Skip to content

Kaxatcmd/camel-hot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ Camel-Hot β€” DJ Harmonic Analyzer

Analyze audio files, detect musical keys and BPM, organize your library by Camelot notation, and generate harmonic mixing playlists β€” all from a clean PyQt5 desktop GUI.

CI Python 3.8+ PyQt5 License: MIT


Features

Feature Details
🎡 Key Detection Chroma-based analysis via librosa; outputs musical key + Camelot code
πŸ₯ BPM Detection Onset-based tempo estimation
⚑ Energy Analysis Brightness, density, energy curve classification
🎢 Groove Detection Kick presence, swing, percussion density
😊 Mood Classification Major/minor tonality, aggressiveness, tension, brightness
πŸ“ Library Organizer Batch-copies files into CH_Org[N]/[key]_Camelot/ hierarchy
🎧 Playlist Generator 4 strategies: harmonic, harmonic sequence, key-to-key, Camelot zone
↔️ Transition Scoring 0–1 compatibility rating across harmonic, BPM, groove, mood, energy dimensions
πŸŒ™ Day / Night Theme Full dark/light theme toggle
🌐 Multi-language English, Portuguese, Spanish
πŸ“Š Camelot Wheel Built-in interactive Camelot wheel visualization
πŸ“ˆ Real-time Progress Animated per-file progress dialog with live speed/ETA stats

Screenshots

CAMEL-HOT Compatibility Tab


Installation

Requirements

  • Python 3.8 or higher
  • libsndfile and ffmpeg (system packages β€” see platform notes below)

Platform notes

Platform Command
Ubuntu / Debian sudo apt install libsndfile1 ffmpeg
Fedora / RHEL sudo dnf install libsndfile ffmpeg
macOS brew install libsndfile ffmpeg
Windows Install FFmpeg and add to PATH

Setup

# 1. Clone
git clone https://github.com/your-username/camel-hot.git
cd camel-hot

# 2. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate

# 3. Install Python dependencies
pip install -r requirements.txt

# 4. Verify the installation
python test_setup.py

Run

python main.py

Or use the convenience script (activates venv, checks deps, launches GUI):

./run.sh

Usage

Analyze tab

Point at a single audio file and click Analyze. The app reports key, Camelot code, BPM, energy level, groove type, mood, and transition potential.

Organize tab

  1. Select an Input Folder (your music library).
  2. Select an Output Folder (where organized files will go).
  3. Click Organize β€” a naming dialog lets you choose the collection name (default: CH_Org1, auto-incremented).
  4. Files are copied into [output]/[CH_OrgN]/[key]_Camelot/ by default. Enable Move Files to remove originals.

Playlist tab

Choose one of four strategies and click Generate Playlist. A .m3u file is written to the location you specify.

Strategy What it does
Harmonic Filters tracks by key compatibility, optional BPM range
Harmonic Sequence Follows the Camelot wheel clockwise/counter-clockwise
Key-to-Key Finds the smoothest harmonic path between two keys
Camelot Zone Groups tracks within N positions of a target key

Compatibility tab

Load two audio files and click Compare. The transition score table shows harmonic, BPM, groove, mood, and energy sub-scores.


Project Structure

camel-hot/
β”œβ”€β”€ main.py                      # Entry point
β”œβ”€β”€ config.py                    # All constants and path helpers
β”œβ”€β”€ logging_config.py            # Log rotation and level control
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ pyproject.toml               # Packaging metadata + pytest/coverage config
β”‚
β”œβ”€β”€ audio_analysis/              # Business logic β€” no PyQt5 here
β”‚   β”œβ”€β”€ key_detection.py         # analyze_track() orchestrator
β”‚   β”œβ”€β”€ energy_detection.py
β”‚   β”œβ”€β”€ groove_analysis.py
β”‚   └── mood_classification.py
β”‚
β”œβ”€β”€ gui/
β”‚   β”œβ”€β”€ main_window.py           # PyQt5 window, QThread workers, dialogs
β”‚   └── file_manager/
β”‚       └── organizer.py         # File discovery, organize, M3U generation
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ camelot_map.py           # CAMELOT_MAP + compatibility helpers
β”‚   β”œβ”€β”€ transition_scoring.py    # Multi-dimension transition scoring
β”‚   β”œβ”€β”€ translations.py          # i18n strings
β”‚   └── dj_tips.py               # Contextual DJ tips
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ conftest.py              # Shared fixtures
β”‚   └── unit/                    # Fast unit tests (no audio files needed)
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ ARCHITECTURE.md
β”‚   β”œβ”€β”€ CAMELOT_SYSTEM.md
β”‚   β”œβ”€β”€ CONFIGURATION.md
β”‚   └── CONTRIBUTING.md
β”‚
└── assets/                      # Images used by the GUI

Development

Run tests

# Unit tests only (fast β€” no audio files, no display required)
python -m pytest tests/unit/ -v

# With coverage report
python -m pytest tests/unit/ \
    --cov=audio_analysis --cov=gui/file_manager --cov=utils --cov=config \
    --cov-report=term-missing

Code style

pip install flake8
flake8 . --select=E9,F63,F7,F82 --exclude=venv,.venv

See docs/CONTRIBUTING.md for the full developer guide: branching model, commit conventions, architecture rules, and PR process.


How it works

Analysis pipeline

Audio file
  β”‚
  β”œβ”€β†’ detect_key_from_audio()  β†’  key + Camelot code + confidence
  β”œβ”€β†’ detect_bpm()             β†’  BPM
  β”œβ”€β†’ analyze_groove()         β†’  kick/swing/percussion profile
  β”œβ”€β†’ classify_mood()          β†’  tonality / aggressiveness / tension
  └─→ analyze_energy()         β†’  level / brightness / density / curve
  β”‚
  └─→ analyze_track() dict  ←  consumed by GUI, organizer, playlist, scoring

Camelot compatibility rules

Two tracks are harmonically compatible if their Camelot codes differ by:

  • 0 β€” same key
  • 0, A↔B β€” relative major/minor (same number, different letter)
  • Β±1 β€” adjacent position on the wheel

utils/camelot_map.py implements all compatibility checks and provides a 0–100 score.


Supported audio formats

.mp3 Β· .wav Β· .flac Β· .ogg Β· .m4a Β· .aac Β· .aiff


Troubleshooting

GUI fails to launch

python -c "from gui.main_window import DJAnalyzerGUI"

Shows the exact import error.

Key detection returns "Unknown"

  • Check librosa is installed: pip show librosa
  • Check the file is valid: try playing it in another app
  • See logs/dj_analyzer.log for the full error

libsndfile not found on Linux

sudo apt install libsndfile1

Contributing

Pull requests are welcome! Please read docs/CONTRIBUTING.md first.

Open a bug report or feature request using the GitHub issue templates.


License

MIT Β© 2026 Camel-Hot contributors

About

Harmonic Music Analyzer for DJs - Analyze music by harmonic key and organize intelligently

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors