Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!mg_cli.py
!requirements.txt
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.9-slim

RUN apt-get update && apt-get install -y libsndfile1 ffmpeg && rm -rf /var/lib/apt/lists/*
COPY requirements.txt mg_cli.py /app/
RUN cd /app && pip install --no-cache-dir -r requirements.txt
WORKDIR /data
ENTRYPOINT ["python3", "/app/mg_cli.py"]
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ And then:

```
usage: mg_cli.py [-h] [-b {16,24,32}] [--log LOG] [--no_limiter]
[--dont_normalize]
[--dont_normalize] [-r INTERNAL_SAMPLE_RATE]
target reference result

Simple Matchering 2.0 Command Line Application
Expand All @@ -94,8 +94,22 @@ optional arguments:
--no_limiter Disables the limiter at the final stage of processing
--dont_normalize Disables normalization, if --no_limiter is set. Can
cause clipping if the bit depth is not 32
-r INTERNAL_SAMPLE_RATE, --internal-sample-rate INTERNAL_SAMPLE_RATE
Set the internal sample rate (default: 44100 Hz)
```

## Docker Usage

1. Clone the repository.
2. Put your track and reference file to `./var` directory.
3. Execute:
4.
```bash
docker run -v "$PWD/var:/data" --rm $(docker build . -q) track.wav ref.wav mastered.wav --internal-sample-rate 48000
```

You may adjust `-v` value to any directory with your track and reference files.

### Visit **[Matchering main repo][matchering]** to learn more about it!

## A Coffee
Expand Down
12 changes: 12 additions & 0 deletions mg_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""

import matchering as mg
from matchering import Config
from argparse import ArgumentParser
import logging
import sys
Expand Down Expand Up @@ -51,6 +52,13 @@ def parse_args():
help="Disables normalization, if --no_limiter is set. "
"Can cause clipping if the bit depth is not 32",
)
parser.add_argument(
"-r",
"--internal-sample-rate",
type=int,
default=44100,
help="Set the internal sample rate (default: 44100 Hz)",
)
return parser.parse_args()


Expand Down Expand Up @@ -87,9 +95,13 @@ def run(args, logger):
logger.debug(f'Contributors: {", ".join(mg.__credits__)}')

try:
config = Config()
config.internal_sample_rate = args.internal_sample_rate

mg.process(
target=args.target,
reference=args.reference,
config=config,
results=[
mg.Result(
args.result,
Expand Down