ASPiK SDK
Loading...
Searching...
No Matches
LFO Class Reference

The LFO object implements a mathematically perfect LFO generator for modulation uses only. It should not be used for audio frequencies except for the sinusoidal output which, though an approximation, has very low TDH. More...

#include <fxobjects.h>

Inheritance diagram for LFO:
IAudioSignalGenerator

Public Member Functions

virtual bool reset (double _sampleRate)
 
OscillatorParameters getParameters ()
 
void setParameters (const OscillatorParameters &params)
 
virtual const SignalGenData renderAudioOutput ()
 generates the oscillator output for one sample interval; note that there are multiple outputs.
 
virtual bool reset (double _sampleRate)=0
 
virtual const SignalGenData renderAudioOutput ()=0
 

Protected Member Functions

bool checkAndWrapModulo (double &moduloCounter, double phaseInc)
 
bool advanceAndCheckWrapModulo (double &moduloCounter, double phaseInc)
 
void advanceModulo (double &moduloCounter, double phaseInc)
 
double parabolicSine (double angle)
 

Protected Attributes

OscillatorParameters lfoParameters
 obejcgt parameters
 
double sampleRate = 0.0
 sample rate
 
double modCounter = 0.0
 modulo counter [0.0, +1.0]
 
double phaseInc = 0.0
 phase inc = fo/fs
 
double modCounterQP = 0.25
 Quad Phase modulo counter [0.0, +1.0].
 
const double B = 4.0 / kPi
 
const double C = -4.0 / (kPi* kPi)
 
const double P = 0.225
 

Detailed Description

The LFO object implements a mathematically perfect LFO generator for modulation uses only. It should not be used for audio frequencies except for the sinusoidal output which, though an approximation, has very low TDH.

Audio I/O:

  • Output only object: low frequency generator.

Control I/F:

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Member Function Documentation

◆ advanceAndCheckWrapModulo()

bool LFO::advanceAndCheckWrapModulo ( double &  moduloCounter,
double  phaseInc 
)
inlineprotected

advanvce the modulo counter, then check the modulo counter and wrap if needed

◆ advanceModulo()

void LFO::advanceModulo ( double &  moduloCounter,
double  phaseInc 
)
inlineprotected

advanvce the modulo counter

◆ checkAndWrapModulo()

bool LFO::checkAndWrapModulo ( double &  moduloCounter,
double  phaseInc 
)
inlineprotected

check the modulo counter and wrap if needed

◆ getParameters()

OscillatorParameters LFO::getParameters ( )
inline

get parameters: note use of custom structure for passing param data

Returns
OscillatorParameters custom data structure

◆ parabolicSine()

double LFO::parabolicSine ( double  angle)
inlineprotected

parabolic sinusoidal calcualtion; NOTE: input is -pi to +pi http://devmaster.net/posts/9648/fast-and-accurate-sine-cosine

◆ renderAudioOutput()

const SignalGenData LFO::renderAudioOutput ( )
virtual

generates the oscillator output for one sample interval; note that there are multiple outputs.

render a new audio output structure

Implements IAudioSignalGenerator.

◆ reset()

virtual bool LFO::reset ( double  _sampleRate)
inlinevirtual

reset members to initialized state

< modulo counter [0.0, +1.0]

<Quad Phase modulo counter [0.0, +1.0]

Implements IAudioSignalGenerator.

◆ setParameters()

void LFO::setParameters ( const OscillatorParameters params)
inline

set parameters: note use of custom structure for passing param data

Parameters
OscillatorParameterscustom data structure

The documentation for this class was generated from the following files: