Hi,
Can two different Pspawners understand each other? (not to get philosophical…)
I have ~spawnerA and ~spawnerB
I’d like to do something like (~spawnerA stop).if{~spawnerB stop}{~spawnerB loop}
Because I am exporting them as separate channels later I need them in their own Pspawner.
Assume ~spawnerA is of an indeterminate length.
edit:
I’ve managed to get them to talk to each other by calling isPlaying in a conditional statement but now I have an issue of synchronicity.
~spawnerB will always generate an additional event to check ~spawnerA. I’d like it to be a dead stop, when A is done B executes a stop command.
Is presented below the best solution?
a = Pseq([0.125],1);
(
~spawnerA = Pspawner({
|sp|
1.do{
sp.seq(
Pbind(
\instrument,\whiteNoiseRaw,
\node,0,
\dur, 0.125,
\amp, 0.5,
));
}
}).play;
~spawnerB = Pspawner({
|sp|
loop{
sp.seq(
Pbind(
\instrument,\sineTone,
\freq,500,
\node,2,
\rel,1,
\sus,Pkey(\rel),
\dur,0.125,
\amp,0.5,
\condition, Pfunc{ if(~spawnerA.isPlaying == false, {~spawnerB.stop},{"is playing".postln})},
));
};
}).play;
)
Thanks,
MJ