Cabbage Logo
Back to Cabbage Site

Solution for user-made presets?

Could you add an invisible item and set it as the selected one as soon as you start editing values?
So you could click on the item you are modifying to go back to its original state. (Forgive me if this suggestion is b*******t)

That might work but would be quite a hack. The preset system is frail enough as it is :rofl:

Having to select another preset and then back again isn’t the world worst solution, albeit a little cumbersome. Leave it with me. I’m just I’m not the only JUCE developers that has encountered this problem. I’ll have a look over the forums.

1 Like

I had another look at this, and a some time spent browsing posts to the JUCE list got me the solution. I’ll push it and trigger a new build when I get a chance. I just want to tidy up some other things first. :+1:

1 Like

Don’t hurry. I did not know that there is something like JUCE behind the scenes. And as I said, it is more a ‘nice to have’.

In ToneZ I made a “Reload” button, when you click on it it will Reload the preset to the state saved in the file
I don’t remember if it is in the preset manager I provided but it is definitely in ToneZ

The latest beta that is currently cooking allows users to reselect an item, at which point it will return the state back to how it was before editing. It will be available here once it’s done. Let me know how it goes. :+1:

I fear there is still a bug in the save mechanism if one overwrites a preset:

https://drive.google.com/file/d/1AjcKPW6Wi_Bgsp8o4RLRaP_lHOPHDJm1/view?usp=sharing

I loaded the preset “e-piano” then I changed the sustain (just to create a difference) and saved it under the same name. Then the combobox jumps to the last preset, “organ”. Selecting “e-piano” again shows that it did the save/overwrite correctly just did not stay with that preset.

Thanks. I was sure there might be some teething issues with this!

I think I know what is going on here. In the previous system jumping to the last preset made sense as the last preset was always the most recent one. Thanks, I’ll take a look today and hopefully find a fix.

That’s fixed now. You can grab the latest build when it’s done. Let me know :wink:

I will try it out. Does the build also include the stack dump mentioned in the other post Hello Cabbage falls very often. Any suggestion? ?

No, I posted that to the other thread. Note that the stack dump version doesn’t have the fix for the presets. Actually, the latest dev build does have a stack dump on exit, but as it’s a release build I’m not sure how much info it will produce for us.

Okey, so I’m trying to collect the save and remove button into one combobox, but when doing a chnget on the preset buttons I get this error:

PERF ERROR in instr 8 (opcode chnget.k) line 599: chnget.k: not initialised
from file C:\Program Files (x86)\VstPlugins\Graindrop Beta\Graindrop Beta v1.4.csd (1)
kRemove chnget.k “RemoveButton”
note aborted

Any way around this?

Can you send me a simplified .csd illustrating the the problem?

Something like this
PresetsNamedButtons.csd (1.2 KB)

kMenuTrigger chnget "Combobox"   
kSave chnget "SaveButton"
kRemove chnget "RemoveButton"

     if changed:k(kMenuTrigger) == 1 then  
            if (kMenuTrigger == 1) then
                kSave = 1
            if (kMenuTrigger == 2) then
                kRemove = 1
else
kSave = 0
kRemove = 0

Something like this with the combobox

filebuttons send info on string channels, not k-channels. Try

SRemove chnget ...

Although I’m not sure that helps you? I have to run, but I’ll check back in later…

Will test :+1:
Edit: Ah right, it’s a filebutton and not a normal button, noticed now
Edit 2: Hmm, can’t make it trigger…

Sorry, I didn’t quite have time to look at what you are trying to do. When you use a filebutton in preset mode it doesn’t send any channel data. But there is no good reason for it not to. It just never came up before. Let me take a look…

1 Like

Ok, new build is just underway. You should now be able to grab the name of the newly created and deleted presets from their respective channels.

instr 1

kValue init 0
SSave chnget "SaveButton"
if changed:k(SSave) == 1 then
    kValue randi 200, 200
    printk2 kValue
endif 

endin
1 Like