rtmidi/core
midi-in-new
(midi-in-new [api :cstr] :ptr<void>)
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) |
(ok handle) on success; (err 0) on failure. Pass handle as :int to rtmidi/in and rtmidi/core functions. Free with midi-in-free when done.
(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] :ptr<void>)
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) |
(ok handle) on success; (err 0) on failure. Pass handle as :int to rtmidi/out and rtmidi/core functions. Free with midi-out-free when done.
(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 :int] :void)
destroy an RtMidi input handle created with midi-in-new.
| mi | MIDI input handle (ok-val from midi-in-new) |
void
(midi-in-free mi)
Since: RM0
midi-out-free
(midi-out-free [mo :int] :void)
destroy an RtMidi output handle created with midi-out-new.
| mo | MIDI output handle (ok-val from midi-out-new) |
void
(midi-out-free mo)
Since: RM0
midi-in-port-count
(midi-in-port-count [mi :int] :int)
return the number of available MIDI input ports.
| mi | MIDI input handle (ok-val from midi-in-new) |
Port count as :int.
(println (midi-in-port-count mi))
Since: RM0
midi-out-port-count
(midi-out-port-count [mo :int] :int)
return the number of available MIDI output ports.
| mo | MIDI output handle (ok-val from midi-out-new) |
Port count as :int.
(println (midi-out-port-count mo))
Since: RM0
midi-in-port-name
(midi-in-port-name [mi :int i :int] :cstr)
return the name of MIDI input port at index i.
| mi | MIDI input handle (ok-val from midi-in-new) | |
| 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 :int i :int] :cstr)
return the name of MIDI output port at index i.
| mo | MIDI output handle (ok-val from midi-out-new) | |
| 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
__ok-- create an ok result wrapping integer value v.__err-- create an err result wrapping integer error value e.__parse-midi-api-- map a keyword string to an rtmidi_api_t value.