-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgrid-sequencer-defs.scd
30 lines (28 loc) · 1 KB
/
grid-sequencer-defs.scd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// you can use the following sound files from freesound.org
/*
http://www.freesound.org/people/datasoundsample/sounds/41947/
http://www.freesound.org/people/datasoundsample/sounds/41948/
http://www.freesound.org/people/datasoundsample/sounds/41942/
http://www.freesound.org/people/datasoundsample/sounds/41944/
*/
(
// make sure to boot the server before loading the samples
s.waitForBoot {
// load samples from relative path (make a subfolder in the working directory with name 'samples')
p = (thisProcess.nowExecutingPath.dirname++"/samples/*").pathMatch;
// collect samples to buffers
c = p.collect{|item| Buffer.read(s, item) };
}
)
// define the SynthDef (synth definition)
(
// buffdrums
SynthDef(\buffdrums, { |bufnum=0, pan=0.0, amp=0.5|
Out.ar(0, Pan2.ar(PlayBuf.ar(1, bufnum, doneAction: 2), pan, amp))
}).add;
)
// play drum hits
Synth(\buffdrums, [\bufnum, c[0]]);
Synth(\buffdrums, [\bufnum, c[1]]);
Synth(\buffdrums, [\bufnum, c[2]]);
Synth(\buffdrums, [\bufnum, c[3]]);