Last week I posted some midi files for improvising in one key. It is possible to improvise against those chord sequences with the notes of one scale only. It's like cycling with stabilizers; completely safe, fun at first but quickly limiting.
This week I want to take it a bit further with the following sequence:
l:C / / / lC / / / lD / / / lD / / / l
l F / / / lF / / / lC / / / lC / / / :l 8 Bar in C midi file
This sequence is in the key of C major but visits the neighbouring key of G major. The D chord in bars 3 and 4 is acting as the dominant chord in G major and you should play an F# against it rather than an F natural. Note that it is not acting as the tonic of D major so don't play C#. If you don't know what I mean by tonic and dominant, don't worry at this stage; the exercise will still work.
Listen to the sequence and you will hear the chords changing. Now play along in C major, changing to G major (the key with F# in) for the bars with the D chord, and back to C major for the F and C chords. When you have mastered this try the same exercise in the other keys (below) and try breaking the rules to see what happens. For instance, play a C# against the D chord and see if you like it. Music is in the ear of the beholder.
The same sequence in F:
l:F / / / lF / / / lG / / / lG / / / l
lBb / / / lBb / / / lF / / / lF / / / :l 8 Bar in F midi file
Play in F major except over the G chord where you play in C major (so no Bb for those two bars).
and the same sequence in G:
l:G / / / lG / / / lA / / / lA / / / l
l C / / / lC / / / lG / / / lG / / / :l 8 Bar in G midi file
Play in G major except over the A chord where you play in D major (so add C# to the F# you already play).
And finally, if none of these symbols mean anything to you and you play entirely by ear then good for you. Feel the changes and let your ears/fingers find the notes that go best.