There are two types of people in this world. Those who finish what they started etcetera etcetera
View post (Are your guitar solos generally spontaneous...)
View thread
I generally play around the melody. Sometimes, however, we'll put together an instrumental with some odd chord changes. When that happens I take the time to analyze the chords to see if they are diatonic or altered. If altered I'll look for the common notes and work the improv around that shared tonality. This helps a lot. Especially if the tonal shifts are fairly radical.