Mozzi  alpha 0.01.1t
sound synthesis library for Arduino
 All Classes Functions Typedefs
Public Member Functions
Phasor< UPDATE_RATE > Class Template Reference

Phasor repeatedly generates a high resolution ramp at a variable frequency. More...

List of all members.

Public Member Functions

 Phasor ()
 Constructor.
unsigned long next ()
 Increments one step along the phase.
void set (unsigned long value)
 Set the current value of the phasor.
void setFreq (unsigned int frequency)
 Set the Phasor frequency with an unsigned int.
void setFreq (float frequency)
 Set the Phasor frequency with a float.

Detailed Description

template<unsigned int UPDATE_RATE>
class Phasor< UPDATE_RATE >

Phasor repeatedly generates a high resolution ramp at a variable frequency.

The output of Phasor.next() is an unsigned number between 0 and 4294967295, the maximum that can be expressed by an unsigned long.

Template Parameters:
UPDATE_RATEthe rate at which the Phasor will be updated, usually CONTROL_RATE or AUDIO_RATE.

Definition at line 40 of file Phasor.h.


Constructor & Destructor Documentation

template<unsigned int UPDATE_RATE>
Phasor< UPDATE_RATE >::Phasor ( ) [inline]

Constructor.

"Phasor <AUDIO_RATE> myphasor;" makes a Phasor which updates at AUDIO_RATE.

Definition at line 50 of file Phasor.h.


Member Function Documentation

template<unsigned int UPDATE_RATE>
unsigned long Phasor< UPDATE_RATE >::next ( ) [inline]

Increments one step along the phase.

Returns:
the next value.

Definition at line 58 of file Phasor.h.

template<unsigned int UPDATE_RATE>
void Phasor< UPDATE_RATE >::set ( unsigned long  value) [inline]

Set the current value of the phasor.

The Phasor will continue incrementing from this value using any previously calculated step size.

Definition at line 71 of file Phasor.h.

template<unsigned int UPDATE_RATE>
void Phasor< UPDATE_RATE >::setFreq ( unsigned int  frequency) [inline]

Set the Phasor frequency with an unsigned int.

Parameters:
frequencyis how many times per second to count from 0 to the maximum unsigned long value 4294967295.

Definition at line 82 of file Phasor.h.

template<unsigned int UPDATE_RATE>
void Phasor< UPDATE_RATE >::setFreq ( float  frequency) [inline]

Set the Phasor frequency with a float.

Parameters:
frequencyis how many times per second to count from 0 to the maximum unsigned long value 4294967295.

Definition at line 93 of file Phasor.h.


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