use super::Instrument;
use crate::synthesis::effects::{Delay, Distortion, Reverb};
use crate::synthesis::envelope::Envelope;
use crate::synthesis::filter::Filter;
use crate::synthesis::lfo::{LFO, ModRoute, ModTarget};
use crate::synthesis::waveform::Waveform;
impl Instrument {
pub fn sitar() -> Self {
let shimmer = LFO::new(Waveform::Sine, 0.4, 0.6); Self {
name: "Sitar".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.001, 0.3, 0.4, 0.8), filter: Filter::low_pass(4500.0, 0.6), modulation: vec![ModRoute::new(shimmer, ModTarget::FilterCutoff, 0.25)],
delay: Some(Delay::new(0.15, 0.35, 0.25)), reverb: Some(Reverb::new(0.5, 0.55, 0.4)),
distortion: Some(Distortion::new(1.4, 0.2)), volume: 1.0,
pan: 0.0,
}
}
pub fn pan_flute() -> Self {
let breath = LFO::new(Waveform::Sine, 3.5, 0.15); Self {
name: "Pan Flute".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.1, 0.25, 0.65, 0.6), filter: Filter::low_pass(3000.0, 0.15), modulation: vec![ModRoute::new(breath, ModTarget::Volume, 0.1)],
delay: None,
reverb: Some(Reverb::new(0.6, 0.6, 0.45)), distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn didgeridoo() -> Self {
let drone_lfo = LFO::new(Waveform::Sine, 0.15, 0.4); Self {
name: "Didgeridoo".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.15, 0.3, 0.95, 0.8), filter: Filter::low_pass(400.0, 0.5), modulation: vec![ModRoute::new(drone_lfo, ModTarget::FilterCutoff, 0.15)],
delay: None,
reverb: Some(Reverb::new(0.5, 0.55, 0.4)),
distortion: Some(Distortion::new(1.3, 0.25)), volume: 1.0,
pan: 0.0,
}
}
pub fn shamisen() -> Self {
Self {
name: "Shamisen".to_string(),
waveform: Waveform::Square,
envelope: Envelope::new(0.001, 0.2, 0.3, 0.5), filter: Filter::low_pass(3500.0, 0.4), modulation: Vec::new(),
delay: Some(Delay::new(0.2, 0.25, 0.15)),
reverb: Some(Reverb::new(0.3, 0.4, 0.25)),
distortion: Some(Distortion::new(1.5, 0.25)), volume: 1.0,
pan: 0.0,
}
}
pub fn bagpipes() -> Self {
let vibrato = LFO::new(Waveform::Sine, 5.0, 0.2); Self {
name: "Bagpipes".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.08, 0.1, 0.95, 0.4), filter: Filter::low_pass(2800.0, 0.65), modulation: vec![ModRoute::new(vibrato, ModTarget::FilterCutoff, 0.1)],
delay: None,
reverb: Some(Reverb::new(0.4, 0.5, 0.35)),
distortion: Some(Distortion::new(1.6, 0.3)), volume: 1.0,
pan: 0.0,
}
}
pub fn kalimba() -> Self {
Self {
name: "Kalimba".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.4, 0.2, 0.8), filter: Filter::low_pass(5500.0, 0.3), modulation: Vec::new(),
delay: Some(Delay::new(0.2, 0.3, 0.25)),
reverb: Some(Reverb::new(0.5, 0.55, 0.4)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn koto() -> Self {
let shimmer = LFO::new(Waveform::Sine, 0.35, 0.3);
Self {
name: "Koto".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.002, 0.35, 0.25, 0.7), filter: Filter::low_pass(4800.0, 0.35), modulation: vec![ModRoute::new(shimmer, ModTarget::FilterCutoff, 0.12)],
delay: Some(Delay::new(0.25, 0.28, 0.22)),
reverb: Some(Reverb::new(0.45, 0.52, 0.38)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn banjo() -> Self {
Self {
name: "Banjo".to_string(),
waveform: Waveform::Square,
envelope: Envelope::new(0.001, 0.15, 0.2, 0.3), filter: Filter::low_pass(5000.0, 0.5), modulation: Vec::new(),
delay: Some(Delay::new(0.15, 0.25, 0.18)),
reverb: Some(Reverb::new(0.25, 0.35, 0.22)),
distortion: Some(Distortion::new(1.3, 0.2)), volume: 1.0,
pan: 0.0,
}
}
pub fn tabla() -> Self {
Self {
name: "Tabla".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.12, 0.15, 0.25), filter: Filter::low_pass(2500.0, 0.6), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.3, 0.4, 0.25)),
distortion: Some(Distortion::new(1.4, 0.25)),
volume: 1.0,
pan: 0.0,
}
}
pub fn erhu() -> Self {
let vibrato = LFO::new(Waveform::Sine, 5.5, 0.4); Self {
name: "Erhu".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.12, 0.28, 0.85, 0.6), filter: Filter::low_pass(3800.0, 0.45), modulation: vec![ModRoute::new(vibrato, ModTarget::FilterCutoff, 0.2)],
delay: None,
reverb: Some(Reverb::new(0.4, 0.5, 0.35)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn dulcimer() -> Self {
let shimmer = LFO::new(Waveform::Sine, 0.4, 0.35);
Self {
name: "Dulcimer".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.002, 0.45, 0.3, 0.8), filter: Filter::low_pass(5500.0, 0.32), modulation: vec![ModRoute::new(shimmer, ModTarget::FilterCutoff, 0.15)],
delay: Some(Delay::new(0.22, 0.28, 0.22)),
reverb: Some(Reverb::new(0.5, 0.55, 0.42)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn oud() -> Self {
let resonance = LFO::new(Waveform::Sine, 0.45, 0.5); Self {
name: "Oud".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.002, 0.35, 0.45, 0.9), filter: Filter::low_pass(4200.0, 0.4), modulation: vec![ModRoute::new(resonance, ModTarget::FilterCutoff, 0.2)],
delay: Some(Delay::new(0.18, 0.32, 0.25)),
reverb: Some(Reverb::new(0.45, 0.52, 0.38)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn mbira() -> Self {
let shimmer = LFO::new(Waveform::Sine, 0.3, 0.4);
Self {
name: "Mbira".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.5, 0.25, 0.9), filter: Filter::low_pass(6000.0, 0.35), modulation: vec![ModRoute::new(shimmer, ModTarget::FilterCutoff, 0.18)],
delay: Some(Delay::new(0.25, 0.35, 0.28)),
reverb: Some(Reverb::new(0.55, 0.6, 0.45)),
distortion: Some(Distortion::new(1.2, 0.15)), volume: 1.0,
pan: 0.0,
}
}
pub fn duduk() -> Self {
let breath = LFO::new(Waveform::Sine, 4.0, 0.25); Self {
name: "Duduk".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.15, 0.3, 0.75, 0.7), filter: Filter::low_pass(2200.0, 0.3), modulation: vec![ModRoute::new(breath, ModTarget::Volume, 0.15)],
delay: None,
reverb: Some(Reverb::new(0.5, 0.58, 0.42)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn guzheng() -> Self {
let flutter = LFO::new(Waveform::Sine, 0.5, 0.35); Self {
name: "Guzheng".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.4, 0.3, 0.85), filter: Filter::low_pass(5200.0, 0.35), modulation: vec![ModRoute::new(flutter, ModTarget::FilterCutoff, 0.15)],
delay: Some(Delay::new(0.22, 0.3, 0.25)),
reverb: Some(Reverb::new(0.5, 0.58, 0.42)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn balalaika() -> Self {
Self {
name: "Balalaika".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.18, 0.25, 0.4), filter: Filter::low_pass(4800.0, 0.45), modulation: Vec::new(),
delay: Some(Delay::new(0.15, 0.28, 0.2)),
reverb: Some(Reverb::new(0.35, 0.42, 0.28)),
distortion: Some(Distortion::new(1.25, 0.18)), volume: 1.0,
pan: 0.0,
}
}
pub fn djembe() -> Self {
Self {
name: "Djembe".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.15, 0.2, 0.35), filter: Filter::low_pass(3000.0, 0.55), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.35, 0.45, 0.32)),
distortion: Some(Distortion::new(1.5, 0.3)), volume: 1.0,
pan: 0.0,
}
}
pub fn uilleann_pipes() -> Self {
let vibrato = LFO::new(Waveform::Sine, 4.8, 0.18); Self {
name: "Uilleann Pipes".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.1, 0.15, 0.9, 0.5), filter: Filter::low_pass(3200.0, 0.55), modulation: vec![ModRoute::new(vibrato, ModTarget::FilterCutoff, 0.12)],
delay: None,
reverb: Some(Reverb::new(0.45, 0.52, 0.38)),
distortion: Some(Distortion::new(1.35, 0.22)), volume: 1.0,
pan: 0.0,
}
}
pub fn charango() -> Self {
let sparkle = LFO::new(Waveform::Sine, 0.6, 0.4); Self {
name: "Charango".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.25, 0.3, 0.6), filter: Filter::low_pass(5500.0, 0.4), modulation: vec![ModRoute::new(sparkle, ModTarget::FilterCutoff, 0.15)],
delay: Some(Delay::new(0.18, 0.3, 0.22)),
reverb: Some(Reverb::new(0.4, 0.48, 0.35)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn taiko() -> Self {
Self {
name: "Taiko".to_string(),
waveform: Waveform::Sine,
envelope: Envelope::new(0.001, 0.25, 0.3, 0.8), filter: Filter::low_pass(300.0, 0.4), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.6, 0.65, 0.5)), distortion: Some(Distortion::new(1.6, 0.3)), volume: 1.0,
pan: 0.0,
}
}
pub fn shakuhachi() -> Self {
let breath = LFO::new(Waveform::Sine, 3.2, 0.2); Self {
name: "Shakuhachi".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.12, 0.3, 0.7, 0.7), filter: Filter::low_pass(2800.0, 0.25), modulation: vec![ModRoute::new(breath, ModTarget::Volume, 0.12)],
delay: None,
reverb: Some(Reverb::new(0.55, 0.6, 0.45)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn gaita() -> Self {
let vibrato = LFO::new(Waveform::Sine, 5.2, 0.25);
Self {
name: "Gaita".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.08, 0.12, 0.92, 0.45), filter: Filter::low_pass(3500.0, 0.7), modulation: vec![ModRoute::new(vibrato, ModTarget::FilterCutoff, 0.15)],
delay: None,
reverb: Some(Reverb::new(0.4, 0.5, 0.35)),
distortion: Some(Distortion::new(1.7, 0.35)), volume: 1.0,
pan: 0.0,
}
}
pub fn ukulele() -> Self {
Self {
name: "Ukulele".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.2, 0.25, 0.4), filter: Filter::low_pass(5000.0, 0.35), modulation: Vec::new(),
delay: Some(Delay::new(0.12, 0.25, 0.18)),
reverb: Some(Reverb::new(0.3, 0.38, 0.25)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
}