Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Preset selection
Avatar
jim
Member
Members
June 15, 2020 - 2:34 am
Member Since: January 1, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

I've set up some presets in

bool PluginCore::initPluginPresets()

as described in the ASPiK documentation. They appear and work correctly in Reaper but unfortunately aren't being displayed in Ableton. 

I'd like to create an option menu to select the internal presets but I'm not sure how to go about this.

I was hoping something like this would work;

PluginParameter* piParamBonus = nullptr;

piParamBonus = new PluginParameter(PRESET_NAME, "presets", controlVariableType::kNonVariableBoundControl);
addPluginParameter(piParamBonus);

But no. Likely a result of not knowing what the PRESET_NAME reserved parameter ID is supposed to be used for.

Any insights would be helpful. Cheers

Avatar
W Pirkle
Admin
June 19, 2020 - 11:18 am
Member Since: January 29, 2017
Forum Posts: 462
sp_UserOfflineSmall Offline

Ableton and Studio One do not show the presets for VST3 plugins, but they do for VST2. I have been in contact with the Presonus engineers, who were very helpful, to confirm that (for S1). As far as I can tell, the same is true with BitWig. I also posted it in the VST3 Dev Forum here:

https://sdk.steinberg.net/viewtopic.php?f=4&t=794&sid=e9c1dec1a770df67310573ff4f21acde

In order to create an option menu for presets, you treat it as any other GUI control and give it a controlID value, etc... 

When you update your parameters at the top of each buffer processing cycle, you can check the value and then manually load a preset. The code for doing this can be found in all of the Plugin Shell code, but looks like this (this would be implemented in the PluginCore object)

PresetInfo* preset = getPreset(0);

if (preset)

{

   for (unsigned int j = 0; jpresetParameters.size(); j++)

   {

      PresetParameter preParam = preset->presetParameters[j];

      setPIParamValue(preParam.controlID, preParam.actualValue);

   }

}

Now this is using the same preset mechanism as the DAW will use. And, you can also create your own presets that only your object has access to. Just follow the same paradigm as the presets in the base class.

Alternatively, you can create your own preset data structure and do the work manually. 

There are some APIs that prefer you to NOT implement your own presets but in some cases, like a DAW that won't show the factory presets, then you will need to. 

You should also check out the documentation for guiParameterChanged( ) which shows how to send messages to update the GUI controls.

Will 

Avatar
jim
Member
Members
June 21, 2020 - 3:44 am
Member Since: January 1, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

Hi Will, 

Again many thanks for the good info. It's gotten me about halfway there.

Is this the documentation you mean? http://aspikplugins.com/sdkdoc.....ecf2422c2a

I think I need a bit more help.

I set a control to act on your code. It might be the wrong place to use it (as per the doc'd caution), but I found that it worked from within the PluginCore::guiParameterChanged section. 

I can see that the internal parameters are being updated correctly by the setPIParamValue() function.

But of course this isn't being reflected yet by the GUI.

I think if there was a similar function to update the GUI controls then it could be used from within that same for loop. I can't find what that function might be.

Also in the doc for GUIUpdateData structure it says to see example code before using. Is that around somewhere?

Cheers

Avatar
W Pirkle
Admin
June 23, 2020 - 5:14 pm
Member Since: January 29, 2017
Forum Posts: 462
sp_UserOfflineSmall Offline

Hi Jim

Let me do some poking around. I may have the sample code stashed somewhere. 

It may be easier for me to alter the ASPiK SDK with the ability to do a brute force update of the GUI via a single thread safe message from your plugin. And, in-plugin Presets are hotter than ever right now.

Please standby and let me think on it. If it is too difficult to change the SDK, I can show you some code to do the GUI update one control at a time, but that would be cumbersome.

Will 

Avatar
W Pirkle
Admin
June 27, 2020 - 5:24 pm
Member Since: January 29, 2017
Forum Posts: 462
sp_UserOfflineSmall Offline

Hey Jim

I wanted to let you know that I have a tutorial cooking right now that will show you how to complete your task here. It is actually easier than I originally suggested and does NOT require calls to set the PIParam internally. I have added the internal presets to the ASPiK StereoDelayer project along with a status LED that shows when a preset is "dirty" and both the GUI update and LED toggle use the same mechanism and function. I will have this available tomorrow (Sunday) as sample RackAFX7 and ASPiK projects as well as a document that explains everything. Just wanted to let you know.

Will 

Avatar
jim
Member
Members
June 28, 2020 - 4:55 am
Member Since: January 1, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

Hey Will,

That is really great news. Thank you very much for the help. 

Although surely it'd be easier if the popular DAW's would just support this critical functionality. I think a tutorial project + document would be highly useful to everyone here.

I'll let you know how it goes for me.

Cheers,

Jim

Avatar
W Pirkle
Admin
June 28, 2020 - 10:47 am
Member Since: January 29, 2017
Forum Posts: 462
sp_UserOfflineSmall Offline

Well, as for the DAW issue, it is my opinion that when VST3 arrived, manufacturers tried to use their existing interface code for hosting VST2 plugins to wrap the VST3 plugins. And presets are just one of many things that are not paralleled between the two APIs (initializing and detecting the GUI is another). 

Here is the new Advanced Projects and Tutorials page. The old site had about a dozen or so App Notes that all referred to RackAFX6 obsolete code, so I am revamping that page and I have added this as the first project/tutorial. 

https://www.willpirkle.com/support/advanced-tutorials/

The Stereo Delayer has an added preset drop-list and a status LED that lets the user know when the preset name and controls are out of sync.

Let me know if you have any questions - the method presented here is powerful, but may be dangerous if you try to adjust internal states (see the docs).

Will

Image Enlarger

Avatar
jim
Member
Members
June 29, 2020 - 6:13 am
Member Since: January 1, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

Hey Will,

Thanks again. The document was really enlightening. I've just spent some time studying it and without looking at how you've done the example yet I hacked together something that seems to work from the first code snippet you suggested.

Just posting it here in case it is beneficial to someone's understanding (including my own). Definitely don't recommend anyone follow this as it may not be threadsafe.

Will check out the StereoDelayer project over the next few days and see how it's properly done there, interested in how you implemented the CustomControl as well.

[CODE]

bool PluginCore::guiParameterChanged(int32_t controlID, double actualValue) {
        switch (controlID)  {
                  case controlID::Menu:
{
PresetInfo* preset = getPreset(menu));
HostMessageInfo hostMessageInfo;
hostMessageInfo.hostMessage = sendGUIUpdate;
GUIParameter param;

if (preset)
{
for (unsigned int j = 0; j < (preset->presetParameters.size() - 1) ; j++){    // -1 because if menu is the last parameter in the list, it won't be updated
  PresetParameter preParam = preset->presetParameters[j];

  param.controlID = preParam.controlID;
  param.actualValue = preParam.actualValue; hostMessageInfo.guiUpdateData.guiParameters.push_back(param);
  pluginHostConnector->sendHostMessage(hostMessageInfo);    }
    }
return true; // handled
     }

default:
break;  } return false; /// not handled
}

 [/CODE]

Cheers,

Jim

Avatar
W Pirkle
Admin
June 29, 2020 - 10:52 am
Member Since: January 29, 2017
Forum Posts: 462
sp_UserOfflineSmall Offline

Hi Jim

That will work, and it will also be thread-safe.

When you send that message to the plugin shell, it will follow its own thread-safe mechanism to change the GUI controls, using the same pattern that it uses for loading DAW presets. 

Will 

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 632

Moderators: 1

Admins: 4

Forum Stats:

Groups: 13

Forums: 40

Topics: 667

Posts: 2597

Newest Members:

VariableCook, Henry, Adekoya Adams, WillAMR, weedshop, Gennaro Schiano, HOA, sanketVxT, sem1307, djd_oz

Moderators: W Pirkle: 462

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 462