Closed p0nce closed 1 year ago
This is the same bug that "VST2 doesn't use chunks", but for LV2 (EDIT from future: no)
Solution given on the mailing list http://lists.lv2plug.in/pipermail/devel-lv2plug.in/2019-March/001919.html
Asking Modartt would probably help => waiting
David Robilla makes the very correct point that a plug-in can't upgrade chunks of normalized parameters in an arbitrary way since automation is stored by the host anyway, so there cannot be a correct upgrade in case of a major rework of a plug-in. LV2 conceptions of "meaningful" parameters + internal state is therefore a more fundamental good idea than I expected.
For Pianoteq, the JUCE LV2 wrapper from FalkTX was used.
Internal state could be used for things like: random seed, UI size, general settings.
I've discussed this with a few plug-in devs and the consensus seems to be that many use their own preset manager, and store the editor dimensions in the regular plug-in state and simply don't save/recall that when saving/loading presets from your preset manager. This means that as discussed, if a user saves/recalls presets via the host the UI will change size.
mmmmmmmmmmmm what do do
Another solution: https://forum.juce.com/t/problem-storing-and-loading-extra-plugin-info-last-editor-size-etc/50968/4 and JUCE has probably facilities to facilitate savng external config. Interesting.
I'll not that other solution use a chunk abstraction to ease serialization, and we also can do that with dplug.core.binrange.
Update 2023:
Remaining for Stage 1:
[x] Would be nice if we had
nothrow
parsing functions indplug.core.binrange
, in the wake of WebAssembly and exceptions being difficult => done in Dplug v14[x]
makeDefaultPreset()
is kinda broken since it has no state data. How to deal with that? It is necessary in VST2 I think. (EDIT: perhaps snapshot the default state?)[x] Rename
getSaveState
to a better name, I tend to mixe up the two of them. The opposite of "save" is "load". =>stateState
after an identifier shoutout 3 vs 0, also is given a reused growable buffer to avoid realloc issues.[x] Rename
setSaveState
to a better name. =>loadState
, also can return a parse error, constness[x] Rename futureBinState to a better name? => nope, good one
ref Vec!ubyte
for serializeState, it exist already in the context of chunk serialization and will be faster in AAX, with alloc reuse. Else it will allocate non-stop. Document the use of dplug.core.binrange in a DDoc example.[x] How do people distinguish data that belongs to a preset (such as a wavetable) from data that is global state saved somewhere that is unrelated to a preset (such as window size, dark mode, colorscheme etc...)? Obviously we don't want to change window size each time a factory preset is loaded. => Ha, exact same question in Iplug2 https://github.com/iPlug2/iPlug2/issues/117#issuecomment-880469172 => either a trick or need config file so a VFS abstrction we don't have yet.
Update 2022:
Old part of the issue below.
I complained on LV2-devel about lack of chunks.
Meanwhile on IRC: