Hi Rory,
Would it be possible to change/add options for the users to manage presets ?
The .snap used currently would act as a preset database for the user
- an EXPORT option would allow the user to export the current preset (into a new kind of file which would only contains one preset actually)
- an IMPORT option would open a file browser where the user can select a single-preset file to add into his database
(what that would do is append the imported preset at the end of his .snap file)
- a RENAME option to rename the current preset
- a SAVE option to save the state of the synth in the .snap (like it works currently)
- a DELETE option to remove a preset from the user database (removing it from the XML file actually)
Then, users will be able to EXPORT their preset, to share them, and other will be able to IMPORT them easily.
Hope this will help making the best preset system possible 
Leave this with me. I agree that a way to easily share presets is needed. Iām currently a little swamped with work, but will try to get around to this soon.
1 Like
Thanks a lot Rory ! Make sure to let me know when itās done and if I can help with anything, let me know too !
This is the last thing that holds me to release my first EDM synthesizer ! But Iāll wait, as I prefer to release finished stuff.
Iāve added a way to name presets now. Just change the filebutton mode parameter to ānamed snapshotsā. But itās still not offering the flexibility you are looking for. I think in your case you might be as well to develop your own custom preset system. That way you can have it behave in any way you wish.
I throw together a simple example for you that uses Csound to read and write presets to disk. Itās a little cumbersome, but in the end you get the preset system that you want. Let me know if this is something you can work with. I set the extension to .pres but you can set it to whatever you like. You should also probably check that the file users try to open also contains that extension. You can use strindex for this.
presetTest.csd (1.9 KB)
1 Like
Thanks a lot ! That seems perfect, but when I try to save a preset, Cabbage stops working 
Thatās odd, I tested it before I posted it. Did you try to bring it into your instrument or are you just trying to use the example I posted?
Iām just trying to use the example you provided, when the file explorer shows, I put a name ans save, and then, Cabbage window became blurry with the message that the program stops working
Where are you trying to save them to? Iām wondering if itās a permission issue? I just tried again here and Iāve no issues. Also, can you try commenting out the contents of the save file instrument and see if taht gets you past the issue. At least we might narrow down where the problem is.
Alright, it was my Csound version, not up to date, so I can successfully save a preset file that way, but when I open it, it doesnāt restore the state of the synth 
My bad haha ^^ I found the culprit 
chnset i1, "att" chnset i1, "dec" chnset i1, "sus" chnset i1, "rel"
When I correct that to
chnset i1, "att" chnset i2, "dec" chnset i3, "sus" chnset i4, "rel"
It works perfectly
Sure Iāll have to save lots and lotās of variables, but as it works perfectly I wonāt complain!
Thanks a lot for providing this nice workaround ! If there wasnāt the VST issue, my synth would have be finished!
Glad you got it to work. Itās a bit of coding, but ultimately you gain more control this way. I think the new mechanism for setting presets names when saving is a good addition, so thanks for prompting that.
I wouldnāt be too concerned about the VST issue. I think this move from Steinberg is more an attempt to get the big fish to move on from VST2.4 and embrace VST3. If I was you I would release your synth anyway. I will try to get a new Windows build done in the next day or so. You probably have enough work to be doing with your new preset system in the meantime!
1 Like
Hey Rory, Iām noticed a weird behaviour of this trigger
if changed:k(chnget:S("openFile")) == 1 then
If I try to open the same preset (letās say, after tweaking the synth I want to reload the preset)
I put a prinks to debug and it seems like if I try to load the same file 2 times in a row, the trigger is not triggered
Could you please have a look ?
Thanks in advance,
That makes sense because youāre not changing the name of the file. In that case it would probably be best to add an update button that will overwrite the previous file without opening a file dialogue?
It hardly makes sense to keep showing the dialogue even when the filename remains the same?
Yes
I added a āreloadā button, that reset the preset to itās original state, thanks for the tips !
Hey Rory, I managed to add a listbox that lists all the .pres files in a folder, so you can click to load them. (Like when using snaps but the .pres are easier to share)
So now, I just need a refresh button to re-populate the list box when the user saves a new preset
Is there a way to trigger that repopulation ? (Without closing the plug-in)
Thanks in advance,
Iāll take a look. Did you try using an identchannel and sending a populate() identifier to Cabbage from Csound? I canāt recall if support for updating a file list is there, but if itās not Iāll add it.
1 Like
I tried sending a populate the the box (identchannel(āboxlā))
chnset āpopulate(ā*.press",āpresetsā)",āboxIā
But because of the quotes I canāt do that without an error.
Alright, Let me know if that was not implemented !
Try:
populate(\"*.press\",\"presets\")","boxI"
You need a \ before each quote that appears as part of the string.
You neednāt bother testing that, it donāt work. But Iāve added a way of doing it. Iāll post a few more details once I get around to building a test version for Windows. That VST2 thing messed up all my automated builds.
Yeah, no more error but it doesnāt work as you said.
But thanks for the backslash tip 
Alright, Iāll try again when you will release the new binary !
Thanks a lot !
I found an other issue :
With the code you provided above :
If I save a preset and then load it right after, nothing happens.
So then I try to re-run the plugin in Cabbage and it results in a freeze
Do you notice the same behaviour ?
EDIT : I tried also in LMMS after exporting, and the same, LMMS freezes