Professional Documents
Culture Documents
5.3 GUI+Loop Example
5.3 GUI+Loop Example
graphical display
//SynthDef (making Synth straight away) which has arguments for the loop points
c= SynthDef(\loopbuffer, {arg start=0, end=10000; Out.ar(0,Pan2.ar(BufRd.ar(1, 0,
Phasor.ar(0, BufRateScale.kr(b.bufnum), start, end),0.0)))}).play(s);
//*BufFrames.ir(b.bufnum) //this isn't needed since the GUI gives us positions
directly in samples
f = SoundFile.new;
f.openRead(Platform.resourceDir +/+ "sounds/a11wlk01.wav");
//set a function which is called when the mouse is let go, i.e. just after dragging
out a selection in the window
a.mouseUpAction_({arg view;
var where;