Aviate Audio Multiverse Library
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Aviate::AudioEffectWrapper Class Referenceabstract

Audio Effect base class. More...

#include <AudioEffectWrapper.h>

Collaboration diagram for Aviate::AudioEffectWrapper:
Collaboration graph
[legend]

Public Member Functions

 AudioEffectWrapper ()
 Constructor.
 
virtual ~AudioEffectWrapper ()
 Destructor.
 
virtual const char * getName ()=0
 Name of the effect. This is normally implemented by automatically by the EffectCreator App. More...
 
virtual void setParam (int paramIndex, float paramValue)=0
 Updates the effect with specified parameter index and value. More...
 
virtual float getUserParamValue (int paramIndex, float normalizedParamValue)=0
 Converts a normalized [0,1.0] value to the user value/range from Effect Creator. More...
 
void sendValueReport (int controlIndex, float value)
 For MONITOR-only controls, you can report them to the host using sendValueReport(). More...
 
virtual void inputLevelAdjust (float scaleFactor)
 (OPTIONAL) controls an input scaling value applied to effects. This must be implemented by the effect to be utilized. More...
 
virtual void resetInputPeak ()
 Reset the peak recorded input level.
 
virtual uint16_t getInputPeak ()
 Get the input peak level as a uint16_t. More...
 
virtual void resetOutputPeak ()
 Reset the peak output level recorded.
 
virtual uint16_t getOutputPeak ()
 Get the output peak level as a uint16_t. More...
 
virtual void enable ()
 Enables audio processing. Note: when not enabled, CPU load is nearly zero.
 
virtual void disable ()
 Disables audio process. When disabled, CPU load is nearly zero.
 
virtual void bypass (bool byp)
 Bypass the effect. More...
 
virtual bool isBypass ()
 Get if the effect is bypassed. More...
 
virtual void toggleBypass ()
 Toggle the bypass effect.
 
virtual void volume (float vol)
 Set the output volume. This affect both the wet and dry signals. More...
 
virtual void volumeDb (float volDb)
 Set the output volume in negative dB. Unity is 0.0, half volume would be -6.0 dB, etc. More...
 
bool isSramReady ()
 Checks to seeif the SRAM Manager is ready. More...
 
SramManagergetSramManager ()
 Returns a pointer to the SramManager. More...
 
virtual void setMidiOmni (bool isOmni)
 Sets whether MIDI OMNI channel is processig on or off. When on, all midi channels are used for matching CCs. More...
 
virtual void mapMidiControl (int parameter, int midiCC, int midiChannel=0)=0
 Configure an effect parameter to be controlled by a MIDI CC number on a particular channel. More...
 
virtual void processMidi (int channel, int midiCC, int value)=0
 process a MIDI Continous-Controller (CC) message More...
 
virtual const uint8_t * getRblk ()=0
 Audio synchronization. More...
 

Protected Member Functions

void m_updateInputPeak (const audio_block_t *block)
 Process an audio_block_t and update the m_inputMaxPeak protected variable. More...
 
void m_updateInputPeak (const int16_t *audioData)
 Process an audio block as a raw int16_t array and update the m_inputMaxPeak protected variable. More...
 
void m_updateOutputPeak (const audio_block_t *block)
 Process an audio_block_t and update the m_outputMaxPeak protected variable. More...
 
void m_updateOutputPeak (const int16_t *audioData)
 Process an audio block as a raw int16_t array and update the m_outputMaxPeak protected variable. More...
 
void m_updatePeak (const int16_t *audioData, uint16_t &peak)
 Internal function used to find the peak in a raw block of audio samples. Size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t) More...
 
void m_applyInputScaling (audio_block_t *block)
 Convenience function for EFX developer. If you wish to apply input scaling, this function will use the value stored in m_inputScaleFactor. More...
 

Protected Attributes

bool m_isOmni = false
 when true, all MIDI channels are processed
 
bool m_bypass = true
 when true, effect is bypassed and will transit input audio to output
 
bool m_enable = false
 when true, effect is disabled with no processing
 
float m_inputScaleFactor = 1.0f
 input scaling factor (if used by the effect)
 
uint16_t m_inputMaxPeak = 0
 current input peak level
 
uint16_t m_outputMaxPeak = 0
 current output peak level
 
float m_volume = 1.0f
 master volume control as a scaling factor. Typically 0.0 to 1.0f.
 
SramManagerm_sramManagerPtr = nullptr
 If the effect uses external SRAM this will be populated.
 
ReportManagerm_reportManagerPtr = nullptr
 populated with the ReportManager instance
 

Static Protected Attributes

static constexpr int MIDI_CHANNEL = 0
 MIDI channel array index. Internal use only.
 
static constexpr int MIDI_CONTROL = 1
 MIDI control array index. Internal use only.
 

Detailed Description

Audio Effect base class.

Member Function Documentation

◆ bypass()

virtual void Aviate::AudioEffectWrapper::bypass ( bool  byp)
virtual

Bypass the effect.

Parameters
bypwhen true, bypass wil disable the effect, when false, effect is enabled. Note that audio still passes through when bypass is enabled.

◆ getInputPeak()

virtual uint16_t Aviate::AudioEffectWrapper::getInputPeak ( )
virtual

Get the input peak level as a uint16_t.

Returns
the input peak level recorded

◆ getName()

virtual const char* Aviate::AudioEffectWrapper::getName ( )
pure virtual

Name of the effect. This is normally implemented by automatically by the EffectCreator App.

Returns
a char* array to a C string with the name

◆ getOutputPeak()

virtual uint16_t Aviate::AudioEffectWrapper::getOutputPeak ( )
virtual

Get the output peak level as a uint16_t.

Returns
the output peak level recorded

◆ getRblk()

virtual const uint8_t* Aviate::AudioEffectWrapper::getRblk ( )
pure virtual

Audio synchronization.

Returns
pointer to audio interrupt lookup

◆ getSramManager()

SramManager* Aviate::AudioEffectWrapper::getSramManager ( )

Returns a pointer to the SramManager.

Returns
a pointer to the SramManager, if valid. Otherwise, nullptr.

◆ getUserParamValue()

virtual float Aviate::AudioEffectWrapper::getUserParamValue ( int  paramIndex,
float  normalizedParamValue 
)
pure virtual

Converts a normalized [0,1.0] value to the user value/range from Effect Creator.

Parameters
paramIndexthe index of the parameter for this effect
normalizedParamValuethe normalized [0,1.0] ranged value
Returns
the float value for the requested parameter

◆ inputLevelAdjust()

virtual void Aviate::AudioEffectWrapper::inputLevelAdjust ( float  scaleFactor)
virtual

(OPTIONAL) controls an input scaling value applied to effects. This must be implemented by the effect to be utilized.

Parameters
scaleFactora float value to be applied as a scaling fator

◆ isBypass()

virtual bool Aviate::AudioEffectWrapper::isBypass ( )
virtual

Get if the effect is bypassed.

Returns
true if bypassed, false if not bypassed

◆ isSramReady()

bool Aviate::AudioEffectWrapper::isSramReady ( )

Checks to seeif the SRAM Manager is ready.

Returns
true if SRAM is ready, otherwise false;

◆ m_applyInputScaling()

void Aviate::AudioEffectWrapper::m_applyInputScaling ( audio_block_t *  block)
protected

Convenience function for EFX developer. If you wish to apply input scaling, this function will use the value stored in m_inputScaleFactor.

Parameters
blockpointer to an audio_block_t structure

◆ m_updateInputPeak() [1/2]

void Aviate::AudioEffectWrapper::m_updateInputPeak ( const audio_block_t *  block)
protected

Process an audio_block_t and update the m_inputMaxPeak protected variable.

Parameters
blockpointer to an audio_block_t structure

◆ m_updateInputPeak() [2/2]

void Aviate::AudioEffectWrapper::m_updateInputPeak ( const int16_t *  audioData)
protected

Process an audio block as a raw int16_t array and update the m_inputMaxPeak protected variable.

Parameters
audioDatapointer to an array of int16_t. It's size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t)

◆ m_updateOutputPeak() [1/2]

void Aviate::AudioEffectWrapper::m_updateOutputPeak ( const audio_block_t *  block)
protected

Process an audio_block_t and update the m_outputMaxPeak protected variable.

Parameters
blockpointer to an audio_block_t structure

◆ m_updateOutputPeak() [2/2]

void Aviate::AudioEffectWrapper::m_updateOutputPeak ( const int16_t *  audioData)
protected

Process an audio block as a raw int16_t array and update the m_outputMaxPeak protected variable.

Parameters
audioDatapointer to an array of int16_t. It's size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t)

◆ m_updatePeak()

void Aviate::AudioEffectWrapper::m_updatePeak ( const int16_t *  audioData,
uint16_t &  peak 
)
protected

Internal function used to find the peak in a raw block of audio samples. Size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t)

Parameters
audioDatapointer to an array of int16_t. It's size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t)
peakpeak value will be written to this variable

◆ mapMidiControl()

virtual void Aviate::AudioEffectWrapper::mapMidiControl ( int  parameter,
int  midiCC,
int  midiChannel = 0 
)
pure virtual

Configure an effect parameter to be controlled by a MIDI CC number on a particular channel.

Parameters
parameterone of the parameter names in the class enum
midiCCthe CC number from 0 to 127
midiChannelthe effect will only response to the CC on this channel when OMNI mode is off.

◆ processMidi()

virtual void Aviate::AudioEffectWrapper::processMidi ( int  channel,
int  midiCC,
int  value 
)
pure virtual

process a MIDI Continous-Controller (CC) message

Parameters
channelthe MIDI channel from 0 to 15)
midiCCthe CC number from 0 to 127
valuethe CC value from 0 to 127

◆ sendValueReport()

void Aviate::AudioEffectWrapper::sendValueReport ( int  controlIndex,
float  value 
)

For MONITOR-only controls, you can report them to the host using sendValueReport().

Parameters
controlIndexthis is the control enum value defined in your EFX public header
valuethe control value to send to the host

◆ setMidiOmni()

virtual void Aviate::AudioEffectWrapper::setMidiOmni ( bool  isOmni)
virtual

Sets whether MIDI OMNI channel is processig on or off. When on, all midi channels are used for matching CCs.

Parameters
isOmniwhen true, all channels are processed, when false, channel must match configured value.

◆ setParam()

virtual void Aviate::AudioEffectWrapper::setParam ( int  paramIndex,
float  paramValue 
)
pure virtual

Updates the effect with specified parameter index and value.

Parameters
paramIndexthe index of the parameter for this effect
paramValuethe new value for the effect

◆ volume()

virtual void Aviate::AudioEffectWrapper::volume ( float  vol)
virtual

Set the output volume. This affect both the wet and dry signals.

The default is 1.0.

Parameters
volSets the output volume between -1.0 and +1.0

◆ volumeDb()

virtual void Aviate::AudioEffectWrapper::volumeDb ( float  volDb)
virtual

Set the output volume in negative dB. Unity is 0.0, half volume would be -6.0 dB, etc.

Parameters
volDbvolume level in dB, must be -60.0 <= volDb <= 60.0

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