Simple LFO.
More...
#include <simplelfo.hpp>
|
| SimpleLFO (void) |
| Default constructor.
|
|
void | cycle (void) |
| Step phase one cycle forward.
|
|
void | reset (void) |
| Reset phase.
|
|
void | setF0 (const float f0, const float fsrecip) |
| Set LFO frequency. More...
|
|
void | setW0 (const float w) |
| Set LFO frequency in radians. More...
|
|
float | sine_bi (void) |
| Get value of bipolar sine wave for current phase.
|
|
float | sine_uni (void) |
| Get value of positive unipolar sine wave for current phase.
|
|
float | sine_bi_off (const float offset) |
| Get current value of bipolar sine wave for phase with offset. More...
|
|
float | sine_uni_off (const float offset) |
| Get current value of positive unipolar sine wave for phase with offset. More...
|
|
float | triangle_bi (void) |
| Get current value of bipolar triangle wave for current phase.
|
|
float | triangle_uni (void) |
| Get value of positive unipolar triangle wave for current phase.
|
|
float | triangle_bi_off (const float offset) |
| Get current value of bipolar triangle wave for phase with offset. More...
|
|
float | triangle_uni_off (const float offset) |
| Get current value of positive unipolar triangle wave for phase with offset. More...
|
|
float | saw_bi (void) |
| Get current value of bipolar saw wave for current phase.
|
|
float | saw_uni (void) |
| Get value of positive unipolar saw wave for current phase.
|
|
float | saw_bi_off (const float offset) |
| Get current value of bipolar saw wave for phase with offset. More...
|
|
float | saw_uni_off (const float offset) |
| Get current value of positive unipolar saw wave for phase with offset. More...
|
|
float | square_bi (void) |
| Get current value of bipolar square wave for current phase.
|
|
float | square_uni (void) |
| Get value of positive unipolar square wave for current phase.
|
|
float | square_bi_off (const float offset) |
| Get current value of bipolar square wave for phase with offset. More...
|
|
float | square_uni_off (const float offset) |
| Get current value of positive unipolar square wave for phase with offset. More...
|
|
Simple LFO.
Definition at line 55 of file simplelfo.hpp.
◆ saw_bi_off()
float dsp::SimpleLFO::saw_bi_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of bipolar saw wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 231 of file simplelfo.hpp.
233 const q31_t phi = phi0 + (f32_to_q31(offset)<<1);
234 return q31_to_f32(phi);
◆ saw_uni_off()
float dsp::SimpleLFO::saw_uni_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of positive unipolar saw wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 243 of file simplelfo.hpp.
245 q31_t phi = phi0 + (f32_to_q31(offset)<<1);
246 return 0.5f * phi + 0.5f;
248 return q31_to_f32(qadd(phi,0x40000000));
◆ setF0()
void dsp::SimpleLFO::setF0 |
( |
const float |
f0, |
|
|
const float |
fsrecip |
|
) |
| |
|
inline |
Set LFO frequency.
param f0 Frequency in Hz param fsrecip Reciprocal of sampling frequency (1/Fs)
Definition at line 101 of file simplelfo.hpp.
103 w0 = f32_to_q31(2.f * f0 * fsrecip);
◆ setW0()
void dsp::SimpleLFO::setW0 |
( |
const float |
w | ) |
|
|
inline |
Set LFO frequency in radians.
- Parameters
-
Definition at line 112 of file simplelfo.hpp.
114 w0 = f32_to_q31(2.f * w);
◆ sine_bi_off()
float dsp::SimpleLFO::sine_bi_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of bipolar sine wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 145 of file simplelfo.hpp.
147 const float phi = q31_to_f32(phi0 + f32_to_q31(2*offset));
148 return 4 * phi * (
si_fabsf(phi) - 1.f);
◆ sine_uni_off()
float dsp::SimpleLFO::sine_uni_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of positive unipolar sine wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 157 of file simplelfo.hpp.
159 const float phi = q31_to_f32(phi0 + f32_to_q31(2*offset));
160 return 0.5f + 2 * phi * (
si_fabsf(phi) - 1.f);
◆ square_bi_off()
float dsp::SimpleLFO::square_bi_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of bipolar square wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 276 of file simplelfo.hpp.
278 const q31_t phi = phi0 + (f32_to_q31(offset)<<1);
279 return (phi < 0) ? -1.f : 1.f;
◆ square_uni_off()
float dsp::SimpleLFO::square_uni_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of positive unipolar square wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 288 of file simplelfo.hpp.
290 const q31_t phi = phi0 + (f32_to_q31(offset)<<1);
291 return (phi < 0) ? 0.f : 1.f;
◆ triangle_bi_off()
float dsp::SimpleLFO::triangle_bi_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of bipolar triangle wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 188 of file simplelfo.hpp.
190 const q31_t phi = phi0 + f32_to_q31(2*offset);
191 return q31_to_f32(qsub(q31abs(phi),0x40000000)<<1);
◆ triangle_uni_off()
float dsp::SimpleLFO::triangle_uni_off |
( |
const float |
offset | ) |
|
|
inline |
Get current value of positive unipolar triangle wave for phase with offset.
- Parameters
-
offset | Offset to apply to current phase, in [-1, 1] |
Definition at line 200 of file simplelfo.hpp.
202 const float phi = q31_to_f32(phi0 + f32_to_q31(2*offset));
The documentation for this struct was generated from the following file:
- /home/etienne/Documents/_projects/logue-sdk/logue-sdk-alt/platform/nutekt-digital/inc/dsp/simplelfo.hpp