Support for using multiple reference tracks#82
Open
soundsnep wants to merge 6 commits intosergree:masterfrom
Open
Support for using multiple reference tracks#82soundsnep wants to merge 6 commits intosergree:masterfrom
soundsnep wants to merge 6 commits intosergree:masterfrom
Conversation
…og included, code untested)
…, verified identical input as with a single track
Author
|
I realized that this somewhat gives the "how much should the matchering apply" control that #65 and #72 ask for. It should be possible to set two references:
and set their I might try it later this week if I have some time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First, thanks to all the authors who contributed to Matchering and got it where it is!
I had a hard time getting a satisfactory result when matching to a reference track that sounded good, although it was a bit bass-heavy and rather aggressively compressed (EDM, partially what I aimed for, but not to that extent). I was thinking if perhaps the spectrum contains peaks related to the key of the reference, which break how the matched result sounds, or something similar. Also I was not very happy with the bass-heaviness and wondered if I can avoid manually applying an EQ (and then fixing the levels/dynamics). I had a second reference track that was a bit "weaker", but too weak on its own .... getting a match somewhere "in between" was my goal.
Hypothesis: Blending multiple reference tracks should help with getting a better balanced result.
Implementation TL;DR: the intermediate "stats" of the reference tracks (outputs of
analyze_levels()andget_fir()) are averaged before applying them to the target track.Now we can get in-between results for multiple reference tracks. It's also possible to specify custom weights separately for levels (dynamics) and frequency response. This way we can use one track as a frequency response reference, and other track for levels/dynamics/loudness, or any mix of any number of tracks. See the README change for an example.
Some examples:
target track matched to reference track A (result identical to unmodified Matchering), screenshot of Audacity's "Plot Spectrum" command:

target track matched to reference track B (result identical to unmodified Matchering):

target track matched to an equal blend of A and B (result enabled by this contribution):

Indeed, the spectrum looks like an average of the two above.
I did not find a nice+easy way to visualize the results for levels/dynamics, but can do more tests if needed.
more plots
original spectrum of the target trackspectrum of reference A

spectrum of reference B

Disclaimer: AI was used for the initial implementation, mainly to test the capabilities of the free tier GitHub Copilot in the Codespace online VSCode, and to avoid wasting time on debugging my stupid typos. It needed a few bumps to push it in the right direction - e.g. it proposed to mix the raw samples of reference tracks, which would break transients etc., but turned out good in the end - see the full chat transcript in the first commit if interested. The follow-up changes (weights splitting etc.) were done manually.
Testing done: in my experiments the results with one reference are identical to the the results before any code changes. As expected, with more references their order does not matter (as long as their weights are the same). I tested with up to 3 reference tracks, but there is no limit (as long they fit in your RAM ... using the whole Spotify library recently scraped by filthy pirates as reference tracks is probably not a good idea, lol). Sorry, I did not bother with proper unit tests as this was just a fun Sunday project for me :3 I can make some later if you want.
It worked reasonably well for my use-case, but I would be interested in others' thoughts.
I hope you find it useful.