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 sub_bass() -> Self {
Self {
name: "Sub Bass".to_string(),
waveform: Waveform::Sine,
envelope: Envelope::new(0.01, 0.1, 0.9, 0.3),
filter: Filter::low_pass(150.0, 0.1),
modulation: Vec::new(),
delay: None,
reverb: None,
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn reese_bass() -> Self {
let filter_lfo = LFO::new(Waveform::Sine, 0.3, 0.8);
Self {
name: "Reese Bass".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.01, 0.2, 0.7, 0.4),
filter: Filter::low_pass(800.0, 0.5),
modulation: vec![ModRoute::new(filter_lfo, ModTarget::FilterCutoff, 0.3)],
delay: None,
reverb: None,
distortion: Some(Distortion::new(1.5, 0.3)),
volume: 1.0,
pan: 0.0,
}
}
pub fn acid_bass() -> Self {
let filter_lfo = LFO::new(Waveform::Sine, 0.5, 1.0);
Self {
name: "Acid Bass".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.001, 0.3, 0.3, 0.2),
filter: Filter::low_pass(400.0, 0.6),
modulation: vec![ModRoute::new(filter_lfo, ModTarget::FilterCutoff, 0.6)],
delay: None,
reverb: None,
distortion: Some(Distortion::new(2.0, 0.4)),
volume: 1.0,
pan: 0.0,
}
}
pub fn wobble_bass() -> Self {
let wobble_lfo = LFO::new(Waveform::Sine, 4.0, 1.0);
Self {
name: "Wobble Bass".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.01, 0.1, 0.8, 0.3),
filter: Filter::low_pass(600.0, 0.7),
modulation: vec![ModRoute::new(wobble_lfo, ModTarget::FilterCutoff, 0.7)],
delay: None,
reverb: None,
distortion: Some(Distortion::new(2.5, 0.5)),
volume: 1.0,
pan: 0.0,
}
}
pub fn deep_bass() -> Self {
Self {
name: "Deep Bass".to_string(),
waveform: Waveform::Sine,
envelope: Envelope::new(0.02, 0.15, 0.95, 0.4),
filter: Filter::low_pass(100.0, 0.2), modulation: Vec::new(),
delay: None,
reverb: None,
distortion: Some(Distortion::new(1.2, 0.2)), volume: 1.0,
pan: 0.0,
}
}
pub fn funk_bass() -> Self {
Self {
name: "Funk Bass".to_string(),
waveform: Waveform::Square,
envelope: Envelope::new(0.001, 0.08, 0.4, 0.1), filter: Filter::low_pass(600.0, 0.6), modulation: Vec::new(),
delay: None,
reverb: None,
distortion: Some(Distortion::new(2.2, 0.4)), volume: 1.0,
pan: 0.0,
}
}
pub fn bass_percussion() -> Self {
Self {
name: "Bass Percussion".to_string(),
waveform: Waveform::Sine,
envelope: Envelope::new(0.001, 0.08, 0.2, 0.15), filter: Filter::low_pass(300.0, 0.4),
modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.2, 0.3, 0.15)),
distortion: Some(Distortion::new(1.8, 0.3)), volume: 1.0,
pan: 0.0,
}
}
pub fn upright_bass() -> Self {
Self {
name: "Upright Bass".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.002, 0.2, 0.4, 0.3), filter: Filter::low_pass(800.0, 0.4), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.2, 0.3, 0.15)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn bass_808() -> Self {
Self {
name: "808 Bass".to_string(),
waveform: Waveform::Sine,
envelope: Envelope::new(0.001, 0.15, 0.0, 0.4), filter: Filter::low_pass(80.0, 0.3), modulation: Vec::new(),
delay: None,
reverb: None,
distortion: Some(Distortion::new(1.3, 0.25)), volume: 1.0,
pan: 0.0,
}
}
pub fn slap_bass() -> Self {
Self {
name: "Slap Bass".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.0005, 0.05, 0.3, 0.15), filter: Filter::low_pass(2000.0, 0.7), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.15, 0.25, 0.1)),
distortion: Some(Distortion::new(1.6, 0.3)), volume: 1.0,
pan: 0.0,
}
}
pub fn synth_bass() -> Self {
let pulse_lfo = LFO::new(Waveform::Sine, 0.4, 0.6);
Self {
name: "Synth Bass".to_string(),
waveform: Waveform::Square,
envelope: Envelope::new(0.005, 0.15, 0.7, 0.35),
filter: Filter::low_pass(500.0, 0.5),
modulation: vec![ModRoute::new(pulse_lfo, ModTarget::FilterCutoff, 0.25)],
delay: None,
reverb: None,
distortion: Some(Distortion::new(1.4, 0.25)),
volume: 1.0,
pan: 0.0,
}
}
pub fn growl_bass() -> Self {
let growl_lfo = LFO::new(Waveform::Sine, 2.5, 0.9); Self {
name: "Growl Bass".to_string(),
waveform: Waveform::Sawtooth,
envelope: Envelope::new(0.002, 0.12, 0.7, 0.25), filter: Filter::low_pass(900.0, 0.75), modulation: vec![ModRoute::new(growl_lfo, ModTarget::FilterCutoff, 0.6)],
delay: None,
reverb: None,
distortion: Some(Distortion::new(3.2, 0.7)), volume: 1.0,
pan: 0.0,
}
}
pub fn fretless_bass() -> Self {
let vibrato = LFO::new(Waveform::Sine, 4.5, 0.25); Self {
name: "Fretless Bass".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.005, 0.25, 0.7, 0.45), filter: Filter::low_pass(1200.0, 0.35), modulation: vec![ModRoute::new(vibrato, ModTarget::FilterCutoff, 0.15)],
delay: None,
reverb: Some(Reverb::new(0.25, 0.35, 0.2)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn picked_bass() -> Self {
Self {
name: "Picked Bass".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.001, 0.12, 0.45, 0.25), filter: Filter::low_pass(1800.0, 0.55), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.18, 0.28, 0.15)),
distortion: Some(Distortion::new(1.4, 0.25)), volume: 1.0,
pan: 0.0,
}
}
pub fn chorus_bass() -> Self {
let chorus_lfo = LFO::new(Waveform::Sine, 0.6, 0.5); Self {
name: "Chorus Bass".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.008, 0.2, 0.75, 0.4), filter: Filter::low_pass(1000.0, 0.4), modulation: vec![ModRoute::new(chorus_lfo, ModTarget::FilterCutoff, 0.2)],
delay: Some(Delay::new(0.3, 0.25, 0.2)),
reverb: Some(Reverb::new(0.3, 0.4, 0.25)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn fingerstyle_bass() -> Self {
Self {
name: "Fingerstyle Bass".to_string(),
waveform: Waveform::Triangle,
envelope: Envelope::new(0.006, 0.18, 0.65, 0.35), filter: Filter::low_pass(900.0, 0.35), modulation: Vec::new(),
delay: None,
reverb: Some(Reverb::new(0.2, 0.3, 0.18)),
distortion: None,
volume: 1.0,
pan: 0.0,
}
}
pub fn dark_bass() -> Self {
let rumble = LFO::new(Waveform::Sine, 0.2, 0.3); Self {
name: "Dark Bass".to_string(),
waveform: Waveform::Sine,
envelope: Envelope::new(0.05, 0.25, 0.9, 0.6), filter: Filter::low_pass(120.0, 0.25), modulation: vec![ModRoute::new(rumble, ModTarget::FilterCutoff, 0.15)],
delay: None,
reverb: Some(Reverb::new(0.5, 0.6, 0.4)), distortion: Some(Distortion::new(1.3, 0.2)), volume: 1.0,
pan: 0.0,
}
}
}