Melodfy v2 (melodfy_v2) — Piano Audio-to-MIDI ONNX Models
Official ONNX weights for Melodfy✨ — an open-source, cross-platform AI Piano-to-MIDI desktop application by @iamhemantin.
Model Files
| File | Size | Purpose |
|---|
melodfy_v2_frontend.onnx | 117 KB | 24 kHz 4-harmonic CQT + temporal phase-derivative acoustic frontend ((1, N) -> (1, 5, 264, T)) |
melodfy_v2_int8.onnx | 25.04 MB | Default INT8-MatMul/Gemm quantized PhaseConformerRoPE + OffsetRefinementHead backbone |
melodfy_v2_fp32.onnx | 60.87 MB | Full-precision FP32 PhaseConformerRoPE + OffsetRefinementHead backbone |
Benchmarks (12 Real Disklavier test Tracks, Clean & MUSAN+Phone OOD)
| Model Variant | Size | Clean Onset | Clean Offset | Clean Vel | OOD Onset | OOD Offset | OOD Vel | Backbone CPU RTF | E2E CPU RTF |
|---|
melodfy_v2_int8.onnx (Default) | 25.04 MB | 87.19% | 58.23% | 43.87% | 79.81% | 50.46% | 35.94% | 137.20x | 62.98x |
melodfy_v2_fp32.onnx | 60.87 MB | 87.18% | 58.09% | 43.89% | 79.75% | 50.81% | 36.39% | 135.47x | 59.44x |
Quick Usage with Melodfy
git clone https://github.com/HemantKArya/Melodfy.git
cd Melodfy
pip install -r requirements.txt
python download_models.py # Downloads frontend + INT8 (default)
python download_models.py --all # Also downloads FP32
python main.py
Direct ONNX Runtime Inference (Python)
import numpy as np
import onnxruntime as ort
fe = ort.InferenceSession("melodfy_v2_frontend.onnx", providers=["CPUExecutionProvider"])
bb = ort.InferenceSession("melodfy_v2_int8.onnx", providers=["CPUExecutionProvider"])
audio = np.zeros((1, 192000), dtype=np.float32) # 8.0s mono @ 24 kHz
hcqt_phase = fe.run(None, {"audio": audio})[0] # (1, 5, 264, 751)
onset_logits, onset_reg, offset_logits, offset_reg, frame_logits, velocity, pedal_logits = bb.run(
None, {"hcqt_phase": hcqt_phase}
)