Expand description
WebAssembly wrapper for the moont CM-32L synthesizer.
Provides a CM32LWeb struct that hooks into the Web Audio API
via ScriptProcessorNode for real-time audio output at 32 kHz.
§Usage from JavaScript
With the bundle-rom feature (ROMs embedded in the WASM binary):
import init, { CM32LWeb } from './moont_web.js';
await init();
const synth = new CM32LWeb();
// Note On: channel 1, note C4, velocity 100.
synth.play_midi(new Uint8Array([0x90, 60, 100]));Without bundle-rom, load ROMs dynamically:
const ctrl = new Uint8Array(await fetch('CM32L_CONTROL.ROM').then(r => r.arrayBuffer()));
const pcm = new Uint8Array(await fetch('CM32L_PCM.ROM').then(r => r.arrayBuffer()));
const synth = CM32LWeb.from_rom(ctrl, pcm);§Features
| Feature | Description |
|---|---|
bundle-rom | Embed pre-parsed ROMs in the WASM binary (enables the new() constructor) |
§Related crates
| Crate | Description |
|---|---|
moont | Core CM-32L synthesizer library |
moont-render | Render .mid files to .wav |
moont-live | Real-time ALSA MIDI sink |
Structs§
- CM32L
Web - CM-32L synthesizer with Web Audio output.