CL-MeltySynth
CL-MeltySynth is a MIDI SoundFont synthesizer with minimal dependencies written entirely in Common Lisp. It can be used to provide MIDI playback in any Common Lisp project with minimal dependencies.
Also included is midi123, a command line MIDI player and MIDI->WAV converter that serves as a non-trivial example program. An AppImage of the lastest release of midi123 for Linux can be downloaded here.
Releases can be found on the Releases wiki page.
CL-MeltySynth is a port of the excellent MeltySynth by Sinshu from C# to pure Common Lisp.
Example videos:
- Warcraft 2's "Human 1" by Glenn Stafford (CL-MeltySynth v2.0.0)
- Rise of The Triad's "Spray" by Lee Jackson (CL-MeltySynth v2.0.0)
- Doom E1M1 "At Doom's Gate" by Bobby Prince (CL-MeltySynth v1.0.0)
Some example usages for midi123:
# Play a MIDI file using a SoundFont, and loop at the end.
$ midi123 --loop -s sc-55.sf2 "11 - Goin' Down the Fast Way.mid"
# Render a MIDI file to a WAV using a SoundFont.
$ midi123 --render -s "Arachno SoundFont.sf2" "15 - Spray.mid"
# Play a MIDI file using a SoundFont, and stop after it finishes.
$ midi123 -s TimGM6mb.sf2 "24 - I Choose the Stairs.mid"
# Show the help information.
$ midi123 --help
# Show version information
$ midi123 --version
An overview of how to use the library can be found here. The full API reference can be found here.
Wanna support me? Buy me a coffee on Ko-Fi
Features
You can find a general roadmap of planned features here in the wiki.
- Wave synthesis and Sound
- [x] 64-bit internal audio engine
- [x] Choice of linear or cubic interpolation
- [x] Loads SoundFont files
- [x] Waveform and Envelope generators
- [x] Low-pass filter
- [x] Vibrato and Modulation LFOs
- MIDI processing
- [x] Note on/off
- [x] Bank/patch selection with optional remapping (remaps unknown presets to bank 0/128)
- [x] Modulation
- [x] Volume control and Panning
- [x] Expression
- [x] Hold pedal
- [x] Pitch bend
- [x] Tuning
- Effects
- [x] Multiple reverb choices, including a port of Zita-Rev1, with controllable parameters
- [x] Chorus effect
- [x] Reverb and Chorus can be enabled/disabled individually
- Other things
- [x] Standard MIDI file support
- [x] RIFF-based MIDI file support (RMI, only the MIDI data is loaded)
- [x] Loop extension support
- [x] Performance optimizations
Building and Development
You can clone this repository using Fossil:fossil clone https://chiselapp.com/user/MistressRemilia/repository/CL-MeltySynth/
This requires a recent version of SBCL (it has been tested with 2.2.2, 2.2.3,
and 2.2.4). Please see the Building article in the wiki
for information on loading the library, building midi123, debug builds, and
running tests. Additional example programs can be found in the examples
directory.
Style info
I use a slightly different style for my code.
- Keep lines 118 characters or shorter. Obviously sometimes you can't, but please try. Use 80 characters for Markdown files, though.
- New type declarations should have their names prefixed with
T/
, for example,t/uint32-vector
. This is only for DEFTYPEs and DEFINE-PSEUDO-ENUMs.
How do I contribute?
- Go to https://chiselapp.com/user/MistressRemilia/repository/CL-MeltySynth/ and clone the Fossil repository.
- Create a new branch for your feature.
- Push locally to the new branch.
- Create a bundle with Fossil that contains your changes.
- Get in contact with me.
Contributors
- Remilia Scarlet - creator and maintainer
Links and Licenses
- MeltySynth by Sinshu (MIT License)
- TimGM6mb.sf2 by Tim Brechbill (GPLv2 License)
- Zita-Rev1 by Fons Adriaensen (GPLv3 License)
CL-MeltySynth itself is mostly under the GNU Affero General Public License version 3, except for the port of Zita-Rev1, which is under the GNU General Public License version 3.