Created
October 24, 2011 21:24
-
-
Save mjg123/1310358 to your computer and use it in GitHub Desktop.
confusion in overtone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def my-bus (audio-bus)) | |
;; produce a signal & put it into the bus | |
(defsynth sig-gen [out-bus 0 cps 440 dur 1] | |
(let [env (env-gen (envelope [1 0.00001] [dur] :exponential)) | |
sig (* env (saw cps))] | |
(out out-bus sig))) | |
;; something to read the bus & make it audible | |
(defsynth send-out [in-bus 3] | |
(let [src (in in-bus)] | |
(out 0 src))) | |
;; switch it on | |
(send-out my-bus) | |
;; looper will call sig-gen repeatedly | |
(defn looper [b] | |
(sig-gen my-bus) | |
(apply-at (m (inc b)) #'looper (inc b) [])) | |
(def m (metronome 128)) | |
(looper (m)) | |
;; but I only get a small snippet of sound out when I call | |
;; (send-out my-bus) | |
;; why? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment