rtmidi/out
src/rtmidi/out.tur
defn
midi-out-open
(midi-out-open [mo : MidiOut i : int name : cstr] :)
open a physical MIDI output port by index.
Parameters
| mo | MIDI output handle (ok-val of the midi-out-new result) | |
| i | port index (0-based, must be < midi-out-port-count) | |
| name | client name to register with the system |
Returns
(Result int int) -- ok carries 0; err carries an integer status code (1 when the underlying RtMidi handle's `ok` flag is false after the open call).
Example
(let [r (midi-out-open mo 0 "Turmeric Out")]
(if (ok? r) ... (println "open failed")))
Since: RM0
defn
midi-out-open-virtual
(midi-out-open-virtual [mo : MidiOut name : cstr] :)
open a virtual MIDI output port.
Parameters
| mo | MIDI output handle (ok-val of the midi-out-new result) | |
| name | name for the virtual port |
Returns
(Result int int) -- ok carries 0; err carries an integer status code (1 when the open call left the handle's `ok` flag false).
Example
(let [r (midi-out-open-virtual mo "My Virtual Out")]
(if (ok? r) ... (println "virtual open failed")))
Since: RM0
defn
midi-out-close
(midi-out-close [mo : MidiOut] :)
close the currently open MIDI output port.
Parameters
| mo | MIDI output handle (ok-val of the midi-out-new result) |
Returns
void
Example
(midi-out-close mo)
Since: RM0
defn
midi-out-send
(midi-out-send [mo : MidiOut bytes : cstr len : int] :)
send a raw MIDI message buffer on the output port.
Parameters
| mo | MIDI output handle (ok-val of the midi-out-new result) | |
| bytes | pointer to raw MIDI bytes as :cstr (e.g. msg-bytes from rtmidi/msg) | |
| len | number of bytes to send (e.g. msg-len from rtmidi/msg) |
Returns
(Result int int) -- ok carries 0; err carries the non-zero return code from rtmidi_out_send_message.
Example
(let [m (msg-note-on 0 60 127)]
(midi-out-send mo (msg-bytes m) (msg-len m))
(msg-free m))
Since: RM0