?️ 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
Generating a structured library of .wav samples with Python.

sample-library Scripts for generating a structured sample library with Python Requires Docker about Samples are written to wave files in lib/. Differe

Ben Mangold 1 Nov 11, 2021
A collection of python scripts for extracting and analyzing acoustics from audio files.

pyAcoustics A collection of python scripts for extracting and analyzing acoustics from audio files. Contents 1 Common Use Cases 2 Major revisions 3 Fe

Tim 74 Dec 26, 2022
Frescobaldi LilyPond Editor

README for Frescobaldi Homepage: http://www.frescobaldi.org/ Main author: Wilbert Berendsen Frescobaldi is a LilyPond sheet music text editor. It aims

Frescobaldi 600 Dec 29, 2022
Linear Prediction Coefficients estimation from mel-spectrogram implemented in Python based on Levinson-Durbin algorithm.

LPC_for_TTS Linear Prediction Coefficients estimation from mel-spectrogram implemented in Python based on Levinson-Durbin algorithm. 基于Levinson-Durbin

Zewang ZHANG 58 Nov 17, 2022
A telegram bot for which is help to play songs in vc 🥰 give 🌟 and fork this repo before use 😏

TamilVcMusic 🌟 TamilVCMusicBot 🌟 Give your 💙 Before clicking on deploy to heroku just click on fork and star just below How to deploy Click the bel

TamilBots 150 Dec 13, 2022
Supysonic is a Python implementation of the Subsonic server API.

Supysonic Supysonic is a Python implementation of the Subsonic server API. Current supported features are: browsing (by folders or tags) streaming of

Alban 228 Nov 19, 2022
Algorithmic Multi-Instrumental MIDI Continuation Implementation

Matchmaker Algorithmic Multi-Instrumental MIDI Continuation Implementation Taming large-scale MIDI datasets with algorithms This is a WIP so please ch

Alex 2 Mar 11, 2022
digital audio workstation, instrument and effect plugins, wave editor

digital audio workstation, instrument and effect plugins, wave editor

306 Jan 05, 2023
[Singing Log] Let your program learn to sing!

[Singing Log] Let your program learn to sing! You must have thought this was changelog when you saw the English title, but it's not, it's chànggēlog. What it does is allow your program to print logs

黄巍 22 Sep 03, 2022
An audio-solving python funcaptcha solving module

funcapsolver funcapsolver is a funcaptcha audio-solving module, which allows captchas to be interacted with and solved with the use of google's speech

Acier 8 Nov 21, 2022
❤️ Hi There Im Cozmo Music Bot A next gen powerful telegram group Music bot for get your Songs and music @Venuja_Sadew

🎵 Cozmo MUSIC 🎵 Cozmo Music is a Music powerfull bot for playing music on telegram voice chat groups. Requirements FFmpeg NodeJS nodesource.com Pyth

Venuja Sadew 3 Jan 08, 2022
An AI for Music Generation

An AI for Music Generation

Hao-Wen Dong 1.3k Dec 31, 2022
This bot can stream audio or video files and urls in telegram voice chats

Voice Chat Streamer This bot can stream audio or video files and urls in telegram voice chats :) 🎯 Follow me and star this repo for more telegram bot

WiskeyWorm 4 Oct 09, 2022
Audio spatialization over WebRTC and JACK Audio Connection Kit

Audio spatialization over WebRTC Spatify provides a framework for building multichannel installations using WebRTC.

Bruno Gola 34 Jun 29, 2022
An 8D music player made to enjoy Halloween this year!🤘

HAPPY HALLOWEEN buddy! Split Player Hello There! Welcome to SplitPlayer... Supposed To Be A 8DPlayer.... You Decide.... It can play the ordinary audio

Akshat Kumar Singh 1 Nov 04, 2021
A voice control utility for Spotify

Spotify Voice Control A voice control utility for Spotify · Report Bug · Request

Shoubhit Dash 27 Jan 01, 2023
Code for paper 'Audio-Driven Emotional Video Portraits'.

Audio-Driven Emotional Video Portraits [CVPR2021] Xinya Ji, Zhou Hang, Kaisiyuan Wang, Wayne Wu, Chen Change Loy, Xun Cao, Feng Xu [Project] [Paper] G

197 Dec 31, 2022
User-friendly Voice Cloning Application

Multi-Language-RTVC stands for Multi-Language Real Time Voice Cloning and is a Voice Cloning Tool capable of transfering speaker-specific audio featur

Sven Eschlbeck 19 Dec 30, 2022
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
Omniscient Mozart, being able to transcribe everything in the music, including vocal, drum, chord, beat, instruments, and more.

OMNIZART Omnizart is a Python library that aims for democratizing automatic music transcription. Given polyphonic music, it is able to transcribe pitc

MCTLab 1.3k Jan 08, 2023