Channel::setMixMatrix

FMOD Studio API

Firelight Technologies FMOD Studio API

Channel::setMixMatrix

Sets a 2D pan matrix that maps input channels (columns) to output speakers (rows).

C++ Syntax

FMOD_RESULT Channel::setMixMatrix(
  float *matrix,
  int outchannels,
  int inchannels,
  int matrixhop
);

C Syntax

FMOD_RESULT FMOD_Channel_SetMixMatrix(
  FMOD_CHANNEL *channel,
  float *matrix,
  int outchannels,
  int inchannels,
  int matrixhop
);

C# Syntax

RESULT Channel.setMixMatrix(
  float[] matrix,
  int outchannels,
  int inchannels,
  int inchannel_hop
);

JavaScript Syntax

Channel.setMixMatrix(
  matrix,                          
  outchannels,                     
  inchannels,                      
  inchannel_hop                    
);

Parameters

matrix
Address of a 2 dimensional array of volume levels in row-major order. Each row represents an output speaker, each column represents an input channel.
outchannels
Number of output channels (rows) in the matrix being passed in, from 0 to FMOD_MAX_CHANNEL_WIDTH inclusive.
inchannels
Number of input channels (columns) in the matrix being passed in, from 0 to FMOD_MAX_CHANNEL_WIDTH inclusive.
matrixhop
The width (total number of columns) of the matrix. Optional. If this is 0, inchannels will be taken as the width of the matrix. Maximum of FMOD_MAX_CHANNEL_WIDTH.

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

Remarks

The gain for input channel 's' to output channel 't' is matrix[t * matrixhop + s].

Levels can be below 0 to invert a signal and above 1 to amplify the signal. Note that increasing the signal level too far may cause audible distortion.

The matrix size will generally be the size of the number of channels in the current speaker mode. Use System::getSoftwareFormat to determine this.

If a matrix already exists then the matrix passed in will applied over the top of it. The input matrix can be smaller than the existing matrix.

A 'unit' matrix allows a signal to pass through unchanged. For example for a 5.1 matrix a unit matrix would look like this:

[ 1 0 0 0 0 0 ]
[ 0 1 0 0 0 0 ]
[ 0 0 1 0 0 0 ]
[ 0 0 0 1 0 0 ]
[ 0 0 0 0 1 0 ]
[ 0 0 0 0 0 1 ]

See Also




Version 1.10.03 Built on Feb 1, 2018