Author Topic: Increase channel limit?  (Read 284 times)

arduano

  • Posts: 1
Increase channel limit?
« on: 27 May '19 - 01:57 »
Hey I'm from the black midi community

I've been talking to Kep, the creator of OmniMIDI about potentially rendering each track of the midis individually without them interfering with each other. When the tracks are merged into one, some notes might cancel out other notes and generally the result doesn't sound good. I was thinking if it's possible to add a "track" value into KDMAPI so that my player doesn't have interfering notes, but it seems like bass only supports up to 128 separate channels.

Is it possible to increase that number in some way? Maybe make it a 32 bit value? A 16 bit value might also be ok as good sounding non-spam midis almost never go above 4096 tracks, making it possible to render a total of 65536 channels in those tracks.
Currently I have to resort to analyzing the midis to find the most noise making channels in tracks and map those to the 128 channels available. It would be really nice if I could play all channels at once though without merging any at all.

Both me and Kep would be able to make great use of that in our programs.

Ian @ un4seen

  • Administrator
  • Posts: 21987
Re: Increase channel limit?
« Reply #1 on: 27 May '19 - 13:24 »
The MIDI channel limit is indeed 128. That limit is per-stream, so if you need more channels, perhaps you could use multiple streams?

KaleidonKep99

  • Posts: 202
Re: Increase channel limit?
« Reply #2 on: 30 May '19 - 10:55 »
The MIDI channel limit is indeed 128. That limit is per-stream, so if you need more channels, perhaps you could use multiple streams?
OmniMIDI, since it's a MIDI driver, creates only one stream, and KDMAPI developers are forced to push everything to that stream alone.
Creating multiple streams would require extensive rework of the driver structure, so I'm not sure if I'll integrate such functionality.

What's the reason behind the 128 channels limit, is it to follow the MIDI standard or is it an architectural limit of BASSMIDI? If it's the former, then adding an opt-in flag "to break it" wouldn't really be a big deal.

Ian @ un4seen

  • Administrator
  • Posts: 21987
Re: Increase channel limit?
« Reply #3 on: 30 May '19 - 12:48 »
BASSMIDI's 128 channel limit is due to the way that it stores events in memory (7 bits are allocated for the channel number). Standard MIDI is actually limited to only 16 channels. That's per-port. Using multiple BASSMIDI streams is basically equivalent to using multiple MIDI ports.