-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Preset Discovery #265
Conversation
Curious why the preset stuff isn’t in an extension and is in the top clap directory? |
Because it is not part of the plugin instance. You don't need a plugin instance to index the presets. On the other hand, yes it could go in |
I beg to differ :) Presets are different in connected hardwares. At least, the plugin instance should probably provide additional per instance presets. |
Then we'd need a preset bank extension right? But in a way it isn't trivial to index because it means:
So somehow we'd need to model "connectable" or "dynamically available" content into our browser. I think it opens many questions which aren't trivial. |
This would be a similar, but different extension for the plugin, I guess. And it is an edge case, indeed. |
// Create a preset provider by its id. | ||
// The returned pointer must be freed by calling preset_provider->destroy(preset_provider); | ||
// The preset provider is not allowed to use the indexer callbacks in the create method. | ||
// Returns null in case of error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the 'indexer callbacks'? clap_preset_indexer_t doesn't have any functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now it doesn't have, maybe it could have some I'm not sure yet.
So one of my synths has entirely in-memory presets. How would you index those without an instance? I guess I would have a clap which makes a factor which makes and discards an instance? Also the JUCE Preset API is entirely instance based. I am not sure if I will be able to adapt it to this (other than doing the create-and-discard trick). And there's no requirement JUCE presets are on file system. So I guess: Are we implicitly requiring the idea of "one physical on disk file per preset" here? |
Or another way to ask it: is there any requirement at all that the contents of the |
(what I'm thinking is: if |
If the preset are in-memory and per-instance we don't index them, what would be the point? |
Yes, because we list the filesystem and then do find the preset files by extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this yesterday and @baconpaul also mentioned it in this PR before the discussion kind of diverged into JUCE implementation details, but I do think having some form of shorthand to expose presets embedded into the plugin itself (which is extremely common) would be immensely useful. The suggestion was that you'd just use your plugin's .clap
file as the preset location, but that adds complexity and potential for making mistakes on the plugin's side. Since this is such a common use case, I propose adding adding a string constant for the location that indicates 'this CLAP file', like $PLUGIN
or %PLUGIN%
. Or URIs as previously mentioned, where file:///path/to/files
refers to the /path/to/files
directory, plugin:///
refers to the .clap
file, and plugin:///foo
could refer to a foo
bank inside of the plugin's file (if that's useful to support). Neither approach requires the interface to be changed, and they're both unambiguous when dealing with regular file paths versus presets stored within this .clap file.
The second matter was informing the host that a preset has been added, removed, or modified. Creating a temporary file for the host to watch and touching it when these things happen works. I wonder if there's a nicer API for this though, couldn't we just have a clap_host_preset_discovery_context
or something like that with a callback and a method on the factory to set that context object? That would make rescanning based on triggers from the pluin a lot more robust and easier to implement in a cross platform way.
I think the |
Programs are out of the scope for this extension. CLAP doesn't have a program/bank management extension yet. |
OK then I mis-understood the extension. And no JUCE, iPlug, DISTRHO etc plugin will generate a scannable preset list using their in-framework API for programs. Gotcha. |
I clarify something:
I don't think that the plugin can solve this for the indexer. Also there is no "plugin daemon / service" which is running all the time. And plugins aren't a single instance thing either. |
IMHO the strict focus on files annoys me a bit. Files come with all kind of implications that make such a library complicated (paths, user privileges, UTF8 characters). I am also not a big fan of "tags" like "Woodwind".. this is the kind of library stuff that didn't work for other hosts, too. |
What do you suggest then? Regarding the indexing, it is not a problem to have a lot of information, the daw can always decide to show "less" or to organize the presets in a more minimal way. |
The easiest solution is to be silent on the keywords. The second easiest is to be incomplete. The hardest is to be relatively comprehensive But the first and third are often better than the second. I wonder why we need to define any categories at all? |
But if we are going to define categories, I would at least ask @mkruselj to think about some of his experience with genres, tags, and categories and give the list a once over :) |
My suggestion would be to stay silent on the keywords, to be honest. Better don't define any if it's going to be sparse like this. |
This list isn't definitive, it can be extended. |
I've had a second thought at it and OK, I'll kill it. |
No description provided.