Crates.io | fbd_sequencer |
lib.rs | fbd_sequencer |
version | 0.2.2 |
source | src |
created_at | 2024-06-16 08:26:20.800218 |
updated_at | 2024-09-03 18:24:32.090208 |
description | A sequencer for playing music using PSG or AY-3-8910 sound sources. Supports playing .fbd sequence files. |
homepage | https://github.com/ain1084/rust_fbd_sequencer |
repository | https://github.com/ain1084/rust_fbd_sequencer |
max_upload_size | |
id | 1273361 |
size | 129,209 |
This crate implements a sequencer (.fbd) for playing music using PSG or AY-3-8910 sound sources. This library itself does not generate PSG waveforms. The generation of PSG waveforms is delegated to external implementations that implement the PsgTrait
.
The Web Application using the crate is fbdplay_wasm, and the CUI Application is fbd_sequencer_cli.
Sequence files are binary files with the .fbd extension. They are designed for PSG sound sources and have three independent channels. The term "FBD" does not have any particular meaning.
Several .fbd files mimicking game music using PSG sound chips are available in the repository. All of them are designed to resemble game music that uses the PSG sound chip on a PC (MSX).
Copyright of the music: © Nihon Falcom Corporation.
Currently, there are no tools available to create .fbd files from scratch. We are considering developing tools to convert from formats like MML.
This library generates PSG waveforms through the following trait.
#[derive(PartialEq)]
pub enum OutputMode {
None,
Tone,
Noise,
ToneNoise,
}
pub trait PsgTrait {
fn sample_rate(&self) -> u32;
fn clock_rate(&self) -> u32;
fn set_tone_period(&mut self, channel: usize, period: u16);
fn set_volume(&mut self, channel: usize, volume: u8);
fn set_output_mode(&mut self, channel: usize, mode: OutputMode);
fn set_noise_period(&mut self, period: u8);
fn next_sample_i16(&mut self) -> i16;
#[cfg(feature = "float")]
fn next_sample_f32(&mut self) -> f32;
}
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.