MIDI message parsing and construction logic.
Interpreting and constructing of midi message as byte arrays (signed) or long arrays (unsigned).
(def msg (byte-array 3 [130 64 100])) ;; Middle C on channel 2 with velocity 100
(channel msg) ;; => 2
(event-type msg) ;; => :note-on
(note msg) ;; => 64
(velocity msg) ;; => 100
(event msg) ;; => [2 :note-on 64 100]
MIDI message parsing and construction logic. Interpreting and constructing of midi message as byte arrays (signed) or long arrays (unsigned). ``` clojure (def msg (byte-array 3 [130 64 100])) ;; Middle C on channel 2 with velocity 100 (channel msg) ;; => 2 (event-type msg) ;; => :note-on (note msg) ;; => 64 (velocity msg) ;; => 100 (event msg) ;; => [2 :note-on 64 100] ```
(b->l b)
Signed byte (-127 to 128) to long (0 to 255)
Signed byte (-127 to 128) to long (0 to 255)
(data-full msg)
Return the data bytes combined into a single integer
Used for pitch-wheel messages.
Return the data bytes combined into a single integer Used for pitch-wheel messages.
(data1 msg)
Return the first data byte
Semantics depend on the message type, e.g. note number, controller number, program number
Return the first data byte Semantics depend on the message type, e.g. note number, controller number, program number
(data2 msg)
Return the second data byte
Semantics depend on the message type, e.g. velocity, pressure
Return the second data byte Semantics depend on the message type, e.g. velocity, pressure
(event msg)
Convert a message (array) to an event vector.
Given a three element message array, return a four element vector with [channel event-type data-byte-1 data-byte-2]
Convert a message (array) to an event vector. Given a three element message array, return a four element vector with [channel event-type data-byte-1 data-byte-2]
(message v)
(message channel type & data)
Convert an event vector to a message array
The inverse of event
.
Convert an event vector to a message array The inverse of [[event]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close