Hi, I am working on a VST3 plugin (+standalone for test). The editor has 3 combo boxes and 21 sliders. Most of the slider work is done in a loop for convenience. Everything seems to compile fine. At the very end of the build, a weird file copy failure happens (see the bottom of this post, because it is very big).
If I comment out one source line (the .reset one), the copy error does not happen.
// (parameters have already been created in ValueTreeState constructor)
for (n = 0; n < KM_NUM_PROB_SLIDERS; n++) {
p_sld_probs_[n] = new juce::Slider;
//...
parmid = "prob";
parmid << n;
p_val_prob_[n] = p_valtree_->getRawParameterValue(parmid);
**p_at_prob_[n].reset(new ASliderAttachment(*p_valtree_, parmid, *p_sld_probs_[n]));**
}
Actually a .vst3 file is created, size 13MB, despite the copy error message.
Is there a problem happening related to “BinaryData.cpp size limit”? I increased 10MB to 20MB but that didn’t solve the error.
I am stumped. Any assistance much appreciated.
Error report:
|Error|MSB3073|The command copy /Y C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\\MelToHarm.dll C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\\MelToHarm.vst3\Contents\x86_64-win\MelToHarm.vst3<br>del /s /q C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\/MelToHarm.vst3\Contents\moduleinfo.json<br>if not exist C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\/MelToHarm.vst3\Contents\Resources\ del /s /q C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\/MelToHarm.vst3\Contents\Resources && mkdir C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\/MelToHarm.vst3\Contents\Resources<br>C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3 Manifest Helper\juce_vst3_helper.exe -create -version 1.0.0 -path C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\/MelToHarm.vst3 -output C:\Users\Kevin\Source\repos\JUCE7\MelToHarm\Builds\VisualStudio2022\x64\Debug\VST3\/MelToHarm.vst3\Contents\Resources\moduleinfo.json<br>:VCEnd exited with code -1073741819.
The issue is most likely that the post build script failed because it couldn’t generate the manifest/moduleinfo file. The most likely cause of this is that the manifest helper couldn’t load your plugin, and the most likely reason for that happening is that the plugin crashed on startup. As you said the plugin built. Could you copy the .vst3 and try to load it in another DAW? Does it load? If not try attaching a debugger and fixing the issue. Once the plugin loads you’ll probably find the builds are working again.
If I comment the offending line, the build completes and I can start trying to run the standalone with a debugger. It stops quickly with a failed assertion (shown below). I’m not sure how to interpret the comment at the assertion.
I’m only trying createAndAddParameter because I want it in a loop. If instead I explicitly declare 21 parameters in the ValueTreeState constructor (.reset line still commented out), I don’t get that assertion and the editor GUI opens. But if I uncomment the .reset, the build fails as before…
RangedAudioParameter* AudioProcessorValueTreeState::createAndAddParameter (std::unique_ptr<RangedAudioParameter> param)
{
if (param == nullptr)
return nullptr;
// All parameters must be created before giving this manager a ValueTree state!
jassert (! state.isValid());
If you take a look at the docs for the AudioProcessorValueTreeState there’s an example of this, it says…
/* ...
You should *not* assign a new ValueTree to the state, or call
createAndAddParameter, after using this constructor.
...
To add parameters programmatically you can call `add` repeatedly on a
ParameterLayout instance:
@code
AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
{
AudioProcessorValueTreeState::ParameterLayout layout;
for (int i = 1; i < 9; ++i)
layout.add (std::make_unique<AudioParameterInt> (String (i), String (i), 0, i, 0));
return layout;
}
YourAudioProcessor()
: apvts (*this, &undoManager, "PARAMETERS", createParameterLayout())
{
}
*/
Thanks for your info. I was having 2 separate issues:
- creating the parameter array
- attaching the parameter array
#1: I’m not sure to which “docs” you are referring (I didn’t find anything in the class reference or tutorials), but I imagine that I can follow the example and get it to work that way. For the short term, explicit entries in the ValueTreeState constructor get around that issue.
#2: I changed my array of Slider* to just an array of Slider. Calling .reset with a reference works, using a dereferenced pointer does not seem to work.
It’s also nice to have a rational explanation of a possible copy error source - not intuitive.
We’re aware it’s not intuitive and we do plan on improving the messaging. We plan on making it a warning with a clear message so that your builds don’t fail.
All working well now. I hadn’t looked far enough. Thanks again (from music hobbyist, JUCE hobbyist, retired programmer).