Skip to content
Browse files

untabify

  • Loading branch information...
1 parent 0bd7763 commit 757ed05b21b0c9e2dcb5bd3967ed35af05966c8b @bgruber bgruber committed Nov 11, 2010
View
2 src/main/clojure/lazytest_listen.clj
@@ -10,4 +10,4 @@
(defn fraction-failed [r]
(let [{:keys [total fail]} (lr/summarize r)]
- (/ fail total)))
+ (/ fail total)))
View
32 src/main/clojure/lazytest_listen/harmony.clj
@@ -1,14 +1,14 @@
(ns lazytest-listen.harmony
(:require [com.stuartsierra.lazytest [watch :as lw]])
(:use [com.iheardata.lazytest-listen]
- [clojure.set :only (difference)])
+ [clojure.set :only (difference)])
(:import [javax.sound.midi MidiSystem]))
(def chords [#{48 55 64 72}
- #{48 55 64 71}
- #{48 55 63 71}
- #{48 54 63 71}
- #{48 54 63 67 71}])
+ #{48 55 64 71}
+ #{48 55 63 71}
+ #{48 54 63 71}
+ #{48 54 63 67 71}])
(def prog 69)
(def init-vol 15)
@@ -21,7 +21,7 @@
new-pitches are sets of integers representing MIDI pitches."
[old-pitches new-pitches note-on-velocity channel]
(doseq [pitch (difference old-pitches new-pitches)]
- (.noteOff channel pitch))
+ (.noteOff channel pitch))
(doseq [pitch (difference new-pitches old-pitches)]
(.noteOn channel pitch note-on-velocity)))
@@ -36,19 +36,19 @@
(defn listen-spec [d & options]
(let [synth (MidiSystem/getSynthesizer)
- agnt (agent {})
- watch-dir-agent (apply lw/watch-spec
- d
- :reporter #(send agnt
- change-chord
- (Math/round (* 4.0 (fraction-failed %))))
- options)]
+ agnt (agent {})
+ watch-dir-agent (apply lw/watch-spec
+ d
+ :reporter #(send agnt
+ change-chord
+ (Math/round (* 4.0 (fraction-failed %))))
+ options)]
(.open synth)
(let [chan (get-channel synth 0)]
(.programChange chan prog)
(.controlChange chan 7 init-vol)
(doseq [p (chords 0)] (.noteOn chan p velocity)))
(send agnt #(assoc %
- :synth synth
- :watch-dir-agent watch-dir-agent
- :ci 0))))
+ :synth synth
+ :watch-dir-agent watch-dir-agent
+ :ci 0))))
View
26 src/main/clojure/lazytest_listen/volume.clj
@@ -15,9 +15,9 @@
(if (= 0 new-vol)
(.noteOn channel pitch 0)
(do
- (.controlChange channel 7 new-vol)
- (when (= 0 old-vol)
- (.noteOn channel pitch 127))))))
+ (.controlChange channel 7 new-vol)
+ (when (= 0 old-vol)
+ (.noteOn channel pitch 127))))))
(defn stop [state]
(let [{:keys [synth watch-dir-agent]} state]
@@ -39,18 +39,18 @@
(defn listen-spec [d & options]
(let [synth (MidiSystem/getSynthesizer)
- agnt (agent {})
- watch-dir-agent (apply lw/watch-spec
- d
- :reporter #(send agnt
- volume
- (int (* 127 (fraction-failed %))))
- options)]
+ agnt (agent {})
+ watch-dir-agent (apply lw/watch-spec
+ d
+ :reporter #(send agnt
+ volume
+ (int (* 127 (fraction-failed %))))
+ options)]
(.open synth)
(doto (get-channel synth 0)
(.programChange prog)
(change-volume 0 init-volume))
(send agnt #(assoc %
- :synth synth
- :watch-dir-agent watch-dir-agent
- :volume init-volume))))
+ :synth synth
+ :watch-dir-agent watch-dir-agent
+ :volume init-volume))))
View
12 src/test/clojure/lazytest_listen/tests.clj
@@ -4,9 +4,9 @@
(defn twice [i] (+ i i))
(describe twice "Sample tests"
- (it "can double a positive integer"
- (= 10 (twice 5)))
- (it "can double a negative integer"
- (= -2 (twice -1)))
- (it "can double 0"
- (= 0 (twice 0))))
+ (it "can double a positive integer"
+ (= 10 (twice 5)))
+ (it "can double a negative integer"
+ (= -2 (twice -1)))
+ (it "can double 0"
+ (= 0 (twice 0))))

0 comments on commit 757ed05

Please sign in to comment.
Something went wrong with that request. Please try again.