Skip to content

spessasus/spessasynth_lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jun 23, 2026
8aae730 · Jun 23, 2026

History

170 Commits
Jun 23, 2026
Jan 31, 2026
Jun 17, 2026
Apr 12, 2026
Jun 1, 2026
May 19, 2026
Jun 1, 2026
Jun 17, 2026
Mar 23, 2026
Jan 31, 2026
Jan 31, 2026
Apr 14, 2025
May 19, 2026
Apr 12, 2026
Jun 23, 2026
Jun 23, 2026
May 19, 2026
Jun 7, 2026

Repository files navigation

SpessaSynth logo

A powerful multipurpose SF2/DLS/MIDI TypeScript/JavaScript library for the browsers, based on spessasynth_core. This is a WebAudioAPI wrapper for the spessasynth_core library.

It allows you to:

  • Play MIDI files using SF2/SF3/DLS files!
  • Read and write MIDI files!
  • Write SF2/SF3 files!
  • Convert DLS to SF2! (and back!)
  • and more!

TIP:

Looking for a bare JS version that works without WebAudioAPI? Try spessasynth_core!

v4.3.0 The General Update is here!

Featuring robust MIDI analysis and editing, broadened MIDI exclusive support, and reworked, more powerful API!

Made with spessasynth_lib

SpessaSynth Project index

Current Features

On top of that...

  • Fully typed: Faster development and IDE auto-completion!
  • Modular design: Easy integration into other projects (load what you need)
  • Detailed documentation: With examples!
  • Easy to Use: Basic setup is just two lines of code!
  • No external dependencies: Just spessasynth_core!
  • Export audio files using OfflineAudioContext!
  • AudioWorklet synthesizer:
    • Runs in a separate thread for maximum performance!
    • Does not stop playing even when the main thread is frozen!
    • Supported by all modern browsers!
  • Web Worker synthesizer:
    • Synthesize directly in the Web Worker!
    • Direct audio engine access!
    • Export audio automatically in the worker!
    • Avoids Chromium Audio Bugs!
  • High-performance mode: Play Rush E! note: may kill your browser ;)

Special Thanks

  • FluidSynth - for the source code that helped implement functionality and fixes
  • Polyphone - for the sound bank testing and editing tool
  • Meltysynth - for the initial low-pass filter implementation
  • RecordingBlogs - for detailed explanations on MIDI messages
  • stbvorbis.js - for the Vorbis decoder
  • fflate - for the MIT DEFLATE implementation
  • tsup - for the TypeScript bundler
  • foo_midi - for useful resources on XMF file format
  • Falcosoft - for help with the RMIDI format
  • Christian Collins - for various bug reports regarding the synthesizer
  • And You! - for checking out this project. I hope you like it :)

Basic example: play a single note

import { WorkletSynthesizer } from "spessasynth_lib";

// SF2, SF3, SFOGG and DLS files are all supported!
const sfont = await (await fetch("soundfont.sf3")).arrayBuffer();
const ctx = new AudioContext();
// make sure you copied the worklet processor!
await ctx.audioWorklet.addModule("./spessasynth_processor.min.js");
const synth = new WorkletSynthesizer(ctx);
await synth.soundBankManager.addSoundBank(sfont, "main");
await synth.isReady;
document.getElementById("button").onclick = async () => {
    await ctx.resume();
    synth.programChange(0, 48); // strings ensemble
    synth.noteOn(0, 52, 127);
};

License

Copyright © 2026 Spessasus Licensed under the Apache-2.0 License.

Legal

This project is in no way endorsed or otherwise affiliated with the MIDI Manufacturers Association, Roland Corporation, Yamaha Corporation, Creative Technology Ltd. or E-mu Systems, Inc., or any other organization mentioned. SoundFont® is a registered trademark of Creative Technology Ltd. All other trademarks are the property of their respective owners.