Ultimate Music Toy (UMT): Instructions

Click here to go straight to the Ultimate Music Toy or read below to learn how to use it for the first time.


Bang the "Start Music" button, it will start playing music.

There's a boatload of sliders, buttons, and listboxes. So what I'll try to do here is give you a brief explanation of what they all do.


If you find Voice #1, the "Octave" slider changes the octave. Octaves are from 0 to 9 where 0 and 9 are barely audible.

Note distance

"Note distance" controls how far apart notes are. Putting it at 0% means you just get the same note over and over, 100% means they can jump a whole octave.


"Restyness" controls what percentage of the notes are rests, i.e. left out.

Amplitude variation

"Amplitude variation" controls variation in how loud the notes are, i.e. how much variation there is in how hard the notes are "hit". 0% means no variation, they are all the same (and the volume for the whole voice determines the volume), while 100% means the volume can vary between silence and the maximum volume.


"Skew" controls how much notes are allowed to vary from the points in time where they are supposed to play. A skew of 0% means they are not allowed to vary and play exactly on their time codes. A skew of 100% means they are allowed to start playing up to 1 time unit before or after their exact time code. But I haven't explained what a time unit is, so I suppose I should do that next while explaining the next four sliders that control the rhythm.

Rhythm Sliders

Min & Max Note

The next four sliders are "Min Note", "Max Note", "Chunk Size", and "Pattern Size". Music in this system isn't composed of quarter notes, eighth notes, sixteenth notes, etc. Instead, instead of starting with a large note (whole note) and making fractions on it, it starts with the minimum note size and builds up from there. So the minimum note is a note of length 1 -- 1 time unit. To hear the minimum note length, just set "Min Note" and "Max Note" to 1. This way the shortest note this voice will use, which is what "Min Note" refers to, will be 1 time unit, and the longest note, which is "Max Note" will also be 1 time unit, so every note will be 1 time unit.


"Chunk Size", which is maybe not the best name (I'm open to suggestions as to a better one), designates a number of time units that have to be a separate "chunk", i.e. a note is not allowed to cross. So, for example, if you make "Min Note" 1, "Max Note" 2, and "Chunk Size" also 2, the resulting rhythm will sound very "straight" -- there will be no syncopation. This is because every note has to finish on every 2 time unit boundary. But if you increase the "Chunk Size" to 4 or 8, now notes are allowed to cross that boundary. In general, the further apart you make the "Min Note" and "Max Note" and the larger you make the "Chunk Size", the more syncopation you are going to get.

Patterns & Variations

Pattern Size

This brings me to "Pattern Size", and the "Variations" section next to it. The idea here is that you come up with a repeating pattern, which you could call a theme or motif, but I just call it the "pattern". Once you have a pattern, you can do variations on the pattern. If the pattern is very short, you get a lot of repetition. In the ultimate case, you could make the pattern 1 time unit, in which case you just get one note repeating endlessly. If the pattern is long, then it will be harder for the listener to hear a repeating pattern -- it will sound more random. If you push the slider up to 64 and increase the syncopation, you will get what sounds like a random sequence of notes. The idea is to pick something in between, so the listener's brain has a pattern to latch on to.


Once you have a pattern, there are various variations you can do with it. The simplest of these is to "transpose" it -- which just means to move all the notes up or down in pitch. A simple way to illustrate this is to go back to that ultimate simple pattern -- the pattern size of 1 -- and put "Transpose" at 50% for *all* the transpose sliders. What will happen is it will first take the 1 note and transpose it, making a 2-note pattern. Then it will take that 2-note pattern and transpose it, resulting in a 4-note pattern. Then it will take the 4-note pattern and transpose it, resulting in an 8-note pattern. Believe it or not, your brain will be able to pick up on all these transposition layers.

Here's what the variations mean:

Instrument-specific parameters

At the end of the row is an additional section that can change depending on what instrument you pick. The default "Sine wave" instrument has 2 instrument-specific parameters, which are "Clipping" and "Lean". "Clipping means chopping the top and bottom off the sine wave, making it more of a square wave. If you crank "Clipping" up to 100%, it means the waveform can vary all the way from a pure sine wave to a pure square wave. I think it sounds best at lower levels, like around 10 or 15%. A sine wave with a little bit of clipping sounds like a glass chime or something. Notice that setting it to, say, 15%, does not mean every note is clipped at 15%. It means the system is allowed to vary the clipping up to 15%. Like every slider on the screen, this slider controls the amount of variation the composition system is allowed. No sliders ever control an absolute value, they all control how much freedom the compositional system has. The "Lean" slider works the same way, except instead of transitioning the sine wave into a square wave, it transitions it into a sawtooth wave -- it controls how much the sine wave "leans" over towards becoming a sawtooth wave. To my ears it makes the sine wave sound more "rubber bandy". Moving the "Lean" slider away from 0 gives the composition system freedom to vary the degree to which the sine waves "lean" and become sawtooth waves.


Speaking of variation, if you're wondering where the variation comes from, it comes from a pseudo-random number generator. You can change the seed to the pseudo-random number generator by changing the "Seed" listbox which I skipped over. This will generate a different melody using exactly the same parameters. If you think about it, any set of parameters could be used to generate a near-infinite set of melodies. This listbox lets you pick between 50 of them.

NR & Rel

A couple others I skipped over are "NR" and "Rel", a couple of little checkboxes you might not have noticed. "NR" means "No Repeats". If it seems like it's playing the same note over and over too much, you could increase the "Note Distance", or, if you want a voice with lots of notes close together, you can click "NR" to tell the system not to repeat the same exact note twice. "NR" is often used with "Rel", which means note intervals generated from the "Note Distance" setting should be relative rather than absolute (relative to the tonic, which I haven't mentioned yet). It's dangerous to use if "Note Distance" is large, because the notes can stray far from the starting point. But if you want to generate a melody where the notes stay close together but still go somewhere interesting, you can make "Note Distance" small and then check "NR" and "Rel" and that'll give you a way of doing that.

Multiple voices

Ok, all this was done with one voice, so you're getting one melody with no harmonization. Click "Add a voice" to add a voice. The new voice is added without playing, allowing you to change the sliders before starting it. When you're ready to start it, check the "Play" checkbox.

There's no hardcoded limit to the number of voices the system allows, so you should be able to add as many as you feel like. There are some interesting things you can get with multiple voices going that you can't really hear with just one, for example if you do a bunch of voices with the "Restyness" set in the middle, say 50%, then you get a composition that switches a lot from having multiple voices going at once to only one or none at all. Notes that don't play because they are turned to "rests" are left out of the harmonization process, leaving the other notes to harmonize as if they really weren't there, as you would expect.

Strumming with Skew

If you move the "Skew" from 0 up to, say, 15 or 20%, you'll get a "strumming" effect, as the different voices don't hit their notes at precisely the same time.



Once you have multiple voices going, there's harmonization to think about. In the section above all the voices, there's two listboxes for "Scale" and "Harmonization". For each of the scales, there's a name for the scale (for example "Major" for the familiar major scale) followed by a number which indicates the number of notes in the scale. Note that when we think of scales, we often repeat the first note at the end and count it twice, but this number doesn't count any notes twice. For example, if you play a major scale from C to C an octave up, that's 8 notes, but you're counting the "C" twice -- the major scale is actually 7 notes. Asterisks indicate whether the scale has a note called the "tritone", which is a note that is hard to harmonize with and which you may want to avoid using for that reason.

The tuning system used by this program is called "just intonation" and is different from the "equal temperament" tuning system you are using. The "equal temperament" tuning system divides the octave into 12 equal parts. This was invented so musicians wouldn't have to re-tune instruments to play in a different key. It works because our ears are imprecise enough not to notice when certain intervals and chords are not perfectly in tune. This program, on the other hand, makes everything perfectly in tune, by representing notes as exact frequency ratios. This enables the harmonization system to determine if any two notes harmonize just by doing math with fractions. It also makes it possible to do scales outside the 12-note equal temperament scale. If you look at the "Scale" listbox, you'll see I put in every scale I could find (and every mode of scales that have multiple modes -- for example all the pentatonic modes are in there), as well as a bunch I invented myself using a program that "explored the octave" and found as many notes as possible that were related to the tonic by multiplying fractions -- up to a 91 note scale. As it turns out, 91 notes is more than the ear can resolve, so at 91 notes it sounds like there is no scale at all -- 19 notes was as far as I could push it. Here is a composition made with the program (using the squarewave instrument) using the 19 note scale. It sounds like it's doing key changes but it actually isn't -- but that's what it sounds like to our brain which tries to shoe-horn the sounds it hears into the familiar 12-note scale framework.



Another thing you might note about this system is that there is no concept of a "chord". "Chords" fall out automatically from the math of what notes are allowed to harmonize. Anytime you get enough voices playing at once, you get chords. If you make a bunch of voices that all change notes at the same time, you'll get what sound like familiar chords. You could make a bunch of voices for "chords" and one voice for "melody". One person insisted I allow the "melody" voice not to harmonize with the "chords" voices, so I added the "EFH" checkbox -- that's one I skipped over, don't know if you noticed. "EFH" stands for "Exempt from Harmonization". I don't think it made any difference, but you're welcome to try it and form your own opinion. The whole point of a "music toy" is to try everything and play around with it.

Triads & 7th chords

Anyway, the "Harmonization" listbox controls what harmonization rules the system uses. "Triads" is the default, but you can make it more restrictive by moving it to "Perfect" or "Major" -- in which case fewer notes will harmonize (only perfect or major intervals respectively). Or you can make it less restrictive by choosing "7th Chords" which allows a few carefully chosen dissonant intervals. "More 7th chords" allows more dissonant intervals and "Allow dissonance" basically turns off the harmonization entirely and anything goes.

Time Signatures

Tab time divisions

To change time signatures, you need to go all the way up out of the tabs section where the voices are where it says "Tab time divisions". You may have noticed that the time groupings have all been powers of 2. From the minimum time unit of 1, the sizes for "Min Size", "Max Size", "Chunk Size", and "Pattern Size" are all powers of 2 -- 2, 4, 8, 16, 32, 64. Certain traditional time signatures like 3/4 time and 6/8 time are not possible when everything is powers of 2. You can change that by changing the time division listboxes. For example, if you make the first one "3" and leave the rest "2", you'll get something that sounds like 6/8 time. If you set the first one back to "2" and the second one "3" and leave the rest "2", you'll get something that sounds like 3/4 time. The options are only prime numbers up to 11. It stops at 11 because at 11, my brain (at least) could no longer hear the pattern. I thought even 5 and 7 were a bit much but you're welcome to try them and see how they are for you. Non-prime numbers were left out because you can get them by combining primes, for example "4" can be represented with two "2"s and I couldn't see any reason not to allow the composition system to use the division between the two 2s. The last entry is always "stop", and by changing that, you can make the whole loop longer (or shorter). There's no hardcoded limit to the number of time divisions you can have.


This brings me to the tabs. Normally the system just plays a loop with one set of parameters over and over. But I wanted the system to be able to switch between different sets of parameters, for example to create a "verse-chorus-verse-chorus" effect. It didn't work as well as I had hoped, but is still fun to play with. You click the "Add Tab" button, then you can use the tabs to switch between the "A" and "B" tabs. When you have tabs you like, you can click the "Play all tabs" radio button and it will cycle through all the tabs. I found that similar patterns with rhythmic variations (like verse-chorus-verse-chorus) work better than other variations like scale variations and whatnot. As always you're welcome to try whatever you like and see (er, hear) what happens. As always, there are no hardcoded limits on the number of tabs.


There's a few more things I skipped over. There's a "tonic" slider that lets you change the tonic. As noted before, all music produced by this system is tonal -- it's incapable of using the 12-note equal temperament tuning system which means it's incapable of producing atonal music (like Arnold Schoenberg type stuff). The tonic slider defaults to 440 Hz.


There's also a "Tempo" slider. The "tempo" number is in "time units per minute", which doesn't correspond to "beats per minute" because a "time unit" is the smallest a note can be in the system and doesn't correspond to a "beat". In fact there's nothing in the system corresponding to a "beat" -- *you* get to decide what feels like a "beat" to the listener by how you compose the music.


The last thing I'd mention is the "Re-randomize" button. What this button does is change all the pseudo-random number seeds for all the voices all at once at random. (But only for the currently visible tab).


I suppose I should also explain why you'll see weird options in the "Instruments" listbox. At one point I was hoping a friend of mine would use the "Web Audio DAW (Digital Audio Workstation)" (aka WAD) he was developing to make a boatload of instruments with a boatload of parameters that I could plug into this system. But he never did. But there's a few "WAD" instruments in the list for that reason. I've been thinking of just chopping the WAD code out of the system entirely. The other instruments I put in, like the FM synthesis, don't sound right, and in order to fix that I would need to invest considerable time in learning digital instrument synthesis algorithms -- and for years I've just been way too busy with other things to do that. At the bottom of the list are some lighting "instruments", "Dan lights" and "Fadecandy". I had a friend (named Dan) who made a lighting system at the Boulder Hackerspace, and I tried to program the lights to dance in sync with music by treating them as an "instrument" in this system. It didn't work because his lighting system had buffers in it somewhere where light change commands would queue up and then execute in a delayed manner. The Fadecandy, however, did work -- it controlled LED light strips and the lights did in fact dance in sync with the music. To get that working, though, you need more than the code here -- you need a server component that picks up notes on a WebSockets connection and sends them down to the Fadecandy controller and the LED lights.


Anyway, the system is written in JavaScript and runs in a browser thanks to the WebAudio API. If you want to see the code, which reveals every detail of how the system works, you can actually see all of it with just "View Source". (If you want a version you can edit, I can point you at the GitHub).

That's All

Go to Ultimate Music Toy and start making your own music!