hi, most of it is good...
I think you hear a dissonance with the Dm7 because of the change of registers... at the 3rd measure you had an F as the last note of the scale and you jump nicely with an E on top... that really works if you are doing something tonal... since the Dm7 is off the tonality here, you might want to play a more closed structure melody..
so instead of jumping up a 7th from F to E, jump down a minor 2nd to E...
it also sounds dissonant because there is a Bb that C7 is using...
Since you are using E natural for both the BbMaj7 (making it a #11) and the Dm7 (making it a 9th).. when you go to Dm7/C7 the ear needs to have that Bb because you went out with the Eb to E natural... why?, because Eb is almost everywhere in the exercise...
Eb and Bb are really close to each other in terms of tonality... and if you play an E natural without making the Bb clear is going to sound like as if you had modulated to a different key, and that is not the intension..
so try this...
for the Dm7/C7 measure leave the E natural but add also a Bb to the melody and as i said before..
dont go too high on the register...
once you fix that, post it here in the forum...
if it still sounds dissonant i will show you another way of fixing it...
