|
arduino-audio-tools
|
The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language. You need to install https://github.com/pschatzmann/Arduino-STK. More...
#include <AudioSTK.h>
Public Member Functions | |
| STKGenerator ()=default | |
| STKGenerator (StkCls &instrument) | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| virtual bool | begin () |
| Starts the processing. | |
| bool | begin (AudioInfo cfg) |
| Starts the processing. | |
| AudioInfo | defaultConfig () |
| provides the default configuration | |
| virtual void | end () |
| virtual void | end (bool allow_rampdown) |
| 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. | |
| virtual size_t | readSamples (T *data, size_t len) |
| virtual void | restart () |
| Restarts the generator, e.g. after a play time has been defined and reached. | |
| virtual void | setAudioInfo (AudioInfo info) |
| Defines/updates the AudioInfo. | |
| virtual void | setFrequency (float frequency) |
| Abstract method: not implemented! Just provides an error message... | |
| void | setInput (StkCls &instrument) |
| 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 | |
| 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 |
| uint32_t | currentSample = 0 |
| uint32_t | downMs = 0 |
| uint8_t | downPercent = 40 |
| uint32_t | downSamples = 0 |
| 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 |
| float | rampUpInc = 0.0 |
| RingBuffer< uint8_t > | ring_buffer {0} |
| uint32_t | upMs = 0 |
| uint8_t | upPercent = 5 |
| uint32_t | upSamples = 0 |
The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language. You need to install https://github.com/pschatzmann/Arduino-STK.
You can find further informarmation in the original Readme of the STK Project
Like many other sound libraries it originates from an University (Princeton) and can look back at a very long history: it was created in 1995. In the 90s the computers had limited processor power and memory available. In todays world we can get some cheap Microcontrollers, which provide almost the same capabilities.
| T |
|
default |
|
inline |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Provides the AudioInfo.
|
inlinevirtualinherited |
Starts the processing.
Reimplemented in SineFromTable< T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, FastIntSineGenerator< T >, SquareWaveGenerator< T >, SawToothGenerator< T >, GeneratorFromArray< T >, and GeneratorFixedValue< T >.
|
inlinevirtual |
Starts the processing.
Reimplemented from SoundGenerator< T >.
|
inlinevirtual |
provides the default configuration
Reimplemented from SoundGenerator< T >.
|
inlinevirtualinherited |
Reimplemented in GeneratorFromArray< T >, and GeneratorQueue< T >.
|
inlinevirtualinherited |
Ends the processing. If either setPlayTime() or setRampTimes() have been set, then allow_rampdown=true will start a ramp-down instead of stopping immediately.
|
inlinevirtualinherited |
Checks if the begin method has been called - after end() isActive is false.
|
inlinevirtualinherited |
Provides the data as byte array with the requested number of channels.
Reimplemented in GeneratorQueue< T >.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlinevirtual |
Provides a single sample.
Implements SoundGenerator< T >.
|
inlinevirtualinherited |
Provides the data as T array (interleaved by channel) with the requested number of samples (values, not frames)
Reimplemented in GeneratorQueue< T >.
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Restarts the generator, e.g. after a play time has been defined and reached.
|
inlinevirtualinherited |
Defines/updates the AudioInfo.
Reimplemented in FloatSineGenerator< T >, FloatSineGenerator< int16_t >, FastIntSineGenerator< T >, SquareWaveGenerator< T >, and SawToothGenerator< T >.
|
inlinevirtualinherited |
Abstract method: not implemented! Just provides an error message...
Reimplemented in GeneratorQueue< T >, SineFromTable< T >, STKInstrument< StkCls, T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, FastIntSineGenerator< T >, SquareWaveGenerator< T >, SawToothGenerator< T >, and GeneratorFromArray< T >.
|
inline |
|
inlinevirtualinherited |
Defines the play time in ms and the ramp up and ramp down time in percent.
Reimplemented in GeneratorQueue< T >.
|
inlinevirtualinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |