Groups | Search | Server Info | Login | Register
Groups > comp.sys.atari.st.tech > #9
| From | nokturnal <nokturnal@nokturnal.pl> |
|---|---|
| Newsgroups | comp.sys.atari.st.tech |
| Subject | midi files replay(tempo) |
| Date | 2012-05-07 11:08 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <5aad2c30-2919-4ba6-8d4a-85b808201b5f@y3g2000vbn.googlegroups.com> (permalink) |
Hello, I'm writing midi replay for Atari ST (and compatible) and I've stuck with setting proper tempo handling. Anyone has managed to translate midi delta times to proper mfp freqency? I wrote midi 0,1,2 parser and put all the data in custom structure. And I track midi ticks for each midi track (in timer b interrupt) and send events at proper delta relative to previous events (I write directly to midi port without bios and put all the events collected from all tracks in buffer to send all the data at once ), but I don't know if it is good enough. My tempo calculation is wrong, the files are replayed too slowly. To calculate tempo I get PPQN from midi file, quaternote duration (500 000 by default and I am handling set tempo event) and use this (for sure there is something wrong with it): float freq=quaternote duration/1000000.0f; freq=freq/PPQN //calculate freq in [hz] freq=1.0f/freq; After that I pass freq to function which translates frequency to MFP data and mode (it's ok for sure). Any thoughts on this topic? Is there other way for replaying midi files? Regards, Pawel Goralski nokturnal@nokturnal.pl
Back to comp.sys.atari.st.tech | Previous | Next | Find similar
midi files replay(tempo) nokturnal <nokturnal@nokturnal.pl> - 2012-05-07 11:08 -0700
csiph-web