Managing channels with multiple instances of instrument

Hi everyone,

My project has a single instrument based on the mincer opcode, and it’s controlled by a GUI using chnset and chnget. I’d like to have multiple instances of the instrument running at once (i.e. a few different tracks playing different samples through the mincer instrument). However, this results in all the instances trying to communicate over the same chnset and chnget channels. What are the strategies for dealing with this?

I was thinking of compiling separate instances of the instrument for each track and then modifying the channel names for each instance, but before going down that road I wondered if there’s a simpler solution.

Thanks!
Jason

I usually pass a unique ID to each instance of the instrument, and then append that to the channel name. It’s quite simple and fairly robust. Sample code below. I wonder how other people handle this?

schedule(1, 0, 1, 101)

instr 1
SFreqChannel sprintf "freq%d", p4
SAmpChannel sprintf "amp%d", p4
(...)

I do the same myself.

Perfect, thanks guys! I incorporated this into my project this morning, and it works like a charm.