What IS this sh**?
Well, this sh** is actually called Muki. It's a web based player for sequenced music, that contains a carefully curated list of songs from video games of the 90's, and some even older. The sound you hear does not come from lossy compressed formats, by the way. Your browser is actually acting as a synthesizer and generating the waveforms from the original notation scores.
How does it work?
Muki uses web-based (Javascript) ports of different libraries that can play native formats for sequenced music such as MIDI or Nintendo music files, among many others. Keep reading if you want to know more.
Who did this?
The guy behind this is Tom (aka T.O.M.A.S.) Pollak, a journalist-slash-developer-slash-aspiring musician who obviously spent too much time playing DOS games when he was young.
Why did you build this?
Because I love MIDI and I wanted to play some of my old songs to my newborn daughter. But it so happens that I use Linux, and it turns out that MIDI and Linux are not exactly, well, best friends. So one day an acorn hit me in the head and I realized the web offered all the tools I needed to build something in order to play them. Once I began the journey, I realized I could actually play a number of different formats besides MIDI. And that's how I got started.
Is this actually legal?
Yes, apparently there's nothing wrong with ripping music from old games nor sharing it, and letting people listen to them is just another form of distribution. If that wasn't the case, YouTube certainly wouldn't allow people to upload the ton of videos with game music that you can find on their site.
Regarding manually sequenced tunes, I've taken precaution in contacting some of the authors of these songs and asked for their permission. I haven't managed to contact eeeveryone, but the response has been overwhemingly positive so far. So thanks again guys!
That said, if there's anything you think should be removed, either because it's yours or because it's from someone who might get pissed, please let me know. I'll make sure to remove it in a snap.
How did you build this? What technologies did you use?
A whole bunch of them! The key piece of all is probably emscripten, a transpiler that provides a way to port native C code to Javascript. Using emscripten I was able to build JS versions of the following libraries: libTiMidity (for MIDI playback, borrowing ideas from midijs.net), Munt (for Roland MT-32 emulation/playback), Game Music Emulator (VGM/VGZ/NSF/SPC/etc), and Highly Experimental (PSF/PSF2). The only one I didn't actually build was the JS port of libopenmpt, which I borrowed from the chiptune2.js project. The real challenge was to glue everything together, ensuring there were no memleaks, and of course, selecting the list of songs.
What about the UI?
Oh yes, the UI. You like it? Also a LOT of code-stiching. The visualization is a customized version of a Codepen snippet I found long ago, and the 3D navigation is from one of the cool Codrops examples. The intro script uses the typed.js library as well as one called starfield.js.
Can I change the visualization?
Not yet, but you can turn it off if you want. Just hit the V key to toggle it. You can also use the left and right arrows to skip tracks, and the spacebar to pause playback.
And what about the music?
Well, so the music is a collection of different files of different formats that hail from
different sources. Probably the most important one is the great, the amazing World of Game Music, a website that contains a huge database of game
music in both MIDI (rips and arranged tracks) and MOD format. Then there's VGMusic, another great site that contains a nice collection
of MIDIs that have been sequenced by its own (and very talented) community.
Another key source is Zophar's Domain, that contains ripped soundtracks from console games (NES, SNES, Sega, PSX, etc). Music from Sierra games comes from the legendary guys at QuestStudios. Finally there's VGMRips, a recent (and surprisingly good) discovery that holds an ever-growing database of VGM music. Everything else was ripped and tweaked personally by me either using an extractor tool or through DOSBox, like the Might and Magic 3 music or the intro song from HeroQuest. You gotta listen to those!
By the way, if you click over the name of the song that's playing, a window will pop up showing the source where the file was downloaded from, as well as the name of the company that holds the rights for the tune. I was able to get that information from TheGamesDB (via API) or MobyGames (by hand!).
Looks like you've put a lot of time into this...
You bet your boots I have! It's been a lot of fun, though. I hope you enjoy listening to Muki as much as I enjoyed building it.
How about playing my own songs? Can I?
Sure you can. Just drag and drop 'em inside the browser window. Voilá!
And what formats are supported?
All of the following: .mid, .mod, .xm, .it, .s3m, .psm, .amf, .ay, .gbs, .gym, .hes, .kss, .nsf, .sap, .spc, .vgm and .vgz. You can drop one or a whole list of files and Muki will play them in order.
Ok, but how do I make my MIDI file to be played with the MT-32 synth?
Good question. If Muki detects a MT-32-specific sysex message, then it will forward it to the MT-32 core automatically. However you can also force MT-32 playback if you hit the 'm' key before dropping your tunes.
Why do some MIDIs take so long to load?
That's because some of them use a lot of different instrument patches, and these need to be preloaded for the music to play. Patches are cached once downloaded, so as you listen to more songs it'll only get faster.
What soundfont do you use for the MIDI patches?
Muki actually uses a combination of different soundfonts, aiming to balance the highest possible sound quality with the lowest possible file size. Most of the patches come from the great Arachno soundfont, though.
Can I submit a new song?
But of course you can! Just shoot me an email and I'll be happy to add it, as long as it's a good rip and it's not already in the Muki database.
Where's the code?
I thought you'd ask. I want to make the player code available but it's an ugly mess as it is right now, so I need to do some housekeeping before I push anything up. It should be available soon on my Github account.
Is there something I can do to help?
You might! I don't have a clear roadmap right now, and that's because I want to build one based on the feedback I get from people like you. So tweeting or contacting me via email would be where to start.
Can I use something from Muki on my site/project/etc?
Sure, help yourself. Remember though that most of the songs aren't mine, so I'm not the one to ask for permission.
What's the logo supposed to mean?
It's an acorn. The magic acorn that hit me in the head.
And what about the name?
It's a long story. Here's the short version: it's what you get if you combine the words "music" and "midi", and divide them by "monkey". You can give it a try.
Ok, I'm out of questions. Anything else?
Yes! I'd like to thank everyone who directly on indirectly helped in making this possible. Kudos to the libTiMidity developers, to the people that made Munt possible (way to go guys!), to the OpenMPT, the Highly Experimental and the Chiptune2.js projects, and to Kode54 for his great work on GME and the nifty trick he pulled on Munt (Super mode). And last but not least, I should thank everyone in the game music community that has contributed their rips, their tweaks and their arrangements to the sites I mentioned above. Thanks for making this possible, and for helping keep sequenced music alive.