-
Notifications
You must be signed in to change notification settings - Fork 267
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
Rapidly changing/extreme panning values result in audible clicks/pops #768
Comments
I can confirm this. Looking at only one channel, we can see the clicks in a spectrogram: When mixing both channels, the clicks average each other out: Disabling panning also makes the clicks go away. Looking at one of those clicks in more detail, we can see that the waveform makes a jump: This can be reproduced with fluidsynth 1.1.6 as well. We already interpolate the sample's amplitude ( fluidsynth/src/rvoice/fluid_rvoice.c Lines 98 to 99 in e2d67ea
This is then considered, when the sample is actually rendered, see here (nearest neighbor interpolation for simplicity, 4th order cubic is default which you can find more to the bottom): fluidsynth/src/rvoice/fluid_rvoice_dsp.c Line 90 in e2d67ea
However, here is a different amplitude, namely fluidsynth/src/rvoice/fluid_rvoice.c Line 515 in e2d67ea
and later used here during mixing: fluidsynth/src/rvoice/fluid_rvoice_mixer.c Line 395 in e2d67ea
As we can see it is used without interpolation. Adding a simple linear interpolation between I will probably come back to this in a few days. |
Thanks for the detailed investigation and confirming the issue, I appreciate the need to maintain vectorization - my project uses FluidSynth in a baremetal ARM environment and performance is important. I look forward to a possible solution when you have some free time. 🙂 |
I just found some time, so here we go. Feel free to test: issue768 |
Thanks for this!
Scratch that, I was comparing the binary release .exe with issue768. I've now compiled my own 2.1.7 and compared it with issue768 - the chorus appears on both, so I think we're good! I must have some different defaults being applied somewhere - apologies! |
Thanks, glad to hear that it works fine! FYI: This fix will be part of fluidsynth 2.1.8, not sure when it will be released though. |
Thankyou so much for the quick fix! |
Temporary fix for FluidSynth/fluidsynth#768 until FluidSynth v2.1.8 is released.
FluidSynth version
2.1.7
Describe the bug
Some MIDI soundtracks change the panning values to extreme values (i.e hard-left to hard-right) rapidly while notes are playing for effect. A good example is the bassline from the Descent Level 1 music (about 30 seconds into the song - examples attached).
With FluidSynth, this can result in audible clicks/pops. Tested mainly with GeneralUser GS, but other SoundFonts exhibit this behaviour too.
Expected behavior
The audio should be panned without audible artifacts.
Steps to reproduce
descent_pan_bass_only.mid
) and notice clicks/pop.Additional context
I'm guessing that the distortion is because the panning is instantaneous, maybe similar to the "click" you get when you truncate a sample. Maybe the behaviour could be mitigated by applying a very fast envelope to smoothly fade out the transition?
The archive attached below archive contains the following files:
D1-Level 1.mid
- Complete Level 1 MIDI song from Descent 1. Panned bassline that triggers the behaviour starts at ~30 seconds into the song.descent_pan_bass_only.mid
- Just the panned bassline on its own.descent_pan_gugs.wav
- Recording of the above from FluidSynth using GeneralUser GS.descent_pan_mu2000.wav
- Recording of the above from a Yamaha MU2000, just for comparison.descent.zip
The text was updated successfully, but these errors were encountered: