Aviate Audio Multiverse Library
|
Audio Effect base class. More...
#include <AudioEffectWrapper.h>
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... | |
SramManager * | getSramManager () |
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. | |
SramManager * | m_sramManagerPtr = nullptr |
If the effect uses external SRAM this will be populated. | |
ReportManager * | m_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. | |
Audio Effect base class.
|
virtual |
Bypass the effect.
byp | when true, bypass wil disable the effect, when false, effect is enabled. Note that audio still passes through when bypass is enabled. |
|
virtual |
Get the input peak level as a uint16_t.
|
pure virtual |
Name of the effect. This is normally implemented by automatically by the EffectCreator App.
|
virtual |
Get the output peak level as a uint16_t.
|
pure virtual |
Audio synchronization.
SramManager* Aviate::AudioEffectWrapper::getSramManager | ( | ) |
Returns a pointer to the SramManager.
|
pure virtual |
Converts a normalized [0,1.0] value to the user value/range from Effect Creator.
paramIndex | the index of the parameter for this effect |
normalizedParamValue | the normalized [0,1.0] ranged value |
|
virtual |
(OPTIONAL) controls an input scaling value applied to effects. This must be implemented by the effect to be utilized.
scaleFactor | a float value to be applied as a scaling fator |
|
virtual |
Get if the effect is bypassed.
bool Aviate::AudioEffectWrapper::isSramReady | ( | ) |
Checks to seeif the SRAM Manager is ready.
|
protected |
Convenience function for EFX developer. If you wish to apply input scaling, this function will use the value stored in m_inputScaleFactor.
block | pointer to an audio_block_t structure |
|
protected |
Process an audio_block_t and update the m_inputMaxPeak protected variable.
block | pointer to an audio_block_t structure |
|
protected |
Process an audio block as a raw int16_t array and update the m_inputMaxPeak protected variable.
audioData | pointer to an array of int16_t. It's size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t) |
|
protected |
Process an audio_block_t and update the m_outputMaxPeak protected variable.
block | pointer to an audio_block_t structure |
|
protected |
Process an audio block as a raw int16_t array and update the m_outputMaxPeak protected variable.
audioData | pointer to an array of int16_t. It's size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t) |
|
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)
audioData | pointer to an array of int16_t. It's size must be AUDIO_SAMPLES_PER_BLOCK*sizeof(int16_t) |
peak | peak value will be written to this variable |
|
pure virtual |
Configure an effect parameter to be controlled by a MIDI CC number on a particular channel.
parameter | one of the parameter names in the class enum |
midiCC | the CC number from 0 to 127 |
midiChannel | the effect will only response to the CC on this channel when OMNI mode is off. |
|
pure virtual |
process a MIDI Continous-Controller (CC) message
channel | the MIDI channel from 0 to 15) |
midiCC | the CC number from 0 to 127 |
value | the CC value from 0 to 127 |
void Aviate::AudioEffectWrapper::sendValueReport | ( | int | controlIndex, |
float | value | ||
) |
For MONITOR-only controls, you can report them to the host using sendValueReport().
controlIndex | this is the control enum value defined in your EFX public header |
value | the control value to send to the host |
|
virtual |
Sets whether MIDI OMNI channel is processig on or off. When on, all midi channels are used for matching CCs.
isOmni | when true, all channels are processed, when false, channel must match configured value. |
|
pure virtual |
Updates the effect with specified parameter index and value.
paramIndex | the index of the parameter for this effect |
paramValue | the new value for the effect |
|
virtual |
Set the output volume. This affect both the wet and dry signals.
The default is 1.0.
vol | Sets the output volume between -1.0 and +1.0 |
|
virtual |
Set the output volume in negative dB. Unity is 0.0, half volume would be -6.0 dB, etc.
volDb | volume level in dB, must be -60.0 <= volDb <= 60.0 |