Skip to content

Commit b52f111

Browse files
Expanded \bow
1 parent 3bcfde8 commit b52f111

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

synths/default-synths.scd

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
3-
*/
4-
51
(
62
/*
73
Function to store argument preset values for each synth. It will eventually be removed and added as a method for CleanSoundLibrary.
@@ -48,6 +44,7 @@ SynthDef(\add, {| out, ada = 0.001, adr = 1,
4844
Out.ar(out, o);
4945
}).store;
5046

47+
5148
// A four operator FM synth.
5249
SynthDef(\fmx, {| sustain = 1, pan, amp = 0.1, out = 0,
5350
freq = 440, bnd, mi1 = 0.8, hr4 = 1 ,hr3 = 2, hr2 = 1, hr1= 0, mi4 = 1, mi3 = 0.5,
@@ -69,6 +66,7 @@ SynthDef(\fmx, {| sustain = 1, pan, amp = 0.1, out = 0,
6966
Out.ar(out, tanh(LeakDC.ar(sig)));
7067
}).store;
7168

69+
7270
// This synthdef builds on the work of Nathan Ho. https://nathan.ho.name/posts/ixa-synthesis/
7371
SynthDef(\ixa, {| out, sustain = 1, pan, amp = 0.5, freq = 440, bnd = 0, bno = 0, bnt = 0.2, bnc = 0,
7472
bes = 2, abs = 2, ths = 2, ber = 1, abr = 1, thr = 1, crv, atk = 0.0, rel = 1.0|
@@ -93,6 +91,7 @@ SynthDef(\ixa, {| out, sustain = 1, pan, amp = 0.5, freq = 440, bnd = 0, bno = 0
9391
Out.ar(out, sig * amp);
9492
}).store;
9593

94+
9695
// A sine wave oscillator.
9796
SynthDef(\sin, {|out = 0, sustain = 1, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, freq = 440, iph = 0, amp = 1.0,
9897
pan = 0, atk = 0.0, rel = 1.0, crv = -8.0|
@@ -110,6 +109,7 @@ SynthDef(\sin, {|out = 0, sustain = 1, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, fre
110109
Out.ar(out, sig);
111110
}).store;
112111

112+
113113
// A saw wave oscillator.
114114
SynthDef(\saw, {|out = 0, sustain = 1, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, freq = 440, iph = 0, wid = 0.25, amp = 1.0, pan = 0, atk = 0.0, rel = 1.0, crv = -8.0|
115115
var env, accel, sig, freqclipped;
@@ -126,6 +126,7 @@ SynthDef(\saw, {|out = 0, sustain = 1, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, fre
126126
Out.ar(out, sig);
127127
}).store;
128128

129+
129130
// A square wave oscillator.
130131
SynthDef(\sqr, {|out = 0, sustain = 1, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, freq = 440, amp = 0.5, pan = 0, atk = 0.0, rel = 1.0, crv = -8.0, wid = 0.25|
131132
var env, accel, sig, freqclipped;
@@ -143,6 +144,7 @@ SynthDef(\sqr, {|out = 0, sustain = 1, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, fre
143144
},
144145
).store;
145146

147+
146148
// Live audio input, (does this really work tho?)
147149
(
148150
SynthDef(\in, { |out, sustain = 1, spd = 1, bgn = 0, end = 1, pan, accelerate, offset|
@@ -156,6 +158,7 @@ SynthDef(\in, { |out, sustain = 1, spd = 1, bgn = 0, end = 1, pan, accelerate, o
156158
}).store
157159
);
158160

161+
159162
// Read input from nth routing bus.
160163
// See also: effect "to".
161164
(
@@ -177,6 +180,7 @@ SynthDef(\clean_from, { |out, sustain = 1, in, pan|
177180
)
178181
);
179182

183+
180184
// Pitch shifted live audio input (does this really work tho?).
181185
(
182186
SynthDef(\inr, { |out, sustain = 1, freq = 440, spd = 1, bgn=0, end=1, pan, bnd, offset|
@@ -191,6 +195,7 @@ SynthDef(\inr, { |out, sustain = 1, freq = 440, spd = 1, bgn=0, end=1, pan, bnd,
191195
}).store
192196
);
193197

198+
194199
// Karplus-Strong physical modeling of a vibrating string, using a delay line (CombL) excited by an intial pulse (Impulse).
195200
// There are two delay lines.
196201
// "bnd" is used for a pitch glide, and "sustain" changes the envelope timescale.
@@ -199,7 +204,7 @@ SynthDef(\kps, {|out, sustain=1, pan, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, freq
199204
var accel, freqclipped;
200205
var env = EnvGen.ar(Env.linen(0.002, 0.996, 0.002, 1,-3), timeScale:sustain, doneAction:2);
201206
var sound = Decay.ar(Impulse.ar(0,0,0.1), 0.1*(freq.cpsmidi)/69) * WhiteNoise.ar;
202-
var pitch = freq * Line.kr(1, 1+0, sustain);
207+
var pitch = freq * Line.kr(1, 1 + 0, sustain);
203208
accel = EnvGen.kr(Env(
204209
[1, 1, 1 + bnd.clip(-1.0, 1.0)],
205210
[bno, bnt * sustain],
@@ -212,6 +217,7 @@ SynthDef(\kps, {|out, sustain=1, pan, bnd = 0, bno = 0, bnt = 0.2, bnc = 0, freq
212217
}).store
213218
);
214219

220+
215221
// These kick and hat sounds build on the work of Rumble-San.
216222
// http://blog.rumblesan.com/post/53271713518/drum-sounds-in-supercollider-part-1
217223
// A drum synth.
@@ -243,6 +249,7 @@ SynthDef(\hat, {|out, sustain=1, pan, bnd, tun |
243249
}).store
244250
);
245251

252+
246253
// Clap Synthesizer. This builds on the work of Nathan Ho: https://youtu.be/L9D78W8C-3w
247254
// Call it by providing \clp as a value to the \snd key in a pattern.
248255
// Parameters:
@@ -303,19 +310,26 @@ SynthDef(\dfd, {|out = 0, freq = 440, res = 1, den = 0, amp = 1, pan = 0.5, atk
303310
Out.ar(out, sig);
304311
}).store;
305312

313+
306314
// Digital wave guide physical model of a bowed instrument.
307-
SynthDef(\bow, { |out=0, freq=440, amp=1.0, frc=1, gate=1, pos=0.07 ,c1=0.25, c3=31, pan=0, atk = 0.0, rel = 1.0, crv = -8.0|
308-
var env, vib, sig;
309-
env = Env.perc(atk, rel, amp*0.666, crv).kr(doneAction: 2);
310-
sig = DWGBowed.ar(freq.clip(20,5000), amp,frc, gate,pos,0.1,c1,c3);
315+
SynthDef(\bow, { |out=0, sustain = 1, freq=440, amp=1.0, frc=1, gate=1, pos=0.07, idc=0.25, hfl=31, pan=0, atk = 0.0, rel = 1.0, gst = 8.0, smp = 0.55, ihf = 2, bnd = 0, bno = 0, bnt = 0.2, bnc = 0|
316+
var env, vib, sig, freqclipped, accel;
317+
var pitch = freq * Line.kr(1, 1 + 0, sustain);
318+
accel = EnvGen.kr(Env(
319+
[1, 1, 1 + bnd.clip(-1.0, 1.0)],
320+
[bno, bnt * sustain],
321+
[0, 0, bnc] //optional curvature
322+
));
323+
freqclipped = freq.clip(20, 5000) * accel;
324+
env = Env.perc(atk, rel, amp * 0.666, gst).kr(doneAction: 2);
325+
sig = DWGBowed.ar(freqclipped.clip(20, 5000), amp, frc, gate, pos, 0.1, idc, hfl, smp, ihf);
311326
sig = DWGSoundBoard.ar(sig);
312-
sig = BPF.ar(sig,118,1)+sig;
313-
sig = BPF.ar(sig,430,1)+sig;
314-
sig = BPF.ar(sig,490,1)+sig;
315-
sig = LPF.ar(sig,6000);
327+
sig = BPF.ar(sig, 118, 1) + sig;
328+
sig = BPF.ar(sig, 430, 1) + sig;
329+
sig = BPF.ar(sig, 490, 1) + sig;
330+
sig = LPF.ar(sig, 4000);
316331
sig = sig * env;
317332
sig = CleanPan.ar(sig, ~clean.numChannels, pan);
318333
Out.ar(out, sig);
319334
}).store;
320-
)
321-
335+
)

0 commit comments

Comments
 (0)