People keep asking questions about how to write songs, or what chords will sound good in a given song, et cetera, so I thought I would write out a sort of "how to"/example of a song being created. Now, I thought about doing a pop song, since pop songs are the most popular form of music by definition, however, I'm not a very good lyricist, so I'll just write a classical-type fingerstyle solo guitar piece, but I will still throw in comments about how the given segment applies in other forms of music, so that it will have utility for everyone.
Step 1: Pick a time signature.
All songs must have a time signature. That being said, most classical music goes way too far in depth with their time signature/tempo. I mean, a song in 4/4 time at 120 bpm (beats per minute) is going to sound exactly the same as a song in 2/2 time at 240 bpm or a song in 8/8 time at 60 bpm. So really, the only important part of our time signature is the number of beats per measure. I tend to prefer waltz/minuet-esque music with 3 beats per measure, but it's much easier for me to play/write in 4/4 time. So we're going to select 4 beats (or downstrokes) per measure.
Step 2: Pick a key.
The easiest key to write in is C major. However, I've been on a G major kick lately, so our song is going to be in G major.
Substep A: Acceptable notes for our song (aka: the scale)
The formula for a major scale is WWHWWWH. For G major, that's: G, A, B, C, D, E, F#.
Step 3: Create a melody.
Now in modern music, the melody is sung, so it is usually very simple, but we're creating a classical solo piece, so it will be quite complex. For the sake of this example, I'm not going to bother actually writing a melody, I'm going to let a random number generator do it. I'm going to do this by setting it up to pick random numbers between 1 and 7 (the number of notes in our scale).
First, we start it on our 1st, or root note (this is customary, but not necessary). Then we let the random number generator (www.random.org) go (normally you would pick these numbers based upon what sounds good following a previous number...but this is faster
1, 2, 7, 7, 6, 1, 1, 7, 1, 1, 5, 5, 4, 2, 2, 2, 7, 4, 3, 6, 7, 5, 1, 1, 7, 1, 6, 3, 2, 2, 3, 1, 3, 6, 1, 5, 6, 2, 2, 4, 7, 3, 5, 6, 6, 6, 6, 1, 3, 5, 1, 6, 7, 7, 2, 1, 5, 1, 4, 1, 3, 7, 3, 6, 1, 4, 5, 5, 2, 6, 5, 6, 5, 4, 4, 4, 2, 4, 2, 6, 4, 4, 3, 2, 1, 6, 6, 6, 7, 6, 5, 4, 6, 1, 3, 1, 3, 1, 1, 3, 1, 1, 7, 1, 1, 5, 6, 6, 5, 5, 1.
Now we convert this to letters:
G, A, F#, F#, E, G, G, F#, G, G, D, D, C, A, A, A, F#, C, B, E, F#, D, G, G, F#, G, E, B, A, A, B, G, B, E, G, D, E, A, A, C, F#, B, D, E, E, E, E, G, B, D, G, E, F#, F#, A, G, D, G, C, G, B, F#, B, E, G, C, D, D, A, E, D, E, D, C, C, C, A, C, A, E, C, C, B, A, G, E, E, E, F#, E, D, C, E, G, B, G, B, G, G, B, G, G, F#, G, G, D, E, E, D, D, G.
Normally we'd add another 1 (root note) to the end, but as it already ends in a G it's unnecessary.
Now we tab/write out a musical score based upon our notes:
E|-----2---|---3-----|---------|-----5---|---------|---------|---------|---------|
B|---------|---------|-----3-3-|-1-------|---------|---------|-------0-|-----0---|
G|-0-2-----|-----0---|-0-0-----|---2---2-|---------|-------0-|---0-----|-2-2---0-|
D|-------4-|-2-----4-|---------|---------|-4-------|---0-----|-4---2---|---------|
A|---------|---------|---------|---------|---3-2---|---------|---------|---------|
E|---------|---------|---------|---------|-------0-|-2---3---|---------|---------|
E|---0-3---|-0-5-----|-------0-|---------|-----3---|---------|-------3-|----------|
B|-0-----3-|---------|-7-0-----|---------|-0-3-----|---------|-3---1---|---7------|
G|---------|-------5-|-----7---|-------0-|---------|-----2-0-|---0-----|-4---9-12-|
D|---------|-----7---|---------|---2-2---|---------|-4-4-----|---------|----------|
A|---------|---------|---------|---------|-------2-|---------|---------|----------|
E|---------|---------|---------|-0-------|---------|---------|---------|----------|
E|----------14-|---0-----|---------|---0-----|---------|---------|---------|-0-------|
B|-13----12----|-0-----1-|---------|-----3-1-|---------|-------1-|-0-------|---------|
G|----12-------|-----0---|---------|---------|---------|-2-------|---2-0---|---------|
D|-------------|---------|-0-0---2-|-0-------|---------|---2-----|-------2-|---2-4-2-|
A|-------------|---------|-----0---|---------|-3-3-0-3-|-----3---|---------|---------|
E|-------------|---------|---------|---------|---------|---------|---------|---------|
E|---------|-------3-|-3-------|---------|---------|
B|-3-1-----|-----0---|---0-----|---------|---------|
G|---------|---0-----|-----0-0-|---------|---------|
D|-----2---|---------|---------|-------0-|-----0---|
A|---------|-2-------|---------|---------|---------|
E|-------3-|---------|---------|-2-3-3---|-0-0---3-|
Granted, it's not a magnum opus, but it suits our purposes fine. Normally you'd want a varied rhythm, but I wrote them all out as downbeats only for simplicity's sake. You could stop here, but it's not really all that satisfying at this point.
Step 4: Create a harmony.
This is the step that is normally referred to as "writing a song". It's purpose is to write a bit that goes along with the melody. As the melody in pop music is usually sung, I'll demonstrate how to create the harmony on a separate guitar, and then I'll move back to our solo-fingerstyle song.
By far the easiest way to do this is to just play all the notes in the given measure at once. Of course, this won't always work, so we can just play some of the notes. But I'll figure out 5 measures or so to give the general idea:
1st measure: 300233 (Gsus2) The notes played are GADADG. If you look at our first 4 notes in our melody, they are: G,A,F#,F#. While we could play F#, F# and G played together sound bad, so we just usually don't.
2nd measure: 320002 (Gmaj7) The notes played are GBDGBF#. I picked this chord just so we'd have an F# in there, to demonstrate that it can be done.
3rd measure: 200230 (Dadd2/F#) The notes played are F#ADADE. I picked this chord because in the previous two chords we ended with G then F#. I thought it sounded cool to keep moving to E.
4th measure: x02210 (Am) The notes played are AEACE. The notes in the 4th measure are C and A. This chord had both and sounded cool.
5th measure: x24432 (Bm) The notes played are BF#BDF#. This chord sounded sweet after the Am.
If you notice, all I'm really doing is picking chords that sound cool with our melody, and only use the notes from our scale. That means that I can't play, like, an A major chord since it has a C# in it, which isn't in our scale.
Back to the solo-style. What you want to do is pick intervals that sound good together (like 3,4,5, or 6) and then place them interesting rhythmic spots. I tend to prefer the first and third beat, but it's just a preference of mine.
For instance, the 5th of G is (well, lets see: G,A,B,C,D...D). Therefore, I'll toss in a D if a G falls on a first or third beat in the measure. If we've got an F#, I'll do a 4th: B. An E, a 6th: C. Of course, you don't have to stay consistent...if I want to do a 6th when a G pops up that's fine. Typically, you want your harmony to stay below the melody, but if it sounds cooler above, go for it.
E|-----2---|---3-----|---------|-----5---|---------|---------|---------|---------|
B|---------|-1-------|-----3-3-|-1-------|---------|---------|-------0-|-----0---|
G|-0-2-----|-----0---|-0-0-----|---2---2-|---------|-------0-|---0-----|-2-2---0-|
D|-0-----4-|-2---0-4-|-0---4---|-2---0---|-4---0---|---0-----|-4---2---|---------|
A|-----2---|---------|---------|---------|-2-3-2---|-2---3---|---------|-0-------|
E|---------|---------|---------|---------|-------0-|-2---3---|-2---0---|-----3---|
I'm not going to do more than the first line because I'm lazy.
Step 5: Finishing
Now's the time to go through and polish it up...if there's that note you just really didn't like, change it. If it's not an "allowed" note, then do it anyway...they're called "accidentals" (from the latin root of the word "accident" meaning "a thing that occurs") and they can spice up your song quite a bit.
Also, normally you'd want some arhythmia in there...some syncopation and such. If you get your harmony moving in a completely different direction than your melody and at a different rhythm, then you have contrapuntal music. (For an example see Taking Back Sunday's "Cute Without the E" at about 2:20 in...the two singers are singing contrapuntally...it's a pretty cool effect that I would like to see more of in popular music.)


