Skip to content

Commit a555254

Browse files
committed
Merge pull request #961 from xavriley/add_vowel_fx_take_two
Add vowel fx
2 parents 2fea76c + 17d4a49 commit a555254

File tree

3 files changed

+179
-1
lines changed

3 files changed

+179
-1
lines changed

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4908,6 +4908,56 @@ def specific_arg_info
49084908
end
49094909
end
49104910

4911+
class FXVowel < FXInfo
4912+
def name
4913+
"Vowel"
4914+
end
4915+
4916+
def introduced
4917+
Version.new(2,10,0)
4918+
end
4919+
4920+
def synth_name
4921+
"fx_vowel"
4922+
end
4923+
4924+
def arg_defaults
4925+
{
4926+
:amp => 1,
4927+
:amp_slide => 0,
4928+
:amp_slide_shape => 1,
4929+
:amp_slide_curve => 0,
4930+
:pre_amp => 1,
4931+
:pre_amp_slide => 0,
4932+
:pre_amp_slide_shape => 1,
4933+
:pre_amp_slide_curve => 0,
4934+
:vowel_sound => 1,
4935+
:voice => 0
4936+
}
4937+
end
4938+
4939+
def specific_arg_info
4940+
{
4941+
:vowel_sound =>
4942+
{
4943+
:doc => "1,2,3,4,5 => A,E,I,O,U",
4944+
:validations => [v_one_of(:vowel_sound, [1,2,3,4,5])],
4945+
:modulatable => true
4946+
},
4947+
:voice =>
4948+
{
4949+
:doc => "0,1,2,3,4 => Soprano,Alto,Counter Tenor, Tenor, Bass",
4950+
:validations => [v_one_of(:voice, [0,1,2,3,4])],
4951+
:modulatable => true
4952+
}
4953+
}
4954+
end
4955+
4956+
def doc
4957+
"This effect filters the input to match a human voice singing a certain vowel sound. Human singing voice sounds are easily achieved with a source of a saw wave with a little vibrato."
4958+
end
4959+
end
4960+
49114961
class FXOctaver < FXInfo
49124962
def name
49134963
"Octaver"
@@ -6411,6 +6461,7 @@ class BaseInfo
64116461
:fx_ring_mod => FXRingMod.new,
64126462
#:fx_chorus => FXChorus.new,
64136463
:fx_octaver => FXOctaver.new,
6464+
:fx_vowel => FXVowel.new,
64146465
:fx_flanger => FXFlanger.new
64156466
}
64166467

Binary file not shown.

etc/synthdefs/designs/sonic_pi/synths/fx.clj

Lines changed: 128 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,133 @@
1818

1919
(without-namespace-in-synthdef
2020

21+
(defsynth sonic-pi-fx_vowel
22+
[amp 1
23+
amp_slide 0
24+
amp_slide_shape 1
25+
amp_slide_curve 0
26+
mix 1
27+
mix_slide 0
28+
mix_slide_shape 1
29+
mix_slide_curve 0
30+
voice 0
31+
vowel_sound 1
32+
pre_amp 1
33+
pre_amp_slide 0
34+
pre_amp_slide_shape 1
35+
pre_amp_slide_curve 0
36+
in_bus 0
37+
out_bus 0]
38+
(let [amp (varlag amp amp_slide amp_slide_curve amp_slide_shape)
39+
pre_amp (varlag pre_amp pre_amp_slide pre_amp_slide_curve pre_amp_slide_shape)
40+
mix (varlag mix mix_slide mix_slide_curve mix_slide_shape)
41+
freqs [800, 1150, 2900, 3900, 4950
42+
350, 2000, 2800, 3600, 4950
43+
270, 2140, 2950, 3900, 4950
44+
450, 800, 2830, 3800, 4950
45+
325, 700, 2700, 3800, 4950
46+
800, 1150, 2800, 3500, 4950
47+
400, 1600, 2700, 3300, 4950
48+
350, 1700, 2700, 3700, 4950
49+
450, 800, 2830, 3500, 4950
50+
325, 700, 2530, 3500, 4950
51+
660, 1120, 2750, 3000, 3350
52+
440, 1800, 2700, 3000, 3300
53+
270, 1850, 2900, 3350, 3590
54+
430, 820, 2700, 3000, 3300
55+
370, 630, 2750, 3000, 3400
56+
650, 1080, 2650, 2900, 3250
57+
400, 1700, 2600, 3200, 3580
58+
290, 1870, 2800, 3250, 3540
59+
400, 800, 2600, 2800, 3000
60+
350, 600, 2700, 2900, 3300
61+
600, 1040, 2250, 2450, 2750
62+
400, 1620, 2400, 2800, 3100
63+
250, 1750, 2600, 3050, 3340
64+
400, 750, 2400, 2600, 2900
65+
350, 600, 2400, 2675, 2950]
66+
amps [1.0 0.5011872336272722 0.025118864315095784 0.09999999999999998 0.0031622776601683764
67+
1.0 0.09999999999999998 0.17782794100389226 0.009999999999999995 0.0015848931924611136
68+
1.0 0.251188643150958 0.050118723362727206 0.050118723362727206 0.006309573444801925
69+
1.0 0.2818382931264453 0.0794328234724281 0.0794328234724281 0.0031622776601683764
70+
1.0 0.1584893192461113 0.017782794100389226 0.009999999999999995 9.999999999999994E-4
71+
1.0 0.6309573444801931 0.09999999999999998 0.015848931924611127 9.999999999999994E-4
72+
1.0 0.06309573444801932 0.031622776601683784 0.017782794100389226 9.999999999999994E-4
73+
1.0 0.09999999999999998 0.031622776601683784 0.015848931924611127 9.999999999999994E-4
74+
1.0 0.3548133892335754 0.1584893192461113 0.03981071705534973 0.001778279410038922
75+
1.0 0.251188643150958 0.031622776601683784 0.009999999999999995 6.309573444801923E-4
76+
1.0 0.5011872336272722 0.07079457843841379 0.06309573444801932 0.012589254117941666
77+
1.0 0.19952623149688797 0.12589254117941667 0.09999999999999998 0.09999999999999998
78+
1.0 0.06309573444801932 0.06309573444801932 0.015848931924611127 0.015848931924611127
79+
1.0 0.3162277660168379 0.050118723362727206 0.0794328234724281 0.019952623149688792
80+
1.0 0.09999999999999998 0.07079457843841379 0.031622776601683784 0.019952623149688792
81+
1.0 0.5011872336272722 0.44668359215096315 0.3981071705534972 0.0794328234724281
82+
1.0 0.19952623149688797 0.251188643150958 0.19952623149688797 0.09999999999999998
83+
1.0 0.17782794100389226 0.12589254117941667 0.09999999999999998 0.031622776601683784
84+
1.0 0.3162277660168379 0.251188643150958 0.251188643150958 0.050118723362727206
85+
1.0 0.09999999999999998 0.14125375446227542 0.19952623149688797 0.050118723362727206
86+
1.0 0.44668359215096315 0.3548133892335754 0.3548133892335754 0.09999999999999998
87+
1.0 0.251188643150958 0.3548133892335754 0.251188643150958 0.12589254117941667
88+
1.0 0.031622776601683784 0.1584893192461113 0.0794328234724281 0.03981071705534973
89+
1.0 0.2818382931264453 0.08912509381337454 0.09999999999999998 0.009999999999999995
90+
1.0 0.09999999999999998 0.025118864315095784 0.03981071705534973 0.015848931924611127]
91+
bws [1/80 1/90 1/120 1/130 1/140
92+
1/60 1/100 1/120 1/150 1/200
93+
1/60 1/90 1/100 1/120 1/120
94+
1/70 1/80 1/100 1/130 1/135
95+
1/50 1/60 1/170 1/180 1/200
96+
1/80 1/90 1/120 1/130 1/140
97+
1/60 1/80 1/120 1/150 1/200
98+
1/50 1/100 1/120 1/150 1/200
99+
1/70 1/80 1/100 1/130 1/135
100+
1/50 1/60 1/170 1/180 1/200
101+
1/80 1/90 1/120 1/130 1/140
102+
1/70 1/80 1/100 1/120 1/120
103+
1/40 1/90 1/100 1/120 1/120
104+
1/40 1/80 1/100 1/120 1/120
105+
1/40 1/60 1/100 1/120 1/120
106+
1/80 1/90 1/120 1/130 1/140
107+
1/70 1/80 1/100 1/120 1/120
108+
1/40 1/90 1/100 1/120 1/120
109+
1/40 1/80 1/100 1/120 1/120
110+
1/40 1/60 1/100 1/120 1/120
111+
1/60 1/70 1/110 1/120 1/130
112+
1/40 1/80 1/100 1/120 1/120
113+
1/60 1/90 1/100 1/120 1/120
114+
1/40 1/80 1/100 1/120 1/120
115+
1/40 1/80 1/100 1/120 1/120]
116+
;; voice is 0 indexed, vowel_sound is 1 indexed
117+
vowel_freq_one (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 5)) freqs)
118+
vowel_freq_two (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 4)) freqs)
119+
vowel_freq_three (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 3)) freqs)
120+
vowel_freq_four (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 2)) freqs)
121+
vowel_freq_five (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 1)) freqs)
122+
vowel_amp_one (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 5)) amps)
123+
vowel_amp_two (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 4)) amps)
124+
vowel_amp_three (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 3)) amps)
125+
vowel_amp_four (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 2)) amps)
126+
vowel_amp_five (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 1)) amps)
127+
vowel_bw_one (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 5)) bws)
128+
vowel_bw_two (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 4)) bws)
129+
vowel_bw_three (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 3)) bws)
130+
vowel_bw_four (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 2)) bws)
131+
vowel_bw_five (select:kr (+ (* 5 voice) (- (* 5 vowel_sound) 1)) bws)
132+
amp-fudge 5
133+
[in-l in-r] (* (* amp-fudge pre_amp) (in in_bus 2))
134+
new-l (+ (b-band-pass in-l vowel_freq_one (* vowel_bw_one vowel_amp_one))
135+
(b-band-pass in-l vowel_freq_two (* vowel_bw_two vowel_amp_two))
136+
(b-band-pass in-l vowel_freq_three (* vowel_bw_three vowel_amp_three))
137+
(b-band-pass in-l vowel_freq_four (* vowel_bw_four vowel_amp_four))
138+
(b-band-pass in-l vowel_freq_five (* vowel_bw_five vowel_amp_five)))
139+
new-r (+ (b-band-pass in-r vowel_freq_one (* vowel_bw_one vowel_amp_one))
140+
(b-band-pass in-r vowel_freq_two (* vowel_bw_two vowel_amp_two))
141+
(b-band-pass in-r vowel_freq_three (* vowel_bw_three vowel_amp_three))
142+
(b-band-pass in-r vowel_freq_four (* vowel_bw_four vowel_amp_four))
143+
(b-band-pass in-r vowel_freq_five (* vowel_bw_five vowel_amp_five)))
144+
fin-l (x-fade2 in-l new-l (- (* mix 2) 1) (* amp-fudge amp))
145+
fin-r (x-fade2 in-r new-r (- (* mix 2) 1) (* amp-fudge amp))]
146+
(out out_bus [fin-l fin-r])))
147+
21148
(defsynth sonic-pi-fx_krush
22149
[amp 1
23150
amp_slide 0
@@ -1604,4 +1731,4 @@
16041731
(core/save-synthdef sonic-pi-fx_ring_mod)
16051732
(core/save-synthdef sonic-pi-fx_octaver)
16061733
(core/save-synthdef sonic-pi-fx_flanger)
1607-
)
1734+
(core/save-synthdef sonic-pi-fx_vowel))

0 commit comments

Comments
 (0)