Phenon

Platoo

Plorenz

Pquad

PlinCong

Pstandard

Pgbman

Pfhn




// EVENT PATTERNS - patterns that generate or require event streams


Pbind( arrayOfPatternPairs ) // binds symbols in each event to values obtained from a pattern

Pmono(synthDefName, patternPairs) // pattern pairs define changes in only one synth's control

Ppar(arrayOfPatterns, repeats) // play in parallel

Ptpar(arrayOfTimePatternPairs, repeats) // play in parallel at different times

Pbindf( pattern, arrayOfNamePatternPairs )

Pfset(function, pattern)  // function constructs an event that is passed to the pattern.asStream

Pset(name, valPattern, pattern)  // set one field of the event on an event by event basis (Pmul, Padd are similar)

Pmul(name, valPattern, pattern)  

Padd(name, valPattern, pattern)  

Psetp(name, valPattern, pattern) // set once for each iteration of the pattern (Pmulp, Paddp are similar)

Pmulp(name, valPattern, pattern) 

Paddp(name, valPattern, pattern) 

Psetpre(name, valPattern, pattern) // set before passing the event to the pattern (Pmulpre, Paddpre are similar)

Pmulpre(name, valPattern, pattern) 

Paddpre(name, valPattern, pattern) 


Pkey( key ) // simplifies backward access to values in an event being processed by Pbind or another event pattern

Pstretch(valPattern, pattern) // stretches durations after 

Pstretchp(valPattern, pattern) // stretches durations after 

Pfindur( duration, pattern ) // embeds elements of the pattern into the stream until the duration comes close enough to dur

PfadeIn(  pattern, fadeTime, holdTime, tolerance )

PfadeOut(  pattern, fadeTime, holdTime, tolerance )

 

Psync( pattern, quantization, dur, tolerance ) // played for dur seconds (within tolerance), then a rest is played so the next pattern

Plag(duration, pattern)


Pstep(levelpattern, durpattern, curvepattern)  // good for representing chord progressions, scale progressions etc.

Pseg(levelpattern, durpattern, curvepattern)   // defines a function of time as a breakpoint envelope 

Pplayer(playerPattern, subPattern)


Pfx(pattern, fxname, name, value, name, value ...)  

// Puts an effect node on the tail of the current group and releases it when the contained pattern finishes

Pgroup(pattern) // starts a new group and plays the pattern in this group

Pbus(pattern, dur, fadeTime, numChannles, rate) // starts a new group and plays the pattern in this group, on a private bus. 

Pgpar(arrayOfPatterns, repeats) // embed event streams in parallel and put each in its own group

Pgtpar(arrayOfPatterns, repeats) 


PlazyEnvirN(func) // evaluates a function that returns a pattern and embeds it in a stream

Pevent(pattern, event)

// GENERAL PATTERNS that work with both event and value streams


Ptrace(pattern, key, printStream)  // print the contents of a pattern

Pprotect(pattern, func) // if an error is thrown in the stream func is evaluated

Pseed(seed, pattern) // set the seed of the random number generator to force repetion

Proutine(function) 

Pfunc(function) // the function should not have calls to embedInStream, use Proutine instead.

Plazy(func) // evaluates a function that returns a pattern and embeds it in a stream.

PlazyEnvir(func) // the function is evaluated using the environment passed in by the stream

Penvir(envir, pattern, independent) // use an environment when embedding the pattern in a stream


Pfsm(list, repeats) // finite state machine

Pdfsm(list, startState, repeats) // deterministic finite state machine

Pfsm2(markovset, repeats) // markov pattern

Pspy(markovset, pattern,repeats) // markov pattern

Ptur(list, startState, startIndex, memory, repeats)  // turing machine


Pboolnet(list, repeats, loops) // boolean network 

Pdict(dict, keyPatterm, repeats, default) // embeds patterns from a dictionary


Ppatmod(pattern, function, repeats) // function receives the current pattern as an argument 

// and returns the next pattern to be played

Peventmod(function, event, repeats) 

Pconst(sum, pattern, tolerance) // constrain the sum of a value pattern 


Pchain(pattern1, pattern2, ... patternN) // pass values from stream to stream

// the following patterns control the sequencing and repetition of other patterns

Pseq(arrayOfPatterns, repeats) // play as a sequence

Pser(arrayOfPatterns, num) // play num patterns from the arrayOfPatterns

Place(arrayOfPatterns, repeats) // similar to Pseq, but array elements that are themselves arrays are iterated 

// embedding the first element on the first repetition, second on the second, etc


Ppatlace(arrayOfPatterns, repeats) // similar to Place, but the list is an array of Patterns or Streams


Pindex(listPat, indexPat, repeats) 

Pif( condition, iftrue, iffalse, default ) // Pattern-based conditional expression

Pn( pattern, patternRepetitions ) // repeat the pattern n times

Pfin( eventcount, pattern ) // play n events from the pattern

Pstutter( eventRepetitions, pattern ) // repeat each event from the pattern n times

Pclutch( pattern, connected ) // sample and hold pattern

PdurStutter( eventRepetitions, pattern ) // designed for a stream of float durations

Pwhile(function, pattern) // while a condition holds,  repeatedly embed  stream

Pswitch( patternList, selectPattern ) // when a pattern ends, switch according to select

Pswitch1( patternList, selectPattern ) // on each event switch according to select

Pmswitch( markovset, which, repeats ) // uses a pattern of indices to walk through a markov dict

Prand( patternList, repeats ) //  random selection from list

Pxrand( patternList, repeats ) //  random selection from list without repeats

Pwrand( patternList, weights, repeats ) // weighted random selection from list

Pwalk( patternList, stepPattern, directionPattern ) // walk through a list of patterns

Pslide(list, repeats, length, step, start)

Pshuf( patternList, repeats ) // iterates over the list in scrambled order, the entire scrambled list is repeated

Ptuple(list, repeats) // at each iteration returns a tuple (array) combining the output of each of the patterns in the list


Pdrop(count, pattern)

Pclump(n, pattern)

Pflatten(n, pattern)

Pdiff(pattern)

Prorate(proportion, pattern) // divide stream proportionally

Pavaroh(pattern, aroh, avaroh, stepsPerOctave) // basic classical indian scale pattern


// the following patterns can alter the values returned by other patterns

Pcollect(function, pattern) // modifies each value by passing it to the function

Pselect(function, pattern) // returns values for which the function returns true. the value is passed to the function

Preject(function, pattern) // rejects values for which the function returns true. the value is passed to the function



// VALUE PATTERNS: these patterns define or act on streams of numbers


// Env as a pattern

Pbindf(Pn(q,inf),\ctranspose, Pn(Env.linen(3,0,0.3,20),inf) ).play;


Penv(levels, times, curve, releaseNode, loopNode)

Pwhite(lo, hi, length) // random values with uniform distribution

Pbrown(lo, hi, step, length) // brownian motion pattern

Pexprand(lo, hi, length) // random values that follow a Exponential Distribution

Plprand(lo,hi, length) // random values that tend toward lo

Phprand(lo,hi, length) // random values that tend toward hi

Pmeanrand(lo,hi, length) // random values that tend toward ((lo + hi) / 2) 

Pbeta(lo,hi, prob1, prob2, length) // random values that follow a Eularian Beta Distribution

Pcauchy(mean, spread, length) // random values that follow a Cauchy Distribution

Pgauss(mean, dev, length) // random values that follow a Gaussian Distribution

Ppoisson(mean, length) // random values that follow a Poisson Distribution (positive integer values)

Pprob(distribution, lo, hi, length, tableSize) // random values with arbitrary probability distribution

Pseries(start,step, length)

Pgeom(start,step, length)

Pwrap(pattern,lo, hi)

PdegreeToKey(pattern, scale, stepsPerOctave) // this reimplements part of pitchEvent (see Event)

Prewrite(pattern, dict, levels)  // Lindenmayer system pattern for selfsimilar structures

PdurStutter( repetitionPattern, patternOfDurations ) // filter pattern designed for a stream of float durations

// subdivides each duration by each stutter and yields that value stutter times

Pstep2add( pat1, pat2 )  // combine multiple patterns with depth first traversal

Pstep3add( pat1, pat2, pat3 )  

PstepNadd(pat1,pat2,...) //  pattern that returns combinatoric sums

PstepNfunc(function, patternArray )


Phid(element, locID, repeats) // pattern that polls values from a human device interface


Ptime(repeats) // returns time in beats from moment of embedding in stream



// PATTERN PROXIES: these patterns keep a reference to a stream that can be replaced while playing


Pdefn( key, pattern )  // value-stream reference definition, keeps a reference to a task that can be replaced while playing


Pdef( key, pattern )  // stream reference definition, keeps a reference to a stream that can be replaced while playing


Tdef( key, obj )  // task reference definition, keeps a reference to a task (time pattern) that can be replaced while playing


Pbindef( key, paramKey1, pattern1 )  // incremental event pattern reference definition, keeps a reference to Pbind


Psym( pattern, dict )  // use a pattern of symbols to embed Pdefs

Pnsym( pattern, dict )  // for non-event patterns


PatternProxy( pattern )  // keeps a reference to a stream that can be replaced while playing

// Multiple streams are thus handled without creating dependancies

TaskProxy( function )  // Keeps a reference to a task (time pattern) that can be replaced while playing

// It plays on when the old stream ended and a new stream is set and schedules the changes to the beat


PbindProxy( key1, pattern1, key2, pattern2, ... )  // keeps a reference to a Pbind in which single keys can be replaced

// It plays on when the old stream ended and a new stream is set and schedules the changes to the beat

EventPatternProxy( pattern )  // keeps a reference to a stream that can be replaced while playing.

// Multiple streams are thus handled without creating dependancies