Terminology
 SIN  Semitone Integer Notation:
 Measures all distances in semitones Note: A number always represents a relative distance. When I want to refer to notes I will write n after the number.
 CIN: Chord Integer Notation:
 Represents a chord with a root tone, and a series of intervals which are measured in semitones. This allows us to abstract away from the notes involved in the chord but to focus on the intervals within it.
 w.r.t: With Respect To
 Interval Movement Table
 Interval Movement Table: With respect to some given note N, the top row represents the interval away from N, as you move down the table, time progresses.

 0  1  2  3  4  5  6  7  8  9  10  11 

            

            

            

            

Abstract
We discuss a possible method to improvise smoothly between two chord changes and to move notes you are playing now into a new chord's context, and to minimize the amount of time spent doing so
Remark
I believe with alot of practice you can get to a level where you don't have to think about this while you're playing and it comes naturally. This article supposes that you are in the learning stages.
Motivation
 Let's start with a 1 4 5 (blues), here is one of the most basic versions.
I7 I7 I7 I7
IV7 IV7 I7 I7
V7 V7 I7 I7
Say you are improvising around the I7 chord and the IV7 chord is approaching.
In order to be able to move into it you might need the context of a key. For
example if we are in the key of C, we know that that I7 chord contains C E G
Bb. We also know that the IV7 chord contains F A C Eb, from here we can
observe that the E could move down to the Eb, and that the A could move up to
the Bb and possibly other ways to move into the next chord.
The analysis above is great! But we are not looking at things in the greatest
generality, if we have to think like that every time a chord change comes, it
detracts from other areas we could be thinking in, (eg your
melody/improvisation might suffer if you are thinking about what notes come
next).
Idea

Instead of thinking with respect to a given key, let's assume that the key is
arbitrary. So in this case, let X denote the key. If we are playing in the key
of X, then we know that the I7 chord is formed by taking X, and generating the
notes which are a P1, M3, P5, m7 distance away from X , equivalently in CIN: Xn  0 4 7 10, meaning that the notes involved are:
(X+0)n (X+4)n (X+7)n (X+10)n
We can see that the first change is from degree I to degree IV. In terms of semitone notation,
that would be 0 to 5, this is because in terms of the scale (when written in
SIN):
0 2 4 5 7 9 11 0
 Representing intervals with respect to X, the notes would be (X+0)n, (X+2)n, ..., (X+11)n
Therefore the second chord is (X+5)n  0 4 7 10. The notes involved in this
chord are:
(X+5+0)n (X+5+4)n (X+5+7)n (X+5+10)n
Recall that our goal is to see how the previous chord tones fit in to our new
context. Very clearly we can see that every note in the original chord has
been shifted up by 5 semitones, therefore with respect to the new context each
note is 5 semitones less than what it used to be.
Notes are good, but to be more general we need to talk about their
distance with respect to the new tone to understand it's melodic qualities.
For example, let's take (X+10)n from our first chord, our goal is to figure
out what the distance is to this note with respect to our new chord.
As it turns out, we can measure the distance between any two notes in SIN
simply by subtracting them. For example, There are three semitones between E
and G because in my system E=4 and G=7, therefore 7  4 = 3.
So, in this case if we want to know the interval between (X+10)n and our new
root (X+5)n, we should just subtract the two, so we get (X+10)  (X+5) = 5,
therefore we know that (X+10) is 5 semitones higher than (X+5), our new root.
This means that an interval of 10 with respect to the first root became an
interval of 5 to the second root. By moving into a chord which is 5 semitones
higher, any previous interval we had has been reduced by 5 semitones.
This idea gives rise to the most fundamental aspect.

If you are playing an interval I with respect to a root R, then with respect
to a new root R* which differs by k semitones wrt R, we know that (I)n differs by Ik
semitones wrt R*
Applying this idea to the full chord, we see that Xn  0 4 7 10 becomes (X+5)n  7 11 2 5. So we have a method to see how the previous chord fits in to the next.
To move smoothly between the chords, let's analyze the acutal intervals
involved in the next chord (X+5)7 (IV7), since it's a dominant 7th, we know in
CIN:
(X+5)n  0 4 7 10
Now if you are improvising on the chord Xn 7 (I7), and you are finishing on
an interval 7 (w.r.t Xn), then it becomes an interval of 2 (w.r.t (X+5)n).
You can see that this interval is not a chord tone, but, it could be moved
easily to a 0 (by moving down two semitones) or the 4 (moving up 2), you could even stay on the 2 if you wanted.
To be able to move fluently you should have an idea about how each of the
intervals change we will use an interval movement table (top row are interavls with
respect to Xn)

 0  1  2  3  4  5  6  7  8  9  10  11 

04710
 x     x    x    x  

71004
 x    x   x     x   

Visually we can see that intervals of 0 4 10 are nice because you can slide to
the next tone by only moving 0 or 1 semitones.
Aside
This is extra information, so feel free to skip to the recap if you just want to see the result

During a chord change (both involving 4 tones), there will always be at least one note which can
stay where it is or move by at most one semitone and become a chord tone of
the next chord.  (Implicit assumtpion: chords have spacing at least one
between any two notes in the chord.)

The reason why this is true comes from the following argument:

Let a1 a2 a3 a4 be the chord tones of the first

Let b1 b2 b3 b4 be the chord tones of the first

If the two chords share a single note, then that note is one that can stay
where it is and still be a par of the B chord

If they don't share a single note, then you have 8 different notes all crammed
into the following set of notes. Let's try and put them in so that no two
notes are ntext to each other and see if that's possible

If we do this:

 0  1  2  3  4  5  6  7  8  9  10  11 

 x   x   x   x   x   x  

We are at a breaking point. We have 6 chord tones in there, and we still need
at add 2 more, (8 in total because a1 a2 a3 a4 b1 b2 b3 b4), but anywhere we
would add another x would make two next to eachother.
Therefore there must be at least one note in the next chord which is one
semitone away, for example, fitting all eight in could give

 0  1  2  3  4  5  6  7  8  9  10  11 

 x  x  x   x  x  x   x   x  

Recap

Using a table is an easy way to visualize what is happening. You can use a
table if you have time before hand to figure out the chord changes. But a
muscian should be able to pick up any piece and play through it. If you don't
have the time to make a table then how can you do this?

Here are the steps.

Take the chord you are playing now in CIN: ex) Z  0 3 7 10

Consider the chord coming up: (Z+3)  0 4 9 11

Compare Root tones: The second root tone is 3 higher than the last

Convert intervals w.r.t to new root by subtracting the above difference:
0 3 7 10
    (3)
9 0 4 7
Consider these intervals w.r.t the intervals that are by default
there in the second chord (in our case those are 0 4 9 11)
If you want something sounding smooth, move to an interval that gets
translated to an interval which is at most 1 semitone away from an
interval in the next chord. This is guarenteed to exist.
We now know the relationships of the last chord w.r.t. to the new one, and how we can figure out what we can play next in our head!