arduino-audio-tools
|
A sine generator based on a table. The table is created using degrees where one full wave is 360 degrees. More...
#include <SoundGenerator.h>
Public Member Functions | |
SineFromTable (float amplitude=32767.0) | |
virtual AudioInfo | audioInfo () |
Provides the AudioInfo. | |
bool | begin () |
virtual bool | begin (AudioInfo info) |
bool | begin (AudioInfo info, float frequency) |
bool | begin (int channels, int sample_rate, uint16_t frequency=0) |
virtual AudioInfo | defaultConfig () |
Provides the default configuration. | |
virtual void | end () |
ends the processing | |
virtual bool | isActive () |
virtual size_t | readBytes (uint8_t *data, size_t len) |
Provides the data as byte array with the requested number of channels. | |
T | readSample () |
Provides a single sample. | |
void | setAmplitude (float amplitude) |
Defines the new amplitude (volume) | |
virtual void | setAudioInfo (AudioInfo info) |
Defines/updates the AudioInfo. | |
void | setFrequency (float freq) |
Abstract method: not implemented! Just provides an error message... | |
void | setMaxAmplitudeStep (float step) |
Protected Attributes | |
bool | active = false |
bool | activeWarningIssued = false |
float | amplitude |
float | amplitude_to_be |
float | angle = 0.0f |
float | base_frequency = 1.0f |
AudioInfo | info |
bool | is_first = true |
float | max_amplitude_step = 50.0f |
RingBuffer< uint8_t > | ring_buffer {0} |
float | step = 1.0f |
float | step_new = 1.0f |
const float | values [181] |
A sine generator based on a table. The table is created using degrees where one full wave is 360 degrees.
|
inlinevirtual |
Reimplemented from SoundGenerator< T >.
|
inlinevirtualinherited |
Reimplemented in STKGenerator< StkCls, T >, and STKGenerator< StkCls, int16_t >.
|
inlinevirtualinherited |
Provides the default configuration.
Reimplemented in STKGenerator< StkCls, T >, STKGenerator< StkCls, int16_t >, SineWaveGenerator< T >, and SineWaveGenerator< int16_t >.
|
inlinevirtualinherited |
ends the processing
Reimplemented in GeneratorFromArray< T >.
|
inlinevirtualinherited |
Checks if the begin method has been called - after end() isActive returns false
|
inlinevirtual |
Provides a single sample.
Implements SoundGenerator< T >.
|
inlinevirtualinherited |
Defines/updates the AudioInfo.
Reimplemented in SineWaveGenerator< T >, and SineWaveGenerator< int16_t >.
|
inlinevirtual |
Abstract method: not implemented! Just provides an error message...
Reimplemented from SoundGenerator< T >.
|
inline |
To avoid pops we do not allow to big amplitude changes at once and spread them over time