Automatic SOUL -> JUCE project generator!

Just released a very cool new feature in the soul command-line tool. We had a rudimentary C++ generator in there, but I’ve spent a few weeks pimping it, so that now it can take a SOUL patch and spit out a folder containing a full, ready-to-build, 100% C++ JUCE project.

So for example you might run

soul generate --juce examples/patches/Reverb/Reverb.soulpatch --output=Reverb

and it will create a folder

Reverb/
    Reverb.jucer
    Reverb.cpp
    Reverb.h
    Main.cpp
    README.txt

Double-click the .jucer file to open it in projucer, hit “save” and you can build a VST/AU/AAX/standalone plugin for whatever OS you’re on.

The code it emits is completely dependency-free (except for JUCE of course), and there’s no JIT involved, it’s a pure-C++ version of the SOUL code.

A nice aspect of the code it generates is that it defines a juce::AudioPluginInstance class which you can override to customise it, e.g. you add your own GUI, and I’ve tried to arrange things so that you can customise without having to change anything inside the generated files.

There’s been a fair amount of behind-the-scenes work to get here, and it’s fresh code, so let us know how you get on, and any problems.

Obviously the next step will be for us to add this to the website, so that you can go to https://soul.dev, tinker around to build yourself a patch, then simply download a zip of a JUCE project that can build a native VST of it :slight_smile:

26 Likes

Will some of the benefits of SOUL be carried over when converting a SOUL project to a JUCE project?

Well, the code is easier to write than C++, I guess.

But obviously it’s a chunk of C++ that it spits out, and then gets built as a VST/AU, so it can’t do any of the fancy low-latency/live-reloading/offload-to-other-devices stuff that SOUL itself offers, or anything that’s not possible in a normal plugin.

Think of it more as an intermediate tool to help people get used to writing SOUL while we wait for native hardware/DAW support.

5 Likes

where is available this soul command line tool ?
Didn’t see something on the soul github or way/guidelines to compile it.

Thanks !

Binaries are in the Soul Github releases page.

oh boy :slight_smile:

Thanks !

Really looking forward to playing around with this, but sadly I’ve had no luck getting the generated projects to build.


Got the same result with other example soul patches in the official SOUL repository. Following the steps in your post.
I’m particulary confused by the LNK1104 asking for .lib. This doesn’t happen on any of my other projects. Only those created by “soul generate”.

Any help would be immensly appreciated and apologies in advance for my novice c++ knowledge

Can you

  • check you’re running the latest release of soul (from yesterday)
  • tell us which version of juce you’ve got
  • tell us which compiler version this is
  • tell us what soul code you’re actually building: is it an unmodified copy of the sine synth example?

Downloaded soul 0.9.13.After ensuring no other versions of SOUL are on my pc and adding the install location to PATH, “soul --version” displays:
SOUL version 0.8.0
Build Date: Jun 22 2020 16:21:30

Im assuming given the build date that this is the version 0.9 but the welcome message just needs updating.

I then followed the steps in the readme trying first with JUCE 5.47 and then JUCE 6 getting the same above result for both. I’m opening the project with visual studio 2019 using the built in c++ compiler.
The the soul code Im trying to build are the example patches in the above mentioned fresh install of SOUL. No changes made to the code atall.
This is all im doing:

P.S. Thankyou for the quick response!

OK, ta for the info.

It looks like the Microsoft compiler is complaining about a zero-length array that we generate in situations where there are no input channels, whereas clang and GCC don’t seem to mind. It’s an easy fix for us to skip generating that array if there are no channels, so will push out a new release soon…

Confirmed, Reverb successfully builds using clang compiler. Very clever stuff!
For fellow newbies on windows / VS:

  1. Open Visual Studio Installer > Modify > Individual Components > tick “C++ Clang Compiler for WIndows…” and “C++ Clang-cl for v142 build tools …”
  2. Open your Jucified soul project with Projucer > VisualStudio
  3. For each project folder (i.e. …SharedCode, …StandalonePlugin, …VST3) right click > Properties > General > set Platform Toolset to LLVM (clang-cl)
  4. hit Build / Debug

PadSynth also successfully builds but seems to run into a memory issue.


Not sure if it’s a leak or an overly tight cap set somewhere in the code. Will investigate

Really amazing to see this working! Kudos to you and your fellow wizards

That’s an odd one - i’ll investigate

Ok, so the problem turned out to be a stack overflow - this was caused by this patch having a very large state, and the code for clearing the state causing a stack overflow. I’ve fixed this by moving to a different strategy for clearing the state, a simple memset for now in the init() method. There is the possibility that other zeroing operations within the code will likewise cause such an issue, so i’ll work out a general solution (my first attempt was a little ugly so i haven’t moved to this for now).

I’ve pushed a new update to the tools which resolves this issue - give it a try and see if this works for you.

Yep, thats done the trick! PadSynth is up and running in less than 5 clicks. Noticed it’s working with Visual c++ too. Thanks so much for your help :slight_smile: Can’t wait to see where you go next with this

In another thread Jules said:

We’ll certainly support multiple formats for GUIs for SOUL patches, and will be fairly agnostic about what hosts choose to support, but would expect most people to write it in React or Javascript web-standards, or maybe simple declarative GUI framework using something like Lua.

Are there any example projects that create a GUI for SOUL using any of these alternate methods? Something less complicated than using JUCE Components in C++?

We’ve released an alpha of support for the Blueprint React GUI library:

More discussion about this over on theaudioprogrammer.com discord channel

6 Likes