m0j0hn / editor-on-fire

Automatically exported from code.google.com/p/editor-on-fire
Other
0 stars 0 forks source link

MIDI import skews notes if there is a mid-beat tempo change #228

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As reported here:
http://www.fretsonfire.net/forums/viewtopic.php?f=6&t=50172&p=573156#p573153

EOF was not designed with mid-beat tempo changes in mind, so this causes some 
problems.  Perhaps it would be a good idea to manipulate the tempo map so that 
tempo changes are forced to be on beat markers, similarly to how Feedback 
import handles this problem.

A test chart is here:
http://www.sendspace.com/file/wv7p57

I included a debug print out of the MIDI events, realtimes, dela times, etc. 
from FoFLC, since the note times FoFLC reports are not affected by this issue 
and match timings given by Reaper.  The problematic tempo change is at absolute 
delta time 7920, placing it 16.5 beats into the MIDI.  The suggested solution 
would place an anchor at the beat just before the tempo change and an anchor at 
the tempo change.  This way, all beat timings will be correct.

Original issue reported on code.google.com by raynebc on 15 Jan 2011 at 3:06

GoogleCodeExporter commented 9 years ago
Mid-beat time signature changes would probably need to be handled as well.

Original comment by raynebc on 15 Jan 2011 at 5:42

GoogleCodeExporter commented 9 years ago
During the tempo map creation, if the tempo changes between beat X and the next 
full beat (Y), then make X an anchor.  The realtime position of Y can be found 
with eof_ConvertToRealTime(), which should find the correct realtime since it 
does not take beats into account.  Then the difference in the time position of 
the two anchors can be used to set the tempo on beat X.  Beat Y's tempo will be 
set by the original mid-beat tempo change, as beat Y will now be at the 
position of that tempo change.  This solution doesn't exactly insert a beat 
marker, but it uses beat X to compensate.

Original comment by raynebc on 15 Jan 2011 at 6:14

GoogleCodeExporter commented 9 years ago
Fixed in r686.

Original comment by raynebc on 15 Jan 2011 at 7:55