A keyframe class holding parameters for phase modification at a given position.
More...
#include <phase_modifier.h>
|
static float | linearTween (float point_from, float point_to, float t) |
| Performs linear interpolation between two points.
|
|
static float | cubicTween (float point_prev, float point_from, float point_to, float point_next, float range_prev, float range, float range_next, float t) |
| Performs cubic interpolation taking into account a previous and next point for smoother curves.
|
|
A keyframe class holding parameters for phase modification at a given position.
PhaseModifierKeyframe stores a phase offset and a mix amount. It can apply various phase modification styles to a WaveFrame’s frequency domain. Interpolation between keyframes allows animating phase changes over a wavetable.
◆ PhaseModifierKeyframe()
PhaseModifier::PhaseModifierKeyframe::PhaseModifierKeyframe |
( |
| ) |
|
Constructs a keyframe with default phase and mix values.
◆ ~PhaseModifierKeyframe()
virtual PhaseModifier::PhaseModifierKeyframe::~PhaseModifierKeyframe |
( |
| ) |
|
|
inlinevirtual |
◆ copy()
void PhaseModifier::PhaseModifierKeyframe::copy |
( |
const WavetableKeyframe * | keyframe | ) |
|
|
overridevirtual |
Copies the state from another keyframe of the same type.
- Parameters
-
keyframe | The source keyframe to copy from. |
Implements WavetableKeyframe.
◆ getMix()
float PhaseModifier::PhaseModifierKeyframe::getMix |
( |
| ) |
|
|
inline |
Gets the mix ratio blending between original and modified phases.
- Returns
- The mix ratio (0 to 1).
◆ getPhase()
float PhaseModifier::PhaseModifierKeyframe::getPhase |
( |
| ) |
|
|
inline |
Gets the phase offset applied to harmonics.
- Returns
- The phase offset in radians.
◆ interpolate()
Linearly interpolates between two keyframes.
- Parameters
-
from_keyframe | The starting keyframe. |
to_keyframe | The ending keyframe. |
t | The interpolation factor [0,1]. |
Implements WavetableKeyframe.
◆ jsonToState()
void PhaseModifier::PhaseModifierKeyframe::jsonToState |
( |
json | data | ) |
|
|
overridevirtual |
Restores the keyframe's state from a JSON object.
- Parameters
-
data | The JSON object containing the keyframe's state. |
Reimplemented from WavetableKeyframe.
◆ render()
void PhaseModifier::PhaseModifierKeyframe::render |
( |
vital::WaveFrame * | wave_frame | ) |
|
|
overridevirtual |
Renders the waveform of this keyframe into a WaveFrame.
- Parameters
-
wave_frame | The WaveFrame to fill with this keyframe's waveform data. |
Implements WavetableKeyframe.
◆ setMix()
void PhaseModifier::PhaseModifierKeyframe::setMix |
( |
float | mix | ) |
|
|
inline |
Sets the mix ratio.
- Parameters
-
mix | The blend between original and modified signal. |
◆ setPhase()
void PhaseModifier::PhaseModifierKeyframe::setPhase |
( |
float | phase | ) |
|
|
inline |
Sets the phase offset (in radians).
- Parameters
-
phase | The new phase offset. |
◆ setPhaseStyle()
void PhaseModifier::PhaseModifierKeyframe::setPhaseStyle |
( |
PhaseStyle | style | ) |
|
|
inline |
Sets the phase modification style.
- Parameters
-
style | The chosen PhaseStyle. |
◆ stateToJson()
json PhaseModifier::PhaseModifierKeyframe::stateToJson |
( |
| ) |
|
|
overridevirtual |
Serializes the state of this keyframe to a JSON object.
- Returns
- A JSON object representing the keyframe.
Reimplemented from WavetableKeyframe.
◆ mix_
float PhaseModifier::PhaseModifierKeyframe::mix_ |
|
protected |
The blend between original and modified harmonic phases.
◆ phase_
float PhaseModifier::PhaseModifierKeyframe::phase_ |
|
protected |
The phase offset in radians.
◆ phase_style_
PhaseStyle PhaseModifier::PhaseModifierKeyframe::phase_style_ |
|
protected |
Selected phase modification style.
The documentation for this class was generated from the following files: