Firelight Technologies FMOD Studio API
FMOD_DSP_DESCRIPTION
When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.
C/C++ Syntax
typedef struct {
unsigned int pluginsdkversion;
char name[32];
unsigned int version;
int numinputbuffers;
int numoutputbuffers;
FMOD_DSP_CREATE_CALLBACK create;
FMOD_DSP_RELEASE_CALLBACK release;
FMOD_DSP_RESET_CALLBACK reset;
FMOD_DSP_READ_CALLBACK read;
FMOD_DSP_PROCESS_CALLBACK process;
FMOD_DSP_SETPOSITION_CALLBACK setposition;
int numparameters;
FMOD_DSP_PARAMETER_DESC **paramdesc;
FMOD_DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat;
FMOD_DSP_SETPARAM_INT_CALLBACK setparameterint;
FMOD_DSP_SETPARAM_BOOL_CALLBACK setparameterbool;
FMOD_DSP_SETPARAM_DATA_CALLBACK setparameterdata;
FMOD_DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat;
FMOD_DSP_GETPARAM_INT_CALLBACK getparameterint;
FMOD_DSP_GETPARAM_BOOL_CALLBACK getparameterbool;
FMOD_DSP_GETPARAM_DATA_CALLBACK getparameterdata;
FMOD_DSP_SHOULDIPROCESS_CALLBACK shouldiprocess;
void *userdata;
FMOD_DSP_SYSTEM_REGISTER_CALLBACK sys_register;
FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister;
FMOD_DSP_SYSTEM_MIX_CALLBACK sys_mix;
} FMOD_DSP_DESCRIPTION;
JavaScript Syntax
struct FMOD_DSP_DESCRIPTION
{
pluginsdkversion,
name,
version,
numinputbuffers,
numoutputbuffers,
create,
release,
reset,
read,
process,
setposition,
numparameters,
setparameterfloat,
setparameterint,
setparameterbool,
setparameterdata,
getparameterfloat,
getparameterint,
getparameterbool,
getparameterdata,
shouldiprocess,
userdata,
sys_register,
sys_deregister,
sys_mix,
};
Members
pluginsdkversion
[w] The plugin SDK version this plugin is built for. Set to this to FMOD_PLUGIN_SDK_VERSION defined above.
name
[w] The identifier of the DSP. This will also be used as the name of DSP and shouldn't change between versions.
version
[w] Plugin writer's version number.
numinputbuffers
[w] Number of input buffers to process. Use 0 for DSPs that only generate sound and 1 for effects that process incoming sound.
numoutputbuffers
[w] Number of audio output buffers. Only one output buffer is currently supported.
create
[w] Create callback. This is called when DSP unit is created. Can be null.
release
[w] Release callback. This is called just before the unit is freed so the user can do any cleanup needed for the unit. Can be null.
reset
[w] Reset callback. This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state. Use to avoid clicks or artifacts.
read
[w] Read callback. Processing is done here. Can be null.
process
[w] Process callback. Can be specified instead of the read callback if any channel format changes occur between input and output. This also replaces shouldiprocess and should return an error if the effect is to be bypassed. Can be null.
setposition
[w] Set position callback. This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source. Can be null.
numparameters
[w] Number of parameters used in this filter. The user finds this with DSP::getNumParameters
paramdesc
[w] Variable number of parameter structures.
setparameterfloat
[w] This is called when the user calls DSP::setParameterFloat. Can be null.
setparameterint
[w] This is called when the user calls DSP::setParameterInt. Can be null.
setparameterbool
[w] This is called when the user calls DSP::setParameterBool. Can be null.
setparameterdata
[w] This is called when the user calls DSP::setParameterData. Can be null.
getparameterfloat
[w] This is called when the user calls DSP::getParameterFloat. Can be null.
getparameterint
[w] This is called when the user calls DSP::getParameterInt. Can be null.
getparameterbool
[w] This is called when the user calls DSP::getParameterBool. Can be null.
getparameterdata
[w] This is called when the user calls DSP::getParameterData. Can be null.
shouldiprocess
[w] This is called before processing. You can detect if inputs are idle and return FMOD_OK to process, or any other error code to avoid processing the effect. Use a count down timer to allow effect tails to process before idling!
userdata
[w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation. Access via FMOD_DSP_STATE_FUNCTIONS::getuserdata.
sys_register
[w] Register callback. This is called when DSP unit is loaded/registered. Useful for 'global'/per system object init for plugin. Can be null.
sys_deregister
[w] Deregister callback. This is called when DSP unit is unloaded/deregistered. Useful as 'global'/per system object shutdown for plugin. Can be null.
sys_mix
[w] System mix stage callback. This is called when the mixer starts to execute or is just finishing executing. Useful for 'global'/per system object once a mix update calls for a plugin. Can be null.
Remarks
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
Members marked with [w] mean the variable can be written to. The user can set the value.
There are 2 different ways to change a parameter in this architecture.
One is to use DSP::setParameterFloat / DSP::setParameterInt / DSP::setParameterBool / DSP::setParameterData. This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.
The other is to use DSP::showConfigDialog. This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.
JavaScript only :
Not all fields are currently supported or may not work as expected at this time. To initialize an new instance in javascript use "FMOD.DSP_DESCRIPTION()", no 'new' keyword is required.
See Also
- System::createDSP
- DSP::setParameterFloat
- DSP::setParameterInt
- DSP::setParameterBool
- DSP::setParameterData
- FMOD_DSP_STATE
- FMOD_DSP_CREATE_CALLBACK
- FMOD_DSP_RELEASE_CALLBACK
- FMOD_DSP_RESET_CALLBACK
- FMOD_DSP_READ_CALLBACK
- FMOD_DSP_PROCESS_CALLBACK
- FMOD_DSP_SETPOSITION_CALLBACK
- FMOD_DSP_PARAMETER_DESC
- FMOD_DSP_SETPARAM_FLOAT_CALLBACK
- FMOD_DSP_SETPARAM_INT_CALLBACK
- FMOD_DSP_SETPARAM_BOOL_CALLBACK
- FMOD_DSP_SETPARAM_DATA_CALLBACK
- FMOD_DSP_GETPARAM_FLOAT_CALLBACK
- FMOD_DSP_GETPARAM_INT_CALLBACK
- FMOD_DSP_GETPARAM_BOOL_CALLBACK
- FMOD_DSP_GETPARAM_DATA_CALLBACK
- FMOD_DSP_SHOULDIPROCESS_CALLBACK
- FMOD_DSP_SYSTEM_REGISTER_CALLBACK
- FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK
- FMOD_DSP_SYSTEM_MIX_CALLBACK
Version 1.10.03 Built on Feb 1, 2018