ParamModulation

Struct ParamModulation 

Source
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: ModWaveform

LFO waveform type

§division: BeatDivision

Beat division for LFO timing

§depth: f32

LFO modulation depth (0.0 - 1.0)

§min: f32

Minimum value for modulation range

§max: f32

Maximum value for modulation range

§random_value: f32

Random state (for Random waveform)

§audio_react: AudioReactConfig

Audio-reactive modulation config

§smoothed_audio: f32

Smoothed audio value (internal state for exponential smoothing)

Implementations§

Source§

impl ParamModulation

Source

pub fn new(min: f32, max: f32) -> Self

Create a new modulation with specified range

Source

pub fn calculate(&self, phase: f32, base_value: f32) -> f32

Calculate modulated value based on beat phase (0.0 - 1.0)

Source

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.

Source

pub fn is_active(&self) -> bool

Check if any modulation is active

Trait Implementations§

Source§

impl Clone for ParamModulation

Source§

fn clone(&self) -> ParamModulation

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParamModulation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ParamModulation

Source§

fn default() -> ParamModulation

Returns the “default value” for a type. Read more
Source§

impl Copy for ParamModulation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V