So, here are a few ideas for how to write a good melody. It helps if you have an awareness of what’s in the melodic toolbox. Sometimes a great melody will just pop into your head as though it has been divinely inspired on other occasions you will have to work at 2 or 3 melodic ideas over a long period of time, mixing them up until you finally produce a melody that inspires. I’m not sure of the maths, but melodic writing certainly involves a combination of these 2 elements. I have heard it often said that “ writing music takes 10% inspiration and 90% perspiration”. Think of any great piece of music from any genre and it will (most likely) have a great melody.
This is the most common question I ask my students when teaching them how to compose music. “What are you going to send me out of the room humming?”