knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
This R package, parn88
, implements the
psychoacoustic root-finding algorithm of @Parncutt1988.
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
You can install the package directly from Github.
if (!require(devtools)) install.packages("devtools") devtools::install_github("pmcharrison/parn88")
Load the package:
library(parn88)
Analyse a chord:
parn88(c(0, 4, 7))
The input is a pitch class set. There are three outputs:
root
- the pitch class of the estimated chord root.root_ambiguity
- the ambiguity of the chord root. Ambiguity is positively
associated with dissonance.pc_weight
- a 12-dimensional vector describing the weight of each pitch class.
High weight means that a pitch class is more likely to become the chord root.It is also possible to compute chord roots and root ambiguities directly.
Chord roots:
root(c(0, 4, 7)) # C major chord root(c(0, 3, 7)) # C minor chord root(c(0, 4, 9)) # A minor chord root(c(2, 5, 7, 11)) # G7 chord
Root ambiguities:
root_ambiguity(c(0, 4, 7)) # major triad root_ambiguity(c(0, 3, 7)) # minor triad root_ambiguity(c(0, 4, 8)) # augmented triad root_ambiguity(c(0, 3, 6)) # dimimished triad
By default, parn88
uses updated root support weights as reported in @Parncutt2006.
However, it is also possible to use root support weights as reported in the
original paper [@Parncutt1988].
root_ambiguity(c(0, 4, 7)) # updated weights root_ambiguity(c(0, 4, 7), root_support = "v1") # original weights
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.