Page 1 of 1

Posted: 19 Jan 2019, 17:50
by sm_jamieson
I usually use midi program changes to select programs on the VST, and luckily most of my plugins support this.
But I now have a VST that does not, so I have to use the preset manager to store and select presets. I am glad the preset manager now supports 64 presets, and I know you can use more than one preset manager in a patch.

So what I then want to do is "import" the preset from the VST. All that is missing is extracting the current patch name from the VST. I have noticed that usually when the plugin GUI is opened the window title is the current patch, but I don't know it this is being done by the VST or by the plugin wrapper.

Is it possible to extract the current patch name from the VST and provide it as an output text parameter on the plugin module ?

I know if the VST exports the preset list then you can select using that and extract the name from the list, but that is not quite the same thing.

Thanks,
Simon.

Posted: 15 Mar 2019, 13:06
by senso
it should be possible. I'll take a look

Posted: 27 Jun 2019, 15:21
by sm_jamieson
OK, I looked at the most recent plugin module included in the SDK (PluginWrapper-juce_5 v2).

This does not seem to be the actual version included with Usine, since it does not place the VST interface in a window with save/load bank/preset buttons at the top.

I added a new output text parameter (m_txtCurrProgName) for the current program name, and referenced it in a modified function:

// from AudioProcessorListener interface
void PluginWrapper::audioProcessorChanged (AudioProcessor *processor)
{
sdkTraceLogChar ("audioProcessorChanged");
populateProgramsNameList ();
const char* caProgInName = qsProgInName.toUTF8 ();
sdkSetListBoxCommatext (offsetProgIn, const_cast <char*> (caProgInName));

// TODO : reconstruire la list de programme et les noms des params

//Simon: if processor only returns a single program name, index is the same and this check does not work.
//if (processor->getCurrentProgram () != (int)sdkGetEvtData (m_lboxProgramIn))
//{
sdkSetEvtData (m_lboxProgramIn, (float)processor->getCurrentProgram ());

String presetName = processor->getProgramName(processor->getCurrentProgram());

caStringToUTF8Buffer = presetName.toUTF8();
sdkSetEvtPChar(m_txtCurrProgName, const_cast <char*> (caStringToUTF8Buffer));

if (pluginWindow != nullptr)
{
pluginWindow->setName (processor->getName() + "-" + presetName);
}
//}

updateModuleParams ();
updateModuleParamsName ();
}

One thing I have noticed is that some VSTs return a full program list with the program number in that list, which would be ideal.

But other VSTs always return a program list of 1 item and the program number of that item when a the VST patch is changed.
If this happens, the check:
//if (processor->getCurrentProgram () != (int)sdkGetEvtData (m_lboxProgramIn))
is never true so the program name in the window title bar never gets updated.
In this case, the program number is useless, which makes the new program name output parameter even more useful,

Please could we have this included in a new plugin module - for HH4 I would guess !

Thanks,
Simon.

Posted: 03 Jul 2019, 20:24
by senso
Thanks for the C++ code, I'll do that.
senso

Posted: 04 Jul 2019, 10:51
by senso
modifications applied in HH4 beta 044

Re: Plugin module current patch name

Posted: 09 Jan 2020, 22:47
by woodslanding
I will have to look into this.... but my workaround is working really well, so maybe not. Just out of curiosity, does the new PM have a program limit?? I couldn't find anything about it in the docs.

Re: Plugin module current patch name

Posted: 12 Jan 2020, 16:12
by senso
the default patch preset manager (not the module) is not limited.