Is there a way to use a SynthesiserSound that applies to all channels?


#1

I have one Synthesiser that I route all my midi to. I have several SynthesiserVoice but only one SynthesiserSound that I want played on all channels. 

Since SynthesiserVoice doesn't keep track of what channel it's playing on, if I get a channel 1 note on and a channel 2 note off for the same note number, the same voice will start and stop.

I can make 16 copies of the same SynthesiserSound and set them all to a different channel, but that seems wasteful. Is that the expected way to do what I want?


#2

I can make 16 copies of the same SynthesiserSound and set them all to a different channel, but that seems wasteful. Is that the expected way to do what I want?

Yes, that's probably the cleanest thing to do. It's only wasteful if the class is large, but there's no reason why a SynthesiserVoice object needs to be any more than a placeholder that points to some shared data.


#3

Ok, thx. That's what I ended up doing.