Melody is a series of single notes.
It is useful to compare writing melody with writing rhythm. Rhythm is audible unpitched sound with a beat that forms recurring patterns over time. Replace unpitched sound by pitched sound, replace beat by note, and we get the definition for melody: melody is audible pitched sound with a note that forms recurring patterns over time.
To write melody we need to know how a note gets its pitch and how we can use that information to write recurring patterns of notes.
We start by looking at musical instruments. Then we investigate the relationship between tuning and interval which determines the notes available for writing melody, how many there are and how they relate to each other. Arranging the notes in a tuning system in a specific order forms a scale. We have a break to look at the human voice and the specific requirements of sung melody then return to scales and spend a lot of time on development and how to generate a melodic idea and write a variant melody. We end with movement and examine motion within a melody and modulation between keys.