Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@menglinmaker/soundfont3

menglinmaker19MIT0.3.1TypeScript support: included

A SoundFont3 parser for Node.js and web browsers

soundfont3, soundfont, sf3, midi, synthesizer

readme

soundfont3.js

GitHub npm version npm version

Parse and write SoundFont3 and SoundFont2.

pnpm i @menglinmaker/soundfont3

For examples and API details, visit the documentation website.

 

What does this solve?

Reduce CDN bandwidth up to 25x

SoundFont2 files contain audio samples in WAV format. SoundFont3 uses OGG VORBIS compression - at the cost of audio quality (if you can hear the difference).

Standard compliance

The parser and writer complies with SoundFont 2.01 specification.

However, this also means the SoundFont3 implementation deviates from the unofficial standard set by MuseScore. Nevertheless, editors like Polyphone can read this SoundFont3 file.

Note: MuseScore SoundFont3 breaks the RIFF file standard. This is the main reason for compatability issues.

Caveats

Besides the potential compliance issues, There are a few limitations:

  • SoundFont3 converter requires Node.js and FFMPEG.
  • The web SoundFont2 converter is UI blocking - AudioContext cannot initialise on a separate process (Web Worker).

Note: Try caching the processed file as memiosation.

changelog

soundfont3

0.3.0

Minor Changes

  • fbf7da1: 4x massive speed improvements
  • 1be4d5d: Remove WASM dependency to prefer AudioContext.decodeAudioData() to reduce library size

0.0.3

Patch Changes

  • 5b351e0: Generic package. Don't specify type module to enable commonjs import

0.0.2

Patch Changes

  • 704abd1: Remove local test link from dependency