As per VCV Manual - Module Presets if I put presets into the plugins root directory they show up in the program.
But as far as I can tell, having the presets folder in the plugin repository alongside the res folder doesn’t have them packaged into the vcvplugin archive.
Do I need to locate them somewhere else, or is this just an omission from the make file?
When I look at the dist directory the preset files are in <myplugin>/presets/<mymodule>. And I see the same thing in the .vcvplugin tar file.
Right now when I build and quickly iterate I am just copying the .vcvplugin file to Rack2/plugins, and then that gets unpacked when I run VCVRack. But the preset files are not seen as factory presets (or as a default / template (for the one named template.vcvm).
If I hand copy the files to the Rack2/presets/<myplugin>/<mymodule> directory then I can see them from the preset submenu. Other plugins (e.g. Fundamental) just have the presets under the <myplugin>/presets/<mymodule>. And the presets are seen from the preset menu without issue. Mine looks the same (to me), but they are not visible?
I am not sure what you are asking. The directories are the name of the plugin and the module. They are both mixed case. The presets directory is all lowercase. There are no spaces - leading, trailing or otherwise. The file extension is .vcvm - all lowercase. The files are unpacked and placed in the Rack2/plugins/<myplugin>/presets/<mymodule>.
When using the menu to save a preset they are written to a different directory - Rack2/presets/<myplugin>/<mymodule>. Simply moving or copying the .vcvm file makes it visible, but not as a factory preset.
K. Had to push the latest changes (which I will caveat as not being ready for prime time since I don’t actually have it working as desired (and hence this discuss)). And none of this has ever been seen by the public - so it is still mostly a learning exercise. That said, you can find everything at:
Also attached is an image (it wouldn’t let me upload a .pml or .csv file) of the the procman file events when preset menu is opened (though I fear this forum has reduced the quality of the image). You can see it scanning the ./Rack2/presets/<myplugin>/<mymodule> directory and finding nothing. Then you can see it scanning ./Rack2/plugins/<myplugin>/presets/<mymodule> where it finds two files. One is added to the user presets. The template file is ignored.
My makefile reads the svg sources from ./src/res and then uses inkscape to convert all the fonts to paths and then places the .svg files in the ./res directory. (there is a comment in the Makefile to that effect).
I am guessing the clone has messed with the timestamps. try touching all the ./res/*.svg files and that will trick make into thinking they are all up to date and skip the need for inkscape.
I think I am that far too. What I can’t get is the template file to be recognized. As such, there is only one hardcoded scale. I want that template file saved to ./Rack2/presets/… I am not sure how to make that automagic when then the plugin is “installed”.
And it is dicey trying to do it yourself because the user may explicitly clear the defaults
One the constructor thing, if the intentionally clears the default (one of the preset menu options). I would likely end up replacing the file on the next construction. I would need a callback for the clear default to build the logic to not copy when the user explicitly deletes.
For default values that can be overriden by the user, I would hard-code the initial values into the module and I would only write out a defaults-file when the user changes and saves the default settings.