README.md

parn88: Parncutt’s (1988) root-finding algorithm

Travis build
status Coverage
status lifecycle DOI

This R package, parn88, implements the psychoacoustic root-finding algorithm of Parncutt (1988).

Citation

Cite the original paper:

Parncutt, Richard. 1988. “Revision of Terhardt’s psychoacoustical model of the root(s) of a musical chord.” Music Perception 6 (1): 65–93.

Cite the implementation:

Peter M. C. Harrison. 2018. “parn88: Implementation of Parncutt’s (1988) root-finding model.” Zenodo. https://doi.org/10.5281/zenodo.1491909

Installation

You can install the package directly from Github.

if (!require(devtools)) install.packages("devtools")
devtools::install_github("pmcharrison/parn88")

Example usage

Load the package:

library(parn88)

Analyse a chord:

parn88(c(0, 4, 7))
#> $root
#> [1] 0
#> 
#> $root_ambiguity
#> [1] 1.870829
#> 
#> $pc_weight
#>  [1] 18  0  3  3 10  6  2 10  3  7  1  0

The input is a pitch class set. There are three outputs:

It is also possible to compute chord roots and root ambiguities directly.

Chord roots:

root(c(0, 4, 7)) # C major chord
#> [1] 0
root(c(0, 3, 7)) # C minor chord
#> [1] 0
root(c(0, 4, 9)) # A minor chord
#> [1] 9
root(c(2, 5, 7, 11)) # G7 chord
#> [1] 7

Root ambiguities:

root_ambiguity(c(0, 4, 7)) # major triad
#> [1] 1.870829
root_ambiguity(c(0, 3, 7)) # minor triad
#> [1] 2.04939
root_ambiguity(c(0, 4, 8)) # augmented triad
#> [1] 2.201398
root_ambiguity(c(0, 3, 6)) # dimimished triad
#> [1] 2.50998

Root support weights

By default, parn88 uses updated root support weights as reported in Parncutt (2006). However, it is also possible to use root support weights as reported in the original paper (Parncutt 1988).

root_ambiguity(c(0, 4, 7)) # updated weights
#> [1] 1.870829
root_ambiguity(c(0, 4, 7), root_support = "v1") # original weights
#> [1] 1.974842

References

Parncutt, Richard. 1988. “Revision of Terhardt’s psychoacoustical model of the root(s) of a musical chord.” *Music Perception* 6 (1): 65–93.
———. 2006. “Commentary on Cook & Fujisawa’s "The Psychophysics of Harmony Perception: Harmony is a Three-Tone Phenomenon".” *Empirical Musicology Review* 1 (4): 204–9.


pmcharrison/parn88 documentation built on Sept. 21, 2019, 12:08 a.m.