SysEx
System Exclusive (0xF0 … 0xF7) traffic is gated at request time. Both directions — inbound and outbound — are controlled by the same opt-in flag.
Requesting SysEx access
Section titled “Requesting SysEx access”import { requestMIDIAccess } from "react-native-midi-api";
// Explicit opt-in required.const midi = await requestMIDIAccess({ sysex: true });
console.log(midi.sysexEnabled); // trueWithout { sysex: true }, midi.sysexEnabled is false.
Sending SysEx
Section titled “Sending SysEx”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.Receiving SysEx
Section titled “Receiving SysEx”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.
Travel Sax note
Section titled “Travel Sax note”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.