Skip to content

Conversation

@bakajikara
Copy link
Contributor

@bakajikara bakajikara commented Nov 10, 2025

Resolves: #21330
Resolves: #24683

  • Adds std::clamp to prevent overflow.
  • Ensures silence (0.0f) correctly maps to 0.
  • Implements correct rounding instead of truncation.
  • TargetBits can be specified independently of the container type (would also be useful for converting to 24-bit).
  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@bakajikara bakajikara changed the title Improve float to int conversion (fixes #21330 and #24683) Improve float to int audio conversion (fixes #21330 and #24683) Nov 10, 2025
@bakajikara bakajikara force-pushed the flac-clipping branch 3 times, most recently from 8347938 to 2ac051e Compare November 12, 2025 14:18
@zacjansheski
Copy link
Contributor

Tested on MacOS 15, Windows 11, Ubuntu 22.04.3. Approved
#21330 FIXED
#24683 FIXED

@cbjeukendrup cbjeukendrup merged commit fe89f37 into musescore:master Nov 18, 2025
12 checks passed
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.

Exported FLAC Audio Cracked FLAC export shows lots of signs of clipping for a score that isn't too loud, WAV export works fine

4 participants