# Easier way to share presets

**URL:** <https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223>\
**Category:** Cabbage Stew\
**Created:** [10 November 2018 17:00 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223 "2018-11-10T17:00:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [10 November 2018 17:00 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/1 "2018-11-10T17:00:40Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [11 November 2018 21:04 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/2 "2018-11-11T21:04:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [11 November 2018 21:30 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/3 "2018-11-11T21:30:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 November 2018 12:35 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/4 "2018-11-16T12:35:16Z")

</div>

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](https://forum.cabbageaudio.com/uploads/default/original/2X/f/fd9c3541149ae42a04d16c71d9f59e354a66039a.csd) (1.9 KB)

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [16 November 2018 13:15 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/5 "2018-11-16T13:15:02Z")

</div>

Thanks a lot ! That seems perfect, but when I try to save a preset, Cabbage stops working 😕

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 November 2018 13:28 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/6 "2018-11-16T13:28:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [16 November 2018 13:35 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/7 "2018-11-16T13:35:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 November 2018 14:02 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/8 "2018-11-16T14:02:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [16 November 2018 16:47 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/9 "2018-11-16T16:47:14Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 November 2018 17:05 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/10 "2018-11-16T17:05:19Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [19 November 2018 21:03 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/11 "2018-11-19T21:03:33Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [19 November 2018 21:13 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/12 "2018-11-19T21:13:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [19 November 2018 21:22 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/13 "2018-11-19T21:22:48Z")

</div>

Yes 🙂 I added a “reload” button, that reset the preset to it’s original state, thanks for the tips !

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [20 November 2018 22:43 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/14 "2018-11-20T22:43:21Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [20 November 2018 22:57 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/15 "2018-11-20T22:57:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [20 November 2018 23:07 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/16 "2018-11-20T23:07:58Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [21 November 2018 09:01 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/17 "2018-11-21T09:01:34Z")

</div>

Try:

`populate(\"*.press\",\"presets\")","boxI"`

You need a \ before each quote that appears as part of the string.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [21 November 2018 15:11 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/18 "2018-11-21T15:11:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [21 November 2018 16:35 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/19 "2018-11-21T16:35:34Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![Retornz](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/retornz/32/2714_2.png) [@Retornz](https://forum.cabbageaudio.com/u/Retornz)\
**Post date:** [24 November 2018 22:45 UTC](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223/20 "2018-11-24T22:45:19Z")

</div>

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

[Next page](https://forum.cabbageaudio.com/t/easier-way-to-share-presets/1223.md?page=2)
