SpessaSynth

spessasynth_lib

A powerful soundfont/MIDI JavaScript library for the browsers.

npm install --save spessasynth_lib

Project site (consider giving it a star!)

Demo

Complete documentation

Basic example: play a single note

import { Synthetizer } from "spessasynth_lib"

const sfont = await (await fetch("soundfont.sf3")).arrayBuffer();
const ctx = new AudioContext();
// make sure you copied the worklet processor!
await ctx.audioWorklet.addModule("./worklet_processor.min.js");
const synth = new Synthetizer(ctx.destination, sfont);
document.getElementById("button").onclick = async () =>
{
    await ctx.resume();
    synth.programChange(0, 48); // strings ensemble
    synth.noteOn(0, 52, 127);
}

Current Features

Easy Integration

Powerful SoundFont Synthesizer

Built-in Powerful and Fast Sequencer

Read and Write SoundFont and MIDI Files with Ease

Read and write MIDI files

Read and write RMID files with embedded SF2 soundfonts

Read and write SoundFont2 files

Read and write SoundFont3 files

Read and write DLS Level 1 or 2 files

Export MIDI as WAV

License

MIT License, except for the stbvorbis_sync.js in the externals folder which is licensed under the Apache-2.0 license.