Liking cljdoc? Tell your friends :D

midi-data.core

MIDI data is often presented as a list of three values: [a b c].

This namespace handle's parsing of MIDI data tuples to maps that represnt there content and back.

The values [a b c] typically encode the following:

  • a - message type and some times a channel for that message type.
  • b - note or paramater number for message.
  • c - velocity or value for message.

This namespace handles parsing of these to maps in the following format:

{:midi-msg message-type ... message-type specific parsing tuple}

Examples might be:

  • {:midi-msg :note-on :note 60 :vel 60 :channel 1}
  • {:midi-msg :note-off :note 60 :vel 60 :channel 1}
  • {:midi-msg :control :number 10 :value 60 :channel 1}
  • {:midi-msg :clock}
  • {:midi-msg :start}
  • {:midi-msg :stop}

Usage:

  • (decode [a b c]) translates from MIDI data tuple to map.
  • (encode m) translates from map back to a MIDI data tuple.
MIDI data is often presented as a list of three values: `[a b c]`.

This namespace handle's parsing of MIDI data tuples to maps that
represnt there content and back. 

The values `[a b c]` typically encode the following:

- `a` - *message type* and some times a *channel* for that message type.
- `b` - *note* or *paramater number* for message.
- `c` - *velocity* or *value* for message.

This namespace handles parsing of these to maps in the following format:

`{:midi-msg message-type ... message-type specific parsing tuple}`

Examples might be:

- `{:midi-msg :note-on  :note 60 :vel 60 :channel 1}`
- `{:midi-msg :note-off :note 60 :vel 60 :channel 1}`
- `{:midi-msg :control :number 10 :value 60 :channel 1}`
- `{:midi-msg :clock}`
- `{:midi-msg :start}`
- `{:midi-msg :stop}`

## Usage:

- `(decode [a b c])` translates from MIDI data tuple to map.
- `(encode m)` translates from map back to a MIDI data tuple.
raw docstring

decodeclj/s

(decode [a b c :as data])

Decodes MIDI message and transforms it to a map containing a representation of the MIDI message being sent.

Decodes MIDI message and transforms it to a map containing a representation
of the MIDI message being sent.
sourceraw docstring

encodeclj/s

(encode {:keys [midi-msg channel] :or {channel 0} :as m})

Takes representation of MIDI event provided as a map and turns it back to a data tuple of [a b c]

Takes representation of MIDI event provided as a map and turns it back to
a data tuple of `[a b c]`
sourceraw docstring

inverse-n->midi-msg-typeclj/s

Map of numbers to midi msg types. Channel numbers often need to be removed with a fn like quantize before they can be looked up using this.

Map of numbers to midi msg types. Channel numbers often need to be removed
with a fn like quantize before they can be looked up using this.
sourceraw docstring

midi-msg-type->msg-paramsclj/s

Maps midi message type to a to the names that b and c paramater values represent.

Maps midi message type to a to the names that `b` and `c` paramater values
represent.
sourceraw docstring

midi-msg-type->nclj/s

Maps MIDI message types to the numbers used to represent them.

Maps MIDI message types to the numbers used to represent them.
sourceraw docstring

n->channelclj/s

(n->channel n)

Returns channel indicated by value. Typically used on first value of MIDI data tuple.

Returns channel indicated by value. Typically used on first value of MIDI
data tuple.
sourceraw docstring

n->midi-msg-typeclj/s

(n->midi-msg-type n)

Returns key representing meaning of numerical value. If n has channel number encoded within it it is discarded.

Returns key representing meaning of numerical value. If n has channel number
encoded within it it is discarded.
sourceraw docstring

strip-channelclj/s

(strip-channel n)
source

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

× close