MultiOutSynth Template with multiple outputs misses 1st channel


#1

Hi!

Sorry, I hope I’m not flooding the forum…

I’m using the MultiOutSynth-example as a template to begin with, and there happens these abnormalities:
If I assign a channel to midinote, anything at all, it will play through the other channels but not the main stereochannel, that I’d assume is the channel 1.

Instead, the channel 1 plays the sound through the second pair of channels that would be channels 3&4.

I imagined that okay, if I assign the midinote to channel 0 it would be 1&2. But it isn’t. It seems to tell the note that it doesn’t belong to any channel. Thus It doesn’t play.

Weird thing is, that if I DON’T assign a channel for midinote, it goes to the main 1&2 as appropriate would be. But what is that behaviour, and what on earth is the 1&2 channels if not 1, 2 or 0???

Another weird thing is that if I want to have multiple mono outputs, and do it by AudioChannelSet::mono(), it sure does the channels, but in dual pairs, and for some reason, say, I want to have 6 mono channels, I need to create 6 pairs of channels thus resulting in 12 channels, where the last 6 are always unused (pr else the plugin crashes if I try to use them)…

Thanks,
Masqutti


#2

Ah I found the culprit.

midimessage.setChannel(int); cannot recieve 0. it needs 1-16. But what’s a bit weird is that if I just leave it undefined(default), it plays in the main channel (0)!

So I’ll just have an if-check to leave all 0-channel notes untouched.

But why is this?


#3

It’s written here: MidiMessage::getChannel()

a value 1 to 16 if the message has a channel, or 0 if it hasn’t (e.g. if it’s a sysex)


#4

Ah thanks!

Should I make a conclusion that “master channel” is always for the notes that doesn’t have any other channel? It feels a bit weird. Is there anything else that’s special for this master channel? :stuck_out_tongue:


#5

There’s no such thing as a “master” or “main” channel, and notes always have a channel, it’s not possible to create a note without giving it a valid channel.


#6

That’s what I thought it should be. :slight_smile:

Okay, is the default channel 0? Since If I gave the note a channel 1, it didn’t go to the first channel but second, There was no way I could get the note to the first channel unless I just didn’t give it a channel… :slight_smile:

I did debug tho, that the notes I didn’t give a channel, returned one with the GetChannel()-method… But If I applied channel 1 to the note, it went to the second…

Gotta check on my code more, it feels impossible. :slight_smile:


#7

There’s also no such thing as a “default” channel.

You supply the channel as an argument when you call noteOn() or however you create the note event. If you’re seeing an unexpected number then it’s because you’ve supplied the wrong value.


#8

Just a note that if you are using MultiOutSynth in Logic: there was a Logic bug in an older version of Logic which would always route the second output bus to the first one. This has been fixed in Logic 10.2.4. After the update you’ll also need to re-scan your plug-ins.