CH·58 Procedural & synthesis
verified 2026-08-01

opal active

RealBitdancer vunknown added 2026-08-01 verified 2026-08-01

[Use when]

You need a portable, sample-accurate OPL2/OPL3 FM synthesis core to play or emulate AdLib/Sound Blaster era DOS game music in a C/C++ project.

Engines
* Engine-agnostic S Standalone
License

MIT

Pricing

Free

Last verified

2026-08-01

Added

2026-08-01

about

opal is a C11 implementation of the Yamaha YMF262 (OPL3) and its OPL2 predecessor — the chips behind AdLib and Sound Blaster cards. The core covers the full register set: two- and four-operator FM, all eight waveforms, tremolo/vibrato LFOs, percussion/rhythm mode with noise generator, timers, and stereo routing including the hardware pipeline delay between left and right channels. Sample-for-sample stereo output matches Nuked-OPL3 at the chip's native 49716 Hz, with internal resampling to any target rate.

The public API is eight functions. The chip instance holds no internal pointers, making it trivially copyable as a complete save state. Registers can be written immediately or queued with buffered timing for closer hardware fidelity. A bundled example player streams DRO v1, HSC, IMF, and WLF files to audio via miniaudio, and a WebAssembly build runs the same core in-browser.

Builds as a static library via CMake on Windows, Linux, macOS, Android, and iOS. The emulation core is public domain (Shayde of Reality/OpenMPT lineage); the surrounding C API and tooling are MIT.