Created
November 29, 2015 07:17
-
-
Save martensjostrand/004c0e557447fcc71947 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(ns overtone-failure.failure | |
"Simple but resource comsuming beat..." | |
(:use [overtone.live])) | |
; This loop plays until SC fail with "FAILUE /s_new too many nodes" | |
; when node 1025 is created | |
; (event-debug-on) gives 1024 | |
; event: [:overtone :osc-msg-received] (:msg {:path "/n_go", :type-tag "iiiii", :args (1023 32 1021 -1 0)}) | |
; | |
; event: "/n_go" (:path "/n_go" :args (1023 32 1021 -1 0)) | |
; | |
; event: [:overtone :node-created 1023] ({:node #<synth-node[live]: repl-test.core/kick 1023>}) | |
; | |
; event: [:overtone :osc-msg-received] (:msg {:path "/n_go", :type-tag "iiiii", :args (1024 36 1022 -1 0)}) | |
; | |
; event: "/n_go" (:path "/n_go" :args (1024 36 1022 -1 0)) | |
; | |
; event: [:overtone :node-created 1024] ({:node #<synth-node[live]: repl-test.core/c-hat 1024>}) | |
; Why aren't the nodes released? Am I missusing :action FREE or is the player broken? | |
; When I issue a single hit, (c-hat), I see the following events: | |
; event: [:overtone :osc-msg-received] (:msg {:path "/n_go", :type-tag "iiiii", :args (2097 36 -1 -1 0)}) | |
; | |
; event: "/n_go" (:path "/n_go" :args (2097 36 -1 -1 0)) | |
; | |
; event: [:overtone :node-created 2097] ({:node #<synth-node[live]: overtone-failure.failure/c-hat 2097>}) | |
(definst kick [freq 100 bend 1.7 dur 0.5] | |
(let [freq-env (* bend freq (env-gen (adsr 0 (* 0.5 dur) 0 0))) | |
amp-env (env-gen (adsr 0.02 dur 0 0.1) :action FREE) | |
src (sin-osc freq-env)] | |
(* amp-env src))) | |
(definst c-hat [amp 0.8 t 0.08] | |
(let [env (env-gen (adsr 0.02 t 0 0 :curve -10) :action FREE) | |
noise (white-noise) | |
filt (hpf noise 9000)] | |
(* amp env filt))) | |
(def metro (metronome 135)) | |
(defn player [beat] | |
; (at (metro beat) (kick)) | |
(at (metro (+ 0.5 beat)) (c-hat)) | |
(apply-by (metro (inc beat)) #'player (inc beat) [])) | |
(comment | |
(c-hat) | |
(stop) | |
(player (metro)) | |
(event-debug-on) | |
(event-debug-off) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment