-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdxkSynthsMisc.scd
More file actions
83 lines (72 loc) · 2.83 KB
/
dxkSynthsMisc.scd
File metadata and controls
83 lines (72 loc) · 2.83 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
SynthDef(\dxkDtmf, {|number = 0, mul = 1, pan = 0, out = 0, gate = 1, att = 0.001, decay = 0.001|
var output, env, freqarr, freqs;
//A = 10, B = 11, C = 12, D = 13, * =14, E = 15
// freq pairs
freqarr = [[941, 1336], [697, 1209], [697, 1336], [697, 1477],
[770, 1209], [770, 1336], [770, 1477],
[852, 1209], [852, 1336], [852, 1477],
[697, 1633], [770, 1633], [852, 1633],
[941, 1633], [941, 1209], [941, 1477]];
freqs = Select.kr(number, freqarr);
output = SinOsc.ar(freqs, 0, mul);
output = Mix.new(output)*0.5;
env = EnvGen.ar(Env.asr(att, 1, decay), gate, doneAction: 2);
output = output * env;
output = Pan2.ar(output, pan);
Out.ar(out, output)}).add;
SynthDef(\dxkClik, {|t_trig = 1, samplen = 1, amp = 1, pan = 0, out = 0|
var output, failsafe, filtput;
output = Trig.ar(t_trig, samplen*SampleDur.ir);
output = output * amp;
failsafe = FreeSelf.kr(Trig.kr(t_trig) * (amp <= 0));
DetectSilence.ar(output, time: 0.01, doneAction: 2);
output = Pan2.ar(output, pan);
Out.ar(out, output);
}).add;
SynthDef(\dxkClikFilt, {|t_trig = 1, samplen = 1, freq = 440, rq = 0.1, amp = 1, pan = 0, out = 0|
var output, failsafe, filtput;
output = Trig.ar(t_trig, samplen*SampleDur.ir);
output = output * amp;
output = BPF.ar(output, freq, rq);
failsafe = FreeSelf.kr(Trig.kr(t_trig) * (amp <= 0));
DetectSilence.ar(output, time: 0.1, doneAction: 2);
output = Pan2.ar(output, pan);
Out.ar(out, output);
}).add;
SynthDef(\dxkWNoiseBPFADSR, {|gate = 1, freq= 440, rq = 0.1, att = 0.01, decay = 0.3, suslvl = 0.5, rel =1, amp = 1, pan = 0, out =0|
var env, output, noise;
noise = WhiteNoise.ar();
env = EnvGen.ar(Env.adsr(att,decay,suslvl,rel),gate, doneAction: 2);
output = BPF.ar(noise, freq, rq, amp);
output = output * env;
output = Pan2.ar(output, pan);
Out.ar(out, output);
}).add;
SynthDef(\dxkWNoizBPFASR, {|gate = 1, freq = 440, rq = 0.1, att = 0.001, rel = 0.001, amp = 1, pan =0, out = 0|
var env, output, noise;
noise = WhiteNoise.ar();
env = EnvGen.ar(Env.asr(att, 1, rel), gate, doneAction: 2);
output = BPF.ar(noise, freq, rq, amp);
output = output * env;
output = Pan2.ar(output, pan);
Out.ar(out, output);
}).add;
SynthDef(\dxkWNoizBPFPerc, {|gate = 1, freq = 440, rq = 0.1, att = 0.01, rel = 1, curve = -4, amp = 1, pan =0, out = 0|
var env, output, noise;
noise = WhiteNoise.ar();
env = EnvGen.ar(Env.perc(att,rel, 1, curve),gate, doneAction: 2);
output = BPF.ar(noise, freq, rq, amp);
output = output * env;
output = Pan2.ar(output, pan);
Out.ar(out, output);
}).add;
SynthDef(\dxkSimpleFm, {|freq = 440, modharm = 1, modidx = 0.5, amp = 1, out = 0|
//harm = harmonicity ratio
//modidx = modulation index
var h, fm, carrier, mod;
var output;
fm = freq * modharm;
mod = SinOsc.ar(fm, mul: fm * modidx, add: freq);
carrier = SinOsc.ar(mod, mul: amp);
Out.ar(out, carrier);
}, [0.005, 0.005, 0.005, 0.005]).add;