Cabbage Logo
Back to Cabbage Site

presetChannel in .psts file

Today I found that if I call some presets from the menu generated by

presetbutton bounds(320, 70, 110, 20) channel("presetChannel"), presetNameAsText(1) userFolder("quasi", "*.psts"), textColour(255), highlightedItemColour(10, 147, 210) highlightedTextColour(255, 255, 255), fontsize(20)

from REAPER it hangs without an error message and I can only kill REAPER from the task manager.

Comparing those .psts files causing that I found that they include

“presetChannel”: “C:\Program Files\Common Files\VST3\Cabbage\quasi\OneBar\Ngbaka-Maibo CB.psts”,

but those working properly

“presetChannel”: “”,

OK. I can fix that by editing the lines. But what sense does it make to write a full path of a .psts file into a .psts file? Wouldn’t it be better to ignore the channel?

And actually it is not the path to the file itself but to the last active .psts file before the “Save as” action.

Very similar here. (Cubase 5 / Win7)
Cubase does not crash, but somehow the wrong sounds are loaded.
Haven’t had time to test this.
That’s why I haven’t posted anything about it yet.
Saving the path of PresetChannel in the sound file for no reason seems to lead to inconsistencies somehow.
If I remember correctly, it also worked better for me when replacing ‘PresetChannel’ with an empty string.

Hi guys, thanks for the report. Does it help if you add presetIgnore(1) to the presetbutton?

I already tried this. But as mentioned in another post this only prevents the channel being shown in the DAW automation but still writes the channel/value to the psts file. But I will try the empty-channel-name-trick of @jockel.

Thanks rory for the quick response.
I tried that but it didn’t help.

I fear there is still this problem here. I wrote some minimal code to illustrate this:

New_presets_test.csd (916 Bytes)

When I run this and save a preset with both buttons on, it produces a psts file like

{
    "All_on": {
        "form": 0.0,
        "presetChannel": "",
        "not-ignored": 1.0,
        "cabbageJSONData": ""
    }
}

So it correctly does not write the channel “ignored” but does write the presetChannel although it also has a , presetIgnore(1).

Even stranger, upon generating a further preset with all buttons off it produces

{
    "All_off": {
        "form": 0.0,
        "presetChannel": "C:\\Users\\Reiner\\Documents\\OwnMusic\\Cabbage\\NPtest\\All_on.psts",
        "not-ignored": 0.0,
        "cabbageJSONData": ""
    }
}

Now with the full path of the first preset.

At the moment I am trying to weed out the lines containg “presetChannel” from the psts files. But if I forget this or a user would try to create additional presets the latter version with the full name will cause REAPER to crash.

Is there any way to get presetIgnore(1) to work also on presetbutton?

PS: I tried also @jockel’s workaround, presetbutton bounds(20, 20, 110, 20) channel(""). But that makes the presetbutton widget completely vanish for me.

Sorry for not getting back to you sooner @RZorn, I’m going to take a look at this shortly. I’ll keep you in the loop.

[edit] Can you try this sample file I usually use to test presets. NewPresets 2.csd (1.9 KB) When you launch it in reaper as a plugin, and first hit save, create a new folder called Presets in the plugin’s Content’s folder. If you save all presets into there it should work fine. I’ve not been able to crash reaper at all, and my presets seem to be working fine. One thing I noticed in this instrument is the preset button does not display the preset value when the session starts, but I think this can easily be resolved.