Representation of a basic wave. More...
#include <basicwave.h>
Public Member Functions | |
BasicWave (uint16_t bitrate) | |
SampleType | getNextSample () |
Retrieve next sample to play. | |
![]() | |
Wave (uint16_t bitrate) | |
void | setNewFormula (FormulaFunction func) |
Set a new formula. | |
void | addToFormula (FormulaFunction func) |
Add an extra formula. | |
void | setLowestFrequency (float freq) |
Set a new lowest frequency. | |
float | getLowestFrequency () |
Retrieve the lowest frequency. | |
void | updateBuffer () |
Update the wave buffer. |
Additional Inherited Members | |
![]() | |
SampleType * | buffer |
std::size_t | bufferSize |
Representation of a basic wave.
BasicWave is the simplest implementation of the abstract Wave class. Oscillators create instances of BasicWave, which can later on be upgraded to EnvelopedWave objects should the need occur.
Definition at line 13 of file basicwave.h.
Construct a BasicWave
When working with 16-bit samples, set uint16_t as the SampleType.
SampleType | Integer type for storing sample in |
Definition at line 10 of file basicwave.cpp.
|
virtual |
Retrieve next sample to play.
Retrieve the next sample from the buffer to play. If the end of the buffer has been reached, getNextSample() will automatically return to the beginning of the buffer.
Implements Wave< SampleType >.
Definition at line 29 of file basicwave.cpp.