knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

dycon: Dyadic Models of Consonance

lifecycle Travis build status AppVeyor build status Coverage status DOI

dycon is an R package that implements three dyadic models of consonance:

Installation

You can install the current version of dycon from Github as follows:

if (!require(devtools)) install.packages("devtools")
devtools::install_github("dycon")

Usage

By default, input sonorities are interpreted as vectors of MIDI note numbers. These notes are expanded into their implied harmonics using the hrep package (see ?hrep::sparse_fr_spectrum).

library(dycon)

# Major triad
roughness_hutch(c(60, 64, 67)) 

# Minor triad
roughness_hutch(c(60, 63, 67)) 

# Diminished triad
roughness_hutch(c(60, 63, 66)) 

# Sethares, major triad minus minor triad
roughness_seth(c(60, 64, 67)) - 
  roughness_seth(c(60, 63, 67))

# Vassilakis, major triad minus minor triad
roughness_vass(c(60, 64, 67)) - 
  roughness_vass(c(60, 63, 67))

Alternatively, it is possible to provide a custom input frequency spectrum as a list of two numeric vectors: frequency and amplitude.

freq <- c(440, 480, 520)
amp <- c(1, 1, 2)
roughness_hutch(list(freq, amp))

These representation formats can be formalised using classes from the hrep package, in particular those created by hrep::pi_chord() and hrep::sparse_fr_spectrum().

References

Hutchinson, W., & Knopoff, L. (1978). The acoustic component of Western consonance. Journal of New Music Research, 7(1), 1–29. https://doi.org/10.1080/09298217808570246

Sethares, W. A. (1993). Local consonance and the relationship between timbre and scale. The Journal of the Acoustical Society of America, 94(3), 1218–1228.

Vassilakis, P. N. (2001). Perceptual and physical properties of amplitude fluctuation and their musical significance. University of California, Los Angeles, CA.



pmcharrison/dycon documentation built on June 28, 2021, 4:46 p.m.