Pitch class
Full module path: melody_features.feature_definitions.pitch_class.
Also importable via import melody_features as mf (for example mf.pitch_range).
Pitch class feature definitions.
- pitch_class_variability_after_folding(pitches)[source]
Standard deviation of all pitch classes after arranging the pitch classes by perfect fifths. Provides a measure of how close the pitch classes are as a whole from the mean pitch class from a dominant-tonic perspective.
- pcdist1(pitches, starts, ends)[source]
Pitch-class distribution weighted by Parncutt duration accent.
- pcdist2(pitches, starts, ends)[source]
Second-order pitch-class transition distribution (MIDI Toolbox pcdist2.m).
Transition weights are the product of Parncutt duration accents of the two notes. Keys are (from_pitch_class, to_pitch_class) with pitch classes 0–11 (C=0, …, B=11).
- dominant_spread(pitches)[source]
The longest sequence of pitch classes separated by perfect 5ths that each appear >9% of the time.
- mean_pitch_class(pitches)[source]
The arithmetic mean of the pitch classes in the melody.
- Parameters:
- Returns:
Linear arithmetic mean pitch class value (between 0 and 11)
- Return type:
Note
This is a linear (non-circular) mean over pitch classes. For example, pitch classes near the wraparound boundary (e.g., 11 and 0) are averaged numerically rather than on the unit circle.
- number_of_common_pitch_classes(pitches)[source]
The number of pitch classes that appear in at least 20% of total notes.
- prevalence_of_most_common_pitch_class(pitches)[source]
The proportion of pitch classes that are the most common pitch class with regards to the total number of pitch classes in the melody.
- relative_prevalence_of_top_pitch_classes(pitches)[source]
The ratio of the frequency of the second most common pitch class to the frequency of the most common pitch class.
- interval_between_most_prevalent_pitch_classes(pitches)[source]
The number of semitones between the two most prevalent pitch classes.
- folded_fifths_pitch_class_histogram(pitches)[source]
A histogram of pitch classes arranged according to the circle of fifths.
- pitch_class_skewness(pitches)[source]
The skewness of the pitch class histogram, using Pearson’s median skewness formula.
- pitch_class_skewness_after_folding(pitches)[source]
The skewness of the pitch class histogram, using Pearson’s median skewness formula, after arranging the pitch classes according to the circle of fifths.
- pitch_class_kurtosis_after_folding(pitches)[source]
The sample excess kurtosis of the pitch class histogram, after arranging the pitch classes according to the circle of fifths.