

Hi Marc.Â
Is your DAW already allowing you to save presets or are you looking to implement a custom method? I've just implemented something of a preset manager. Based off that, this is what I would recommend.
Create/update a text file with the address of all the samples you want stored on separate lines.
Create a parameter to select the current sample so the DAW can save/recall that state.
On initialization and "PluginCore::guiParameterChanged" - open the text file, iterate through to the correct line based off the parameter state, get the path, close the text file, load the sample.
You might then want to add some options to add to/overwrite to that list which is possible.
Maybe add some code after your 'load sample' parameter to auto-update the text file at the current parameter position.
It's possible to create a menu list that will display/load items from that text file as well.Â
I use this code to get to the Appdata folder on any Windows computer. Think it makes sense to store there.
char out[MAX_PATH];Â Â ///https://stackoverflow.com/questions/36049010/how-to-get-appdata-path-as-stdstring
(SHGetSpecialFolderPathA(NULL, out, CSIDL_APPDATA, 0)); // //WIN ONLYÂ
Using -iostream- an -fstream- for all of that, it's well documented. The above code also needs a shlobj.h include.
Â
Hope anything there helps,
Jim


Hi Jim.
This is funny, because I was thinking of doing exactly the same thing before I read your post: writing a text file with all the path informations. AppData is also my choice for Windows, and /Users/<my user>/Library/Application\ Support/<my company>/Presets_for_myPlugin.txt for Mac.
I was wondering if it was easy to extend the normal preset-writing/reading so that the paths are in it. I did it in VST2.4, remembering that it was not trivial.
The advantages of writing a text file:
- you can edit it later
- you can save a whole bunch of presets, a bank, which is not possible in Audio Units
Now I will look if I can use the command from the DAW to trigger this. I think that should be easy.
Thank you,
Marc
Hey Marc,
Thanks for responding with the mac code. I'm still using win7 but plan to branch out soon.
I'm not entirely sure if what you had would be possible with a normal .VST3preset file. I use Ableton 10 which currently doesn't handle them well, and Reaper which just goes with it's own format. So I figured it'd be easiest to not bother with it/roll my own.
PluginCore::guiParameterChanged is a very powerful place to do most of the text and parameter updating stuff. Happy to provide any additional help there.Â
Cheers,
Jim
Hey guys I am coming back online now that all of the SynthLab stuff is done and ready for the book to be in print (should be a few days from now).
One thing I build into the PluginParameter object from day 1 was the ability to store additional information in a Parameter object (this came from something similar in VSTGUI that was very flaky to get to work). These are called "Aux Parameter Attributes" and I use them all the time for GUI customization, but they can also be used for storing tect strings.Â
See:
http://aspikplugins.com/sdkdoc.....873bc06ece
There is also a setAuxAttribute( ) method.
In a nutshell, you can automatically store a wide variety of common datatypes, see:
http://aspikplugins.com/sdkdoc.....ibute.html
In addition, I added the ability to get/set a void* allowing you to cloak many things and store/retrieve them via void pointer cloaking and un-cloaking. You could, for instance, store an additional text string this way, such as a path.Â
WillÂ


marclingk said
Hi Jim.This is funny, because I was thinking of doing exactly the same thing before I read your post: writing a text file with all the path informations. AppData is also my choice for Windows, and /Users//Library/Application\ Support//Presets_for_myPlugin.txt for Mac.
I was wondering if it was easy to extend the normal preset-writing/reading so that the paths are in it. I did it in VST2.4, remembering that it was not trivial.
The advantages of writing a text file:
- you can edit it later
- you can save a whole bunch of presets, a bank, which is not possible in Audio Units
Now I will look if I can use the command from the DAW to trigger this. I think that should be easy.
Thank you,
Marc
jim said
Hi Marc.ÂIs your DAW already allowing you to save presets or are you looking to implement a custom method? I've just implemented something of a preset manager. Based off that, this is what I would recommend.
Create/update a text file with the address of all the samples you want stored on separate lines.
Create a parameter to select the current sample so the DAW can save/recall that state.
On initialization and "PluginCore::guiParameterChanged" - open the text file, iterate through to the correct line based off the parameter state, get the path, close the text file, load the sample.
You might then want to add some options to add to/overwrite to that list which is possible.
Maybe add some code after your 'load sample' parameter to auto-update the text file at the current parameter position.
It's possible to create a menu list that will display/load items from that text file as well.Â
I use this code to get to the Appdata folder on any Windows computer. Think it makes sense to store there.
char out[MAX_PATH];Â Â ///https://stackoverflow.com/questions/36049010/how-to-get-appdata-path-as-stdstring
(SHGetSpecialFolderPathA(NULL, out, CSIDL_APPDATA, 0)); // //WIN ONLYÂUsing -iostream- an -fstream- for all of that, it's well documented. The above code also needs a shlobj.h include.
Â
Hope anything there helps,
Jim
jim said
Hi Marc.ÂIs your DAW already allowing you to save presets or are you looking to implement a custom method? I've just implemented something of a preset manager. Based off that, this is what I would recommend.
Create/update a text file with the address of all the samples you want stored on separate lines.
Create a parameter to select the current sample so the DAW can save/recall that state.
On initialization and "PluginCore::guiParameterChanged" - open the text file, iterate through to the correct line based off the parameter state, get the path, close the text file, load the sample.
You might then want to add some options to add to/overwrite to that list which is possible.
Maybe add some code after your 'load sample' parameter to auto-update the text file at the current parameter position.
It's possible to create a menu list that will display/load items from that text file as well.Â
I use this code to get to the Appdata folder on any Windows computer. Think it makes sense to store there.
char out[MAX_PATH];Â Â ///https://stackoverflow.com/questions/36049010/how-to-get-appdata-path-as-stdstring
(SHGetSpecialFolderPathA(NULL, out, CSIDL_APPDATA, 0)); // //WIN ONLYÂUsing -iostream- an -fstream- for all of that, it's well documented. The above code also needs a shlobj.h include.
Â
Hope anything there helps,
Jim
jim said
Hi Marc.ÂIs your DAW already allowing you to save presets or are you looking to implement a custom method? I've just implemented something of a preset manager. Based off that, this is what I would recommend.
Create/update a text file with the address of all the samples you want stored on separate lines.
Create a parameter to select the current sample so the DAW can save/recall that state.
On initialization and "PluginCore::guiParameterChanged" - open the text file, iterate through to the correct line based off the parameter state, get the path, close the text file, load the sample.
You might then want to add some options to add to/overwrite to that list which is possible.
Maybe add some code after your 'load sample' parameter to auto-update the text file at the current parameter position.
It's possible to create a menu list that will display/load items from that text file as well.Â
I use this code to get to the Appdata folder on any Windows computer. Think it makes sense to store there.
char out[MAX_PATH];Â Â ///https://stackoverflow.com/questions/36049010/how-to-get-appdata-path-as-stdstring
(SHGetSpecialFolderPathA(NULL, out, CSIDL_APPDATA, 0)); // //WIN ONLYÂUsing -iostream- an -fstream- for all of that, it's well documented. The above code also needs a shlobj.h include.
Â
Hope anything there helps,
Jim
jim said
Hi Marc.ÂIs your DAW already allowing you to save presets or are you looking to implement a custom method? I've just implemented something of a preset manager. Based off that, this is what I would recommend.
Create/update a text file with the address of all the samples you want stored on separate lines.
Create a parameter to select the current sample so the DAW can save/recall that state.
On initialization and "PluginCore::guiParameterChanged" - open the text file, iterate through to the correct line based off the parameter state, get the path, close the text file, load the sample.
You might then want to add some options to add to/overwrite to that list which is possible.
Maybe add some code after your 'load sample' parameter to auto-update the text file at the current parameter position.
It's possible to create a menu list that will display/load items from that text file as well.Â
I use this code to get to the Appdata folder on any Windows computer. Think it makes sense to store there.
char out[MAX_PATH];Â Â ///https://stackoverflow.com/questions/36049010/how-to-get-appdata-path-as-stdstring
(SHGetSpecialFolderPathA(NULL, out, CSIDL_APPDATA, 0)); // //WIN ONLYÂUsing -iostream- an -fstream- for all of that, it's well documented. The above code also needs a shlobj.h include.
Â
Hope anything there helps,
Jim
Hi Jim, after all I came to the solution to write my own CSV file to save all the presets. For a more elegant solution I wasn't clever enough.
Thanks for your effort and hav a nice day!
Marc
Most Users Ever Online: 294
Currently Online:
4 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Chaes: 56
Skyler: 48
StevieD: 46
Derek: 46
Frodson: 45
Peter: 43
TheSmile: 43
Nickolai: 43
clau_ste: 39
jeanlecode: 37
Member Stats:
Guest Posters: 2
Members: 795
Moderators: 1
Admins: 6
Forum Stats:
Groups: 13
Forums: 42
Topics: 862
Posts: 3400
Newest Members:
AP, Liv, Wojciech Jakóbczyk, markb, marcTark, Jon_1, John Thursday, JK, kyrandian, F_MarchalModerators: W Pirkle: 706