Sometimes I get a lyric, and the lyric, you know, comes off the page, and goes into my brain and comes out with a melody. Other times, I may create a melody first.
Indeed, whenever a new idea is developed, as for example ballooning, warfare immediately takes possession.