A keyframe class that stores the window shape and positions at a given table position.
More...
#include <wave_window_modifier.h>
|
float | applyWindow (float t) |
| Applies the currently selected window shape at a given normalized time t.
|
|
|
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 that stores the window shape and positions at a given table position.
The WaveWindowModifierKeyframe holds parameters for the left and right positions along the wave where the window begins and ends, as well as which window shape to use. Interpolating between keyframes allows the windowed portion of the wave to change shape or size smoothly across the wavetable dimension.
◆ WaveWindowModifierKeyframe()
WaveWindowModifier::WaveWindowModifierKeyframe::WaveWindowModifierKeyframe |
( |
| ) |
|
◆ ~WaveWindowModifierKeyframe()
virtual WaveWindowModifier::WaveWindowModifierKeyframe::~WaveWindowModifierKeyframe |
( |
| ) |
|
|
inlinevirtual |
◆ applyWindow()
float WaveWindowModifier::WaveWindowModifierKeyframe::applyWindow |
( |
float | t | ) |
|
|
inlineprotected |
Applies the currently selected window shape at a given normalized time t.
- Parameters
-
t | The normalized time parameter [0,1]. |
- Returns
- The windowed amplitude.
◆ copy()
void WaveWindowModifier::WaveWindowModifierKeyframe::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.
◆ getLeft()
float WaveWindowModifier::WaveWindowModifierKeyframe::getLeft |
( |
| ) |
|
|
inline |
Gets the left window position.
- Returns
- The left position parameter.
◆ getRight()
float WaveWindowModifier::WaveWindowModifierKeyframe::getRight |
( |
| ) |
|
|
inline |
Gets the right window position.
- Returns
- The right position parameter.
◆ 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 WaveWindowModifier::WaveWindowModifierKeyframe::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 WaveWindowModifier::WaveWindowModifierKeyframe::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.
◆ setLeft()
void WaveWindowModifier::WaveWindowModifierKeyframe::setLeft |
( |
float | left | ) |
|
|
inline |
Sets the left position of the window (0 to 1).
The portion of the wave before this position will be gradually introduced from 0 amplitude.
- Parameters
-
left | The new left position. |
◆ setRight()
void WaveWindowModifier::WaveWindowModifierKeyframe::setRight |
( |
float | right | ) |
|
|
inline |
Sets the right position of the window (0 to 1).
The portion of the wave after this position will be gradually tapered to 0 amplitude.
- Parameters
-
right | The new right position. |
◆ setWindowShape()
void WaveWindowModifier::WaveWindowModifierKeyframe::setWindowShape |
( |
WindowShape | window_shape | ) |
|
|
inline |
Sets the window shape for this keyframe.
- Parameters
-
window_shape | The WindowShape to apply. |
◆ stateToJson()
json WaveWindowModifier::WaveWindowModifierKeyframe::stateToJson |
( |
| ) |
|
|
overridevirtual |
Serializes the state of this keyframe to a JSON object.
- Returns
- A JSON object representing the keyframe.
Reimplemented from WavetableKeyframe.
◆ left_position_
float WaveWindowModifier::WaveWindowModifierKeyframe::left_position_ |
|
protected |
The left boundary of the windowing region.
◆ right_position_
float WaveWindowModifier::WaveWindowModifierKeyframe::right_position_ |
|
protected |
The right boundary of the windowing region.
◆ window_shape_
WindowShape WaveWindowModifier::WaveWindowModifierKeyframe::window_shape_ |
|
protected |
The chosen window shape for this keyframe.
The documentation for this class was generated from the following files: