I sometimes try to analyze the harmony of a Bach prelude to understand how chords change, and how he manages to shift from one key to another. Here is the prelude in Cm BWV 847 (source image, MP3 here):
Here is what I understand:
BAR CHORD DEGREE / KEY
[Cm key] [Gm key] [Fm key]
1 Cm I
2 Fm IV
3 G V
4 Cm I
5 Ab VI = IIb ?
6 D V
7 Gm I
8 C7 IV = V
9 Fm I
Would you have a similar analysis or are the key changes on bars 5 and 8 incorrect?
Notes: I'm using capital letters for every degree, I don't write I for major and i for minor, I hope it's understandable. Also I haven't written the chords "with bass", for example bar 5 it should Ab/C for Ab major chord with bass C.