UGenPatterns Overview


library of patterns acting as ugens


The main idea behind the ugenpatterns quark is to take advantage of the interface we've already learned by using the normal audio ugens. It simplifies things like lfo modulation on a stream of numbers. No need to do the math - just reuse the knowledge you have about how for example SinOsc works.


generators:


PClipNoise

PDC

PExpRand

PFSinOsc

PImpulse

PIRand

PLFPulse

PLFSaw

PLFTri

PLine

PMouseX

PMouseY

PMouseButton

PPulse

PRand

PSaw

PSilent

PSinOsc

PWhiteNoise

PXLine


modifiers:


PBPZ2

PBRZ2

PClip

PCombN

PDelay1

PDelay2

PDelayN

PFold

PGate

PHPZ1

PHPZ2

PInRange

PInRect

PIntegrator

PLastValue

PLatch

PLinExp

PLinLin

PLPZ1

PLPZ2

POnePole

POneZero

PPeak

PPulseCount

PRunningMax

PRunningMin

PSchmidt

PToggleFF

PTrig

PTrig1

PTDelay

PWrap



//--examples


s.boot


//slow variation (+/- 10hz) on switching frequencies

a= Pbind(\freq, PLFPulse(8).linlin(0, 1, 400, 800)+PSinOsc(40).linlin(-1, 1, -10, 10), \dur, 0.25).play

a.stop


//or the same thing without using linlin

a= Pbind(\freq, PLFPulse(8, 0, 0.5, 400, 400)+PSinOsc(40, 0, 10), \dur, 0.25).play

a.stop



//--comparison


//the equivalent without this ugenpatterns quark would be something like this... (only standard patterns)

a= Pbind(\dur, 0.25, \freq, Pn(Pstutter(4, Pseq([800, 400])))+(sin(Ptime()/Pkey(\dur)*2pi*(1/40))*10).trace).play

a.stop



//and the equivalent (well, roughly) synth as well... (compare how time is handled differently in the original examples above)

(

a= {

var dur= 0.25;

var env= Decay2.ar(Impulse.ar(1/dur), 0.01, 0.5);

SinOsc.ar(LFPulse.kr(1/(8*dur), 0, 0.5, 400, 400)+SinOsc.ar(1/(40*dur), 0, 10))*env;

}.play

)

a.free



//--nesting


//here a PSinOsc is modulating the amount of lfo

a= Pbind(\freq, PLFPulse(8, 0, 0.5, 400, 400)+PSinOsc(40, 0, PSinOsc(30, 0, 100)), \dur, 0.25).play

a.stop



//--binary ops


//here duration is controlled by two 'ring modulated' sinosc patterns

a= Pbind(\freq, PLFPulse(8, 0, 0.5, 400, 400)+PSinOsc(40, 0, 10), \dur, PSinOsc(50, 0, 0.2, 0.25)*PSinOsc(20, 0, 0.2, 0.5), \legato, Pkey(\dur)).play

a.stop