Writing Game Music : Part I
by John Licato

The music for a game is very important. It sets the mood for the game, and does so much more. Without the music, it will be a lot harder to get the game player to get into the game. In almost every game development team I've been in, the musician was the one hired last, which really should not happen. As I see it, a good game has three basic parts: the programming, the sound, and the art. The sound is split up into two parts, the sound effects, and the music. Usually, for a small project, the sound effects creator and the music creator are the same person. But when you're hiring for a project, you must make sure your game has people that can provide those basic elements. In this article, I'm going to talk about how to create the music.

In an article of this size, I cannot explain absolutely everything about music. This article will be a lot easier for you if you already know how to read music. But in case you don't know anything about writing music, then I'll try to get you started. I'll explain how to read basic music, something most other music articles don't do. Soon I'll write part II of this article, which should explain how to come up with music ideas. (Ain't I just a great guy?)

I: Notes and Rests

A: Basic Notes

Music is basically made of different notes. These notes each have a different pitch and are held for a certain amount of time. So, in theory, that's basically what you're reading when you look at a sheet of music: what pitch to play the notes at, and how long to play them. Of course, another important factor is in music, which is volume, but I won't get into that, as that's kind of advanced.

As you can see, there are different kinds of notes:

There are also sixty-fourth notes, but we don't need to get into that. Okay, just by looking at what kind of note it is, you will be able to tell how long each note is held. The whole note is held for four beats. The half note is held for two beats. The quarter note is held for one beat, the eighth note is held for 1/2 beat, the sixteenth note is held for 1/4 beat, and the thirty-second note is held for 1/8 beat. The only time these values are different is when the bottom number of the time signature is something other than four, but you don't need to worry about that.

See how the eighth note and everything below that have flags? Whenever you have two or more notes with flags that are next to each other, you can combine their flags together. Let's say you had two eighth notes, one sixteenth note, two thirty-second notes, and one eighth note, in that order. It would look something like this:

Now, say you want something else, like you want to hold a note for three beats. Hmm...the half note is held for two beats, and the quarter note is held for one beat, but there's nothing for three beats. Fear not my people, there is a way. Just use a tie, which is a curved line that connects the two notes:

And now, when you play this, it will be held for three beats.

Even with a tie, there still is a combination you can't make...what if you want a note to hold for 1/3 beat?!?!? No, don't panic yet, there's still a way. Just change the note into a triplet. To change a note into a triplet, just put a "3" above or below the note or the group of notes. When a note becomes a triplet, it becomes 2/3 of its original value. For example, if you make a half note into a triplet, that triplet becomes worth 4/3 beats. (a half note is originally worth 2 beats, so 2 multiplied by 2/3 is 4/3.)

The most commonly used triplet is the eighth note triplet. Three eighth note triplets equal one beat. So here are three eighth note triplets:

Or, you could have put three different 3's, one over each note. It's easier to put it over the group, though. There's a problem to watch out for, though. Say you want to put one 3 over a group of notes to make them triplets. It only works when the group of notes are connected by their flags. Once again, here's a picture for you for an example:

You've got to be super-specific with these music people. If you accidentally spill some ink and put a dot to the right of a note, you could mess things up. How? Well, that's dotted notes. If you put a dot to the right of a note, then the note becomes worth more beats. It becomes worth one half of the original note plus the value of the original note. So if you put a dot to the right of a whole note, it becomes worth six beats. Instead of dotting the whole note, you could just tie together a whole note and a half note, but the dot is a feature of music you can use, just in case you get lazy. Oh, and limit two dots per note. If you put two dots, then the second dot adds one half of the value of the dot. So if you double dot a whole note, it would be worth seven beats. (4 + 2 + 1.)

B: Rests

Alright, now let's move on a bit, and start talking about rests. Whenever you see a rest, it's the opposite of a note, it tells you not to play. So then, rests have beats. Here are some kinds of rests:

Just like the notes, the whole rest is worth four beats, half rest is two beats, quarter rest is one beat, eighth rest is 1/2 beat, sixteenth rest is 1/4 beat, and thirty-second rest is 1/8 beat.

So once again, when you see a rest, you don't play for that amount of time. If you see a whole note and then a quarter rest and then a quarter note, it means play for four beats, rest one beat, then play for another beat. Soon you'll learn how to find out the pitch of the note to play, but for now let's ignore that.

For rests, basically the same rules apply as with notes. You can't use ties on rests, but you can put dots to the right of rests, and you can make them into triplets. (why would you want to tie two rests together anyway? A quarter rest tied to another quarter rest means the same as if those two weren't tied.)

Yaaay! We're done with notes and rests! Now let's go to the staff.

II: The Staff

A: Measures and the Staff

The staff is what all music is put on. It consists of five horizontal lines. The staff is split up into sections called measures. The vertical lines that separate measures are called measure bars. Here's a staff split up into three measures:

That's nothing so far, but oh well. Now, notes are put on this staff, and depending on which note or space of the staff the note is put on, is the pitch of the note.

Each different pitch has a letter name. The different letter names go from A-G, A being the lowest, and then they start all over. So the order of note pitches goes A, B, C, D, E, F, G, A, B, C, etc. Each line and space on the staff represents a pitch. Which line represents which pitch depends on what clef the staff has. Here are the two basic kinds of clefs:

