asigalov61/Discover-Piano
Discover Piano Ultimate pre-tokenized solo Piano MIDI dataset for symbolic music AI and MIR purposes Installation and use Load dataset #=================================================================== from datasets import load_dataset #=================================================================== discover_piano = load_dataset('asigalov61/Discover-Piano') dataset_split = 'train' dataset_entry_index = 0 dataset_entry =… See the full description on the dataset page: https://huggingface.co/datasets/asigalov61/Discover-Piano.
398
Discover Piano
Ultimate pre-tokenized solo Piano MIDI dataset for symbolic music AI and MIR purposes

Installation and use
Load dataset
#===================================================================
from datasets import load_dataset
#===================================================================
discover_piano = load_dataset('asigalov61/Discover-Piano')
dataset_split = 'train'
dataset_entry_index = 0
dataset_entry = discover_piano[dataset_split][dataset_entry_index]
midi_hash = dataset_entry['md5']
midi_score = dataset_entry['score']
print(midi_hash)
print(midi_score[:15])Decode score to MIDI
#===================================================================
# !git clone --depth 1 https://github.com/asigalov61/tegridy-tools
#===================================================================
import TMIDIX
#===================================================================
def decode_to_ms_MIDI_score(midi_score):
score = []
time = 0
for t in midi_score:
if 0 <= t < 128:
time += t * 32
elif 128 < t < 256:
ptc = (t-128)
elif 256 < t < 384:
dur = (t-256) * 32
elif 384 < t < 512:
vel = (t-384)
score.append(['note', time, dur, 0, ptc, vel, 0])
elif 512 <= m < 845:
chord_tok = m-512
chord = TMIDIX.ALL_CHORDS_SORTED[chord_tok-12] if chord_tok > 11 else [chord_tok]
elif 845 <= m < 973:
bar_tok = m-845
return score
#===================================================================
ms_MIDI_score = decode_to_ms_MIDI_score(midi_score)
#===================================================================
detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(ms_MIDI_score,
output_signature = midi_hash,
output_file_name = midi_hash,
track_name='Project Los Angeles'
)Dataset pipeline
- Source MIDI dataset: Discover MIDI Dataset
- Dataset was created using the following pipeline code:
import os
import TMIDIX # v26.7.20
clean_midis = TMIDIX.read_jsonl('Discover-MIDI-Dataset/DATA/Files Lists/clean_midis_files_list.jsonl')
filez = [os.path.join('Discover-MIDI-Dataset/MIDIs', f['md5'][0], f['md5'][1], f['md5']+'.mid') for f in pool]
CLEAN_INSTRUMENTS = TMIDIX.LEAD_INSTRUMENTS+TMIDIX.BASE_INSTRUMENTS
def process(input_midi):
try:
raw_score = TMIDIX.midi2single_track_ms_score(input_midi)
escore_notes = TMIDIX.advanced_score_processor(raw_score, return_enhanced_score_notes=True, apply_sustain=True)[0]
escore_notes = TMIDIX.augment_enhanced_score_notes(escore_notes, timings_divider=32)
escore_notes = [e for e in escore_notes if e[6] < 80 and e[6] in CLEAN_INSTRUMENTS]
escore_notes = TMIDIX.solo_piano_escore_notes(escore_notes)
escore_notes = TMIDIX.remove_duplicate_pitches_from_escore_notes(escore_notes)
escore_notes = TMIDIX.fix_escore_notes_durations(escore_notes, min_notes_gap=0)
cscore = TMIDIX.chordify_score([1000, escore_notes])
fixed_score = []
for c in cscore:
c.sort(key=lambda x: -x[4])
tones_chord = sorted(set([p[4] % 12 for p in c]))
if tones_chord not in TMIDIX.ALL_CHORDS_SORTED:
tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord, use_full_chords=False)
for e in c:
if e[4] % 12 in tones_chord:
fixed_score.append(e)
vels = [e[5] for e in fixed_score]
avg_vel = sum(vels) / len(vels)
if len(set(vels)) == 1:
fixed_score = TMIDIX.humanize_velocities_in_escore_notes(fixed_score)
if avg_vel < 80:
TMIDIX.adjust_score_velocities(fixed_score, 100)
cscore = TMIDIX.chordify_score([1000, fixed_score])
score = []
abs_time = 0
pbar = -1
pc = cscore[0]
for c in cscore:
c.sort(key=lambda x: -x[4])
if abs_time // 128 > 127:
break
if abs_time // 128 > pbar:
score.append(min(127, (abs_time // 128))+845)
pbar = min(127, (abs_time // 128))
tones_chord = sorted(set([p[4] % 12 for p in c]))
if len(c) > 1:
chord_tok = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord)+12
else:
chord_tok = tones_chord[0]
dtime = max(0, min(127, c[0][1]-pc[0][1]))
score.append(dtime)
score.append(chord_tok+512)
abs_time += dtime
for e in c:
score.extend([max(1, min(127, e[4]))+128, max(1, min(127, e[2]))+256, e[5]+384])
pc = c
if len(score) > 255:
return os.path.splitext(os.path.basename(input_midi))[0], score
except:
return NoneChangelog
Version 26.7.24
- Dataset now features the best possible encoding scheme which should greately improve the results.
- This is a breaking change from the original version so if you need the original version, please pull it from the respective commits/DOIs.
Citations
@misc{DiscoverPiano2026,
title = {Discover Piano: Ultimate pre-tokenized solo Piano MIDI dataset for symbolic music AI and MIR purposes},
author = {Alex Lev},
publisher = {Project Los Angeles / Tegridy Code},
year = {2026},
url = {https://huggingface.co/datasets/asigalov61/Discover-Piano}@misc{project_los_angeles_2025,
author = { Project Los Angeles },
title = { Discover-MIDI-Dataset },
year = 2025,
url = { https://huggingface.co/datasets/projectlosangeles/Discover-MIDI-Dataset },
publisher = { Hugging Face }
}