| Crates.io | ym2149-gist-replayer |
| lib.rs | ym2149-gist-replayer |
| version | 0.9.0 |
| created_at | 2025-12-03 15:00:29.183963+00 |
| updated_at | 2026-01-15 17:21:41.211705+00 |
| description | GI Sound Tool (GIST) file parser and multi-PSG player for YM2149 |
| homepage | https://ym2149-rs.org |
| repository | https://github.com/slippyex/ym2149-rs |
| max_upload_size | |
| id | 1964176 |
| size | 104,276 |
GIST Sound File Parser and Multi-PSG Player for YM2149.
This crate provides a parser and player for GIST (Graphics, Images, Sound, Text) sound effect files, originally used on the Atari ST. GIST was developed by Dave Becker and distributed by Antic Software in the late 1980s.
This is a Rust port of the GIST sound driver from th-otto/gist.
For simple playback, use GistPlayer:
use ym2149_gist_replayer::{GistPlayer, GistSound};
let sound = GistSound::load("effect.snd").unwrap();
let mut player = GistPlayer::new();
player.play_sound(&sound, None, None);
// Generate audio samples
while player.is_playing() {
let samples = player.generate_samples(882); // ~20ms at 44100 Hz
// Send samples to audio output...
}
For more control, use GistDriver directly with a Ym2149 chip:
use ym2149::Ym2149;
use ym2149_gist_replayer::{GistDriver, GistSound, TICK_RATE};
let sound = GistSound::load("effect.snd").unwrap();
let mut chip = Ym2149::new();
let mut driver = GistDriver::new();
// Start playing on first available voice
driver.snd_on(&mut chip, &sound, None, None, -1, i16::MAX - 1);
// In your audio loop, call tick() at 200 Hz (TICK_RATE)
while driver.is_playing() {
driver.tick(&mut chip);
// Generate samples from chip.get_sample() and send to audio output
}
Each GIST sound contains:
Values use 16.16 fixed-point format for smooth envelope transitions.
GistPlayer::new() - Create player with default 44100 Hz sample rateGistPlayer::with_sample_rate(rate) - Create player with custom sample rateplayer.play_sound(sound, volume, priority) - Play sound on auto-selected voiceplayer.play_sound_on_voice(sound, voice, volume, priority) - Play on specific voiceplayer.play_sound_pitched(sound, pitch, voice, volume, priority) - Play with specific pitchplayer.stop_voice(voice) - Stop a specific voiceplayer.stop_all() - Stop all voicesplayer.is_playing() - Check if any voice is activeplayer.generate_samples(count) - Generate audio samplesplayer.generate_samples_into(buffer) - Generate samples into existing bufferGistDriver::new() - Create a new driver instancedriver.snd_on(chip, sound, voice, volume, pitch, priority) - Start a sounddriver.snd_off(voice_idx) - Stop a specific voicedriver.stop_all(chip) - Stop all voicesdriver.is_playing() - Check if any voice is activedriver.tick(chip) - Process one tick (call at 200 Hz)TICK_RATE (200 Hz) - The driver tick rate, matching the Atari ST Timer CDEFAULT_SAMPLE_RATE (44100 Hz) - Default audio sample rateSee the main ym2149-rs repository for license information.