FMOD API User Manual 2.00
The Digital Signal Processor is one node within a graph that transforms input audio signals to an output stream.
Create with System::createDSP, System::createDSPByType or System::createDSPByPlugin.
Connections:
Parameters:
Channel format:
Metering:
Processing:
General:
Adds a DSP unit as an input to this object.
FMOD_RESULT DSP::addInput(
DSP *input,
DSPConnection **connection = nullptr,
FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD
);
Type of connection between the two units. (FMOD_DSPCONNECTION_TYPE)
When a DSP has multiple inputs the signals are automatically mixed together, sent to the unit's output(s).
The returned connection will remain valid until the units are disconnected.
See Also: DSP::getInput, DSP::getNumInputs, DSP::getOutput, DSP::getNumOutputs
Disconnects all inputs and/or outputs.
FMOD_RESULT DSP::disconnectAll(
bool inputs,
bool outputs
);
Whether all inputs should be disconnected.
Whether all outputs should be disconnected.
This is a convenience function that is faster than disconnecting all inputs and outputs individually.
See Also: DSP::disconnectFrom
Disconnect the specified input DSP.
FMOD_RESULT DSP::disconnectFrom(
DSP *target,
DSPConnection *connection = nullptr
);
If target had only one output, after this operation that entire sub graph will no longer be connected to the DSP network.
After this operation connection is no longer valid.
See Also: DSP::addInput, DSP::disconnectAll
Retrieves the processing active state.
FMOD_RESULT DSP::getActive(
bool *active
);
Active state.
If active is False, processing of this unit and its inputs are stopped.
When created a DSP is inactive. If ChannelControl::addDSP is used it will automatically be activated, otherwise it must be set to active manually.
See Also: DSP::setActive, DSP::setBypass
Retrieves the processing bypass state.
FMOD_RESULT DSP::getBypass(
bool *bypass
);
Bypass state.
If bypass is true, processing of this unit is skipped but it continues to process its inputs.
See Also: DSP::setBypass, DSP::setActive
Retrieves the PCM input format this DSP will receive when processing.
FMOD_RESULT DSP::getChannelFormat(
FMOD_CHANNELMASK *channelmask,
int *numchannels,
FMOD_SPEAKERMODE *source_speakermode
);
See Also: DSP::setChannelFormat
Retrieves statistics on the mixer thread CPU usage for this unit.
FMOD_RESULT DSP::getCPUUsage(
unsigned int *exclusive,
unsigned int *inclusive
);
CPU time spent processing just this unit during the last mixer update.
CPU time spent processing this unit and all of its input during the last mixer update.
FMOD_INIT_PROFILE_ENABLE with System::init is required to call this function.
Retrieve the index of the first data parameter of a particular data type.
FMOD_RESULT DSP::getDataParameterIndex(
int datatype,
int *index
);
datatype after the function is called. Will be -1 if no matches were found.This function returns FMOD_OK if a parmeter of matching type is found and FMOD_ERR_INVALID_PARAM if no matches were found.
The return code can be used to check whether the DSP supports specific functionality through data parameters of certain types without the need to provide index.
Retrieves the idle state.
FMOD_RESULT DSP::getIdle(
bool *idle
);
Idle state.
A DSP is considered idle when it stops receiving input signal and all internal processing of stored input has been exhausted.
Each DSP type has the potential to have differing idle behaviour based on the type of effect. A reverb or echo may take a longer time to go idle after it stops receiving a valid signal, compared to an effect with a shorter tail length like an EQ filter.
Retrieves information about this DSP unit.
FMOD_RESULT DSP::getInfo(
char *name,
unsigned int *version,
int *channels,
int *configwidth,
int *configheight
);
See Also: DSP::showConfigDialog
Retrieves the DSP unit at the specified index in the input list.
FMOD_RESULT DSP::getInput(
int index,
DSP **input,
DSPConnection **inputconnection
);
Offset into this DSP's input list.
index. (DSP)input. (DSPConnection)This will flush the DSP queue (which blocks against the mixer) to ensure the input list is correct, avoid this during time sensitive operations.
The returned connection will remain valid until the units are disconnected.
See Also: DSP::addInput, DSP::getOutput
Retrieves the input and output signal metering enabled states.
FMOD_RESULT DSP::getMeteringEnabled(
bool *inputEnabled,
bool *outputEnabled
);
Metering enabled state for the input signal.
Metering enabled state for the output signal.
Input metering is pre processing, while output metering is post processing.
Enabled metering allows DSP::getMeteringInfo to return metering information and allows FMOD profiling tools to visualize the levels.
FMOD_INIT_PROFILE_METER_ALL with System::init will automatically turn on metering for all DSP units inside the mixer graph.
See Also: DSP::setMeteringEnabled
Retrieve the signal metering information.
FMOD_RESULT DSP::getMeteringInfo(
FMOD_DSP_METERING_INFO *inputInfo,
FMOD_DSP_METERING_INFO *outputInfo
);
Requesting metering information when it hasn't been enabled will result in FMOD_ERR_BADCOMMAND.
FMOD_INIT_PROFILE_METER_ALL with System::init will automatically enable metering for all DSP units.
See Also: DSP::setMeteringEnabled, DSP::getMeteringEnabled
Retrieves the number of DSP units in the input list.
FMOD_RESULT DSP::getNumInputs(
int *numinputs
);
This will flush the DSP queue (which blocks against the mixer) to ensure the input list is correct, avoid this during time sensitive operations.
See Also: DSP::getNumOutputs, DSP::getInput
Retrieves the number of DSP units in the output list.
FMOD_RESULT DSP::getNumOutputs(
int *numoutputs
);
This will flush the DSP queue (which blocks against the mixer) to ensure the output list is correct, avoid this during time sensitive operations.
See Also: DSP::getNumInputs, DSP::getOutput
Retrieves the number of parameters exposed by this unit.
FMOD_RESULT DSP::getNumParameters(
int *numparams
);
Use this to enumerate all parameters of a DSP unit with DSP::getParameterInfo.
See Also: DSP::setParameterFloat, DSP::setParameterInt, DSP::setParameterBool, DSP::setParameterData
Retrieves the DSP unit at the specified index in the output list.
FMOD_RESULT DSP::getOutput(
int index,
DSP **output,
DSPConnection **outputconnection
);
Offset into this DSP's output list.
index. (DSP)output. (DSPConnection)This will flush the DSP queue (which blocks against the mixer) to ensure the output list is correct, avoid this during time sensitive operations.
The returned connection will remain valid until the units are disconnected.
See Also: DSP::addInput, DSP::getInput
Retrieves the output format this DSP will produce when processing based on the input specified.
FMOD_RESULT DSP::getOutputChannelFormat(
FMOD_CHANNELMASK inmask,
int inchannels,
FMOD_SPEAKERMODE inspeakermode,
FMOD_CHANNELMASK *outmask,
int *outchannels,
FMOD_SPEAKERMODE *outspeakermode
);
See Also: DSP::setChannelFormat, DSP::getChannelFormat
Retrieves a boolean parameter by index.
FMOD_RESULT DSP::getParameterBool(
int index,
bool *value,
char *valuestr,
int valuestrlen
);
Parameter index.
Parameter boolean data.
value. (UTF-8 string)Length of valuestr.
See Also: DSP::setParameterBool, DSP::getParameterInfo
Retrieves a binary data parameter by index.
FMOD_RESULT DSP::getParameterData(
int index,
void **data,
unsigned int *length,
char *valuestr,
int valuestrlen
);
Parameter index.
Length of data.
data. (UTF-8 string)Length of valuestr.
See Also: DSP::setParameterData, DSP::getParameterInfo
Retrieves a floating point parameter by index.
FMOD_RESULT DSP::getParameterFloat(
int index,
float *value,
char *valuestr,
int valuestrlen
);
Parameter index.
value. (UTF-8 string)Length of valuestr.
See Also: DSP::setParameterFloat, DSP::getParameterInfo
Retrieve information about a specified parameter.
FMOD_RESULT DSP::getParameterInfo(
int index,
FMOD_DSP_PARAMETER_DESC **desc
);
Parameter index.
index. (FMOD_DSP_PARAMETER_DESC)See Also: DSP::setParameterFloat, DSP::setParameterInt, DSP::setParameterBool, DSP::setParameterData
Retrieves an integer parameter by index.
FMOD_RESULT DSP::getParameterInt(
int index,
int *value,
char *valuestr,
int valuestrlen
);
Parameter index.
value. (UTF-8 string)Length of valuestr.
See Also: DSP::setParameterInt, DSP::getParameterInfo
Retrieves the parent System object.
FMOD_RESULT DSP::getSystemObject(
System **system
);
See Also: System::createDSP, System::createDSPByType
Retrieves the pre-defined type of a FMOD registered DSP unit.
FMOD_RESULT DSP::getType(
FMOD_DSP_TYPE *type
);
This is only valid for built in FMOD effects. Any user plugins will simply return FMOD_DSP_TYPE_UNKNOWN.
Retrieves a user value associated with this object.
FMOD_RESULT DSP::getUserData(
void **userdata
);
See Also: DSP::setUserData
Retrieves the scale of the wet and dry signal components.
FMOD_RESULT DSP::getWetDryMix(
float *prewet,
float *postwet,
float *dry
);
Level of the 'Dry' (pre-processed signal) mix that is processed by the DSP. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Level of the 'Wet' (post-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Level of the 'Dry' (pre-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
See Also: DSP::setWetDryMix
Frees a DSP object.
FMOD_RESULT DSP::release();
If DSP is not removed from the network with ChannelControl::removeDSP after being added with ChannelControl::addDSP, it will not release and will instead return FMOD_ERR_DSP_INUSE.
See Also: System::createDSP
Reset a DSPs internal state ready for new input signal.
FMOD_RESULT DSP::reset();
This will clear all internal state derived from input signal while retaining any set parameter values. The intended use of the function is to avoid audible artifacts if moving the DSP from one part of the DSP network to another.
Sets the processing active state.
FMOD_RESULT DSP::setActive(
bool active
);
Active state.
If active is false, processing of this unit and its inputs are stopped.
When created a DSP is inactive. If ChannelControl::addDSP is used it will automatically be activated, otherwise it must be set to active manually.
See Also: DSP::getActive, DSP::setBypass, DSP::getBypass
Sets the processing bypass state.
FMOD_RESULT DSP::setBypass(
bool bypass
);
Bypass state.
If bypass is true, processing of this unit is skipped but it continues to process its inputs.
See Also: DSP::getBypass, DSP::setActive, DSP::getActive
Sets the PCM input format this DSP will receive when processing.
FMOD_RESULT DSP::setChannelFormat(
FMOD_CHANNELMASK channelmask,
int numchannels,
FMOD_SPEAKERMODE source_speakermode
);
Number of channels to be processed.
Setting the number of channels on a unit will force either a down or up mix to that channel count before processing the DSP read/process callback.
See Also: DSP::getChannelFormat
Sets the input and output signal metering enabled states.
FMOD_RESULT DSP::setMeteringEnabled(
bool inputEnabled,
bool outputEnabled
);
Metering enabled state for the input signal.
Metering enabled state for the output signal.
Input metering is pre processing, while output metering is post processing.
Enabled metering allows DSP::getMeteringInfo to return metering information and allows FMOD profiling tools to visualize the levels.
FMOD_INIT_PROFILE_METER_ALL with System::init will automatically turn on metering for all DSP units inside the mixer graph.
See Also: DSP::getMeteringEnabled
Sets a boolean parameter by index.
FMOD_RESULT DSP::setParameterBool(
int index,
bool value
);
Parameter index.
Parameter value.
See Also: DSP::getParameterInfo, DSP::getParameterBool
Sets a binary data parameter by index.
FMOD_RESULT DSP::setParameterData(
int index,
void *data,
unsigned int length
);
Parameter index.
Length of data.
Certain data types are predefined by the system and can be specified via the FMOD_DSP_PARAMETER_DESC_DATA, see FMOD_DSP_PARAMETER_DATA_TYPE
See Also: DSP::getParameterInfo, DSP::getParameterData
Sets a floating point parameter by index.
FMOD_RESULT DSP::setParameterFloat(
int index,
float value
);
Parameter index.
See Also: DSP::getParameterInfo, DSP::getParameterFloat
Sets an integer parameter by index.
FMOD_RESULT DSP::setParameterInt(
int index,
int value
);
Parameter index.
See Also: DSP::getParameterInfo, DSP::getParameterInt
Sets a user value associated with this object.
FMOD_RESULT DSP::setUserData(
void *userdata
);
Associates some data with this object to give it context, it will be passed back via callbacks but otherwise remain untouched.
See Also: DSP::getUserData
Sets the scale of the wet and dry signal components.
FMOD_RESULT DSP::setWetDryMix(
float prewet,
float postwet,
float dry
);
Level of the 'Dry' (pre-processed signal) mix that is processed by the DSP. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Level of the 'Wet' (post-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Level of the 'Dry' (pre-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
The dry signal path is silent by default, because dsp effects transform the input and pass the newly processed result to the output.
See Also: DSP::getWetDryMix
Display or hide a DSP unit configuration dialog box inside the target window.
FMOD_RESULT DSP::showConfigDialog(
void *hwnd,
bool show
);
Whether to show or hide the dialog box inside target hwnd.
Dialog boxes are used by DSP plugins that prefer to use a graphical user interface to modify their parameters rather than using the other method of enumerating the parameters and using DSP::setParameterFloat / DSP::setParameterInt / DSP::setParameterBool / DSP::setParameterData.
These are usually VST plugins. FMOD Studio plugins do not have configuration dialog boxes. To find out what size window to create to store the configuration screen, use DSP::getInfo where you can get the width and height.