svapp
1.9
|
Mix into a target buffer a signal synthesised so as to sound at a specific frequency. More...
#include <ContinuousSynth.h>
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 |
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.
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.
void ContinuousSynth::setChannelCount | ( | int | channels | ) |
void ContinuousSynth::reset | ( | ) |
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().
int ContinuousSynth::m_channels [private] |
Definition at line 53 of file ContinuousSynth.h.
Referenced by mix().
int ContinuousSynth::m_sampleRate [private] |
Definition at line 54 of file ContinuousSynth.h.
Referenced by mix().
int ContinuousSynth::m_blockSize [private] |
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.
int ContinuousSynth::m_wavetype [private] |
Definition at line 60 of file ContinuousSynth.h.
Referenced by mix().