SuperpoweredSDK  v2.0.2
Superpowered Audio SDK
Superpowered::Echo Class Reference

Simple echo ("delay effect"). More...

#include "SuperpoweredEcho.h"

Inheritance diagram for Superpowered::Echo:
Collaboration diagram for Superpowered::Echo:

Public Member Functions

 Echo (unsigned int samplerate, unsigned int maximumSamplerate=96000)
 Constructor. More...
 
 ~Echo ()
 
bool process (float *input, float *output, unsigned int numberOfFrames)
 Processes the audio. More...
 
bool process (float *input, float *output, unsigned int numberOfFrames, FX *fx)
 Processes the audio. More...
 
void setMix (float mix)
 Sets dry and wet simultaneously with a good balance between them. More...
 

Public Attributes

float beats
 Delay in beats. 0.03125 to 2. More...
 
float bpm
 40 to 250 More...
 
float decay
 0 to 0.99 More...
 
float dry
 0 to 1 More...
 
bool enabled = false
 Turns the effect on/off. The actual switch will happen on the next process() call for smooth, audio-artifact free operation. More...
 
unsigned int samplerate = 0
 Sample rate in Hz. More...
 
float wet
 0 to 1 More...
 

Private Member Functions

 Echo (const Echo &)
 
Echooperator= (const Echo &)
 

Private Attributes

echoInternals * internals
 

Detailed Description

Simple echo ("delay effect").

One instance allocates around 770 kb memory.

Constructor & Destructor Documentation

◆ Echo() [1/2]

Superpowered::Echo::Echo ( unsigned int  samplerate,
unsigned int  maximumSamplerate = 96000 
)

Constructor.

Enabled is false by default.

Parameters
samplerateThe initial sample rate in Hz.
maximumSamplerateMaximum sample rate (affects memory usage, the lower the smaller).

◆ ~Echo()

Superpowered::Echo::~Echo ( )

◆ Echo() [2/2]

Superpowered::Echo::Echo ( const Echo )
private

Member Function Documentation

◆ operator=()

Echo& Superpowered::Echo::operator= ( const Echo )
private

◆ process() [1/2]

bool Superpowered::Echo::process ( float *  input,
float *  output,
unsigned int  numberOfFrames 
)
virtual

Processes the audio.

Always call it in the audio processing callback, regardless if the effect is enabled or not for smooth, audio-artifact free operation. It's never blocking for real-time usage. You can change all properties and call setMix() on any thread, concurrently with process().

Returns
If process() returns with true, the contents of output are replaced with the audio output. If process() returns with false, it indicates silence. The contents of output are not changed in this case (not overwritten with zeros).
Parameters
inputPointer to floating point numbers. 32-bit interleaved stereo input. Can point to the same location with output (in-place processing). Special case: input can be NULL, the effect will output the tail only in this case.
outputPointer to floating point numbers. 32-bit interleaved stereo output.
numberOfFramesNumber of frames to process. Recommendation for best performance: multiply of 4, minimum 64.

Implements Superpowered::FX.

◆ process() [2/2]

bool Superpowered::Echo::process ( float *  input,
float *  output,
unsigned int  numberOfFrames,
FX fx 
)

Processes the audio.

Always call it in the audio processing callback, regardless if the effect is enabled or not for smooth, audio-artifact free operation. It's never blocking for real-time usage. You can change all properties and call setMix() on any thread, concurrently with process().

Returns
If process() returns with true, the contents of output are replaced with the audio output. If process() returns with false, the contents of output are not changed.
Parameters
inputPointer to floating point numbers. 32-bit interleaved stereo input. Can point to the same location with output (in-place processing). Special case: input can be NULL, the effect will output the tail only in this case.
outputPointer to floating point numbers. 32-bit interleaved stereo output.
numberOfFramesNumber of frames to process. Recommendation for best performance: multiply of 4, minimum 64.
fxfx->process() will be used to pass audio from input to the internal buffer. For example, a resonant Filter can provide a nice color for the echoes.

◆ setMix()

void Superpowered::Echo::setMix ( float  mix)

Sets dry and wet simultaneously with a good balance between them.

Wet always equals to mix, but dry changes with a curve.

Parameters
mix>= 0 and <= 1.

Member Data Documentation

◆ beats

float Superpowered::Echo::beats

Delay in beats. 0.03125 to 2.

◆ bpm

float Superpowered::Echo::bpm

40 to 250

◆ decay

float Superpowered::Echo::decay

0 to 0.99

◆ dry

float Superpowered::Echo::dry

0 to 1

◆ enabled

bool Superpowered::FX::enabled = false
inherited

Turns the effect on/off. The actual switch will happen on the next process() call for smooth, audio-artifact free operation.

◆ internals

echoInternals* Superpowered::Echo::internals
private

◆ samplerate

unsigned int Superpowered::FX::samplerate = 0
inherited

Sample rate in Hz.

◆ wet

float Superpowered::Echo::wet

0 to 1


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