This is the code for a small personal project I finished for my 10,000th day of being alive. I created a song in which the main melody line plays 10,000 individual notes; though there are more notes and chords in the accompaniment, as well as some sustained (held) notes in the melody line, the onset of each main note can technically be distinguished individually.
To visualise this song, I drew a single dot for each note, and modulated the color and fade time of the dot according the note pitch and volume. I used a module called mido to parse the MIDI file of the song melody, Python Image Library to draw the content of each frame and ImageIO to write the frames to an mp4 video.
See the generated video here: https://www.youtube.com/watch?v=PM1uEvJf31A