npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

spessasynth_lib

v4.0.19

Published

MIDI and SoundFont2/DLS library for the browsers with no compromises

Downloads

1,826

Readme

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

v4.0.0 TypeScript Update is here! The NPM package now contains type declarations for easier developing! Read about breaking changes here

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!

Project site (consider giving it a star!)

Made with spessasynth_lib

Documentation

SpessaSynth Project index

Current Features

All the features of spessasynth_core!

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!
  • Reverb and chorus support: customizable and can be used standalone!
  • 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 © 2025 Spessasus Licensed under the Apache-2.0 License.

SoundFont® is a registered trademark of Creative Technology Ltd.