I have met a lot of composers in my life, and many of them I can call my friends. Inevitably, I've heard many of their own ways, methods and routines of composing, and I don't think any two have the exact same process. As one of my composition teachers, Loris Chobanian, said to me (more than once) "There is no 'right' way to compose. There are as many ways to write a piece of music as there are composers." Even from what I know of some of the great composers of the past, they were all different. Mozart wrote a lot (conceiving of nearly an entire piece in his head at a time) and very quickly, Beethoven was constantly reworking and reworking his ideas until they were satisfactory and often wrote music down while out on a walk in nature, Ives composed whenever he could find the time, on weekends, holidays, on the train (as his day job was founding and running a life insurance company), Stravinsky always composed at the piano, Carl Ruggles only completed a small handful of works and was extremely methodical and slow (once spent several hours playing a single chord over and over again to make sure that he still liked it after a while), and these are just a few of many. But I'm going to try and explain, to the best of my ability, how I myself go about composing music.
Before I even start, I have to say that much of this process I do not even consciously know myself. It was Samuel Barber who said, "As to what happens when I compose, I really haven't the faintest idea." Unlike him, I do have some idea (otherwise this essay would stop right here) but there is plenty that happens below the surface of consciousness and I am gradually learning what that is.
And, of course, this only goes for my process currently, and many of these things will probably change as I grow and as my life progresses.
But here is what I can say:
I do not have a set schedule of composing. I do not treat it as a 9 to 5 job and begin at a certain hour and then clock out when my hours are up. I typically work when I have the time, when I'm inspired or want to, and I do it until I don't feel like doing it anymore, or I have to do something else I need to then do (like go to sleep or eat dinner).
I do a lot of finding and working out of ideas, melodies, harmonies, through improvising at the piano (or an electric keyboard, if necessary), and especially because I do not own a piano (or a keyboard at this point) a lot of that composition time revolves around when I can access a piano. Because I am also an active performing pianist, I will do practicing and composing in the same session and freely switch between the two whenever I feel like it. I take my laptop, put down the music rack, and place it right there so that I can input notes straight into my Sibelius notation software (which creates my nice legible engraved musical scores), although I do do plenty of sketching and getting ideas down on a pad of staff paper with a pencil as well.
I also tend to do a lot of "composing" just when I have some good time to let my mind wander, like falling asleep at night, taking a shower, or sitting on a bus or plane. I very often have a musical idea in my head, sometimes original or sometimes from a song or piece I know, and I just play around with it, imaging how it is notated and how it is on my "mind's piano," changing notes and rhythms and thinking about all the theory behind it. I do this so often without thinking that I remember not too long ago coming to the quasi-shocking realization that most other people probably don't ever do this!
I also do a lot of composing at the computer on Sibelius after getting some raw material worked out at the piano. This work, including orchestrating, inputting dynamics, articulations, figuring out tempos and metronome marks (which Sibelius is great for) and making the score clear and professional, I often do at night (I am definitely a night owl more than a morning person) which works well as I usually can't get on a piano at that point without disturbing someone anyways. I take plenty of breaks during this work to check email, surf the net, and maybe watch a basketball game (which I'm doing right now while I write this!) or something else at the same time.
I always have several pieces and projects going on simultaneously. I tend to get a lot of ideas for pieces that I want to write, begin them, and then hit a wall. Always wanting to be efficient, if I hit a wall with one piece, I'll move to another and see if that one is flowing at all.
I do very little revision after I put music "on paper" (meaning on the computer). Most of my experimenting and discarding of things I don't want to use is done very quickly as I improvise at the piano. If it doesn't work after playing and hearing it, then I try something else or modify it, so what hits (digital) paper has already gone through a bit of revision already. I almost never go back and substantially revise a piece after it is "finished"; I often will take something and make a new work from it, adapt it for different instrumentation for instance, but I always leave the original as the piece it was and do not replace it. It is done and this is what I could create at this time in my life, and if I want to do anything different I'll do that in future pieces.
On occasion, I have music in my dreams at night, and while I rarely I remember them enough to write them down, these have sometimes been great ideas which I have used in pieces. (Although, they certainly haven't all been good musical ideas. Once I was dreaming of a choral piece, which in my dream state seemed awesome. As I woke up, I kept repeating it to myself over and over so I wouldn't forget it. Then after being fully awake, I realized how lame it was! The words were "Come and take the train to Harvard Square..."!)