svapp  1.9
ContinuousSynth Class Reference

Mix into a target buffer a signal synthesised so as to sound at a specific frequency. More...

#include <ContinuousSynth.h>

List of all members.

Public Member Functions

 ContinuousSynth (int channels, int sampleRate, int blockSize, int waveType)
 ~ContinuousSynth ()
void setChannelCount (int channels)
void reset ()
void mix (float **toBuffers, float gain, float pan, float f0)
 Mix in a signal to be heard at the given fundamental frequency.

Private Attributes

int m_channels
int m_sampleRate
int m_blockSize
double m_prevF0
double m_phase
int m_wavetype

Detailed Description

Mix into a target buffer a signal synthesised so as to sound at a specific frequency.

The frequency may change with each processing block, or may be switched on or off.

Definition at line 24 of file ContinuousSynth.h.


Constructor & Destructor Documentation

ContinuousSynth::ContinuousSynth ( int  channels,
int  sampleRate,
int  blockSize,
int  waveType 
)

Definition at line 22 of file ContinuousSynth.cpp.

Definition at line 32 of file ContinuousSynth.cpp.


Member Function Documentation

void ContinuousSynth::setChannelCount ( int  channels)

Definition at line 37 of file ContinuousSynth.cpp.

References m_phase.

void ContinuousSynth::mix ( float **  toBuffers,
float  gain,
float  pan,
float  f0 
)

Mix in a signal to be heard at the given fundamental frequency.

Any oscillator state will be maintained between process calls so as to provide a continuous sound. The f0 value may vary between calls.

Supply f0 equal to 0 if you want to maintain the f0 from the previous block (without having to remember what it was).

Supply f0 less than 0 for silence. You should continue to call this even when the signal is silent if you want to ensure the sound switches on and off cleanly.

Definition at line 43 of file ContinuousSynth.cpp.

References m_blockSize, m_channels, m_phase, m_prevF0, m_sampleRate, and m_wavetype.

Referenced by AudioGenerator::mixContinuousSynthModel().


Member Data Documentation

Definition at line 53 of file ContinuousSynth.h.

Referenced by mix().

Definition at line 54 of file ContinuousSynth.h.

Referenced by mix().

Definition at line 55 of file ContinuousSynth.h.

Referenced by mix().

double ContinuousSynth::m_prevF0 [private]

Definition at line 57 of file ContinuousSynth.h.

Referenced by mix().

double ContinuousSynth::m_phase [private]

Definition at line 58 of file ContinuousSynth.h.

Referenced by mix(), and reset().

Definition at line 60 of file ContinuousSynth.h.

Referenced by mix().


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