Skip to content

replaygain: add replaygain editing to track properties dialogs - #16062

Closed
ywwg wants to merge 1 commit into
mixxxdj:mainfrom
ywwg:owilliams/replaygain-props
Closed

replaygain: add replaygain editing to track properties dialogs#16062
ywwg wants to merge 1 commit into
mixxxdj:mainfrom
ywwg:owilliams/replaygain-props

Conversation

@ywwg

@ywwg ywwg commented Feb 27, 2026

Copy link
Copy Markdown
Member

in single track edit mode, prefills the dialog with the current replaygain value. blank values will not edit the current value.

For multi track edit mode, prefills the dialog with an empty string. empty string means no change. An info string shows the current min, max, and average replaygain values. Users can type in whatever value they want. A filled-in value will be applied to all selected tracks. This is handy for leveling out a mixed album where every track is meant to blend together and should have the same volume.

ai initial draft, hand edited and checked, hand tested.

in single track edit mode, prefills the dialog with the current replaygain value.
blank values will not edit the current value.

For multi track edit mode, prefills the dialog with an empty string.  empty string means no change.
An info string shows the current min, max, and average replaygain values.  Users can type in whatever value they want.
A filled-in value will be applied to all selected tracks. This is handy for leveling out a mixed album where every track is meant to blend together and should have the same volume.

ai initial draft, hand edited and checked, hand tested.

Signed-off-by: Owen Williams <owilliams@mixxx.org>
@ronso0

ronso0 commented Feb 27, 2026

Copy link
Copy Markdown
Member

in single track edit mode, prefills the dialog with the current replaygain value.

I understand the album use case, but what's the reason you want change it for single track in track info, like changing a rather meaningless value -- compared to adopting it from pregain via track menu or mapped control?

@ywwg

ywwg commented Feb 27, 2026

Copy link
Copy Markdown
Member Author

compared to adopting it from pregain via track menu or mapped control?

It's more for symmetry with the multitrack dialog than anything else. I think it would be weird to have a way to edit replaygain for many tracks but then when only one is selected, suddenly it's not editable. In this case the amount of code needed to support editing it is minimal so it seemed worth doing.

I could imagine someone wanting to reset replaygains to 0, or -6, or some other round number.

Another thing I could imagine is right-click "set replaygain for all selected tracks", and the analyzer goes through all of them and calculates the replaygain for the tracks as a whole. That could be dangerous if someone selects the entire library, though.

the great thing about AI code is I spent a lot less time to make this PR so I don't feel bad about trying out different approaches.

@ywwg

ywwg commented Feb 27, 2026

Copy link
Copy Markdown
Member Author

(would detecting replaygain for a series of tracks be equivalent to averaging the replaygain values of those tracks, weighted by the lengths of the tracks?)

@ywwg

ywwg commented Feb 27, 2026

Copy link
Copy Markdown
Member Author

actually claude points out it would have to be acoustically weighted, but yes we could do that.

@daschuer

Copy link
Copy Markdown
Member

See here:

* Pseudo-code to process an album:

Technically we have two replay gain values, album gain and title gain.

I think we can assume that in an album, all tracks are normalized. So there is a single replay gain to achieve a desired target loudness. There might be a dynamic in the album that for instance an intro is played with less loudness which might make it too quiet for a DJ Mixxx. Is this actually an issue? If not or we can ignore this corner case, it would be great, because we get around the hassle of storing a second gain value and the required mode switch when playing ans album.

So may allow to adopt the album gain in Mixxx for a whole album replacing the track gain. Can this be a right click action? Select all tracks of the album, right click "Apply Album Gain" or such?
The album Gain is not the average, it is calculated with a kind of median filter as if the whole album is one Track.
Maybe we can build an average of the title gain multiplied by the track duration?

@daschuer

Copy link
Copy Markdown
Member

We have removed the GetAlbumGain function for some reason. Here is a version including the function:
https://github.com/fuzzm/fuzzm-project/blob/93c7a7e6c934a6de106c27d2042baa6938685d54/benchmarks/flac/src/share/replaygain_analysis/replaygain_analysis.c#L568

@ywwg

ywwg commented Feb 28, 2026

Copy link
Copy Markdown
Member Author

Is this actually an issue?

I have an album that is meant to be played continuously, each track mixes into the next. when the replaygain value is different for different tracks, there is an audible change in the volume when the tracks change. when playing the album as a cd, it is seamless. (example: https://throwingsnow.bandcamp.com/album/embers).

Maybe we can build an average of the title gain multiplied by the track duration?

yes that works too I think, would you prefer that?

@ywwg

ywwg commented Feb 28, 2026

Copy link
Copy Markdown
Member Author

one issue with averaging the replaygain of a series of tracks is, what to do if some of the tracks are unanalyzed? kick off an analysis for them? exclude them from calculation?

@daschuer

Copy link
Copy Markdown
Member

Exclude them from calculation is probably the best choice. It is unlikely that this track is an outlier causing clipping or such.

@ywwg

ywwg commented Mar 1, 2026

Copy link
Copy Markdown
Member Author

ok I'll close this PR and post the other one since it's a very different implementation

@ywwg ywwg closed this Mar 1, 2026
@ywwg

ywwg commented Mar 1, 2026

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants