signvector {musicMCT} | R Documentation |
Detect a scale's location relative to a hyperplane arrangement
Description
As "Modal Color Theory" describes (pp. 25-26), each distinct scalar "color" is determined
by its relationships to the hyperplanes that define the space. For any scale, this
function calculates a sign vector that compares the scale to each hyperplane and returns
a vector summarizing the results. If the scale lies on hyperplane 1, then the first
entry of its sign vector is 0
. If it lies below hyperplane 2, then the second entry
of its sign vector is -1
. If it lies above hyperplane 3, then the third entry of its
sign vector is 1
. Two scales with identical sign vectors belong to the same "color".
Usage
signvector(set, ineqmat = NULL, edo = 12, rounder = 10)
Arguments
set |
Numeric vector of pitch-classes in the set |
ineqmat |
Specifies which hyperplane arrangement to consider. By default (or by
explicitly entering "mct") it supplies the standard "Modal Color Theory" arrangements
of |
edo |
Number of unit steps in an octave. Defaults to |
rounder |
Numeric (expected integer), defaults to |
Value
A vector whose entries are 0
, -1
, or 1
. Length of vector equals the
number of hyperplanes in ineqmat
.
Examples
# 037 and 016 have identical sign vectors because they belong to the same trichordal color
signvector(c(0, 3, 7))
signvector(c(0, 1, 6))
# Just and equal-tempered diatonic scales have different sign vectors because they have
# different internal structures (e.g. 12edo dia is generated but just dia is not).
dia_12edo <- c(0, 2, 4, 5, 7, 9, 11)
just_dia <- j(dia)
isTRUE( all.equal( signvector(dia_12edo), signvector(just_dia) ) )