Sequence busses to send triggers

Im using a modular kind of set up with proxyspace. I have several kind of instruments like, ~snare, ~kick, ~cymbal etc. and i also have some sequencers that send out triggers. Right now i have to use a new sequencer for each new instrument and pair them like this. ~sequencer_1 <>>.trig ~snare, ~sequencer_2 <>>.trig ~kick, etc. But what i really want is to have just one sequencer for all instruments. A sequencer for which you can decide for each trigger to which instrument its being sent.
I was trying to do this by using an Out ugen and a demand ugen to sequence a bunch of busses for the Out ugen to send triggers over.

Something like this:

//this for example is supposed to alternate some pattern over
//the snare, kick and cymbal
//however it just plays all the instruments simultaneously for every trigger
p = ProxySpace.push;
~sequencer        = { TDuty.kr( Dseq([/*some pattern*/], inf)) };
~trigBusSequencer = { Out.kr( Demand.kr(\trig.kr(0), 0, Dseq([~snareBus, ~kickBus, ~cymbalBus], inf)), \trig.kr(0)) };
~snare            = { var trig = In.kr(~snareBus, 1); /*make sound*/ };
~kick             = { var trig = In.kr(~kickBus, 1); /*make sound*/ };
~cymbal           = { var trig = In.kr(~cymbalBus, 1); /*make sound*/ };

~sequencer <>>.trig ~trigBusSequencer;

~snare.play;
~kick.play;
~cymbal.play;
~trigBusSequencer.play;

I also tried something like this:

p = ProxySpace.push;
~sequencer        = { TDuty.kr( Dseq([/*some pattern*/], inf)) };
~trigBusSequencer = { Out.kr( Demand.kr(\trig.kr(0), 0, Dseq([~snareBus, ~kickBus, ~cymbalBus], inf)), \trig.kr(0)) };
~snare            = { var trig = \trig.kr(0); /*make sound*/ };
~kick             = { var trig = \trig.kr(0); /*make sound*/ };
~cymbal           = { var trig = \trig.kr(0); /*make sound*/ };

~sequencer <>>.trig ~trigBusSequencer;
~snare.map(\trig, ~snareBus);
~kick.map(\trig, ~kickBus);
~cymbal.map(\trig, ~cymbalBus);

~snare.play;
~kick.play;
~cymbal.play;
~trigBusSequencer.play;

However this doesnt work either. For both methods i dont know why it doesnt work.
Whats the best way to do this?

p = ProxySpace.push;
~sequencer        = { TDuty.kr( Dseq([/*some pattern*/], inf)) };
~trigBusSequencer = { Out.kr( Demand.kr(\trig.kr(0), 0, Dseq([\busses.kr(0!3)], inf)), \trig.kr(0)) };
~snare            = { var trig = \trig.kr(0); /*make sound*/ };
~kick             = { var trig = \trig.kr(0); /*make sound*/ };
~cymbal           = { var trig = \trig.kr(0); /*make sound*/ };


~sequencer.set(\busses, [~snareBus.index, ~kickBus.index, ~cymbalBus.index]);
~trigBusSequencer.play;
~snare.play;
~kick.play;
~cymbal.play;

~sequencer <>>.trig ~trigBusSequencer;
~snare.map(\trig, ~snareBus);
~kick.map(\trig, ~kickBus);
~cymbal.map(\trig, ~cymbalBus);

It works when you use .index . Without .index it doesnt seem to work.

1 Like