Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow free-self to take audio-rate signals (#515) #516

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

diegovdc
Copy link
Contributor

This fixes #515.

(comment
  (o/connect-external-server)

  (o/defsynth rev-perc []
    (let [sig (-> (o/sin-osc 200)
                  (o/pan2:ar)
                  (* 0.2 (o/env-gen (o/env-perc)))
                  (o/free-verb 0.5 3))]
      (o/free-self (* (o/detect-silence (+ sig (o/impulse 0)))))
      (o/out 0 sig)))

  (def node (rev-perc))
  ;; after a while
  (println node) ;; #<synth-node[destroyed]: external.dev/rev-perc 107>  
)

@diegovdc
Copy link
Contributor Author

There may be other cases like this. To make the code more easy to maintain I would suggest refactoring this into a function that can be more easily configured:

;; Special case the a2k ugen
(and (= "A2K" (:name ugen))
(= :ar (:rate-name bad-input)))
;; Special case the FFT ugen which may have ar ugens plugged into it
(and (= "FFT" (:name ugen))
(= :ar (:rate-name bad-input)))
;; Special case demand rate ugens which may have kr ugens plugged into them
(and (= :dr cur-rate)
(= :kr (:rate-name bad-input)))
;; Special case Amplitude ugen which may have ar ugens plugged into it
(and (= "Amplitude" (:name ugen))
(= :ar (:rate-name bad-input)))
;; Special case Coyote ugen which may have ar ugens plugged into it
(and (= "Coyote" (:name ugen))
(= :ar (:rate-name bad-input)))
;; Special case Pitch ugen which may have ar ugens plugged into it
(and (= "Pitch" (:name ugen))
(= :ar (:rate-name bad-input)))
;; Special case FreeSelf ugen which may have ar ugens plugged into it
(and (= "FreeSelf" (:name ugen))
(= :ar (:rate-name bad-input)))
;; Special case LocalBuf which may have kr ugens plugged in
;; but further modifications aren't honoured
(and (= "LocalBuf" (:name ugen))
(= :kr (:rate-name bad-input))))

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

free-self doesn't work as expected
1 participant