JUCE Assertion failure in juce_AudioProcessor.cpp:440

Hi! Noob here. But I’ve searched and tried to debug for a couple of days and can’t find a solution.
(Yes, I’m going to focus on learning more c++. But I just really want to get this plugin up and running.)

So, when I build my code in Xcode I get the following error " JUCE Assertion failure in juce_AudioProcessor.cpp:440"

I also get this message on my addParameter lines: JUCE Message Thread (1): EXC_BREAKPOINT (code=1, subcode=0x100942410).

Anyone who can point me in the direction of a solution? Thanks.

Here’s the code I think is causing it:

TestPluginProcessor::TestPluginProcessor()
#ifndef JucePlugin_PreferredChannelConfigurations
: AudioProcessor (BusesProperties()
#if ! JucePlugin_IsMidiEffect
#if ! JucePlugin_IsSynth
.withInput (“Input”, juce::AudioChannelSet::stereo(), true)
#endif
.withOutput (“Output”, juce::AudioChannelSet::stereo(), true)
#endif
)
#endif
{
addParameter(amount = new juce::AudioParameterFloat(“amount”, “Amount”, 0.0f, 1.0f, 0.5f));
addParameter(mix = new juce::AudioParameterFloat(“Mix”, “Mix”, 0.0f, 1.0f, 0.5f));
addParameter(decay = new juce::AudioParameterFloat(“Decay”, “Decay”, 0.0f, 1.0f, 0.5f));
addParameter(frequency = new juce::AudioParameterFloat(“Frequency”, “Frequency”, 0.0f, 1.0f, 0.5f));
}

To help people help you, please format your code with three ’ in a row, show the line of code for the assert, and for extra points a stack trace.

Where the assertion failed there will always be some comment just above the assert point that explains what went wrong, in this case it’s due to the new requirement for JUCE: ParameterID Class Reference to have a version hint when using AudioUnits.

Unfortunately the tutorial on adding paramters hasn’t been updated yet to reflect this, but follow that link and you’ll see how to squash this assert.

2 Likes

Thank you so much! That fixed it. Brilliant.