# Retrieving sample in soundfiler with presets

**URL:** <https://forum.cabbageaudio.com/t/retrieving-sample-in-soundfiler-with-presets/618>\
**Category:** Cabbage recipes\
**Created:** [17 July 2017 16:01 UTC](https://forum.cabbageaudio.com/t/retrieving-sample-in-soundfiler-with-presets/618 "2017-07-17T16:01:41Z")\
**Posts on this page:** 3\
**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:** [17 July 2017 16:01 UTC](https://forum.cabbageaudio.com/t/retrieving-sample-in-soundfiler-with-presets/618/1 "2017-07-17T16:01:41Z")

</div>

Hello all,

You will find attached the simplest synth based on wavshape (see adventure kid for free single cycle wavshapes) which is able to save and restore its configuration.  
It only aims at explaining how to retrieve a preset into a soundfiler… and to make some noise. (for sure it could be better coded)

Hope this helps

[SimpleSynthPreset.csd](https://forum.cabbageaudio.com/uploads/default/original/1X/1e915c2a91a7845178e5fe6d64f639971d194f44.csd) (3.5 KB)

---

<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:** [17 July 2017 17:16 UTC](https://forum.cabbageaudio.com/t/retrieving-sample-in-soundfiler-with-presets/618/2 "2017-07-17T17:16:26Z")

</div>

Thanks for posting. It seems like a good solution. Btw, are you aware that the [changed](http://csound.github.io/docs/manual/changed.html) opcode can take any number of input arguments? So I think you could save yourself some code by simply doing this?

```
gSfilepathA0	chnget	"filenameA0"
gkCombochanged chnget "PresetCombobox"
kTrg	changed	gSfilepathA0, gkCombochanged
if kTrg == 1 then ; if this trigger is 1 ...
  event	"i",101,0,0 ; call instrument to update sample storage function table 
endif
```

---

<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:** [17 July 2017 18:57 UTC](https://forum.cabbageaudio.com/t/retrieving-sample-in-soundfiler-with-presets/618/3 "2017-07-17T18:57:40Z")

</div>

Yes, indeed you are right !
