Skip to main content

CLI Audio Analyzer for Music Producers - DnB, Techno, House

Project description

mixref

Tests Documentation Code Quality codecov PyPI version Python Versions License: MIT Documentation Status

CLI Audio Analyzer for Music Producers

Status: v0.4.0 - Feature Complete! ๐ŸŽ‰

A sharp, opinionated audio analysis tool that speaks the language of producers. Not another generic analyzerโ€”built specifically for electronic music (Drum & Bass, Techno, House) with genre-aware insights that matter.

Features

๐ŸŽš๏ธ Professional Loudness Analysis

  • EBU R128 Metering: Integrated LUFS, True Peak (dBTP), Loudness Range (LRA)
  • Platform Targets: Spotify (-14), YouTube (-14), Apple Music (-16), Club (-6 to -8)
  • Genre Awareness: DnB, Techno, House, Dubstep, Trance profiles
  • Real-time Warnings: Clipping detection, loudness guidance

๐ŸŽต Musical Analysis

  • BPM Detection: Genre-aware tempo detection with half-time correction
  • Key Detection: Krumhansl-Schmuckler algorithm with Camelot notation (8A, 5B, etc.)
  • Confidence Scores: Know how reliable the detection is

๐Ÿ“Š Spectral Analysis

  • 5-Band Breakdown: Sub (20-60Hz), Low (60-250Hz), Mid (250-2kHz), High (2-8kHz), Air (8-20kHz)
  • Visual Bars: See your frequency balance at a glance
  • Percentage Distribution: Understand where your energy sits

๐Ÿ”„ A/B Comparison

  • Reference Matching: Compare your mix against professional tracks
  • Side-by-Side Analysis: Loudness, spectral, BPM, and key comparison
  • Smart Suggestions: Get actionable feedback on what to adjust
  • Difference Highlighting: See exactly where you differ (> 3% significance threshold)

๐Ÿ“ค Flexible Output

  • Rich CLI Tables: Beautiful terminal output with colors and formatting
  • JSON Export: Perfect for scripting and automation
  • Multiple Formats: WAV, FLAC, MP3, OGG, AIFF support

Installation

# From PyPI
pip install mixref

# Or with uv
uv pip install mixref

System Requirements

  • Python: 3.12 or 3.13
  • Platforms: Linux, macOS, Windows

โš ๏ธ Known Issue: Python 3.13 on Windows is not currently supported due to numpy/librosa compatibility issues. Windows users should use Python 3.12. This limitation does not affect Linux or macOS.

Quick Start

Python API

from mixref.audio import load_audio
from mixref.meters import calculate_lufs
from mixref.detective import detect_tempo, detect_key

# Load and analyze
audio, sr = load_audio("your_track.wav")

# Get loudness metrics
result = calculate_lufs(audio, sr)
print(f"LUFS: {result.lufs_integrated}")
print(f"True Peak: {result.true_peak_dbtp}")

# Detect BPM and key
bpm = detect_tempo(audio, sr)
key = detect_key(audio, sr)
print(f"Tempo: {bpm.bpm} BPM")
print(f"Key: {key.key_name} ({key.camelot_code})")

CLI Usage

# Check version
mixref --version

# Analyze a track
mixref analyze my_track.wav

# With platform target
mixref analyze track.wav --platform spotify

# With genre awareness
mixref analyze dnb_track.wav --genre dnb

# JSON output for scripting
mixref analyze track.wav --json | jq '.lufs.integrated'

# Compare your mix to a reference
mixref compare my_mix.wav professional_reference.wav

# Full comparison with BPM and key
mixref compare my_track.wav reference.wav --bpm --key

# Compare with JSON output
mixref compare track1.wav track2.wav --json

Live Demos

๐Ÿ“Š Analyze Command

analyze demo

Analyze any track to get loudness metrics, BPM, key, and spectral balance. Add --genre dnb for genre-specific feedback.

๐Ÿ”„ Compare Command

compare demo

Compare your mix against professional references with side-by-side analysis and smart suggestions.

Real-World Example

