| minimize_vl | R Documentation |
Given a source set and a goal to move to, find the voice leading from source
to goal with smallest size.
minimize_vl(
source,
goal,
method = c("taxicab", "euclidean", "chebyshev", "hamming"),
no_ties = FALSE,
edo = 12,
rounder = 10
)
source |
Numeric vector, the pitch-class set at the start of your voice leading |
goal |
Numeric vector, the pitch-class set at the end of your voice leading |
method |
What distance metric should be used? Defaults to |
no_ties |
If multiple VLs are equally small, should only one be returned? Defaults to |
edo |
Number of unit steps in an octave. Defaults to |
rounder |
Numeric (expected integer), defaults to |
Unless method="hamming", it is assumed that the minimal voice leading should be
strongly crossing-free, so you might get strange results if your source and goal
are not both in ascending order.
Using method="hamming" in principle should only care about preserving common tones, with no other restrictions on how voices move. This gives a profusion of tied voice leadings, which is not generally useful. This function therefore eliminates many of the options by requiring that the voices which aren't common tones make a minimal voice leading by the taxicab metric. Nevertheless, for multisets, method="hamming" can still return many tied possibilities.
Numeric array. In most cases, a vector the same length as source;
or a vector of NA the same length as source if goal and
source have different lengths. If no_ties=FALSE and multiple voice leadings
are equivalent, the array can be a matrix with m rows where m is the number
of equally small voice leadings.
c_major <- c(0, 4, 7)
ab_minor <- c(8, 11, 3)
minimize_vl(c_major, ab_minor)
diatonic_scale <- c(0, 2, 4, 5, 7, 9, 11)
minimize_vl(diatonic_scale, tn(diatonic_scale, 7))
d_major <- c(2, 6, 9)
minimize_vl(c_major, d_major)
minimize_vl(c_major, d_major, no_ties=TRUE)
minimize_vl(c_major, d_major, method="euclidean", no_ties=FALSE)
minimize_vl(c(0, 4, 7, 10), c(7, 7, 11, 2), method="euclidean")
minimize_vl(c(0, 4, 7, 10), c(7, 7, 11, 2), method="euclidean", no_ties=TRUE)
natural_hexachord <- c(0, 2, 4, 5, 7, 9)
hard_hexachord <- c(7, 9, 11, 0, 2, 4)
minimize_vl(natural_hexachord, hard_hexachord, method="hamming")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.