moont-web
WebAssembly wrapper for the moont CM-32L
synthesizer. Provides a Cm32lSynth struct that hooks into the Web Audio API
via ScriptProcessorNode for real-time audio output at 32 kHz.
Usage from JavaScript
Build with wasm-bindgen --target web:
import init from './moont_web.js';
await ;
const synth = ; // requires bundle-rom feature
// Note On: MIDI channel 2, note C4, velocity 100.
synth.;
// Note Off: MIDI channel 2.
synth.;
Without the bundle-rom feature, load ROMs dynamically:
const ctrl = ;
const pcm = ;
const synth = ;
Features
bundle-rom— Bundles the CM-32L ROMs into the WASM binary, enabling thenew Cm32lSynth()constructor. Enablesmoont/bundle-rom.
Building
A demo/ directory and tools/run-web-demo.sh script are included in the
repository for quick local testing.
Related Crates
| Crate | Description |
|---|---|
| moont | Core CM-32L synthesizer library |
| moont-render | Render .mid files to .wav |
| moont-live | Real-time ALSA MIDI sink |
License
moont-web is distributed under LGPL 2.1+.
Copyright (C) 2021-2026 Geoff Hill geoff@geoffhill.org
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.