Author Topic: Bassmidi speaker assigment to Midi channels/ports  (Read 127 times)

Falcosoft

  • Posts: 114
Hi Ian,
I know this could be done with separated Midi streams but I wonder how hard would be to implement the ability to set different speaker assignment flags on different Midi channels or ports of the same stream (e.g. ch1-16 on front speakers ch17-32 on rear speakers).
Thanks in advance! 

@Edit: some 32-channel Midi files can sound surprisingly good with such a setup
(below is a 4-channel ogg file rendered with SC-VA. Channels 1-16 are assigned to front speakers and channels 17-32 to rear speakers). :
https://falcosoft.hu/kikan_4ch.ogg

Original Midi file:

« Last Edit: 12 May '22 - 09:42 by Falcosoft »

Ian @ un4seen

  • Administrator
  • Posts: 24424
Re: Bassmidi speaker assigment to Midi channels/ports
« Reply #1 on: 12 May '22 - 15:29 »
All of BASSMIDI's processing is currently limited to stereo, so it wouldn't be a simple addition, but not impossible either. If it was to be implemented, it would probably be by producing multiple stereo outputs that get combined at the end for multi-channel output, but custom processing via BASS_MIDI_StreamGetChannel would probably be impossible then (as there would be multiple streams for each channel/effect). I'll look into it before the next BASSMIDI release, but that could be a little while from now, as the last release only just happened.

In the meantime, you could indeed implement it by creating multiple streams and muting different MIDI channels (via MIDI_EVENT_MIXLEVEL) in each. If you link the streams via BASS_ChannelSetLink then they should start playing in perfect sync. Or you could use a BASSmix mixer to combine them, or even a simple STREAMPROC (that fetches and combines the data from both).

Falcosoft

  • Posts: 114
Re: Bassmidi speaker assigment to Midi channels/ports
« Reply #2 on: 12 May '22 - 23:32 »
All of BASSMIDI's processing is currently limited to stereo, so it wouldn't be a simple addition, but not impossible either. If it was to be implemented, it would probably be by producing multiple stereo outputs that get combined at the end for multi-channel output, but custom processing via BASS_MIDI_StreamGetChannel would probably be impossible then (as there would be multiple streams for each channel/effect). I'll look into it before the next BASSMIDI release, but that could be a little while from now, as the last release only just happened.

In the meantime, you could indeed implement it by creating multiple streams and muting different MIDI channels (via MIDI_EVENT_MIXLEVEL) in each. If you link the streams via BASS_ChannelSetLink then they should start playing in perfect sync. Or you could use a BASSmix mixer to combine them, or even a simple STREAMPROC (that fetches and combines the data from both).
1. OK, it's not that important at all so I can wait.
2. I think in my case it could be done even simpler way. Currently I have a single 64-channel real-time Midi stream that is already multi-port aware. Currently I send Midi data to stream this way:
Code: [Select]
BASS_MIDI_StreamEvents(MidiStream, BASS_MIDI_EVENTS_FILTER or BASS_MIDI_EVENTS_RAW + (Channel + ((MidiPort and 3) shl 4)) + 1, @status, 3)Instead of this single stream I should quadruplicate the count of my real-time streams and create them as four 16-channel streams.
Then I can assign them to different speakers and send them data even a simpler way:
Code: [Select]
Case MidiPort of
1: BASS_MIDI_StreamEvents(MidiStream1, BASS_MIDI_EVENTS_FILTER or BASS_MIDI_EVENTS_RAW, @status, 3);
2: BASS_MIDI_StreamEvents(MidiStream2, BASS_MIDI_EVENTS_FILTER or BASS_MIDI_EVENTS_RAW, @status, 3);
3: BASS_MIDI_StreamEvents(MidiStream3, BASS_MIDI_EVENTS_FILTER or BASS_MIDI_EVENTS_RAW, @status, 3);
4: BASS_MIDI_StreamEvents(MidiStream4, BASS_MIDI_EVENTS_FILTER or BASS_MIDI_EVENTS_RAW, @status, 3);
end;
Of course the routing should be done also in case of SysEx messages and 2-byte messages and so on. But this way I think I should not bother with linking the streams or synchronizing them.
« Last Edit: 12 May '22 - 23:39 by Falcosoft »