MASCII: Musical ascii

Thursday, December 18, 2008

[UPDATE: This post is outdated. The complete mascii specification can now be found at mascii.org and a free implementation of it open to the public can be found at composersnotebook.com]

I'm very excited about an ASCII-based musical language I've invented called mascii, which stands for musical ascii. I'd love to see this adopted as I think it's way better than anything else I've seen out there.

BACKGROUND
I wanted to create a robust musical notation system that lets you easily input music using plain ASCII text from any standard computer keyboard, and have it represented in a format that is easily understood by humans and computers alike. This makes passing around musical snippets and scores as easy as sending an email, and doesn't require any special software in order to use, write, or understand.

It must be: compact, chromatic, polyphonic, rhythmically expressive, and generally expressive, in that anything that can be notated in standard music notation should be writable here too. Basically, for a system to pass muster, you should have no trouble writing the Brandenburg Concertos in it.

Many attempts have been made for such a system, the most popular being a language called ABC, but ABC rapidly degenerates into an eyesore for anything but the simplest type of music. Mascii is both simpler (much fewer rules to learn) AND more versatile.

Other systems such as XML based ones rapidly become tedious and burdensome for humans to actually read or write.

Mascii, on the other hand, totally rocks! Here is the "white paper" outlining how it works:

PITCHES & ACCIDENTALS

Follow standard western music practice. Notes are named c d e f g a b, and are taken from the currently active octave. To "shift" into another octave, write a number before the note indicating its octave, and all subsequent notes will be in the new octave. Starting at the lowest C on the piano, and going up by octaves you have:

1c 2c 3c 4c 5c 6c 7c

So for example,

| 2c c f g | e e d 1g | 2c | plays as |2c 2c 2f 2g| 2e 2e 2d 1g | 2c |

Using a number shifts the octave in an absolute way. To shift octaves in a relative way, use the "<" and ">" symbols. "<" shifts down and octave while ">" shifts up an octave (and ">>" shifts up two octaves, etc).

So

| 2f e g >g | e d c . | plays as |2f 2e 2g 3g| 3e 3d 3c .|

At the start of a piece, if no octave is specified, "4" is assumed.

Finally, one more notational convenience: notes written in CAPITAL are played one octave lower than written. They do not shift the currently active octave, they merely play themselves an octave lower than otherwise indicated. This saves you from having so many octave specifiers all over the place. For example:

| f d g G | c A G B | c | plays as: |4f 4d 4g 3g| 4c 3a 3 g 3b| 4c

By default, notes are assumed to be natural.
To raise a note (sharp), put a plus "+" after the note.
To lower (flat) postfix it with a minus "-"
To naturalize explicitly (i.e. cancel a sharp or flat) use an equal "=".

d+ = d sharp
d- = d flat
d= = d natural


MEASURES, or PULSES

Rhythm is what has tripped up every other system I've seen, and here is where mascii really shines. That's because other systems try to emulate standard written music, which itself is unnecessarily complex and redundant when it comes to rhythmic notation. Thus those systems inherit these problems, only they become even worse when exposed by the brevity demanded by an ascii-based language.

Mascii uses pipes ("|") to indicate measures.

Unlike every other system out there, mascii does not explicitly specify a time signature -- instead, relative timings are implied by the groupings of the notes themselves.

As in traditional notation, measures represent a constant unit of time. What is unique in mascii is that measures are always divided evenly over the number of elements inside, so each element gets an equal split of the time. The more elements there are in the measure, the less time each element occupies.

Elements are always separated by spaces, and in this case above, all the elements are notes. The above example was 4 quarter notes, because there were 4 elements inside the measure.

These are half notes:
| d c |

And these are still half notes, because there are still only two elements:
| d gec |

The second element, "gec", consists of three half notes, which are played simultaneously (in other words, a chord).

So far we have only seen notes, but elements can be one of three things:

  1. a note ("a", "b", etc)
  2. a rest, denoted by the period "."
  3. a grouping of other elements, indicated by a pair of parentheses "( )". This is called a composite. Composites contain one or more elements inside their parentheses, so a composite is a way of grouping one or more elements into a single larger element in the rhythmic scheme.


Rests are indicated by a period ".", and they are full-fledged elements, so they get an even time slice just like notes and composites do.

For example, a quarter note on the 2nd beat followed by two more empty beats looks like this:

| . a . . |

Again, why was it a quarter note? Because there were 4 elements, so each element gets 1/4 of the time.


SUBDIVIDING THE BEAT

The mascii solution to rhythm is simultaneously vastly simpler AND more expressive and flexible than other systems, so therefore I'd unabashedly describe it as just plain cooler than anything else I've seen!

Here are triplets spread evenly over a measure:
| c d c |

Since there are three elements in this measure, each element gets 1/3 of the time; thus, triplets. Notice how easy that is! Traditional notation gets flustered when it comes to anything "outside the box" like triplets.

But now what if we do not want triplets; how do we specify that / c d c / should be two quarters and then a half note, rather than three equal thirds?

This is where we use the third element type introduced earlier: a composite.

The trick is that anything enclosed in parentheses gets grouped into a single element in the rhythm scheme, which takes a single share of time just like any other single element. The time is then distributed evenly to all its sub-elements (the elements being grouped together), dividing into equal portions, as always.

So two quarters followed by a half note looks like this:

| (f g) a |

How did that work? Well without the parentheses, this measure would contain three elements, and thus would be triplets.

But by using the parentheses we've grouped together the "f" and "g" into a single composite element, so therefore this measure now contains just two top-level elements: a composite "()" and a note "a".

Because elements are always given even time, this means each top-level element is a half note. So the composite element occupies a half-note, and the "a" occupies a half note. But the composite element merely distributes its allotted time to its contained elements. In this case, it contains two elements, which are both notes: "f" and "g". Therefore, again distributing time evenly to all the contained elements, the "f" and "g" each take half of the time, in this case half of a half note, meaning that they are quarter notes.


Here is a quarter note, triplet eighths, and then 2 more quarters:
| c (c b a) g g |

Here's a triplet rhythm consisting of a rest and two 8ths, then a regular quarter:

| (. a a) a |

Here is an 8th, two 16ths, two more 8ths, and two quarters, followed by a whole note:

| (e (f e)) (d f) e d | c |

Let's analyze that. This piece has two measures. The first measure contains four top-level elements:
1: (e (f e))
2: (d f)
3: e
4: d

Therefore each element gets 1/4 of the time, i.e. quarter notes. The first element is itself a composite, containing two elements: "e" and another composite "(f e)". Therefore each of these two subelements gets half of the time, so half of 1/4 = 1/8th notes. Thus the first subelement, "e", is an eighth note.

But the second subelement, the "(f e)", is itself yet again another composite, consisting of two sub-elements, both notes: "f" and "e". So again dividing evenly, these become 1/16th notes.

Top-level element number two is a composite consisting of two elements, so dividing the quarter in two, the "d" and "f" become 1/8th notes. Elements 3 and 4 are each just notes (not composites), so they each fill their full time slot, and are thus 1/4 notes.

Finally, the second measure has just one element, so it takes the entire measure -- it's a whole note.

Here's the tune "it's beginning to look a lot like Christmas" in G:

| . . B c | (d e d) (c+ . d) e g | b d . . |

See the triplets in action?

Here is Mary Poppins' "Chim chim-n-ey, chim chim-n-ey, chim chim, che-roo" song:

| c (g g) g | B (g g) g | B- a- (. g) | f |

Here are mascii equivalents for some common time signatures:

6/8 = | (. . .) (. . .) |
3/4 = | . . . |
2/4 = | . . |

I've written them using rests, but of course notes could have just as easily been used.

But when using mascii, try not to think too literally about what the equivalent standard notational note equivalents would be, because often they would be something rather ugly! Instead think more about the time over which your notes must be evenly divided.

Ultimately three quarter notes in 3/4 time is the same as three eighth notes in 3/8 time, and yet traditional notation uses different symbols for these values -- very silly. So mascii clears out the notational push-ups and gets down to what actually matters to a musician -- how many of these notes do I have to fit into my beat?

Mascii achieves this without losing ANY precision or expressiveness, in fact mascii notation is MORE rhythmically precise than traditional music, because traditional music has a very hard time with "3 versus 4" type cross rhythms -- they are as a rule not written accurately. But mascii handles this with ease, clarity, and precision.


EXTENDING A NOTE

Note duration is always determined by slicing the number of elements in a measure or composite space as described earlier. There are no "whole" or "half" or "dotted half" notes as in other systems.

The "time-slice" system conveniently takes care of many needs for other note values from other systems, but sometimes you still need a note to last longer than a single allotment. In such cases, to extend a note beyond its allotted time slice, you must tie a note to another.

Tying notes together in mascii works a little more like MIDI than like standard music notation, in that you only specify the beginning and the end of the note, nothing in between. To indicate the start of a tied note, put an exclamation after the note to be held (like the note has some audacity to stay past its allotted time!. Then write another note indicating where it ends, and suffix that note with an asterisk (inspired by the use of an asterisk to denote the release of the sustain pedal in piano music).

For example, here is a note sequence of quarter, half (written as two quarters tied together), quarter, half, half, whole:

| d f! f* d |

Analysis: The first measure has four elements, so they are quarter notes. The second element, "f!" indicates that the note should be held, until the matching element, "f*", indicates the ending portion of this note. After the third element finishes playing (a continuation of the "f" note from before), the "f" is finally released. Therefore this is a quarter note d followed by a half note f, then a quarter note d.

This abbreviation may also be used:

| d f! * d | e d | c |

No matter how many notes are being held, a plain asterisk without any specifier ends all actively playing notes, which may or may not be what you want in a polyphonic piece. The abbreviated form should be used whenever possible, but the first form can always be used to specify which note to end when needed.

Here is the basic sketch of the first line of a Jim Morrison song that begins, "Caravan caravan take me away"

| a b c | d e f | e d c | a . . |

Here it is again with more accurate notation using ties to reflect the way he actually sings it:

| a (b c!) * | d e f | e d (c c!) | (* a) . . |


META INSTRUCTIONS

Anything enclosed in quotes "" is not considered an element and does not contain music. This is where you can put extra instructions.

For example, octave transposition, key signatures, and tempo markings go here. Meta instructions apply to all subsequent bars until explicitly cancelled.

A "key signature" for example looks like this:
"c+f+"| c d e f | translates to | c+ d e f+ |


POLYPHONY

There are two ways to handle polyphony: you can mash together multiple notes on the same line, or you can use separate lines for each "voice". These techniques can be mixed freely.

Any two consecutive lines without a break in between are interpreted as simultaneous lines, i.e. polyphony. In such cases, matching up the barlines is a nice visual convention but not strictly required. Also, with multi-line polyphony, the "|" measure separater looks better than the "/" or "\". By convention, "|" is used in multiline polyphony, while "/" is used for single line notation.
"\" is included for dislexics.

Here is the melody and bass line to Handel's "Gloria", on separate lines, in key of B-flat:



| 5f! * (g f) (e d) | e! * (f e) (d c) |
| . d B= G | . c A F |

| d! * (e d) (c B) | c! (* F) F * |
| . B- E G | F <F f e |



Now here is "Gloria" mashed together into a single line:


| 5f! *D (g f)3B= (5e d)3G | 5e! *C (f e)3A (5d c)3F |

| 5d! *3B- (5e d)3E (5c B)3G | 5c!3F (* 4f)2F 4f!3f *E |



DYNAMICS & GOODIES

There is something subtle here worth mentioning... notice in the first bar that the asterisk "*" comes BEFORE the D. If it came after the D, it would be interpreted as "D*", which is not what I wanted -- D* would indicate the end of a held D note, but what I wanted was to end the f. The syntax to end an f is f*, so I could have written Df* or f*D, but since there's only one note being held anyway I can just use the universal * without specifying which note it applies to, but in this case the * must go at the beginning, before -- not after -- the D, to avoid any confusion.

Future enhancements could include dynamics, lyrics, etc.
If used, all these things will be specified on a separate dedicated track, similar to how multi-line polyphony works. That way they don't clutter the musical essentials that are most relevant to real musicians.

Comments