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

Fix bugs in modulator handling #1392

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Fix bugs in modulator handling #1392

wants to merge 7 commits into from

Conversation

derselbst
Copy link
Member

This PR fixes two problems:

#1068: Previously, if a modulator had src1 set to "No Controller" it would always cancel src2.

#1389: If any src was set to "No Controller", its input value would not be transformed.

Also, previously, some modulators received a "special treatment" during soundfont loading, by setting their amount to zero. This was to aid the magic done in fluid_voice_get_lower_boundary_for_attenuation(). After looking through that function again, I don't see the changes introduced in fluid_defsfont.c will cause problems for the fluid_voice_get_lower_boundary_for_attenuation(): Bipolar modulators are correctly accounted for. And if src1 is set to FLUID_MOD_NONE it will no longer cancel the modulator, hence it would trigger the else branch here:

else
{
/* No negative value possible. But still, the minimum contribution is 0. */
min_val = 0;
}

The only theoretical problem that comes to my mind is if there was a modulator which sets both src1 and src2 to "No Controller", in which case it would never cause a "minimum" contribution.

But I might be missing something else. @mawe42 In case you have some time, could you have a look into the fluid_voice_get_lower_boundary_for_attenuation() as well?

@derselbst derselbst added the bug label Oct 3, 2024
@derselbst derselbst added this to the 2.4 milestone Oct 3, 2024
Copy link

sonarcloud bot commented Oct 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants