AXFX_MULTI_CH_CHORUS

Syntax

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


typedef enum _AXFX_CHORUS_MODE
{
    AXFX_CHORUS_MODE_2CH,       // Original chorus effects
    AXFX_CHORUS_MODE_4CH,
    AXFX_CHORUS_MODE_6CH,
    AXFX_CHORUS_MODE_2CH_2,     // Version 2 optimized chorus effects
    AXFX_CHORUS_MODE_4CH_2,
    AXFX_CHORUS_MODE_6CH_2,
} AXFX_CHORUS_MODE;

typedef struct AXFX_MULTI_CH_CHORUS
{
    // don't touch these
    u32 fs;
    AXFX_6CH_CHORUS_DELAY  delay;
    AXFX_6CH_CHORUS_LFO    lfo;
    f32        history[AXFX_MULTI_CH_MAX_CHANNELS][AXFX_CHORUS_HIST_SIZE];
    u32        histIndex;
    u32        active;
    // Set this under specific conditions (see below).
    AXFX_CHORUS_MODE mode;
    // user params          // Original Chorus      Chorus_2
                            // -----------------    ------------------------
    f32        delayTime;   // 0.1 - 50.0 (msec)    same as original version
    f32        depth;       // 0.1 -  1.0           0.1 - 1.0
    f32        rate;        // 0.1 -  2.0 (Hz)      same as original version
    f32        feedback;    // 0.0 - <1.0           0.1 - 1.0
    AXFX_6CH_BUFFERUPDATE  *busIn;  //              same as original version
    AXFX_6CH_BUFFERUPDATE  *busOut; //              same as original version
    f32        outGain;     // 0.0 - 1.0            same as original version
    f32        sendGain;    // 0.0 - 1.0            unused
} AXFX_MULTI_CH_CHORUS;

Elements

delayTime Length of the delay line (=standard delay time of input audio). Specify a value as 0.1 <= value <= 50.0 (in msec).
depth Range over which the output position from the delay line (=delay time) is varied in time by the LFO. Specified as a proportion of delayTime; the value is in the range of 0.0 <= value <= 1.0. For version two, 0.1 <= value <= 1.0.
rate Frequency of LFO. Specify a value as 0.1 <= value <= 2.0 (in Hertz).
feedback Feedback gain. Specify a value as 0.0 <= value < 1.0. This is mainly used to heighten the flanging effect when chorus is used as a flanger. (It produces the powerful swell of sound called "jet plane" sound.) It is also possible to use this as a characteristic delay effect by setting a somewhat longer delay time. For version two, 0.1 <= value <= 1.0..
busIn Specifies the input buffer for effect bus sends. When not used, this should be set to NULL.
busOut Specifies the output buffer for effect bus sends. When not used, this should be set to NULL.
outGain Output gain. Specify a value as 0.0 <= value <= 1.0.
sendGain Send gain to the next-level effect bus. Specify a value as 0.0 <= value <= 1.0.
mode This must be set prior to calling AXFXMultiChChorusGetMemSize if this call is made before AXFXMultiChChorusInit and must match AXFXMultiChChorusInit's mode parameter. For more information, see AXFXMultiChChorusGetMemSize. This value is an enumerated value which specifies the number of channels the effect operates on.

Description

There are two main classes of chorus effects which use the original algorithm or optimized algorithm. For each of the two classes, there are three types of chorus effects which process 2, 4, or 6 individual channels. When using this chorus effect, assign appropriate values to the various parameters of the AXFX_MULTI_CH_CHORUS structure before initializing with AXFXMultiChChorusInit.

Memory Requirements

Allocators registered with AXFXGetHooks must return memory aligned on an f32x2 (eight byte) boundary.

Performance

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.

mode32k48k
2ch 0.71%1.08%
4ch 1.26%1.90%
6ch 1.83%2.75%
2ch_20.71%1.06%
4ch_21.10%1.65%
6ch_21.55%2.32%

See Also

AXFXMultiChChorusOverview
AXFXMultiChChorusGetMemSize
AXFXMultiChChorusInit
AXFXMultiChChorusShutdown
AXFXMultiChChorusSettings
AXFXMultiChChorusSettingsUpdate
AXFXMultiChChorusSettingsUpdateNoReset
AXFXMultiChChorusCallback
axfxmulticheffects demo
alleffects demo

Revision History

2014/03/11 CPU metrics
2014/02/26 Add related link.
2014/02/25 Add related link
2013/05/08 Automated cleanup pass.
2013/03/04 New no-reset API.
2012/08/01 Cleanup Pass
2012/05/25 Simplified API.
2012/05/10 Added 2/4/6 channel effects.
2012/04/10 Initial version.


CONFIDENTIAL