minimize_vl {musicMCT} | R Documentation |
Smallest voice leading between two sets
Description
Given a source
set and a goal
to move to, find the "strongly
crossing-free" voice leading from source
to goal
with smallest size.
Usage
minimize_vl(
source,
goal,
method = c("taxicab", "euclidean", "chebyshev", "hamming"),
no_ties = FALSE,
edo = 12,
rounder = 10
)
Arguments
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 |
Value
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.
Examples
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)