transcPybe
transcPybe transcribes monophonic singing into notes: onset and offset times in seconds, and pitches as MIDI note numbers, with the measured pitch retained as a pitch bend. It is intended for solo vocal recordings and for lead vocals separated from mixed recordings.
Version 2 places note onsets with three small neural networks, which detect where each syllable begins to sound and where its vowel begins. Notes are then decoded from the pitch track by a hidden Markov model. Version 1, which relies on the pitch track and a spectral-flux onset detector alone, remains available.
The code is released under the MIT licence. The weights of the version 2 networks are released under CC BY-NC-SA 4.0 (see Licence).
Comparison to other models
| System | vocadito | Molina | RWC-P dev | Mean | 95% CI |
|---|---|---|---|---|---|
| transcPybe v2, PESTO | 0.520 | 0.693 | 0.348 | 0.521 | [0.500, 0.542] |
| Phoneme-informed | 0.522 | 0.712 | 0.317 | 0.517 | [0.495, 0.539] |
| transcPybe v2, pYIN | 0.531 | 0.675 | 0.339 | 0.515 | [0.495, 0.536] |
| transcPybe v2, CREPE | 0.523 | 0.670 | 0.347 | 0.513 | [0.494, 0.533] |
| CTC-CE | 0.372 | 0.629 | 0.359 | 0.453 | [0.431, 0.476] |
| MIR-ST500 model | 0.381 | 0.534 | 0.371 | 0.429 | [0.406, 0.451] |
| GAME | 0.314 | 0.506 | 0.348 | 0.389 | [0.368, 0.411] |
| Omnizart | 0.467 | 0.512 | 0.180 | 0.386 | [0.368, 0.405] |
| transcPybe v1 | 0.488 | 0.419 | 0.231 | 0.379 | [0.363, 0.396] |
| YourMT3+ | 0.312 | 0.464 | 0.328 | 0.368 | [0.347, 0.390] |
| SOME | 0.313 | 0.441 | 0.242 | 0.332 | [0.315, 0.349] |
| Basic Pitch | 0.316 | 0.345 | 0.133 | 0.265 | [0.246, 0.284] |
| CREPE Notes | 0.296 | 0.275 | 0.167 | 0.246 | [0.228, 0.265] |
| Kum et al. | 0.233 | 0.251 | 0.224 | 0.236 | [0.221, 0.253] |
| Essentia | 0.290 | 0.289 | 0.120 | 0.233 | [0.216, 0.250] |
| ROSVOT | 0.194 | 0.189 | 0.154 | 0.179 | [0.165, 0.194] |
| aubio | 0.061 | 0.086 | 0.019 | 0.055 | [0.049, 0.061] |
| STARS ‡ | 0.070 | 0.068 | 0.038 | 0.059 | [0.047, 0.071] |
The table compares transcPybe with fifteen published singing transcription systems on the three annotated datasets that none of them was trained on: vocadito, Molina and the RWC-P development set (126 recordings). Its means and intervals are those reported in the DMRN+21 abstract.
- Runs. Each system ran in its own pinned container on identical audio.
- Metric. COnPOff@50 at whole semitones: a note counts when its onset is within 50 ms, its pitch within 50 cents, and its offset within 20% of the note's duration or 50 ms, whichever is larger. vocadito's column averages the scores against its two annotators' references. The mean is the mean of the three columns.
- Intervals. 95% intervals from a paired bootstrap over recordings, stratified by dataset.
Results on all five datasets of the benchmark, computation times, every system's reference and the per-recording scores are in the transcription-benchmarking repository's full results.
Notes to the table:
- SSVD and MIR-ST500, the benchmark's other two datasets, are left out because Phoneme-informed, CTC-CE, the MIR-ST500 model and YourMT3+ were trained on other recordings from them.
- Tony is not shown: vocadito's reference annotations were produced by correcting its output.
- ‡ STARS requires lyrics. They were obtained by automatic speech recognition.
- transcPybe's defaults. Version 2's networks were trained only on M4Singer, GTSinger and MUSDB18-HQ. Its presets' default settings, which are where note starts sit between syllable and vowel and the decoder thresholds listed under Presets, were chosen on vocadito, Molina, the RWC-P development set and SSVD's training and validation recordings. These are values that any decoder needs, and each can be changed. On the held-out SSVD and MIR-ST500 test sets, transcPybe's mean is lower than on the datasets the defaults were chosen on by 0.015 with pYIN, 0.046 with PESTO and 0.052 with CREPE; for comparison, the ten systems that saw none of the five datasets change by between −0.084 and +0.028 (median −0.026).
For reference, vocadito's two annotators agree with each other at 0.64 COnPOff@50.
Installation
pip install transcpybe # version 2 with the pYIN pitch tracker
pip install "transcpybe[crepe]" # adds the CREPE pitch tracker
pip install "transcpybe[pesto]" # adds the PESTO pitch tracker (LGPL-3.0)
transcPybe requires Python 3.9 or later. PyTorch is a dependency, because the version 2 networks require it. On a
machine without a GPU, installing PyTorch's CPU build first avoids downloading the CUDA libraries:
pip install torch --index-url https://download.pytorch.org/whl/cpu. To install from a source checkout, use
pip install -e ".[dev]".
Usage
Command line
# A lead vocal separated from a mix: writes lead-vocal.mid, .notes.json and .notes.csv
transcpybe lead-vocal.wav -o out/
# Solo singing, with nothing else in the recording
transcpybe solo.wav --preset acappella
# Version 1, without the networks
transcpybe lead-vocal.wav --preset rules
# Every audio file in a directory, with a log file
transcpybe stems/ -o midi/ --log-file transcribe.log
# Print the notes as a table
transcpybe lead-vocal.wav --print-notes
# Write whole equal-tempered semitones only, without pitch bends
transcpybe lead-vocal.wav --12tet
# Run the built-in synthetic test suite
transcpybe --self-test
transcpybe --help lists every option.
Presets
| Preset | Version | Intended input | Evaluated on |
|---|---|---|---|
pop (default) |
2 | a lead vocal separated from a pop mix | 82 MIR-ST500 test songs |
acappella |
2 | solo singing, with nothing else in the recording | 127 SSVD test recordings |
rules |
1 | either; no neural networks besides the pitch tracker |
--onset-position F (TranscriptionConfig(onset_position=F)) moves version 2's note starts: from the start of each
syllable (0) to the start of its vowel (1). Annotation conventions differ on where a sung note begins, and this matches
the output to one: 0 suits references that start a note at its consonant, 1 those that start it at the vowel. Left
unset, each preset uses the value it was evaluated with (0.5 for pop, 0.875 for acappella).
The two version 2 presets were fixed on development sets and then evaluated once on recordings that had not been used
for tuning. Each preset also sets the decoder parameters with which it was evaluated: --min-note, --p-self,
--note-level-floor, --onset-delta, --onset-split-strength and --release-drop. The command line warns if one of
these is given with a version 2 preset. With --preset rules, every parameter takes the value given.
Pitch trackers
| Tracker | Option | Requires | Notes |
|---|---|---|---|
| pYIN | --f0-backend pyin (default) |
Version 2's best mean over all five datasets of the benchmark; runs on the CPU | |
| CREPE | --f0-backend crepe |
transcpybe[crepe] |
Fastest on a GPU, slowest on a CPU. --crepe-model tiny is about 14 times faster on a CPU; version 2 has not been evaluated with it |
| PESTO | --f0-backend pesto |
transcpybe[pesto] |
A much smaller network than CREPE |
The version 2 networks were trained on CREPE's pitch tracks. pYIN and PESTO report lower confidence than CREPE. Their
tracks therefore pass through a voicing map before decoding: a quantile map onto CREPE's confidence scale, fitted on
the training data. Version 1's thresholds were set on CREPE. Further trackers can be added with
transcpybe.f0.register_f0_backend.
Python
from transcpybe import TranscriptionConfig, transcribe_file, write_midi
result = transcribe_file("solo.wav", TranscriptionConfig(preset="acappella"))
for note in result.notes:
print(note.onset, note.offset, note.pitch) # seconds, seconds, MIDI note number
write_midi(result.notes, "solo.mid", result.config)
TranscriptionConfig documents every parameter. The result also contains the pitch track (f0_track) and the onset
track (onsets) from which the notes were decoded.
Output
.mid: one track. Note times are absolute seconds; the tempo in the header affects only the bar grid displayed by notation software. Each note's MIDI number is the semitone nearest the sung pitch. By default, the measured pitch is also written as a pitch bend at the start of the note, using General MIDI's two-semitone range.--12tetomits the bends..notes.csv: onset, offset, duration, pitch, velocity, confidence, pitch in Hz, and the measured pitch as a fractional MIDI number (pitch_midi_float)..notes.json: the same notes, with the complete configuration that produced them.
transcpybe.midi_io.read_midi_notes reads a MIDI file back with its pitch bends applied.
Method
Version 2: note onsets from neural networks
Three networks with the same architecture were trained with different random seeds:
- Architecture: a convolutional front end over an 80-band log-mel spectrogram, then a two-layer bidirectional GRU, with 0.8 million parameters each.
- Inputs: the spectrogram and five features from the pitch track.
- Outputs: every 10 ms, the probability that a syllable begins to sound and the probability that its vowel begins.
- Training data: singing from M4Singer and GTSinger, mixed with accompaniment from MUSDB18-HQ.
The three networks' outputs are averaged. Each vowel onset is paired with the nearest preceding syllable onset, and the
note onset is placed between them: at 0.5 of the interval in the pop preset, at 0.875 in the acappella preset, or
wherever --onset-position sets it.
The decoder described below then forms notes from the pitch track, with these onsets.
The networks run on the CPU. On an Apple M-series laptop with PyTorch's default four threads, the three together take
about 3.6 s per minute of audio. The code is in transcpybe.landmarks. The weights, the voicing maps and their
provenance are in src/transcpybe/landmarks/weights/.
The note decoder
Both versions share the following stages. Version 1 takes its onsets from stage 5. Version 2 takes them from the networks and uses its preset's parameters throughout.
- Pitch and voicing. The pitch tracker estimates a fundamental frequency and a periodicity confidence every 10 ms. The confidence is multiplied by a loudness gate set relative to the recording's 95th-percentile level, so that periodic residue left by source separation in quiet passages is not transcribed.
- Note decoding. A Viterbi decoder runs over pitch states spaced a third of a semitone apart, plus an unvoiced state. Emissions favour states near the measured pitch, weighted by voicing. Transitions favour remaining on a note, and penalise larger intervals. The design follows the note tracker of Tony (Mauch et al., 2015). The sub-semitone states prevent a note sung between two semitones from alternating between them.
- Fragments. Very short segments adjacent to a much longer note, within two semitones of it, are merged into it. Such segments typically arise from wide vibrato at the end of a note.
- Glides. Where the singer slides into a note, the transition is attributed to the note being approached. This corrects the late onset the slide would otherwise produce, and removes the brief notes it would leave on each semitone crossed.
- Onsets. A spectral-flux onset envelope with a frequency-domain maximum filter (SuperFlux) splits repeated notes at the same pitch, and aligns note onsets with audible attacks. The maximum filter prevents vibrato from registering as onsets.
- Pitch and clean-up. Each note's pitch is the confidence-weighted median of its pitch track, excluding the start of the note, rounded to the nearest semitone. Notes shorter than the minimum duration, and notes far quieter than the rest of the performance, are removed.
- Note ends. A note ends where its level has fallen a set amount below its own sustained level: 15 dB by default,
20 dB in the
poppreset. This excludes the release and room reverberation, which pitch trackers continue to report as periodic. - Tuning reference. If the notes of a first pass show that the performance is consistently offset from the
A440 grid, decoding is repeated against the grid on which it was sung. Offsets beyond 40 cents are not applied,
because scattered intonation is otherwise better explained by a grid a quarter tone away.
--no-tuning-estimatedisables the estimate.
Processing large collections
Given a directory, transcpybe transcribes every audio file within it:
- Existing outputs: files whose outputs already exist are skipped, so an interrupted run resumes;
--overwritetranscribes them again. - Failures: a file that cannot be read is logged and the run continues;
--stop-on-errorstops it instead. - Remaining time: estimated from audio duration rather than file count.
Progress is shown on a single line in a terminal, and as periodic timestamped lines when output is redirected. The following options control logging and the GPU:
| Option | Purpose |
|---|---|
--log-file PATH |
Append timestamped logs to a file as well as the console. |
--progress-interval N |
Seconds between progress lines when output is redirected (default 5). |
--no-progress |
Disable progress reporting. |
--device |
Torch device for CREPE and PESTO: auto (default; CUDA, then Apple MPS, then CPU), or an explicit device such as cuda:1. The device used is logged and recorded in the JSON output. |
--crepe-batch-size N |
CREPE frames per forward pass (default 512); lower it if GPU memory is limited. |
--gpu-memory-every N |
Log GPU memory every N CREPE batches. |
-v |
Include debugging detail. |
Reproducibility
The JSON output records the complete configuration used. CREPE adds random dither of ±20 cents to its pitch estimates.
transcPybe seeds it (--seed, default 0) and restores the global random state afterwards, so repeated runs give
identical output. --no-seed restores CREPE's unseeded behaviour.
Adjusting version 1
With --preset rules, the decoder's parameters may be adjusted. The most commonly used are:
| Symptom | Option | Direction |
|---|---|---|
| Short spurious notes | --min-note |
increase (e.g. 0.08) |
| Sustained notes split into several | --p-self |
increase (e.g. 0.995) |
| Fast passages merged into single notes | --p-self |
decrease (e.g. 0.97) |
| Vibrato fragmenting notes | --pitch-sigma |
increase (e.g. 0.7) |
| Notes in silent passages | --note-level-floor |
decrease (e.g. 22) |
| Quiet sung notes discarded | --note-level-floor |
increase |
| Repeated notes at one pitch merged | --onset-split-strength |
decrease |
| Noisy recordings over-segmented | --onset-delta |
increase |
| Note ends too late | --release-drop |
decrease (e.g. 10) |
| Note ends too early | --release-drop |
increase, or --no-release-trim |
| Voice outside the tracked range | --fmin, --fmax |
widen |
Tests
pytest tests/ # the test suite
pytest tests/ -m slow # the tests that run CREPE
transcpybe --self-test # the synthetic suite
Limitations
- Monophonic input. Harmonies or overlapping voices in the same recording are transcribed as a single line.
- Note ends follow a convention. Annotators differ on where a sung note ends. The release threshold
(
--release-drop) may need adjusting for a particular corpus. - Separation residue. Loud residue from source separation can be transcribed as notes. With
--preset rules, lowering--note-level-floorreduces this, at the cost of quiet singing. - Tuning. A performance sung more than 40 cents from A440 is decoded on the A440 grid.
- No quantisation. Output times are in seconds, without beat tracking or rhythmic quantisation.
Acknowledgements
Pitch estimation
- CREPE: J. W. Kim, J. Salamon, P. Li and J. P. Bello, "CREPE: A Convolutional Representation for Pitch Estimation", ICASSP 2018. Used through torchcrepe (M. Morrison; MIT licence), which supplies the weights.
- pYIN: M. Mauch and S. Dixon, "pYIN: A fundamental frequency estimator using probabilistic threshold distributions", ICASSP 2014. Used through librosa's implementation.
- PESTO: A. Riou, S. Lattner, G. Hadjeres and G. Peeters, "PESTO: Pitch Estimation with Self-supervised Transposition-equivariant Objective", ISMIR 2023. Used through the pesto-pitch package (LGPL-3.0).
Note segmentation and onsets
- Tony: M. Mauch, C. Cannam, R. Bittner, G. Fazekas, J. Salamon, J. Dai, J. Bello and S. Dixon, "Computer-aided melody note transcription using the Tony software: Accuracy and efficiency", TENOR 2015. The pitch-state hidden Markov model is a simplified form of Tony's note tracker.
- SuperFlux: S. Böck and G. Widmer, "Maximum filter vibrato suppression for onset detection", DAFx 2013. Used
through librosa's
onset_strength.
Training data for the version 2 networks
- M4Singer: L. Zhang et al., "M4Singer: A Multi-Style, Multi-Singer and Musical Score Provided Mandarin Singing Corpus", NeurIPS 2022 Datasets and Benchmarks. CC BY-NC-SA 4.0.
- GTSinger: Y. Zhang et al., "GTSinger: A Global Multi-Technique Singing Corpus with Realistic Music Scores for All Singing Tasks", NeurIPS 2024 Datasets and Benchmarks. CC BY-NC-SA 4.0.
- MUSDB18-HQ: Z. Rafii, A. Liutkus, F.-R. Stöter, S. I. Mimilakis and R. Bittner, 2019. Accompaniment only; educational and non-commercial use.
Libraries
- librosa (ISC licence)
- pretty_midi (MIT)
- mir_eval (MIT)
- NumPy (BSD-3-Clause)
- SciPy (BSD-3-Clause)
- soundfile (BSD-3-Clause)
- PyTorch (BSD-3-Clause)
Licence
The code is released under the MIT licence (LICENSE).
The weights of the version 2 networks and the voicing maps, in src/transcpybe/landmarks/weights/, are released under
CC BY-NC-SA 4.0, because the singing on which they were trained
is licensed on those terms:
- Attribution: use requires attribution.
- Non-commercial: commercial use is not permitted.
- Share-alike: derived weights must be shared under the same licence.
That folder's LICENSE and README.md give the full terms and the provenance. The pop and acappella presets use
these weights; --preset rules does not. The pitch trackers' weights are distributed with their own packages, under
their own licences.
Metadata
Release files for transcpybe 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| transcpybe-2.1.1.tar.gz | 9.4 MB | With provenance | Details for transcpybe-2.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transcpybe-2.1.1-py3-none-any.whl | Python 3 | none | any | Details for transcpybe-2.1.1-py3-none-any.whl |
Total release size: 18.7 MB
Release files / transcpybe-2.1.1.tar.gz
| Download URL | transcpybe-2.1.1.tar.gz |
|---|---|
| Size | 9.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3dc2d1fa7a26fa404d2699d77f75aa8de306d87f6f66e2aa984eaa3715f7174
|
|
BLAKE2b-256 checksum How to use checksums |
bd961c105accc498d208e095db105e1b4bdc46fbc0f8ff1320ad78f4825b4bd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / transcpybe-2.1.1-py3-none-any.whl
| Download URL | transcpybe-2.1.1-py3-none-any.whl |
|---|---|
| Size | 9.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a61ff54fe2088fdcca6826087e46a31328f858ff541b04685bd15f6d77059cc2
|
|
BLAKE2b-256 checksum How to use checksums |
e94c116a9de4e2fc7cf2025ee9858de6b9edef4b50a409c7b75f6cbaeefa2b92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for transcpybe 2.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for transcpybe-2.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.