Skip to content

Commit 46733ec

Browse files
author
Ben Marx
committed
Synths winwood_lead, bass_foundation, bass_highend
1 parent adef9ea commit 46733ec

File tree

7 files changed

+373
-0
lines changed

7 files changed

+373
-0
lines changed

app/server/ruby/lib/sonicpi/synths/synthinfo.rb

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,6 +3290,214 @@ def arg_defaults
32903290
end
32913291
end
32923292

3293+
class WinwoodLead < SonicPiSynth
3294+
def name
3295+
"Winwood Lead"
3296+
end
3297+
3298+
def introduced
3299+
Version.new(3,3,0)
3300+
end
3301+
3302+
def synth_name
3303+
"winwood_lead"
3304+
end
3305+
3306+
def on_start(studio, args_h)
3307+
args_h[:rand_buf] = studio.rand_buf_id
3308+
end
3309+
3310+
def doc
3311+
"A lead synth inspired by the Winwood songs from the early 80s. Adapted for Sonic Pi from [Steal This Sound](https://raw.githubusercontent.com/supercollider/supercollider/develop/examples/demonstrations/stealthissound.scd). Published there under [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html), so re-published under the same terms. The source code is available [on the Sonic Pi GitHub repository](https://github.com/sonic-pi-net/sonic-pi). Date of modification: 10.01.2021"
3312+
end
3313+
3314+
def arg_defaults
3315+
{
3316+
:note => 69,
3317+
:note_slide => 0,
3318+
:note_slide_shape => 1,
3319+
:note_slide_curve => 0,
3320+
:amp => 1,
3321+
:amp_slide => 0,
3322+
:amp_slide_shape => 1,
3323+
:amp_slide_curve => 0,
3324+
:pan => 0,
3325+
:pan_slide => 0,
3326+
:pan_slide_shape => 1,
3327+
:pan_slide_curve => 0,
3328+
3329+
:attack => 0.01,
3330+
:decay => 0,
3331+
:sustain => 0.9,
3332+
:release => 0.05,
3333+
:attack_level => 1,
3334+
:decay_level => 0.5,
3335+
:sustain_level => 0.5,
3336+
3337+
:cutoff => 119,
3338+
:cutoff_slide => 0,
3339+
:cutoff_slide_shape => 1,
3340+
:cutoff_slide_curve => 0,
3341+
3342+
:res => 0.8,
3343+
:res_slide => 0,
3344+
:res_slide_shape => 1,
3345+
:res_slide_curve => 0,
3346+
:lfo_width => 0.01,
3347+
:lfo_width_slide => 0,
3348+
:lfo_width_slide_shape => 1,
3349+
:lfo_width_slide_curve => 0,
3350+
:lfo_rate => 8,
3351+
:lfo_rate_slide => 0,
3352+
:lfo_rate_slide_shape => 1,
3353+
:lfo_rate_slide_curve => 0,
3354+
:seed => 0,
3355+
}
3356+
end
3357+
3358+
def specific_arg_info
3359+
{
3360+
:seed =>
3361+
{
3362+
:doc => "Seed value for rand num generator used for the phase offset of the triangle low-frequency oscillator (LFO)",
3363+
:modulatable => false
3364+
},
3365+
:lfo_width =>
3366+
{
3367+
:doc => "Width of the low-frequency oscillator (LFO) which determines how wide base tones oscillate around their base frequencies",
3368+
:modulatable => true
3369+
},
3370+
:lfo_rate =>
3371+
{
3372+
:doc => "Width of the low-frequency oscillator (LFO) which determines how fast base tones oscillate around their base frequencies",
3373+
:modulatable => true
3374+
},
3375+
}
3376+
end
3377+
end
3378+
3379+
class BassFoundation < SonicPiSynth
3380+
def name
3381+
"Bass Foundation"
3382+
end
3383+
3384+
def introduced
3385+
Version.new(3,3,0)
3386+
end
3387+
3388+
def synth_name
3389+
"bass_foundation"
3390+
end
3391+
3392+
def doc
3393+
"A soft bass synth inspired by the sounds of the 80s. Use together with :bass_highend if you want to give it a gargling component. Adapted for Sonic Pi from [Steal This Sound](https://raw.githubusercontent.com/supercollider/supercollider/develop/examples/demonstrations/stealthissound.scd). Published there under [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html), so re-published under the same terms. The source code is available [on the Sonic Pi GitHub repository](https://github.com/sonic-pi-net/sonic-pi). Date of modification: 10.01.2021"
3394+
end
3395+
3396+
def arg_defaults
3397+
{
3398+
:note => 40,
3399+
:note_slide => 0,
3400+
:note_slide_shape => 1,
3401+
:note_slide_curve => 0,
3402+
:amp => 1,
3403+
:amp_slide => 0,
3404+
:amp_slide_shape => 1,
3405+
:amp_slide_curve => 0,
3406+
:pan => 0,
3407+
:pan_slide => 0,
3408+
:pan_slide_shape => 1,
3409+
:pan_slide_curve => 0,
3410+
3411+
:attack => 0.01,
3412+
:decay => 0,
3413+
:sustain => 0.9,
3414+
:release => 0.05,
3415+
:attack_level => 1,
3416+
:decay_level => 0.5,
3417+
:sustain_level => 0,
3418+
3419+
:cutoff => 83,
3420+
:cutoff_slide => 0,
3421+
:cutoff_slide_shape => 1,
3422+
:cutoff_slide_curve => 0,
3423+
3424+
:res => 0.5,
3425+
:res_slide => 0,
3426+
:res_slide_shape => 1,
3427+
:res_slide_curve => 0,
3428+
}
3429+
end
3430+
end
3431+
3432+
class BassHighend < SonicPiSynth
3433+
def name
3434+
"Bass Highend"
3435+
end
3436+
3437+
def introduced
3438+
Version.new(3,3,0)
3439+
end
3440+
3441+
def synth_name
3442+
"bass_highend"
3443+
end
3444+
3445+
def doc
3446+
"An addition to the :bass_foundation synth inspired by the sounds of the 80s. Use them together if you want to give it a rough, slurping, or gargling component. Adapted for Sonic Pi from [Steal This Sound](https://raw.githubusercontent.com/supercollider/supercollider/develop/examples/demonstrations/stealthissound.scd). Published there under [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html), so re-published under the same terms. The source code is available [on the Sonic Pi GitHub repository](https://github.com/sonic-pi-net/sonic-pi). Date of modification: 11.01.2021"
3447+
end
3448+
3449+
def arg_defaults
3450+
{
3451+
:note => 40,
3452+
:note_slide => 0,
3453+
:note_slide_shape => 1,
3454+
:note_slide_curve => 0,
3455+
:amp => 1,
3456+
:amp_slide => 0,
3457+
:amp_slide_shape => 1,
3458+
:amp_slide_curve => 0,
3459+
:pan => 0,
3460+
:pan_slide => 0,
3461+
:pan_slide_shape => 1,
3462+
:pan_slide_curve => 0,
3463+
3464+
:attack => 0.01,
3465+
:decay => 0,
3466+
:sustain => 0.9,
3467+
:release => 0.05,
3468+
:attack_level => 1,
3469+
:decay_level => 0.5,
3470+
:sustain_level => 0,
3471+
3472+
:cutoff => 102,
3473+
:cutoff_slide => 0,
3474+
:cutoff_slide_shape => 1,
3475+
:cutoff_slide_curve => 0,
3476+
3477+
:res => 0.1,
3478+
:res_slide => 0,
3479+
:res_slide_shape => 1,
3480+
:res_slide_curve => 0,
3481+
3482+
:drive => 2.0,
3483+
:drive_slide => 0,
3484+
:drive_slide_shape => 1,
3485+
:drive_slide_curve => 0,
3486+
}
3487+
end
3488+
3489+
def specific_arg_info
3490+
{
3491+
:drive =>
3492+
{
3493+
:doc => "Higher drive values make the sound louder and rougher.",
3494+
:validations => [v_positive(:drive)],
3495+
:modulatable => true
3496+
},
3497+
}
3498+
end
3499+
end
3500+
32933501
class StudioInfo < SonicPiSynth
32943502
def user_facing?
32953503
false
@@ -7949,6 +8157,9 @@ class BaseInfo
79498157
:kalimba => SynthKalimba.new,
79508158
:pluck => SynthPluck.new,
79518159
:tech_saws => TechSaws.new,
8160+
:winwood_lead => WinwoodLead.new,
8161+
:bass_foundation => BassFoundation.new,
8162+
:bass_highend => BassHighend.new,
79528163

79538164
:sound_in => SoundIn.new,
79548165
:sound_in_stereo => SoundInStereo.new,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Adapted for Sonic Pi from
2+
// https://raw.githubusercontent.com/supercollider/supercollider/develop/examples/demonstrations/stealthissound.scd
3+
// Published there under GPL v3, so re-published under the same terms, see:
4+
// https://www.gnu.org/licenses/gpl-3.0.en.html
5+
// Date of modification: 10.01.2021
6+
7+
(
8+
SynthDef('sonic-pi-bass_foundation', {|
9+
note = 40, note_slide = 0, note_slide_shape = 1, note_slide_curve = 0,
10+
amp = 1, amp_slide = 0, amp_slide_shape = 1, amp_slide_curve = 0,
11+
pan = 0, pan_slide = 0, pan_slide_shape = 1, pan_slide_curve = 0,
12+
attack = 0.01, decay = 0, sustain = 0.9, release = 0.05,
13+
attack_level = 1, decay_level = 0.5, sustain_level = 0,
14+
cutoff = 83, cutoff_slide = 0, cutoff_slide_shape = 1, cutoff_slide_curve = 0,
15+
res = 0.5, res_slide = 0, res_slide_shape = 1, res_slide_curve = 0,
16+
out_bus = 0|
17+
18+
var snd, osc, env, filterenv;
19+
20+
note = note.midicps;
21+
note = note.varlag(note_slide, note_slide_curve, note_slide_shape);
22+
decay_level = Select.kr(decay_level < 0, [decay_level, sustain_level]);
23+
amp = amp.varlag(amp_slide, amp_slide_curve, amp_slide_shape);
24+
pan = pan.varlag(pan_slide, pan_slide_curve, pan_slide_shape);
25+
26+
cutoff = cutoff.midicps;
27+
cutoff = cutoff.varlag(cutoff_slide, cutoff_slide_curve, cutoff_slide_shape);
28+
29+
res = res.varlag(res_slide, res_slide_curve, res_slide_shape);
30+
31+
osc = Saw.ar(note);
32+
33+
filterenv = EnvGen.ar(Env.adsr(0.0, 0.5, 0.2, 0.2), 1, doneAction:2);
34+
snd = RLPF.ar(osc,cutoff*filterenv+100, res);
35+
36+
env = Env.new(
37+
[0, attack_level, decay_level, sustain_level, 0],
38+
[attack,decay,sustain,release],
39+
\lin
40+
);
41+
42+
snd = Pan2.ar(Mix(snd) * EnvGen.kr(env, doneAction: 2), pan);
43+
44+
Out.ar(out_bus, snd * amp);
45+
}).writeDefFile("/home/bmarx/music/sonic_pi/synthdefs/compiled/");
46+
)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Adapted for Sonic Pi from
2+
// https://raw.githubusercontent.com/supercollider/supercollider/develop/examples/demonstrations/stealthissound.scd
3+
// Published there under GPL v3, so re-published under the same terms, see:
4+
// https://www.gnu.org/licenses/gpl-3.0.en.html
5+
// Date of modification: 11.01.2021
6+
7+
(
8+
SynthDef('sonic-pi-bass_highend',{|
9+
note = 40, note_slide = 0, note_slide_shape = 1, note_slide_curve = 0,
10+
amp = 1, amp_slide = 0, amp_slide_shape = 1, amp_slide_curve = 0,
11+
pan = 0, pan_slide = 0, pan_slide_shape = 1, pan_slide_curve = 0,
12+
attack = 0.01, decay = 0, sustain = 0.9, release = 0.05,
13+
attack_level = 1, decay_level = 0.5, sustain_level = 0,
14+
cutoff = 102, cutoff_slide = 0, cutoff_slide_shape = 1, cutoff_slide_curve = 0,
15+
res = 0.1, res_slide = 0, res_slide_shape = 1, res_slide_curve = 0,
16+
drive = 2.0, drive_slide = 0, drive_slide_shape = 1, drive_slide_curve = 0,
17+
out_bus = 0|
18+
19+
var osc, snd, env, filterenv, ab;
20+
21+
note = note.midicps;
22+
note = note.varlag(note_slide, note_slide_curve, note_slide_shape);
23+
decay_level = Select.kr(decay_level < 0, [decay_level, sustain_level]);
24+
amp = amp.varlag(amp_slide, amp_slide_curve, amp_slide_shape);
25+
pan = pan.varlag(pan_slide, pan_slide_curve, pan_slide_shape);
26+
27+
cutoff = cutoff.midicps;
28+
cutoff = cutoff.varlag(cutoff_slide, cutoff_slide_curve, cutoff_slide_shape);
29+
30+
res = res.varlag(res_slide, res_slide_curve, res_slide_shape);
31+
32+
drive = drive.varlag(drive_slide, drive_slide_curve, drive_slide_shape);
33+
34+
osc = Mix(Saw.ar(note*[0.25,1,1.5],[0.5,0.4,0.1]));
35+
filterenv = EnvGen.ar(Env.adsr(0.0,0.5,0.2,0.2), doneAction:2);
36+
snd = RLPF.ar(osc,cutoff*filterenv+100,res);
37+
38+
ab = abs(snd);
39+
snd = (snd*(ab + drive)/(snd ** 2 + (drive - 1) * ab + 1));
40+
41+
// Remove low end
42+
snd = BLowShelf.ar(snd, 300, 1.0, -12);
43+
44+
// Dip at 1600Hz
45+
snd = BPeakEQ.ar(snd, 1600, 1.0, -6);
46+
47+
env = Env.new(
48+
[0, attack_level, decay_level, sustain_level, 0],
49+
[attack,decay,sustain,release],
50+
\lin
51+
);
52+
53+
snd = Pan2.ar(Mix(snd) * EnvGen.kr(env, doneAction: 2) * 2, pan);
54+
55+
Out.ar(out_bus, snd * amp);
56+
57+
}).writeDefFile("/home/bmarx/music/sonic_pi/synthdefs/compiled/");
58+
)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Adapted for Sonic Pi from
2+
// https://raw.githubusercontent.com/supercollider/supercollider/develop/examples/demonstrations/stealthissound.scd
3+
// Published there under GPL v3, so re-published under the same terms, see:
4+
// https://www.gnu.org/licenses/gpl-3.0.en.html
5+
// Date of modification: 10.01.2021
6+
7+
(
8+
SynthDef('sonic-pi-winwood_lead', {|
9+
note = 69, note_slide = 0, note_slide_shape = 1, note_slide_curve = 0,
10+
amp = 1, amp_slide = 0, amp_slide_shape = 1, amp_slide_curve = 0,
11+
pan = 0, pan_slide = 0, pan_slide_shape = 1, pan_slide_curve = 0,
12+
attack = 0.01, decay = 0, sustain = 0.9, release = 0.05,
13+
attack_level = 1, decay_level = 0.5, sustain_level = 0.5,
14+
cutoff = 119, cutoff_slide = 0, cutoff_slide_shape = 1, cutoff_slide_curve = 0,
15+
lfo_width = 0.01, lfo_width_slide = 0, lfo_width_slide_shape = 1, lfo_width_slide_curve = 0,
16+
lfo_rate = 8, lfo_rate_slide = 0, lfo_rate_slide_shape = 1, lfo_rate_slide_curve = 0,
17+
res = 0.8, res_slide = 0, res_slide_shape = 1, res_slide_curve = 0,
18+
seed = 0, rand_buf = 0,
19+
out_bus = 0|
20+
21+
var snd, pulse, env, lfo;
22+
var rand_val;
23+
24+
note = note.midicps;
25+
note = note.varlag(note_slide, note_slide_curve, note_slide_shape);
26+
decay_level = Select.kr(decay_level < 0, [decay_level, sustain_level]);
27+
amp = amp.varlag(amp_slide, amp_slide_curve, amp_slide_shape);
28+
pan = pan.varlag(pan_slide, pan_slide_curve, pan_slide_shape);
29+
30+
cutoff = cutoff.midicps;
31+
cutoff = cutoff.varlag(cutoff_slide, cutoff_slide_curve, cutoff_slide_shape);
32+
33+
lfo_width = lfo_width.varlag(lfo_width_slide, lfo_width_slide_curve, lfo_width_slide_shape);
34+
lfo_rate = lfo_rate.varlag(lfo_rate_slide, lfo_rate_slide_curve, lfo_rate_slide_shape);
35+
36+
res = res.varlag(res_slide, res_slide_curve, res_slide_shape);
37+
38+
rand_val = BufRd.kr(1, rand_buf, seed, 1);
39+
40+
lfo = LFTri.kr(lfo_rate,(rand_val*2.0)!2);
41+
42+
pulse = Mix(Pulse.ar(note*[1,1.001]*(1.0+(lfo_width*lfo)),[0.2,0.19]))*0.5;
43+
44+
snd = RLPF.ar(pulse,cutoff,res);
45+
46+
snd = BLowShelf.ar(snd,351,1.0,-9);
47+
48+
env = Env.new(
49+
[0, attack_level, decay_level, sustain_level, 0],
50+
[attack,decay,sustain,release],
51+
\lin
52+
);
53+
54+
snd = Pan2.ar(Mix(snd) * EnvGen.kr(env, doneAction: 2), pan);
55+
56+
Out.ar(out_bus, snd * amp);
57+
}).writeDefFile("/home/bmarx/music/sonic_pi/synthdefs/compiled/");
58+
)

0 commit comments

Comments
 (0)