summaryrefslogtreecommitdiff
path: root/src/midi.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/midi.clj')
-rw-r--r--src/midi.clj14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/midi.clj b/src/midi.clj
index bfe075e..6aace8f 100644
--- a/src/midi.clj
+++ b/src/midi.clj
@@ -153,7 +153,7 @@
(fn [d]
(with-tx d
(fn [f]
- (m/reduce {} nil (flow-handler f))))))))
+ (m/reduce prn nil (flow-handler f))))))))
(defn echo
"Echo test."
@@ -233,6 +233,18 @@
[>messages]
(m/group-by #(.getChannel ^ShortMessage %) >messages))
+(defn |notes
+ [>messages]
+ (m/group-by #(.getData1 ^ShortMessage %) >messages
+ #_
+ (m/ap
+ (let [^ShortMessage v (m/?< >messages)]
+ (println "V" v)
+ (if (#{ShortMessage/NOTE_ON ShortMessage/NOTE_OFF} (.getCommand v))
+ v
+ (m/amb))))))
+
+
#_(defn >ch-stream [>device ch]
(m/cp (m/?< (second (get >device ch)))))