Skip to content

2. Motion & Forbidden Parallels

Chapter 1 classified single sonorities. This chapter adds time: how two voices move between sonorities. Almost every famous counterpoint prohibition lives here, and they all protect the same asset — the audible independence of the voices.

The four types of relative motion

Between any two consecutive sonorities, a voice pair moves in one of four ways:

MotionDefinitionRisk level
ContraryThe voices move in opposite directions.Safest — independence is audible.
ObliqueOne voice holds while the other moves.Safe — the held voice anchors the pair.
SimilarBoth move the same direction by different amounts.Risky into perfect intervals (hidden parallels).
ParallelBoth move the same direction keeping the interval.Fine for imperfect consonances; forbidden for perfects.
Safe motionContrary and oblique motion
Contrary and oblique motion are the safest ways to approach any interval — even a perfect one. Independence is audible because the voices do different things. Most parallel-rule violations disappear when one voice simply moves the other way.
First the voices move apart in opposite directions, then one holds while the other moves.
Allowed patternParallel sixths are fine
The parallel prohibition applies only to perfect intervals. Chains of parallel thirds, sixths, and tenths are idiomatic Baroque writing — each sonority is rich enough that the voices keep their identity even while moving together.
Both voices move in parallel, but the repeated interval is imperfect.

Bach promoted contrary motion from a recommendation to a structural law — twice. Variations 12 and 15 of the Goldberg Variations are canons by inversion, where the second voice is the first voice upside down:

From BachBach: Goldberg Variations — canons in contrary motion
the same mirror at two intervals —
Variation 12 of the Goldberg Variations (BWV 988) is a canon by inversion: the lower voice repeats the upper voice's line one bar later with every interval flipped — where the leader steps up, the follower steps down, mirror-exact for the whole variation. The result is contrary motion elevated from a recommendation to a structural law: in bar 2 the leader climbs to its peak while the follower descends beneath it, and the two lines could not be more audibly independent. (The bass of the ground, which runs under both voices, is omitted here.)
The follower replays the leader upside down: every step up answered by a step down, one bar later.

Forbidden perfect parallels

Parallel fifths and octaves make two voices sound like a single doubled line — the classic loss of voice independence. Play the two examples below and listen for it: the octave case in particular collapses into one thick voice.

Why exactly fifths and octaves?

Perfect intervals blend so strongly (chapter 1) that when the same perfect interval is repeated by motion in both voices, the ear groups the two lines into one. A single fifth is fine; a fifth moving to another fifth is the violation.

ForbiddenParallel fifths
The red verticals show the repeated perfect fifth. The arrows show that neither voice is stationary, so this is not oblique motion.
parallel_fifthBoth voices move up, and the red vertical interval remains P5 at both arrivals.
ForbiddenParallel octaves
The octave frame is repeated by motion in both voices, collapsing two lines into one doubled contour.
parallel_octaveBoth voices move in the same direction while the interval remains an octave.

Implementation map:

RuleFires when
parallel_fifthTwo voices both move and the previous and current vertical intervals are perfect fifths.
parallel_octaveTwo voices both move and the previous and current intervals are unisons or octaves.
Oblique escapeOblique and static motion are allowed even on repeated perfect intervals — only both voices moving triggers the rule.
Cadence exemptionNotes committed as part of a declared cadence cell are exempt.
Material exemptionThe check skips when both notes are Material (fixed inputs the composer cannot edit). If either voice is Compose, the rule fires.

What is a "cadence cell"?

The engine writes the closing gesture of a phrase as a pre-built unit and stamps its notes CadenceCellCommitted. Local note-pair rules skip those notes; the dedicated cadence_voice_leading rule (chapter 5) judges the cadence as a whole instead. Historical cadence formulas license motions that would trip the local rules — exempting the cell keeps the two layers from fighting.

Hidden (direct) fifths and octaves

A hidden, or direct, perfect interval occurs when voices move in the same direction into a perfect fifth or octave from some other interval. The parallel never literally happens — it is implied by the similar-motion arrival, which makes the hollow interval jump out of the texture.

Hidden means "arrived by similar motion"

In a hidden fifth, the first vertical interval is not a fifth. The problem appears at the arrival: both voices move in the same direction and land on a perfect fifth. That direct arrival can still make the voices fuse.

Forbidden arrivalHidden fifth
The first sonority is imperfect; the second is the red perfect fifth. Similar motion makes the perfect arrival sound exposed.
hidden_parallel_fifthSimilar motion moves from an imperfect interval directly into P5.
Forbidden arrivalHidden octave
Landing on an octave by similar motion makes the empty interval jump out of the texture. The engine checks every voice pair at every onset, with the same exemptions as the hidden fifth: cadence cells and both-material pairs.
hidden_parallel_octaveBoth voices move upward into a perfect octave by similar motion.
RuleScope
hidden_parallel_fifthSimilar motion lands on a perfect fifth from a non-perfect interval. Cadence cells and both-material pairs are exempt.
hidden_parallel_octaveSimilar motion lands on a unison or octave from a non-perfect interval. Same scope and exemptions as the fifth: every voice pair, any beat; cadence cells and both-material pairs are exempt.

Two scoping terms used in this chapter

A strong beat is the first beat of a bar — the engine's model is the binary start_tick % ticks_per_bar == 0 (primer). An upper-voice pair is a pair of adjacent voices that does not include the lowest voice: in a three-voice texture, the top two. The bass is excluded because these checks exist for material that will later be inverted (see below), and the bass line is not part of that swap.

Voice crossing and spacing

Vertical writing must remain readable as separate voices even before any interval question arises. Two layout rules guarantee it:

ForbiddenVoice crossing
Voice order is part of the texture contract. Crossing makes the lines ambiguous.
voice_crossingThe lower voice rises above the upper voice at the red arrival.

Bach himself crosses voices on purpose when a stricter contract demands it. The third Goldberg variation is a canon at the unison — the follower repeats the leader at the very same pitch, so both voices share one register and tangle the moment the second enters. The engine has no page of slurs and stems to keep tangled lines readable, so it simply refuses the trade:

From BachBach: Goldberg Variation 3 — a canon at the unison must cross
Variation 3 of the Goldbergs is a canon at the unison: the follower repeats the leader's line one bar later at the very same pitch. Same pitch means same register — and when the follower enters in bar 2 on the B the leader sang a bar ago, the leader has already stepped down to G, a third below it. The voices are crossed from the follower's first note; half a bar later the leader vaults an octave to G5 and order is restored. Bach accepts the tangle as the price of strict imitation — on a page, slurs and stems keep the lines legible. The engine's generated voices carry no page, so voice_crossing refuses every crossing outright, with no exemptions. The ground bass below the two canonic voices is omitted here.
voice_crossingBoth canonic voices live in the same register: the moment the follower enters, the leader dips beneath it.
SpacingUpper voices too far apart
For three or more voices, upper adjacent pairs stay within an octave. The bottom pair may be wider in four-voice writing.
spacing_adjacent_voices_within_octaveThe adjacent upper voices exceed an octave.

In a real three-voice texture the rule splits cleanly in two — tight above, free below:

SpacingThree-voice spacing: tight on top, free below
This is the rule as it actually applies — to real three-voice texture. Upper adjacent pairs are kept within an octave so the chord sounds connected; the bottom pair is allowed to spread because a wide gap above the bass is exactly how Bach voices keyboard music. The validator checks the spacing at each chord start.
spacing_adjacent_voices_within_octaveThe soprano-alto gap stays within an octave; the alto-bass gap may exceed it.
RuleScope
voice_crossingBy convention, a lower voice index means a higher pitch (voice 0 is the soprano). A negative interval between any pair — every combination is checked, not just neighbors — means the voices have swapped: rejected wherever it occurs.
spacing_adjacent_voices_within_octaveIn textures of three or more voices, adjacent upper pairs must stay within an octave (12 semitones). The bottom pair (tenor–bass) may be wider, matching four-part Bach practice. Checked at chord starts, only where the harmonic plan declares the chord (has_degree).

Invertible counterpoint at the octave

Fugues reuse two-voice combinations with the voices swapped: what was on top moves below. For that to work, every interval must survive being replaced by its octave complement — thirds become sixths, fifths become fourths, octaves become unisons. Toggle the example below: lift the lower line an octave and every third turns into a sixth, both versions equally consonant.

Invertible counterpointLift one line an octave — and it still works
raise line B an octave —
Two short lines written to be invertible. Line A on top holds still in both views; only line B (blue) rises a whole octave when you switch to “inverted,” so the voices trade places and every interval maps to its octave complement — thirds become sixths — yet both versions stay consonant. That benign mapping is what invertible_at_octave relies on; the next example shows where it turns hostile.
invertible_at_octaveToggle the two: line A on top never moves; only line B (blue) rises an octave, and every third becomes a sixth.

Not every interval survives so kindly. The perfect fifth — a stable consonance — inverts to a perfect fourth, which between two voices alone counts as a dissonance:

Invertible counterpointInversion at the octave: 5 becomes 4
Invertible counterpoint means two lines still work after swapping registers. Every interval maps to its complement: 5ths become 4ths, octaves become unisons. That is why the engine bans strong-beat fourths and parallel octaves in upper-voice pairs — after inversion they would become strong-beat fifths and parallel unisons.
invertible_at_octaveThe same two pitch classes form a fifth, then a fourth once the lower note moves up an octave.

Bach cashes in on the benign cases constantly. In the C minor fugue of WTC I, the subject and its countersubject are written so that either can sit on top. Toggle between bar 7 and bar 20 and follow the blue countersubject as it moves from above the subject to below it:

From BachBach: BWV 847 — the same pair, top and bottom
follow the blue countersubject —
The same subject and countersubject from the C minor fugue (WTC I, BWV 847), at two points in the piece. Toggle between them and follow the blue line: at bar 7 the countersubject sits above the subject; at bar 20 the pair is turned over and the same countersubject runs below — the two voices trade octaves note for note. It survives because the lines carry no strong-beat fourths and no octave-parallels — exactly what invertible_at_octave and fourth_only_on_weak_beat protect. (A third voice is dropped at each spot for clarity.)
invertible_at_octavefourth_only_on_weak_beatAt bar 7 the countersubject (blue) sits above the subject; at bar 20 Bach turns the pair over and the same countersubject runs below — every interval still holds.

Two scoped rules keep upper-voice pairs invertible:

Scoped ruleStrong-beat fourth between upper voices
A fourth can pass on a weak beat, but the scoped upper pair cannot use it as a strong-beat pillar.
fourth_only_on_weak_beatThe red fourth is on a strong beat in an upper-voice pair.
RuleWhat it prevents
invertible_at_octaveParallel octaves in an upper-voice pair on strong beats — after inversion they would become parallel unisons, the most extreme fusion possible. Oblique motion and weak beats are exempt.
fourth_only_on_weak_beatA strong-beat perfect fourth in an upper-voice pair — after inversion it becomes a strong-beat fifth. Weak-beat fourths pass as transitional sonorities.

How the validator sees this chapter

RuleFailKindKey exemptions
parallel_fifth, parallel_octaveMusicalFailoblique/static motion, cadence cells, both-material pairs
hidden_parallel_fifthMusicalFailcadence cells, both-material pairs
hidden_parallel_octaveMusicalFailcadence cells, both-material pairs
voice_crossingMusicalFailnone
spacing_adjacent_voices_within_octaveMusicalFailbottom pair may exceed an octave; ≥3 voices only
invertible_at_octaveMusicalFailoblique motion, weak beats, both-material pairs
fourth_only_on_weak_beatMusicalFailweak beats, both-material pairs

Continue with Chapter 3 — Dissonance Treatment.

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