Skip to content
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

SF3 decoder produces crackling sound for loud samples #1380

Closed
spessasus opened this issue Sep 13, 2024 · 1 comment
Closed

SF3 decoder produces crackling sound for loud samples #1380

spessasus opened this issue Sep 13, 2024 · 1 comment
Labels
Milestone

Comments

@spessasus
Copy link
Contributor

FluidSynth version

Execute fluidsynth --version and provide the output.
It is seen in the video: 2.3.6

Full command:

FluidSynth runtime version 2.3.6
Copyright (C) 2000-2024 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

FluidSynth executable version 2.3.6
Sample type=double

Describe the bug

Provide a clear and concise description of the current situation, e.g. how the bug manifests.

2024-09-13.21-11-58.mp4
  1. playing the "Orchestra Hit" patch with fluidsynth via the Virtual MIDI Piano Keyboard. You can hear the crackling
  2. Playing the patch via Polyphone. You don't hear the crackling
  3. Playing the patch via SpessaSynth. You don't hear the crackling

Expected behavior

Provide a clear and concise description of what you expected to happen.
No crackling like Polyphone or spessasynth. If that matters, polyphone uses 7th order (I believe) while spessa uses linear.

Steps to reproduce

Soundfont

GeneralUserGS.zip

It is just GUGS sf2 converted to sf3 via musescore/sftools.

Please explain the steps required to duplicate the issue, esp. if you are able to provide a sample application. E.g. how to start fluidsynth, what shell commands to enter, what midi events to send, etc.

  1. fluidsynth GeneralUserGS.sf3 -o synth.gain=0.5 -o audio.driver=pulseaudio`
  2. Switch to the patch 56 "Orchestra Hit"
  3. Play some notes like in the video
  4. Hear the crackling sound

NOTE: This is not a driver issue. Running the same command with the sf2 version works fine!

PS: About the driver errors: I always had those and ignored them as it seems to work fine with audio.driver=pulseaudio instead of the default pipewire. I don't think they are related.

@spessasus spessasus added the bug label Sep 13, 2024
@derselbst derselbst added this to the 2.3 milestone Sep 19, 2024
@derselbst
Copy link
Member

I successfully reproduced this with any audio driver. The sample is quite loud and the audio is clipping. It took me a while to realize that this is the same bug that I have reported to libsndfile more than 7 years ago: libsndfile/libsndfile#194

A simple additional - but improperly documented - preprocessing step is needed, see my commit above.

Thanks for the report!

@derselbst derselbst changed the title SF3 decoder produces crackling sound sometimes SF3 decoder produces crackling sound for loud samples Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants