summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJake Zerrer <him@jakezerrer.com>2025-11-06 14:15:51 -0500
committerJake Zerrer <him@jakezerrer.com>2025-11-06 15:10:01 -0500
commitc62ed160a04c1ee5d08297d13a26630a590c5d6a (patch)
tree57f43c2b6b4ad3d8f427f8375cc33228e3780ef6 /src
parent1941fed92200e60c0912115e4eb87d114c206383 (diff)
Define minilab3 values
Diffstat (limited to 'src')
-rw-r--r--src/unheard/instrument/minilab3.clj31
-rw-r--r--src/unheard/instrument_utils.clj13
-rw-r--r--src/unheard/midi_util.clj4
3 files changed, 48 insertions, 0 deletions
diff --git a/src/unheard/instrument/minilab3.clj b/src/unheard/instrument/minilab3.clj
new file mode 100644
index 0000000..11da62e
--- /dev/null
+++ b/src/unheard/instrument/minilab3.clj
@@ -0,0 +1,31 @@
+(ns unheard.instrument.minilab3
+ (:require [unheard.instrument-utils :as iu]))
+
+(def minilab3
+ {:knobs
+ {1 [0 74]
+ 2 [0 71]
+ 3 [0 76]
+ 4 [0 77]
+ 5 [0 93]
+ 6 [0 18]
+ 7 [0 19]
+ 8 [0 16]}
+ :faders
+ {1 [0 82]
+ 2 [0 83]
+ 3 [0 85]
+ 4 [0 17]}
+ :pads
+ {1 [9 36]
+ 2 [9 37]
+ 3 [9 38]
+ 4 [9 39]
+ 5 [9 40]
+ 6 [9 41]
+ 7 [9 42]
+ 8 [9 43]}})
+
+(def is-knob (iu/is-knob minilab3))
+(def is-fader (iu/is-fader minilab3))
+(def is-pad (iu/is-pad minilab3))
diff --git a/src/unheard/instrument_utils.clj b/src/unheard/instrument_utils.clj
new file mode 100644
index 0000000..1ceae6b
--- /dev/null
+++ b/src/unheard/instrument_utils.clj
@@ -0,0 +1,13 @@
+(ns unheard.instrument-utils)
+
+(defn is-knob [inst]
+ (fn [n [ch k _v]]
+ (= [ch k] (get-in inst [:knobs n]))))
+
+(defn is-fader [inst]
+ (fn [n [ch k _v]]
+ (= [ch k] (get-in inst [:faders n]))))
+
+(defn is-pad [inst]
+ (fn [n [ch k _v]]
+ (= [ch k] (get-in inst [:pads n]))))
diff --git a/src/unheard/midi_util.clj b/src/unheard/midi_util.clj
new file mode 100644
index 0000000..382fe87
--- /dev/null
+++ b/src/unheard/midi_util.clj
@@ -0,0 +1,4 @@
+(ns unheard.midi-util)
+
+(defn control-message? [msg-type]
+ (= :control msg-type))