Skip to content

Commit 79732b7

Browse files
committed
FX - add experimental guitar saw synth
Will potentially be used as a base for future pitch-detection-style synths/FX
1 parent f87ad63 commit 79732b7

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

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

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,135 @@
145145

146146

147147
)
148+
149+
(without-namespace-in-synthdef
150+
(core/def-fx sonic-pi-fx_guitar_saw
151+
[]
152+
[
153+
amp (* 1 (lag (amplitude dry-r)))
154+
155+
dry-r (* 1 (compander dry-r dry-r
156+
0.2 ;; thresh
157+
10 ;; slope below
158+
1 ;; slope above
159+
0.01 ;; clamp-time
160+
0.01))
161+
162+
dry-r (* 1 (compander dry-r dry-r
163+
0.2 ;; thresh
164+
1 ;; slope below
165+
0.5 ;; slope above
166+
0.01 ;; clamp-time
167+
0.01)) ;; relax-time
168+
dry-r (lpf dry-r 800)
169+
dry-r (hpf dry-r 80)
170+
171+
freq (pitch dry-r
172+
100 ;; :init-freq 100
173+
60 ;; :min-freq 80
174+
1300 ;; :max-freq 1200
175+
400 ;; :exec-freq 100
176+
32 ;; :max-bins-per-octave 32
177+
1 ;; :median 1
178+
0.01 ;; :amp-threshold 0.01
179+
0.1 ;; :peak_threshold 0.01
180+
0 ;; :down-sample 1
181+
7) ;; :clar 0
182+
183+
184+
freq (lag freq 0.01)
185+
186+
snd (* 1 amp (+ (saw freq)
187+
(+ 5 (saw freq))
188+
(* 2 (saw (/ freq 2)))))
189+
190+
191+
;; snd (* 1 amp (+ (lf-tri freq)
192+
;; (+ 5 (lf-tri freq))
193+
;; (* 2 (lf-tri (/ freq 2)))))
194+
195+
196+
snd (* 1 amp (+ (sin-osc freq)
197+
(sin-osc (* 4 freq))
198+
(* 4 (sin-osc (/ freq 2)))
199+
))
200+
[wet-l wet-r] (pan2 snd)])
201+
202+
(core/save-synthdef sonic-pi-fx_guitar_saw)
203+
204+
)
205+
206+
(without-namespace-in-synthdef
207+
(core/def-fx sonic-pi-fx_guitar_saw2
208+
[octave 0
209+
default_note 48]
210+
[
211+
amp (* 1 (lag (amplitude dry-r)))
212+
213+
;; dry-r (* 1 (compander dry-r dry-r
214+
;; 0.2 ;; thresh
215+
;; 10 ;; slope below
216+
;; 1 ;; slope above
217+
;; 0.01 ;; clamp-time
218+
;; 0.01))
219+
220+
dry-r (* 1 (compander dry-r dry-r
221+
0.2 ;; thresh
222+
1 ;; slope below
223+
0.5 ;; slope above
224+
0.01 ;; clamp-time
225+
0.01)) ;; relax-time
226+
227+
min-freq 20
228+
max-freq 400
229+
;; guitar values
230+
;; dry-r (lpf dry-r 1200)
231+
;; dry-r (hpf dry-r 80)
232+
233+
;; bass values
234+
dry-r (lpf dry-r max-freq)
235+
dry-r (hpf dry-r min-freq)
236+
init-freq (midicps default_note)
237+
freq (pitch dry-r
238+
73.416 ;; :init-freq 100
239+
20 ;; :min-freq 80
240+
400 ;; :max-freq 1200
241+
100 ;; :exec-freq 100
242+
32 ;; :max-bins-per-octave 32
243+
1 ;; :median 1
244+
0.01 ;; :amp-threshold 0.01
245+
0.1 ;; :peak_threshold 0.01
246+
1 ;; :down-sample 1
247+
7)
248+
freq (lag freq 0.05)
249+
freq-nd (send-reply (impulse:kr 4) "/scsynth/freq" [freq])
250+
; freq (lag (* (+ octave 1) (/ freq 4)) 0.01)
251+
252+
253+
saws (* 1 amp (+ (saw freq) (+ 5 (saw freq))
254+
(* 2 (saw (/ freq 2)))))
255+
256+
257+
tris (* 1 amp (+ (lf-tri freq)
258+
(+ 5 (lf-tri freq))
259+
(* 2 (lf-tri (/ freq 2)))))
260+
261+
sqrs (* 1 amp (+ (pulse freq)
262+
(+ 5 (pulse freq))
263+
(* 2 (pulse (/ freq 2)))))
264+
265+
266+
sins (* 1 amp (+ (sin-osc freq)
267+
;; (sin-osc (* 4 freq))
268+
;; (* 4 (sin-osc (/ freq 2)))
269+
))
270+
271+
272+
273+
snd sqrs
274+
275+
[wet-l wet-r] (pan2 snd)])
276+
277+
(core/save-synthdef sonic-pi-fx_guitar_saw)
278+
279+
)

0 commit comments

Comments
 (0)