2 summary:: use a pattern of symbols to embed Pdefns
3 categories:: Libraries>JITLib>Patterns
4 related:: Classes/Pdefn
7 for event patterns see link::Classes/Psym::. Overview: link::Overviews/JITLib::.
14 a pattern that returns symbols or characters. Arrays are converted to parallel patterns ( link::Classes/Ptuple:: ).
17 the dictionary to be used for lookup. By default, this is code::Pdefn.all::, so one can embed Pdefns by name.
22 set the dictionary to be used.
31 { arg out=0, freq=440, sustain=0.05, amp=0.1, pan;
33 env = EnvGen.kr(Env.perc(0.01, sustain), doneAction:2) * amp;
34 Out.ar(out, Pan2.ar(SinOsc.ar(freq, 0, env), pan))
39 Pdefn(\y, Prand([5, 9, 1], 2));
40 Pdefn(\z, Pdefn(\y) * 2);
46 \harmonic, Pnsym(Pseq([\x, \x, Prand([\x, \y]), [\z, \y], \y], inf)).trace,
52 // change root pattern:
54 Pdefn(\x, Pseq([1, 3, 1, 2, 1, 4, 5]));
55 Pdefn(\x, Pseq([1, 3, 1, 2, [1, 3], 4, 5]));