mwg API
    Preparing search index...

    Function collectSoundFontUsage

    • Every sampled voice the given MIDI files can request, as (bank, program) pairs: the channel voice in effect at each scheduled note, with drums mapped to bank 128 the same way the renderer maps them. A game's compile step feeds this straight into subsetSoundFont so the shipped font carries only these programs.

      Parameters

      Returns SoundFontProgram[]

      import { parseMidi, collectSoundFontUsage } from '@datamoc/mwg/audio';

      declare const midiBytes: ArrayBuffer;

      const usage = collectSoundFontUsage([parseMidi(midiBytes)]);
      console.log(usage.length);