I'd love a bulletproof way to always wake up immediately after hearing a song, but not so soon that it doesn't have time to finish (which has also happened to me), but I'm not sure if that's possible
they're hard to catch. the more time you spend writing and coming up with things while you're awake, the easier it will be to remember and understand what you hear in your dreams. and it will also generally increase the chances that the good stuff will also come around while you're awake