#emulation #synthesizer #retro #opl

opl3-rs

Rust bindings for Nuked-OPL3, a Yamaha OPL3 FM-synthesis chip emulation library

1 unstable release

0.2.0 Jul 6, 2024
0.1.2 Jun 30, 2024
0.1.1 Jun 28, 2024
0.1.0 Jun 28, 2024

#306 in Emulators

23 downloads per month

LGPL-2.1

185KB
3K SLoC

Rust 1.5K SLoC // 0.0% comments C 1.5K SLoC // 0.1% comments

opl3-rs

A small library to provide bindings for the Nuked-OPL3 library.

Crates.io version Changelog Documentation

Usage

Nuked-OPL3 is not a turn-key implementation of the OPL3 chip - functions such as the status register, timers and interrupts are left as implementation details.

You can access the Nuked-OPL3 API via the Opl3Chip struct, if needed, but with the caveat that directly writing registers to Nuked-OPL3 will prevent you from reading the OPL registers correctly.

If you intend to utilize opl3-rs in an emulator, you will probably want to use the Opl3Device wrapper which provides a full, device-oriented OPL3 implementation including the status, address and data registers, plus the OPL3 timers.

Docs

Documentation can be found on docs.rs

Examples

An example of music playback is provided in the play_tune directory under /examples. This example uses the rodio library for audio playback and crossbeam channels for inter-thread communication.

opl3-rs was primarily built for use with the MartyPC PC emulator. It is used to implement an AdLib Music Card device.

https://github.com/dbalsom/opl3-rs/assets/7229541/d78d4e90-71ed-4841-a963-9b09f25974c1

Credits

Nuked-OPL3 is (C) 2013-2020 Nuke.YKT and licensed under LGPL 2.1

play_tune example based off code by Maarten Janssen and Peter De Wachter.

Dependencies

~0.3–2.7MB
~56K SLoC