For me it's always contingent on getting a sound-the sound always suggests what kind of melody it should be. So it's always sound first and then the line afterwards. ↗
When I am seriously composing, sometimes a phrase will come into my head, a catch phrase. When I was writing pop songs for a few years, as a career, separate from my folksinging career, I used to write songs for pop singers. ↗