Aaron Giles

Web Development


Since 2013, I have run the website rehearsaltracks.net, which features online learning resources for choral singers. At this time, it is mostly a privately-run endeavor, although from the home page you can access a complete set of tracks from Handel’s Messiah.

As with most of my more complex sites, this one is developed in a mix of JavaScript on the client side and PHP on the server. Recently, the JavaScript has been enhanced with a healthy dollop of WebAssembly for more flexible playback.

How It Works

I originally designed the site with an eye toward someday commericalizing it, either for choirs or for composers/publishers (I’ll refer to these choirs/composers/publishers as “clients” below). Who knows, someday it could happen!

In its current incarnation, clients have access to an admin console that allows them to choose from among all the existing rehearsal tracks in the database. For multi-part works, clients can choose either the whole thing, or just selected movements. All selected tracks can be put into groups and placed in whatever order is desired for presentation to the end users.

End users are given a special private link by the client’s administrator, which gives them access to the rehearsal interface. (This is the same interface you get when you access the free Messiah tracks I mentioned earlier.) The rehearsal interface offers a list of tracks, grouped and arranged by the administrator. Clicking on a track opens up the player.

The player is where the magic happens. The core playback system is a software-driven custom MIDI playback engine that runs off of SoundFonts. It has markers for each measure and page, plus support for bookmarks, allowing for quick and easy navigation throughout any piece of music. The tempo may be adjusted, and with advanced controls you can also change the overall volume or transpose on the fly to another key.

To help with learning, you are asked to select which voice part you are interested in, and then given options to hear that part emphasized, at equal volume to other parts, or completely removed from the mix. This is a great ramp-up for learning new music, allowing you to hear your part banged out loudly at first, then dropping it into the overall mix once some confidence is developed, before finally removing your part altogether to see if you can hold your own.

Past Revisions

The current MIDI-based setup is really the second major incarnation of the site, and was largely completed in the summer of 2018.

When I first created the site in 2013, however, there was no practical way to reliably play back MIDI with any kind of control. Each browser had its own way of dealing with MIDI, so using it directly was a no-go. And WebAudio didn’t yet exist, so even if I did port a MIDI engine to JavaScript, there was no way to stream the results.

In order to deal with these limitations, the first version of the site leveraged pre-generated MP3 audio files instead. The way that worked is that I would generate a giant matrix of MP3 files for each rehearsal track, with separate files for each voice part at each difficulty level at each playback speed (limited to just a handful of options, if any).

The playback interface looked much as it does today, but there were no tempo, volume, or transposition controls available, since everything was canned. The measure and page jumping still worked, at least. Information on where each measure and page started was output as part of the process of generating the MP3 files, and the player could jump around easily.

One advantage of the pre-generated MP3 files was that I could focus on making high quality tracks, since it was all being done offline. Initially I used the same custom MIDI engine (written in C) that I use today, but eventually I switched over to generating the tracks using the awesome PianoTeq, which acoustically models the behavior of a piano instead of relying on samples.

Another advantage of the pre-generated files is that it was easy to support using recorded voice tracks instead of MIDI-generated playback. For a couple of years, one of my choirs would record separate vocal rehearsal tracks for each voice part, and then I would generate my canned files by mixing those instead of the MIDI. In order to generate proper measure and page boundaries, I would manually create a click track, which I fed into some custom software to produce timing information.

Motivation & History

When I first started singing, I was pretty insecure about my skills. To help me overcome this, I (naturally) applied a software solution. I developed a Windows program in C++, dubbed Virtual Accompanist, that can take music transcribed into ABC notation and play it back using a custom MIDI engine with various controls.

(Transcribing music into text form was nothing new to me. In the 8th grade my science fair project was called “Music in the Computer Age,” and I ended up transcribing some 3-part Bach inventions onto several 8-bit computer systems to test their sound capabilities.)

The Virtual Accompanist UI is pretty minimal, but it allows me to dynamically alter the tempo of the piece, plus adjust the relative volumes of the accompaniment and of each individual voice part. It also supports bookmarks that can be used to quickly jump to key points in the piece.

For the first few years of my singing experiences, this method was sufficient to help me gain confidence. I would begin by rehearsing with my part emphasized over all the other parts. As I gained familiarity with a given piece of music, I would equalize all the voices, and eventually tune out my part completely to be sure I could hold my own without assistance.

Even once I’d mastered a piece, having the ability to call up an accompaniment whenever I wanted was still invaluable for practicing.

After a couple of years, I joined the Sacred Music Chorale and quickly realized that such a system would be helpful for others I was singing with. Each season I would transcribe the pieces we were singing into ABC notation, and then use Virtual Accompanist to export the tracks to WAV format, which I then burned onto CDs.

Unfortunately, this was very labor intensive. Plus, since space was limited, I only exported the version that had each part emphasized, and left off the ones where all the parts are equalized or where you heard everything except a single part.

Since I was also the web manager for SMC, I realized that with a little JavaScript and PHP I could host all the tracks interactively online as MP3s. With some additional information exported by Virtual Accompanist, I was also able to add markers for each measure, page, and rehearsal mark.

Given all this extra information, I was able to make the online versions much easier to use for rehearsing. Now you could easily jump to any location within the piece, though due to the limitations of MP3s, adjusting the tempo dynamically was no longer an option. For some pieces I manually created slowed down versions to compensate.

Eventually I moved the online implementation to its own website, rehearsaltracks.net, so that I could share my efforts with other groups I was connected with.

Since entering in music by hand—especially major choral works—is a time-consuming operation, I began to seek out existing MIDI files online to use as starting points. Assuming I can find the MIDI files for the piece I’m interested in, I can use a utility I wrote to convert the MIDI into ABC and use that as a starting point.


This site and all contents Copyright © Aaron Giles