Crate ym2149

Crate ym2149 

Source
Expand description

YM2149 PSG Emulator for ATARI ST

A cycle-accurate emulator of the Yamaha YM2149 Programmable Sound Generator as integrated into the ATARI ST computer.

§Features

  • Cycle-accurate emulation of all 3 audio channels (clk/8 internal step)
  • Hardware envelope/volume tables (10 shapes, 32-step volume), buzzer/digidrum correct
  • 50Hz VBL (Vertical Blanking) synchronization
  • Raw register dump support
  • Audio sample generation

§Backend Trait

The Ym2149Backend trait (from ym2149-common) allows alternative implementations (e.g., ym2149-softsynth crate) to be used interchangeably with the hardware-accurate backend.

§Quick start

use ym2149::{Ym2149, Ym2149Backend};
let mut chip = Ym2149::new();
chip.write_register(0, 0x1C); // Tone A Lo
chip.write_register(1, 0x01); // Tone A Hi
chip.write_register(8, 0x0F); // Volume A
chip.clock();
let sample = chip.get_sample();

For YM file playback, use the ym2149-ym-replayer crate which provides YM2-YM6 format support. For real-time audio streaming, use the ym2149-replayer-cli crate.

Re-exports§

pub use constants::get_volume;
pub use psg_bank::PsgBank;

Modules§

constants
YM2149 Hardware Constants
psg_bank
Multi-PSG Bank for Arkos Tracker and PlayCity support

Structs§

Ym2149
YM2149 Programmable Sound Generator emulator

Enums§

Ym2149Error
Error types for YM2149 chip emulator operations

Traits§

Ym2149Backend
Common interface for YM2149 chip backends

Type Aliases§

Result
Result type for emulator operations