-
Pif: Filter: Class methods new Inherited class methods Instance methods Inherited instance methods Undocumented instance methods asStream condition default iffalse iftrue Examples Classes | Streams-Patterns-Events > Patterns'>Patterns > Pat ...
-
... pattern is to stop a value stream/pattern after a certain amount of time. This Pif pattern uses Ptime to get values from the true branch for exactly 4 beats after the first value is requested. After that, the condition will be false and Pi ...
-
... trol methods Some patterns mimic language-style control methods: conditionals ( Pif ), loops ( Pwhile ) and error cleanup ( Pprotect ). Pif(condition, iftrue, iffalse, default) Evaluates a pattern condition that returns true or false. Then, ...
-
... s/ another value, // be sure to use |==| p = Pbind( \a, Pseries(1, 1, inf), \b, Pif( Pkey(\a) == 2, "equals 2", "nope" ) ).asStream; p.next(()); // 'b' is always "nope" p = Pbind( \a, Pseries(1, 1, inf), \b, Pif( Pkey(\a) |==| 2, "equals 2" ...
-
... \kik, \preamp, 0.4, \dur, 0.25, *(~pbindPairs.value(#[amp, decay2])) ), \freq, Pif(Pkey(\amp) > 0, 1, \rest) ) }), inf)).play(quant: 4); ⧉ ✔ Penvir(~kikEnvir, ...) Tell the enclosed pattern to run inside the kick drum's environment. Pn(... ...
-
... uage Control Some patterns mimic language-style control methods: conditionals ( Pif ), loops ( Pwhile ) and error cleanup ( Pprotect ). Pif(condition, iftrue, iffalse, default) Evaluates a pattern condition that returns true or false. Then, ...
-
... g the name to look up the pattern for each event. Related: Conditional patterns Pif supports this kind of structure: If the next value from a Boolean pattern is true, return the next item from pattern A, otherwise take it from pattern B. An ...
-
... om James Harkins' "A Practical Guide to Patterns": s.boot p = Pbind( \midinote, Pif(Pwhite(0.0, 1.0, inf) < 0.7, Pwhite(60, 80.5, inf), Pwhite(45, 55.5, inf)), \dur, Prand([0.125, 0.25, 0.5], inf) ); p.play ⧉ ✔ Add the next 40 Events in our ...
-
... ods . asEvent Examples Using Rest instances in a pitch stream ( Pbind( \degree, Pif( 0.1.loop.coin, Pseq([Rest(), 7], inf), // every second is a Rest Pseries(0, 1, inf).fold(-7, 7) ), \dur, 0.125 ).play ) ⧉ ✔ Using a Rest instance in a dura ...
-
... (see Pattern Guide 06e: Language Control for an explanation of the conditional Pif ): ( // first, pitches ascending by 1-3 semitones, until 2 octaves are reached var pitches = Pseries(0, Pconst(24, Pwhite(1, 3, inf)), inf).asStream.all, // ...