crashing supercollider with FAILURE IN SERVER /s_new too many nodes

396 views
Skip to first unread message

Tom Willis

unread,
May 8, 2014, 6:39:08 PM5/8/14
to over...@googlegroups.com
Hello, 

First time poster here and very very amateur clojurist/overtonist

I've been playing around with ways to do composition/sequencing as a way to learn both clojure and overtone. 

here's the gist is what i've been doing. https://gist.github.com/twillis/065053bd0340fb28f10a

an instrument defined as

(definst flute [frequency 440 volume 1 length 1000]
(let [envelope (line volume 0 (/ length 1000))]
(* envelope (sin-osc frequency))))

and a play-notes function defined as

(defn play-notes [notes inst tempo & {:keys [start-at] :or {start-at 1}}]
(doseq [{note :note play-at :play-at} notes]
(at (beat->ms (+ start-at play-at) tempo)
(inst (pitch->hz (:pitch note))
(:volume note)
(duration->ms (:length note) tempo)))))
 

So now I think I dont quite understand how to play a note on a synth because I can routinely crash supercollider with the error "/s_new too many nodes" by repeatedly doing the following. (it's the intro to primary by the cure)  



(comment
(def bass-e (mk-bar (take 8 (repeat [:e2 :e3]))
(take 8 (repeat 2))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))))
 
(def bass-a (mk-bar (take 8 (repeat [:a2 :a3]))
(take 8 (repeat 2))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))))
(def bass-a2 (mk-bar [[:a2 :a3 :d4] [:a2 :a3 :d4] [:a2 :a3 :d4] [:a2 :a3 ::c#4] [:a2 :a3 ::c#4] [:a2 :a3 ::c#4] [:a2 :a3 :d4] [:a2 :a3 :d4]]
(take 8 (repeat 2))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))))
 
(def guitar-1 (mk-bar [[:e3 :e4 :e5] [:e3 :e4 :e5] [:e3 :e4 :e5] [:e3 :f#4 :f#5] [:e3 :f#4 :f#5] [:e3 :f#4 :f#5] [:e3 :e4 :e5] [:e3 :e4 :e5]]
(take 8 (repeat 3))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))
))
(def guitar-2 (mk-bar [[:e3 :g4 :g5] [:e3 :g4 :g5] [:e3 :g4 :g5] [:e3 :a4 :a5] [:e3 :a4 :a5] [:e3 :a4 :a5] [:e3 :g4 :g5] [:e3 :g4 :g5]]
(take 8 (repeat 3))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))
))
(def guitar-3 (mk-bar [[:e3 :d4 :d5] [:e3 :d4 :d5] [:e3 :d4 :d5] [:e3 :c#4 :c#5] [:e3 :c#4 :c#5] [:e3 :c#4 :c#5] [:e3 :d4 :d5] [:e3 :d4 :d5]]
(take 8 (repeat 3))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))
))
(def guitar-4 (mk-bar (take 8 (repeat [:e3 :b5 :b6]))
(take 8 (repeat 3))
(take 8 (repeat 1/2))
(take 8 (range 0 4 1/2))
))
(def m (metronome 180))
 
(play-bars (flatten (take 4 (repeat [bass-e bass-a bass-e bass-a2]))) flute m)
 
(play-bars [guitar-1 guitar-2 guitar-1 guitar-3 guitar-1 guitar-2 guitar-4 guitar-4] flute m :start-at 32)
)


looking in the server console for supercollider I can "dump node tree with controls" and see a flute inst node for every note I defined(which is a lot) So I'm pretty sure I'm not doing this right it feels similar to a memory leak. Any ideas? Guidance?

Tom Willis

Tom Willis

unread,
May 10, 2014, 10:04:21 AM5/10/14
to over...@googlegroups.com
So of course, going through the exercise of stating my problem for public consumption leads me to the solution. :)

For the curious :action FREE needs to be provided to the line function. YAY Learning.

(definst flute [frequency 440 volume 1 length 1000]
  (let [envelope (line volume 0 (/ length 1000)  :action FREE)] 
    (* envelope (sin-osc frequency))))
(def guitar-4 (mk-bar (take 8 (<span class="nb" style="box-sizing: border-box; color:
...
Reply all
Reply to author
Forward
0 new messages