MidiMessage.toBytes

Write the raw MIDI data in a buffer data of capacity len.

If given < 0 len, return the number of bytes needed to return the whole message. Note: Channel Pressure event, who are 2 bytes, are transmitted as 3 in VST3 (no issue) but also in LV2 (BUG).

struct MidiMessage
pure nothrow @nogc const
int
toBytes
(
ubyte* data
,
int buflen
)

Parameters

data ubyte*

Pointer to at least 3 bytes of buffer to write MIDI message to (advice = 256 bytes).

buflen int

Length of buffer pointed to by data. If buflen < 0, this functions instead return the number of bytes needed (or -1 for unknown length).

Return Value

Type: int

Number of written bytes. If the MIDI message has an unknown (aka unsupported) length then nothing gets written, zero is returned.

Meta