Skip to content

Commit

Permalink
Adjust range for resonace and filter attack to reduce clicks. #36
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Santos committed Sep 24, 2012
1 parent ed81e18 commit 03583d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/minibeast/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@

(defn filter-controls []
[(Control. 545 35 :knob (mk-pos-only-knob "Cutoff") synth-voices :cutoff (fn [val] (* (- val 10) 100.0)))
(Control. 613 35 :knob (mk-pos-only-knob "Resonance") synth-voices :resonance (fn [val] (/ val 32.0)))
(Control. 613 35 :knob (mk-pos-only-knob "Resonance") synth-voices :resonance (fn [val] (/ val 127.0)))
(Control. 545 102 :knob (mk-plus-minus-knob "ENV Amt") synth-voices :cutoff-env (fn [val] (* (- val 64.0) 200.0)))
(Control. 613 102 :knob (mk-plus-minus-knob "KBD Tracking" {:start-sym "0%"
:end-sym "200%"
Expand Down Expand Up @@ -626,14 +626,14 @@
(fn [val] (* 127.0 (:sub-osc-amp @synth-state))))])

(defn filter-asdr-controls []
[(Control. 565 265 :slider {:caption "Attack"} synth-voices :filter-attack (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 1.0) 12.0)))
[(Control. 565 265 :slider {:caption "Attack"} synth-voices :filter-attack (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 0.9) 12.0)))
(Control. 605 265 :slider {:caption "Decay"} synth-voices :filter-decay (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 1.0) 12.0)))
(Control. 645 265 :slider {:caption "Sustain"} synth-voices :filter-sustain (fn [val] (/ val 127.0)))
(Control. 685 265 :slider {:caption "Release"} synth-voices :filter-release (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 1.0) 12.0)))])


(defn amp-adsr-controls []
[(Control. 770 265 :slider {:caption "Attack"} synth-voices :amp-attack (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 1.0) 12.0)))
[(Control. 770 265 :slider {:caption "Attack"} synth-voices :amp-attack (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 0.9) 12.0)))
(Control. 810 265 :slider {:caption "Decay"} synth-voices :amp-decay (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 1.0) 12.0)))
(Control. 850 265 :slider {:caption "Sustain"} synth-voices :amp-sustain (fn [val] (/ val 127.0)))
(Control. 890 265 :slider {:caption "Release"} synth-voices :amp-release (fn [val] (/ (- (Math/pow 1.01 (* val 5.0)) 1.0) 12.0)))])
Expand Down
8 changes: 4 additions & 4 deletions src/minibeast/mbsynth.clj
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@
(* lfo2filter LFO)
(* cutoff-tracking note-freq)
(* cutoff-env FILTER-ADSR))))
filter-bank [(rlpf:ar VCO+fback vcf-freq (* -1 (- resonance 4)))
(bpf:ar VCO+fback vcf-freq (* -1 (- resonance 4)))
(rhpf:ar VCO+fback vcf-freq (* -1 (- resonance 4)))
(brf:ar VCO+fback vcf-freq (* -1 (- resonance 4)))]
filter-bank [(rlpf:ar VCO+fback vcf-freq (- 1.0 resonance))
(bpf:ar VCO+fback vcf-freq (- 1.1 resonance));;(/ 1.0 resonance))
(rhpf:ar VCO+fback vcf-freq (- 1.0 resonance))
(brf:ar VCO+fback vcf-freq (- 1.0 resonance))]
VCF (select filter-type filter-bank)

VIBRATO-LFO (+ 1 (* vibrato-amp (sin-osc:kr vibrato-rate)))
Expand Down

0 comments on commit 03583d5

Please sign in to comment.