Skip to content

Instantly share code, notes, and snippets.

@rumblesan
Last active January 27, 2018 23:49
Show Gist options
  • Save rumblesan/7a538e1b23bab45544472d72648d1dca to your computer and use it in GitHub Desktop.
Save rumblesan/7a538e1b23bab45544472d72648d1dca to your computer and use it in GitHub Desktop.
s = Server.local
s.boot
b = Buffer.read(s, "/Users/guy/src/grains/sounds/vox.wav");
(
SynthDef("mygrains", {
arg trate = 1, bufnum = 0;
var dur = 8 / trate;
var clk = Impulse.kr(trate);
var pos = Integrator.kr(BrownNoise.kr(0.001));
var pan = WhiteNoise.kr(0.6);
var g = TGrains.ar(2, clk, bufnum, 1, pos, dur, pan, 0.1);
Out.ar(0, g);
}).send(s);
)
(
SynthDef("playback", {
arg out = 0, bufnum = 0;
var snd = PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum));
Out.ar(out, snd);
}).send(s);
)
p = Synth("playback", ["bufnum", b.bufnum])
p.free
g = Synth("mygrains", ["bufnum", b.bufnum])
g.free
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment