Harmonic Systems - Harmonizing from top notes (melodies)

In the jazz world, Barry Harris came up with the idea of harmonizing a bebop scale. Combining a C6 (C, E, G, A) and a Bdim7 (B, D, F, Ab) chords, we have this scale:     From this stantpoint we can alternate tonic and dominant sounds, like this:     Every pair of chords have all the 8-note set. The notes C,E, G and A are always harmonized with a C6 chord. The notes D, F, Ab and B are always harmonized with a Bdim7 chord.   So, from
I found a solution with pattern-match.   Pitches for melody (setf melody '(c5 c5 d5 e5 g5 a5 g5 c6 b5 c6))   Block harmonization with pattern-match (setf blkharm (pattern-map '(((c3) (e2g2a2c3)) ((d3) (f2gs2b2d3)) ((e3) (e3c3a2g2)) ((f3) (gs2b2d3f3)) ((g3) (g3e3c3a2)) ((gs3) (b2d3f3gs3)) ((ab3) (b2d3f3ab3)) ((a3) (c3e3g3a3)) ((b3) (d3f3ab3b3)) ((c4) (e3g3a