|
arduino-audio-tools
|
STK Stream for Instrument. More...
#include <AudioSTK.h>
Public Member Functions | |
| STKInstrument ()=default | |
| STKInstrument (StkCls &instrument) | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| virtual bool | begin () |
| bool | begin (AudioInfo cfg) |
| Starts the processing. | |
| AudioInfo | defaultConfig () |
| provides the default configuration | |
| virtual void | end () |
| ends the processing | |
| virtual bool | isActive () |
| void | noteOff () |
| void | noteOn (float freq, float vol) |
| 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 amplitude (0.0 ... 1.0) | |
| virtual void | setAudioInfo (AudioInfo info) |
| Defines/updates the AudioInfo. | |
| void | setFrequency (float frequency) override |
| sets the frequency | |
| void | setInput (StkCls &instrument) |
| 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 |
| float | amplitude = 1.0 |
| uint32_t | currentSample = 0 |
| uint8_t | downPercent = 40 |
| float | factor = 1.0f |
| AudioInfo | info |
| T | max_value |
| StkCls * | p_instrument = nullptr |
| 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 |
STK Stream for Instrument.
|
default |
|
inline |
Provides the AudioInfo.
Reimplemented in SineFromTable< T >, SineWaveGenerator< T >, SineWaveGenerator< int16_t >, GeneratorFromArray< T >, and GeneratorFixedValue< T >.
Starts the processing.
Reimplemented from SoundGenerator< T >.
|
inlinevirtualinherited |
provides the default configuration
Reimplemented from SoundGenerator< 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 >.
sets the frequency
Reimplemented from SoundGenerator< T >.
|
inlineinherited |
|
protectedinherited |