Bug fix in MidiFileIn.cpp for timing with time-code formats.

This commit is contained in:
Gary Scavone
2016-11-02 18:03:25 -04:00
parent 2a6ada02a7
commit 96b1a72186

View File

@@ -79,7 +79,8 @@ MidiFileIn :: MidiFileIn( std::string fileName )
usingTimeCode_ = false;
if ( *data & 0x8000 ) {
// Determine ticks per second from time-code formats.
tickrate = (double) -(*data & 0x7F00);
signed char tmp = -(*data & 0xFF00)>>8;
tickrate = (double) tmp;
// If frames per second value is 29, it really should be 29.97.
if ( tickrate == 29.0 ) tickrate = 29.97;
tickrate *= (*data & 0x00FF);