-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsamplePatterns.scd
56 lines (43 loc) · 1015 Bytes
/
samplePatterns.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// pattern with one shot samples
Buffer.freeAll;
// ~samplesDir = thisProcess.nowExecutingPath.dirname +/+ "../soundfiles";
~samplesDir = "/home/jbloit/sounds/DataBending";
// ~samplesDir = thisProcess.nowExecutingPath.dirname +/+ "../soundfiles";
~tac = Buffer.read(s, ~samplesDir +/+ "blipGlitch_comic_book.wav");
// See num frames:
~tac.numFrames;
// see num channels
~tac.numChannels;
// see sample rate:
~tac.sampleRate;
// see a summary:
~tac.query;
// y = Synth(\sampler, [\bufNum, ~tac.bufnum]);
(
SynthDef(\sampler, {
|out=0, bufNum=0, amp=0.3, rate=1|
var sig;
sig = PlayBuf.ar(2, bufNum, rate * BufRateScale.kr(bufNum), doneAction:2);
Out.ar(out, sig*amp);
}).add;
)
TempoClock.tempo = 1;
// ternaire
(
Pbind(\instrument, \sampler,
\dur, 1/8,
\amp, Pexprand(0.01, 0.7),
\rate, Pexprand(0.9, 1.2),
).play;
)
// binaire
(
Pbind(\instrument, \sampler,
\dur, 1/4,
\amp, Pexprand(0.01, 1),
\rate, Pexprand(1, 3),
).play;
)
// dict with samples from dir?
// frees the buffer.
~tac.free;