Sorry for the late reply. Been sick. Thanks to all of you trying to sort this out. @bovil43810 is right about my misinterpretation of the classic technique. I think this is the clearest showcase of the technique
with @jamshark70 suggestion it sounds something like this in SC:
(
~noteSource = Pbind(
\instrument,\default,
\midinote, Pseq([33,40, 45], inf),
).asStream; // 'asStream' is important!
)
// step sequencer trigger
(
Pdef(\part, Pbind(
\switch, Pseq([0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0], inf),
\dur, 0.125,
).collect { |ev|
if(ev[\switch] > 0) {
ev = ~noteSource.next(ev);
} {
ev.put(\type, \rest)
};
ev}
).play;
)
I guess the actual sound is comming from the ~noteSource Pbind… a quess it is also here I specify my \out argument? When I try updating the ~noteSource Pbind value it doesn’t seem to pile up in the NodeTree which Is strange considering it is is a Pbind and not a Pdef.
Regarding my original question I have no better way of explaining it by showing it like this.
I am trying to force myself to work in the syntax Pdefs and not sure how to apply Pspawn in this context…
(
~c = TempoClock.new(120/60).permanent_(true);
~c.tempo_(120/4/60);
);
(
Pdef(\part,
Ppar([
//pattern that triggers
Pbind(
\instrument, \default,
\degree, 1,
\legato,0.02,
\sus,0.002,
\octave, 3,
\dur, Pseq([1/8,1/2,Rest(1/8),Rest(1/8),1/8],inf),
\amp,0.05,
).collect({ |ev|
~kickEvent = ev}),
Pbind(
// pattern that listens
\instrument, \default,
\ghoast, Pif(Pfunc({~kickEvent[\dur]== (1/8)}),Pn(1,inf,\trigny),1),
\degree,Pgate(Pseq([1,5,7,9
],1),inf,\trigny),
\octave,5,
\timingOffset, Pseq([0,Pwhite(0.003,0.006,inf)],inf),
\dur, 1/16,
\sus,0.1,
\amp,0.01,
)
],inf)
).play(~c);
)
But as I’ve pointed out earlier the Pgate keeps on playing the same note in the sequence before it gets the next 1/8, then moving on to the next note in the pattern.
I rather want it to cycle through the Pseq’s 1,5,7,9 for as long as it takes before the next 1/8, and only then make i start from the begining of the sequence 1,5, etc , whichever the step in the pattern is currently on. Sorry can’t explain it better. Hope it helps