This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-16
Channels
- # announcements (22)
- # beginners (4)
- # biff (4)
- # cider (5)
- # clerk (3)
- # clojure (28)
- # clojure-chennai (1)
- # clojure-europe (23)
- # clojure-gamedev (7)
- # clojure-korea (5)
- # clojure-madison (3)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (49)
- # clojure-sweden (7)
- # clojure-uk (4)
- # clojuredesign-podcast (14)
- # clojurescript (10)
- # clr (5)
- # cursive (4)
- # datascript (17)
- # datomic (2)
- # events (1)
- # garden (1)
- # introduce-yourself (2)
- # jobs-discuss (14)
- # lsp (23)
- # malli (14)
- # missionary (9)
- # off-topic (109)
- # overtone (7)
- # polylith (5)
- # releases (5)
- # shadow-cljs (7)
- # sql (13)
- # testing (30)
- # xtdb (10)
- # yamlscript (44)
How do I control the volume of an instrument after the fx chain? I have an instrument with an fx after, Im naively thinking (set-volume! myinst) will lower the volume of the entire inst+fx, but that doesnt seem to happen.
removing the fx, i can again control vol
haven't really looked into how inst+fx works, or how the volume on instruments is handled... you want a volume control after the fx?
thats my naive assumption that i get a mixer at the end of the fx chain yes
I made a new track, and I restarted the sc and clj runtimes a couple of times because problems. I noticed that after restart, the mixer behaves a little bit more intuitive, that is (set-volume) controls the volume of an instrument after the effect chain again. So
there is something weird somewhere here, but I dont know what
I don’t use definst
though, but if you are having trouble, you can use defsynth
. The former, from my very limited knowledge about it, just removes a bit of boilerplate, and perhaps it makes more assumptions than necessary. The latter is a bit more lower level, but very flexible. Never had the sort of bugs that you mention.
However, if you want to have your fx separate from your sources, you will need to learn a bit more about groups and routing, but if you want to integrate your fx into your synth, it’s fairly easy, and you can copy-paste the fx that you want. Thats the simplest, and can provide as much control as you need.
For example say you have this synth (omitting any envelope to avoid cluttering the example):
(defsynth siny [freq 200 amp 0.2]
(out 0 (-> (sin-osc freq) (* amp))
And you want to add the freeverb fx to it:
(defsynth fx-freeverb
"Uses the free-verb ugen."
[bus 0 wet-dry 0.5 room-size 0.5 dampening 0.5]
(let [source (in bus)
verbed (free-verb source wet-dry room-size dampening)]
(replace-out bus (* 1.4 verbed))))
Then you can just do this:
(defsynth siny
[freq 200 amp 0.2 wet-dry 0.5 room-size 0.5 dampening 0.5]
(out 0 (-> (sin-osc freq)
(free-verb wet-dry room-size dampening)
(* amp))
And this allows for cool modifications, like if you want to modulate the room-size
:
(defn lfo-kr [freq min* max*]
(lin-lin:kr (lf-noise1:kr freq) -1 1 min* max*))
(defsynth siny
[freq 200 amp 0.5 wet-dry 0.5 dampening 0.5]
(out 0 (-> (sin-osc freq)
(free-verb wet-dry (lfo-kr 2 0.3 1) dampening)
(* amp))
And of course you can control the amplitude:
(def synth1 (siny))
(ctl synth1 :amp 0.5)
;; or even better
(ctl synth1 :amp (dbamp -6))
So you actually get a lot more control than using the standard fx. Of course you can make your own fx, but one thing I like about not having ready made fx is that it forces me to decide about things and that leads to creative choices.