When it comes to musical creation, there is often a step that can be a bit of a headache: mastering. This is the final touch that we add to a piece of music by emphasizing certain characteristics. For example, we can adjust specific frequencies, enhance the stereo aspect, and eliminate certain sound parasites to achieve a polished sound optimized for all distribution systems, from vinyl to streaming to CD.
Fortunately, there are tools that can simplify this step. One such example is an open-source project coded in Python called Matchering. It takes your song as input, along with a reference song. The Matchering algorithm enables you to give your piece of music the same sound as that of your favorite artist. It also allows you to harmonize all the songs from the same album. Matchering analyzes the reference song, extracting parameters such as root mean square (RMS), frequency response, amplitude, and stereo spatialization. It then applies these settings to your song.
As it is free software, you can install it via Docker on your own machine. It is also a Python library, so you can integrate its functionality into your tools. Here’s an example of how to use it:
import matchering as mg # Sending all log messages to the default print function # Just delete the following line to work silently mg.log(print) mg.process( # The track you want to master target="my_song.wav", # Some "wet" reference track reference="some_popular_song.wav", # Where and how to save your results results=[ mg.pcm16("my_song_master_16bit.wav"), mg.pcm24("my_song_master_24bit.wav"), ], )
Producers or sound engineers interested in exploring Docker can find more information.