#include <cafe.h>
#include <cafe/axfx.h>

typedef struct
    // User params
    f32 delay_time; //  0.1  to   7.0 ms
    f32 mod_depth;  //  0.1  to   1.0
    f32 mod_rate;   //  0.1  to  10.0 Hz
    f32 feedback;   // -1.0  to   1.0
    f32 feedforward;//  0.0  to   1.0
    f32 out_gain;   //  0.0  to   1.0
    f32 dry_gain;   //  0.0  to   1.0

s32  AXFX2FlangerGetMemSize            (AXFX_FLANGER_MODE mode, AXFX_SAMPLE_RATE sampleRate);
BOOL AXFX2FlangerInit                  (AXFX2_FLANGER *flanger, AXFX_FLANGER_MODE mode, AXFX_SAMPLE_RATE sampleRate);
void AXFX2FlangerShutdown              (AXFX2_FLANGER *flanger);
BOOL AXFX2FlangerSettingsUpdate        (AXFX2_FLANGER *flanger);
BOOL AXFX2FlangerSettingsUpdateNoReset (AXFX2_FLANGER *flanger);
void AXFX2FlangerCallback              (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_FLANGER *flanger, AXAUXCBSTRUCT *info);


delay_time Specify a float value in milliseconds as 0.1 <= value <= 7.0. The delay time parameter sets the average amount of delay for each delay line. The actual delay length will vary about this value according to the modulation depth.
mod_depth Specify a float value as 0.1 <= value < 1.0. The modulation depth parameter controls how much the delay time varies. When the modulation depth is high the number and location of notches or peaks will change dramatically.
mod_rate Specify a float value in Hertz as 0.1 <= value <= 10.0. The modulation rate controls how quickly the delay time changes. It does this by changing the frequency of the low-frequency oscillator. High modulation rates will lead to faster changes in the number and location of notches or peaks.
feedback Specify a float value as -1.0 <= value <= 1.0. The output of the delay line can be fed back and added to the delay line input. The feedback parameter controls the amount of feedback. As the amount of feedback increases the areas between the notches will become peaks. Negative feedback creates even sharper peaks.
feedforward Specify a float value as 0.0 <= value <= 1.0. The spectral effect caused by flanging relies on the delayed sound being mixed with (added to) the original undelayed sound. The feedforward parameter controls the amount of the undelayed sound that is mixed with the delayed. The overall mixing architecture may be set up such that a non-delayed (dry) sound is already being mixed in. In this case the flanger may sound better if the feedforward value is reduced.
out_gain Specify a value as 0.0 <= value <= 1.0. Out gain controls the output level of the processed sound. When this is set to 0.0 no flanger effect will be heard, while at high values the effect will be prominent.
dry_gain Specify a value as 0.0 <= value <= 1.0. Dry gain controls the level of the input signal that is added to the processed output.


There are three flanger effects that operate on 2, 4, and 6 channels. Appropriate values must be assigned to the parameters of the AXFX2_FLANGER structure function before the call to AXFX2FlangerInit.


Library Version Availability
Sound 2.0 Yes
Sound 1.0 No


The following table lists the CPU utilization given the specified mode and channel settings. The Sound 2 Library Interactive Effects demo displays real time CPU usage metrics from which this data is derived.


See Also

AXFX2 Flanger Overview
alleffects demo

Revision History

2014/03/11 CPU metrics
2013/08/26 Initial version.