Cool new plug in format on the way -- CLAP
-
- Banned
- Topic Starter
- 1646 posts since 4 Aug, 2017
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4294 posts since 8 Mar, 2004 from Berlin, Germany
interesting news! let's hope, this takes off!
- KVRist
- 407 posts since 6 Apr, 2008
I was following the development over the last couple of months in anticipation of an official announcement, glad to see it's finally happening.
I have serious plans to support CLAP in the future and already playing with it. Not that I'm a relevant player in the industry by any capacity, but I'll do my best to support it's adoption, given the sad state of currently established "standards".
I already started diving into the current API spec and overall everything looks well thought-through and straight-forward.
One thing I noted and was wondering about is the number of initialization steps required to create a plugin instance and make it ready for processing audio. There is:
clap_plugin_entry->init()
clap_plugin_entry->createPlugin()
clap_plugin->init()
clap_plugin->activate()
clap_plugin->start_processing()
Any rationale why all these steps are needed? It sure would help to describe their use case in the API docs. Right now, it's not clear to my why anything beyond, say, just createPlugin() plus activate() is needed. At the very least, it might be a good idea to make some of these optional. Current reference host impl unfortunately assumes everything to be there and crashes if it isn't.
I have serious plans to support CLAP in the future and already playing with it. Not that I'm a relevant player in the industry by any capacity, but I'll do my best to support it's adoption, given the sad state of currently established "standards".
I already started diving into the current API spec and overall everything looks well thought-through and straight-forward.
One thing I noted and was wondering about is the number of initialization steps required to create a plugin instance and make it ready for processing audio. There is:
clap_plugin_entry->init()
clap_plugin_entry->createPlugin()
clap_plugin->init()
clap_plugin->activate()
clap_plugin->start_processing()
Any rationale why all these steps are needed? It sure would help to describe their use case in the API docs. Right now, it's not clear to my why anything beyond, say, just createPlugin() plus activate() is needed. At the very least, it might be a good idea to make some of these optional. Current reference host impl unfortunately assumes everything to be there and crashes if it isn't.
- u-he
- 28108 posts since 8 Aug, 2002 from Berlin
I'm not 100% certain, but the steps have certain meanings and useful side effects.
I'll try to explain:
After clap_plugin_entry->init() you can query the number of plug-ins and meta data. This way hosts can scan plug-ins quickly without actually instantiating them.
clap_plugin_entry->createPlugin() creates an instance. At this time it can't call the host, because the host has no pointer to the plug-in yet.
clap_plugin->init() tells it to allocate its resources, and from here on it can query the host.
clap_plugin->activate() is the point of time where sample rate, buffer size etc. are known. One can re-activate() a plug-in if the host changes those environmental variables. This happens on the user thread. We can expect further resource allocation here for buffers etc.
clap_plugin->start/stop_processing() is solely to inform the plug-in of its processing state. It may want to reset some state on start(). This happens on the audio thread, so it needs to be realtime compliant.
So the ideas behind those steps are
- one extra step to allow for fast plug-in scanning (similar to what at least one other plug-in format does)
- one (extra) step (as opposed to some formats) to prevent that a plug-in has to be unloaded/reloaded when environmental things change
- one extra step to clearly cut between user and realtime threads for plug-in processing maintenance
I'll try to explain:
After clap_plugin_entry->init() you can query the number of plug-ins and meta data. This way hosts can scan plug-ins quickly without actually instantiating them.
clap_plugin_entry->createPlugin() creates an instance. At this time it can't call the host, because the host has no pointer to the plug-in yet.
clap_plugin->init() tells it to allocate its resources, and from here on it can query the host.
clap_plugin->activate() is the point of time where sample rate, buffer size etc. are known. One can re-activate() a plug-in if the host changes those environmental variables. This happens on the user thread. We can expect further resource allocation here for buffers etc.
clap_plugin->start/stop_processing() is solely to inform the plug-in of its processing state. It may want to reset some state on start(). This happens on the audio thread, so it needs to be realtime compliant.
So the ideas behind those steps are
- one extra step to allow for fast plug-in scanning (similar to what at least one other plug-in format does)
- one (extra) step (as opposed to some formats) to prevent that a plug-in has to be unloaded/reloaded when environmental things change
- one extra step to clearly cut between user and realtime threads for plug-in processing maintenance
- KVRist
- 36 posts since 3 Sep, 2021
I don’t think it’s good idea to make an another plugin format. VST3 works well.
-
- KVRAF
- 1795 posts since 13 May, 2004 from Germany
No it doesn't.
-
- Banned
- Topic Starter
- 1646 posts since 4 Aug, 2017
Read the link at the top of the thread to discover why they are doing it.Trader One wrote: ↑Fri Dec 24, 2021 6:41 am I don’t think it’s good idea to make an another plugin format. VST3 works well.
- KVRAF
- 23115 posts since 7 Jan, 2009 from Croatia
That's a good one.
- KVRAF
- 2146 posts since 22 Sep, 2016
So how can any plugin-vendor do any plugin in VST3 if it does not work well? There's amazing plugins done in VST3. I've often learnet that if I don't like things (Pro SW Dev here, not plugins) it could be as well an OSI Layer 8 problem.
I followed the "threadpool" discussion a little and actually I think it is weird and btw. the link on gh is broken https://github.com/free-audio/clap/blob ... ead-pool.h
Why is it weird. Not plugins should be in control of threads or ask for threads and potentialy cause side-effects or suffer from side-effects of other plug-in doing weird stuff.
The DAW is the single point of truth for the processing graph and it should build the graph in a meaningfull way and map it onto resources in an optimal way because we have to deal with cache coherence and stuff.
So a plug-in should somehow contribute to the graph, but when a graph consists of per-unisono-voice chains of like the synth-unisono-voice --> a voice specific filter --> a voice specific EQ --> voice specific crusher --> voice specific compressor I wouldn't want all that spread over different threads but pack the whole chain on one thread ... but anyway ... only my two cents and why I strongly beleive in "new" is not always "better".
- u-he
- 28108 posts since 8 Aug, 2002 from Berlin
It's not draft anymore (see the "draft" in the path?). Concept is proven and reduces multithreading overhead dramatically. Just go to the head of the path and click your way through.] Peter:H [ wrote: ↑Fri Dec 24, 2021 10:17 amI followed the "threadpool" discussion a little and actually I think it is weird and btw. the link on gh is broken https://github.com/free-audio/clap/blob ... ead-pool.h
(it's still linked as draft on the gut hub main page readme, but you'll find it through the path clap/include/clap/ext/ in the sources)
Exactly. That's what it does.Not plugins should be in control of threads
- KVRAF
- 23115 posts since 7 Jan, 2009 from Croatia
It's far from a pleasant development experience dealing with VST3 SDK directly. That's what I meant.] Peter:H [ wrote: ↑Fri Dec 24, 2021 10:17 amSo how can any plugin-vendor do any plugin in VST3 if it does not work well?
VST3 is overengineered instead of simple. All the things it does could have been done in a far more efficient manner, but nope.
- u-he
- 28108 posts since 8 Aug, 2002 from Berlin
Or things that could have been done but weren't. Which slowly are added as bandaids. Which aren't supported in hosts until dog knows when...
- KVRAF
- 7954 posts since 12 Feb, 2006 from Helsinki, Finland
All that extension does is allow plugins to optionally tell the host "please process these things in parallel."] Peter:H [ wrote: ↑Fri Dec 24, 2021 10:17 am Why is it weird. Not plugins should be in control of threads or ask for threads and potentialy cause side-effects or suffer from side-effects of other plug-in doing weird stuff.
If you're the host, you benefit by having full control over multi-threading. If you're a plugin, you benefit by being able to take advantage of multi-threading without having to manage your own threads. If you're a plugin that couldn't care less about multi-threading, you benefit by having less threads compete for CPU resources and trashing your caches. If you're the user, you benefit from having better (and almost certainly more predictable) performance.
In other words, it's a pure win-win-win for everyone over the status quo.
- KVRAF
- 1748 posts since 2 Jul, 2018
We plan to support the new format (CLAP) and will collaborate. It's open-source, it's simple, it's free for all and there are no unfair licensing conditions.
We Indy developers should have been getting rid of Steinberg and Apple already a decade ago.
We Indy developers should have been getting rid of Steinberg and Apple already a decade ago.