|
arduino-audio-tools
|
Generates pink noise. More...
#include <SoundGenerator.h>
Public Member Functions | |
| PinkNoiseGenerator (T amplitude=32767) | |
| the amplitude defines the max value which is generated | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| virtual bool | begin () |
| virtual bool | begin (AudioInfo info) |
| 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. | |
| virtual void | setAudioInfo (AudioInfo info) |
| Defines/updates the AudioInfo. | |
| virtual void | setFrequency (float frequency) |
| Abstract method: not implemented! Just provides an error message... | |
| void | setPlayTime (uint32_t playMs, uint8_t upPercent=20, uint8_t downPercent=30) |
Protected Member Functions | |
| T | applyRamp (T sample) |
| 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 () |
Protected Attributes | |
| bool | active = false |
| bool | activeWarningIssued = false |
| unsigned int | amplitude |
| uint32_t | currentSample = 0 |
| uint8_t | downPercent = 40 |
| float | factor = 1.0f |
| AudioInfo | info |
| T | key |
| T | max_key |
| uint32_t | playMs = 0 |
| uint32_t | playSamples = 0 |
| float | rampDownDec = 0.0 |
| uint32_t | rampDownSamples = 0 |
| float | rampUpInc = 0.0 |
| RingBuffer< uint8_t > | ring_buffer {0} |
| uint8_t | upPercent = 5 |
| uint32_t | upSamples = 0 |
| unsigned int | white_values [5] |
Generates pink noise.
|
inline |
the amplitude defines the max value which is generated
Provides the AudioInfo.
Reimplemented in SineFromTable< T >, SineWaveGenerator< T >, SineWaveGenerator< int16_t >, GeneratorFromArray< T >, and GeneratorFixedValue< T >.
Provides the default configuration.
Reimplemented in STKGenerator< StkCls, T >, STKGenerator< stk::Instrmnt, int16_t >, STKGenerator< StkCls, int16_t >, SineWaveGenerator< T >, and SineWaveGenerator< int16_t >.
ends the processing
Reimplemented in GeneratorFromArray< T >.
Checks if the begin method has been called - after end() isActive returns false
Provides the data as byte array with the requested number of channels.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
Provides a single sample.
Implements SoundGenerator< T >.
Defines/updates the AudioInfo.
Reimplemented in SineWaveGenerator< T >, and SineWaveGenerator< int16_t >.
Abstract method: not implemented! Just provides an error message...
Reimplemented in SineFromTable< T >, STKInstrument< StkCls, T >, SineWaveGenerator< T >, and SineWaveGenerator< int16_t >.
|
inlineinherited |
|
protectedinherited |