Skip to content

fix(synth): let a local initialAttenuation replace the global zone value - #2994

Merged
Danielku15 merged 1 commit into
developfrom
feature/issue-2977
Oct 29, 2026
Merged

Danielku15 merged 1 commit into
developfrom
feature/issue-2977

Conversation

@Danielku15

@Danielku15 Danielku15 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Note

AI-authored disclosure (alphatab-ai-authored-v1)

Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.

Issues

Fixes #2977

Proposed changes

Local SoundFont zones start as a copy of their global zone. Region.operator added initialAttenuation (generator 48) to the copied value instead of replacing it, so a local value was summed with the global one at the same level (global 200 cB + local 120 cB played at 32 dB instead of 12 dB). The SoundFont 2.04 spec (§9.4) says a local generator replaces the global one at the same level, while preset and instrument levels are added. TinySoundFont, which alphaSynth is based on, fixed the same in 2020.

The generator is now assigned. The preset/instrument summation in loadPresets is unchanged. The bundled Sonivox and default SoundFonts have no global attenuation, so they sound the same.

This PR only covers the reported generator. Coarse/fine tune and the sample address offsets still sum global and local values; those will be covered by the planned synthesizer replacement.

A unit test on Region covers replacing, inheriting and an explicit local zero.

Checklist

  • I consent that this change becomes part of alphaTab under its current or any future open source license
  • This PR is linked to an accepted issue (see above)
  • Changes are implemented
  • New tests were added
  • I have read AGENTS.md if an AI helped draft any part of this PR

AI authorship disclosure

  • No AI agent authored any part of this PR (description, code, tests, or commit messages)
  • An AI agent contributed to this PR. The AI-authored disclosure block
    (alphatab-ai-authored-v1) is present at the top of this body, and I have
    personally reviewed every change and can explain each one

Further details

  • This is a breaking change
  • This change will require update of the documentation/website

Local zones start as a copy of the global zone, so adding the local
attenuation summed both values. Preset and instrument levels are still added
as the SoundFont 2.04 specification requires.

Fixes #2977
@Danielku15
Danielku15 merged commit a0f2171 into develop Oct 29, 2026
9 of 10 checks passed
@Danielku15
Danielku15 deleted the feature/issue-2977 branch October 29, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SoundFont local initialAttenuation does not override global attenuation, making affected presets too quiet

1 participant