Skip to content

Instantly share code, notes, and snippets.

@baconpaul
Last active January 26, 2022 19:40
Show Gist options
  • Save baconpaul/998dcbe6bee3d9f3b17c63ecd6d4e577 to your computer and use it in GitHub Desktop.
Save baconpaul/998dcbe6bee3d9f3b17c63ecd6d4e577 to your computer and use it in GitHub Desktop.
Building Surge-XT and Surge-XT-FX as a CLAP

NOTE JAN 26 / CLAP 0.18 WE ARE UPDATING THESE DIRECTIONS

How to build Surge-family synths using the free-audio clap extensions

We are working on documenting this, but basically have a set of clap extensions which don't require you to fork juce. Right now Surge/SurgeFX/ Tuning Workbench all build

It's pretty simple really. The steps are

  1. Check out the clap core, helpers, and juce extensions
  2. Check out the synths at head
  3. Add cmake flags pointing to the setup in 1 and 2
  4. Build, Enjoy!

So here we go.

Before we begin

Current state of play

There's lots of todos on the JUCE code, but it is working it seems in win/lin/mac pretty well for several things

Check out the clap components

Make a directory called 'clap-plugins' or some such where you will check out everything.

First step: clone the libs

git clone https://github.com/free-audio/clap
git clone https://github.com/free-audio/clap-helpers
git clone https://github.com/free-audio/clap-juce-extensions

Then checkout surge at main and grab submodules

git clone https://github.com/surge-synthesizer/surge.git
cd surge
git submodule update --init --recursive
cd ..

Building surge

You want to set up the cmake build first. These instructions work on mac and linux; on windows you would replace ${PWD}/.. with the path to your clap directory hosting the elements

cd surge
cmake -Bignore/clap -DCLAP_ROOT=${PWD}/.. -DCLAP_JUCE_EXTENSIONS_ROOT=${PWD}/../clap-juce-extensions -DCMAKE_BUILD_TYPE=Debug -GNinja -DSURGE_COPY_AFTER_BUILD=True

Then once this is done you can build either of the plugins.

cmake --build ignore/clap --target surge-xt_CLAP
cmake --build ignore/clap --target surge-fx_CLAP

This recipe works for other Surge family synths also

The generic formula I am working towards is

git clone https://github.com/surge-synthesizer/PLUGIN.git
cd PLUGIN
git submodule update --init --recursive
cmake -Bignore/clap -DCLAP_ROOT=${PWD}/.. -DCLAP_JUCE_EXTENSIONS_ROOT=${PWD}/../clap-juce-extensions -DCMAKE_BUILD_TYPE=Debug -GNinja
cmake --build ignore/clap --target PLUGIN_CLAP

As of this writing the following synths work with this generic formula (with PLUGIN replaced with the synth name)

Build the clap host (unixes only)

Pretty simple.

git clone https://github.com/free-audio/clap-host
cd clap-host
git submodule update --init --recursive
cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug  

On Ubuntu 20 you need to download QT6 and add a line line -DCMAKE_PREFIX_PATH=/home/paul/Qt/6.2.1/gcc_64/

then to build and run

cmake --build build
CLAP_HOST_FORCE_PLUGIN=~/Library/Audio/Plug-Ins/CLAP/Surge\ XT.clap ./clap-host/build/host/clap-host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment