pink.io.midi

Functions for handling MIDI event and controller input

Pink's design  uses a virtual device system so that projects 
can be written to depend on the virtual device, and the
real device can be configured per-system using a .pinkrc
file. This allows both swapping in and out of hardware as 
well as creating mock hardware devices.

Conventions are to use the following for virtual hardware
names:

* "keyboard x" - number of keyboard
* "knobs/sliders x" - number of knobs/slider device

Note, a hardware device can map to multiple virtual devices.

add-virtual-device

(add-virtual-device midi-manager device-name)

bind-device

(bind-device midi-manager hardware-id virtual-device-name)

bind-key-func

(bind-key-func virtual-device channel afn)

create-debug-receiver

(create-debug-receiver)

create-manager

(create-manager)

create-receiver

(create-receiver virtual-device)

device-debug

(device-debug hardware-id)

device-is-named?

(device-is-named? device-name {:keys [description name]})
true when device-name is part of device's description or name.

find-device

(find-device device-name device-type)
Finds device with device-name of device-type :in (input) or :out (output).
Throws exception when multiple or zero matching devices are found.

get-cc-atom

(get-cc-atom virtual-device channel cc-num)

input-device?

(input-device? {:keys [device]})
True when device can act as MIDI input. False otherwise.

list-devices

(list-devices)
Fetches list of available MIDI devices.

list-input-devices

(list-input-devices)
Lists all MIDI input devices.

list-output-devices

(list-output-devices)
Lists all MIDI output devices.

list-virtual-devices

(list-virtual-devices midi-manager)

midi->freq

(midi->freq notenum)
Convert MIDI Note number to frequency in hertz

output-device?

(output-device? {:keys [device]})
True when device can act as MIDI output. False otherwise.

set-event-processor

(set-event-processor virtual-device channel midi-event-func)