Dave Mead who writes for the guitar magazines and has had lots of educational guitar books published recommends singing riffs out loud and then trying to play them. You will embarrass yourself at first as you naturally become self conscious, the trick is to ignore it and keep doing it. I do it all the time and it would appear a bit mental to an outsider, or anyone really come to think of it!! It really develops your pitch, timing and phrasing.