Pick a scale. It could be any scale or mode, but for this exercise I will ask you to pick either a major or a minor scale. This is because it is easy to begin with (and to find chords that match later).
Draw a simple graphic outline of how you’d like your melody to move in pitches. Up or down, big jumps or smooth.
Draw a picture, no notes yet. As you imagine the visual outline of the melody, also imagine the sound, maybe rhythm, and speed etc. So your graphic melody idea might look something like this:
Keep it simple. Nothing fancy. This is only to have as a basic idea of the shape of the melody and to help to start your creative juices flowing!
Decide how many measures you would like the melody to be. It's a good idea to start with 4 or 8 measures. It gives a nice balance, and is easy to work with when you start out to learn how to write a melody.
Divide your graphic in the amount of measures you decided. 4 or 8 parts, or «measures» where it seems to make sense (visually).
Write your scale and its key signature. This is the basic material for your melody. Like this example in C major:
Important and useful "hook" notes are the 1st, 4th, 5th and 7th (leads "home" to the 8th/1st). These are great to lead to, rest on and sometimes start a measure with.
Prepare a staff with a G-clef and key signature. Do not write time signature, we don’t know what rhythm will fit your melody yet! But do draw bar lines for the number of measures you decided on.
To set the mood of the piece to reflect the scale you chose, end your melody on the first note of the scale. In the example this is C. So in the last measure, as the last note I write the note C.
Now look at your graphic diagram. For each measure, pick notes from the scale at the height you wanted, to shape the melodic outline.
Use only indications of notes, or whole notes. (The note values we’ll decide later.) You are free to change your mind whenever you want.
Does the outline look good visually? Are there any larger interval jumps?
Most singers and instrumentalists do not enjoy huge jumps in the music.
To make it smoother, make sure a jump of a 7th goes to the next note up, the octave, that any intervals larger than a 5th are not used too often, and avoid jumps larger than an octave.
First «taste» test. Play the melody on your instrument. Get a feel for which notes want to go faster or slower, and if they like to be grouped together somewhere. Make any changes you like.
Now start jotting in the rhythm. Make notes you'd like to be faster 8th or 16th notes; longer notes quarter, half or whole. Keep it simple.
Feel what notes you want more emphasized, this will give you an idea of what meter the piece wants to be in! The more emphasized notes could be the main beats. Mark them out. Make any changes or adjustments that you like.
What do you think the meter is? Do you feel the melody in 2, 3, 4 beats per measure or something else? If you have trouble here, check out my lesson about musical meter.
Decide the time signature you feel is the most appropriate, and adjust the note values for all measures. Play through the melody and make any corrections you like.
Repeated rhythm patterns are nice. Try to incorporate that!
Try not to be a perfectionist. This is your first try learning how to write a melody. The tune might even surprise you and get a «life» of its own!
Time to move on to how to add a chord sequence that fits with the melody>>>