MIDI Player JS

Musical Instrument Digital Interface (MIDI) is a standard to transmit and store music, orignally designed for digital music synthesizers. MIDI does not transmit recorded sounds. Instead, it includes musical notation, timing, and velocity, which the receiving device uses to play music from its own sound library.

The music score comes in JSON format:

  • A list of tracks
  • Each track has an instrumentName and a list of notes
  • Notes need to be played at a specific time for a given duration (both in milliseconds).
  • Notes have a name, which indicates their frequencies
  • Notes also have a velocity, which indicate how loudly they must be played

The name and velocity need to be passed on to the synthesizer.

Many companies have large scale real-time applications. They run hundreds of independent services across thousands of servers, resulting in complex concurrency problems. This project explores a similar problem, applied to a different domain: playing music.

In the context of playing music, running a single track with a few notes can be done simply with synchronous logic. However, as the number of tracks, notations, and time all scale up, we can utilize asynchronous solutions to solve these complex issues.

Music available:

  1. Whistle
  2. Metroid (Nintendo) Item Discovery
  3. Yoshi Island
  4. Tetris
  5. The Legend of Zelda
  6. Super Mario Bros.
  7. Megaman 3
  8. Super Mario Bros. 3
  9. Little Nemo
  10. Duck Tales
  11. Megalovania

The controls below will load the JSON file and pass it to the code.