Liking cljdoc? Tell your friends :D

casa.squid.midi

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]
```
raw docstring

aget-bytecljmacro

(aget-byte arr idx)
source

b->lclj

(b->l b)

Signed byte (-127 to 128) to long (0 to 255)

Signed byte (-127 to 128) to long (0 to 255)
sourceraw docstring

cc-dataclj

source

channelclj

(channel msg)
source

controllerclj

source

data-fullclj

(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.
sourceraw docstring

data1clj

(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
sourceraw docstring

data2clj

(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
sourceraw docstring

eventclj

(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]
sourceraw docstring

event-typeclj

(event-type msg)
source

event-typesclj

source

event-valclj

(event-val msg)
source

event-valsclj

source

l->bclj

(l->b l)

Long to signed byte

Long to signed byte
sourceraw docstring

messageclj

(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]].
sourceraw docstring

noteclj

source

pitchwheelclj

source

special-typesclj

source

special?clj

(special? msg)
source

statusclj

(status msg)
source

velocityclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close