PianoCoRe with audio
PianoCoRe performances that have a score and a score-to-performance note alignment, with audio added. One sample is one performance: audio, performance MIDI, score and alignment. Made for score-informed piano transcription.
- Audio: FLAC, mono, 16 kHz, 16 bit. Sample 0 of the audio is t = 0 of the performance MIDI.
- Real audio for the ASAP performances whose MAESTRO recording could be placed exactly
(
audio_source = "maestro"); synthesized audio for all others (audio_source = "fluidsynth"). - Noncommercial research only (see Licences).
| Split | Performances | Hours of audio | Shards | GiB | Real audio | From PianoCoRe |
|---|---|---|---|---|---|---|
train |
141,719 | 11,113 | 567 | 597.6 | 437 | train split, tier A |
validation |
5,961 | 619 | 24 | 33.1 | 23 | test split, tier A*, 46 compositions |
test |
5,962 | 585 | 24 | 31.2 | 15 | test split, tier A*, the other 46 compositions |
Every performance of the selection passed the checks; none was left out (excluded.jsonl is empty).
PianoCoRe's train and test splits share no piece, and validation and test share no composition (split.json
lists which composition went where). Tier A: a score and a note alignment exist. Tier A*: also labelled high
quality with at least 85% of the notes aligned.
Files
train/shard-000000.tar ... shard-000566.tar 250 performances per shard, in random order
validation/shard-000000.tar ... shard-000023.tar
test/shard-000000.tar ... shard-000023.tar
index_train.jsonl, index_validation.jsonl, index_test.jsonl one line per sample: its metadata and its shard
tar_md5.txt, tar_sha256.txt checksums of every shard
excluded.jsonl performances of the manifest that are not in the dataset, with the reason
split.json validation / test compositions
summary.json counts and hours
README.md this file
Each shard is a plain tar in WebDataset layout. The files of one sample share its PianoCoRe id as prefix:
| File | Content |
|---|---|
<id>.flac |
audio, mono 16 kHz |
<id>.mid |
performance MIDI, PianoCoRe's file unchanged |
<id>.notes.npy |
float32 (N, 4): onset s, offset s, pitch, velocity; the notes of <id>.mid in audio time, sorted by onset |
<id>.score.mxl |
score, compressed MusicXML |
<id>.score.mid |
score as MIDI |
<id>.align.npz |
PianoCoRe's raw score-to-performance alignment (see below) |
<id>.refined_score.mid, <id>.refined.mid, <id>.refined_align.npz |
PianoCoRe's refined score, refined performance and their alignment (optional extras, see below) |
<id>.json |
metadata |
Alignment
align.npz has one entry per aligned pair or unmatched note:
| Array | Meaning |
|---|---|
score_idx, perf_idx |
note numbers in PianoCoRe's own note order; -1 where the note has no partner |
score_pitch, perf_pitch |
MIDI pitch |
score_times, perf_times |
(n, 2) onset and offset in seconds, in the time of score.mid and of <id>.mid (= audio time) |
perf_times can be used directly with the audio. perf_idx is not a row number of notes.npy: PianoCoRe
numbers the notes after rounding times to 1/960 s and sorting by onset and pitch, and it leaves very short notes
out of the table. To connect an alignment entry to a row of notes.npy, match pitch and onset: a listed
performance note has a row with the same pitch and an onset within 2 ms (required for at least 99% of the listed
notes of every sample; it was 100% in the 2,000 samples that were counted).
import numpy as np
def alignment_rows(notes, alignment, tolerance=0.002):
"""Row of notes.npy for every entry of align.npz (-1: no performance note)."""
alignment = {name: alignment[name] for name in ("perf_idx", "perf_pitch", "perf_times")}
rows = np.full(len(alignment["perf_idx"]), -1)
for pitch in np.unique(alignment["perf_pitch"][alignment["perf_idx"] >= 0]):
entries = np.where((alignment["perf_idx"] >= 0) & (alignment["perf_pitch"] == pitch))[0]
candidates = np.where(notes[:, 2] == pitch)[0]
if not len(candidates):
continue
onsets = notes[candidates, 0].astype(np.float64)
wanted = alignment["perf_times"][entries, 0]
nearest = np.abs(onsets[None, :] - wanted[:, None]).argmin(axis=1)
close = np.abs(onsets[nearest] - wanted) <= tolerance
rows[entries[close]] = candidates[nearest[close]]
return rows
Refined files
The refined performance is PianoCoRe's cleaned version of the performance: exactly one note per score note, in
score order, with missing notes interpolated (interpolated in refined_align.npz) and extra notes removed. Its
time axis is not the audio's (it starts at 0 and passages can be shifted), so it does not describe the audio.
The audio is always made from, or matched to, the unrefined <id>.mid. See the PianoCoRe card for these files.
Metadata (<id>.json)
All PianoCoRe metadata columns (composer, composition, movement, performance and score source, tiers, quality labels, alignment recall and precision, ...), and:
| Field | Meaning |
|---|---|
split, pianocore_split |
split in this dataset, and PianoCoRe's |
piece_id |
composer/composition/movement |
shard |
shard number within the split |
duration, sample_rate, num_notes |
of the audio and of notes.npy |
audio_source |
fluidsynth or maestro |
files |
the files of this sample |
render |
for synthesized audio: soundfont and preset, EQ bands, room response and mix, gains, counts of ignored MIDI messages |
maestro |
for real audio: the MAESTRO recording, where the performance starts in it, the share of notes found in the MAESTRO MIDI |
Loading
import io, json
import numpy as np
import soundfile as sf
import webdataset as wds
from huggingface_hub import snapshot_download
# after access is granted; all of it is 662 GiB, so allow_patterns can take e.g. ["validation/*", "*.json*"]
root = snapshot_download("mimbres/pianocore-fluidsynth", repo_type="dataset", local_dir="pianocore-fluidsynth")
dataset = wds.WebDataset(f"{root}/train/shard-{{000000..000566}}.tar", shardshuffle=100).shuffle(200)
for sample in dataset:
audio, rate = sf.read(io.BytesIO(sample["flac"]), dtype="float32") # mono, 16 kHz
notes = np.load(io.BytesIO(sample["notes.npy"])) # onset, offset, pitch, velocity
meta = json.loads(sample["json"])
alignment = np.load(io.BytesIO(sample["align.npz"])) # only if needed
score_musicxml, score_midi, performance_midi = sample["score.mxl"], sample["score.mid"], sample["mid"]
score.mxl opens with music21, partitura or MuseScore. A performance is 4.8 minutes long on average and up to
about an hour; cut training segments after decoding.
How the audio was made
Synthesized (99.7% of the performances). The performance MIDI is played with FluidSynth 2.3.4 at 48 kHz
stereo, EQ and a room are applied, and the result is mixed to mono, resampled to 16 kHz and scaled to a peak of
-1 dBFS (gain at most +30 dB). Every choice comes from a hash of the seed (42) and the performance id, and is
written to render.
- Soundfont: the Salamander grand piano for half of the performances; for the others one of MuseScore General, FluidR3 GM, GeneralUser GS, TimGM6mb, Arachno (each: grand and bright grand preset), Upright Piano KW and YDP Grand Piano, with equal chances per font.
- EQ on half of the performances: seven bands, each within ±2 dB.
- Room on every performance: one impulse response from Aachen AIR (84 measured binaural pairs in six rooms),
ReverbFX (1,846 plugin responses) or Samplicity's Bricasti M7 set (134 presets), one third each, cut to 4 s
and mixed at 15-35%. FluidSynth's own reverb is also on, at the settings of gigamidi-fluidsynth
(
render.native_reverb). - Only notes and the three pedals (controllers 64, 66, 67) are played. A note-on for a key that is still down
ends the old note first;
notes.npyis written from the same event list. - The audio ends 2 s after the last MIDI message.
- Timing: a note starts at the next 64-sample block of the synthesizer (at most 1.3 ms late). The Salamander samples have about 12 ms of attack before the hammer is heard, against 1-5 ms for the other fonts, so its renders are advanced by 12 ms.
Real (475 performances). ASAP names the MAESTRO recording of its performances. PianoCoRe's MIDI does not start where ASAP's does, so each performance was placed by matching its notes to the notes of the MAESTRO MIDI; the audio (MAESTRO v3.0.0) is cut so that MIDI time equals audio time, up to 2 s after the last MIDI message or the start of the next piece in the recording. Used only if at least 95% of the notes were found within 20 ms and the offset changed by less than 10 ms over the piece; in every performance that is used at least 99.9% of the notes were found and the offset changed by at most 3.1 ms. Real audio is not level-normalised.
Checks
Every sample: all files present and of the right type; audio 16 kHz mono, finite, not clipped (fewer than 0.1%
of the samples at full scale), not silent, of the stated length and long enough for its notes; notes.npy equal to the notes read from the .mid; at least
99% of the performance notes in align.npz present in notes.npy. Every real-audio sample and 3% of the
synthesized ones: the delay between the MIDI onsets and the attacks in the audio, measured near the start and
near the end, is within 25 ms and changes by less than 12 ms. Samples that failed are listed in excluded.jsonl.
Known limits
- Most performance MIDI in PianoCoRe (the Aria-MIDI, PERiScoPe, ATEPP and GiantMIDI-Piano parts) was itself
transcribed from recordings (
is_transcription,capture_model). The synthesized audio matches that MIDI exactly, but the MIDI is not a perfect record of the original performance. - The alignment is PianoCoRe's and is not corrected here;
raw_recall,raw_precisionand the tier flags tell how complete it is. - Very soft performances stay below full scale because of the +30 dB gain limit.
Licences
This dataset is CC BY-NC-SA 4.0, as required by its sources: noncommercial research only, share alike. PianoCoRe: CC BY-NC-SA 4.0. MAESTRO (real audio): CC BY-NC-SA 4.0. The audio was rendered with freely available soundfonts (Salamander Grand Piano, CC BY 3.0; MuseScore General, FluidR3 GM, GeneralUser GS, TimGM6mb, Arachno, Upright Piano KW, YDP Grand Piano) and room responses (Aachen AIR, ReverbFX CC BY-NC 4.0, Samplicity Bricasti M7); none of those files is part of this dataset.
Access is granted on request.
- Downloads last month
- 1,466