Skip to contents

The melodic features used in musicassessr mainly come from the FANTASTIC library (Müllensiefen, 2009), except where noted.

Feature Description Equation Reference
N The length of the target melody. - -
freq The count of its occurence in the corpus. freq -
rel_freq The relative count of a frequency in the corpus rel_freq -
log_freq The log of the relative count of a frequency in the corpus - -
IDF The inverse document frequency IDF -
i.entropy The average level of “information” or “surprise” in intervallic representations. Specifically, a variant of Shannon entropy on interval representations (Shannon, 1948) \(- \frac{ \sum_{i} f_{i} \cdot \log_{2} f_{i}}{\log_{2} 139}\) Müllensiefen, 2009
span The difference between the highest MIDI pitch and the lowest MIDI pitch in the melody. span span
tonalness The magnitude of the highest correlation value in a vector of tonality correlation values computed with the Krumhansl-Schmuckler algorithm (Krumhansl, 1990). It expresses how strongly a melody correlates to a single key. - Müllensiefen, 2009
tonal.clarity Inspired by Temperley’s notion of tonal clarity (Temperley, 2007), the ratio between the magnitude of the highest correlation in a tonality.vector (see tonalness) A0 and the second highest correlation A1. tonal.clarity Müllensiefen, 2009
tonal.spike Similar to tonal.clarity, tonal.spike depends on the magnitude of the highest correlation but in contrast to the previous feature is divided by the sum of all correlation values > 0. tonal.spike Müllensiefen, 2009
mode The mode of the tonality with the highest correlation in the tonality.vector. It can assume the values major and minor. mode Müllensiefen, 2009
step.cont.glob.var step.cont.glob.var step.cont.glob.var Müllensiefen, 2009.
step.cont.glob.dir step.cont.glob.dir step.cont.glob.dir Müllensiefen, 2009
step.cont.loc.var The mean absolute difference between adjacent values in the vector representing of step contour. \(\frac{ \sum_{i=1}^{N-1} \lvert x_{i+1} - x_{i} \rvert }{N-1}\) Müllensiefen, 2009
mean_int_size The average level of “information” or “surprise” in rhythm values. Specifically, a variant of Shannon entropy on rhythmic representations (Shannon, 1948) mean_int_size Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
int_range d.eq.trans int_range Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
dir_change The average interval size dir_change Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
mean_dir_change int_range. mean_dir_change Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
int_variety dir_change int_variety Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
pitch_variety mean_dir_change pitch_variety Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
mean_run_length int_variety mean_run_length Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021)
d.entropy The average level of “information” or “surprise” in rhythm values. Specifically, a variant of Shannon entropy on rhythmic representations (Shannon, 1948) \(- \frac{ \sum_{i} f_{i} \cdot \log_{2} f_{i}}{\log_{2} 140}\) Müllensiefen, 2009
d.eq.trans mean_run_length d.eq.trans Müllensiefen, 2009
mean_duration mean_duration mean_duration mean_duration
mean_information_content The average information content contained in the pitch values of a melody. Can be thought of as quantifying a melody’s self-similarity. - Harrison, Bianco, Chait & Pearce (2020)

References

Beaty, R. E., Frieler, K., Norgaard, M., Merseal, H. M., MacDonald, M. C., & Weiss, D. J. (2021). Expert musical improvisations contain sequencing biases seen in language production. Journal of Experimental Psychology. https://doi.org/10.1037/xge0001107

Harrison, P. M. C., Bianco, R., Chait, M., & Pearce, M. T. (2020). PPM-Decay: A computational model of auditory prediction with memory decay. PLOS Computational Biology, 16(11), e1008304. https://doi.org/10.1371/journal.pcbi.1008304

Müllensiefen, D. (2009). FANTASTIC: Feature ANalysis Technology Accessing STatistics (In a Corpus; Technical report). 37.