roland-sysex.js

Parse and generate Roland-specific MIDI SysEx messages in JavaScript

parse

parse
Parameters
buf ((Buffer | Uint8Array)) A buffer containing MIDI messages.
Returns
Array<MIDIMessage>: Contains SysEx messages parsed from the buffer.

format

Encodes MIDI data into a Buffer. For supported Roland messages, checksum calculation is done automatically.

format
Parameters
message ((MIDIMessage | Array<MIDIMessage>))
Returns
Buffer: The formatted message(s), ready for MIDI transmission.

Message types

The format and parse functions use plain objects as structured representations of MIDI data. The following types specify these objects' shapes.

MIDIMessage

Describes a MIDI message. This is either a SysexMessage or a Buffer.

MIDIMessage

SysexMessage

Describes a SysEx message.

SysexMessage
Properties
type ("sysex")

RolandSysexVendorData

Describes the Roland-specific parts of a SysEx message that are common to various commands.

RolandSysexVendorData
Properties
vendor ("Roland")
deviceId ((number | Buffer))
modelId ((number | Buffer))

RolandSysexCommandRQ1

Describes a Roland "Data Request 1" command.

RolandSysexCommandRQ1
Properties
type (("RQ1" | "DR1"))
address (number)
size (number)
checksum (number)

RolandSysexCommandDT1

Describes a Roland "Data Set 1" command.

RolandSysexCommandDT1
Properties
type (("DT1" | "DS1"))
address (number)
body (Buffer)
checksum (number)