GrandOrgue / grandorgue

GrandOrgue software
Other
166 stars 40 forks source link

Respect tempo changes in loaded MIDI #1753

Closed khenisey closed 5 months ago

khenisey commented 9 months ago

When loading a MIDI for play back in GO, it seems like GO plays using the last tempo meta-event occurring in the file. I believe the intended implementation of "set tempo" system meta event (type 0x51) sent after some delay is to change the milliseconds per timing pulse (where the pulses per quarter note are defined in the MIDI header's division bytes) for pulses that occur only after the tempo event.

For example, the MIDI file encoded below (in base64) plays two measures starting at 240bpm and changing to 120bpm at the beginning of the second measure. Windows Media Player plays this file correctly. GO, on the other hand, plays the eight pitches at the same tempo, specifically, the last tempo encountered in the first track (120bpm).

Base64 encoded example tempo change MIDI:

TVRoZAAAAAYAAQACAWhNVHJrAAAAEwD/UQMD0JCLIP9RAwehIAH/LwBNVHJrAAAATACRPH+CaIE8fwCRPn+CaIE+fwCRQH+CaIFAfwCRQX+CaIFBfwCRQ3+CaIFDfwCRRX+CaIFFfwCRR3+CaIFHfwCRSH+CaIFIfwH/LwA=
oleg68 commented 5 months ago

@khenisey What grandorgue version have you tried with?

The recent GO (3.14.0-1) plays this midi file correctly: the first four pitches at 240bpm and the second four pitches at 120bpm.

Seems you have experienced the problem mentioned in #1225, but it was fixed in GrandOrgue 3.9.0.

oleg68 commented 5 months ago

Already fixed with #1232