dist_from_middle: Distance from middle

Description Usage Arguments Note

View source: R/cf-dist.R

Description

Defines and returns a voicer feature, suitable for passing to the features argument of voice_opt, that compares the chord's mean pitch to a reference pitch specified in the middle argument. The resulting function takes one argument, x, corresponding to a chord represented as a numeric vector of MIDI note numbers, without duplicates, sorted in ascending order, and returns an unsigned distance in semitones.

Usage

1

Arguments

middle

(Numeric scalar) The pitch height to which the chord is compared, specified as a MIDI note number where 60 corresponds to middle C.

Note

The resulting function is not vectorized.


pmcharrison/voicer documentation built on Dec. 17, 2020, 1:09 p.m.