?️ Open Source Audio Matching and Mastering

Overview

Buy Me A Coffee

Matchering 2.0

License PyPI Version PyPI Python Versions Mentioned in Awesome Python Code style: black

Matching + Mastering = ❤️

Matchering 2.0 is a novel Containerized Web Application and Python Library for audio matching and mastering.

It follows a simple idea - you take TWO audio files and feed them into Matchering:

  • TARGET (the track you want to master, you want it to sound like the reference)
  • REFERENCE (another track, like some kind of "wet" popular song, you want your target to sound like it)

Our algorithm matches both of these tracks and provides you the mastered TARGET track with the same RMS, FR, peak amplitude and stereo width as the REFERENCE track has.

Watch the video:

Matchering 2.0 Promo Video

So Matchering 2.0 will make your song sound the way you want! It opens up a wide range of opportunities:

  • You can make your music instantly sound like your favorite artist's music
  • You can make all the tracks on your new album sound the same very quickly
  • You can find new aspects of your sound in experiments
  • You can do everything as you want! Because of Your References, Your Rules.™ (just a little nostalgic note) ?

Matchering WEB GIF Animation

Differences from the previous major version:

  • Completely rewritten in Python 3, based on open source tech stack (no more MATLAB)
  • Our own open source brickwall limiter was implemented for it
  • Processing speed and accuracy have been increased
  • Now it is the library that can be connected to everything in the Python world

Installation and Usage

If you are a music producer or an audio engineer, choose the Docker Image.

If you are a developer, choose the Python Library.

Docker Image - The Easiest Way

Matchering 2.0 works on all major platforms using Docker.

Choose yours

Windows

macOS

Linux

Updating

If you need to update the version of the installed Docker Image, follow these instructions.

Python Library - For Developers

Installation

4 GB RAM machine with Python 3.6.0 or higher is required

libsndfile

Matchering 2.0 depends on the SoundFile library, which depends on the system library libsndfile. On Windows and macOS, it installs automatically. On Linux, you need to install libsndfile using your distribution's package manager, for example:

sudo apt update && sudo apt -y install libsndfile1

python3-pip

On some Linux distributions, python3-pip is not installed by default. For example use this command on Ubuntu Linux to fix this:

sudo apt -y install python3-pip

Matchering Python Package

Finally, install our matchering package:

# Linux / macOS
python3 -m pip install -U matchering

# Windows
python -m pip install -U matchering

(Optional) FFmpeg

If you would like to enable MP3 loading support, you need to install the FFmpeg library. For example use this command on Ubuntu Linux:

sudo apt -y install ffmpeg

Or follow these instructions: Windows, macOS.

Quick Example

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"),
    ],
)

You can find more examples in the examples directory.

Or you can use premade Matchering 2.0 Command Line Application: matchering-cli.

A Coffee

If our package saved your time or money, you may:

Buy Me A Coffee

Thank you!

Links

Comments
  • python version

    python version

    Create a python re-write of matchering, because matlab is not that easy to acquire for normal user.

    Differences

    • simplified error messages and display messages
    • no explicit memory cleaning operation, but done by in-place operation and python own garbage collection
    • vectorized rms calculation
    • display rms coefficient in db scale
    • replace smoothing operation with average filter when filtering match fft . May change to 'loess' method in the future
    • no limiter. I haven't add the limiter function yet, but this can be easily done in the future

    Have run this script on my laptop very smoothly, but I can't compare the differences cuz I currently don't have matlab installed device (the last time I use matlab was in college lol).

    opened by yoyololicon 35
  • CAN'T SAVE TO A DIFFERENT FOLDER in DJANGO

    CAN'T SAVE TO A DIFFERENT FOLDER in DJANGO

    Request Method: | GET -- | -- http://127.0.0.1:8000/dashboard/track/8/master 3.0.2 RuntimeError Error opening './media/goody/mastered/my_song_master_16bit.wav': System error. /home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/site-packages/soundfile.py in _error_check, line 1357 /home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/bin/python 3.6.9 ['/home/goodness/Documents/django_dev/MeshakProj', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python36.zip', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/lib-dynload', '/usr/lib/python3.6', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/site-packages'] Thu, 30 Jan 2020 10:52:20 +0100

    opened by GoodnessEzeokafor 8
  • Any plan on create a demo site with matchering?

    Any plan on create a demo site with matchering?

    Thanks for your hard working on containerize the whole project ! I want to say congrats to everyone who have participated in it, thank you :clap: I would also like to ask is there any plan on create a demo site so everyone can access the serverce ?

    BTW I have run it on a private docker server and it works well, but the loading time is a little bit long though (~= 10 seconds).

    opened by yoyololicon 6
  • GET request possible for usage with Docker image?

    GET request possible for usage with Docker image?

    Hi, I would like to automate some tasks to process our rehearsel recordings (ideation for new songs). I currently use the docker image and I wondered whether it would be possible to make a GET request to the site supplying reference and target files/filepaths and receive the resulting file (or automatically put it into a shared folder). E.g. just call http://127.0.0.1:8360?ref=reference.wav&target=target.wav&output=target_by_reference.wav

    I know I could use the python version and the CLI but I would like to keep the docker version for simplicity.

    More background: I mainly use the same 3 reference tracks from our own album and this way I could create a script to copy the recordings from the SD card, show a simple GUI to select the reference track for each recording and provide the names, call matchering, convert the resulting audio file to mp3 and copy it to our band sharing file space.

    question 
    opened by boriswerner 5
  • 4001: Audio stream error in the TARGET file

    4001: Audio stream error in the TARGET file

    Request Method: | GET -- | -- http://127.0.0.1:8000/dashboard/track/6/master 3.0.2 ModuleError 4001: Audio stream error in the TARGET file /home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/site-packages/matchering/loader.py in load, line 42 /home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/bin/python 3.6.9 ['/home/goodness/Documents/django_dev/MeshakProj', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python36.zip', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/lib-dynload', '/usr/lib/python3.6', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/site-packages'] Thu, 30 Jan 2020 09:19:52 +0100

    opened by GoodnessEzeokafor 4
  • mono vs stereo output

    mono vs stereo output

    Hi,

    Great repo! Just had one question: when both target and reference are stereo I think everything makes sense. But if both of them are mono, current code converts the target to stereo on loading by duplicating its channel. After all the matching process, the output is a stereo file containing two identical channels, which is essentially mono. Would there be any issue if we don't convert the input/target to stereo in the beginning?

    Thanks, Zhenyu

    opened by RoyJames 3
  • How to work with mp3s?

    How to work with mp3s?

    Hello guys! matchering is an amazing lib, thank you very much!

    I wanna try to play around with some mp3 files in matchering but can't find any documentation about it

    I want to upload a target and reference (both mp3) and extract the mastered target as mp3 as well. Is it possible? where can I find information about the python syntax to make it possible?

    Thank you!

    opened by nothingcomeseasy 3
  • Max file size limit?

    Max file size limit?

    Hello Sergree,

    First, thanks for this great tool! i really see a great future for matcherng in the future for fast mixing of radio mixes. I really want to support you and buy a coffe! but before that..

    I want to know why there is a file limit and if it is possible to disable that. ''The file format is not supported or the maximum file size (256 MB) has been exceeded.''

    Why i ask this? Because i think this tool van be great for fast mastering of radio mixes that are long and over 300 mb of size.

    thanks!! hope to hear from you and sorry for bad english, ask me if you want to know more.

    opened by Superbeertje 3
  • Add Moises.ai Link to README

    Add Moises.ai Link to README

    I think it would be great to have this link more visible so people can try Matchering out easier!

    BTW this tool is amazing :sparkles: Thank you so much! I don't know what it does to me and my brother's music, but I've no music mastering training or knowlege other than what I've tried to learn myself by messing with Open Source audio tools and I have been trying to figure out how to make our music sound like that forever!

    This is just great. :smile:

    opened by zicklag 3
  • matchering.log.exceptions.ModuleError: 4002: Track length is exceeded in the TARGET file

    matchering.log.exceptions.ModuleError: 4002: Track length is exceeded in the TARGET file

    Hi,

    I'm trying to use matchering to master a song but ran into an error.

    Loading and analysis
    Loading the TARGET file: 'target.wav'...
    The TARGET file is loaded
    TARGET audio length: 99615480 samples (0:37:38)
    Traceback (most recent call last):
      File "master.py", line 9, in <module>
        mg.pcm24('target24bit.wav'),
      File "/Users/highcenoid/Documents/TCSP/mastered/env/lib/python3.7/site-packages/matchering/core.py", line 53, in process
        target, target_sample_rate = check(target, target_sample_rate, config, 'target')
      File "/Users/highcenoid/Documents/TCSP/mastered/env/lib/python3.7/site-packages/matchering/checker.py", line 102, in check
        else Code.ERROR_REFERENCE_LENGTH_LENGTH_TOO_SMALL
      File "/Users/highcenoid/Documents/TCSP/mastered/env/lib/python3.7/site-packages/matchering/checker.py", line 57, in __check_length
        raise ModuleError(error_code_max)
    matchering.log.exceptions.ModuleError: 4002: Track length is exceeded in the TARGET file
    
    At first I just loaded the target and reference files, then I cut the reference file to be exactly as long as the target but was still getting the error.
    
    
    wontfix 
    opened by reyesvicente 3
  • MemoryError: Unable to allocate array with shape (13755436,) and data type float64

    MemoryError: Unable to allocate array with shape (13755436,) and data type float64

    Here is the error information.
    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='../music_file/torch.wav',
    
        # Some "wet" reference track
        reference='../music_file/juanzhulian.wav',
    
        # Where and how to save your results
        results=[
            mg.pcm16('my_song_master_16bit.wav'),
            mg.pcm24('my_song_master_24bit.wav'),
        ]
    )
    
    Please give us a star to help the project: https://github.com/sergree/matchering
    ----------------------------------------
    Loading and analysis
    Loading the TARGET file: '../music_file/torch.wav'...
    The TARGET file is loaded
    TARGET audio length: 12900720 samples (0:04:52)
    Audio clipping is detected in the TARGET file. It is highly recommended to use the non-clipping version
    Loading the REFERENCE file: '../music_file/juanzhulian.wav'...
    The REFERENCE file is loaded
    REFERENCE audio length: 14971904 samples (0:05:11)
    Resampling REFERENCE audio from 48000 Hz to 44100 Hz...
    The REFERENCE audio was resampled
    ----------------------------------------
    Matching levels
    The maximum size of the analyzed piece: 661500 samples or 15.00 seconds
    Normalizing the REFERENCE...
    The REFERENCE was normalized. Final amplitude coefficient for the TARGET audio is: -0.0495 dB
    Calculating mid and side channels of the TARGET...
    The TARGET will be didived into 20 pieces
    One piece of the TARGET has a length of 645036 samples or 14.63 seconds
    Calculating RMSes of the TARGET pieces...
    Extracting the loudest pieces of the TARGET audio with the RMS value more than average -11.3945 dB...
    The current average RMS value in the loudest pieces is -9.3542 dB
    Calculating mid and side channels of the REFERENCE...
    
    
    
    ---------------------------------------------------------------------------
    
    MemoryError                               Traceback (most recent call last)
    
    <ipython-input-8-b42637885823> in <module>
          9     results=[
         10         mg.pcm16('my_song_master_16bit.wav'),
    ---> 11         mg.pcm24('my_song_master_24bit.wav'),
         12     ]
         13 )
    
    
    ~/miniconda3/lib/python3.7/site-packages/matchering/core.py in process(target, reference, results, config, preview_target, preview_result)
         75         need_default=any(rr.use_limiter for rr in results),
         76         need_no_limiter=any(not rr.use_limiter and not rr.normalize for rr in results),
    ---> 77         need_no_limiter_normalized=any(not rr.use_limiter and rr.normalize for rr in results),
         78     )
         79 
    
    
    ~/miniconda3/lib/python3.7/site-packages/matchering/stages.py in main(target, reference, config, need_default, need_no_limiter, need_no_limiter_normalized)
        177         reference_mid_loudest_pieces, reference_side_loudest_pieces,\
        178         target_divisions, target_piece_size, reference_match_rms\
    --> 179         = __match_levels(target, reference, config)
        180 
        181     del target, reference
    
    
    ~/miniconda3/lib/python3.7/site-packages/matchering/stages.py in __match_levels(target, reference, config)
         50         reference_mid_loudest_pieces, reference_side_loudest_pieces,\
         51         reference_match_rms, *_\
    ---> 52         = analyze_levels(reference, 'reference', config)
         53 
         54     rms_coefficient, target_mid, target_side = get_rms_c_and_amplify_pair(
    
    
    ~/miniconda3/lib/python3.7/site-packages/matchering/stage_helpers/match_levels.py in analyze_levels(array, name, config)
        146     name = name.upper()
        147     debug(f'Calculating mid and side channels of the {name}...')
    --> 148     mid, side = lr_to_ms(array)
        149     del array
        150 
    
    
    ~/miniconda3/lib/python3.7/site-packages/matchering/dsp.py in lr_to_ms(array)
         64     mid = np.copy(array[:, 0])
         65     array[:, 0] -= array[:, 1]
    ---> 66     side = np.copy(array[:, 0])
         67     return mid, side
         68 
    
    
    <__array_function__ internals> in copy(*args, **kwargs)
    
    
    ~/miniconda3/lib/python3.7/site-packages/numpy/lib/function_base.py in copy(a, order)
        788 
        789     """
    --> 790     return array(a, order=order, copy=True)
        791 
        792 # Basic operations
    
    
    MemoryError: Unable to allocate array with shape (13755436,) and data type float64
    

    Is my wav file is too long? I am new for this package.

    du -sh torch.wav
    50M     torch.wav
    du -sh juanzhulian.wav
    58M     juanzhulian.wav
    

    I run it on an Ubuntu system.

    opened by JiaxiangBU 3
  • Apple M1 - Getting an

    Apple M1 - Getting an "Unknown Error"

    M1 Mac Mini running OSX 11.5.2, latest version of Matchering, and Docker 4.15.0. Getting an "Unknown Error" after Matchering performs its analysis steps. This was working at one point, but for some reason now I can't get any set of files to complete. Works perfectly on my other Mac, which is a Macbook Pro Retina 2016, running OSX 10.14 (same version of Matchering and Docker). Are there any troubleshooting steps I should attempt? Thank you!

    bug help wanted 
    opened by theaor 4
  • matchering.com redirects to eMastered

    matchering.com redirects to eMastered

    It seems matchering.com redirects to eMastered. Also i found other domains like matchering.org, matchering.net, matchering.info which look malicious.

    ¯_(°ペ)_/¯

    question wontfix 
    opened by djsora 1
  • Any way to see exactly what matchering did to a song

    Any way to see exactly what matchering did to a song

    Would love to see it possibly put out a text file or some sort that includes what exactly is different about the new master that the program makes (such as EQ changes, how much stereo spread was applied, how much louder it is compared to the original file, etc.)

    This program is way more accurate than something like izotope but in izotope you can see what changes will be made in the new master and apply that difference to other tracks if you so choose, rather than making them all have the exact same mastering as a specific song. Love this program and keep up the good work <3 hope this all made sense!

    enhancement 
    opened by Waffled-II 3
  • Tonal Balance, Dynamic EQ, Intensity Analysis, Wetness %

    Tonal Balance, Dynamic EQ, Intensity Analysis, Wetness %

    Getting a similar tonal balance on the most high energy (and low energy) sections of a track is crucial for matching a sound.. as well as the other items that this library aims for. This could possibly be achieved with a dynamic EQ with N bands. Applying the matching of the values already compared within these bands may improve the result.

    If it would be possible to identify intensity levels of a song and apply these parameters to corresponding sections of the input song, the result may also be substantially better.

    Being able to tweak the percentage application of these values would be very useful as well. (wetness)

    I'd like to help work on these features if you can point me in the right direction.

    enhancement 
    opened by rhelsing 2
Releases(2.0.6)
  • 2.0.6(Oct 19, 2022)

  • 2.0.5(Apr 13, 2022)

  • 2.0.4(Apr 13, 2022)

    Hey folks! Since the last release, many dependencies have been updated. This version allows you to take advantage of these third-party library improvements. Some information about the repository has also been updated. This is not a major update that does not introduce new Matchering features. Updating is not necessary.

    Source code(tar.gz)
    Source code(zip)
  • 2.0.3(Nov 10, 2020)

    Long time no see, time to update.

    • (Docker) Windows 10 Home support
    • (Core) Ubuntu 20.04 support
    • Dependencies update: everything should be more stable and faster now
    • Description & installation instructions update
    • Black code formatting

    Yes, I have some plans and small prototypes of Rust native binaries, but so far everything is very vague.

    Source code(tar.gz)
    Source code(zip)
  • 2.0.2(Feb 10, 2020)

  • 2.0.1(Feb 10, 2020)

  • 2.0.0(Jan 12, 2020)

    Matchering 2.0 initial release!

    Differences from the previous major MATLAB version:

    • Completely rewritten in Python 3, based on open source tech stack (no more MATLAB)
    • Our own open source brickwall limiter was implemented for it
    • Processing speed and accuracy have been increased
    • Now it is the library that can be connected to everything in the Python world

    Differencies from the @yoyololicon version:

    • Modular architecture
    • PyPI library
    • DRY, KISS, SOLID
    • Fixed some inaccuracies and errors in the algorithm
    • MP3 support with FFmpeg
    Source code(tar.gz)
    Source code(zip)
Owner
Sergey Grishakov
Audio Mastering Robin Hood
Sergey Grishakov
Deep learning transformer model that generates unique music sequences.

music-ai Deep learning transformer model that generates unique music sequences. Abstract In 2017, a new state-of-the-art was published for natural lan

xacer 6 Nov 19, 2022
A simple music player, powered by Python, utilising various libraries such as Tkinter and Pygame

A simple music player, powered by Python, utilising various libraries such as Tkinter and Pygame

PotentialCoding 2 May 12, 2022
Music player and music library manager for Linux, Windows, and macOS

Ex Falso / Quod Libet - A Music Library / Editor / Player Quod Libet is a music management program. It provides several different ways to view your au

Quod Libet 1.2k Jan 07, 2023
A rofi-blocks script that searches youtube and plays the selected audio on mpv.

rofi-ytm A rofi-blocks script that searches youtube and plays the selected audio on mpv. To use the script, run the following command rofi -modi block

Cliford 26 Dec 21, 2022
Stevan KZ 1 Oct 27, 2021
GNOME powered sound conversion

SoundConverter A simple sound converter application for the GNOME environment. It reads anything the GStreamer library can read, and writes Ogg Vorbis

Gautier Portet 188 Dec 17, 2022
Python audio and music signal processing library

madmom Madmom is an audio signal processing library written in Python with a strong focus on music information retrieval (MIR) tasks. The library is i

Institute of Computational Perception 1k Dec 26, 2022
Synchronize a local directory of songs' (MP3, MP4) metadata (genre, ratings) and playlists with a Plex server.

PlexMusicSync Synchronize a local directory of songs' (MP3, MP4) metadata (genre, ratings) and playlists (m3u, m3u8) with a Plex server. The song file

Tom Goetz 9 Jul 07, 2022
PyAbsorp is a python module that has the main focus to help estimate the Sound Absorption Coefficient.

This is a package developed to be use to find the Sound Absorption Coefficient through some implemented models, like Biot-Allard, Johnson-Champoux and

Michael Markus Ackermann 8 Oct 19, 2022
gentle forced aligner

Gentle Robust yet lenient forced-aligner built on Kaldi. A tool for aligning speech with text. Getting Started There are three ways to install Gentle.

1.2k Dec 30, 2022
Library for working with sound files of the format: .ogg, .mp3, .wav

Library for working with sound files of the format: .ogg, .mp3, .wav. By work is meant - playing sound files in a straight line and in the background, obtaining information about the sound file (auth

Romanin 2 Dec 15, 2022
Speech Algorithms Collections

Speech Algorithms Collections

Ryuk 498 Jan 06, 2023
We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

1 Nov 19, 2021
A python package for calculating the PESQ.

PyPESQ (WIP) Pypesq is a python wrapper for the PESQ score calculation C routine. It only can be used in evaluation purpose. INSTALL pip install https

Jingdong Li 269 Dec 18, 2022
The official repository for Audio ALBERT

AALBERT Here is also the official repository of AALBERT, which is Pytorch lightning reimplementation of the paper, Audio ALBERT: A Lite Bert for Self-

pohan 55 Dec 11, 2022
praudio provides audio preprocessing framework for Deep Learning audio applications

praudio provides objects and a script for performing complex preprocessing operations on entire audio datasets with one command.

Valerio Velardo 105 Dec 26, 2022
📺Headless全自动B站直播录播、切片、上传一体工具

DDRecorder Headless全自动B站直播录播、切片、上传一体工具 感谢 FortuneDayssss/BilibiliUploader 安装指南(Windows) 在Release下载zip包解压。 修改配置文件config.json 双击运行DDRecorder.exe (这将使用co

322 Dec 27, 2022
Vixtify - Python Controlled Music Player

Strumm Sound Playlist : Click me to listen Welcome to GitHub Pages You can use the editor on GitHub to maintain and preview the content for your websi

Vicky Kumar 2 Feb 03, 2022
Simple discord bot by @merive 🤖

Parzibot Powerful and Useful Discord Bot on Python. The source code of the bot is available to everyone. Parzibot uses English language. This is free

merive_ 3 Dec 28, 2022
MUSIC-AVQA, CVPR2022 (ORAL)

Audio-Visual Question Answering (AVQA) PyTorch code accompanies our CVPR 2022 paper: Learning to Answer Questions in Dynamic Audio-Visual Scenarios (O

44 Dec 23, 2022