Wrap plain timeline data.
The segments and the span they cover; copied, never retained.
The chord segments, in time order.
Where the last chord stops sounding.
The key held longest across the span, when the analysis found one.
Every key region under the span, in time order.
These are the regions the timeline was built with: the ones Timeline.fromNotes read off the notes, or the single region a key given to Timeline.fromChords describes. A timeline holding chords alone carries none until it is asked to read them — Timeline.modulations is where the chords are searched for the keys they imply.
How sure the analysis is of each segment's chord, in [0, 1] and in segment order, so a reading is paired with the segment it describes by position.
A confidence answers the question a chord symbol cannot: whether the notes really spell that chord, or whether a passing figure was the best of a bad set of candidates. Empty on a timeline whose chords were placed rather than inferred — Timeline.fromChords and Timeline.fromProgression are given the harmony, so there is no reading to report.
How many segments the timeline holds.
A copy of the underlying plain data.
The { at, segments } shape the analysis functions take.
StaticfromBuild a timeline from placed chords.
The chords with their onsets, in any order.
Where the last chord stops sounding.
Optionalkey: KeyLike
The key the chords are read in, when it is already known. It becomes the one key region under the whole span; without it the timeline carries no key, and the members that need one say so.
The timeline.
StaticfromInfer a timeline from sounding notes.
The note events to read.
Optionalopts: ChordTimelineOptions
The options chordTimelineFromNotes accepts.
The inferred timeline, carrying the key regions the analysis found.
StaticfromPlace a progression's chords on a regular grid.
The chords cross over as harmony alone: a spelling one of them carried is
dropped, since a chord placed on the grid is a ChordSpan and a span
carries none. A carried key becomes the one key region under the span,
spelled tonic and scale form included — an Ab minor comes back Ab minor,
which is what the numerals over the region are read from.
The chords, in order.
How long each chord sounds.
The timeline.
StaticfromRebuild a timeline from the plain data Timeline.data hands out.
StaticfromThe chord sounding at a beat, or null where nothing is.
A segment covers [startBeat, endBeat), so the beat a chord gives way on
answers with the chord arriving rather than the one leaving. The chord
carries the key in force at that beat when the timeline knows one, so it
can name its own numeral and function.
The beat to read.
The chord, or null outside every segment.
Iterate the segments in time order, so a timeline works with for...of.
Drop the time axis, keeping the chord order.
Explicit rather than implicit, because the onsets are information and losing them silently is how a chord rhythm disappears from a pipeline. A rest between two segments goes with them: the chords either side become neighbours in the progression.
The chords in order, carrying the prevailing key when there is one.
The structural chords behind the surface harmony.
Optionalopts: ReduceProgressionOptions
Which reading decides the frame; see ReduceProgressionOptions.
One labelled chord per segment, in time order.
The cadences the harmony arrives at.
Each hit carries the beat it arrives on as well as the cadence itself: a cadence without its onset says that the music cadenced but not where, which is the one thing a timed class is holding that a chord pair is not.
The cadences found, in time order.
The keys the chords themselves imply, in time order.
The chord route to key regions, for a timeline that holds harmony without the notes it was played from — a lead sheet, or a progression laid out in time. A chord argues for a key far more strongly than its three or four pitch classes do, so a modulation is read off the chords rather than off a pitch-class profile, and the chord that reads in both keys is reported as the pivot the modulation turned on.
The regions are searched for here rather than kept on the timeline: Timeline.keys answers with what the timeline was built with, which for placed chords is the key the caller stated or nothing at all.
Optionalopts: KeyTimelineOptions
Analysis options; see KeyTimelineOptions.
The key regions the chords imply; empty when there are no chords.
The chords as roman numerals in a key.
Optionalkey: KeyLike
Key to read the chords in; falls back to the key in force at each segment, so a timeline that modulates names every chord in the key it actually sounds in.
Optionalopts: ChordToRomanOptions
Applied-numeral rendering options; see ChordToRomanOptions.
One numeral per segment, with the beats it holds for.
The stretch of the timeline between two beats.
Beats are kept as they are rather than rebased on the slice, so a sliced
timeline still lines up with the score it was read from; totalBeats
becomes where the slice ends. A segment or key region straddling an edge is
clipped to it, and one reduced to nothing is dropped.
First beat of the stretch.
End of the stretch, exclusive.
The clipped timeline.
The timeline moved by a number of semitones.
The key regions move with the chords, so every segment keeps the degree and function it had in the key it sounded in.
The signed semitone offset.
The transposed timeline.
The timeline moved by a spelled interval, keeping the spelling.
Unlike Timeline.transpose, which picks letters from a semitone count, the interval's diatonic number decides them: a chord taken up an augmented fourth is spelled with sharps and one taken up a diminished fifth with flats.
Only a chord carrying a spelling of its own is spelled that way. A key region holds a key/scale rather than a spelled key, so a chord that takes its letters from the key in force follows the spelling that scale reads best from, whichever interval moved it there.
An interval name (e.g. 'A4', '-m3'), plain interval
data, or an Interval; a descending interval moves down.
The transposed timeline.
Whether another timeline holds the same chords over the same span.
The key regions are not compared: they are an analysis lens over the chords, the way a Progression's key context is over its own.
The timeline to compare.
True when the segments and the span both match.
The plain form of the timeline, for JSON.stringify.
Harmony that keeps its place in time: chord segments over a span of beats, with the key regions the analysis found under them.
This is the timed counterpart of Progression, which holds an ordered list of chords and deliberately drops their onsets. A piece read from a MIDI track has both a chord order and a chord rhythm, and until now only the order could be held in a class;
Timelineis where the rhythm lives.Example