Skip to content

SysEx

System Exclusive (0xF0 … 0xF7) traffic is gated at request time. Both directions — inbound and outbound — are controlled by the same opt-in flag.

import { requestMIDIAccess } from "react-native-midi-api";
// Explicit opt-in required.
const midi = await requestMIDIAccess({ sysex: true });
console.log(midi.sysexEnabled); // true

Without { sysex: true }, midi.sysexEnabled is false.

const output = [...midi.outputs.values()][0];
// Roland-style SysEx example — adjust manufacturer ID and data as needed.
output?.send([0xf0, 0x41, 0x10, 0x00, 0x00, 0x00, 0x28, 0x12, 0x00, 0x00, 0x01, 0x7f, 0xf7]);

If sysexEnabled is false, send() with a 0xF0 start byte throws InvalidAccessError:

InvalidAccessError: SysEx is not enabled. Call requestMIDIAccess({ sysex: true }) first.

When SysEx is enabled, inbound 0xF0 messages arrive via onmidimessage like any other message:

input.onmidimessage = (event) => {
if (event.data[0] === 0xf0) {
console.log("SysEx received:", Array.from(event.data));
}
};

When SysEx is not enabled, inbound SysEx bytes are filtered out silently — they never reach onmidimessage.

SysEx is non-negotiable for Travel Sax firmware protocol (the primary consumer of this library via react-native-travel-instruments). Always pass { sysex: true } in Travel Sax apps.