?️ 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
cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python

audioread Decode audio files using whichever backend is available. The library currently supports: Gstreamer via PyGObject. Core Audio on Mac OS X via

beetbox 419 Dec 26, 2022
cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python

audioread Decode audio files using whichever backend is available. The library currently supports: Gstreamer via PyGObject. Core Audio on Mac OS X via

beetbox 359 Feb 15, 2021
Audio augmentations library for PyTorch for audio in the time-domain

Audio augmentations library for PyTorch for audio in the time-domain, with support for stochastic data augmentations as used often in self-supervised / contrastive learning.

Janne 166 Jan 8, 2023
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
convert-to-opus-cli is a Python CLI program for converting audio files to opus audio format.

convert-to-opus-cli convert-to-opus-cli is a Python CLI program for converting audio files to opus audio format. Installation Must have installed ffmp

null 4 Dec 21, 2022
BART aids transcribe tasks by taking a source audio file and creating automatic repeated loops, allowing transcribers to listen to fragments multiple times

BART (Beyond Audio Replay Technology) aids transcribe tasks by taking a source audio file and creating automatic repeated loops, allowing transcribers to listen to fragments multiple times (with possible overlap between segments).

null 2 Feb 4, 2022
Stevan KZ 1 Oct 27, 2021
Synthesia but open source, made in python and free

PyPiano Synthesia but open source, made in python and free Requirements are in requirements.txt If you struggle with installation of pyaudio, run : pi

DaCapo 11 Nov 6, 2022
C++ library for audio and music analysis, description and synthesis, including Python bindings

Essentia Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPL license.

Music Technology Group - Universitat Pompeu Fabra 2.3k Jan 3, 2023
An app made in Python using the PyTube and Tkinter libraries to download videos and MP3 audio.

yt-dl (GUI Edition) An app made in Python using the PyTube and Tkinter libraries to download videos and MP3 audio. How do I download this? Windows: Fi

null 1 Oct 23, 2021
DeepSpeech is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers.

Project DeepSpeech DeepSpeech is an open-source Speech-To-Text engine, using a model trained by machine learning techniques based on Baidu's Deep Spee

Mozilla 20.8k Jan 3, 2023
SU Music Player — The first open-source PyTgCalls based Pyrogram bot to play music in voice chats

SU Music Player — The first open-source PyTgCalls based Pyrogram bot to play music in voice chats Note Neither this, or PyTgCalls are fully

SU Projects 58 Jan 2, 2023
Spotifyd - An open source Spotify client running as a UNIX daemon.

Spotifyd An open source Spotify client running as a UNIX daemon. Spotifyd streams music just like the official client, but is more lightweight and sup

null 8.5k Jan 9, 2023
Open-Source bot to play songs in your Telegram's Group Voice Chat. Powered by @Akki_ThePro

VcPlayer Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜ Account requirements A Telegram account to use as the music bot, You cannot use regular

Akki ThePro 2 Dec 25, 2021
Audio fingerprinting and recognition in Python

dejavu Audio fingerprinting and recognition algorithm implemented in Python, see the explanation here: How it works Dejavu can memorize audio by liste

Will Drevo 6k Jan 6, 2023
Python library for audio and music analysis

librosa A python package for music and audio analysis. Documentation See https://librosa.org/doc/ for a complete reference manual and introductory tut

librosa 5.6k Jan 6, 2023
Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications

A Python library for audio feature extraction, classification, segmentation and applications This doc contains general info. Click here for the comple

Theodoros Giannakopoulos 5.1k Jan 2, 2023
Manipulate audio with a simple and easy high level interface

Pydub Pydub lets you do stuff to audio in a way that isn't stupid. Stuff you might be looking for: Installing Pydub API Documentation Dependencies Pla

James Robert 6.6k Jan 1, 2023
Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications

A Python library for audio feature extraction, classification, segmentation and applications This doc contains general info. Click here for the comple

Theodoros Giannakopoulos 3.8k Feb 17, 2021