pub struct ParamModulation {
pub waveform: ModWaveform,
pub division: BeatDivision,
pub depth: f32,
pub min: f32,
pub max: f32,
pub random_value: f32,
pub audio_react: AudioReactConfig,
pub smoothed_audio: f32,
}Expand description
Modulation settings for a single parameter
Supports both LFO (beat-synced oscillation) and audio-reactive modulation. These can be combined for complex parameter animation.
Fields§
§waveform: ModWaveformLFO waveform type
division: BeatDivisionBeat division for LFO timing
depth: f32LFO modulation depth (0.0 - 1.0)
min: f32Minimum value for modulation range
max: f32Maximum value for modulation range
random_value: f32Random state (for Random waveform)
audio_react: AudioReactConfigAudio-reactive modulation config
smoothed_audio: f32Smoothed audio value (internal state for exponential smoothing)
Implementations§
Source§impl ParamModulation
impl ParamModulation
Sourcepub fn calculate(&self, phase: f32, base_value: f32) -> f32
pub fn calculate(&self, phase: f32, base_value: f32) -> f32
Calculate modulated value based on beat phase (0.0 - 1.0)
Sourcepub fn calculate_with_audio(
&mut self,
phase: f32,
base_value: f32,
audio: &AudioReactiveParams,
delta_time: f32,
) -> f32
pub fn calculate_with_audio( &mut self, phase: f32, base_value: f32, audio: &AudioReactiveParams, delta_time: f32, ) -> f32
Calculate the full modulated value with audio input
Updates internal smoothed audio state and applies all modulation sources.
Trait Implementations§
Source§impl Clone for ParamModulation
impl Clone for ParamModulation
Source§fn clone(&self) -> ParamModulation
fn clone(&self) -> ParamModulation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParamModulation
impl Debug for ParamModulation
Source§impl Default for ParamModulation
impl Default for ParamModulation
Source§fn default() -> ParamModulation
fn default() -> ParamModulation
Returns the “default value” for a type. Read more
impl Copy for ParamModulation
Auto Trait Implementations§
impl Freeze for ParamModulation
impl RefUnwindSafe for ParamModulation
impl Send for ParamModulation
impl Sync for ParamModulation
impl Unpin for ParamModulation
impl UnwindSafe for ParamModulation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more