colinfwren / midi-to-lsdj

Convert a MIDI file into LSDJ project
GNU Affero General Public License v3.0
5 stars 0 forks source link

Add support for tempo changes #13

Closed colinfwren closed 1 year ago

colinfwren commented 1 year ago

While the setTempo events are collected in getTrackEvents these are not currently plotted out. In order to create an accurate transcription there should be commands on the notes to trigger the tempo change.

As per the LSDJ Manual

4.16 T: Tempo
Changes the tick rate to match the given beats per minute (BPM) value. The
BPM is accurate only if the active groove has 6 ticks per note step. If the groove
has some other number of ticks per note step, the BPM value should be adjusted
according to the formula lsdj bpm = (desired bpm × ticks per step)/6. T28-TFF
selects 40-255 BPM, T00-T27 selects 256-295 BPM.
Example:
T80 set tempo to 128 BPM
TFF set tempo to 255 BPM
T27 set tempo to 295 BPM