trying for more intstruments, getting pluck string

This commit is contained in:
efim 2022-09-02 19:23:30 +00:00
parent 6d54d6bf37
commit 99dff2c53b
1 changed files with 74 additions and 10 deletions

View File

@ -14,8 +14,8 @@
(sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq)) (sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq))
(sndStep3 (* sndStep2 ampEnv))) (sndStep3 (* sndStep2 ampEnv)))
(out.ar out (pan2.ar sndStep3 pan)))) (out.ar out (pan2.ar sndStep3 pan))))
(synth :acid0to3091-my-attempt :freq 80) ;; (synth :acid0to3091-my-attempt :freq 80)
(stop) ;; (stop)
;; after getting help with translation of other synth examples ;; 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)) (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))
@ -26,8 +26,8 @@
(sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq)) (sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq))
(sndStep3 (* sndStep2 ampEnv))) (sndStep3 (* sndStep2 ampEnv)))
(out.ar out (pan2.ar sndStep3 pan)))) (out.ar out (pan2.ar sndStep3 pan))))
(synth :acid0to3091-from-getting-help :freq 80) ;; (synth :acid0to3091-from-getting-help :freq 80)
(stop) ;; (stop)
;; and let's remove gate? ;; 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)) (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))
@ -38,8 +38,8 @@
(sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq)) (sndStep2 (rlpf.ar sndStep1 (* freq filterEnv) rq))
(sndStep3 (* sndStep2 ampEnv))) (sndStep3 (* sndStep2 ampEnv)))
(out.ar out (pan2.ar sndStep3 pan)))) (out.ar out (pan2.ar sndStep3 pan))))
(synth :acid0to3091-without-gate :freq 80) ;; (synth :acid0to3091-without-gate :freq 80)
(stop) ;; (stop)
;; just removing gate does nothing? so maybe gate should be controlled from patterns? by pasting in another ;; 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? ;; and sound the same, so I'd need to put in maybe an envelope? in a pattern?
@ -69,8 +69,8 @@
(sndStep3 (* sndStep2 env)) (sndStep3 (* sndStep2 env))
(sndStep4 (lpf.ar sndStep3 cutoff amp))) (sndStep4 (lpf.ar sndStep3 cutoff amp)))
(out.ar out (pan2.ar sndStep4 pan)))) (out.ar out (pan2.ar sndStep4 pan))))
(synth :fmBass-my-attempt :freq 80) ;; (synth :fmBass-my-attempt :freq 80)
(stop) ;; (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)) (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)) (let* ((env (env-gen.kr (adsr att dec sus rel) :gate gate :act :free))
(freq (lag.kr freq slideTime)) (freq (lag.kr freq slideTime))
@ -79,8 +79,8 @@
(sndStep3 (* sndStep2 env)) (sndStep3 (* sndStep2 env))
(sndStep4 (lpf.ar sndStep3 cutoff amp))) (sndStep4 (lpf.ar sndStep3 cutoff amp)))
(out.ar out (pan2.ar sndStep4 pan)))) (out.ar out (pan2.ar sndStep4 pan))))
(synth :fmBass :freq 80) ;; (synth :fmBass :freq 80)
(stop) ;; (stop)
(in-package #:cl-patterns) (in-package #:cl-patterns)
(pb :foo-with-fmbass (pb :foo-with-fmbass
@ -99,3 +99,67 @@
;; ;;
;; 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 ;; 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, ;; 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)