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

Linear sweep in interval [0,1) More...

#include <Oscillator.h>

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

List of all members.

Public Member Functions

 Sweep (float frq=440, float phs=0)
float operator() ()
 Alias of cycle()
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 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.

Detailed Description

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

Linear sweep in interval [0,1)


Constructor & Destructor Documentation

Sweep ( float  frq = 440,
float  phs = 0 
)
Parameters:
[in]frqFrequency
[in]phsPhase 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: