How can I get descriptions of input and output channels?

When hosting plugins, how can I get descriptions/labels of what each input and output channel is, and whether they’re midi or audio? And not to mention whether a midi channel supports midi 2.0. Thanks.

You can use getBusesLayout() to get the descriptions of the different input and output channels: JUCE: AudioProcessor Class Reference

Not sure about MIDI - the MidiBuffer that’s provided to the processBlock() would be a good place to start, and inspect the MidiMessages it contains.

1 Like

Hmm, I don’t see a function/variable for descriptions exactly, though I see a list of channel types indicating mainly which speaker it is, is there anything more? And that list doesn’t seem to have any accommodation for midi. I’m surprised there’s no direct way to detect if a channel is midi.

As for MidiBuffer, I guess I could use that to detect if an output channel is midi by seeing if it contains any messages after I process a block…but if it’s an input channel, then I’m the one who supplies the data, so I don’t think I can check that way? (And midi is usually input, I’m guessing)

And also I guess after processing a block just to check, I’d have to reset the plugin to its beginning state before I do the real processing?

Yeah, get the AudioChannelSet from the BusesLayout that you’re interested in then you can either use getTypeOfChannel() to get the enum value, or use getDescription() to get a string descriptor.

1 Like