VST 2.4: DAW undo and read-only program banks

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hello,

I'm working on a tiny plugin framework and I'm looking for some advise with regards to VST 2.4 programs/preset handling and DAW undo.

I initially implemented it so that the plugin's bank of presets/programs, as changed by the user, is stored/restored together with the current plugin state in the save-chunk. This is working fine.

I then changed my mind and decided that I wanted 'read-only' completely fixed presets instead of a programmable bank.

I first tried the lazy option and simply ignored changes to bank parameters in setParameter and chunk serialisation. This breaks DAW undo after a preset change. So I went back to temporarily storing changes to the bank in setParameter, but ignoring those changes when saving the state.

This is kind of the worst of both worlds.

I get DAW undo, but only for the current session.
My bank returns to its defaults, but only after reloading the project.

Is there a clean way of having a completely fixed bank AND preserving undo with VST 2.4? One that doesn't add a big fat 'reset programs to default' button?

Thanks!

Post

The way VST2 presets are supposed to work is that the "current preset" is really just an index into the bank and it's the preset in the bank that is modified whenever whatever parameter is changed. One can obviously implement this by keeping the current preset separately and then storing the current preset into it's relevant slot whenever the preset is changed, but ... as far as the API is concerned, if the first preset is currently selected then there is no distinction between preset 1 and the current state. Trying to do something else will almost certainly break stuff in some DAW somewhere beyond just undo. DAWs can do things like repeatedly iterate "setProgram" through all programs just to read the preset names or parameters or whatever.

Since this is not really how most modern plugins want to handle presets (rather they usually treat presets more like "files" that are saved and loaded explicitly), most modern plugins just ignore the VST2 preset management completely by advertising a bank of one "preset" and then just implementing whatever preset management they want in their own GUI (eg. some sort of preset browser and a button to save.. or something).

Post

Thanks!

After reading your reply, particularly "repeatedly iterate setProgram through all programs", and some additional research and thought, I gave up on read-only banks. I'll just add a big 'reset bank' button for now.

Post Reply

Return to “DSP and Plugin Development”