rtmidi/core
MidiIn
(MidiIn)
opaque handle to an RtMidi input port (RtMidiInPtr).
MidiOut
(MidiOut)
opaque handle to an RtMidi output port (RtMidiOutPtr).
midi-in-new
(midi-in-new [api : cstr] :)
create an RtMidi input handle for the given backend API.
| api | backend keyword: ":alsa", ":core-midi", ":winmm", ":jack", ":dummy", | |
| or any other value for RTMIDI_API_UNSPECIFIED (auto-select) |
(Result MidiIn int) -- ok carries the live handle; err carries an integer status code (1 = rtmidi_in_create returned NULL; 2 = handle returned but its `ok` flag was false).
(let [r (midi-in-new ":core-midi")]
(if (ok? r) (let [mi (ok-val r)] ...) (println "midi-in init failed")))
Since: RM0
midi-out-new
(midi-out-new [api : cstr] :)
create an RtMidi output handle for the given backend API.
| api | backend keyword: ":alsa", ":core-midi", ":winmm", ":jack", ":dummy", | |
| or any other value for RTMIDI_API_UNSPECIFIED (auto-select) |
(Result MidiOut int) -- ok carries the live handle; err carries an integer status code (1 = rtmidi_out_create returned NULL; 2 = handle returned but its `ok` flag was false).
(let [r (midi-out-new ":core-midi")]
(if (ok? r) (let [mo (ok-val r)] ...) (println "midi-out init failed")))
Since: RM0
midi-in-free
(midi-in-free [mi : MidiIn] :)
destroy an RtMidi input handle created with midi-in-new.
| mi | MIDI input handle (ok-val of the midi-in-new result) |
void
(midi-in-free mi)
Since: RM0
midi-out-free
(midi-out-free [mo : MidiOut] :)
destroy an RtMidi output handle created with midi-out-new.
| mo | MIDI output handle (ok-val of the midi-out-new result) |
void
(midi-out-free mo)
Since: RM0
midi-in-port-count
(midi-in-port-count [mi : MidiIn] :)
return the number of available MIDI input ports.
| mi | MIDI input handle (ok-val of the midi-in-new result) |
Port count as :int.
(println (midi-in-port-count mi))
Since: RM0
midi-out-port-count
(midi-out-port-count [mo : MidiOut] :)
return the number of available MIDI output ports.
| mo | MIDI output handle (ok-val of the midi-out-new result) |
Port count as :int.
(println (midi-out-port-count mo))
Since: RM0
midi-in-port-name
(midi-in-port-name [mi : MidiIn i : int] :)
return the name of MIDI input port at index i.
| mi | MIDI input handle (ok-val of the midi-in-new result) | |
| i | port index (0-based, must be < midi-in-port-count) |
Port name as :cstr.
(println (midi-in-port-name mi 0))
Since: RM0
midi-out-port-name
(midi-out-port-name [mo : MidiOut i : int] :)
return the name of MIDI output port at index i.
| mo | MIDI output handle (ok-val of the midi-out-new result) | |
| i | port index (0-based, must be < midi-out-port-count) |
Port name as :cstr.
(println (midi-out-port-name mo 0))
Since: RM0
Internal definitions
_parse-midi-api-- map a keyword string to an `enum RtMidiApi` value.