Permalink
Browse files

merging new interop and trying to get blues running smoothly

  • Loading branch information...
1 parent 8415278 commit 0ae544b5f25c01db7af1d4ae8df4b9dc8fa4060c @rosejn rosejn committed Mar 6, 2011
View
@@ -8,7 +8,7 @@
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
; [overtone/scsynth-jna "0.1.2-SNAPSHOT"]
- [overtone/scsynth-interop "git-SNAPSHOT"]
+ [overtone/scsynth-interop "0.3.1-SNAPSHOT"]
[overtone/osc-clj "0.3.0-SNAPSHOT"]
[overtone/byte-spec "0.2.0-SNAPSHOT"]
[overtone/midi-clj "0.2.0-SNAPSHOT"]
@@ -6,9 +6,11 @@
env (env-gen (perc (/ dur 2.0) (/ dur 2.0)) :action :free)]
(out 0 (pan2 (* env snd)))))
+(def alien-buf (buffer 2048))
+
(defsynth alien-computer [trig 0.3]
(out 0 (pan2 (ifft
- (pv-rand-comb (fft 0 (white-noise))
+ (pv-rand-comb (fft alien-buf (white-noise))
0.95 (impulse:kr trig))))))
(defsynth rise-fall-pad [freq 440 t 4 amt 0.3 amp 0.8]
@@ -31,7 +33,7 @@
env (env-gen 1 1 0 1 2 (perc 0.01 (/ dur 1000)))]
(out 0 (pan2 (* env (+ a b))))))
-(definst bass [freq 120 t 0.6 amp 0.2]
+(definst bass [freq 120 t 0.6 amp 0.5]
(let [env (env-gen (perc 0.08 t) :action :free)
src (saw [freq (* 0.98 freq) (* 2.015 freq)])
src (clip2 (* 1.3 src) 0.8)
View
@@ -9,7 +9,7 @@
[java.util.regex Pattern]
[java.util.concurrent TimeUnit TimeoutException]
[java.io BufferedInputStream]
- [supercollider.scsynth ScSynth ScSynthStartedListener MessageReceivedListener])
+ [supercollider.scsynth ScSynth ScSynthStartedListener ScSynthMessageReceivedListener])
(:require [overtone.log :as log])
(:use
[overtone event config setup util time-utils]
@@ -133,7 +133,7 @@
(.send @sc-world* buffer))
peer (assoc (osc-peer) :send-fn send-fn)]
(.addMessageReceivedListener @sc-world*
- (proxy [MessageReceivedListener] []
+ (proxy [ScSynthMessageReceivedListener] []
(messageReceived [buf size]
(event :osc-msg-received
:msg (osc-decode-packet buf)))))
@@ -93,7 +93,8 @@
[ugens constants]
(let [pan-chans (pan2 root)
pan (:ugen (first pan-chans))]
- [(conj ugens pan (out MIXER-BUS pan-chans)) (set (floatify (conj constants MIXER-BUS 1)))]))))
+ [(conj ugens pan (out MIXER-BUS pan-chans))
+ (set (floatify (conj constants MIXER-BUS 1 0)))]))))
(defmacro inst [sname & args]
`(let [[sname# params# ugens# constants#] (pre-synth ~sname ~@args)
@@ -86,7 +86,7 @@
(defn apply-at
"Calls (apply f args argseq) as soon after ms-time (timestamp in milliseconds) as possible."
{:arglists '([ms-time f args* argseq])}
- [#^clojure.lang.IFn ms-time f & args]
+ [ms-time #^clojure.lang.IFn f & args]
(let [delay-time (- ms-time *APPLY-AHEAD* (now))]
(if (<= delay-time 0)
(apply f (#'clojure.core/spread args))
View
@@ -8,8 +8,8 @@
env (env-gen (perc 0.3 2) :action :free)]
(* vol src env)))
-(defn play [synth pitch-classes]
- (doall (map #(synth %) pitch-classes)))
+(defn play [synth pitch-classes & args]
+ (doall (map #(apply synth % args) pitch-classes)))
(defn play-seq [count synth notes vels durs time odds]
(when (and notes durs)
@@ -36,7 +36,10 @@
(play synth pitch :amp vel))
(at (+ time (* 0.5 dur))
(c-hat 0.1))
- (apply-at n-time #'play-seq (mod (inc count) 4) synth (next notes) (next vels) (next durs) n-time odds []))))
+ (apply-at n-time #'play-seq
+ (mod (inc count) 4) synth
+ (next notes) (next vels) (next durs)
+ n-time odds []))))
; TODO: Strum the chord
@@ -65,9 +68,10 @@
octave)))
(defn blue-beep []
- (play-seq beep
+ (play-seq 0 beep
(cycle (map sort (progression blues-chords :a 3 :ionian)))
(cycle [1200 1204 1195 1206])
+ (cycle [300])
(now)
0.2))
@@ -78,7 +82,8 @@
(play-seq 0 ks1-demo
(cycle (map sort (progression blues-chords :a 2 :ionian)))
(cycle [530 524 532 528])
+ (cycle [400])
(now)
0.5))
-(blue-ks1)
+;(blue-ks1)

0 comments on commit 0ae544b

Please sign in to comment.