A CLI tool that calculates pitch adjustment percentages for DJ tracks, helping you beatmatch on CDJs without sync functionality.
When performing on CDJs that lack sync functions, you need to manually match the speed of each song to your set's BPM. Rather than doing this by ear, this tool calculates the exact percentage adjustment needed.
The tool scans your music files, reads the BPM from the filename, and renames each file to include the pitch adjustment percentage needed to match your target BPM.
- Python 3.10+
- Music files with BPM in the filename (e.g., from Mixed In Key)
git clone https://github.com/yourusername/DJ-Beatmatch-Encoder.git
cd DJ-Beatmatch-EncoderNo additional dependencies required - uses only Python standard library.
python3 beatmatch_encoder.py -d <directory> -b <bpm> [options]| Argument | Description |
|---|---|
-d, --directory |
Directory containing music files |
-b, --bpm |
Base BPM of your DJ set |
| Argument | Description |
|---|---|
-n, --dry-run |
Preview changes without renaming files |
-v, --verbose |
Enable detailed output |
-q, --quiet |
Suppress non-error messages |
-h, --help |
Show help message |
Preview what changes would be made:
python3 beatmatch_encoder.py -d ~/Music/DJSet -b 128 --dry-runRename files with pitch adjustments for a 130 BPM set:
python3 beatmatch_encoder.py -d ~/Music/DJSet -b 130Verbose output for debugging:
python3 beatmatch_encoder.py -d ~/Music/DJSet -b 128 -vYour music files must include the BPM in the filename with this pattern:
<track info> - <BPM>.<extension>
Examples of valid filenames:
01. Artist - Track Name - 128.mp3Song Title - 140.wavMy Track - 125.flac
Output after processing (with base BPM of 130):
01. (+1.56) Artist - Track Name - 128.mp3(-7.14) Song Title - 140.wav(+4.0) My Track - 125.flac
The pitch adjustment placement depends on the filename format:
- With track number (e.g.,
01.,01,1.): inserted after the number - Without track number: prepended to the beginning of the filename
The pitch adjustment formula calculates the percentage change needed:
adjustment = ((base_bpm - track_bpm) / track_bpm) × 100
- Positive values (+): Speed up the track (track is slower than set)
- Negative values (−): Slow down the track (track is faster than set)
- Zero (0): Track already matches set BPM
- Filenames must follow the expected BPM pattern (
- XXX.) - Non-UTF-8 characters in filenames may cause issues