Stellimare

JSME: JavaScript Music Engine

JSME allows for playing back music using only JavaScript. This is great for web apps, and even single page web games that can exist entirely in a single .html file.

The idea for this project came about as part of a side project to create a fully functional video game in a single .html file, with all the code needed for graphics and sound contained within that file. So, borrowing from how early trackers worked back in the 90s on early systems, this essentially uses a JavaScript sequenced array to play music, stepping through it at each tick (in this case, a 1/8th note is a tick). The music driver uses the new audio context capability of modern browsers to synthesize instruments in "chiptune" fashion. It works great, and is simple to use.

The JSME Composer was developed to assist in composing music for use with the sound driver, also borrowing a little bit from the 90s era sound trackers. The JSME Composer proved to be the more difficult part of this tool to get up and working as intended (and I'm still improving it)

Download the JSME driver here: JSME Driver

Using JSME is easy:

<script src='jsme-driver.js'></script>
<script>
compiled_music = JSMEDriver.compileMusic(JSME_Composer_Exported_Music);
JSMEDriver.setMusic(compiled_music);
JSMEDriver.Play();
JSMEDriver.Pause();
JSMEDriver.Resume();
JSMEDriver.Stop();
</script>

That's all there is to it!

JSME driver (Sm-driver.js) is free to use under the MIT license. The composer is only free to use on this website. It will always remain free to use supported by ads and your contributions.