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

Puse

this class can be used to access the current event
inside a Pbind to create more complex modifications.
it is maybe avoidable.
(
#{
	var pat;
	pat = Pbind(
			\ugenFunc, { arg freq, sustain, amp=0.2;
						SinOsc.ar(freq)*Line.kr(amp, 0, sustain)
			},
			\legato, Pseq([0.1, 0.1, Prand([0.5, 0.1], 2)], inf),
			\freq, 
				Pseq([
					Puse({ 
						if(0.8.coin, { ~legato = rrand(4, 2.9) });
						~legato * 500 + 300
					}, 16),
					Pshuf([1300, 1400, 1500], 4),
				], inf),
			\dur, Pshuf([0.2, 0.6, 0.4,  0.1]/2, 2)
			);
	{ Pseq([pat], inf).ar(2) }.play;
}.send;
)





//Julian Rohrhuber 1/2001
Puse : Pattern {
	var <>func, <>repeats;
	*new { arg func, repeats = 1;
		^super.newCopyArgs(func, repeats)
	}
	asStream { 
		^Routine.new({ arg inval;
			repeats.value.do({
				inval.use(func).yield
			})
		})
	}
}


Links to this Page