Advanced Music Production
A data pipeline that turns the MAESTRO classical piano dataset into normalized note sequences for training a music model.The groundwork for a piano music generation project. It takes the MAESTRO v3 dataset of recorded piano performances and turns every performance in the training split into a clean sequence of notes a model can learn from.
So far this is the data stage: about 5.66 million note events extracted, plus a script that turns the sequences back into a playable MIDI file to check the round trip.
Each MIDI file is read with mido, and music21 analyzes its key so the whole piece can be transposed to C, putting every performance in the same key.
Only note-on events with a nonzero velocity are kept, stored as time delta, pitch and velocity, normalized to the 0 to 1 range, and written to CSV with pandas.
A second script reverses the normalization and writes the notes back out as MIDI.