Gamma  0.9.5
Generic Synthesis Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
LFO< Stap, Ts > Class Template Reference

Low-frequency oscillator (non band-limited). More...

#include <Oscillator.h>

Inheritance diagram for LFO< Stap, Ts >:
Accum< Stap, Ts >

List of all members.

Public Member Functions

 LFO (float frq, float phase=0, float mod=0.5)
LFOset (float f, float p, float m)
 Set frequency, phase and modifier amount.
LFOmod (double n)
 Sets modifier parameter of waveform from unit value.
float cos ()
 Cosine based on 3rd order polynomial.
float down ()
 Downward ramp (1 to -1)
float even3 ()
 Even harmonic sine-like wave (3rd order)
float even5 ()
 Even harmonic sine-like wave (5th order)
float imp ()
 Impulse (occurs at beginning of cycle)
float line2 ()
 2-segment line. mod changes wave from down to tri to up
float para ()
 Parabolic wave (triangle wave with all harmonics)
float pulse ()
 Pulse (up + down). 'mod' controls pulse width.
float sinPara ()
 Sine-like wave constructed from parabolas (odd harmonics)
float stair ()
 Stair (square + square). 'mod' controls pulse width.
float sqr ()
 Square (-1 to 1)
float tri ()
 Triangle (starts at 1 goes down to -1 then up to 1)
float up ()
 Upward ramp.
float up2 ()
 Dual upward ramp (up + up). 'mod' controls pulse width.
float cosU ()
 Unipolar cosine based on 3rd order polynomial.
float downU ()
 Unipolar downward ramp.
float hann ()
 Hann window.
float line2U ()
 Unipolar line2.
float paraU ()
 Unipolar parabolic wave.
float pulseU ()
 Unipolar pulse.
float stairU ()
 Unipolar stair.
float sqrU ()
 Unipolar square.
float triU ()
 Unipolar triangle (starts at 1 going down then up)
float upU ()
 Unipolar upward ramp.
float up2U ()
 Unipolar upward ramp2.
void freq (float v)
 Set frequency.
float freq () const
 Get frequency.
void phase (float v)
 Set phase from [0, 1) of one period.
float phase () const
 Get phase in [0, 1)
void phaseMax ()
 Set phase to maximum value.
void phaseAdd (float v)
 Add value to phase [0, 1)
void period (float v)
 Set period length.
void reset ()
 Reset phase accumulator.
bool done () const
 Returns true if tap is done.
uint32_t freqI () const
 Get fixed-point frequency.
float freqUnit () const
 Get frequency in [0, 1)
uint32_t phaseI () const
 Get fixed-point phase.
uint32_t cycle ()
 Returns 0x80000000 on phase wrap, 0 otherwise.
uint32_t operator() ()
 Alias of cycle()
uint32_t nextPhase ()
 Increment phase and return pre-incremented phase.
uint32_t nextPhasePost ()
 Increment phase and return post-incremented phase.
uint32_t cycles ()
 Get 1 to 0 transitions of all accumulator bits.

Public Attributes

uint32_t modi
 Modifier parameter.

Detailed Description

template<class Stap = tap::Wrap, class Ts = Synced>
class gam::LFO< Stap, Ts >

Low-frequency oscillator (non band-limited).

This object generates various waveform types by mapping the output of a an accumulator through mathematical functions.


Constructor & Destructor Documentation

LFO ( float  frq,
float  phase = 0,
float  mod = 0.5 
)
Parameters:
[in]frqFrequency
[in]phasePhase in [0, 1)
[in]modModifier amount in [0, 1)

Member Function Documentation

uint32_t cycle ( ) [inherited]

Returns 0x80000000 on phase wrap, 0 otherwise.

The return value can be used as a bool. It's an integer because it saves a conditional check converting to a bool.


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