pc_harmonicity: Pitch-class harmonicity

Description Usage Arguments Value Note References Examples

View source: R/pc-harmonicity.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;textualhar18.

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

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;textualhar18.

rho

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

sigma

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

...

Arguments passed to specific methods.

array_dim

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

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

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

pmcharrison/har18 documentation built on April 1, 2021, 9:22 p.m.