Closed baconpaul closed 1 year ago
Just FYI when you read this in the morning @abique - since a lot went by on discord
To make surge meet this optional spec makes a bit of a mess in the way juce wraps a clap and would be super inefficient but I made it work. If they were mandatory, i could instead just skip those malformed events with a null cookie and be a to-spec plugin.
I think the host should be encouraged to provide the cookie if it can do better than N hash map lookup, with N being the number of events addressing parameters. Otherwise there is no benefit in passing the cookie, the plugin may as well do the resolution.
In Bitwig, once we did scan the parameters, we build an array with all the cached parameters info and internally work with param index, so we get immediate access to the cookie, therefore the optimization works.
I'm 100% convinced that the cookie must not be mandatory and the explanation is short:
The scenario is a device in which the user would manually enter the GUI a parameter id and amplitude, and then the device would generate parameter modulation events which would be merged into the event stream. This device can't know the cookie, and the host providing the event stream may not be aware of plugin parameters.
CLAP needs to be working for all, for a very long time and prove to be flexible enough to work in situations we did not even think of. Making the cookie mandatory reduces the flexibility, and may make CLAP inappropriate for certain things.
I have updated the juce wrappers and also updated surge to support null cookies.
The validator now also explicitly zeroes out the cookies in one of its test cases: https://github.com/robbert-vdh/clap-validator/commit/ba9564ce04f688fa3f21ed1b1033cce8155e68b8
I'll merge this on Friday unless anyone comes with strong arguments against it.
I mean you know my arguments against it :)
But we have to pick one. So that's fine with me.
Clarify Cookie Optionality. The documentation was ambiguous as to whether hosts can choose to ignore the plugin cookie. This change documents the fact that they can, and the plugin must react accordingly