Author Topic: Bassmidi midi file playback using 1x soundfont per midi channel.  (Read 64 times)

titobal

  • Posts: 14
Hello,

is it possible with Bassmidi to play a midi file and use 1x different soundfont per midi channel ?

Let say I have a midifile and it has 4 channels used :
midi channel 2
midi channel 10
midi channel 11
midi channel 16

if it is possible, how to I assign per midi channel a different SF2 soundfont file, I would like to do :
midi channel 2    is played by soundfont1_file.sf2
midi channel 10    is played by soundfont2_file.sf2
midi channel 11    is played by soundfont3_file.sf2
midi channel 16    is played by soundfont4_file.sf2

then I would like to render a wave/audio file of the whole playback in 1  file.

Thanks in advance.



Ian @ un4seen

  • Administrator
  • Posts: 23470
BASSMIDI doesn't currently include the option of assigning soundfonts to specific MIDI channels, but you could perhaps implement that by using a different bank (via MIDI_EVENT_BANK or MIDI_EVENT_BANK_LSB) in each MIDI channel and assigning the soundfonts to those banks in your BASS_MIDI_StreamSetFonts call.

titobal

  • Posts: 14
Thanks Ian but that is not how I need it to work.

I'd like to play midi files as if they were in a kind of "daw" and be able to assign each midi channel a different 'synthbank' for output (from completely different soundfonts files of various files sizes & contents in terms of bank select MSB/LSB too) ...

Would it be possible to parse a midi file in code and send each note/event from a channel to a different audio ouput in bass in that case (without bass midi) ?

Thanks

Ian @ un4seen

  • Administrator
  • Posts: 23470
Yes, if you want, you can use BASSMIDI just for parsing MIDI files. After loading a MIDI file, use BASS_MIDI_StreamGetEvents to get its events.

Btw, are you sure you couldn't use MIDI_EVENT_BANK_LSB to assign soundfonts to specific channels? Note that LSB banks aren't supported by the SF2 format, so using a unique MIDI_EVENT_BANK_LSB value in each channel should ensure there are no conflicts. You can use BASS_MIDI_StreamSetFilter to enforce the bank LSB, in case the MIDI file tries to change it. One issue is that BASSMIDI will fallback to bank 0 if the soundfont doesn't have a requested preset. So you could perhaps leave bank 0 empty, eg. use LSB banks 1-16.

titobal

  • Posts: 14
Thanks Ian.

Regarding the banks, when you use banks, you will reach a different sound/preset inside/within the same/unique soundfont file, bank select won't tell to load a new / another SF2 file.