-
Notifications
You must be signed in to change notification settings - Fork 104
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
adding ext/draft/gain-reduction.h #440
base: next
Are you sure you want to change the base?
Conversation
typedef struct clap_plugin_gain_reduction { | ||
// reports the current gain reduction in dB. the value is intended | ||
// for informational display only, for example in a host meter or tooltip. | ||
double(CLAP_ABI *current_gain_reduction_db)(const clap_plugin_t *plugin); |
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.
Is it called on the audio thread after the process call?
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 think either a main thread only or audio thread only model is reasonable, but my suggestion would be to explicitly document it as threadsafe. The processing time associated with the returned value is whatever the plugin thinks "current" means.
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.
Probably best to document as well that the returned value is negative if the gain is reduced. Note that as written, this extension is essentially a copy of https://github.com/fenderdigital/presonus-plugin-extensions/blob/main/ipslgainreduction.h.
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 believe that the logical place to query that value is after the process call (audio-thread). Then the host can carry the value to its GUI itself.
You should add that this interface should only be implemented if the gain reduction is relevant for this plugin.
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 about renaming current_gain_reduction_db()
to simply get()
?
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.
You may want to mention that while the plugin isn't processing, the value can be assumed to be 0.
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 agree that stereo gain reduction is probably not important, we can keep it mono and see if anyone complains.
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.
Should we name the extension clap_plugin_gain_reduction_feedback
? 🤔
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 think the extension name is fine, but if you want to change it, I would suggest clap_plugin_gain_reduction_reporting rather than _feedback.
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 also think the extension name is fine.
Should there be a fixed min/max dB value defined in a comment so that it is clear for the host what the min range needs to be in the case of drawing a gain reduction meter? |
If a plugin can change its type dynamically (e.g. if it is a compressor or an eq), should there be a mechanism to report that to the host? |
I don’t think that’s necessary. The plugin is either applying gain reduction or it’s not.
|
Basic extension for plugin to report gain reduction to the host.