DEV Community

Cover image for Visualizing MIDI with Three.js, Tone.js, and TypeScript
rfranr
rfranr

Posted on

Visualizing MIDI with Three.js, Tone.js, and TypeScript

Some time ago i built a fun little music visualizer that reads a MIDI file and generates a 3D piano roll in sync with the music. The project combines music and 3D graphics for a creative coding experience.

๐Ÿง  Idea

The concept is simple: load a MIDI file, and use Three.js to create the 3D visuals triggered by the notes. Tone.js handles the MIDI playback, and everything runs in the browser.

๐Ÿ”ง Tech Stack

  • Three.js for 3D rendering
  • Tone.js for MIDI playback
  • Vite for bundling and development
  • TypeScript for type-safety and cleaner code

๐ŸŽฎ Try it live

๐Ÿ‘‰ Live demo on Surge

๐Ÿ“ฆ Source code on GitHub

๐Ÿงฉ What could be better

Some parts of the code are a bit rough. Still, it's fun to share this as-is!

๐Ÿ’ญ Let me know what you think

Thanks for reading, and I hope you enjoy the music! ๐ŸŽงโœจ

Top comments (0)