I know about non-diatonic chords and such (not much though), but what I mean is a different tonality over each chord. In a song I've been working on lately, the tonality changes with each chord, and the chords play for several bars each (4 bars in most parts). I have a funky blues pentatonic intro to the song, and then right after two chords play for 4 bars each, A7 and Gm7. Over A7 I used the pentatonic of A Mixolydian, and over the Gm7 I used G Dorian, and the whole thing repeats once more. The thing is that it didn't sound "wrong" at all. Actually to me it sounded way more interesting than the one tonality stuff I've always written. Then after this part I play an A Phrygian dominant riff for a while, since I wanted a Middle Eastern feel to it. The transition sounded smooth to me since it's the same root chord. And after that I'm thinking to repeat the previous part, then right after a different Phrygian dominant melody (that I still haven't written).
As for the solo, this is the chord progression I've come up with just yesterday: A7, Dm7, A7, E7, C#7, E7 and then as an outro to the solo an A Phrygian dominant section for 8 bars. In the first section of the solo, over the A7 I used A minor pentatonic to give it a bluesy sound. Over the Dm7 chord I played D minor pentatonic then D natural minor. The change of tonality sounded much more interesting than sticking to one tonality, and gave the solo some soul or something. As for the rest of the solo I still need to come up with some ideas.
My question is: do I really have to stick to harmony and to just one tonality for riffs/melodies and follow the rules strictly? I feel this is very limiting. As you can see especially with the solo I wasn't following a certain diatonic chord progression, but the chords just sounded good this way and allowed me to be more free with my solo and riffs. Is what I've written considered "wrong?" Also if someone has a theoretical explanation to what I've done it would be more than appreciated.
