VOLTAreference

Reference / Patterns and harmony

Theory tools and composition workflow

Patterns and harmony

Open in the workbench →
On this page · 4 sections

Volta provides the musical operations; Studio makes them available from pattern cells. Native and browser Studio use the same Rust implementation. Musical search runs in a background worker and discards superseded results.

Start in Studio#

Open Counterpoint on a pattern cell (the Bay's Counterpoint tool; in the notebook, Counterpoint board in a ruled cell's menu or its board ▸ chip). Melody and Harmony add editable rules while keeping the pattern. To work against another line, enter its binding name and choose Species 1–5. The rule text remains ordinary source.

Voice lead chords arranges a progression into the selected number of parts. Add counterpoint parts solves additional voices around the written line. Both insert the corresponding DSL operation. Edit its options in the source; the part labels show each tagged voice's note count and MIDI range.

Hover a rule for its meaning. Failed rules show their witnesses directly. Clicking a rule temporarily excludes it from search; this does not remove the written rule. Click the pitch board to lock a note, or use clear locks.

For a written single-note literal, Find local repairs offers alternatives that change one or two pitch atoms (the button reads Stop repair while it runs). Weighted rhythm, rests, velocity, slide markers and the remaining source spelling stay intact. Repeated occurrences of one source atom change together. Locks use the actual written onset grid. Audition written line and each candidate's audition control provide before/ after comparison; Audition with reference voice includes the reference. The preview retains each note's duration. A candidate's pin chip commits an alternative through the same compile-checked, single-Undo source transaction as other workbench edits. Preview and lock operations do not edit source.

Configurable voice leading#

key = "c major"
settings = {
  voices = 4,
  ranges = [[40,60],[48,69],[55,76],[60,84]],
  spacing = 12,
  rootBias = 6,
  motion = [0.35,1,1,1],
  parallels = "avoid",
  doubling = "complete",
  maxLeap = 12,
  locks = [[0,3,72]]
}
parts = voiceLines settings !"I IV V I"

The manual voiceLines [a,b] and numeric voiceLines 4 progression forms retain their behavior. Options may be literal, named, imported or computed with a record update. Ranges and motion weights run from lowest voice upward.

OptionMeaning
voices1–8; record default 4
rangesOne inclusive MIDI [low,high] pair per voice; default follows the first chord's register
spacingMaximum adjacent upper-voice gap, excluding bass; default 12 semitones
rootBiasNon-root bass penalty; default 6
motionNonnegative movement weights per voice; default bass 0.35, other voices 1
parallelsavoid tries strict then a penalty pass; forbid never relaxes; allow explicitly permits parallel motion
doublingcomplete covers as many distinct members as voices permit and includes the root; distinct forbids pitch-class doubling; free permits omissions and doubling
maxLeapOptional hard maximum adjacent-chord motion per voice, 0–127 semitones
locksZero-based [chordIndex,voiceIndex,MIDI] triples; conflicting locks fail

Import choraleVoicing or openVoicing from harmony for inspectable starting values. A revoiced chord uses its longest written member duration, as the existing numeric solver does. Its source member's articulation and adaptive tuning identity follow that member into its new octave.

Transform existing patterns and chord values#

melody = !"c#4 f#4 a#4"
fitted = fitScale (tonality "c major") melody
thirds = transposeDiatonic 2 (tonality "c major") fitted
inverted = invertVoicing -1 !"c4:maj7"
spread = dropVoicing [2,4] !"c4:maj7"
answer = imitate 0.25 7 fitted

fitScale chooses the nearest scale note, choosing downward on equal distance. transposeDiatonic fits first, then moves by signed scale steps. These operate on resolved pitches, so reusable patterns work. inScale retains its separate literal/degree-resolution contract. Pitch-class changes clear obsolete chord tuning metadata; octave-only voicing transforms retain it. All preserve timing, articulation and voice identity. Output must remain in MIDI 0–127.

invertVoicing rotates the lowest note upward for positive steps and the highest downward for negative steps. dropVoicing positions count from the top, starting at 1; [2,4] lowers those members one octave. An absent position fails.

The existing harmony library's Chord, Quality and Interval values remain ordinary typed data. parallel, relative and leadingTone implement triadic P/R/L transformations; other qualities pass through. invert accepts signed inversions. canon delay semitones pattern stacks a subject and its exact imitate answer with separate voice tags. Delay is a fraction of the pattern period and wraps cyclically. imitates delay semitones reference checks the answer's pitches, attacks and durations.

Rhythm and multiple voices#

Relational checks now use actual sounding durations and changes in either voice, including releases. A rest does not hold the previous pitch. A note crosses the cycle boundary only if its written duration does. Melodic sequence predicates inspect successive written attacks, without a last-to-first melodic edge; this is separate from the cyclic sounding-interval check. Relational checks compare normalized pattern phases: use matching pattern periods when you need this to represent physical-time alignment. Independent polymetric periods are not expanded to a joint timeline by these predicates.

suspensions reference requires syncopation. Dissonance must be prepared as a consonance, held as the reference changes, and resolved down by one or two semitones into a consonance, without a gap. floridWith reference also permits weak passing/neighbor tones and requires mixed durations. species 4 reference and species 5 reference combine these with the melodic/relational rules and a tonic ending. Their melodic frame omits the single-peak requirement. This is Volta's explicit rule set, informed by Open Music Theory's suspension model. Decorated suspensions and every historical species convention are not modeled.

The rhythm search chooses among explicit weighted-note templates on a regular 3–16-note reference. Fourth species uses sustained syncopations; fifth species subdivides a sustained value. Candidate pins are checked through the same forward rules. Irregular written rhythms can be checked even when this bounded generator cannot generate them.

counterLines { voices = 3, fixedVoice = 0 } reference jointly solves all parts over a non-overlapping reference of up to 128 notes, preserving its rhythm and fixing it at the chosen voice index. Additional notes use the current key; every sounding pair is consonant. The same ranges, spacing, weights and locks apply. Its defaults are parallels = "forbid", maxLeap = 7, doubling = "free", rootBias = 0. More existing parts can be fixed using per-note locks. This solves parts on a common rhythm; arbitrary mutually recursive ?holes with independent rhythms are not a joint-solve interface.

Search is bounded. Voicing domains retain at most 20,000 placements, then 1,500 per chord for the movement walk. Rhythmic search has at most 200,000 pitch trials. Local repair searches within an octave of each original atom, at most 50,000 trials, and returns up to five alternatives. An exhausted search is not proof that no musical solution exists.