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

Add automatic audio normalisation to highest volume #14

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RastislavTuranyi
Copy link
Contributor

@RastislavTuranyi RastislavTuranyi commented May 4, 2024

Description

The karaoke library has a massive variation in the volumes of different songs, which is not only annoying when the speaker volume has to be constantly readjusted, but it also makes the quietest songs difficult to hear and sing. Therefore, this PR introduces automatic volume normalisation using the ffmpeg-normalize tool. However, this is only used when the kara.moe map consists of video instead of audio since in that case the audio is already being re-encoded and therefore adding volume normalisation at the same time should not introduce any additional compression artifacts. The normalisation does not take place in the case when the kara.moe map contains audio and not video to avoid compression artifacts, but we can discuss this.

The normalisation is set to be to the highest reasonable volume (i.e. highest volume that does not degrade audio quality) to avoid having too quiet songs; from my experience it is always easier to turn volume down than up during karaoke.

To test

  1. Convert a kara.moe map using this version of KaraLuxer
  2. See that the volume in .mp3 is louder than that in .mp4.
  3. (optional) use the ffmpeg -i a.mp3 -af "volumedetect" -vn -sn -dn -f null - command and see that the max volume is close to 0.

With the previous settings, issues could appear when the input (kara.moe) audio was already loud. Therefore, the loudness range target for the EBU algorithm has also been maximised and the --keep-lra-above-loudness-range-target option has been added to ensure that the loudest settings will be used and that ffmpeg-normalize won't automatically adjust things in an unexpected way.
@RastislavTuranyi RastislavTuranyi marked this pull request as draft May 9, 2024 13:59
@RastislavTuranyi
Copy link
Contributor Author

After using this for mapping more songs, I have noticed that the ffmpeg-normalize tool sometimes does not work as I intended. For example, sometimes it messes up the "smoothness" of the volume, e.g. it causes some random notes to be significantly louder or quieter than the rest of the song (where such a volume jump was not present previously).

Therefore, I think it may be a better idea to simply do a peak-based normalisation, which I have been using in my maps for a long time manually and I haven't noticed any issues with so far.

@Baklap4
Copy link
Contributor

Baklap4 commented Aug 23, 2024

While I understand the intention behind introducing automatic audio normalization, I believe it would be more beneficial as an opt-in feature rather than something applied by default.

Reasons:
Dynamic Range Preservation: Automatic normalization can reduce the dynamic range, which is crucial for users with high-end hardware setups. We rely on the full range of audio to capture the nuances and details that might be lost with automatic adjustments.

Control Over the Mix: For those of us who are meticulous about our audio settings, having control over the mix is essential. Automatic normalization could override these settings, affecting the final output in ways we might not want.

Artistic Integrity: Many audio tracks are mixed with intentional volume variations. Automatic normalization could alter these creative decisions, impacting the artistic vision.

Suggestion:
Could we consider making normalization an optional setting? This way, users can choose to enable it if it fits their needs, while those who prefer manual control can maintain their current workflow.

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.

2 participants