Presets don't get packaged into the dist?

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?

Add

DISTRIBUTABLES += presets

to your Makefile. I’ve added this reminder to VCV Manual - Module Presets

2 Likes

Thanks Andrew

I am having similar issues. I had

DISTRIBUTABLES += ($wildcard presets)

Then I read this and changed to the

DISTRIBUTABLES += presets

Both do the same thing when I make dist

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?

Ideas? Suggestions of what to look at?

Have you checked upper/lower case in or is there any leading/trailing whitespace?

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.

Do you have your sources on GitHub, so I could download and compile to see what’s going on?

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:

https://github.com/zachwieja/2LiftStudios.git

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.

If I hand copy the template file to the first scanned directory, then it is successfully recognized as the defaults.

Thanks for your effort.

Your makefile gives the following error, so I can’t run make dist successfully:

make: /c/program files/inkscape/bin/inkscape.exe: No such file or directory
make: *** [Makefile:44: res/Merge.svg] Error 127

I commented out everything related to svg and could run make dist and got the following result:

So it seems to work on my Windows 10 machine with Rack v2.1.2.

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

It is not possible to use the installer/unpacker for copying files to anywhere outside of your plugin directory.

But you could write some code inside your module constructor to do the job.

Sure. Thanks for your help.

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.