I've been studying the Bach inventions, and I see a common patterns in the first 3 inventions: They tend to include the flat 7ths in the very end. Examples:

C major:

enter image description here

D major:

enter image description here

E♭ major:

enter image description here

From a music theoretical standpoint, it's confusing, but in my ears this harmony "sounds like the piece is ending". Does anyone here have an analysis on what's going on?

Edit: I understand that the music is modulating towards the subdominant but that seems counter-intuitive to do towards the very end of a piece. Bach left nothing to chance, and I'm looking for a way to motivate this choice from a theoretical point of view.

  • The C, D and Eb are the last chords. Are you saying the pieces are in D E and F? – Tim Apr 14 '20 at 8:24
  • 4
    @Tim - No, I believe the OP is referring to the flattened 7th degree in each of the excerpts. The pieces are indeed in C, D, and E Flat major - the OP is referring to the excerpts' B flat, C natural, and D natural, respectively. – Dekkadeci Apr 14 '20 at 8:43
  • 3
    Surely it's just the b7 making the tonic move towards the subdominant briefly? – Tim Apr 14 '20 at 8:50
  • 1
    @Dekkadeci - you did mean Bb, C and Db respectively? – Tim Apr 14 '20 at 8:51
  • 1
    @Tim - Sorry, I did mean D flat. – Dekkadeci Apr 14 '20 at 8:53

11 Answers 11


Well spotted! This is very common. Bach often uses a brief modulation to the subdominant key near the end of his fugues, preludes and inventions (presumably other pieces, too). Sometimes this is so brief, that we feel like we are just travelling through this key, without really modulating to it. Sometimes this is over a final tonic pedal, which is really “bringing the harmony home”, although not in your examples.

The reason he does this, is related to how much of Western common practice music is harmonically structured. Although we may modulate to a wide range of related keys, by far the most commonly used structural modulations are basically an arch: Tonic -> Dominant -> Tonic (again). If we imagine this as a “swing” one place to the sharp side around the circle of fifths and then back again, the move to the subdominant helps to “balance” this, by swinging “a bit too far” to the flat side, as we return to the tonic, with the final settling on the tonic feeling even more like a resolution as a result.

Another way to think about the same structural harmonic movement, is considering the brightness of related keys. As we move to sharper keys around the circle of fifths they sound comparatively brighter; as we move to flatter keys they sounds comparatively darker. [Thanks to Tim for commenting on this, hence the edit for clarity...] We start at the tonic, our home key, move to a brighter key, the dominant, and then back to our home key. To emphasise this movement back from a brighter key to our home key, we go "a bit darker" than our home key before finally settling there.

We could come up with numerous analogies for this kind of movement: tuning a sharp guitar string down below the note we want, before coming back up to pitch; taking a clipping recorded volume down below the volume we want before gradually raising it to the optimum position etc.

  • 1
    I'm quite sceptical on this 'sharper keys = brighter, flatter keys = darker' idea. Go a step further. In key F# (say). and moving to C#. Brighter? What about moving to Db instead? really darker? Never subscribed to any of this! Devil's advocate! Convince me! – Tim Apr 14 '20 at 10:34
  • All major keys are the same set of semitones apart, there should be no real change in sounds between the keys, there is just a lot of practical considerations in regards to keys choice. – Neil Meyer Apr 14 '20 at 11:27
  • 14
    Tim, I agree that no keys are inherently brighter or darker than any others, what I'm talking about here is the relationships between keys. The dominant is brighter than the tonic key; the subdominant is darker. It's the same relationship you get between modes one step away around the circle of fifths: the Lydian is brighter than the Ionian; the Mixolydian is darker - this is a modal way of thinking about the same Tonic/Dominant/Subdominant relationship (or thinking about the relationship between these keys over an unchanging root note...) – Bob Broadley Apr 14 '20 at 12:33
  • 3
    @Tim Part of that is that you're hearing modern instruments with equal temperament, where the difference in pitch from one note to the next is basically constant. It is not mathematically possible for an instrument to be perfectly tuned in all keys, so we split the difference to get as close as possible. Instruments in Bach's day would be in meantone temperament, where the further you get from C, the more out of tune it sounds. There's debate over exactly what Bach intended by "Well-Tempered", but it is most likely not the same as modern Equal Temperament. – Darrel Hoffman Apr 14 '20 at 16:54

In addition to what's been mentioned above, the motion to the subdominant also has a plagal sound. What's more final than a big "aaaa-men" plagal cadence at the end of a hymn? Sometimes Bach's flat-7s come after the authentic cadence. Sometimes before.

The use of the flat-7 was much more widespread in Renaissance polyphony and early baroque music. It was the natural function of some major modes to lower the 7th during motion downward in the scale. Baroque composers from the early 17th century would continue to pare down use of the flat-7 as music became less melodically- and more harmonically-driven. By Bach's time, you see he saves it for a special moment near the final cadence. (This is not to answer your question of WHY, but just to add some history.)

  • 1
    Thank you for your answer, I really appreciate it. Before the bars referenced in these screenshots there are indeed some hints of an authentic candence. So authentic candence following a plagal cadence, and then an authentic candence again to mark a super-final ending. – Karamell Apr 15 '20 at 7:00

It's the same cliche as the 'Saints Go Marching In' ending. Not sure if Bach ever went the whole hog with a iv as well as the I7 though! And he generally did it over a tonic pedal, the modern(ish) version walks the bass line down. Same idea though. Decoration. No functional analysis required.

C, C7, F, Fm, C, G7. C.

  • Interesting idea, but in this case F minor plays a really important role in this cliche ending and Bach omits it. It seems a little bit far fetched – Karamell Apr 14 '20 at 12:56
  • 1
    Well, everything must develop a BIT over a couple of hundred years! They're certainly similar in just being decoration, no functional analysis required. – Laurence Payne Apr 14 '20 at 13:08
  • I don't think the comparison is that clear. With "Saints Go Marching In", a big part of what makes that progression work is the chromatic decent. On the other hand, you can view the progression Bach uses in functional terms as I IV V I, with V/IV inserted before IV to strengthen the forward motion of the cadence. In other words the b7 makes the mode mixing sound better in the former case by providing a stepwise line, while it resolves functionally in the latter case. – bjb568 Apr 16 '20 at 9:08
  • As I've argued elsewhere, the is best understood as a simplification of ⅶ⁰, and Bach definitely used that a lot in this context. Example, Cello suite 3 Prelude ends with C - C₇ - F/C - B⁰/C - {Gsus⁴-G-ish suspension, but sans G} - C. The B⁰/C could be interpreted as Fm₆j⁷/C. – leftaroundabout Apr 16 '20 at 15:50

Actually, I would not even call it a modulation (e.g., into a subdominant in the first example--the one I consider here) because for a progressiin to be called a modulation it needs to follow the cadential formula T-S-(D 6/4)- D-T in the new tonality. What we see though is a progression that stays in the original tonality, except for the non-harmonic tone B flat. I think that the explanation for the use of this tone lies in modal scales, which Bach has used all the time. In the mixolydian C scale, the seventh degree is B flat, and this is the only tone that makes it different from the C major scale, and so on its approaching to the final cadence, Bach uses the progressions in the mixolydian scale (T I 7 -- S IV--SII--DIII), and then employs T-S-T in C major 6 chords before concluding with the conventional T-S-DT6/4-D7-T.

This is, in my opinion "what" Bach is doing. As to the "why," I think the only answer is: It spunds beautiful. In the beginning of the 20th century many composers turned to using modal harmonies in addition to the tonal ones.


I think this is closely related to a widespread device known as "backdoor" cadence: Bb7 resolving to C rather than the obiquitous G7 resolving to C.

This could be preceded by a F chord, perhaps. Which would be a subdominant.

Or maybe it would be a previous tonal centre from which you return. In which case, the Bb7 works much like the Fm in When the Saints Go Marching In as described in a post above.


It's not really ending with a flat seventh. I briefly tonicizes the subdominant, but ends most emphatically with a perfect cadence.

Moving to the dominant (adding sharps) has an effect of intensifying.

Moving to the subdominant (adding flats) has an effect of relaxing.

Of course the dominant and subdominant are the two tonal pillars on either side of the tonic so including both provides a kind of symmetry and tonal compliment to the main tonic. The question of order then is a matter of form and general sense of dramatic arch.

From a structural point of view the intensifying move to the dominant would logically come first to build toward a climax and the move to the subdominant would follow after the climax as a denouement before the final ending.

It's interesting to note the difference or ordering depending on the scale (scale in the sense of duration.) On the phrase level you see the subdominant center followed by the dominant in the QUISCENZA harmonic schema (exs. Bach's B flat invention and various Mozart sonatas) but on the compositional level (the whole composition) it's the opposite order.


The C major example looks like it could be a modulation to the sub dominant (F Major), that would explain the Bb flat. The D major example, again looks like a modulation to the sub dominant G major, which is the only key that has a F# and a C natural. The last example looks like a quick modulation to Ab major for half a bar, that explains the D flat.

He ends with the key the piece was written in, it just modulates often and sometimes just for a measure. Modulations or the movement between keys is how you give movement to music. It is also how you make music interesting. Classical music rarely stays static in regards to keys.

  • Thank you for the answer Neil. However, that's only half an answer since it doesn't explain how that makes a more powerful ending. Bob's answer is so far a more complete hypothesis – Karamell Apr 14 '20 at 11:14

It's not a modulation. It's only a secondary dominant for IV. An addition for an authentic cadence


This is nothing else than an extended perfect athentic cadence (the b7 appears as the Ib7 is used as V7/IV)

I - IV - I46 - V7 - I


In the C major and Eb major examples, this accidental also sets up an effective ii-V-I progression, to provide a stronger cadence at the end of the piece. The I7 chord would resolve authentically to IV, but these examples can be analyzed as that chord instead resolving deceptively to ii, and then moving around the circle of fifths back to I. By stringing together cadences like this, the piece has a stonier ending.


I honestly can’t believe the length and Amount of philosophical persiflage of these answers. They’re just plain common, garden-variety secondary dominants to add interest to the harmony, which may be one reason most people who play such music play Bach and not Georg Böhm or Johann Adam Rein[e]ken. Also, the remark about dark flat keys and bright sharp keys, while having some truth, is deeply dependent, more so than personal emotional perceptions, on what tuning is being employed. Bach alone, that is, as opposed to the tunings used in places where Bach did not work, used three different tuningS in his lifetime. They were called the Chor-Ton, the Kammer-ton, and the Tief Kammer-Ton. These were not necessarily his choice. They varied as much as a major third, one from the other, not to mention how the split-key tunings were handled. So! Easy on the deep-significance philosophisizig and a little more of old-fashioned musicology better answers the question. By the way, this is the first time I have heard of widespread bVII in renaissance music. There ‘s not one renaissance theorist who speak of chords, certainly not in a function way. Johann s Tinctoris would have seen what we call a simple c-major triad as three chords, one built on c, one on e, and one on g. As some of you clearly would know, it was Jean Philippe Rameau in 1722 who first explained that these three sounds were actually one chord, or, put another way, he was the first to formulate the invertibility of chords. Peace L

  • Could you clarify your answer a little bit, with respect to how to speak about chords. You're talking about a secondary dominant, but you also say we can't talk about chords in a functional way. Isn't this a contradiction? How can you even have any kind of cadence without functional harmony? – Karamell Apr 15 '20 at 20:50
  • 1
    By the way, this is the first time I have heard of widespread bVII in renaissance music. Not sure what you mean by this. Bach isn't a renaissance composer. They varied as much as a major third, one from the other, not to mention how the split-key tunings were handled. This is also unclear to me. Are you talking about different ways of tuning the same keyboard instrument, like just tuning versus equal temperament, etc.? Clearly those can't differ by more than a fraction of a semitone. – Ben Crowell Apr 16 '20 at 0:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.