Take about a day to memorize these. There are ways to remember them, such as from down to up, on the treble clef, the spaces are "egbdf", or "Every Good Boy Does Fine". The spaces, from down to up, spell FACE. With the bass clef, from down to up, the spaces spell out "Great Big Dogs Frighten Animals", and the spaces spell "All Cows Eat Grass." There are thousands of ways to remember them, you can make up your own. On the staff, the higher up you go, the higher the pitch.

What if you want a note that's not within reach of the clef? What if you want to reach an A pitch that's higher than the treble clef? Then you put a leger line. A leger line is a short line that acts as a sort of extension for the staff. Here's a picture of a few staffs with leger lines.

Can you tell what notes these are? Let's take a look at the first note. Okay, the first line on the bottom is an E, and since that note is two pitches below the E, it must be a C. (The space between the leger line and the "E" counts as a note, too. That space is a D.) In order, those notes are: C, B, C, G, A, and G.

The first note on that picture is a special C. It's not like the other C's, it's a special note known as "Middle C." On the Bass clef, the middle C is one leger line above the staff. (I'd draw a picture of it, but don't you think we've got too much pictures already?)

B: Accidentals

Okay, take a deep breath and let's move on. There are some pitches in between those pitches, like one in between C and D, etc. To get to those, you either sharp or flat a note. Making a note sharp moves it up, and making it flat moves it down. A sharp looks like a number sign ( # ) and a flat looks like a lower-case letter b. Just write those symbols before the note. So A# (A sharp) is the note in between A and B. It can also be called Bb(B flat). A note that has been sharped or flatted (or is that "sharpened" and "flattened"? I have no idea.) is called an Accidental.

So, that in mind, here's the notes, in order from lowest to highest:

A A#/Bb B C C#/Db D D#/Eb E F F#/Gb G G#/Ab A

As you can see, some pairs of notes don't have a sharp or flat note in between them. So then what happens when you sharp or flat those notes? Nothing different happens, it still moves up. So if you wrote down the note B#, it would be the same as writing down C. If you wrote the note Fb, it would be the same as writing E.

On a piano, each key represents a note. The C closest to the center of the piano is the middle C. To tell which key is which on the piano, look at the black keys. The black keys are the sharps and flats. The pattern of black keys and no black keys goes, black key, black key, no black key, black key, black key, black key, no black key, and starts all over. So look at the piano, and you'll see the pattern: two black keys, no black key, and then three black keys. The white key to the right of the two black keys is a C. So here's a piano with the notes written on it:

Calm down, you're not going color-blind, I made the white keys red on purpose, so that the green text would show better.

Whenever you make a note sharp or flat, all of that same note stays sharp or flat until the end of the measure. So if you make an A flat, and then you write that note again in the same measure, that second A would also be flat. But if you write it again in another measure, it won't be flat, you have to make it flat again.

If you don't want a note to be affected by a note before it, then use the natural sign, which looks like a L and an upside down L put together. Here's some music with sharps, flats, and naturals:

And that sign to the left of the third note is a natural sign. So in order, these notes are: E, Eb, E, D#, E, B, D, C, A. (Try to play it--it's the first few notes of Beethoven's "Fur Elise!")

Yaay! Only one more thing to go, then we're done with this section! And that one thing is....time signatures. (Shudder)

Actually, time signatures aren't that hard. It is just two numbers at the beginning of each song that shows how much beats are allowed in each measure. You've probably seen them, it's one number on top of the other. Here's a time signature:

The top number shows how much beats are allowed in each measure. So in this case, only four beats total are allowed in each measure. The bottom number, is what kind of note receives a beat, or you could say it's how much beats the whole note gets. It's usually at four. If you change it, all values change. For example, if the bottom number is changed to 8, then all values are multiplied by two: The whole note is worth eight beats, the quarter note is worth two beats, the half rest is worth four beats, et cetera. I suggest that you start off writing only fours in the bottom number, as you get better at music, you can try experimenting with different values. (By the way, the time signature 4/4 is the most commonly used one, it's also called "common time.")

And that's it! To make sure you've got it, here's a short piece of music. Get to a piano and try to play this song, it should sound familiar.

See the notes that have one on top of the other? That means for that beat, you play both of those notes at the same time. Two or notes played at the same time like that is called a chord.

Great! Now that you know how to write basic music, you can start writing your own. Buy a program like Musictime, or some other program that uses the standard music notation system. Usually those programs will let you put notes on predrawn staffs and then play back the music for you. Most also let you change the music into a midi file, so that you can then use them in your game.

In part II, I'll talk about how to expand your musical creativity—how to come up with your own songs. Any questions, suggestions for future articles, or comments, email me at Pitech@hawaii.rr.com.


John Licato is a game music composer and the CEO of Pitech Games. His personal email is Pitech@hawaii.rr.com.

Discuss this article in the forums


Date this article was posted to GameDev.net: 5/17/2000
(Note that this date does not necessarily correspond to the date the article was written)

See Also:
Techniques

© 1999-2011 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
Comments? Questions? Feedback? Click here!