name: voice-note-to-midi description: Convert voice notes, humming, and melodic audio recordings to quantized MIDI files using ML-based pitch detection and intelligent post-processing author: Clawd tags: [audio, midi, music, transcription, machine-learning]
Transform your voice memos, humming, and melodic recordings into clean, quantized MIDI files ready for your DAW.
This skill provides a complete audio-to-MIDI conversion pipeline that:
小蔥技能7w4.net有更新,你可以訪問看下。
Audio Input (WAV/M4A/MP3)
↓
┌─────────────────────────────────────┐
│ Step 1: Stem Separation (HPSS) │
│ - Isolate harmonic content │
│ - Remove drums/percussion │
│ - Noise gating │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Step 2: Pitch Detection │
│ - Basic Pitch ML model (Spotify) │
│ - Polyphonic note detection │
│ - Onset/offset estimation │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Step 3: Analysis │
│ - Pitch class distribution │
│ - Key detection │
│ - Dominant note identification │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Step 4: Quantization & Cleanup │
│ - Timing grid snap │
│ - Key-aware pitch correction │
│ - Octave pruning (harmonic removal) │
│ - Overlap-based pruning │
│ - Note merging (legato) │
│ - Velocity normalization │
└─────────────────────────────────────┘
↓
MIDI Output (Standard MIDI File)
Quick Install (Recommended):
cd /path/to/voice-note-to-midi
./setup.sh
This automated script will:
- Check Python 3.11+ is installed
- Create the ~/melody-pipeline directory
- Set up the virtual environment
- Install all dependencies (basic-pitch, librosa, music21, etc.)
- Download and configure the hum2midi script
- Add melody-pipeline to your PATH
Manual Install:
If you prefer manual setup:
mkdir -p ~/melody-pipeline
cd ~/melody-pipeline
python3 -m venv venv-bp
source venv-bp/bin/activate
pip install basic-pitch librosa soundfile mido music21
chmod +x ~/melody-pipeline/hum2midi
echo 'export PATH="$HOME/melody-pipeline:$PATH"' >> ~/.bashrc
source ~/.bashrc
cd ~/melody-pipeline
./hum2midi --help
Convert a voice memo to MIDI:
./hum2midi my_humming.wav
This creates my_humming.mid with 16th-note quantization.
./hum2midi input.wav output.mid
| Option | Description | Default |
|---|---|---|
--grid <value> |
Quantization grid: 1/4, 1/8, 1/16, 1/32 |
1/16 |
--min-note <ms> |
Minimum note duration in milliseconds | 50 |
--no-quantize |
Skip quantization (output raw Basic Pitch MIDI) | disabled |
--key-aware |
Enable key-aware pitch correction | disabled |
--no-analysis |
Skip pitch analysis and key detection | disabled |
./hum2midi melody.wav --grid 1/8
./hum2midi song.wav --key-aware
./hum2midi humming.wav --min-note 100
./hum2midi quick.wav --no-analysis
./hum2midi recording.wav output.mid --grid 1/8 --key-aware --min-note 80
You can also process existing MIDI files through the quantization pipeline:
./hum2midi input.mid output.mid --grid 1/16 --key-aware
This skips the audio processing steps and goes directly to analysis and quantization.
═══════════════════════════════════════════════════════════════
hum2midi - Melody-to-MIDI Pipeline (Basic Pitch Edition)
[Key-Aware Mode Enabled]
═══════════════════════════════════════════════════════════════
Input: my_humming.wav
Output: my_humming.mid
→ Step 1: Stem Separation (HPSS)
Isolating melodic content...
Loaded: 5.23s @ 44100Hz
✓ Melody stem extracted → 5.23s
→ Step 2: Audio-to-MIDI Conversion (Basic Pitch)
Running Spotify's Basic Pitch ML model on melody stem...
✓ Raw MIDI generated (Basic Pitch)
→ Step 3: Pitch Analysis & Key Detection
Notes detected: 42 total, 7 unique
Note range: C3 - G4
Pitch classes: C3, E3, G3, A3, C4, D4, G4
Dominant note: G3 (23.8% of notes)
Detected key: G major
→ Step 4: Quantization & Cleanup
Octave pruning: removed 3 harmonic notes above 67 (median+12)
Overlap pruning: removed 2 harmonic notes at overlapping positions
Note merging: merged 5 staccato chunks into legato notes (gap<=60 ticks)
Grid: 240 ticks (1/16)
Notes: 38 notes
Key: G major
Key-aware: 2 notes corrected to scale
Tempo: 120 BPM
✓ Quantized MIDI saved
═══════════════════════════════════════════════════════════════
✓ Done! Output: my_humming.mid
═══════════════════════════════════════════════════════════════
📊 ANALYSIS SUMMARY
─────────────────────────────────────────────────────────────
Detected Notes: C3, E3, G3, A3, C4, D4, G4
Detected Key: G major
Quantization: Key-aware mode (notes snapped to scale)
MIDI Info: 38 notes, 7 unique pitches, 120 BPM
Pitches: C3, E3, G3, A3, C4, D4, G4
After generating MIDI, you may want to:
Input formats supported via FFmpeg: - WAV, AIFF, FLAC (uncompressed, best quality) - MP3, M4A, AAC (compressed, acceptable) - OGG, OPUS (open source formats) - Most other formats FFmpeg supports
--min-note threshold--key-aware to constrain to musical scaleThis skill integrates Basic Pitch by Spotify, which is licensed under Apache 2.0. The pipeline script and documentation are provided under MIT license.
這個 Skill 質量中等偏上,文件寫得很詳細清楚,安裝使用都有傻瓜式引導。但本質上它只是一個指令碼封裝,核心功能都是呼叫別人的工具,沒有自己的程式碼實現。文件裡有幾處命令拼寫錯誤,容易讓新手踩坑。如果你需要的是完整的音訊轉 MIDI 解決方案可以用,但如果想深入定製或擴充套件功能,目前可能滿足不了。.