Author Topic: Recover track number in MIDI SYNCPROC  (Read 76 times)

gicci

  • Posts: 84
Recover track number in MIDI SYNCPROC
« on: 20 May '22 - 11:12 »
Hi,

is there any way to recover, in a SYNCPROC attached to BASS_SYNC_MIDI_EVENTs, not only the MIDI channel on which the event is sent but also the MIDI track that generated it?

Thank you.

Ian @ un4seen

  • Administrator
  • Posts: 24424
Re: Recover track number in MIDI SYNCPROC
« Reply #1 on: 20 May '22 - 14:40 »
No, I'm afraid there isn't a simple way to reliably get the track number in a SYNCPROC. If each MIDI channel has its own track then you could use BASS_MIDI_StreamGetEvents beforehand to find out which track each channel is in, and use that info in the SYNCPROC. Another option is to use a MIDIFILTERPROC (via BASS_MIDI_StreamSetFilter) instead of a SYNCPROC (via BASS_ChannelSetSync).