$ mixref analyze neurofunk_banger.wav --genre dnb

             Analysis: neurofunk_banger.wav             
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Metric              โ”ƒ        Value โ”ƒ Status โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Integrated Loudness โ”‚    -6.2 LUFS โ”‚   ๐Ÿ”ด   โ”‚
โ”‚ True Peak           โ”‚    -0.8 dBTP โ”‚   โš ๏ธ   โ”‚
โ”‚ Loudness Range      โ”‚       5.2 LU โ”‚   โ„น    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Tempo               โ”‚    174.0 BPM โ”‚   โ“   โ”‚
โ”‚ Key                 โ”‚ F minor (4A) โ”‚   โ“   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Sub                 โ”‚   โ– โ– โ– โ– โ– โ– โ– โ–กโ–กโ–ก โ”‚ 35.2%  โ”‚
โ”‚ Low                 โ”‚   โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–ก โ”‚ 28.4%  โ”‚
โ”‚ Mid                 โ”‚   โ– โ– โ– โ– โ–กโ–กโ–กโ–กโ–กโ–ก โ”‚ 18.1%  โ”‚
โ”‚ High                โ”‚   โ– โ– โ– โ– โ– โ– โ–กโ–กโ–กโ–ก โ”‚ 14.2%  โ”‚
โ”‚ Air                 โ”‚   โ– โ–กโ–กโ–กโ–กโ–กโ–กโ–กโ–กโ–ก โ”‚  4.1%  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โš ๏ธ  Platform Targets
  โ€ข Spotify (-14):      ๐Ÿ”ด +7.8 dB too loud
  โ€ข YouTube (-14):      ๐Ÿ”ด +7.8 dB too loud
  โ€ข Club/DJ:            ๐ŸŸข OK for club play

๐Ÿ’ก Genre Insights (DnB)
  โ€ข Sub-bass is strong (35%) - typical for neurofunk
  โ€ข True peak close to 0dB - consider -1dB headroom

Documentation

Full documentation is available at caparrini.github.io/mixref

Development

# Clone and setup
git clone https://github.com/caparrini/mixref.git
cd mixref
uv sync --all-extras

# Run tests
uv run pytest

# Type check
uv run mypy src/

# Lint and format
uv run ruff check src/
uv run ruff format src/

# Build docs
cd docs && uv run sphinx-build -b html source build/html

See CONTRIBUTING.md for detailed development guidelines.

CI/CD

This project uses GitHub Actions for continuous integration:

  • โœ… Tests: Python 3.12-3.13 on Ubuntu, macOS, Windows
  • ๐Ÿ“š Docs: Auto-deployed to GitHub Pages
  • ๐Ÿ” Quality: Linting, type checking, coverage (88%+)
  • ๐Ÿ“ฆ Publish: Automated PyPI releases
  • ๐Ÿ“Š Coverage: Tracked on Codecov

See .github/CICD_SETUP.md for CI/CD configuration details.

Links

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mixref-0.4.0.tar.gz (176.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mixref-0.4.0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file mixref-0.4.0.tar.gz.

File metadata

  • Download URL: mixref-0.4.0.tar.gz
  • Upload date:
  • Size: 176.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mixref-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dbec8bf69658146854225052fdd5f66c9f1e979d616668484f32aea7f1443bf7
MD5 2b0dc265b9c8f55edef79241031a4768
BLAKE2b-256 7b679dc4c05cb2e928b0731c1da5b39a245e3b837f99ec4176457217f5dcddde

See more details on using hashes here.

Provenance

The following attestation bundles were made for mixref-0.4.0.tar.gz:

Publisher: publish.yml on Caparrini/mixref

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mixref-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mixref-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mixref-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe45b99f48e79db1b833bb030b0c5dbce78211f75b2dd3b8d36d32e526c6024
MD5 6278e267c5209d44da2cd7da40b62607
BLAKE2b-256 91b340613281f84701b226d36422d5ab639c988e2c21e567c4454643b2d80eea

See more details on using hashes here.

Provenance

The following attestation bundles were made for mixref-0.4.0-py3-none-any.whl:

Publisher: publish.yml on Caparrini/mixref

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page