Welcome, Guest.
Please login or register.
Basic Music Tutorial
Forum Login
Login Name: Create a new account
Password:     Forgot password

Darkshade Forum    Isle of Everwar    Game Builder Discussion  ›  Basic Music Tutorial
Users Browsing Forum
No Members and 1 Guests

Basic Music Tutorial  This thread currently has 1 views. Print Print Thread
1 Pages 1 Recommend Thread
Diddly
July 6, 2010, 6:46pm Report to Moderator Report to Moderator

Noble
Posts: 1,231
One of the cool things you can add to your maps in Everwar is your own custom music.  The music notation is written as MML.  This is a pretty "simple" notation to write, but can be daunting to read.  Here's the official documentation for this implementation of MML: http://mmltalks.appspot.com/document/siopm_mml_ref_05_e.html

But you probably don't want to read that yet.  It might scare you.

So instead, here's a quick little tutorial I've done, as much to help me understand this stuff too.  

The core of MML is just writing the note names in the order they are played.  For example, I got the Pirates of the Caribbean song stuck in my head, so I went to the piano and plunked out the tune.  The notes of the first bar are: G Bb C C

MML uses the same note names (but lowercase), and denotes sharps as + and flats as -
Our song so far:gb-cc

However, note names will only get you one octave of music.  MML starts each octave on C, so for our sample song, we need to move up one octave after the b-.  This is done with the < symbol.  Similarly, the > symbol will take you down an octave.
Our song so far:gb-<cc

Music isn't just tones though.  We need to be able to say how long each note lasts.  In classical notation, there are whole notes, half notes, quarter notes, eighth notes, sixteenth notes, and so on.  The time signature would tell a musician what type of note gets a beat and how many per bar.  In MML, it seems a quarter note gets a beat.

We can define a note's length by adding a number after it.  The numbers are 1 (whole), 2 (half), 4 (quarter), 8 (eighth), 16 (sixteenth), 32 ... well you get the idea.  So let's do that now.
Our song so far:g16b-16<c8c8

That's already starting to look a little complex.  But we can simplify it with setting some "defaults".  For example, in classical notation a composer COULD write sharps and flats behind every relevant note, but what a waste of time!  So they invented the Key.  I figure our song is in the key of B flat.  That makes all B's and E's flat.  So we can set that for our song using #SIGN{key};
Our song so far:#SIGN{B-}; g16b16<c8c8

We can assign a default note length too.  Using the l command (lower case L).  Whatever number follows it will be applied to any notes that don't have a duration explicitly defined.  For our example I'll choose l16.  I could do l8 instead, but since 8 is less characters I'm going with 16.
Our song so far:#SIGN{B-}; l16 gb<c8c8

Another aspect we want to manipulate in music is volume.  MML has a volume dial that goes from 0 to 16.  You can adjust it at any point in the song, but let's set it to 15 right at the beginning.  This is done with the v command.
Our song so far:#SIGN{B-}; v15 l16 gb<c8c8

We've talked about note duration, but you could ask the question "How long is a quarter note?"  We need to set the tempo for our piece.  That's done with the t command.  The default tempo is 120 bpm (beats per minute).  But for the sake of completeness, let's set it ourself.
Our song so far:#SIGN{B-}; t120 v15 l16 gb<c8c8

You can repeat any set of notes any number of times by enclosing them in square brackets and putting the number of repeats immediate afterward.  So [cde]3 is the same as cde cde cde.  At this point I'm going to add in the rest of the Pirates riff and repeat it twice.
Our song so far: #SIGN{B-}; t120 v15 l16 [gb<c8c8wr def8f8wr ede8e8wr dcd8r4]2

If you put that in the music editor, you should be able to recognize the tune.  But wait!  What's those w and r symbols?  w stands for "wait" and essentially holds the note however long you want.  In this case an extra 16th (since that's our default duration).  r stands for rest and leaves a silence for whatever duration you define.  You can see I left some spaces in there too.  That's just for legibility.  Spaces and newlines mean nothing in the language so I encourage you to use them in places that make it easier to read.

So that's the melody all done, but how do we add harmony?  You'll note the ; after the key.  This is how MML completes a concept.  If we wanted to add another line of concurrent notes to be played, we just need to complete this line of notes.
Our song so far: #SIGN{B-}; t120 v15 l16 [gb<c8c8wr def8f8wr ede8e8wr dcd8r4]2;

Now we can add harmony.  Each part needs its own tempo, volume and default length, and needs to be finished off with a semicolon.  The finished song is below, and concludes this basic tutorial on MML.  At this point you can try writing some of your own stuff!

Quoted Text
// key of B flat
#SIGN{B-};

// tempo 120, volume 15, default note length = sixteenth
t120 v15 l16 [gb<c8c8wr def8f8wr ede8e8wr dcd8r4]2;

// the chords, repeated twice
t120 v15 l16 [rr>c4r rrc4r rre4r rrd4r8]2;
t120 v15 l16 [rr>g4r rrf4r rrg4r rrg4r8]2;



Currently Reading:Next in Queue:
When Heavens CollideRed Mars - Kim Stanley Robinson
Logged Offline
E-mail E-mail Private Message Private message
1 Pages 1 Recommend Thread
Print Print Thread

Darkshade Forum    Isle of Everwar    Game Builder Discussion  ›  Basic Music Tutorial