# Preset system : questions

**URL:** <https://forum.cabbageaudio.com/t/preset-system-questions/762>\
**Category:** Csound Noobs\
**Created:** [15 October 2017 08:42 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762 "2017-10-15T08:42:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [15 October 2017 08:42 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762/1 "2017-10-15T08:42:25Z")

</div>

Hello,  
Once you have a lot of preset files, it is difficult to remember which file corresponds to which specific properties of the cabbage instrument. Can the texteditor be used for saving a short comment about each preset properties?

As far as I understand, the preset system saves ONLY the state of widgets.  
How could I stave the status of variables ?  
The idea behind is to use less widgets. I working on a new synth using GEN 19 routine.  
For that I want 12 partials ( each of them being represented on screen by a check box member of a radiogroup).  
Each partial needs 4 parameters. I wish to make only 4 encoders and not 48 ! (Yes I am lazy)

Depending on the checkbox ticked, the encoder values would be sent to global variables corresponding to the partial number.

Code would be something like :

```
if changed:k(chnget:k("checkbox_X"))==1 then 
 if chnget:k("checkbox_X")==1 then
    ; check values of encoders and store them into gVariable for partialX
 endif
endif
if changed:k(chnget:k("checkbox_Y"))==1 then 
 if chnget:k("checkbox_Y")==1 then
    ; check values of encoders and store them into gVariable for partialY
 endif
endif

```

But I afraid that if I save the preset, only one set of value will be saved (i;e; the last value entered into the encoders) and all the other partial will be forgotten.

---

<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:** [15 October 2017 09:31 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762/2 "2017-10-15T09:31:32Z")

</div>

You can save the states of variables to a text file in Csound. Or you could write them to a function table. Check out some of Iain’s instruments. He doesn’t use the preset system but rolls his own custom preset loading system using Csound. Iain uses macros for this. I try to avoid them at all costs.

I’d start by trying to save the values of different variables to a text file and reloading them again later. If I get a moment later between fatherly duties I’ll see if I can throw a simple example together.

---

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [15 October 2017 17:26 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762/3 "2017-10-15T17:26:30Z")

</div>

Thank you… Somehow I manage to move forward.  
Last question : how can I check if a filebutton configured save snapshot has been pressed and to get the name of the snapshot getting saved ?

---

<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:** [15 October 2017 20:14 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762/4 "2017-10-15T20:14:14Z")

</div>

Hmm, that may involve some trickery. Let me think about it. You can used a changed opcode to see if the filebutton has been pressed. You might need to use the directory opcode to see if the directory then has more files. But don’t forget I plan to update the preset system to use a single preset file. So I might be able to add something useful when doing that.

---

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [16 October 2017 09:16 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762/5 "2017-10-16T09:16:06Z")

</div>

Somehow the changed opcode does not respond when filebutton is set to snapshot mode :  
`if changed:k(chnget:S("filebutton")) == 1 then` does not give any signal and `if changed:k(chnget:k("filebutton")) == 1 then` give an error :

```
 INIT ERROR in instr 2: channel already exists with incompatible type
#k0	chnget.k	"filebutton"
```

---

<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 October 2017 19:03 UTC](https://forum.cabbageaudio.com/t/preset-system-questions/762/6 "2017-10-16T19:03:50Z")

</div>

Right you are. I’ve updated the sources so that a filebutton set to “snapshot” mode will now send the name of the most recent snapped file to its associated channel. Rebuild and give it a whirl.
