pc_harmonicity: Pitch-class harmonicity

View source: R/model-har18.R

pc_harmonicityR Documentation

Pitch-class harmonicity

Description

Gets the pitch-class harmonicity of an input sonority, after \insertCiteHarrison2018;textualincon and \insertCiteMilne2013;textualincon.

Usage

pc_harmonicity(
  x,
  method = "kl",
  num_harmonics = 12,
  rho = 0.75,
  sigma = 6.83,
  ...
)

## Default S3 method:
pc_harmonicity(
  x,
  method = "kl",
  num_harmonics = 12,
  rho = 0.75,
  sigma = 6.83,
  array_dim = 1200,
  ...
)

## S3 method for class 'pc_set'
pc_harmonicity(
  x,
  method = "kl",
  num_harmonics = 12,
  rho = 0.75,
  sigma = 6.83,
  array_dim = 1200,
  ...
)

## S3 method for class 'milne_pc_spectrum'
pc_harmonicity(
  x,
  method = "kl",
  num_harmonics = 12,
  rho = 0.75,
  sigma = 6.83,
  ...
)

Arguments

x

Object to analyse.

method

(Character scalar) Method to use.

  • "kl" (default) delivers the Kullback-Leibler method of \insertCiteHarrison2018;textualincon.

  • "peak" delivers the peak-value method of \insertCiteMilne2013;textualincon.

num_harmonics

(Integerish scalar) Number of harmonics to use when expanding tones into their implied harmonics, and when defining the harmonic template (including the fundamental frequency). Defaults to 12, after \insertCiteMilne2016;textualincon.

rho

(Numeric scalar) Roll-off parameter for harmonic expansion. Defaults to 0.75, after \insertCiteMilne2016;textualincon.

sigma

(Numeric scalar) Standard deviation of the Gaussian smoothing distribution (cents). Defaults to 6.83, after \insertCiteMilne2016;textualincon.

...

Arguments passed to specific methods.

array_dim

(Integerish scalar) Dimensionality of the pitch-class spectrum array. Defaults to 1200, after \insertCiteMilne2016;textualincon.

Value

Pitch-class harmonicity, as a numeric scalar.

Note

This algorithm makes use of milne_pc_spectrum() as defined in the hrep package.

References

\insertAllCited

Examples

pc_harmonicity(c(0, 4, 7))
pc_harmonicity(c(0, 3, 7))
pc_harmonicity(c(0, 3, 6))

pmcharrison/incon documentation built on Feb. 12, 2024, 3:18 a.m.