diff --git a/native-bridge/src/effects/granular_delay.rs b/native-bridge/src/effects/granular_delay.rs index 39e46556..dd14480d 100644 --- a/native-bridge/src/effects/granular_delay.rs +++ b/native-bridge/src/effects/granular_delay.rs @@ -133,7 +133,7 @@ impl GranularDelay { // Find inactive grain slot index let slot_idx = self.grains.iter().position(|g| !g.active); if let Some(idx) = slot_idx { - let delay_samples = (self.sample_rate as f32 * self.settings.delay_time / 1000.0) as usize; + let delay_samples = (self.sample_rate as f32 * self.settings.position / 1000.0) as usize; let grain_size = self.window.len(); // Add texture randomization (generate randoms before borrowing grain) diff --git a/native-bridge/src/effects/harmonizer.rs b/native-bridge/src/effects/harmonizer.rs index 61aca28c..7a057a3c 100644 --- a/native-bridge/src/effects/harmonizer.rs +++ b/native-bridge/src/effects/harmonizer.rs @@ -3,7 +3,7 @@ //! Creates up to 3 additional voices at scale-correct intervals. use super::pitch::{key_to_offset, PitchDetector, PitchShifter, Scale}; -use super::types::{HarmonizerSettings, HarmonyType, PitchCorrectionScale}; +use super::types::{HarmonizerScale, HarmonizerSettings, HarmonyType}; use super::AudioEffect; /// A single harmony voice @@ -100,15 +100,8 @@ impl Harmonizer { // Update key/scale self.key_offset = key_to_offset(&settings.key); self.scale = match settings.scale { - PitchCorrectionScale::Major => Scale::Major, - PitchCorrectionScale::Minor => Scale::Minor, - PitchCorrectionScale::PentatonicMajor => Scale::PentatonicMajor, - PitchCorrectionScale::PentatonicMinor => Scale::PentatonicMinor, - PitchCorrectionScale::Blues => Scale::Blues, - PitchCorrectionScale::Dorian => Scale::Dorian, - PitchCorrectionScale::Mixolydian => Scale::Mixolydian, - PitchCorrectionScale::HarmonicMinor => Scale::HarmonicMinor, - _ => Scale::Chromatic, + HarmonizerScale::Major => Scale::Major, + HarmonizerScale::Minor => Scale::Minor, }; // Set up voices based on harmony type @@ -139,6 +132,20 @@ impl Harmonizer { self.voice2.enabled = false; self.voice3.enabled = false; } + HarmonyType::MinorThird => { + self.voice1.interval = 3; // Minor third + self.voice1.level = 0.7; + self.voice1.enabled = true; + self.voice2.enabled = false; + self.voice3.enabled = false; + } + HarmonyType::Fourth => { + self.voice1.interval = 5; // Perfect fourth + self.voice1.level = 0.7; + self.voice1.enabled = true; + self.voice2.enabled = false; + self.voice3.enabled = false; + } HarmonyType::Fifth => { self.voice1.interval = 7; // Perfect fifth self.voice1.level = 0.7; @@ -146,6 +153,13 @@ impl Harmonizer { self.voice2.enabled = false; self.voice3.enabled = false; } + HarmonyType::Sixth => { + self.voice1.interval = 9; // Major sixth + self.voice1.level = 0.7; + self.voice1.enabled = true; + self.voice2.enabled = false; + self.voice3.enabled = false; + } HarmonyType::Octave => { self.voice1.interval = 12; self.voice1.level = 0.5; @@ -153,6 +167,27 @@ impl Harmonizer { self.voice2.enabled = false; self.voice3.enabled = false; } + HarmonyType::ThirdBelow => { + self.voice1.interval = -4; // Major third below + self.voice1.level = 0.7; + self.voice1.enabled = true; + self.voice2.enabled = false; + self.voice3.enabled = false; + } + HarmonyType::FifthBelow => { + self.voice1.interval = -7; // Perfect fifth below + self.voice1.level = 0.7; + self.voice1.enabled = true; + self.voice2.enabled = false; + self.voice3.enabled = false; + } + HarmonyType::OctaveBelow => { + self.voice1.interval = -12; + self.voice1.level = 0.5; + self.voice1.enabled = true; + self.voice2.enabled = false; + self.voice3.enabled = false; + } HarmonyType::PowerChord => { self.voice1.interval = 7; self.voice1.level = 0.7; @@ -180,6 +215,15 @@ impl Harmonizer { self.voice2.enabled = true; self.voice3.enabled = false; } + HarmonyType::ThirdAndFifth => { + self.voice1.interval = 4; // Major third + self.voice1.level = 0.6; + self.voice1.enabled = true; + self.voice2.interval = 7; // Perfect fifth + self.voice2.level = 0.6; + self.voice2.enabled = true; + self.voice3.enabled = false; + } HarmonyType::Custom => { // Custom intervals are set via voice settings } diff --git a/native-bridge/src/effects/multi_filter.rs b/native-bridge/src/effects/multi_filter.rs index a674e05f..aa74b1da 100644 --- a/native-bridge/src/effects/multi_filter.rs +++ b/native-bridge/src/effects/multi_filter.rs @@ -44,6 +44,7 @@ impl MultiFilter { MultiFilterType::Highpass => BiquadType::Highpass, MultiFilterType::Bandpass => BiquadType::Bandpass, MultiFilterType::Notch => BiquadType::Notch, + MultiFilterType::Allpass => BiquadType::Allpass, MultiFilterType::Formant => BiquadType::Peak, // Approximate formant with peak } } diff --git a/native-bridge/src/effects/rotary_speaker.rs b/native-bridge/src/effects/rotary_speaker.rs index 67a7649a..9e2fca22 100644 --- a/native-bridge/src/effects/rotary_speaker.rs +++ b/native-bridge/src/effects/rotary_speaker.rs @@ -163,6 +163,7 @@ impl RotarySpeaker { RotarySpeed::Stop => (0.0, 0.0), RotarySpeed::Slow => (settings.slow_rate, settings.slow_rate * 0.85), // Drum slightly slower RotarySpeed::Fast => (settings.fast_rate, settings.fast_rate * 0.85), + RotarySpeed::Brake => (0.0, 0.0), // Brake slows to stop (handled by acceleration ramp) }; self.horn.set_speed(horn_speed); diff --git a/native-bridge/src/effects/vibrato.rs b/native-bridge/src/effects/vibrato.rs index e68e488c..f0fa6f41 100644 --- a/native-bridge/src/effects/vibrato.rs +++ b/native-bridge/src/effects/vibrato.rs @@ -32,6 +32,8 @@ impl Vibrato { let waveform = match settings.waveform { VibratoWaveform::Sine => LfoWaveform::Sine, VibratoWaveform::Triangle => LfoWaveform::Triangle, + VibratoWaveform::Square => LfoWaveform::Square, + VibratoWaveform::Sawtooth => LfoWaveform::Sawtooth, }; self.lfo.set_waveform(waveform); self.settings = settings;