Modulation oscillator with tempo sync, delay, fade-in and seeded random shapes.
More...
|
| void | prepare (double sampleRate) noexcept |
| | Prepares for a sample rate (invalid rates are ignored).
|
| |
| void | reset () noexcept |
| | Restarts the cycle at the start phase, the cycle count at zero and the delay and fade-in from the beginning.
|
| |
| void | setShape (Shape s) noexcept |
| |
| Shape | getShape () const noexcept |
| |
| void | setRateHz (double hz) noexcept |
| | Free rate in Hz, 0..kMaxRateHz (NaN ignored). Used while sync is off.
|
| |
| void | setTempoSync (bool on) noexcept |
| | Tempo sync on or off; when on, the rate is the division of the tempo.
|
| |
| void | setDivision (Division d) noexcept |
| |
| void | setTempo (double bpm) noexcept |
| | Tempo in BPM for tempo sync, 1..999 (invalid values ignored).
|
| |
| void | setStartPhase (double phase) noexcept |
| | Cycle position reset() starts at, 0..1 (wrapped).
|
| |
| void | setDelayMs (double ms) noexcept |
| | Silence before the depth starts rising, in ms (>= 0).
|
| |
| void | setFadeInMs (double ms) noexcept |
| | Linear rise to full depth after the delay, in ms (>= 0).
|
| |
| void | setSeed (uint64_t seed) noexcept |
| | Seed of the random shapes (the same seed repeats the same sequence).
|
| |
| void | setRetriggerGlideMs (double ms) noexcept |
| | How long reset() glides from the output it was at to the new start, in ms (0, the default, jumps; >= 0, non-finite ignored).
|
| |
| void | setNumSteps (int count) noexcept |
| | Steps in a cycle, 1..kMaxSteps (16, the default).
|
| |
| int | getNumSteps () const noexcept |
| |
| void | setStep (int index, double value, double glide=0.0, double curve=0.0) noexcept |
| | One step: its value, how much of its length it glides to it from the step before, and the curve of that glide.
|
| |
| void | setStepRandom (int index, bool random) noexcept |
| | Makes a step draw its value from the seed every cycle (see the file notes).
|
| |
| double | getStepValue (int index) const noexcept |
| |
| double | getStepGlide (int index) const noexcept |
| |
| double | getStepCurve (int index) const noexcept |
| |
| bool | isStepRandom (int index) const noexcept |
| |
| void | setStepSwing (double swing) noexcept |
| | Moves the boundary inside each pair of steps, -1..1: at 0.5 the first step of a pair lasts 1.25 steps and the second 0.75 (the boundary moves by half the value, in steps).
|
| |
| double | getStepSwing () const noexcept |
| |
| void | setStepQuantize (int divisions) noexcept |
| | Quantizes the step values to a grid of 1/divisions (0, the default, leaves them free; 12 puts them on semitones when the owner maps -1..1 to -12..12 semitones). Glides move between the quantized values.
|
| |
| int | getStepQuantize () const noexcept |
| |
| double | stepsAt (double cycles) const noexcept |
| | The Steps shape's value at an absolute cycle position (the integer part is the cycle whose random steps are drawn).
|
| |
| double | getRateHz () const noexcept |
| | Effective rate in Hz (the synced one when tempo sync is on).
|
| |
| double | getCycles () const noexcept |
| | Cycles run since reset(), start phase included.
|
| |
| T | value () const noexcept |
| | The output now (shape times delay/fade depth), without advancing.
|
| |
| T | advance (int samples=1) noexcept |
| | Returns the output now, then advances by samples at the current rate (a control-rate owner advances its control period).
|
| |
| T | advanceScaled (int samples, double rateScale) noexcept |
| | Advances by samples at rateScale times the current rate (rate modulation; the scale is clamped to 0..64).
|
| |
| double | depthAt (int64_t samples) const noexcept |
| | Depth of the delay and fade-in samples after reset(): 0 during the delay, then a linear rise to 1.
|
| |
template<FloatType T>
class dspark::Lfo< T >
Modulation oscillator with tempo sync, delay, fade-in and seeded random shapes.
Modulation oscillator with tempo sync, delay, fade-in and seeded random shapes.
void prepare(double sampleRate) noexcept
Prepares for a sample rate (invalid rates are ignored).
void setShape(Shape s) noexcept
void reset() noexcept
Restarts the cycle at the start phase, the cycle count at zero and the delay and fade-in from the beg...
void setRateHz(double hz) noexcept
Free rate in Hz, 0..kMaxRateHz (NaN ignored). Used while sync is off.
T advance(int samples=1) noexcept
Returns the output now, then advances by samples at the current rate (a control-rate owner advances i...
void setFadeInMs(double ms) noexcept
Linear rise to full depth after the delay, in ms (>= 0).
void setDelayMs(double ms) noexcept
Silence before the depth starts rising, in ms (>= 0).
- Template Parameters
-
| T | Output type (float or double). Phase arithmetic is double. |
Definition at line 79 of file Lfo.h.