arduino-audio-tools
|
Default implementation for a Channel. You can provide the Sound Generator as parameter to the effects: e.g. DefaultSynthesizerChannel<AudioEffects<SineWaveGenerator<int16_t>>> *channel = new DefaultSynthesizerChannel<AudioEffects<SineWaveGenerator<int16_t>>>();. More...
#include <Synthesizer.h>
Public Member Functions | |
DefaultSynthesizerChannel ()=default | |
Default constructor. | |
DefaultSynthesizerChannel (DefaultSynthesizerChannel &ch)=default | |
Copy constructor. | |
DefaultSynthesizerChannel (SoundGenerator< int16_t > &generator) | |
void | addEffect (AudioEffect *ptr) |
virtual void | begin (AudioInfo config) override |
Start the sound generation. | |
DefaultSynthesizerChannel * | clone () override |
virtual bool | isActive () override |
Checks if the ADSR is still active - and generating sound. | |
virtual void | keyOff () override |
Provides the key off event to ADSR to stop the sound. | |
virtual void | keyOn (int note, float tgt) override |
start to play a note - note expects the frequency of the note! | |
virtual int | note () override |
Provides the actual midi note that is played. | |
virtual int16_t | readSample () override |
Provides the next sample. | |
void | setGenerator (SoundGenerator< int16_t > &generator) |
Protected Attributes | |
int | actual_note = 0 |
AudioInfo | config |
AudioEffectCommon | effects |
ADSRGain * | p_adsr = nullptr |
SoundGenerator< int16_t > * | p_generator = nullptr |
Default implementation for a Channel. You can provide the Sound Generator as parameter to the effects: e.g. DefaultSynthesizerChannel<AudioEffects<SineWaveGenerator<int16_t>>> *channel = new DefaultSynthesizerChannel<AudioEffects<SineWaveGenerator<int16_t>>>();.