View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

Plazy/Ppatmod

Plazy can be used by specifying a function that returns a pattern
that is then embedded into the stream. Plazy
a = Plazy({  var array, val;
                        array = [1, 2, 3].scramble;
                        val = array.removeAt(0); //take out the first value and store it in val
                        Pseq([val, val, Pseq(array, rrand(1, 3)), Pshuf([val, \hereiam], 1)])
});

b = Pseq([a], 5).asStream;
60.do({ b.next.postln });



Ppatmod takes the pattern of its input as a whole and applies the
function to it before embedding it into the stream:
(
a = Ppatmod(
                Pseq([1, 2, 3], 1),
                { arg pat, i; 
                        \evaluated.postln;
                        pat.list = Array.fill(i+3, { arg i;  i.squared }); 
                        pat 
                },
                6
        );
b = a.asStream;
30.do({ b.next.postln });
)



Links to this Page