Synth.cpp
 All Data Structures Namespaces Files Functions Variables Macros
Public Member Functions | Private Attributes
Oscillator Class Reference

#include <synth.h>

Public Member Functions

 Oscillator ()
 
void setfreq (float f)
 
void setwaveform (int32_t x)
 
void step (void)
 
uint32_t get_phase (void)
 
int32_t output (void)
 

Private Attributes

uint32_t phase
 
uint32_t dphase
 
uint32_t waveform
 

Detailed Description

Definition at line 237 of file synth.h.

Constructor & Destructor Documentation

Oscillator::Oscillator ( )
inline

Definition at line 253 of file synth.h.

Member Function Documentation

uint32_t Oscillator::get_phase ( void  )
inline

Definition at line 268 of file synth.h.

int32_t Oscillator::output ( void  )

Definition at line 270 of file synth.cpp.

Referenced by SimpleVoice::output(), TwoSquaresVoice::output(), and NoisyVoice::step().

Here is the caller graph for this function:

void Oscillator::setfreq ( float  f)
inline

Definition at line 257 of file synth.h.

Referenced by SimpleVoice::setfreq(), TwoSquaresVoice::setfreq(), and NoisyVoice::setfreq().

Here is the caller graph for this function:

void Oscillator::setwaveform ( int32_t  x)
inline

Definition at line 260 of file synth.h.

Referenced by NoisyVoice::NoisyVoice(), SimpleVoice::SimpleVoice(), and TwoSquaresVoice::TwoSquaresVoice().

Here is the caller graph for this function:

void Oscillator::step ( void  )
inline

Definition at line 265 of file synth.h.

Referenced by SimpleVoice::step(), TwoSquaresVoice::step(), and NoisyVoice::step().

Here is the caller graph for this function:

Field Documentation

uint32_t Oscillator::dphase
private

Because the human ear is very sensitive to pitch, both the phase and dphase variables use the entire 32-bit unsigned range.

Definition at line 249 of file synth.h.

Referenced by setfreq(), and step().

uint32_t Oscillator::phase
private

Because the human ear is very sensitive to pitch, both the phase and dphase variables use the entire 32-bit unsigned range.

Definition at line 243 of file synth.h.

Referenced by get_phase(), output(), and step().

uint32_t Oscillator::waveform
private

Definition at line 250 of file synth.h.

Referenced by Oscillator(), output(), and setwaveform().


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