Analysis updated 2026-05-18
Add accurate OPL2 or OPL3 chip music playback to a game or emulator project.
Play classic DOS music files such as DRO, HSC, IMF, or WLF with the bundled player.
Try the chip emulation in a browser using the WebAssembly build with no installation.
| realbitdancer/opal | code-my-spec/ear_witness | douglascorrea/syscall-agent | |
|---|---|---|---|
| Stars | 2 | 2 | 2 |
| Language | C | C | C |
| Setup difficulty | easy | hard | moderate |
| Complexity | 3/5 | 4/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires CMake 3.23+ and a C11 compiler, platform-specific presets are provided for most targets.
Opal is a software emulator for the Yamaha YMF262 sound chip, better known as the OPL3, along with its earlier OPL2 version. These are the chips that powered the AdLib and Sound Blaster sound cards in old PCs, and through them, most of the music heard in DOS-era games and music trackers. The emulation core itself was written years ago by a developer known as Shayde and released into the public domain as part of a tracker program called Reality Adlib Tracker 2. This project wraps that core in a small, modern C11 library with a clean interface, so it can be used in new software. The library is described as feature-complete, meaning it implements the full set of chip registers that affect sound: two- and four-operator FM synthesis, all eight waveforms, tremolo and vibrato effects, a percussion mode with noise generation, and internal timers. Its accuracy has been checked sample by sample against other well-regarded OPL3 emulators and matches hardware behavior closely, down to small quirks like a one-sample delay between the left and right audio channels that the real chip also has. To build it, you need CMake 3.23 or newer and a C11 compiler, with ready-made build presets for Windows, Linux, macOS, Android, iOS, and web browsers via WebAssembly. The result is a small static library with just eight public functions: you write to chip registers and read back stereo audio samples, similar to programming the real hardware. A bundled example player can play OPL music files in several classic formats, including some public-domain demo tracks included in the repository, and there is a live web demo that runs entirely in the browser with no installation needed. The project's own code is licensed under MIT, a permissive license that allows free use, modification, and redistribution including commercial use. The core emulation logic itself remains public domain, and the small audio library it depends on is public domain or MIT-0.
Opal is a C library that accurately emulates the OPL2 and OPL3 sound chips used for music in classic DOS games and trackers.
Mainly C. The stack also includes C11, CMake, WebAssembly.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice, the core emulation logic is public domain.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.