Author Topic: Issue with tempo events and BassMidi  (Read 272 times)


  • Posts: 311
Issue with tempo events and BassMidi
« on: 24 Mar '17 - 15:13 »
Hello  ;D

I've spotted a potential bug inside BassMidi: the documentation of the library states that the sync procedure related to the BASS_SYNC_MIDI_EVENT comes with a "data" parameter :
data : LOWORD = event parameter
          HIWORD = channel

when the sync is set for the MIDI_EVENT_TEMPO, the reported tempo seems to be truncated to a WORD but its value can require more than 16 bits, indeed for a bpm of 120, the reported value should be 500000 which cannot be obviously stored inside a 16 bits value.  :o
After a further verification I can see that the reported value is 41248 which is the 500000 value truncated to a WORD value.

I hope this makes sense: any suggestion is welcome.

Kind regards  ;D


Ian @ un4seen

  • Administrator
  • Posts: 21332
Re: Issue with tempo events and BassMidi
« Reply #1 on: 24 Mar '17 - 16:36 »
The event value is indeed currently limited to 16-bit in the SYNCPROC "data" parameter, to make space for the MIDI channel number and event type. A MIDI channel number isn't really needed with a TEMPO event though, so perhaps that space can also be used for the tempo value. I'll look into that. In the meantime, you can use BASS_MIDI_StreamGetEvent in the SYNCPROC to get the full TEMPO event value.