Often I awaken with a "song clip" melody in my head, and often even with words. Of course I quickly examine whether it's someone else's song! But it's almost always "mine." At first I would sketch down everything I had in my journal, working at a piano to write the few melody notes I had. Sometimes even selected which of the usually-4-chords would fit melody notes.
And that works of course when you don't have recording capability right there. But the result is often forgetting to finish what might have been a great song. AND.... I've learned that we lose the "feel" of the original idea if we're like perfectionists, waiting for completion before we record.
1. Go record what you already have. Use a slower tempo for easier recording of instruments with lots of notes, like piano or guitar.
2. Create a duplicate track.
3. Set the playhead (red line) a bit before the Step #1 recording ends, and select the duplicate track.
4. Hit RECORD and begin playing "anything" on the DUP track.
6. Set the tempo to what "feels" right. If you have words, it helps to sing with the music when deciding a tempo. (Once I didn't realize until in the professional studio that I'd almost pass out from lack of breath singing the entire song at once in my selected tempo.... that was "HOLY HEZEKIAH BLUES" !!!
7. Later.... you can wait until you have time!..... select the regions you want to keep or edit, and delete what you hate. Build on these with music you like.
8. Finally, just look at the SCORE in the recording program to calculate the melody notes and chord names to write down on your music sheet pages.