Skip to content

JavaScript MIDI player and synthesizer based on SoundFont2 specifications. Modulator and sf3 support. No dependencies required.

License

Notifications You must be signed in to change notification settings

spessasus/SpessaSynth

Repository files navigation

SpessaSynth logo

SoundFont2 based realtime synthetizer and MIDI player written in JavaScript using Web Audio API. Can also be used as a synthesis library.

SpessaSynth Promotional Image

Youtube video

Watch the YouTube video

This repo is essentially 2 programs in one:

spessasynth_lib

A flexible, powerful, and feature-packed soundfont synthesizer library for the WebAudio API.

Tip

Looking for a Node.js version? try spessasynth_core

Documentation

Features

  • SoundFont2 Generator Support
  • SoundFont2 Modulator Support
  • SoundFont3 (vorbis compressed sf2) Support (thanks to stbvorbis.js)
    • Can provide very hiqh quality audio while being relatively light on file size thanks to sf3 support
  • Reverb and chorus support
  • Render audio to file
  • A few custom modulators to support some additional controllers (see modulators.js)
  • Written using AudioWorklets (Firefox and Chrome both work perfectly)
  • Can load really large soundfonts (4GB!) (but only on Firefox, Chromium has a memory limit)
  • Multi-port MIDIs support (more than 16 channels)
  • MIDI Controller Support (Default supported controllers can be found here).
  • Supports some Roland GS and Yamaha XG sysex messages
  • High performance mode for playing black MIDIs (Don't go too crazy with the amount of notes though)
  • Can be used as a library (learn more here)
  • Modular design allows easy integrations into other projects
  • Written in pure JavaScript using WebAudio API (Every modern browser supports it)
  • No dependencies

Limitations

  • The performance is questionable, especially on mobile devices.

Installation

  1. Clone this repository.
  2. copy src/spessasynth_lib to your project.
  3. Use the library

Web app / Local Edition

The complete GUI for spessasynth_lib, allowing remixing experimenting and playing MIDIs in the coolest way possible.

How to use

Features

  • Visualization of the played sequence with effects like visual pitch bend and note on effects
  • Playable keyboard with various sizes
  • Integrated controller for the synthetizer with a lot of options
  • Mutliple languages support, currently: english, polish, japanese
  • Web MIDI API support (Enables physical MIDI devices to be used with the program)
  • WebMidiLink support
  • Play around with the MIDI file, edit instruments controllers and more!
  • Render the MIDI file (either modified or unmodified) to wav
  • Comes bundled with a compressed SGM SoundFont to get you started

Installation

Important

Firefox is recommended, due to unconstrained memory size.

Recommended high quality soundfont (better than the built-in one)

Requires Node.js

Windows

  1. Download the code as zip and extract or use git clone https://github.com/spessasus/SpessaSynth
  2. Put your soundfonts into the soundfonts folder. (you can select soundfonts in the program)
  3. Double click the start.bat
  4. Enjoy!

Linux

  1. git clone https://github.com/spessasus/SpessaSynth
    cd SpessaSynth
    npm install && node server.js 
  2. Put your soundfonts into the soundfonts folder. (you can select soundfonts in the program)
  3. Enjoy!

(note that in KDE Plasma 6 the browser auto opening seems to be broken. You must navigate to http://localhost:8181 manually)

todo

  • make the worklet system perform good
  • port the worklet system to emscripten (maybe)

Special thanks

  • Fluidsynth - the source code really helped me understand and implement a lot of functionality and fixes
  • Polyphone - a wonderful testing tool for soundfonts and how they should sound
  • Meltysynth - for the low-pass filter implementation
  • You! - for checking out this project. I hope you like it :)

License

Copyright © 2024 Spessasus. Licensed under the MIT License.

Important

Please note that bundled stbvorbis_sync.js licensed under the Apache-2.0 license.