mwg API
    Preparing search index...

    Class SyxBank

    A .syx bank a player dropped: its messages, the DX7 patch names in it, and an audition that loads a patch into a MidiSynth and renders one note through it, so a settings screen can show the names and let the player hear one before committing. Auditioning sends the whole bank message (a DX7 loads voices as a bank, and the synth owns which voice it then plays), then a single note for seconds plus a short tail.

    import { SyxBank, type MidiSynth } from '@datamoc/mwg/audio';

    declare const bankBytes: Uint8Array;
    declare const synth: MidiSynth;

    const bank = new SyxBank(bankBytes);
    console.log(bank.patches.map((patch) => patch.name));
    const heard = bank.audition(synth, bank.patches[0]);
    console.log(heard.duration > 0); // true
    Index
    • source names the file in each patch's id (a file name, a package asset id); bank when omitted

      Parameters

      • bytes: Uint8Array
      • source: string = 'bank'

      Returns SyxBank

    messages: Uint8Array<ArrayBufferLike>[]

    every whole sysex message in the file, in order

    patches: SyxPatch[]

    the DX7 patches in it, in bank order; empty for another maker's bank

    skipped: SyxSkip[]

    what the read left out and why; empty for a clean DX7 bank file

    • Renders one note of every patch through synth and reports the ones that come out silent (peak under silentBelow, 0.002 when omitted) or clipped (a peak at full scale), so an author knows before publishing a bank. A screen: it says a patch makes no sound or too much, not that it sounds right.

      Parameters

      • synth: MidiSynth
      • options: { note?: number; silentBelow?: number } = {}

      Returns SyxPatchFinding[]

    • Renders one note with patch loaded into synth: the patch's bank message goes to the synth as sysex, then the note sounds for seconds and decays over a short tail.

      Parameters

      Returns RenderedMidi