Hello everyone,
I’m trying to use a simple Pseq((0…5),inf).asStream.next ,because I would love to receive back the values 0,1,2,3,4,5 over and over inside a Pfunc with a case structure, but I receive only zeros.
How to keep the pseq counting correctly?
I found this solution, but … it’s ugly.
I would love to use the list patterns without limitations.
~o = 0;
(
Pbindef(\ampAnalysis,
\instrument, \DcOuts,
\amp, Pseq(~amp,inf), // my ~amp array
\bus,
Pfunc { |d|
case
{ d[\amp] > 0.9 }{ (0..5) }
{ d[\amp] < 0.5 }{ ~o = ((~o + 1)%6); } // THIS IS MY UGLY SOLUTION
{ d[\amp] > 0.5 && d[\amp] < 0.9 }{ Prand([0,1,2,3,4,5],inf).asStream.next; } // works
}
).play;
)
or in this way …
~o = 0;
(
Pbindef(\ampAnalysis,
\instrument, \DcOuts,
\amp, Pseq(~amp,inf), // my ~amp array
\bus,
Pfunc { |d|
case
{ d[\amp] > 0.9 }{ (0..5) }
{ d[\amp] < 0.5 }{ ~o = ((~o + 1)%6); // A kind of solution..
Pseq([0,1,2,3,4,5]., inf,~o).asStream.next.postln;}
{ d[\amp] > 0.5 && d[\amp] < 0.9 }{ Prand([0,1,2,3,4,5],inf).asStream.next; } // works
}
).play;
)
Do you think it’s possible ?
Thank you very much for all the help!