diff_num_notes: Difference in the number of notes

Description Usage Arguments Value Note

View source: R/cf-diff-num-notes.R

Description

Defines and returns a voicer feature, suitable for passing to the features argument of voice_opt, that computes how much the number of notes in a chord voicing differs from an ideal number of notes as specified by the ideal_num_notes 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.

Usage

1
diff_num_notes(ideal_num_notes)

Arguments

ideal_num_notes

(Numeric scalar) The ideal number of notes in the chord.

Value

A numeric scalar corresponding to the difference between the number of notes in the chord and an ideal number of notes as determined by the ideal_num_notes argument.

Note

The resulting function is not vectorized.


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