I'm assuming you have basic knowledge of intervals (refer to musictheory.net or my "pure theory" lessons if not).
Vocab:Melodic interval - an interval between two notes sounded one after another
Step - a melodic interval smaller than a minor third
Skip - a melodic interval a minor third or larger
Conjunct motion - melodic movement dealing with steps
Disjunct motion - melodic movement dealing with skips
Classically, disjunct motion is generally more dissonant and conjunct motion more consonant. Try playing a C, then skip to a G, then go down the major scale step by step back to C (C, G, F, E, D, C). This is a simple melody involving a skip and some steps. The melody could be described as mostly conjunct.
Now try a melody made entirely of skips. C, A, D, G, E, C. It feels much more "varied" and "diverse" than a conjunct melody, just a bit short of earning the title "exotic."
Experiment with varying amounts of disjunct and conjunct motion until you feel you've fully grasped the concept.
Part 2: Rhythmic Embellishment
Another element to consider when writing melodies is timing. Take the first example above (C, G, F, E, D, C). I'll show you two different rhythms for this melody, both in 4/4, with the count (#, e, &, a, etc.) next to the numbers.
C(1) G(&) F(2) E(&) D(3) C(&) /(4) /(&)
C(1) /(&) G(2) /(&) /(3) F(&) E(4) D(&) C(1)
In the first example there is a rest after the melody, and then it would repeat. In the second example, the final note of the melody is also the first note of the repeat. The second example feels a little more varied, and you'd be more likely to hear it in a popular song than the first example, which feels a little squished together and awkward. However, sometimes the inspiration/purpose calls for that awkward feeling.
Write some melodies with some nice steps and skips, and then work on their rhythms until you've fully grasped this concept too.
Part 3: Scales
Using different scales/modes can really give your melodies distinct flavors. The examples we've worked on so far all work in the major mode, specifically the Cmajor scale. But what if you took the 4 (F) and sharpened it, for a Lydian sound? It sounds a little more adventurous, and dreamlike. What if, instead, you flattened the 3rd (E) and turned the major melody into a minor melody? Now it sounds like a darker, lurking melody.
This may sound contradictory, but try not to get into the habit of describing melodies or songs as "in" a certain scale, and try not to think too much in terms of scales. Instead, think of it in terms of intervals. Although the main melody of a song may include a #4 and a b7, the "lydian dominant" mode may not be very consistent through the song; those notes could just be colorful little accidentals thrown in for interest. Ultimately thinking in terms of scales when composing, improvising, or analyzing music will only limit your creativity.
So even though this part is titled "scales," what I'm really trying to teach you is to use a few colorful notes. Throw in some b2s, #2s, b3s, #4s, b7s, or whatever it is you're into.
Mess around with all the melodies you've written so far and try writing some new ones until you feel a strong grasp on this concept.
Part 4: Now What?
So you've written a melody and taken steps/skips, rhythm, and the scale (or colorful notes) into careful situation. Now how do you go from one melody to an entire song?
The easiest way to go about it is to repeat the melody without any variation, just keep going for an entire verse or chorus or whatever it is. There are some great songs written this way, keeping your interest through lyrical change, little licks/fills from the instruments, etc.
A more complex way to deal with the issue is to add variations of the melody. Take Radiohead's "High and Dry." During the chorus:
"Don't leave me hiiigh
Don't leave me dryyy"
The initial melody (don't leave me high) is varied a bit (don't leave me dry) by ending with two extra notes (on the word "high" there is one consistent high note, and on the word "dry" Thom Yorke hits the same note but then follows it with a couple lower notes).
This guy's lesson on melody writing is very helpful, pay special attention to his song analysis (he explains Warmth of the Sun by The Beach Boys, Eleanor Rigby by The Beatles, and High and Dry by Radiohead).
These two links (first, second) are to lessons on how melodic development has been handled by classical composers.
Hope this all helps. Next time, we'll discuss what to do with the other instruments (or "voices") once you've written enough melody for your entire composition.