No matching definitions.

rtmidi/msg

src/rtmidi/msg.tur
defn

msg-note-on

(msg-note-on [channel :int note :int velocity :int] :int)

construct a Note On MIDI message.

channelMIDI channel (0-15)
noteMIDI note number (0-127)
velocitynote velocity (0-127)

A __midi_msg* as :int. len is 3.

(let [m (msg-note-on 0 60 127)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-note-off

(msg-note-off [channel :int note :int velocity :int] :int)

construct a Note Off MIDI message.

channelMIDI channel (0-15)
noteMIDI note number (0-127)
velocityrelease velocity (0-127)

A __midi_msg* as :int. len is 3.

(let [m (msg-note-off 0 60 0)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-control-change

(msg-control-change [channel :int cc :int value :int] :int)

construct a Control Change MIDI message.

channelMIDI channel (0-15)
cccontroller number (0-127)
valuecontroller value (0-127)

A __midi_msg* as :int. len is 3.

(let [m (msg-control-change 0 7 100)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-program-change

(msg-program-change [channel :int program :int] :int)

construct a Program Change MIDI message.

channelMIDI channel (0-15)
programprogram number (0-127)

A __midi_msg* as :int. len is 2.

(let [m (msg-program-change 0 0)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-pitch-bend

(msg-pitch-bend [channel :int lsb :int msb :int] :int)

construct a Pitch Bend MIDI message.

channelMIDI channel (0-15)
lsbleast significant 7 bits of bend value (0-127)
msbmost significant 7 bits of bend value (0-127)

A __midi_msg* as :int. len is 3.

(let [m (msg-pitch-bend 0 0 64)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-aftertouch

(msg-aftertouch [channel :int pressure :int] :int)

construct a Channel Pressure (Aftertouch) MIDI message.

channelMIDI channel (0-15)
pressurepressure value (0-127)

A __midi_msg* as :int. len is 2.

(let [m (msg-aftertouch 0 64)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-poly-aftertouch

(msg-poly-aftertouch [channel :int note :int pressure :int] :int)

construct a Polyphonic Aftertouch MIDI message.

channelMIDI channel (0-15)
noteMIDI note number (0-127)
pressurepressure value (0-127)

A __midi_msg* as :int. len is 3.

(let [m (msg-poly-aftertouch 0 60 80)]
    (midi-out-send mo (msg-bytes m) (msg-len m))
    (msg-free m))

Since: RM0

defn

msg-sysex

(msg-sysex [bytes :cstr len :int] :int)

construct a SysEx MIDI message with 0xF0/0xF7 framing.

bytespointer to the inner SysEx data bytes (without 0xF0/0xF7)
lennumber of inner data bytes

A __midi_msg* as :int. Total len is len + 2 (including 0xF0 and 0xF7).

(let [data "\x41\x10\x42"]
    (let [m (msg-sysex data 3)]
      (midi-out-send mo (msg-bytes m) (msg-len m))
      (msg-free m)))

Since: RM0

defn

msg-status

(msg-status [m :int] :int)

return the status nibble (high 4 bits) of a MIDI message.

m__midi_msg* as :int (from any msg-* constructor)

Status nibble as :int, e.g. 0x90 for Note On.

(assert-eq (msg-status (msg-note-on 0 60 127)) 0x90)

Since: RM0

defn

msg-channel

(msg-channel [m :int] :int)

return the channel nibble (low 4 bits) of a MIDI message.

m__midi_msg* as :int (from any msg-* constructor)

Channel nibble as :int (0-15).

(assert-eq (msg-channel (msg-note-on 3 60 127)) 3)

Since: RM0

defn

msg-data1

(msg-data1 [m :int] :int)

return the first data byte of a MIDI message.

m__midi_msg* as :int (from any msg-* constructor with len >= 2)

First data byte as :int.

(assert-eq (msg-data1 (msg-note-on 0 60 127)) 60)

Since: RM0

defn

msg-data2

(msg-data2 [m :int] :int)

return the second data byte of a MIDI message.

m__midi_msg* as :int (from any msg-* constructor with len >= 3)

Second data byte as :int.

(assert-eq (msg-data2 (msg-note-on 0 60 127)) 127)

Since: RM0

defn

msg-bytes

(msg-bytes [m :int] :cstr)

return a pointer to the raw byte buffer of a MIDI message.

m__midi_msg* as :int (from any msg-* constructor)

Raw byte buffer as :cstr; use with msg-len for midi-out-send.

(midi-out-send mo (msg-bytes m) (msg-len m))

Since: RM0

defn

msg-len

(msg-len [m :int] :int)

return the byte count of a MIDI message.

m__midi_msg* as :int (from any msg-* constructor)

Number of bytes in the message as :int.

(assert-eq (msg-len (msg-note-on 0 60 127)) 3)

Since: RM0

defn

msg-free

(msg-free [m :int] :void)

free all memory associated with a MIDI message.

m__midi_msg* as :int (from any msg-* constructor)

void

(msg-free m)

Since: RM0