-
Notifications
You must be signed in to change notification settings - Fork 259
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
strange audio distortion when using filter envelope after merging #1345 #1417
Comments
I can confirm the distortion in the sample and agree to all your points. More to #1415. |
Let me clarify a few things:
Yet, I appreciate your input Chris and will look into that when I find the time. |
I must admit the Roland Sound Canvas sample has the most clicks and cracks. And the distortion is more pronounced at around 7 seconds or so in FluidSynth 2.4 sample. My hope is that it can be fixed or at least reduced |
I started investigating this. The good thing is, that we now got several different use-cases and test data, thanks for that. I incorporated the test data into the buildsystem's unit tests. The data is available in the following directory, on the The tests can be run during build by executing Additionally, in order to get a better understanding of the filter's behavior, I created an interactive Bode plot by using Matlab. The script is also available in this directory. It let's you adjust The clicks heard in all three issues (#1415, #1424, and this one) are much more subtle and decent, compared to the artifacts I attempted to fix by #1345. I believe the distortions here (and clicks in the other two issues) are the result of the filter's phase changing rapidly, i.e. causing the frequency-dependent delay inside the filter to change. Therefore I agree with Chris' comment that the In the next days I'll attempt to implement this smoothing by using a linear interpolation of the Currently, I still believe that #1345 itself was correct. I don't see how the linear interpolation of the filter coefficients itself can preserve any state of the filter at all - the coefficients do not change in a linear way, but rather in a sinusoidal way. So yes, while there are cases where this linear interpolation of the coefficients apparently yields the desired effect (as heard in the example files posted by Chris here), it can also break stuff in a much more louder way as heard in #1345. |
Looks like:
Therefore, I think #1345 should be reverted and AWE implementation changed. There's probably a good reason for the coefficient interpolation, given that it stayed for 13 (17?) years without any issues. Reverting and fixing AWE would fix this bug (along with the one i reported) and nervous filter would be fine too. And then there's no need to interpolate the Fc or Q in ModEnv, which is not good according to Christian Collins:
|
Why are you so focused on the new AWE NRPN feature? The NRPNs just modulate the
So, what exactly makes you believe that the AWE implementation needs to be changed / reverted / fixed? Can you pls. be a bit more specific?
Preservation of tradition is not a legitimate reason. Pls. argue on a technical level. I have tried to explain that the clicks are related to the filter's changing phase whenever
I'm planning to introduce a smoothing, that is agnostic of what has caused the parameter changes. Just like the previous coefficient smoothing also was agnostic of its cause. If all that effort doesn't yield the desired effect, reverting #1345 will obviously be a last resort. |
Sorry for not being specific, I simply meant to smooth out AWE params instead of messing with the filter, for example by setting a target value when the NRPN is received and changing fc to it slowly enough for no clicks. I'm not against removing this feature (i meant reverting the PR, not AWE!), I just want to keep the filter as it was before, because it just worked and it worked perfectly. Now it does not. I hope this clears things up for you : ) |
I have applied the previous linear smoothing logic to the
I'm glad that it worked for you. I've been messing around with the filter for the past seven years using custom modulators, and I can tell you that it wasn't "perfect" and probably will never be. Yet, implementing the smoothing on NRPN-level only is not a meaningful solution. |
I can confirm that the current iir-tests branch eliminates the distortion that was introduced after the merge of #1345. |
I'm glad that we decided to keep the AWE32 NRPN support as the issue seems to be with #1345, and hope there will be no need to revert it but I guess will find out soon |
Since we now have a nice test suite in place, I would like to share some renderings, that I have created with different implementations of fluidsynth's filter. The first test renderings are created from fluidsynth's recent master (4cdd9af) which should be identical to the offical(-ly broken) 2.4.0 release: On top of that, I have applied the change of #1430 to get a bit more modulations in the fc of the AWE test files - if audible at all. Next, I'm providing renderings where I have
I cannot hear a difference between From my perception, there is a "muffled side tone / vibration" present at the beginning of We can also hear that none of the changes affects the testcase for #1427. So this will be addressed separately. Anyway, in case all of you are happy with the result, I'd make some final performance tweaks to #1432, merge it and then release a fix. |
As I have stated before, this has nothing to do with the filter itself (or the coefficients). It's just that its output is not processed by the Volume envelope when it should be. |
Yes, understood. I wanted to express that the tests prove this to be true. |
Well, I definitely hear clicks and pops in The Nervous Filter.mid with 1345 reverted so we can toss that out completely. And it is good that you applied #1430 but the effect is not very pronounced and only minor, at best. Based on what my ears hear, I agree that 1432-smooth5 has the best overall sound. 1432-smooth 8 to me, has a lower volume to my ears, but I have no clue why Also, I noticed in Uplift.mid at around 2:10 or so it plays the wrong instrument, on my Live! (and Audigy2?) it should be a synth, but in Fluidsynth it is strings, is Fluid loading bank 1 properly, or any idea what is going on here ? |
FluidSynth version
2.4 (and master)
Describe the bug
Since #1345 was merged, there is now a strange audio distortion when the filter is modulated by the modulation envelope. I created a demo MIDI file and audio renderings that should hopefully make this quite evident: filter envelope noise.zip
Inside the zip file, you will find the following files:
filter envelope noise.mid
– A MIDI file that uses the GS preset 008:038 Acid Bass featured in GeneralUser GS 2.0.1. This preset uses high filter emphasis and has both the modulation envelope and modulation LFO modulating the filter.filter envelope noise-FluidSynth 2.4.flac
– The above MIDI file rendered using the latest FluidSynth master (one commit ahead of 2.4) via FluidSynth Plugin in REAPER. You can hear a strange, grainy distortion throughout correlating to the filter being modulated by the modulation envelope.filter envelope noise-1345 reverted.flac
– Same as above but with Remove interpolation of IIR filter coefficients #1345 reverted. You can hear no more distortion. Everything sounds as it should.filter envelope noise-Roland SC8820.flac
– The above MIDI file rendered on Roland Sound Canvas VA (SC8820 model, reverb disabled). Filter popping with high Q and quick modulation is a known issue with IIR filters. I included this recording to show that FluidSynth handles filter popping much better than the Roland Sound Canvas, even without Remove interpolation of IIR filter coefficients #1345.It is unfortunate that such a substantial change was made to FluidSynth's behavior so soon before a major new release. From my perspective, FluidSynth's filter behavior was far better than any other SoundFont synth I had tested, and now it's broken. I'm really upset that I didn't have the time to test this until now, otherwise I would have been able to say something sooner.
The text was updated successfully, but these errors were encountered: