Welcome to %s forums

BrainModular Users Forum

Login Register

Plugin module current patch name

Tell us what you'd like Usine to do
Post Reply
sm_jamieson
Member
Posts: 553
Contact:

Unread post by sm_jamieson » 19 Jan 2019, 17:50

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.

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Mar 2019, 13:06

it should be possible. I'll take a look

sm_jamieson
Member
Posts: 553
Contact:

Unread post by sm_jamieson » 27 Jun 2019, 15:21

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.

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 03 Jul 2019, 20:24

Thanks for the C++ code, I'll do that.
senso

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 04 Jul 2019, 10:51

modifications applied in HH4 beta 044

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 09 Jan 2020, 22:47

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.
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 12 Jan 2020, 16:12

the default patch preset manager (not the module) is not limited.

Post Reply

Who is online

Users browsing this forum: No registered users and 119 guests