summaryrefslogtreecommitdiff
path: root/src/scratch.clj
blob: 7c305aab903983d658acd9f74a4a07b3f56cdf3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(ns scratch
  (:require [unheard.midi :as midi]
            [unheard.midi.percussion :refer [kick snare]]
            [missionary.core :as m]))

#_(print-all-midi-devices)

(def midi-keyboard  "CoreMIDI4J - Minilab3 MIDI")

(def run
  (midi/<bus midi-keyboard
             (fn [v]
               (m/ap
                 ;; 2 is the number of message types, e.g. :key
                (let [[t f] (m/?> 2 (midi/keyboard v))]
                  [t (rest (m/?< f))])))))

#_
(def cancel
  (run prn prn))

#_
(cancel)