BigCatDjPlayer / README.md
Luis-Filipe's picture
Update README.md
e6dace8 verified
metadata
license: apache-2.0
title: '# 🎡 Professional MP3 Mixer with Transitions'
sdk: docker

🎡 Professional MP3 Mixer with Transitions

A powerful web application that allows you to upload 2-20 MP3 files and create a seamless mixed audio track with intelligent transitions between songs.

πŸš€ Features

🎯 Core Functionality

  • Upload 2-20 MP3 Files: Support for multiple audio files with validation
  • Smart Transitions: Automatic detection and creation of optimal transitions
  • Professional Quality: 44.1kHz output with normalization
  • Multiple Output Formats: WAV and MP3 export options

πŸŽ›οΈ Transition Types

  • Beat-Match: For tracks with 95%+ BPM compatibility
  • Harmonic: Key-based transitions for musical compatibility
  • Standard Crossfade: Smooth linear blending for all tracks

πŸ“Š Audio Analysis

  • BPM Detection: Automatic tempo analysis using librosa
  • Key Detection: Musical key identification for harmonic mixing
  • Energy Analysis: Track energy measurement for smooth transitions
  • Duration Tracking: Precise timing for seamless mixing

🎡 How to Use

Step 1: Upload MP3 Files

  • Upload between 2 to 20 MP3 files
  • Files will be automatically analyzed for BPM, key, and energy
  • Drag and drop or select files manually

Step 2: Configure Settings

  • Transition Duration: 2-10 seconds (default: 4 seconds)
  • Output Format: WAV (recommended) or MP3

Step 3: Create Mix

  • Click "Create Mix" to process all tracks
  • The app will analyze compatibility and create optimal transitions
  • Download your professional mixed audio track

🎼 Transition Algorithm

Compatibility Scoring

The app analyzes each pair of tracks to determine the best transition type:

  1. BPM Compatibility Check

    • Calculate tempo difference between tracks
    • High compatibility (>95%): Beat-match transition
    • Good compatibility (>80%): Harmonic transition
    • Lower compatibility: Standard crossfade
  2. Key Compatibility

    • Musical key analysis for harmonic mixing
    • Compatible keys get smoother transitions
    • Incompatible keys get filtered transitions
  3. Energy Matching

    • Maintain consistent energy flow
    • Smooth transitions between high/low energy tracks

Transition Types

πŸ”„ Beat-Match Transition (95%+ BPM compatibility)

  • Precise tempo matching using playback rate adjustment
  • 8-second transition duration
  • Maintains original musical integrity

🎡 Harmonic Transition (80%+ compatibility)

  • Key-based transitions for musical compatibility
  • 12-second transition with subtle EQ
  • Smooth frequency blending

🌊 Standard Crossfade (All tracks)

  • Linear crossfade with customizable duration
  • 4-20 second transition options
  • Works with any track combination

πŸ“‹ Technical Specifications

Input Requirements

  • File Format: MP3 only
  • File Count: 2-20 files
  • Maximum File Size: No hard limit (browser dependent)
  • Sample Rate: Any (resampled to 44.1kHz)

Output Specifications

  • Sample Rate: 44.1kHz
  • Bit Depth: 16-bit
  • Channels: Stereo
  • Normalization: Automatic peak normalization

Processing Features

  • Real-time Analysis: BPM, key, and energy detection
  • Smart Transitions: Automatic transition type selection
  • Quality Enhancement: Noise reduction and normalization
  • Format Support: WAV (recommended) and MP3 export

πŸ—οΈ Technical Architecture

Backend (Python)

  • librosa: Audio analysis and feature extraction
  • pydub: Audio manipulation and format conversion
  • numpy: Numerical processing for audio algorithms
  • Gradio: Web interface and file handling

Audio Processing Pipeline

  1. File Upload & Validation
  2. Audio Analysis (BPM, key, energy, duration)
  3. Compatibility Assessment between track pairs
  4. Transition Type Selection based on compatibility
  5. Audio Processing with optimal transitions
  6. Normalization & Export to final format

Web Interface

  • Gradio Blocks: Modern web interface
  • File Upload: Drag & drop with validation
  • Real-time Progress: Processing status updates
  • Audio Playback: Preview mixed track in browser
  • Download: Direct file download of mixed track

🌐 Deployment

Hugging Face Spaces

This app is ready for deployment on Hugging Face Spaces:

  1. Upload all files to a new Space
  2. Choose Docker SDK for Python applications
  3. Automatic build with dependencies
  4. Get live URL in 2-3 minutes

Local Development

# Install dependencies
pip install -r requirements.txt

# Run the application
python app.py

πŸ“Š Performance

Processing Time

  • Analysis: ~2-5 seconds per track
  • Transition Creation: ~1-3 seconds per transition
  • Final Export: ~5-15 seconds depending on total duration

Quality Metrics

  • BPM Accuracy: Β±1-2 BPM typical
  • Transition Smoothness: Seamless with no audible gaps
  • Audio Quality: Professional broadcast quality
  • Format Compatibility: Universal WAV/MP3 support

πŸŽ“ Educational Value

This application demonstrates:

  • Audio Signal Processing: Real-world audio manipulation
  • Music Information Retrieval: BPM and key detection
  • Algorithm Design: Transition optimization strategies
  • Web Development: Modern web app with audio processing
  • Python Audio Libraries: Professional audio toolchain

πŸ“ Example Usage

Perfect for:

  • DJ Practice: Create practice mixes from your collection
  • Podcast Production: Combine multiple audio segments
  • Music Education: Learn about audio transitions and mixing
  • Content Creation: Create seamless audio content
  • Remix Practice: Study how different tracks work together

Input Example:

Track 1: Charlotte de Witte - Roar (128 BPM, Am)
Track 2: Amelie Lens - Drift (130 BPM, C)
Track 3: Adam Beyer - Consciousness (127 BPM, F)
...

Output Result:

  • Single mixed audio file
  • Professional transitions between tracks
  • Consistent volume and quality
  • Ready for broadcast or distribution

πŸ”§ Requirements

System Requirements

  • Python 3.8+: Core runtime
  • FFmpeg: Audio format conversion
  • Audio Libraries: libsndfile, portaudio
  • Web Browser: Modern browser with audio support

Dependencies

All dependencies are listed in requirements.txt:

  • librosa (audio analysis)
  • pydub (audio manipulation)
  • soundfile (audio I/O)
  • gradio (web interface)
  • numpy (numerical processing)

🎯 Future Enhancements

Potential improvements:

  • More Audio Formats: Support for FLAC, OGG, M4A
  • Advanced Effects: Reverb, delay, filters during transitions
  • Visual Waveforms: Real-time waveform visualization
  • Transition Preview: Preview transitions before mixing
  • Batch Processing: Multiple mix projects simultaneously

Create professional mixed audio tracks from your MP3 collection with intelligent transitions! 🎡🎧