mwg API
    Preparing search index...

    Function readSyx

    • Splits a .syx file like splitSysex and also says what it left out: bytes before the first 0xF0 (leading-bytes), an unterminated final message (unterminated), a DX7-shaped bank whose checksum fails (bad-checksum), and whole messages that are no DX7 bank (unrecognised, which is normal for another maker's data and for a single-voice dump). A file with several banks, a corrupt message or another model in it is therefore read for what is usable and reported for the rest.

      Parameters

      • bytes: Uint8Array

      Returns { messages: Uint8Array<ArrayBufferLike>[]; skipped: SyxSkip[] }

      import { readSyx } from '@datamoc/mwg/audio';

      const { messages, skipped } = readSyx(new Uint8Array([1, 2, 0xf0, 0x41, 0xf7]));
      console.log(messages.length, skipped); // 1 [{ kind: 'leading-bytes', bytes: 2 }, ...]