FMOD Studio User Manual 2.02

24. Plug-in Reference

FMOD Studio and the Studio API support loading DSP plug-ins created using the FMOD Studio Plug-in SDK. Please see the FMOD Studio Plug-in SDK documentation for more information about authoring DSP plug-ins for FMOD.

24.1 Loading plug-ins

Plug-in libraries are automatically loaded from the following locations:

Changing the user plug-in directory, will cause all plug-ins to be reloaded. Warnings are added to the log for plug-ins that fail to load. This can be viewed from the Logging tab of the Console window.

24.2 Using plug-ins

Once a DSP plug-in is loaded, it can be used within the project. Plug-ins with zero input channels, often referred to as generators, can be added as plug-in instruments.

Add Plug-in Instrument

Plug-ins that process input signals can be added as plug-in effects.

Add Plug-in Effect

By default, the appearance of plug-ins in FMOD Studio is based on the FMOD_DSP_DESCRIPTION and attached FMOD_DSP_PARAMETER_DESC. This includes the plug-in's name, available properties, and deck layout.

It is possible to change the appearance of a plug-in using the plug-in scripting API.

24.3 Trial plug-ins

A trial plug-in is an effect that has been developed by a third party developer.

Trial plug-in effects can be auditioned in FMOD Studio, but .bank files that include trial plug-in effects cannot be loaded at runtime.

The files required to use these plug-in effects in your game must be purchased and loaded using the Studio API. Contact sales@fmod.com to find more information on how to purchase these third party plug-ins.

24.4 Plug-in Scripting API

To customize the appearance of a plug-in, the FMOD_DSP_DESCRIPTION can be augmented by adding a javascript file that sits alongside the plug-in library. This file must end in the .plugin.js extension. The javascript file can then make use of the plug-in scripting API, which can be used to register plug-in descriptions for one or more plug-ins using the studio.plugins.registerPluginDescription() function. For example:

studio.plugins.registerPluginDescription("Acme_Explosion", {
    companyName: "Acme",
    productName: "Explosion Generator",
    deckUi: {
        // deck widget layout
    },
});

By registering a plugin description, the appearance of a plug-in can be customized accordingly.

Plug-in script files are reloaded when plug-in libraries are reloaded, or when selecting "Scripts > Reload".

It is recommended that FMOD_DSP_DESCRIPTION.name and FMOD_DSP_PARAMETER_DESC.name fields are not changed after deployment of a plug-in library, as FMOD Studio uses these names as identifiers for the corresponding DSPs.

24.4.1 API functions

studio.plugins.registerPluginDescription(identifier, pluginDescription)

Registers a plug-in description. The identifier must match the FMOD_DSP_DESCRIPTION.name.

The pluginDescription argument is an object with attributes as described below. All attributes of the pluginDescription are optional.

pluginDescription.companyName

A string corresponding to the author of the plug-in. Plug-ins with the same company name are grouped in the same menu in context menus.

pluginDescription.productName

A string corresponding to the name of the plug-in.

pluginDescription.parameters

An Object which maps each FMOD_DSP_PARAMETER_DESC.name to a description Object. Each DSP parameter description Object contains the following optional attributes:

For example:

parameters: {
    "gain": {
        // FMOD_DSP_PARAMETER_DESC.name is "gain"
        displayName: "Volume"
    },
    "freq": {
        // FMOD_DSP_PARAMETER_DESC.name is "freq"
        displayName: "Frequency"
    },
    "outputMode": {
        // FMOD_DSP_PARAMETER_DESC.name is "outputMode"
        displayName: "Output",
        enumeration: ["Mono", "Stereo", "Surround"], // Mono = 0, Stereo = 1, Surround = 2
    },
    "pattern": {
        // FMOD_DSP_PARAMETER_DESC.name is "pattern"
        displayName: "Pattern",
        enumeration: ["Rain", "Hail", "Shine"], // Rain = 0, Hail = 1, Shine = 2
    },
},

pluginDescription.defaultConfigurations

An Array containing Objects which describe default configurations for the plug-in parameters. These can be accessed from the context menu of the plug-in in the deck.

defaultConfigurations: [
    {
        name:"Quiet",
        parameterValues: {
            "gain": -20,
        },
    },
    {
        name:"Bright",
        parameterValues: {
            "gain": 0,
            "freq": 5000,
        },
    },
],

pluginDescription.deckUi

An Object describing the user interface for the plug-in when displayed in the deck. For example:

deckUi: {
    deckWidgetType: studio.ui.deckWidgetType.Layout,
    layout: studio.ui.layoutType.VBoxLayout,
    spacing: 6,
    items: [
        { deckWidgetType: studio.ui.deckWidgetType.Pixmap, filePath: __dirname + "/company_logo.png", },
        { deckWidgetType: studio.ui.deckWidgetType.Button, binding: "invert", },
        { deckWidgetType: studio.ui.deckWidgetType.Dial, color: "#e31a1c", binding: "freq", },
        { deckWidgetType: studio.ui.deckWidgetType.Dropdown, binding: "mode", buttonWidth: 44, },
    ],
},

The layout of the deck panel is based on a deck widget description object, which contains the following attributes:

Applicable to deckWidgetType.Layout:

Applicable to items within a layoutType.HBoxLayout or layoutType.VBoxLayout:

Applicable to items within a layoutType.GridLayout:

Applicable to deckWidgetType.Label:

Applicable to deckWidgetType.Pixmap:

Applicable to deckWidgetType.Dial:

Applicable to deckWidgetType.Fader:

Applicable to deckWidgetType.MinMaxFader:

Applicable to deckWidgetType.NumberBox:

Applicable to deckWidgetType.Dropdown:

Applicable to deckWidgetType.Button:

Applicable to deckWidgetType.ButtonGroup:

Applicable to deckWidgetType.DataDrop:

Applicable to deckWidgetType.DistanceRolloffGraph:

    rolloffTypes: {
        -1: studio.project.distanceRolloffType.Custom,
        0: studio.project.distanceRolloffType.Linear,
        1: studio.project.distanceRolloffType.LinearSquared,
    },

Applicable to deckWidgetType.PolarDirectivityGraph:

studio.ui.deckWidgetType

An enum corresponding to different deck widget types available for a pluginDescription.deckUi widget. For bindable controls (e.g. dials, faders), properties with the appropriate FMOD_DSP_PARAMETER_TYPE should be selected. Possible values are:

studio.ui.dataDropMode

An enum corresponding to the different types of input methods available for a deckWidgetType.DataDrop widget. Possible values are:

24.5 Updating plug-ins

When working with custom DSP plug-ins, there may be times when migrating from an FMOD Designer project, migrating to a newer version of FMOD Studio, or the DSP's description gets updated which can cause DSPs to need repairing in the FMOD Studio project.

When an issue has been detected, the effect plug-in module or plug-in instrument is faded with a dashed yellow outline.

Effect plug-in issue detected

FMOD Studio supports repairing or removing DSP plug-in instances when a plug-in description changes or a plug-in DLL has been removed. This can be done by clicking on the deck widget of the corresponding plug-in instance. Plug-ins can be repaired or removed per instance or across an entire project.

Repairing a plug-in