README.md

parn94: Implementation of Richard Parncutt’s Psychoacoustic Harmony Algorithms

lifecycle Travis build
status AppVeyor build
status Coverage
status DOI

parn94 is an R package that implements Richard Parncutt’s psychoacoustic harmony algorithms, as described in Parncutt & Strasburger (1994).

Installation

You can install the current version of parn94 from Github by entering the following commands into R:

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

Example usage

This package provides a variety of methods for analysing chords in isolation and in combination.

Most functions can be used with numeric inputs, which will be interpreted as MIDI note numbers. Methods are also provided for various chord classes in the hrep package, such as pi_chord, sparse_pi_spectrum, and so on. These inputs are internally coerced to sparse_pi_spectrum before continuing the analysis.

Key functions include:

library(parn94)

c_maj <- c(60, 64, 67) # C major triad
c_dim <- c(60, 63, 66) # C diminished triad
g_maj <- c(59, 62, 67) # G major triad

# Pure sonorousness
pure_sonor(c_maj)
#> [1] 0.6157366
pure_sonor(c_dim)
#> [1] 0.4758778

# Complex sonorousness
complex_sonor(c_maj)
#> [1] 0.309965
complex_sonor(c_dim)
#> [1] 0.147792

# Multiplicity
multiplicity(c_maj)
#> [1] 2.843946
multiplicity(c_dim)
#> [1] 3.192587

# Pitch commonality
pitch_commonality(c_maj, g_maj)
#> [1] 0.3496254
pitch_commonality(c_maj, c_dim)
#> [1] 0.2535183

# Pitch distance
pitch_distance(c_maj, g_maj)
#> [1] 1.495423
pitch_distance(c_maj, c_dim)
#> [1] 1.003077

References

Parncutt, R., & Strasburger, H. (1994). Applying psychoacoustics in composition: “Harmonic” progressions of “nonharmonic” sonorities. Perspectives of New Music, 32(2), 88–129.



pmcharrison/parn94 documentation built on April 10, 2021, 1:33 p.m.