Tutorial: Making CLAP plugins

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hi folks,

Recently I've been writing a tutorial about making CLAP audio plugins. It runs through a simple example of making a CLAP plugin with all the standard features:
  • Polyphonic modulation
  • Voice stacking
  • Cross-platform GUIs
  • Saving and loading
  • Gesture management
It's designed for people who already have experience writing audio plugins. I hope that it will make the porting of existing plugins over to the CLAP format easier.

The tutorial works for Windows, Linux and macOS. Please leave any feedback you have on this thread :)

Here are the links to the tutorials: And here is the link to the final plugin code: Enjoy!
Last edited by nakst on Tue Nov 15, 2022 3:53 pm, edited 1 time in total.

Post

Thank you very much for this.
I've been meaning get started with CLAP for some time now and this looks like a good resource to start me off.

Thanks
Kirsty :)

Post

Thanks for making a non-trivial example! AGain examples need to just go away before I do something really bad. :D
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

Thanks, cool to have a reference. I'd like to drop JUCE if I find a good multiplatform GUI framework when the official wrappers to other formats are launched.

I keep an eye to this, but it seems to move slow:
https://github.com/cycfi/elements

Not that JUCE is bad, quite the contrary, but it is a heavy dependency that wants to own my CMakelists.txt and annoys me with this Juceaide thing running.
Last edited by rafa1981 on Thu Nov 17, 2022 9:56 pm, edited 2 times in total.

Post

rafa1981 wrote: Sun Nov 13, 2022 9:07 pm Thanks, cool to have a reference. I'd like to drop JUCE if I find a good multiplatform GUI framework when the official wrappers to other formats are launched.

I keep an eye to this, but it seems to move slow:
https://github.com/cycfi/elements

Not that JUCE is bad, quite the contrary, but it is a heavy dependency that wants to own my CMakelists.txt and annoys me with this Juceaide thing running.
I just resurrected my OpenGl-backed GUI because of this:
https://github.com/ollix/MetalNanoVG
It creates a Metal backing, so I can be au current on the Mac. I stopped development with OGL when Apple announced ut was deprecated.

This library has a few quirks, but literally does what it says on the tin. It just does not like to be re-dimensioned. Resizing is free, though.

I haven't seen Elements before. I'll have to check it out, see how it compares to DearIMGUI.
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

DearIMGUI is immediate mode. Elements is retained. Not comparable.

Elements is coded by Joel de Guzman. The guy is a world-class C++ expert (coded template-heavy boost libraries like spirit and fusion) and the library seems well designed, but might set requirements on the C++ amount of knowledge required to use it (just a hunch, not verified, so take this at face value). It's not 1.0 so it might miss stuff.

Post

We have worked on a simple solution with Dear IMGUI. It works rather well, but I think we need to add some half decent looking components to make it attractive.

I'll be updating the cleveraudio.org website soon, and I'd love to add this tutorial and hopefully a few more examples.

Post

Hey Urs!

I find the choice of DearImGUI for a tutorial plug-gui a bit strange TBH. It's really designed for debug guis for gamedev, uses a different paradigm to most UI libraries and would require a lot of extra work for anyone to make something that looks like a normal plug-in. It appeals to me on a hacker level, and at one point I integrated it into iPlug2, but I don't think it's a good thing to have as a starting point UI framework for plug-ins. Elements would be a better choice I think, but I'm not sure of the status of that project either.

Best,

Oli

Post

Well, the thing is, there was an example CLAP plug-in with it early on, but it wasn't working with CLAP's final ABI. We made it work with the final ABI and as a plug-in, which meant replacing GLFW with an event handling layer.

If someone made an example with Elements, I'd be happy to link to that as well.

Post

Last edited by OBSOLETE160530 on Sun Oct 08, 2023 4:10 pm, edited 1 time in total.

Post

Last edited by OBSOLETE160530 on Sun Oct 08, 2023 4:10 pm, edited 2 times in total.

Post

Nice.

Post

Sorry to resurrect this, but I'm having trouble building the example in the first part. I copied plugin.cpp to my project folder, but when I try building it with Visual Studio it gives me this error:
plugin.cpp(118): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
I got around this by initialising .features with a global variable (horrible, I know, but I wanted to see if I can get it to build) but now I'm getting this error:
LINK : fatal error LNK1561: entry point must be defined
What am I doing wrong?

Post

Majisto wrote: Sat Jul 01, 2023 5:49 pm
LINK : fatal error LNK1561: entry point must be defined
What am I doing wrong?
Make sure you're building a DLL rather than an EXE.

Post

Thanks! I was trying to use this command:
cl /DLL /Zi /std:c++20 plugin.cpp
But I was supposed to use this instead:
cl /LD /Zi /std:c++20 plugin.cpp
EDIT: Any idea on what's causing the other error? It's something in the definition pluginDescriptor.

Post Reply

Return to “DSP and Plugin Development”