After a 10-15 minute warmup, I would pop in a CD and improvise my own thing over every song. I'd also go for playing the exact thing on the cd too, but the idea is to make your own tune to go with the song. I think of myself actually jamming with the band on the cd. I make sure I'm in the right key and everything, and make sure I'm following the music correct not just spatting out just anything. After years of doing this, I noticed that I can now pretty much improvise over anything. I get with a group of guys and I can play just about anything I want to with them. I'm no Vai or Petrucci, but I don't want to be either.
Now of course when I started this routine, It was crap. It was so hard to play something over a cd and make it sound natural, but it was fun and challenging so I stuck with it. With practice I became a natural at it. Now my friends would get pist cause when I hear a song, I'm always humming my own thing over top of it. I learned not to do that (just keep it in my mind), but once I get with a band it became an extremely important tool. Since cd's are mostly 45-60 minutes long, thats all I would practice. Now I'm into writing my own stuff, it is also a benefit.
It usually only takes me a couple of hours to write an entire song. Coming up with the original idea and writting it out probably takes the longest. Once that it done, I play it back through the headphone, plug my guitar into the recorder, and improvise the entire song. Last I go back, doctor up the little mistake or things I just don't want there. Bang I'm done. My whole idea is on a recorder in less than, my usual 2 hrs. Next steps are to write it out in midi, and finalize by adding bridges, and whatever else I choose to put in it to make it a complete song.
"My whole life is a dark room...ONE BIG DARK ROOM" - a.f.i.