Main Content

generateAudioPlugin

Generate audio plugin from MATLAB class

Description

example

generateAudioPlugin className generates a VST 2 audio plugin from a MATLAB® class specified by className. See Supported Compilers for a list of compilers supported by generateAudioPlugin.

example

generateAudioPlugin options className specifies a nondefault plugin type, output folder, file name, or file type. You can use the -juceproject option to create a zip file containing generated C/C++ code and a JUCER project. Options can be specified in any grouping, and in any order.

example

generateAudioPlugin with no input arguments opens a user interface (UI) to generate and validate an audio plugin. The UI provides functionality equivalent to the command-line interfaces of generateAudioPlugin, audioPluginConfig, and validateAudioPlugin.

  • The Audio plugin class name corresponds to the className input argument.

  • The Validation options section corresponds to the options argument of validateAudioPlugin.

  • The Generation options section corresponds to the options argument of generateAudioPlugin.

  • The Coder configuration section corresponds to the Properties of audioPluginConfig.

Examples

collapse all

generateAudioPlugin audiopluginexample.Echo
.......

A VST 2 plugin with file name Echo is saved to your current folder. The extension of your plugin depends on your operating system.

mkdir(fullfile(pwd,'myPluginFolder'))
generateAudioPlugin -outdir myPluginFolder audiopluginexample.Echo
.......

A VST 2 plugin with file name Echo is saved to your specified folder, myPluginFolder. The extension of your plugin depends on your operating system.

generateAudioPlugin -output awesomeEffect audiopluginexample.Echo
.......

A VST 2 plugin with file name awesomeEffect is saved to your current folder. The extension of your plugin depends on your operating system.

mkdir(fullfile(pwd,'myPluginFolder'))
generateAudioPlugin -output coolEffect -outdir myPluginFolder audiopluginexample.Echo
.......

A VST 2 plugin with file name coolEffect is saved to your specified folder, myPluginFolder. The extension of your plugin depends on your operating system.

generateAudioPlugin -win32 audiopluginexample.Echo
.......

A 32-bit VST 2 plugin with file name Echo.dll is saved to your current folder.

generateAudioPlugin -juceproject audiopluginexample.Echo

A zip file containing generated C/C++ code and a JUCER project file suitable for use with JUCE 5.3.2 to 6.0.8 is saved to your current folder.

To generate a binary standalone executable, use the -exe option. The following command saves Echo.exe to your current folder.

generateAudioPlugin -exe audiopluginexample.Echo
.......

When you execute the generated code, the UI you defined in your audio plugin opens.

eval('!Echo.exe')

The standalone executable enables you to:

  • Configure audio input and output from the plugin. Synchronizing parameters with MIDI devices is not currently supported.

  • Save and load states.

  • Reset states to default values.

To open the UI, call generateAudioPlugin with no input arguments.

generateAudioPlugin

Type "audiopluginexample.Echo" into the Audio plugin class name field. Click Validate to validate the plugin. Click Generate to generate the plugin in the location specified by the Output folder field.

Use the -auv3 option to generate an AUv3 plugin containing app.

generateAudioPlugin -auv3 audiopluginexample.Echo

Run the generated app to register the plugin with the macOS system. This also opens a window containing the plugin interface. You can close the app once it successfully opens.

Use the system function to run the auval macOS command and verify that the plugin was successfully registered.

[status,output] = system("auval -a | grep Echo")
status = 

     0


output =

    'aufx 4pvz Math  -  MathWorks: Echo
     '

Input Arguments

collapse all

Options to specify output folder, plugin name, and file type, specified as one of the values in the table. You can specify options in any order and group them.

Option

UI Setting

Description

-auSet Format to AUGenerates an Audio Unit (AU) v2 audio plugin binary. This option is valid only on macOS.
-auv3Set Format to AUv3

Generates a containing app for an AUv3 plugin. Run this app to register the AUv3 plugin in your macOS system.

The generated plugin is ad-hoc code signed. You can use the codesign command in the macOS command line to manually code sign the plugin with your own certificate. Use the --force option to ensure that the ad-hoc signature is replaced. For more information, see the Apple documentation, Code Signing Guide.

This option is valid only on macOS.

-vstSet Format to VSTGenerates a VST 2 audio plugin binary. By default, generateAudioPlugin generates a VST 2 plugin.
-vst3Set Format to VST3Generates a VST 3 audio plugin binary. This option adds a Bypass parameter to the plugin.
-exeSet Format to Standalone executable

Generates a standalone executable for your audio plugin. When you evaluate the generated code, the UI you defined in your audio plugin opens. You can control the input to your plugin and the output from your plugin using Options.

-juceprojectSet Format to JUCE project

Creates a zip file containing generated C/C++ code and a JUCER project file suitable for use with JUCE 5.3.2 to 6.0.8. You can use the generated zip file to modify the generated plugin or compile it to a format other than VST 2.4. This option requires a MATLAB Coder™ license. To use the generated files with JUCE, you must obtain your own appropriately licensed copy of JUCE.

-output fileNameOutput file name

Specifies the file name of the generated plugin or zip file. The appropriate extension is appended to the fileName based on the platform on which the plugin or zip file is generated. By default, the plugin or zip file is named after the class.

-outdir folderOutput folder

Generates a plugin or zip file to a specific folder. By default, the generated plugin is placed in the current folder. If folder is not in the current folder, specify the exact path.

-win32Generate a 32-bit audio plugin

Creates a 32-bit audio plugin. Valid only on win64 Windows® platforms. This option does not support the coder.DeepLearningConfig("mkldnn") deep learning library configuration, the "Intel AVX (Windows)" code replacement library, or the "DSP Intel AVX2-FMA (Windows)" code replacement library.

-mac64universalGenerate a macOS universal plugin

Creates a Mac audio plugin for use on Intel® and Apple Silicon. This option works only on Macintosh platforms. This option does not support the coder.DeepLearningConfig("mkldnn") deep learning library configuration or any code replacement libraries.

-audioconfig cfgCoder Configuration section

Generates a plugin that uses a deep learning network or a code replacement library. See audioPluginConfig for more details.

Only the -juceproject option is supported in MATLAB Online.

Name of the plugin class to generate. The plugin class must be on the MATLAB path. It must derive from either the audioPlugin class or the audioPluginSource class.

You can specify the plugin class to generate by specifying its class name or file name. For example, the following syntaxes perform equivalent operations:

  • generateAudioPlugin myPlugin

  • generateAudioPlugin myPlugin.m

If you want to specify the plugin class by file name, and your plugin class is inside a package, you must specify the package as a file path. For example, the following syntaxes perform equivalent operations:

  • generateAudioPlugin myPluginPackage.myPlugin

  • generateAudioPlugin +myPluginPackage/myPlugin.m

Limitations

Build problems can occur when using folder names with spaces. For more information, see Build Process Support for File and Folder Names (Simulink Coder) and Why is the build process failing with error code: "NMAKE: fatal error U1073: don't know how to make 'C:\Program'"?.

More About

collapse all

Generated VST Plugin File Extension

The extension of your generated VST plugin depends on your operating system.

Operating System

File Extension

Windows

.dll

macOS

.vst

Version History

Introduced in R2016a

expand all