Mix Multi-Channel Demo

Location

$CAFE_ROOT/system/src/demo/ax

Description

Demonstrates how to smoothly pan and crossfade audio between the channels of the TV and DRC outputs. Also demonstrates how to use the MIX library provided with the SDK to manipulate the voice mixes and how to use custom equations for the volumes. Particularly, it demonstrates:

Both stereo and multi-channel modes can be demonstrated. Use the Cafe menu to setup the audio output mode to be used. The demo will indicate which mode is used.

The following are required for this demo:

Five samples are included in ADPCM, PCM8, and PCM16 audio formats. Pure sine waves are also available and generated at runtime by the application.

This demo is interactive. Follow the on-screen instructions to explore the panning, crossfade, and playback controls.

NOTE:
The demo contains aux effect calls which have been updated to the new effects library. The original effects can be reinstated by remaking the demo as follows.
make AXFX_DEMO_OLD_EFFECTS=1

Console Output

After being invoked, the demo will display similar output to the following:

    Loading file axdemo/spdemo/spdemo.spt
    Loading file axdemo/spdemo/spdemo.spd
    SPInitSoundTable: loaded samples @ 0x10fe4000, samples_size=4421885
    Loading file axdemo/spdemo/spdemo_pcm8.spt
    Loading file axdemo/spdemo/spdemo_pcm8.spd
    SPInitSoundTable: loaded samples @ 0x1141c240, samples_size=7782373
    Loading file axdemo/spdemo/spdemo_pcm.spt
    Loading file axdemo/spdemo/spdemo_pcm.spd
    SPInitSoundTable: loaded samples @ 0x1141b940, samples_size=15476546

This is followed by instructions for the interactive controls:

    ********************************************************
    ********************************************************
    *               Multi-Channel demo                     *
    ********************************************************
    ********************************************************
    *    PAD Buttons are:                                  *
    *    Home        Quit Program                          *
    *    Rt/Lt       move parameter selection cursor       *
    *    Up/Dn       +/- selected parameter                *
    *    Stick Y     Vary selected numeric parameter       *
    *    A           Cycle through PCM8, PCM16, ADPCM tones*
    *    B           Start/Stop playing current tone       *
    *    X           Cycle through samples                 *
    *    Y           Cycle through SRC Types               *
    *    Zr          Toggle between DSP and PPC Renderer   *
    *    Stick x     Crossfade Tv <-> DRC                  *
    *    Substick Y  Multi-Channel Pan F <-> R             *
    *    Substick X  Pan L <-> R                           *
    ********************************************************
    ********************************************************

TV Output

The current parameter settings are displayed on the TV:

                mixmultichan.c built 14:34:07 Jan 23 2012
                
               Voice                                 Global
    Substick X Pan        64                         Audio Mode        Multi
    Substick Y SPan       64                         TV Volume         0    dBx10
       Stick X Crossfade  64                         DRC Volume        0    dBx10
           ... SRC Ratio >1.00                       AuxA Return       0    dBx10
             B Play       On                         AuxB Return       0    dBx10
             X Voice      STRAT                      AuxC Return       0    dBx10
           ... AuxA       Reverb                     Aux DRC Return    0    dBx10
           ... AuxB       Delay                         
           ... AuxC       (none)                         
             A Format     PCM16                         
             Y SRC Type   LINEAR                         
            Zr Render     PPC                         
               TV Send    0    dBx10                         
               DRC Send   0    dBx10                 Home       Quit
               AuxA Send  -960 dBx10                 Up/Dn      move cursor
               AuxB Send  -960 dBx10                 Left/Right Toggle Value
               AuxC Send  -960 dBx10                 Stick Y    Vary Value

The two left columns display per-voice parameters. The upper right column displays Global settings. The lower right describes the PAD navigation controls.

Navigating with the GamePad

Parameters

Pan Pans the sound between Left and Right, where 0 is full Left and 127 is full Right. The X-axis of the right-hand joystick can be used to control panning.
SPan Positions the sound between Front and Rear, where 0 is full Rear and 127 is full Front. The Y-axis of the right-hand joystick can be used to control span value.
Crossfade Controls crossfading between TV and the DRC, where 0 fades to the TV and 127 fades to the DRC. The X-axis of the left-hand joystick can be used to control crossfade. A simple custom equation is used for crossfade in the demo. Developers are free to use their own crossfade equations and/or tables.
SRC Ratio Playback pitch. Range is from 0.0 to 8.0.
Play Start or Stop playing the current sound. Pressing the B Button will also toggle this value.
Voice Selects which sound effect is played. Pressing the X Button will also cycle through the available sound effects..
AuxA Selects the effect for AUXA.
AuxB Selects the effect for AUXB.
AuxC Selects the effect for AUXC.
Format The audio format of the sound effect (PCM, ADPCM).
SRC Type The type of SRC filter to apply.
Render Selects the renderer (PPC or DSP) to use.
TV Send Attenuation level applied to the TV output.
DRC Send Attenuation level applied to the DRC output.
AuxA Send Attenuation level applied to the AUXA effects path. Applies to both the TV and DRC.
AuxB Send Attenuation level applied to the AUXB effects path. Applies to both the TV and DRC.
AuxC Send Attenuation level applied to the AUXC effects path. Applies to both the TV and DRC.

Global Parameters

Audio Mode Displays if the audio is played in stereo or multi-channel output mode.
TV Volume Final volume level to the TV output.
DRC Volume Final volume level to the DRC output.
AuxA Return Amount of effect assigned to AuxA that is mixed into the TV output.
AuxB Return Amount of effect assigned to AuxB that is mixed into the TV output.
AuxC Return Amount of effect assigned to AuxC that is mixed into the TV output.
Aux DRC Return Amount of effect assigned to AuxA that is mixed into the DRC output.

Files

$CAFE_ROOT/system/src/demo/ax/mixmultichan.c Demo source code.
$CAFE_ROOT/system/src/demo/ax/tone_data.c PCM16 data source code.
$CAFE_ROOT/system/src/demo/ax/tone_data.h PCM16 data header.
$CAFE_ROOT/data/disc/content/axdemo/spdemo/spdemo.spt Sound Pipeline table file.
$CAFE_ROOT/data/disc/content/axdemo/spdemo/spdemo.spd Sound Pipeline sample file.
$CAFE_ROOT/data/disc/content/axdemo/spdemo/spdemo_pcm8.spt Sound Pipeline table file.
$CAFE_ROOT/data/disc/content/axdemo/spdemo/spdemo_pcm8.spd Sound Pipeline sample file.
$CAFE_ROOT/data/disc/content/axdemo/spdemo/spdemo_pcm.spt Sound Pipeline table file.
$CAFE_ROOT/data/disc/content/axdemo/spdemo/spdemo_pcm.spd Sound Pipeline sample file.

See Also

AXAcquireVoice
AXSetVoiceState
MIXSetDeviceFader
MIXSetInput
MIXSetDevicePan
MIXSetDeviceSPan
MIXSetDeviceAux
MIXAssignChannel
MIXReleaseChannel

Revision History

2013/05/08 Automated cleanup pass.
2012/08/01 Cleanup Pass.
2012/01/26 Updated for SDK 2.02 Release


CONFIDENTIAL