ruffbox_synth 0.13.0

A beatbox-oriented synthesizer library.
Documentation
// a collection of pre-fabricated synths
pub mod karplusplus;
pub mod multi_oscillator_synth;
pub mod risset_bell;
pub mod sampler;
pub mod single_oscillator_synth;
pub mod stereo_sampler;

pub use crate::synths::karplusplus::KarPlusPlus;
pub use crate::synths::multi_oscillator_synth::MultiOscillatorSynth;
pub use crate::synths::risset_bell::RissetBell;
pub use crate::synths::sampler::Sampler;
pub use crate::synths::single_oscillator_synth::SingleOscillatorSynth;
pub use crate::synths::stereo_sampler::StereoSampler;

use crate::building_blocks::{EffectType, FilterType, OscillatorType};

/// parts to assemble a synth
#[repr(C)]
pub struct SynthDescription {
    /// effects before the filter ...
    pub pre_filter_effects: Vec<EffectType>,

    /// filter chain (keeping these apart for now ...)
    pub filters: Vec<FilterType>,

    /// leave empty if not needed ...
    pub oscillator_types: Vec<OscillatorType>,

    pub ambisonic: bool,
}

#[repr(C)]
pub enum SynthType {
    Sampler(SynthDescription),
    LiveSampler(SynthDescription),
    FrozenSampler(SynthDescription),
    SingleOscillator(SynthDescription),
    MultiOscillator(SynthDescription),
    KarPlusPlus(SynthDescription),
    RissetBell(bool),
}