|
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 <CodecOpusOgg.h>
Public Member Functions | |
| SineFromTable (float amplitude=NumberConverter::maxValueT< T >()) | |
| SineFromTable (float amplitude=NumberConverter::maxValueT< T >()) | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| bool | begin () |
| bool | begin () |
| bool | begin (AudioInfo info, float frequency) |
| bool | begin (AudioInfo info, float frequency) |
| bool | begin (int channels, int sample_rate, uint16_t frequency=0) |
| bool | begin (int channels, int sample_rate, uint16_t frequency=0) |
| virtual bool | begin (AudioInfo info) |
| Starts the processing with the provided AudioInfo. | |
| virtual AudioInfo | defaultConfig () |
| Provides the default configuration. | |
| virtual void | end () |
| virtual bool | isActive () |
| Checks if the begin method has been called - after end() isActive is false. | |
| 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. | |
| T | readSample () |
| Provides a single sample. | |
| virtual size_t | readSamples (int16_t *data, size_t len) |
| virtual void | restart () |
| Restarts the generator, e.g. after a play time has been defined and reached. | |
| void | setAmplitude (float amplitude) |
| Defines the new amplitude (volume). | |
| 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 | setFrequency (float freq) |
| Abstract method: not implemented! Just provides an error message... | |
| void | setMaxAmplitudeStep (float step) |
| void | setMaxAmplitudeStep (float step) |
| virtual void | setPlayTime (uint32_t playMs, uint8_t upPercent=20, uint8_t downPercent=30) |
| Defines the play time in ms and the ramp up and ramp down time in percent. | |
| virtual void | setRampTimes (uint32_t playMs, uint32_t upMs=5, uint32_t downMs=5) |
Protected Member Functions | |
| int16_t | applyRamp (int16_t sample) |
| T | interpolate (float angle) |
| T | interpolate (float angle) |
| T | map (T x, T in_min, T in_max, T out_min, T out_max) |
| T | map (T x, T in_min, T in_max, T out_min, T out_max) |
| size_t | readBytesFrames (uint8_t *buffer, size_t lengthBytes, int frames, int channels) |
| size_t | readBytesFromBuffer (uint8_t *buffer, size_t lengthBytes, int frame_size, int channels) |
| void | recalculatePlayTime () |
| void | updateAmplitudeInSteps () |
| void | updateAmplitudeInSteps () |
Protected Attributes | |
| bool | active |
| bool | activeWarningIssued |
| float | amplitude |
| float | amplitude_to_be |
| float | angle = 0.0f |
| float | base_frequency = 1.0f |
| uint32_t | currentSample |
| uint32_t | downMs |
| uint8_t | downPercent |
| uint32_t | downSamples |
| float | factor |
| AudioInfo | info |
| bool | is_first = true |
| float | max_amplitude_step = 50.0f |
| uint32_t | playMs |
| uint32_t | playSamples |
| float | rampDownDec |
| float | rampUpInc |
| RingBuffer< uint8_t > | ring_buffer |
| float | step = 1.0f |
| float | step_new = 1.0f |
| uint32_t | upMs |
| uint8_t | upPercent |
| uint32_t | upSamples |
| const float | values [181] |
A sine generator based on a table. The table is created using degrees where one full wave is 360 degrees.
|
inline |
|
inline |
|
inlineprotectedinherited |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Starts the processing with the provided AudioInfo.
Reimplemented in FastIntSineGenerator< T >, FastIntSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< T >, GeneratorFixedValue< T >, GeneratorFixedValue< T >, GeneratorFromArray< T >, GeneratorFromArray< T >, SawToothGenerator< T >, SawToothGenerator< T >, SquareWaveGenerator< T >, and SquareWaveGenerator< T >.
|
inlinevirtualinherited |
Provides the default configuration.
Reimplemented in FloatSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, FloatSineGenerator< T >, STKGenerator< StkCls, T >, STKGenerator< stk::Instrmnt, int16_t >, and STKGenerator< StkCls, int16_t >.
|
inlinevirtualinherited |
Reimplemented in GeneratorFromArray< T >, GeneratorFromArray< T >, GeneratorQueue< T >, GeneratorQueue< T >, GeneratorFromArray< T >, and GeneratorQueue< T >.
|
inlineprotected |
|
inlineprotected |
|
inlinevirtualinherited |
Checks if the begin method has been called - after end() isActive is false.
|
inlineprotected |
|
inlineprotected |
|
inlinevirtualinherited |
Provides the data as byte array with the requested number of channels.
Reimplemented in GeneratorQueue< T >, GeneratorQueue< T >, and GeneratorQueue< T >.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlinevirtual |
Provides a single sample.
Implements SoundGenerator< int16_t >.
|
inlinevirtual |
Provides a single sample.
Implements SoundGenerator< int16_t >.
|
inlinevirtualinherited |
Provides the data as T array (interleaved by channel) with the requested number of samples (values, not frames)
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Restarts the generator, e.g. after a play time has been defined and reached.
|
inline |
Defines the new amplitude (volume).
|
inline |
Defines the new amplitude (volume).
|
inlinevirtualinherited |
Defines/updates the AudioInfo.
Reimplemented in FastIntSineGenerator< T >, FastIntSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, SawToothGenerator< T >, SawToothGenerator< T >, SquareWaveGenerator< T >, and SquareWaveGenerator< T >.
|
inlinevirtual |
Abstract method: not implemented! Just provides an error message...
Reimplemented from SoundGenerator< int16_t >.
|
inlinevirtual |
Abstract method: not implemented! Just provides an error message...
Reimplemented from SoundGenerator< int16_t >.
|
inline |
To avoid pops we do not allow to big amplitude changes at once and spread them over time
|
inline |
To avoid pops we do not allow to big amplitude changes at once and spread them over time
|
inlinevirtualinherited |
Defines the play time in ms and the ramp up and ramp down time in percent.
Reimplemented in GeneratorQueue< T >, GeneratorQueue< T >, and GeneratorQueue< T >.
|
inlinevirtualinherited |
|
inlineprotected |
|
inlineprotected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |