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; a countersubject may accompany those entries. Episodes: passages often use sequences or subject-related ideas to travel between keys, but their material can vary. Development: middle entries restate the subject in related keys; stretto and pedal points raise the temperature toward the close.

These labels describe common procedures rather than universal requirements; see Open Music Theory's exposition overview and Puget Sound's fugue analysis guide.

Subject and answer ​

When the second voice enters, it usually carries the subject toward the dominant — the answer. A literal transposition is a real answer; the exact interval can be a fifth up or a fourth down, depending on the entering voice. A tonal answer makes small intervallic adjustments where a literal transposition would destabilize the tonal center. The adjustments depend on the subject and its context; they are not limited to an I↔V head followed by an untouched tail.

Fugal deviceSubject and tonal answervoices play in turn
A real answer transposes the whole subject up a fifth. A tonal answer makes small intervallic adjustments where a literal transposition would destabilize the tonic; this teaching cell models that as I↔V mapping at the head. Real fugues can modify more than a simple head/tail split, while the validator checks the declared head mapping.
tonal_answer_dominant_mappingThe subject opens on the tonic; this teaching cell models a tonal answer whose head maps I to V.

tonal_answer_dominant_mapping is a narrower engine contract. When material declares a tonal answer, it checks the subject's opening pitch class for the I↔V mapping; subjects that open on neither tonic nor dominant pass that particular check without requiring a mapping. The contract does not claim that every historical tonal answer uses only this head 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.

A contrasting real answer appears in Bach’s G-minor “Little” Fugue (BWV 578): the displayed alto entry is a literal transposition of the quoted soprano opening, a perfect fourth below. It needs no tonal head correction:

From BachBach: "Little" Fugue in G minor (BWV 578) — a real answervoices play in turn
In the "Little" Fugue in G minor (BWV 578), the upper staff quotes the soprano in mm. 1–2 and the lower staff quotes the alto in mm. 6–7. The 11 displayed pitches and their durations match after a transposition of −5 semitones, a perfect fourth down. The full subject continues beyond these two bars; this comparison covers its opening only. The staves are aligned for comparison and play sequentially, so they are not simultaneous voices.
The displayed opening of the subject returns five semitones lower in the alto entry.

The countersubject ​

Fugal deviceDeclared countersubject keeps sounding
A countersubject is a recurring companion in some fugues, not a requirement of every fugue. When material declares one, this engine contract samples every quarter-beat of the answer window and fails if the countersubject voice falls silent.
countersubject_continuousWhen a countersubject is declared, it fills every beat of the answer window without resting.

A countersubject is a recurring companion in some fugues, but it is not a required part of every fugue. When material declares one, 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, invertible_at_octave also checks it at structural accents; fourths are judged against the actual bass by vertical_dissonance.

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. Historical episodes often develop fragments of the subject or countersubject, and sequences are common, but they can also use free counterpoint or another salient idea. In this engine, only material explicitly declared as a motif transform must be derived from a source slice — restatement re-anchors the slice 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). A declared sequence uses the same seed on successively higher or lower steps.

EpisodeDescending sequence
Sequences are common ways for Baroque episodes to travel between keys, but episodes can also develop other ideas and need not be exact transpositions. This cell shows the stricter engine contract: each declared step must be a verbatim transposition of the seed by the declared offset.
sequence_pattern_consistencyepisode_motif_derivedThis engine cell 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
When material declares a subject slice and a transform, inversion is a clear example: an upward step becomes a downward step, and an upward third becomes a downward third. Historical episodes can use other ideas; this cell isolates the declared engine transform, which is checked by 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_derivedFor a declared episode fragment, every note matches the expected output of the declared motif operation applied to the declared source slice — pitch, duration, and tick.
sequence_pattern_consistencyFor a declared sequence, each step is a verbatim transposition of the seed by the declared offset. Paraphrases fail this engine contract.

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. In major mode, the allowed stations are the dominant (V), relative (vi), subdominant (IV), and supertonic (ii); in minor mode, they are the minor dominant (v), relative major (III), and minor subdominant (iv). middle_entry_in_related_key restricts the declared entry key to the mode-specific family and checks every entry pitch against the corresponding collection.

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?

Minor mode uses the related-key set {v, III, iv}. The validator checks every entry pitch against the home minor collection: pitch-class offsets {0, 2, 3, 5, 7, 8, 10, 11} from the tonic, which includes the natural-minor flat seventh and the raised leading tone.

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 ​

RuleOutcomeCheck
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.
countersubject_invertibleInformationalA strong-beat perfect fifth between a marked countersubject and an overlapping subject or answer would become a fourth under octave inversion. This observation is informational and never blocks generation.
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.
imitation_entry_realizationMusicalFailDuring Generation, emitted Material notes must match the declared leader/follower windows in pitch, onset, duration, voice, and intent; both entry heads need the realization marker.
middle_entry_in_related_keyMusicalFailIn major mode, entry key ∈ {V, vi, IV, ii}; notes are diatonic in the related station's major scale, except vi uses the home major collection. In minor mode, entry key ∈ {v, III, iv}; notes use home-minor pitch-class offsets {0, 2, 3, 5, 7, 8, 10, 11}.
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.