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

Travis build status Coverage status lifecycle DOI

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.

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))

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
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

Root support weights

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

References



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