Expand description
Key-finding and compact analysis helpers.
Modules§
- correlate
- How what a stream’s notes sound goes with the dynamics they sound under:
music21’s
analysis.correlate. - elements
- Counting what a stream’s elements say: music21’s
analysis.elements. - enharmonics
- The best spelling of a run of pitches: music21’s
analysis.enharmonics. - floating_
key - A key for every measure, each measure’s own reading smoothed by its
neighbours’: music21’s
analysis.floatingKey. - harmonic_
function - Harmonic function labels and the Roman numerals they stand for:
music21’s
analysis.harmonicFunction. - metrical
- Metrical and melodic accent: music21’s
analysis.metrical. - neoriemannian
- Neo-Riemannian transformations of triads: music21’s
analysis.neoRiemannian. - patel
- Aniruddh D. Patel’s measures of rhythm and melody: music21’s
analysis.patel. - pitch_
analysis - Counting a stream’s pitches: music21’s
analysis.pitchAnalysis. - reduce_
chords - A score reduced to the chords it is made of: music21’s
analysis.reduceChords. - reduction
- Reductions written into a score by its lyrics: music21’s
analysis.reduction. - segment_
by_ rests - A part cut into the runs of notes between its rests: music21’s
analysis.segmentByRests. - transposition
- How many distinct transpositions a set of pitches has: music21’s
analysis.transposition. - windowed
- An analysis run over windows of a stream, from a quarter note long to
the whole of it: music21’s
analysis.windowed.
Structs§
- KeyEstimate
- A ranked key estimate.
Enums§
- KeyProfile
- A set of key-finding weights for the Krumhansl-Schmuckler algorithm.
Functions§
- estimate_
key_ from_ chords - Estimates likely keys from chords using the Krumhansl-Schmuckler weights.
- estimate_
key_ from_ chords_ with - Estimates likely keys from chords using the given weights.
- estimate_
key_ from_ distribution - Every key ranked by how well
profilefitsdistribution, best first: music21’s key-weight analysis. - estimate_
key_ from_ pitches - Estimates likely keys from pitches using the Krumhansl-Schmuckler weights.
- estimate_
key_ from_ pitches_ with - Estimates likely keys from pitches using the given weights, each pitch counting once.
- estimate_
key_ of_ stream - The keys a stream is likely in, best first, by
profile’s weights over its duration-weighted pitch classes: music21’sKeyWeightKeyAnalysisrun on a stream. Nothing for a stream with no notes. - melodic_
interval_ counts - Every melodic interval between neighbouring notes of each line, with how
often it comes, in the order each is first met: music21’s
MelodicIntervalDiversity.countMelodicIntervals. Withignore_directiona falling interval counts as the rising one, and withignore_unisona repeated note does not count. Intervals are told apart by their directed name, and the first of each is the one kept. - melodic_
line_ positions - The same lines as positions in
Stream::leaves, which is the by-position twinmelodic_linesreads its own answer off: the note a count was taken from is the note the stream holds, so a caller handing back objects can hand back its own. - melodic_
lines - The melodic lines of a stream, as music21’s
MelodicIntervalDiversityreads them: each part-like stream it holds on its own, or the stream as one line where it holds none; the notes of each in order, chords and rests left out, and a note continuing a tie heard once. - pitch_
class_ distribution - How long each pitch class sounds: for each note, its pitches and its
length in quarter notes, every pitch counting for the whole length.
Nothing when there are no notes. music21’s
_getPitchClassDistribution, a quarter tone rounding to the even class as music21’spitchClassdoes. - pitch_
span - The lowest and the highest pitch among
pitches, the first of each where several share a place: music21’sAmbitus.getPitchSpan. Nothing for no pitches. - stream_
distribution - How long each pitch class sounds in a stream, nested streams included:
music21’s
_getPitchClassDistributionover the stream’s notes, each pitch counting for its note’s whole length. A note is music21’s: a note, a chord, a chord symbol or the pitched members of a percussion chord, so a stream of chord symbols lasting nothing has a distribution of nothing but noughts. Nothing for a stream with no notes at all. - stream_
pitch_ span - The lowest and highest pitch sounding anywhere in a stream: music21’s
Ambitus.getPitchSpan, which leaves chord symbols out. - tonal_
certainty - How decisively the first of a ranked list of key estimates wins: music21’s
Key.tonalCertaintyfor a key that came out of analysis. It is the leader’s score plus twice its lead over the next positive score; with no positive runner-up it is the leader’s score, floored at zero. - tonal_
certainty_ from_ scores - The same measure over the scores alone, for a ranking that came from
somewhere else — music21 hands its own analysis results around as keys
carrying a
correlationCoefficientrather than as estimates.