Dr. Presto - Now with MUSIC!

Jan 27

It's hard to believe that I built the Dr. Presto widget, a NES Dr. Mario clone, so many years ago. I remember back then that I really wanted to have music playing while playing the game, but I also remember I just couldn't find a way to get MIDI files to play in a widget (or even in a website!) context without resorting to Flash or some other heavy, embedded applet.

Fast forward to today, where I found myself thinking about it again. Heck, the Dr. Mario MIDI files I wanted to use are still in the folder where I store the widget files. I never threw them out. Could I make it work this time?

It turns out that the HTML5 <audio> element still doesn't support playing MIDI files, and it's doubtful if it ever will. However, there must be other ways, right? After trying and failing to make three different javascript-based MIDI player systems work, I eventually found html-midi-player by cifkao and got it working. It's a pretty big file (592kB), but the main reason I like it is precisely because it is all one file (bundled of course), and specifying a sound-font is optional. It's "plain Jane" and easily portable.

Give Dr. Presto a try yourself. The music is turned off by default (I'm not a monster!) so just click the little speaker icon to get it playing. You can turn off the music at any time by pausing the game or hitting the speaker icon again.

Hope you like! And remember to take your vitamins. ;)


Post comment :: No Comments Yet

Recent posts

  1. Dr. Presto - Now with MUSIC! Jan 2023
  2. Check if a String of Text can be Composed Entirely of Chemical Element Symbols Dec 2022
  3. Choosing High-Contrast Text Colour Based on Background Colour Dec 2022
  4. Making Parallaxed HTML5 Video Work Mar 2022
  5. activeImageMap script Jan 2020
  6. Archive