model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- piano-transcription
|
| 5 |
+
- audio-to-midi
|
| 6 |
+
- music-transcription
|
| 7 |
+
- core-ai
|
| 8 |
+
- aimodel
|
| 9 |
+
- apple-silicon
|
| 10 |
+
- macos
|
| 11 |
+
library_name: swift-music-transcriber
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Piano transcription with pedals for Core AI (`.aimodel`)
|
| 15 |
+
|
| 16 |
+
Apple Core AI conversion of **High-resolution Piano Transcription with Pedals by Regressing
|
| 17 |
+
Onset and Offset Times** — Qiuqiang Kong, Bochen Li, Xuchen Song, Yuan Hou, Yuxuan Wang
|
| 18 |
+
(ByteDance, 2020), checkpoint `CRNN_note_F1=0.9677_pedal_F1=0.9186` from
|
| 19 |
+
[github.com/bytedance/piano_transcription](https://github.com/bytedance/piano_transcription)
|
| 20 |
+
(Apache 2.0, 43M parameters). The piano specialist: one instrument, but a velocity for every note
|
| 21 |
+
and the sustain pedal, which general audio-to-MIDI models do not hear.
|
| 22 |
+
|
| 23 |
+
`scribe-piano-float32.aimodel` (136 MB) has two entry points:
|
| 24 |
+
|
| 25 |
+
- `trunk`: log-mel `[1, 1001, 229]` (one 10-second segment at 100 fps; 229 Slaney mels
|
| 26 |
+
30–8000 Hz in dB) → the seven CRNN trunks' features `[1, 1001, 768]` (frame, onset, offset,
|
| 27 |
+
velocity, pedal onset, pedal offset, pedal frame).
|
| 28 |
+
- `parameters`: every GRU and head weight as one flat vector. Core AI has no recurrent op and a
|
| 29 |
+
decomposed GRU unrolls to ~770k ops at this size, so the sixteen bidirectional recurrences run in
|
| 30 |
+
the host (Swift, Accelerate) from these weights. Nothing was re-authored, retrained or pruned.
|
| 31 |
+
|
| 32 |
+
The host side — front end, segmentation with 5-second hop, stitching, the regression
|
| 33 |
+
post-processor and the note/pedal state machines — lives in
|
| 34 |
+
[swift-music-transcriber](https://github.com/arraypress/swift-music-transcriber) (MIT), where the
|
| 35 |
+
`scribe` CLI exposes it as `--engine piano`.
|
| 36 |
+
|
| 37 |
+
## Faithfulness
|
| 38 |
+
|
| 39 |
+
Held to upstream's Python on real audio (a piano loop, and a 17-second three-segment piece):
|
| 40 |
+
|
| 41 |
+
- The trunk is asserted equal to upstream's forward before export, and agrees at 155 dB PSNR
|
| 42 |
+
through Core AI on the GPU.
|
| 43 |
+
- The Swift GRU agrees with PyTorch's at 112 dB on upstream's own trunk activations.
|
| 44 |
+
- The seven framewise outputs agree at 123–147 dB.
|
| 45 |
+
- **Note and pedal events are identical**: every note, velocity and pedal event, with onset and
|
| 46 |
+
offset times within 0.001 ms of upstream's.
|
| 47 |
+
|
| 48 |
+
## Use
|
| 49 |
+
|
| 50 |
+
```sh
|
| 51 |
+
hf download arraypress/scribe-piano --local-dir models
|
| 52 |
+
scribe model install models/scribe-piano-float32.aimodel
|
| 53 |
+
scribe recording.wav --engine piano # one piano track, velocities, controller 64 for sustain
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Requirements: macOS 27, Apple silicon. Reproduce with `uv run Tools/export_piano.py` in the
|
| 57 |
+
library repo (downloads the checkpoint from Zenodo).
|
| 58 |
+
|
| 59 |
+
## Licence and citation
|
| 60 |
+
|
| 61 |
+
Apache 2.0, as upstream. Please cite:
|
| 62 |
+
|
| 63 |
+
> Q. Kong, B. Li, X. Song, Y. Hou, Y. Wang. "High-resolution Piano Transcription with Pedals by
|
| 64 |
+
> Regressing Onset and Offset Times." arXiv:2010.01815, 2020.
|