This function represents an input object as a sparse pitch-class spectrum.
sparse_pc_spectrum(x, ...) # S3 method for sparse_fr_spectrum sparse_pc_spectrum(x, coherent = FALSE, ...) # S3 method for list sparse_pc_spectrum(x, ...) # S3 method for default sparse_pc_spectrum(x, ...) # S3 method for pi_chord sparse_pc_spectrum(x, amplitude = 1, coherent = FALSE, ...)
x | Input sonority. |
---|---|
... | Arguments passed on to
|
coherent | Whether the amplitudes from different spectral components should be combined
assuming coherent summation, where the amplitudes simply add together
(default is |
amplitude | (Numeric vector) Vector of amplitudes to assign to each pitch. If a scalar value is provided, this value is assigned to all pitches |
An object of class sparse_pc_spectrum
.
A sparse pitch-class spectrum describes an input sonority as a finite set of spectral components, each defined by a pitch class (expressed as numbers in the range [0, 12)) and an amplitude (expressed in arbitrary units, but with the fundamental frequencies of chord pitches typically taking the value 1).
A sparse pitch-class spectrum is most easily created by coercion from
a different chord representation. If a numeric vector is provided as the input,
it is treated as a pi_chord
representation, for example
sparse_pc_spectrum(c(60, 64, 67))
will create a sparse pitch-class spectrum
by expanding the harmonics implied by a C major triad.
A sparse pitch-class spectrum can also be created directly by providing a list
with two elements, the first being labelled "pc", and the second labelled "amplitude",
each of which being numeric vectors of the same length.
In this case no harmonic expansion is performed.
The first element will be taken as a vector of pitches,
and the second element will be taken as a vector of corresponding amplitudes.
For example, one might write
sparse_pc_spectrum(list(pitch = c(0, 4, 7), amplitude = c(3, 1, 2)))
.