A CMake template project for developing custom FMOD DSP plugins in C++.
This project provides a structure for creating cross-platform FMOD DSP plugins in C++.
It contains the boilerplate code required to interface with FMOD's DSP callback API, and defines a clean separation between interface, state, and data.
DSP helper functions are implemented in standalone libraries: a header-only DSP math library (libs/ans_dsp) and a static library of FMOD helpers (libs/ans_fmod_dsp).
- CMake 3.30 or higher
- FMOD Core API (download here)
- C++20 compatible compiler
- Clone the repository:
git clone https://github.com/horacv/FmodCMake_Plugins.git cd FmodCMake_Plugins - Download and install the FMOD Core API with
tools/setup_fmod_api.py(seetools/readme.md), or download it manually and copy the files as described inlibs/fmod/core/readme.md. - Configure and build with CMake (see commands below).
- Debug:
cmake -B build/debug -DCMAKE_BUILD_TYPE=Debug && cmake --build build/debug - Release:
cmake -B build/release -DCMAKE_BUILD_TYPE=Release && cmake --build build/release
.
├── CMakeLists.txt # Main CMake configuration
├── libs/ # Helper libraries for DSP processing
│ ├── ans_dsp/ # Base DSP functionality (Common, Filters, Noise, Oscillators, Smoothing)
│ ├── ans_fmod_dsp/ # FMOD-specific DSP utilities
│ └── fmod/ # FMOD API headers and libraries
├── plugins/ # DSP plugin implementations
│ ├── passthrough/ # Example plugin — no processing
│ ├── gain/ # Gain / trim
│ ├── lpf_1p/ # One-pole low-pass filter
│ ├── hpf_1p/ # One-pole high-pass filter
│ ├── lpf_2p/ # Two-pole low-pass filter
│ ├── hpf_2p/ # Two-pole high-pass filter
│ ├── eq_4b/ # 4-band parametric EQ
│ ├── delay/ # Delay / echo
│ └── tone_generator/ # Tone generator (Sine, Saw, Triangle, Square, Noise)
├── fmod_project/ # FMOD Studio project files (empty, ignored by default)
└── tools/ # Python scripts for setting up the FMOD API
| Plugin | Description |
|---|---|
passthrough |
Minimal example plugin; passes audio through unmodified. Good starting point for a new plugin. |
gain |
Simple gain/trim with parameter smoothing. |
lpf_1p / hpf_1p |
One-pole low-pass and high-pass filters. |
lpf_2p / hpf_2p |
Two-pole (biquad) low-pass and high-pass filters. |
eq_4b |
4-band parametric EQ using cascaded biquads (HPF/low shelf, two peaking bands, LPF/high shelf). |
delay |
Delay/echo with feedback, built on a circular ring buffer. |
tone_generator |
Tone generator producing sine, saw, triangle, square waves and white noise. |
- Add a new subdirectory under
plugins/, modeled onpassthrough/or an existing plugin. - Replace the namespace name with the name of your plugin, not the classes.
- Write your DSP processing in the '_state' class.
- Write the UI definition in the '.plugin.js' file.
- Register the new plugin target in
CMakeLists.txt.
- Open FMOD Studio.
- Create a new project or open an existing one.
- Go to Edit -> Preferences -> Assets.
- In the Plug-ins folder, enter the folder where your plugin binaries (
.dll/.dylib/.so) and their.plugin.jsfiles are built. Each plugin is built into its own folder, for exampleC:/FmodCMake_Plugins/build/debug/plugins/gain/(with Visual Studio generators, a furtherDebug/orRelease/subfolder). - Enjoy.
- FMOD Studio API Getting Started
- CMake Documentation
- Audio EQ Cookbook (Bristow-Johnson) — reference for biquad coefficient math used throughout
eq_4band the filter plugins - Designing Audio Effect Plugins in C++ (Pirkle) - reference for
delaymath and circular buffers, as well as the formulas used for thetone_generatoroscillators. - One-Pole IIR Filter Formulas (DSP StackExchange)
- Subnormal Numbers (YouTube - Fading Audio is ROUGH on CPUs)
- Subnormal Numbers (Wikipedia)
- PolyBLEP Oscillator (Martin Finke)
- PolyBLEP GitHub
- CMake Projects in Visual Studio
- Create a CMake hello world project in VS Code
- Xcode generator in CMake
- CLion - Create/open CMake projects
