Skip to content

dsp_connection

Francisco Dias edited this page Nov 22, 2024 · 4 revisions

DSP Connection

FMOD Object: DSPConnection


This module holds the functionality related to Digital Signal Processor (DSP) Connections.

See the DSP Architecture Guide for more information.

Functions

This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.



Back To Top

fmod_dsp_connection_set_mix

FMOD Function: DSPConnection::setMix


This function sets the connection's volume scale.


Syntax:

fmod_dsp_connection_set_mix(dsp_connection_ref, volume)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.
volume Real The volume scale applied to the input before being passed to the output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.



Returns:

N/A




Back To Top

fmod_dsp_connection_get_mix

FMOD Function: DSPConnection::getMix


This function retrieves the connection's volume scale.

The function returns the volume scale applied to the input before being passed to the output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.


Syntax:

fmod_dsp_connection_get_mix(dsp_connection_ref)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.



Returns:

Real




Back To Top

fmod_dsp_connection_set_mix_matrix

FMOD Function: DSPConnection::setMixMatrix


This function sets a 2 dimensional pan matrix that maps the signal from input channels (columns) to output speakers (rows).

A matrix element is referenced from the incoming matrix data as out_channel * in_channel_hop + in_channel.

If 0 or equivalent is passed in via matrix a default upmix, downmix, or unit matrix will take its place. A unit matrix allows a signal to pass through unchanged.

Example 5.1 unit matrix:

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

Note

Matrix element values 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.


Syntax:

fmod_dsp_connection_set_mix_matrix(dsp_connection_ref, matrix, out_channels, in_channels, in_channel_hop)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.
matrix Array of Real A two-dimensional array of volume levels in row-major order. Each row represents an output speaker, each column represents an input channel. 0 or equivalent sets a 'default' matrix.
out_channels Real The number of output channels (rows) in matrix. A value in the range [0, FMOD_MAX_CHANNEL_WIDTH];
in_channels Real The number of input channels (columns) in matrix. A value in the range [0, FMOD_MAX_CHANNEL_WIDTH];
in_channel_hop Real OPTIONAL The width (total number of columns) of source matrix. Can be larger than in_channels to represent a smaller valid region inside a larger matrix. A value in the range [0, FMOD_MAX_CHANNEL_WIDTH]. Defaults to in_channels.



Returns:

N/A




Back To Top

fmod_dsp_connection_get_mix_matrix

FMOD Function: DSPConnection::getMixMatrix


This function retrieves a 2 dimensional pan matrix that maps the signal from input channels (columns) to output speakers (rows).

A matrix element is referenced from the incoming matrix data as out_channel * in_channel_hop + in_channel.


Syntax:

fmod_dsp_connection_get_mix_matrix(dsp_connection_ref, in_channel_hop)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.
in_channel_hop Real The width (total number of columns) of the destination matrix. Can be larger than in_channels to represent a smaller valid region inside a larger matrix.



Returns:

FmodDSPConnectionMixMatrix




Back To Top

fmod_dsp_connection_get_input

FMOD Function: DSPConnection::getInput


This function retrieves the connection's input DSP unit.

If fmod_dsp_add_input was just called, the connection might not be ready because the DSP system is still queued to be connected, and may need to wait several milliseconds for the next mix to occur. If so fmod_last_result will return FMOD_RESULT.ERR_NOTREADY and the value 0 will be returned.


Syntax:

fmod_dsp_connection_get_input(dsp_connection_ref)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.



Returns:

Real




Back To Top

fmod_dsp_connection_get_output

FMOD Function: DSPConnection::getOutput


This function retrieves the connection's output DSP unit.

If fmod_dsp_add_input was just called, the connection might not be ready because the DSP system is still queued to be connected, and may need to wait several milliseconds for the next mix to occur. If so the function will return FMOD_RESULT.ERR_NOTREADY and the value 0 will be returned.


Syntax:

fmod_dsp_connection_get_output(dsp_connection_ref)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.



Returns:

Real




Back To Top

fmod_dsp_connection_get_type

FMOD Function: DSPConnection::getType


This function retrieves the type of DSP connection between 2 DSP units.


Syntax:

fmod_dsp_connection_get_type(dsp_connection_ref)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.



Returns:

FMOD_DSPCONNECTION_TYPE




Back To Top

fmod_dsp_connection_set_user_data

FMOD Function: DSPConnection::setUserData


This function sets a floating-point user value associated with this object.

Note

While FMOD supports arbitrary User Data, this function only allows you to set a real value (a double-precision floating-point value).


Syntax:

fmod_dsp_connection_set_user_data(dsp_connection_ref, data)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.
data Real The floating-point value to set.



Returns:

N/A




Back To Top

fmod_dsp_connection_get_user_data

FMOD Function: DSPConnection::getUserData


This function retrieves the floating-point user value associated with this object, as set by an earlier call to fmod_dsp_connection_set_user_data.

Note

While FMOD supports arbitrary User Data, this function only allows you to get a real value (a double-precision floating-point value).


Syntax:

fmod_dsp_connection_get_user_data(dsp_connection_ref)
Argument Type Description
dsp_connection_ref Real A reference to a DSPConnection.



Returns:

Real