|
arduino-audio-tools
|
Tremolo AudioEffect: periodic change of the volume (amplitude modulation) between (100 - depth)% and 100%. More...
#include <AudioEffect.h>


Public Types | |
| enum | Shape { Triangle , Sine } |
| Waveform of the modulation. More... | |
Public Member Functions | |
| Tremolo (const Tremolo ©)=default | |
| Tremolo (int16_t duration_ms=2000, uint8_t depthPercent=50, uint32_t sampleRate=44100) | |
| virtual bool | active () |
| determines if the effect is active | |
| Tremolo * | clone () |
| uint8_t | depth () |
| int16_t | duration () |
| int | id () |
| Allows to identify an effect. | |
| effect_t | process (effect_t input) |
| calculates the effect output from the input | |
| float | rate () |
| virtual void | setActive (bool value) |
| sets the effect active/inactive | |
| void | setDepth (uint8_t percent) |
| Depth in percent: the volume changes between (100 - depth)% and 100%. | |
| void | setDuration (int16_t ms) |
| Period of the modulation in ms (<= 0: no modulation) | |
| void | setId (int id) |
| Allows to identify an effect. | |
| void | setPhase (float degrees) |
| void | setRate (float hz) |
| Speed of the modulation in Hz (e.g. 5.5 for an electric piano) | |
| void | setSampleRate (uint32_t sampleRate) |
| Sample rate of the processed audio. | |
| void | setShape (Shape shape) |
| Waveform: Triangle (default) or Sine. | |
| Shape | shape () |
Protected Member Functions | |
| int16_t | clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767) |
| generic clipping method | |
| void | copyParent (AudioEffect *copy) |
| int32_t | gainAt (float pos) |
| Gain (Q16) at a position in the period: (1 - depth) .. 1. | |
| void | nextSegment () |
| void | recalculate () |
Protected Attributes | |
| bool | active_flag = true |
| int16_t | duration_ms = 0 |
| int32_t | gain = 65536 |
| int32_t | gain_step = 0 |
| int | id_value = -1 |
| uint8_t | p_percent = 50 |
| Shape | p_shape = Triangle |
| float | phase = 0.0f |
| float | rate_hz = 0.0f |
| int | remaining = 0 |
| uint32_t | sample_rate = 44100 |
| float | segment_inc = 0.0f |
Static Protected Attributes | |
| static constexpr int | SEGMENT = 32 |
Tremolo AudioEffect: periodic change of the volume (amplitude modulation) between (100 - depth)% and 100%.
The gain is calculated every 32 samples and interpolated linearly in between: per sample only one integer multiplication is needed (no float operation, no division), for the float and the fixed point configuration.
| enum Shape |
|
inline |
Tremolo constructor - use e.g. duration_ms=2000; depthPercent=50; sampleRate=44100
|
inlinevirtualinherited |
determines if the effect is active
|
inlineprotectedinherited |
generic clipping method
|
inlinevirtual |
Implements AudioEffect.
|
inlineprotectedinherited |
|
inline |
|
inline |
Gain (Q16) at a position in the period: (1 - depth) .. 1.
|
inlineinherited |
Allows to identify an effect.
|
inlineprotected |
Calculates the gain at the end of the next segment: the gain is interpolated linearly inside of the segment
calculates the effect output from the input
Implements AudioEffect.
|
inline |
|
inlineprotected |
Parameters changed: the next segment ramps from the current gain to the new values (no clicks)
|
inlinevirtualinherited |
sets the effect active/inactive
|
inline |
Depth in percent: the volume changes between (100 - depth)% and 100%.
|
inline |
Period of the modulation in ms (<= 0: no modulation)
|
inlineinherited |
Allows to identify an effect.
|
inline |
Phase of the modulation in degrees, e.g. 180 for the right channel of a stereo auto pan
|
inline |
Speed of the modulation in Hz (e.g. 5.5 for an electric piano)
|
inline |
Sample rate of the processed audio.
|
inline |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
protected |