AXFX_MULTI_CH_DELAY

Syntax

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

typedef struct _AXFX_DELAY_LINE {
    AXFX_DELAY_TYPE type;
    s32             size;   // Buffer length in samples.  Must be 1 more than maximum delay size.
    f32             *buff;
    s32             delay;  // Delay sample size.  Maximum value must be size-1.
    s32             in;
    s32             out;
    f32             coef;   // Required for allpass
} AXFX_DELAY_LINE;

typedef struct _AXFX_MULTI_CH_DELAY {
    // User configurable parameters
    f32 delay_time;        // 0 to 2000.0
    f32 feedback;          // 0.1 to 1.0
    f32 low_pass_amount;   // 0.1 to 1.0
    f32 channel_spread;    // 0.1 to 1.0
    f32 out_gain;          // 0.1 to 1.0
    // DO NOT TOUCH THESE!
    // Derived parameters and objects
    AXFX_PS_DELAY_LINE psdelay[AXFX_MULTI_CH_MAX_CHANNELS/2]; // Paired singles operate on two f32's at a time
    f32 fb;
    f32 fb_direct;
    f32 fb_cross;
    f32 lpf_b0;
    f32 lpf_a1;
    f32x2 pslpf_z[AXFX_MULTI_CH_MAX_CHANNELS/2];
    f32 gain;
    // SET THESE UNDER SPECIFIC CONDITIONS (SEE BELOW).
    u32 fs;
    AXFX_DELAY_MODE mode;
    f32 max_delay;
} AXFX_MULTI_CH_DELAY;

Elements

delay_time Length of the delay line (= maximum delay time of input audio). Specify a value between 0.0 and 2000.0 (units of msec). The memory to be used for the delay line is allocated once during initialization which is the maximum (=2000.0) delay.
feedback Feedback gain. Specify a value as 0.1 <= value < 1.0.
low_pass_amount Tunes the cut-off frequency of the low-pass filter (LPF). Specify a value as 0.1 <= value <= 1.0. The smaller the value, the lower the cut-off frequency.
channel_spread Determines how much of the sample is distributed to neighboring channels. Specify a value as 0.1 <= value <= 1.0.
outGain Output gain. Specify a value as 0.1 <= value <= 1.0.
fs If AXFXMultiChDelayGetMemSize is called before AXFXMultiChDelayInit, this must be set to an integer value matching parameter sampleRate passed to AXFXMultiChDelayInit. For more information, see AXFXMultiChDelayGetMemSize. This value is an integer value which represents the sample frequency of the audio the effect operates on. Only a value of 32000 is supported.
mode If AXFXMultiChDelayGetMemSize is called before AXFXMultiChDelayInit, this must be set to parameter mode passed to AXFXMultiChDelayInit. For more information, see AXFXMultiChDelayGetMemSize. This value is an enumerated value which specifies the number of channels the effect operates on.
max_delay If AXFXMultiChDelayGetMemSize is called before AXFXMultiChDelayInit, this must be set to 2000.0. For more information, see AXFXMultiChDelayGetMemSize. This value represents the internal delay line buffer length. This is a float value and must be set to 2000.0.

Description

There are three classes of delay effects which apply the effect equally to 2, 4 or 6 channels. Each channel feeds back its output to it two neighboring channels, except for the subwoofer channel in the 6ch instance. The 6ch delay diagram:

Appropriate values must be assigned to the parameters of the AXFX_MULTI_CH_DELAY structure before calling AXFXMultiChDelayInit. The parameters affect each channel equally.

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
2ch0.42%0.63%
4ch0.79%1.18%
6ch1.16%1.85%

See Also

AXFXMultiChDelayOverview
AXFXMultiChDelayGetMemSize
AXFXMultiChDelayInit
AXFXMultiChDelayShutdown
AXFXMultiChDelaySettingsUpdate
AXFXMultiChDelaySettingsUpdateNoReset
AXFXMultiChDelayCallback
axfxmulticheffects demo
alleffects demo

Revision History

2014/03/11 CPU metrics
2014/02/26 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/22 Added delay effect diagram.
2012/05/10 Added 2/4/6 channel effects.
2012/04/10 Initial version.


CONFIDENTIAL