I thought it might be interesting to know about everyone’s writing techniques, I find I have two main methods for writing tunes. I either think them out in my head completely, often without touching any instrument before hand or I write them based around a chord or melody that I discovered by chance on my guitar that intrigues me.

I’ve noticed that the best seem to be the ones I randomly develop in my head, perhaps it’s because they’re not centred around one idea. Anyway, that got me wondering of those two techniques - what seems to work better for you guys?
I usually write them in my head before hand. A lot of the times when you jsut jam them out, they're generic because they're coming from muscle memory