arduino-audio-tools
Public Member Functions | Protected Attributes | List of all members
DefaultSynthesizerChannel Class Reference

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>

Inheritance diagram for DefaultSynthesizerChannel:
AbstractSynthesizerChannel

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.
 
DefaultSynthesizerChannelclone () 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
 
ADSRGainp_adsr = nullptr
 
SoundGenerator< int16_t > * p_generator = nullptr
 

Detailed Description

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>>>();.

Author
Phil Schatzmann

The documentation for this class was generated from the following file: