|
|
|
@ -0,0 +1,165 @@
|
|
|
|
|
;;; my yesterday's attempt
|
|
|
|
|
|
|
|
|
|
(in-package #:cl-collider)
|
|
|
|
|
;; https://github.com/SCLOrkHub/SCLOrkSynths
|
|
|
|
|
;; https://github.com/SCLOrkHub/SCLOrkSynths/blob/master/SynthDefs/bass/acidOto3091.scd
|
|
|
|
|
|
|
|
|
|
(defsynth bdrum ((amp 0.5) (out 0) )
|
|
|
|
|
(out.ar out (* amp (sin-osc.ar (line.ar 120 60 1) 0 (env-gen.ar (env (list 0 1 0) (list 0.005 0.5)) :act :free)))))
|
|
|
|
|
(defsynth acid0to3091-my-attempt ((amp 0.5) (out 0) (gate 1) (freq 440) (pan 0) (att 0.001) (dec 0.5) (sus 0.1) (rel 0.5) (curve -4) (lagTime 0.12) (filterRange 6) (width 0.51) (rq 0.3))
|
|
|
|
|
(let* ((freq (lag.kr freq lagTime))
|
|
|
|
|
(ampEnv (env-gen.kr (adsr att dec sus rel amp 0) :gate gate))
|
|
|
|
|
(filterEnv (env-gen.kr (adsr att (* 2 dec) (/ sus 2) (* 2 rel) (expt 2 filterRange) (* -1 curve) 1) :gate gate :act :free))
|
|
|
|
|
(sndStep1 (_range nil (lf-pulse.ar freq 0.0 width) -1 1))
|
|
|
|
|
(sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq))
|
|
|
|
|
(sndStep3 (* sndStep2 ampEnv)))
|
|
|
|
|
(out.ar out (pan2.ar sndStep3 pan))))
|
|
|
|
|
;; (synth :acid0to3091-my-attempt :freq 80)
|
|
|
|
|
;; (stop)
|
|
|
|
|
|
|
|
|
|
;; after getting help with translation of other synth examples
|
|
|
|
|
(defsynth acid0to3091-from-getting-help ((amp 0.5) (out 0) (gate 1) (freq 440) (pan 0) (att 0.001) (dec 0.5) (sus 0.1) (rel 0.5) (curve -4) (lagTime 0.12) (filterRange 6) (width 0.51) (rq 0.3))
|
|
|
|
|
(let* ((freq (lag.kr freq lagTime))
|
|
|
|
|
(ampEnv (env-gen.kr (adsr att dec sus rel amp 0) :gate gate))
|
|
|
|
|
(filterEnv (env-gen.kr (adsr att (* 2 dec) (/ sus 2) (* 2 rel) (expt 2 filterRange) (list (* -1 curve) curve curve) 1) :gate gate :act :free))
|
|
|
|
|
(sndStep1 (range (lf-pulse.ar freq 0.0 width) -1 1))
|
|
|
|
|
(sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq))
|
|
|
|
|
(sndStep3 (* sndStep2 ampEnv)))
|
|
|
|
|
(out.ar out (pan2.ar sndStep3 pan))))
|
|
|
|
|
;; (synth :acid0to3091-from-getting-help :freq 80)
|
|
|
|
|
;; (stop)
|
|
|
|
|
;; and let's remove gate?
|
|
|
|
|
|
|
|
|
|
(defsynth acid0to3091-without-gate ((amp 0.5) (out 0) (freq 440) (pan 0) (att 0.001) (dec 0.5) (sus 0.1) (rel 0.5) (curve -4) (lagTime 0.12) (filterRange 6) (width 0.51) (rq 0.3))
|
|
|
|
|
(let* ((freq (lag.kr freq lagTime))
|
|
|
|
|
(ampEnv (env-gen.kr (adsr att dec sus rel amp 0)))
|
|
|
|
|
(filterEnv (env-gen.kr (adsr att (* 2 dec) (/ sus 2) (* 2 rel) (expt 2 filterRange) (list (* -1 curve) curve curve) 1) :act :free))
|
|
|
|
|
(sndStep1 (range (lf-pulse.ar freq 0.0 width) -1 1))
|
|
|
|
|
(sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq))
|
|
|
|
|
(sndStep3 (* sndStep2 ampEnv)))
|
|
|
|
|
(out.ar out (pan2.ar sndStep3 pan))))
|
|
|
|
|
;; (synth :acid0to3091-without-gate :freq 80)
|
|
|
|
|
;; (stop)
|
|
|
|
|
;; just removing gate does nothing? so maybe gate should be controlled from patterns? by pasting in another
|
|
|
|
|
;; and sound the same, so I'd need to put in maybe an envelope? in a pattern?
|
|
|
|
|
|
|
|
|
|
(in-package #:cl-patterns)
|
|
|
|
|
(pb :foo-with-acid
|
|
|
|
|
|
|
|
|
|
:instrument :acid0to3091-from-getting-help
|
|
|
|
|
:play-quant 4
|
|
|
|
|
:freq (pseq (list 40 50 60 70 80) 1)
|
|
|
|
|
:dur (pseq (list 1 2))
|
|
|
|
|
)
|
|
|
|
|
;; (play :foo-with-acid)
|
|
|
|
|
;; (end :foo-with-acid)
|
|
|
|
|
;;
|
|
|
|
|
;; wait, so it does work? maybe because "gate" is default parameter
|
|
|
|
|
;; that gets created when events with duration get created?
|
|
|
|
|
|
|
|
|
|
;;; fmbass after getting help:
|
|
|
|
|
(in-package #:cl-collider)
|
|
|
|
|
;;; my attempt
|
|
|
|
|
;;; https://github.com/SCLOrkHub/SCLOrkSynths/blob/master/SynthDefs/bass/bassWarsaw.scd
|
|
|
|
|
(defsynth fmBass-my-attempt ((out 0) (freq 440) (gate 1) (amp 0.5) (pan 0) (att 0.01) (dec 0.3) (sus 0.4) (rel 0.1) (slideTime 0.17) (cutoff 1100) (width 0.15) (detune 1.005) (preamp 4))
|
|
|
|
|
(let* ((env (env-gen.kr (adsr att dec sus rel) :gate gate :act :free))
|
|
|
|
|
(freq (lag.kr freq slideTime))
|
|
|
|
|
(sndStep1 (var-saw.ar freq 0 width preamp))
|
|
|
|
|
(sndStep2 (distort sndStep1))
|
|
|
|
|
(sndStep3 (* sndStep2 env))
|
|
|
|
|
(sndStep4 (lpf.ar sndStep3 cutoff amp)))
|
|
|
|
|
(out.ar out (pan2.ar sndStep4 pan))))
|
|
|
|
|
;; (synth :fmBass-my-attempt :freq 80)
|
|
|
|
|
;; (stop)
|
|
|
|
|
(defsynth fmBass ((out 0) (freq 440) (gate 1) (amp 0.5) (pan 0) (att 0.01) (dec 0.3) (sus 0.4) (rel 0.1) (slideTime 0.17) (cutoff 1100) (width 0.15) (detune 1.005) (preamp 4))
|
|
|
|
|
(let* ((env (env-gen.kr (adsr att dec sus rel) :gate gate :act :free))
|
|
|
|
|
(freq (lag.kr freq slideTime))
|
|
|
|
|
(sndStep1 (var-saw.ar (list freq (* freq detune)) 0 width preamp))
|
|
|
|
|
(sndStep2 (distort (mix sndStep1)))
|
|
|
|
|
(sndStep3 (* sndStep2 env))
|
|
|
|
|
(sndStep4 (lpf.ar sndStep3 cutoff amp)))
|
|
|
|
|
(out.ar out (pan2.ar sndStep4 pan))))
|
|
|
|
|
;; (synth :fmBass :freq 80)
|
|
|
|
|
;; (stop)
|
|
|
|
|
|
|
|
|
|
(in-package #:cl-patterns)
|
|
|
|
|
(pb :foo-with-fmbass
|
|
|
|
|
:instrument :fmBass
|
|
|
|
|
:play-quant 4
|
|
|
|
|
:legato 1
|
|
|
|
|
:freq (pseq (list 40 50 60 70 80) 1)
|
|
|
|
|
:dur 1 ;; (pseq (list 1 2 3))
|
|
|
|
|
)
|
|
|
|
|
;; (play :foo-with-fmbass)
|
|
|
|
|
;; (end :foo-with-fmbass)
|
|
|
|
|
|
|
|
|
|
;; changing :legato between 1 0.7 0.4 0.2
|
|
|
|
|
;; and duration between 1 0.5 0.2
|
|
|
|
|
;; produces cool sounds, and reevaluation while thing runs on #'PLAY is super cool
|
|
|
|
|
;;
|
|
|
|
|
;; apart from pitch model I'd like to learn how to merge patterns, so that all notes of phrase would play on one setting for :dur & :legato
|
|
|
|
|
;; then on others,
|
|
|
|
|
|
|
|
|
|
(in-package #:cl-collider)
|
|
|
|
|
;; https://github.com/SCLOrkHub/SCLOrkSynths/blob/master/SynthDefs/bells/glockenspiel.scd
|
|
|
|
|
;; Skipping because of dyn-klang.ar ? not having arguments?
|
|
|
|
|
;; (defsynth glockenspiel ((freq 440) (amp 0.01) (pan 0) (out 0) (att 0.001) (rel 6) (exciterRel 0.05))
|
|
|
|
|
;; (let* ((envelope (env-gen.kr (perc att exciterRel 0.25)))
|
|
|
|
|
;; (exciter (white-noise.ar envelope))
|
|
|
|
|
;; (snd (dyn-klang.ar (list (list 1 2 2.803 3.871 5.074 7.81 10.948 14.421) ;; harmonics
|
|
|
|
|
;; (list 1 0.044 0.891 0.0891 0.794 0.1 0.281 0.079) ;; amplitudes
|
|
|
|
|
;; (list 1 0.205 1 0.196 0.339 0.047 0.058 0.047)) ;; ring times
|
|
|
|
|
|
|
|
|
|
;; )))))
|
|
|
|
|
|
|
|
|
|
;; too bad example has /input and /freqoffset : http://doc.sccode.org/Classes/DynKlank.html
|
|
|
|
|
;; (defsynth whelp ((freq 40) (rel 6))
|
|
|
|
|
;; (out.ar 1 (dyn-klang.ar (list (list 1 2 2.803 3.871 5.074 7.81 10.948 14.421) ;; harmonics
|
|
|
|
|
;; (list 1 0.044 0.891 0.0891 0.794 0.1 0.281 0.079) ;; amplitudes
|
|
|
|
|
;; (list 1 0.205 1 0.196 0.339 0.047 0.058 0.047)) ;; ring times
|
|
|
|
|
|
|
|
|
|
;; freq rel)))
|
|
|
|
|
|
|
|
|
|
;; (synth :whelp)
|
|
|
|
|
;; (stop)
|
|
|
|
|
|
|
|
|
|
;;; so, let's go with another?
|
|
|
|
|
;; https://github.com/SCLOrkHub/SCLOrkSynths/blob/master/SynthDefs/guitar/pluck.scd
|
|
|
|
|
(defsynth pluck-synth-sample ((amp 0.1) (freq 440) (decay 5) (coef 0.1) (pan 0))
|
|
|
|
|
(let* ((envelope (env-gen.kr (linen 0 decay 0) :act :free))
|
|
|
|
|
(snd-step-1 (pluck.ar (white-noise.ar amp) (impulse.kr 0) 0.1 (reciprocal freq) decay coef))
|
|
|
|
|
(snd-step-2 (pan2.ar snd-step-1 pan)))
|
|
|
|
|
(out.ar 0 (list snd-step-2 snd-step-2))))
|
|
|
|
|
;;; ??? Big question: what's with the ENVELOPE that is not inputed anywhere
|
|
|
|
|
;; (synth :pluck-synth-sample :freq 360 :decay 9)
|
|
|
|
|
;; (stop)
|
|
|
|
|
|
|
|
|
|
(in-package #:cl-patterns)
|
|
|
|
|
(pb :foo-with-pluck-synth
|
|
|
|
|
:instrument :pluck-synth-sample
|
|
|
|
|
:play-quant 4
|
|
|
|
|
;; :legato 1
|
|
|
|
|
:decay 2
|
|
|
|
|
:freq (pseq (list 340 350 360 370 380) 1)
|
|
|
|
|
:dur 2 ;; (pseq (list 1 2 3))
|
|
|
|
|
)
|
|
|
|
|
;; (play :foo-with-pluck-synth)
|
|
|
|
|
;; (end :foo-with-pluck-synth)
|
|
|
|
|
;; (stop :foo-with-pluck-synth)
|
|
|
|
|
|
|
|
|
|
;;; let's get some chords, from a previous day and stop for tonight
|
|
|
|
|
;; so, from 08.19
|
|
|
|
|
|
|
|
|
|
(pb :what-predef-chord
|
|
|
|
|
:instrument :pluck-synth-sample
|
|
|
|
|
:note (pseq (mapcar #'chord-notes (list (chord "Major Triad") (chord "Minor Triad") (chord "Minor 7th") (chord "Major 7th") (chord "Diminished Triad") (chord "Major Triad"))) 1)
|
|
|
|
|
:octave 4
|
|
|
|
|
:root 2
|
|
|
|
|
:decay (pseq (list 2 2 4))
|
|
|
|
|
:dur (pseq (list 2 2 4))
|
|
|
|
|
;; :play-quant 4
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; (play :what-predef-chord)
|
|
|
|
|
;; (end :what-predef-chord)
|
|
|
|
|
;; (stop :what-predef-chord)
|