Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

After update from 2.3.7 to 2.4.0, on some note played via tuxguitar, a "larsen" is emitted shortly #1451

Closed
ycollet opened this issue Dec 9, 2024 · 23 comments
Labels
Milestone

Comments

@ycollet
Copy link

ycollet commented Dec 9, 2024

FluidSynth version

I used fuildsynth 2.4.0 from Fedora 41. The version before this update was 2.3.7.

Describe the bug

I used fluidsynth via tuxguitar.
When I play some guitarpro score, some some notes; a larsen is emitted briefly.
Seems to disappear if I turn off chorus and / or reverb.

Expected behavior

No audible larsen

Steps to reproduce

I haven't yet a good reproducer. I will pos one once I found a reproductible score

Additional context

There was no problems before 2.4.0. Tuxguitar was not updated in the mean time.
I removed the tuxguitar configuration and start a new one from scratch but the problem is still here.

@ycollet ycollet added the bug label Dec 9, 2024
@derselbst
Copy link
Member

What do you mean by "larsen"? Also, I highly recommend to use fluidsynth 2.4.1 since we have fixed possible clicks and pops in the low pass filter. If it also happens with 2.4.1, pls. post at least an audio sample where the "larsen" can be heard, or even better, a reproducible score.

@ycollet
Copy link
Author

ycollet commented Dec 10, 2024

I will wait for the fedora update.
From tiime to time, there is a high frequency sound really similar to a larsen we can hear with a guitar.
The problem is not always reproductible. Once I found a GuitarPro score where the problem occurs regularly, I will record the sound.

@ycollet
Copy link
Author

ycollet commented Dec 11, 2024

Here is an example.

image

We can here the high frequency sound in the 2 first sequences.

output.mp4

@derselbst
Copy link
Member

derselbst commented Dec 11, 2024 via email

@ycollet
Copy link
Author

ycollet commented Dec 22, 2024

Good idea. I will check tonight if it's the case.
My answer to:

It sounds to me like the MIDI file is using the GS preset 008:030 Feedback Guitar, which has a feedback that creeps in as the notes sustain.

@ycollet
Copy link
Author

ycollet commented Jan 4, 2025

I reproduced the problem via an exported midi file played with vlc / fluidsynth and a specific sound font.
I uploaded the files on my website.
The soundfont: http://ycollette.free.fr/Guitare/63mg_The_Xioad_Bank.sf2
The midi file: http://ycollette.free.fr/Guitare/bolt_thrower_armageddon_bound_transposed.mid
When played on vlc + fluindsynth plugin, the problem starts at 3:40

@derselbst
Copy link
Member

Ok, thanks. So I'm still trying to understand what you mean. For this, I've rendered the midi + SF2 with both, fluidsynth 2.3.7 and 2.4.2. Then I inverted one rendering, mixed them both together and exported it to this file, so we only hear the differences:
1451.zip

The differences in the drums are expected, due to #1199. And yes, fluidsynth 2.4.2 produces a strange sinusoidal feedback at e.g. 4:28 and 4:41 on the right channel - is that what you mean by "larsen"?

@ycollet
Copy link
Author

ycollet commented Jan 5, 2025

Yes, by feedback I mean this sine wave on the right channel at the time you specified.

@derselbst derselbst added this to the 2.4 milestone Jan 5, 2025
@derselbst
Copy link
Member

Thanks for confirming I'll investigate what's going on. May take a while though...

@ycollet
Copy link
Author

ycollet commented Jan 5, 2025

OK, thanks a lot for your work :)

@spessasus

This comment was marked as off-topic.

@ycollet

This comment was marked as off-topic.

@spessasus

This comment was marked as off-topic.

@derselbst
Copy link
Member

The provided difference audio was generated with effects disabled, so it's not related to this.

@spessasus
Copy link
Contributor

Splitting the file into two where:
one contains percussion and bass (channels 10, 12 and 13)
one contains the rest (distortion guitars)

results in a clean output. Adding them back together results in clear sound that 2.3.7 produces.

@spessasus
Copy link
Contributor

attaching them for reference:
Archive.zip

@derselbst
Copy link
Member

I have identified 186a4af (#1314) as the culprit. I still need to understand what's going on exactly, such as why the problem disappears if e.g. I only accept noteOn events from either channel 5 or channel 4 (which are the ones causing the feedback).

@ycollet
Copy link
Author

ycollet commented Jan 11, 2025

Excellent !
A big thanks for this work !!

@derselbst
Copy link
Member

So, it turns out that when a voice is in delay phase, its amplitude is not updated. Since the amplitude isn't cleared either, it may inherit an amplitude as well as an amplitude increment of a previous voice. If that previous amp increment was non-zero, nothing prevents the amplitude of the current in-delay-phase-voice from rising infinitely. A case that I indeed haven't considered. I will propose a fix, since I was reworking that code anyway.

@ycollet
Copy link
Author

ycollet commented Jan 12, 2025

Thanks !
Is there any donation page ? Like a patreon account ?

@derselbst
Copy link
Member

No, sry, I thought about this before but decided against a sponsorship. But thanks for the offer :)

@derselbst
Copy link
Member

Fixed by #1470 and will be released with 2.4.3. Thanks again for the report!

@ycollet
Copy link
Author

ycollet commented Jan 25, 2025

Thanks a lot for your work !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants