Buffer Code

8 views
Skip to first unread message

Graham Booth

unread,
Mar 27, 2013, 4:01:53 PM3/27/13
to belfast...@googlegroups.com
// read a whole sound into memory
// note: not *that* columbia, the first one
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav"); // remember to free the buffer later.

(
SynthDef(\help_PlayBuf, {| out = 0, bufnum = 0, start = 0.3, dur = 0.2 |
var env, sample, del;
    Out.ar(out,
env = EnvGen.kr(Env.linen(sustainTime: dur, releaseTime: 0.1), doneAction: 2);
sample = PlayBuf.ar(1, bufnum, 2, startPos: b.numFrames * start);
del = DelayC.ar(sample, 1, 0.2, add: sample);
env * del;
    )
}).play(s, [\out, 0, \bufnum, b]);
)
Reply all
Reply to author
Forward
0 new messages