When I write music (which i never do with an instrument in my hands anymore) I do it by visualizing the different parts of a song as different patterns of shapes and whatnot sitting at different heights and depths on a plane. The job is to figure out how to connect those parts together.
This is a really shitty explanation btw... I've never been able to explain this to anyone.
Bookmarks