My problem is fairly simple. I have a midi file that has a tempo track and a playing track. When played it only plays back the music at one tempo, which causes it to sound wrong. Is this a known issue? Does it only read from one track?
- Emp asked 11 years ago
There is no known issue concerning MIDI tempo changes at the moment. The tempo information can be on any track, we handle the tempo change event and apply the new timing for the rest of the MIDI file (or until another tempo change comes along).
There indeed may be an issue with this though, if you could post a link to the MIDI file you are having problems with I will check it out for you. Alternatively you can send it to firstname.lastname@example.org.
Thanks for sending the test MIDI, unfortunately I can’t see any problem with the tempo. Admittedly the song does sound like it is the wrong tempo, but playback is the same in FMOD, Windows Media Player and NoteWorthy Composer.
In NoteWorthy composer I can see the tempo changes, they are all very small , i.e. 150 to 151 to 149, etc. I’m not sure how obvious those fluctuations would be to hear anyway.
Just to be sure the tempo code in our MIDI implementation is working I composed a test MIDI which starts at 50bpm then changes to 150bpm, I tried this in both format 0 and format 1 MIDI and it sounded correct.
It appears it is locking the tempo into whole values. To proof this we ran the midi file along with its exported wav file at the same time (in fmod). In version 1 we used whole tempo values and the syncing is exact. However with version 2 we used floating tempo values and the tracks began to separate as the song continued. Please let me know if you can reproduce this on your end (sent via email).
Thanks for the info and the e-mailed test cases. I have gone through the code and found one of our timing calculations for playback speed after a tempo change was being cast to int, causing the final playback speed to be not as accurate as it should.
I noticed drift in both examples you sent to our support email, this makes sense because even if you use floats in your MIDI program of choice, they get converted to 24bit int when stored in the .mid file.
Anyway I have corrected the calculation error and now both of your test sample sets are perfectly in sync. This fix will be in todays release.
Please login first to submit.