-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynthdefs1.scd
186 lines (185 loc) · 9.24 KB
/
synthdefs1.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
SynthDef(\donk, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0], [0.01, 1], curve:-3);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var modulator = (SinOsc.ar(freq*[1.0001,0.9999]*abs(speed))*2).tanh;
var carrier = (SinOsc.ar((freq/4)+(modulator*1000*envGen))*0.8).tanh;
var sound = DirtPan.ar(carrier, ~dirt.numChannels, pan, envGen);
Out.ar(out, sound);
}).add;
SynthDef(\wub, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0],[1,5], curve:2);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
// --- //
var speedFreq = freq*abs(speed)/4;
var mod = Latch.ar((SinOsc.ar(speedFreq*[7,11,13,5])*5).tanh*2000*envGen, Saw.ar(21000*envGen));
var car = Latch.ar(((SinOsc.ar(speedFreq+mod)*10)+(SinOsc.ar(speedFreq)!2)).tanh, Saw.ar(21000*envGen));
var sound = LPF.ar(car, DC.ar(20000)*envGen+DC.ar(10))*(-11.dbamp);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\sawpluck, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0.333, 0],[5, 70, 1000]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var sound = Saw.ar(freq*abs(speed));
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\vibsawpluck, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0.333, 0],[5, 70, 1000]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var sound = Saw.ar(freq*abs(speed)+(SinOsc.ar(10)*(freq*0.06)*line*line));
sound = RLPF.ar(sound, Clip.ar(envGen*freq*48, 0, 20000), 0.5);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\plucklead, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0.333, 0],[5, 70, 1000]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var speedFreq = freq*abs(speed);
var pulseLfo = SinOsc.ar(Rand(-1,1));
var sound = RLPF.ar(Pulse.ar([speedFreq*Rand(0.99,1.01)*2,speedFreq*Rand(0.99,1.01)*2],pulseLfo)*0.5+Saw.ar(speedFreq), (20000*(envGen**2.8))+DC.ar(10), 0.5);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\wob, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0],[1, 1]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
// --- //
var speedFreq = freq*abs(speed)/4;
var mod = Latch.ar((SinOsc.ar(speedFreq*[7,11,13,5])*5).tanh*2000*envGen, Saw.ar(21000*envGen));
var car = Latch.ar(((SinOsc.ar(speedFreq+mod)*10)+(SinOsc.ar(speedFreq)!2)).tanh, Saw.ar(21000*envGen));
var sound = car*(-10.dbamp);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\noisebuild, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0],[127, 1],curve:4);
var envGen = IEnvGen.ar(env, line*env.times.sum/*abs(speed)*/);
// --- //
var sound = HPF.ar(BPF.ar(WhiteNoise.ar()*envGen, 10+(20000*envGen), 0.8), 1000);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\fmp, {
|out,sustain = 1,freq = 440,speed = 1,begin=0,end=1,pan,accelerate,offset,cStartFreq=440,cEndFreq=440,cEnvFMod=0,mStartFreq=440,mEndFreq=440,mEnvFMod=0,fMod=0,pMod=0,cFFeedback=0,cPFeedback=0,mFFeedback=0,mPFeedback=0,feedbackDelay=0.01,attackCurve=1,decayCurve=1,atk=1,dcy=1|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0],[atk,dcy],[attackCurve,decayCurve]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var feedback = LocalIn.ar(1);
var mFreq = ((1-line)*mStartFreq)+(line*mEndFreq)+(envGen*mEnvFMod)+(mFFeedback*feedback);
var mPhase = mPFeedback*feedback;
var modulator = SinOsc.ar(mFreq,mPhase)*envGen;
var cFreq = ((1-line)*cStartFreq)+(line*cEndFreq)+(envGen*cEnvFMod)+(modulator*fMod)+(cFFeedback*feedback);
var cPhase = (modulator*pMod)+(cPFeedback*feedback);
var carrier = SinOsc.ar(cFreq,cPhase);
var sound = carrier*envGen;
LocalOut.ar(DelayL.ar(sound,10,feedbackDelay));
Out.ar(out, DirtPan.ar(sound,~dirt.numChannels,pan,1));
}).add;
SynthDef(\ab2, {
arg out, freq = 440, sustain = 5, speed = 1, begin =0, end=1, pan, accelerate, offset;
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0], [0.01, 1], curve:-3);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var snd;
var sound;
snd = Saw.ar([freq, freq*1.022]);
8.do { |k|
var trig, ffreq;
snd = AllpassN.ar(snd, 1, 0.1 / (12 - k), 2);
trig = Impulse.ar(2 ** (8 - k) / 32, 1 / 2);
ffreq = 80 ** TRand.ar(1, 2, trig).lag((2 ** (8 - k)).reciprocal);
snd = BRF.ar(snd, ffreq, 2);
};
sound = DirtPan.ar(snd, ~dirt.numChannels, pan, envGen);
Out.ar(out, sound);
}).add;
SynthDef(\flutter, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0,1,0],[0.2,0.8]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var lfo = SinOsc.ar(Rand(-0.1,0.1),Rand(0,3.145))*(freq*abs(speed))/80;
var sound = Saw.ar((freq*abs(speed))+lfo+(Rand(-1,1)*(freq*abs(speed))/DC.ar(100)));
sound = LPF.ar(sound, (freq*abs(speed))*1.5);
//sound = RLPF.ar(sound, Clip.ar(envGen*freq*48, 0, 20000), 0.5);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\futuresaw, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var envCurve = -1.5;
var env = Env([0,1,0],[0.5,0.5],[-1*envCurve,envCurve]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var sound = Saw.ar((freq*abs(speed))+(Rand(-1,1)*(freq*abs(speed))/DC.ar(100)));
sound = RLPF.ar(sound, Clip.ar(envGen*freq*48, 0, 20000), 0.5);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\futuresub, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var envCurve = 5;
var env = Env([0,1,0],[0.5,0.5],[-1*envCurve,envCurve]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var sound = SinOsc.ar((freq*abs(speed))+(Rand(-1,1)*(freq*abs(speed))/DC.ar(100)));
sound = sound*2;
sound = sound.tanh;
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\ultrasaw, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0,1,1,0],[0.001,1,0.001]);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var freqs = {Rand(-1,1)*(freq/60)}.dup(12);
var sound = Saw.ar((freq+freqs));
sound = sound + Saw.ar((freq+freqs)*2);
sound = sound + Saw.ar((freq+freqs)*0.5);
sound = sound + Saw.ar((freq+freqs)*4);
sound = sound + Saw.ar((freq+freqs)*0.25);
sound = LPF.ar(sound, freq*1.5);
//sound = RLPF.ar(sound, Clip.ar(envGen*freq*48, 0, 20000), 0.5);
Out.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\acid, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset, clamp=1, res=0.2, mix=0.1|
var line = Line.ar(begin, end, sustain, doneAction:2);
var env = Env([0, 1, 0], [0.01, 1], curve:-3);
var envGen = IEnvGen.ar(env, line*env.times.sum*abs(speed));
var carrier = RLPF.ar((Saw.ar(freq)*(1-mix))+(Pulse.ar(freq)*mix), envGen*clamp*18000,res);
var sound = DirtPan.ar(carrier, ~dirt.numChannels, pan, envGen);
Out.ar(out, sound);
}).add;
SynthDef(\sinosc, {
|out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan=0.5, accelerate, offset|
var env, envTimes, envGen, line, sound, rate, phase;
envTimes = [1,100];
envTimes = envTimes/envTimes.sum;
env = Env([0,1,0],envTimes);
line = Line.ar(0,1,sustain,doneAction:2);
envGen = IEnvGen.ar(env,line);
sound = SinOsc.ar(freq*speed)*envGen;
OffsetOut.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, envGen));
}).add;
SynthDef(\rhodes, {|out, sustain=1, pan, accelerate, freq |
var sig, in, n = 6, max = 0.04, min = 0.01, delay, pitch, detune, hammer, amp, env;
amp = 0.9;
freq = freq.cpsmidi;
hammer = Decay2.ar(Impulse.ar(0.001), 0.008, 0.04, LFNoise2.ar([2000,4000].asSpec.map(amp), 0.25));
sig = Mix.ar(Array.fill(3, { arg i;
detune = #[-0.04, 0, 0.03].at(i);
delay = (1/(freq + detune).midicps);
CombL.ar(hammer, delay, delay, 50 * amp)
}) );
sig = HPF.ar(sig,50);
env = EnvGen.ar(Env.perc(0.0001,sustain, amp * 4, -1), doneAction:2);
OffsetOut.ar(out, DirtPan.ar(sig, ~dirt.numChannels, pan, env));
}).add;