(Beginner): Methods to test/debug processBlock

Hi !

When I used to make VST plugins in MATLAB, I found it very useful to sometimes to work in console by creating the audio plug in object and manually call the ‘processBlock’ method. Then I would print to console the output samples, which helped me identify problems in my code rather effectively.

Is there a similar way I can do this with the JUCE framework?

Although I am fairly comfortable with the syntax of C++, I am far from experienced with understanding the dependencies of the JUCE framework, and I am wondering if there is a simple way of extracting the AudioProcessor class to a separate project such that I could call the processBlock method with my own arguments? I am using Visual Studio 2019!

You can host your AudioPlugin created in JUCE in Matlab and do exactly that :slight_smile: I don’t have the necessary commands at hand but you’ll find it in Matlab’s AudioPlugin docs

Just to clarify, when you say host in MATLAB, would I host the VST3 generated by JUCE?

Thanks for your reply!

Yes, you can create a VST or VST3 in JUCE, and host that in Matlab, and send audio data within matlab scripts or matlab’s command line. Something like processed = hostetPlugin.step(inputMatrix) if I remember correctly

1 Like

This is neat, i’ll look into it. Thanks!

Never tried it, but in theory you should even be able to build a debug build of your plugin and then attach the Visual Studio debugger to Matlab before calling the plugin from Matlab. This way you could set breakpoints in your C++ processBlock routine and step through the processing code to inspect each stage of your C++ processing. Could be a quite powerful debugging workflow.

There’s also the Matlab API, with which you can send data from an application directly to the Matlab Workspace, and even vice versa. I’ve never used it, but seems like a nice way to visualize data