Skip to content

6. Fugal Devices

A fugue is not a form like a sonata — it is a procedure: one theme (the subject) enters voice by voice, travels through related keys, and returns intensified. Every device in that procedure is a contract between declared material and emitted notes, and the validator checks each one. These rules sit above the local interval rules from chapters 2–3, which keep applying throughout.

The fugue procedure at a glance

Exposition: each voice enters in turn with the subject or its answer, accompanied by the countersubject. Episodes: sequential passages derived from subject motifs travel between keys. Development: middle entries restate the subject in related keys; stretto and pedal points raise the temperature toward the close.

Subject and answer

When the second voice enters, it carries the subject transposed to the dominant — the answer. A literal transposition is a real answer. But if the subject opens by outlining tonic→dominant, literal transposition would immediately yank the music out of the home key. The fix, used constantly by Bach, is the tonal answer: adjust the head so tonic maps to dominant and dominant maps back to tonic, then transpose the tail normally.

Fugal deviceSubject and tonal answervoices play in turn
A real answer transposes the whole subject up a fifth. A tonal answer adjusts the opening so that tonic maps to dominant and dominant maps back to tonic, keeping the music anchored in the home key during the exposition. The validator checks exactly this head mapping when the material declares a tonal answer.
tonal_answer_dominant_mappingThe subject opens on the tonic; the answer opens on the dominant — the head is mapped I to V, not transposed literally.

tonal_answer_dominant_mapping checks exactly this head mapping when the material declares a tonal answer: the subject's opening pitch class must map I↔V. Subjects that open on neither tonic nor dominant pass vacuously — they need no adjustment.

Here is the textbook case in Bach's own hand — the opening of the C minor fugue from WTC I. Play the two lines in turn and listen for the single bent note:

From BachBach: WTC I Fugue in C minor — the tonal answervoices play in turn
The most quoted tonal answer in the repertoire — the opening of the C minor fugue (WTC I, BWV 847). The subject begins C–B♮–C and drops to G: tonic to dominant. Answered literally a fifth higher, that fourth note would be D and the exposition would lurch out of the home key. Bach answers G–F♯–G and bends the one note back to C — tonic maps to dominant, dominant maps back to tonic, the tail transposes exactly. This is precisely the head mapping tonal_answer_dominant_mapping verifies.
tonal_answer_dominant_mappingThe subject's fourth note falls to the dominant (G); the answer bends that one note back to the tonic (C) and transposes everything else literally.

The countersubject

Fugal deviceCountersubject keeps sounding
The countersubject is the recurring companion line that accompanies each later entry of the subject. To do its job it must actually be there: the validator samples every quarter-beat of the answer window and fails the rule if the countersubject voice falls silent.
countersubject_continuousWhile the answer states the theme, the countersubject fills every beat without resting.

A countersubject is only useful if it actually accompanies. countersubject_continuous samples every quarter-beat of the answer's window and requires a sounding note from the countersubject voice at each one. (Since the pair is designed to be reused with voices swapped, the invertible-counterpoint rules from chapter 2 — invertible_at_octave, fourth_only_on_weak_beat — police the same passage.)

In the same C minor fugue, the countersubject enters the moment the answer does — and never stops sounding under it:

From BachBach: BWV 847 — the countersubject at work
Bars 3–4 of the C minor fugue: the answer above, the countersubject below — a falling sixteenth scale, a register leap, then climbing eighths. Notice what it never does: rest. Every quarter-beat of the answer's window has the countersubject sounding, which is literally the check countersubject_continuous performs. The pair is built to be reused with the voices exchanged; chapter 2's invertible-counterpoint rules police that property, and bars 7–8 of the same fugue cash it in.
countersubject_continuousWhile the soprano sings the answer, the alto's countersubject fills every quarter-beat of the window without a single rest.

Episodes and sequences

Episodes are where fugues travel. Their material is not free improvisation: it must be derived from a declared slice of the subject by a declared transform — restatement re-anchors the slice verbatim at its new position, inversion mirrors the contour upside down, retrograde plays it backwards, and augmentation/diminution stretch or compress every duration (not to be confused with augmented intervals from chapter 4). It usually moves as a sequence — the same seed restated on successively higher or lower steps.

EpisodeDescending sequence
Sequences are how Baroque episodes travel between keys: a short seed is restated on successively lower (or higher) steps. The validator checks that each step is a verbatim transposition of the seed by the declared offset — paraphrases fail the rule.
sequence_pattern_consistencyepisode_motif_derivedBar two repeats bar one exactly, transposed down one step.

The declared transform can also flip the seed upside down — play these in sequence and hear the mirror:

EpisodeMotif inversion: the seed upside downvoices play in turn
Episode material must be the declared transform of a declared subject slice — and inversion is the most striking transform: up a step becomes down a step, up a third becomes down a third. Play the two lines one after the other; the second is recognizably the first, upside down. The validator recomputes the expected notes from the transform and compares pitch, duration, and tick.
episode_motif_derivedThe derived line mirrors every step of the seed in the opposite direction.

Bach builds whole stretches of fugue from exactly this transform. In the D♯ minor fugue the subject and its mirror are full partners — the inverted form quoted below even arrives in stretto with another inverted entry:

From BachBach: WTC I Fugue in D♯ minor — the subject upside downvoices play in turn
The subject of the D♯ minor fugue climbs a fifth from tonic to dominant and circles back down. From the fugue's second half Bach turns the whole line upside down: the inverted form quoted here (bar 45) falls a fifth from dominant to tonic and circles back up — and it enters one bar after another inverted entry in the bass, an inversion stretto. Play the two staves in sequence: the rhythm is identical, the contour an exact mirror within the scale. This is the same transform the engine's episode rule verifies, recomputing every expected note. Quoted in E♭ minor spelling for readability; the companion voices around each entry are omitted, and the final note of each quote is trimmed to close the two-bar frame.
episode_motif_derivedSame rhythm, note for note — but every rise answers with a fall of the same scale size.

The C minor fugue puts both contracts on display the moment its exposition pauses. Bars 5–6 — between the answer and the bass entry — sequence the subject's own head figure upward, one step per half bar:

From BachBach: BWV 847 — the first episode climbs by step
Bars 5–6 of the C minor fugue — the bridge between the answer (bars 3–4) and the bass entry (bars 7–8). The episode's material is not new: the soprano's sixteenth cell E♭–D–E♭ is the subject's opening neighbour figure, restated exactly one step higher each half bar — E♭, then F, then G — while the alto answers with rising sixteenth runs in its own sequence. Derived material, exact steps: the two contracts episode_motif_derived and sequence_pattern_consistency check. The soprano's last F is tied on into bar 7, where the bass entry — the passage chapter 2 quotes for invertible counterpoint — takes over.
episode_motif_derivedsequence_pattern_consistencyThe subject's head cell is restated one diatonic step higher each half bar while the alto runs counter-scales.
RuleContract
episode_motif_derivedEvery note emitted for an episode fragment matches the expected output of the declared motif operation applied to the declared source slice — pitch, duration, and tick.
sequence_pattern_consistencyEach step of a sequence is a verbatim transposition of the seed by the declared offset. Paraphrases fail.

Imitation

ImitationImitative entry at the fourth below
Imitation declares a contract: the follower must enter exactly at the declared time distance and exactly at the declared interval. The validator verifies both the entry tick and the pitch offset against the leader fragment.
imitation_entry_matchThe follower restates the leader's figure one bar later, a fourth lower.

Imitation generalizes the subject/answer idea to any material: a follower restates the leader's fragment at a declared time distance and interval. imitation_entry_match verifies both numbers — enter at leader.tick + distance, pitched at leader.pitch + interval.

Bach wrote a whole laboratory for this contract: the Goldberg canons. In the last of them, both declared numbers are audible — one bar, one ninth:

From BachBach: Goldberg Variations — canon at the ninth
Variation 27 (BWV 988), the last canon of the set and the only one without a free bass: two voices, nothing else. Whatever the leader plays, the follower replays one bar later, a major ninth (14 semitones) higher — so exactly that even the C♯ survives the trip. This is the contract imitation_entry_match verifies, with both numbers explicit: enter at leader.tick + distance, sound at leader.pitch + interval. While the follower repeats the opening, the leader has already moved on to sparse interjections — the texture that keeps a strict canon breathing.
imitation_entry_matchThe follower restates the leader exactly one bar later and exactly a ninth higher — semitone for semitone.

Development devices

Middle entries

After the exposition, the subject returns in related keys — the dominant (V), the relative (vi), the subdominant (IV), the supertonic (ii). middle_entry_in_related_key restricts the declared entry key to that family and requires every note of the entry to stay diatonic in it.

What makes a key "related"?

Two keys are related when their scales share most of their notes, so the ear can slide between them without a jolt. The dominant and subdominant keys differ from home by a single accidental; the relative key (vi of a major key — A minor for C major) uses the same notes with a different center.

What about minor keys?

The related-key set is defined as fixed distances from the home tonic — V, vi, IV, ii — whatever the home mode, and the diatonic check reads the entry against the major scale on the declared key. A minor-mode fugue therefore states its middle entries in related major keys (the engine restates the subject in its major-mode shape for the entry). The destinations classical minor-key practice favors most — the relative major (III: E♭ for C minor, where Bach takes the C minor fugue's first middle entry) and the minor dominant (v) — sit outside the current set.

DevelopmentMiddle entry in the relative keyvoices play in turn
After the exposition the subject travels: here the C major subject returns in A minor, the relative key. The validator restricts the declared entry key to the related family — dominant, relative, subdominant, supertonic — and then checks that every note of the entry is diatonic in that key. Play them in sequence: the same theme, a new emotional light.
middle_entry_in_related_keyThe subject returns transposed into vi — every note diatonic in the related key.

Stretto

DevelopmentStretto: entries overlap
In a stretto the subject chases itself: the second entry begins inside the first one's window. It is the classic intensification device near a fugue's climax. The validator requires a genuine overlap and an exact transposition of the subject.
stretto_overlap_validThe follower starts the subject before the leader has finished it.

No fugue demonstrates the device like the C major fugue that opens WTC I — Bach builds nearly the whole piece from strettos. By bar 7 the subject is already chasing itself at one beat's distance:

From BachBach: WTC I Fugue in C major — stretto at one beat
Bars 7–8 of the C major fugue (WTC I, BWV 846), the fugue famous for being built almost entirely of stretto. The soprano begins the subject; one beat later the alto begins it too, a fourth below, and both statements run complete. A genuine overlap and an exact transposition — the two things stretto_overlap_valid demands. (The bass voice of these bars is omitted for clarity.)
stretto_overlap_validThe alto starts the subject one beat after the soprano, a fourth below — the leader is only four notes in.

Pedal point

DevelopmentTonic pedal point
A pedal point suspends the harmonic clock: the held bass legitimizes passing clashes above it. The validator does not police those clashes — it checks that the pedal pitch itself is the tonic or the dominant, the only degrees that can bear this weight.
pedal_point_tonic_or_dominantThe bass holds the tonic while the upper voice moves through dissonances above it.

The pedal point usually arrives near the end — a dominant pedal building tension before the final cadence, or a tonic pedal confirming arrival. Notice the rule's direction: it does not police the dissonances above the pedal (those are licensed by the device), it polices the pedal pitch itself.

The first prelude of WTC I shows the device at its barest. Before the ending, Bach spends eight bars hammering nothing but the dominant in the bass — here are two of them:

From BachBach: WTC I Prelude in C major — the bass refuses to move
Bars 24–25 of the C major prelude — the same ripple the primer's figure showed at bar 1, but now listen to the bottom. The harmony alternates above (a dominant seventh, then the tonic chord in 6/4 position) while the bass strikes G, and only G, again and again: a dominant pedal. It lasts eight bars in the piece, winding the spring that the ending releases — and when release comes, Bach does it again, riding a tonic pedal C from bar 32 to the final chord. Its companion fugue closes the same way, with the last bar's voices running above a held C. Dominant and tonic: the only two degrees the validator lets carry this weight.
pedal_point_tonic_or_dominantFour strikes of the same G under two alternating harmonies — a dominant pedal stretching the tension.

How the validator sees this chapter

RuleFailKindCheck
tonal_answer_dominant_mappingMusicalFailTonal answer's head maps the subject's opening pitch class I↔V.
countersubject_continuousMusicalFailThe countersubject voice sounds at every quarter-beat of the answer window.
episode_motif_derivedMusicalFailEpisode notes equal the declared motif transform of the declared source slice.
sequence_pattern_consistencyMusicalFailEach sequence step is an exact transposition of the seed by the declared offset.
imitation_entry_matchMusicalFailFollower enters at the declared tick distance and interval from the leader.
middle_entry_in_related_keyMusicalFailEntry key ∈ {V, vi, IV, ii} of the home tonic; entry notes diatonic in that key's major scale, whatever the home mode.
stretto_overlap_validMusicalFailFollower starts strictly inside the leader's subject window and is an exact transposition.
pedal_point_tonic_or_dominantMusicalFailEvery pedal pitch class is the home tonic or dominant.

Continue with Chapter 7 — Form-Specific Constraints.

Dual-licensed: AGPL-3.0 · commercial licensing available. Generated MIDI is yours to use freely.