I write rock music, but I also write classical music. One set of techniques that classical composers use to create better melodies also allows you to start with a simple idea and create something much larger. I use these techniques to write rock music. This set of techniques is called motif development.
This is a long list, but you can chose just a couple to begin with. Once you've mastered those, you can learn a few more and so on.
An example of motif development would be Beethoven's fifth. The famous, da, da, da, dum at the beginning is called a motif. It's like the classical music version of a riff. Beethoven only had four notes in that motif, yet according to the third link at the bottom, he wrote 506 measures by developing that four note motif. So if you want "study with a master of motif development", check out Beethoven's music.
You didn't say if you read music. If not, don't worry. You can still use them.
The jargon may make this sound complicated, but it is just a list of ways to modify a motif, by rearranging the notes in various ways kind of like a puzzle. After you get familiar with a few of these, you probably come up with a few of your own.
First you write a motif. It's just a short group of notes you think sound good.
Then you will repeat that motif after it has been changed by one or more of these techniques. Then you change it another way and repeat it again. You can write a lot of music this way. Beethoven was a master of this.
The first technique is just plain old repetition. You just repeat the motif.
The next one is called sequence. You repeat it but you have shifted it higher or lower in pitch. This is how Beethoven wrote that opening theme to that movement. He moved those four notes up and down to create most of that music.
Interval change An interval is the distance between two notes. C to D is an interval of a whole step. When you change it to go from C to Db, you have contracted the interval to a half step. If you go from C to Eb, you have expanded the interval to a minor third.
-Interval change is where you repeat the motif but change the distance between notes in one or more places in the motif. If Beethoven had followed da da da dum with da da da doo, it would be interval change.
The next one is called rhythm change. When you repeat it, you change the rhythm.
The next one is called fragmentation. It is where you repeat just a part of the motif. You could follow that with a different piece of the motif. If your motif is long enough, you can create a melody using just this technique alone.
Next is extension. This is where you add some new material (a new set of notes) before the last note of the motif when you repeat it.
Compression is where you remove notes from the middle of the sequence.
Expansion is where you add some new material (a new set of notes) after the last note of the motif when you repeat it.
Inversion is where you flip your motif upside down. Where the motif goes up in pitch, the inversion goes down in pitch and vice versa. This is good for a call in response. The "response" (the inversion) is similar enough to the original motif to sound like a response to the "call" of the motif.
Introversion is where you break the motif into fragments that make musical sense unto themselves and you change the order of the fragments to create the introverted motif.
Diminution is where you shorten all of the note values. Half notes become quarter notes. Quarter notes become eights and so on. The modified motif is twice as fast.
Augmentation is where you lengthen all of the note values. Half notes become whole notes. Quarter notes become half notes and so on. The modified motif is twice as slow.
Ornamentation is harder to explain. You keep the same basic motif, but add fancy devices called ornaments to it. It could be as simple as adding extra notes between the notes of the motif to fancier things like trills and turns. For your purposes, just think of it as dressing up the motif to make it fancier.
The final technique I have for your is thinning. This is where you eliminate notes. Beethoven does this in the first theme where he reduces da, da, da, dum to single notes at the end of the theme. You can eliminate any number of notes.
You can combine these. You can do two or more of these when you repeat your motif the first time. For example, you could repeat a fragment at a higher pitch with a slightly different rhythm.
When you have found the right combination, it will sound right. It works. It will sound organic, like it belongs with the motif.
For me it's inspiring when this happens. My process is to flounder around trying things out, but nothing inspires me. Then a day or two later something gels and then I am glad I learned these techniques.
If you learn these techniques, you will start hear them in all kinds music. A lot of songwriters do these things intuitively.
I wish you luck with your songwriting.
If you want to know more about motif development, check out these links:
These two links are the ones I use to remind me what the techniques are and are my source for this list:
Here is one I found that uses Beethoven's fifth as the example: