Cabbage Logo
Back to Cabbage Site

Easier way to share presets

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 :slight_smile:

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 :confused:

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 :confused:

My bad haha ^^ I found the culprit :slight_smile:
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 :smiley: 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 :slight_smile: 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 :slight_smile:

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