-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Compressor effect: Adjust Makeup Time constant #13237
Comments
@daschuer Could you explain in more details, what you would like to have? Do you want to change
Yes, I considered it, but the problem is that this auto make up algorithm is too simple. It doesn't have separate attack and release time, it has just "generic" coefficient. If I connect it to attack time, for example, someone may be surprised, that changing attack time has influence to make up gain. Moreover, it's fine to use fast attack time (~0.05ms) and slow release time (~250ms) for dance-pop songs, but I definitely don't want to use such fast attack time for auto make up algorithm, because it will lead to crackling. Eventually I decided to leave this auto make up algorithm as simple as it is, and create another effect called "Auto Gain Control" in order to control gain more precisely. It will have it's own attack and release time and some other stuff. What do you think about it? |
Since auto makeup it "auto", it should maintain roughly the same sound when enabled, IMHO without making the user to think about it. I have tested a bit more and I must admit that my conclusion when writing the bug was probably not perfect. One issue is that the makeup gain will introduce unwanted noise, because the gain is not ramped here:
The calculation of the makeUp can be optimized by sqrtf(sumSquared/sumSquared) Can you introduce a PR for that? The other issue is the buffer dependency, This could be solve by always building the RMS value for the same number of samples. Not sure if this is worth the effort, or if we find a smarter solution. Need to test. |
Wait, this
|
All buffers needs to be cleared when enabling this effect, to not apply values form a previous use:
|
Yes, it's how it works now: it maintains output gain the same as input gain.
Indeed, you're right
I guess the buffer size is always the same unless we don't change sample rate, isn't it?
I don't understand it. Why do you think samples are the same?
|
We done even change the sample rate at this point. However the user might configure a different buffers size and sample rate in the hardware preferences. In this case, the Compressor effect should still sound the same or at least similar.
You need to collect the calculated gain from the compressor stage in a buffer and then calc the rms from it (not from the samples).
But how make it buffer size independent?
|
Ok, I got it. I think we can easily fix it by calculating make up attack coeff from buffer size and sample rate. As I understand the buffer size is
oh, eventually I got it. So you suggest not to apply calculated gain to the buffer immediately, but firstly calculate make up from it, secondly apply make up to calculated gains, and finally apply these gains to the input buffer. It's not the same algorithm that I used, but I think it should work too. I need some time to implement it, I'll take a look.
I don't think it's so important to make it buffer size independent. As long as we calculate make up coeff from buffer size and sample rate, it will be good enough. |
Yes.
I have no strong demand. Consider how this matches to the other topic of buffer independence.
I agree. There should be no significant different sound at least. Can you also add your reasoning for the picked markup timing as comment? |
Yes, sure. I've done several fixes, which were discussed here. You can see it in #13261 |
Bug Description
The Compressor introduced in #12523
Use the input RMS value to generate a makeup gain. This is required to allow fading and outros.
Unfortunately this value does not scale with the compressor timing nor the engine buffer.
Version
2.5~alpha
OS
No response
The text was updated successfully, but these errors were encountered: