fbd_sequencer

Crates.iofbd_sequencer
lib.rsfbd_sequencer
version0.2.2
sourcesrc
created_at2024-06-16 08:26:20.800218
updated_at2024-09-03 18:24:32.090208
descriptionA sequencer for playing music using PSG or AY-3-8910 sound sources. Supports playing .fbd sequence files.
homepagehttps://github.com/ain1084/rust_fbd_sequencer
repositoryhttps://github.com/ain1084/rust_fbd_sequencer
max_upload_size
id1273361
size129,209
Seiji Ainoguchi (ain1084)

documentation

https://docs.rs/fbd_sequencer

README

FBD Sequencer Library

Crates.io Documentation Build Status Crates.io License

Overview

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.

About .fbd Files

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.

Features

  • Software envelope (AL, AR, DR, SR, SL, RR)
  • Software LFO (vibrato)
  • Noise period setting
  • Output mode setting (tone, noise, tone & noise)
  • Tone period offset (also known as detune)
  • Nested loops
  • Tie and slur
  • Fine control in 1/60 second units

PsgTrait

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;
}

License

Licensed under either of

Contribution

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.

Commit count: 5

cargo fmt