A minimal music practice application for musicians to analyze, loop, and practice with audio tracks. Features real-time audio analysis, stem separation, and interactive waveform visualization.
Note: This application has primarily been tested on macOS Apple Silicon. While it should work on other platforms, some features may require additional setup or may not be fully optimized.
π― For Best Results: We highly recommend installing the optional Vamp plugins (Chordino, qm-vamp-plugins) for significantly improved chord detection, key estimation, and beat tracking accuracy. See the "Optional Enhanced Analysis Plugins" section below for installation instructions.
- Chord Detection: Advanced chord recognition with optional Chordino plugin support
- Key Detection: Automatic key estimation with optional qm-keydetector and Chordino plugin support
- Audio Analysis: Beat tracking, tempo estimation, and harmonic analysis
- Interactive Waveform: Visual waveform with chord annotations and beat markers
- Loop Management: Create, save, and manage multiple loops with visual flags
- Time Stretching: Pitch-preserving tempo adjustment (0.5x - 1.5x)
- Pitch Shifting: Tempo-preserving pitch adjustment (Β±12 semitones) with automatic key and chord transposition
- Stem Separation: AI-powered source separation using Demucs (vocals, drums, bass, etc.)
- Stem Notation Export: Generate a hybrid standard-notation + tablature PDF from a separated stem
- Session Management: Save and restore analysis data and loop configurations
- Cross-Platform: Works on macOS, Windows, and Linux
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtbrew install portaudio ffmpeg vamp-plugin-sdk libsndfilesudo apt-get update && sudo apt-get install -y python3-pip python3-venv portaudio19-dev ffmpegSimply run the main application file:
python app.pyThe application will start with all features available, including:
β Core Features (always available):
- Chord detection (internal algorithm)
- Key estimation (Krumhansl-Schmuckler)
- Beat tracking (Librosa-based)
- Time stretching (phase vocoder)
- Stem separation (Demucs AI)
- All UI and playback features
π― Highly Recommended Enhancements (significantly better accuracy):
- Professional chord detection (Chordino plugin)
- Professional key detection (qm-keydetector plugin)
- Professional beat tracking (qm-barbeattracker plugin)
Why Install Vamp Plugins?
- Much more accurate chord recognition
- Better key detection for complex harmonies
- More precise beat tracking for rhythm practice
- Professional-grade analysis used in music production
The app automatically detects available plugins and uses them when present, falling back to built-in algorithms when plugins are not installed.
- Load Audio: File β Open or drag & drop audio files (WAV, MP3, FLAC, M4A)
- Playback: Space bar or toolbar buttons
- Loop Creation:
- Drag on waveform to create new loops
- Click "Set A" and "Set B" buttons to set loop points
- Right-click loop flags to rename or delete
- Navigation:
- Click waveform to seek
- Mouse wheel to zoom in/out
- Arrow keys to pan left/right
- Time Stretching: Adjust rate slider (0.5x - 1.5x) for pitch-preserving tempo changes
- Pitch Shifting: Use pitch spinner (Β±12 semitones) for tempo-preserving pitch changes with automatic key/chord transposition
- Space: Play/Pause
- Left/Right Arrow: Skip to previous/next bar
- Home: Go to start of track
- Ctrl+O: Open audio file
- Ctrl+S: Save session
- Ctrl+Shift+O: Load session
- Ctrl+Shift+R: Recompute analysis
- View β Combined & Show Stems
- Automatically separates audio into vocals, drums, bass, guitar, piano, and other
- Individual volume and mute controls for each stem
- Focus Button: Click the focus button next to any stem to solo it and display a piano roll visualization
- Show Notation Button: Transcribe a stem to MIDI and render a combined notation + tablature PDF
- Uses Demucs AI model for high-quality separation
The notation export keeps intermediate artifacts per stem in the track's .musicpractice/notation/<stem>/ folder:
*_raw.mid: the direct Basic Pitch transcription*_clean.mid: instrument-aware cleaned MIDI used as the editable source of truth for notation*_quantized.mid: grid-snapped MIDI generated from the clean MIDI*.lyand*.pdf: the LilyPond source and rendered notation/tab PDF
If clean.mid or quantized.mid already exist, the app reuses them and only regenerates downstream artifacts when needed. This makes it easy to refine the clean or quantized MIDI in a DAW and reopen notation without retranscribing the audio.
- View β Show Stem Waveforms: Display individual waveforms for each separated stem
- View β Show Combined Waveform: Display the original full mix waveform
- Toggle between views to analyze individual parts or the complete mix
- File β Save Session: Saves loops, analysis data, and settings
- File β Load Session: Restores previous session state
- Sessions are automatically saved alongside audio files
- Analysis β Recompute analysis (Ctrl+Shift+R): Force re-analysis of current track
- Analysis β Always recompute on open: Automatically clear cache and re-analyze when opening files
- Clears cached chord detection, beat tracking, and stem separation data
- Toggle "Snap" checkbox to snap loop edges to detected beats
- Automatic beat and bar detection with visual markers
- Pitch Control: Use the pitch spinner in the toolbar to adjust pitch by Β±12 semitones
- Tempo Preservation: Pitch changes do not affect playback speed
- Automatic Transposition: Key labels and chord names are automatically transposed to match the new pitch
- Stem Processing: All separated stems are pitch-shifted together for consistent playback
- Caching: Pitch-shifted audio is cached for faster loading on subsequent sessions
- Reset Button: Quickly return to original pitch (0 semitones) using the Reset button
- Session Persistence: Pitch settings are saved and restored with session data
- Chord Detection: Template matching with Viterbi smoothing for major/minor triads and 7th chords, with optional Chordino plugin support for improved recognition
- Key Detection: Krumhansl-Schmuckler key profiles with enharmonic spelling, with optional qm-keydetector and Chordino plugin support for improved estimation
- Beat Tracking: Librosa-based onset detection and tempo estimation, with optional qm-barbeattracker plugin support for improved accuracy
- Time Stretching: Librosa phase vocoder implementation preserving pitch (0.5x - 1.5x range)
- Pitch Shifting: Librosa pitch shifting with tempo preservation (Β±12 semitones range)
- Input: WAV, MP3, FLAC, M4A, AAC
- Output: WAV (for rendered time-stretched audio)
- Core: PySide6 (Qt), NumPy, SciPy, Librosa, SoundDevice
- Audio Processing: SoundFile, FFmpeg
- AI Separation: Demucs, PyTorch (optional, CPU works)
- Enhanced Analysis: Vamp Plugin SDK, nnls-chroma (Chordino), qm-vamp-plugins (optional)
- Utilities: TQDM for progress bars
For improved chord detection and key estimation, you can install these optional Vamp plugins:
Chordino provides enhanced chord recognition capabilities. To install:
- Download Chordino: Visit the NNLS Chroma project page
- Install the plugin:
- macOS (Intel): Copy
nnls-chroma.dylibto~/Library/Audio/Plug-Ins/Vamp/ - macOS (Apple Silicon): Build from source as pre-built binaries are not available for ARM64
- Linux: Copy
nnls-chroma.soto/usr/local/lib/vamp/ - Windows: Copy
nnls-chroma.dllto your Vamp plugins directory
- macOS (Intel): Copy
- Set permissions:
chmod 755 ~/Library/Audio/Plug-Ins/Vamp/nnls-chroma.dylib
Note for Apple Silicon Macs: The Chordino plugin must be built from source as pre-compiled ARM64 binaries are not available. Follow the build instructions in the NNLS Chroma repository. Alternatively, pre-built ARM64 binaries (nnls-chroma.dylib) are available in the third-party/ directory of this project, but building from source is recommended.
The QM Key Detector plugin provides improved key estimation. To install:
- Download QM Vamp Plugins: Visit the QM Vamp Plugins page
- Install the plugin:
- macOS (Intel): Copy
qm-vamp-plugins.dylibto~/Library/Audio/Plug-Ins/Vamp/ - macOS (Apple Silicon): Build from source as pre-built binaries are not available for ARM64
- Linux: Copy
qm-vamp-plugins.soto/usr/local/lib/vamp/ - Windows: Copy
qm-vamp-plugins.dllto your Vamp plugins directory
- macOS (Intel): Copy
- Set permissions:
chmod 755 ~/Library/Audio/Plug-Ins/Vamp/qm-vamp-plugins.dylib
Note for Apple Silicon Macs: The QM Key Detector plugin must be built from source as pre-compiled ARM64 binaries are not available. Follow the build instructions in the QM Vamp Plugins repository. Alternatively, pre-built ARM64 binaries (qm-vamp-plugins.dylib) are available in the third-party/ directory of this project, but building from source is recommended.
Note: These plugins are automatically detected if installed. The application will fall back to built-in analysis methods if the plugins are not available.
The stem notation export is effectively a second Python toolchain inside this repo:
- The main MusicPractice app runs in the normal project environment from
requirements.txt - The notation/transcription helper runs in its own
.venv-basic-pitchenvironment
The notation helper environment is separate on purpose so the Basic Pitch stack and MIDI tooling do not have to be installed into the main app environment.
The stem notation export feature depends on:
- Spotify Basic Pitch in a separate helper environment for audio-to-MIDI transcription:
python3.11 -m venv .venv-basic-pitch && .venv-basic-pitch/bin/pip install -r requirements-basic-pitch.txt - LilyPond for rendering the final standard-notation + tablature PDF
The app looks for the helper interpreter at .venv-basic-pitch/bin/python by default.
If you keep it somewhere else, set BASIC_PITCH_PYTHON before launching the app.
The app will show a dependency message instead of failing if either tool is missing.
- Bass stems get additional pre-quantization cleanup to suppress ghost notes and out-of-register artifacts.
- Bass tablature uses phrase-aware fingering heuristics so the tab can favor more realistic string choices instead of only the lowest-fret spelling of each pitch.
- The notation cache is incremental: newer
clean.midregeneratesquantized.mid,.ly, and.pdf; newerquantized.midregenerates.lyand.pdf.
musicpractice/
βββ app.py # Main application and GUI with optimized waveform rendering
βββ audio_engine.py # Audio playback and time stretching
βββ chords.py # Chord detection and key estimation with Vamp plugin support
βββ stems.py # Stem separation with Demucs
βββ timestretch.py # Time stretching utilities
βββ utils.py # Helper functions
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ WaveformView.png # Screenshot of main waveform interface
βββ StemsView.png # Screenshot of stem separation interface
βββ third-party/ # Pre-built Vamp plugins for Apple Silicon
βββ nnls-chroma/
β βββ macosx-arm64/
β βββ nnls-chroma.dylib # Chordino chord detection plugin
βββ qm-vamp-plugins/
βββ macosx-arm64/
βββ qm-vamp-plugins.dylib # QM key detection plugin
- Time-stretch renders to temporary WAV files for playback (pitch preserved)
- Pitch-shifted audio is cached in
pitch+N/subdirectories for faster subsequent loading - Chord detection uses major/minor triads and 7th chords with Viterbi smoothing
- Stem separation requires significant CPU/GPU resources and may take several minutes
- Session files are saved as
.musicpractice.jsonalongside audio files - All analysis is cached and restored when reopening files
- Use "Recompute analysis" if you need fresh analysis results or encounter issues
- Stem separation results are cached in
.musicpractice/stems/directories


