Skip to contents

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 getineqmat(), but can be set to "white," "roth", "pastel," or "rosy", giving the ineqmats of make_white_ineqmat(), make_roth_ineqmat(), make_pastel_ineqmat(), and make_rosy_ineqmat(). For other arrangements, the desired inequality matrix can be entered directly.

edo

Number of unit steps in an octave. Defaults to 12.

rounder

Numeric (expected integer), defaults to 10: number of decimal places to round to when testing for equality.

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))
#> [1] -1 -1 -1
signvector(c(0, 1, 6))
#> [1] -1 -1 -1

# 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) ) )
#> [1] FALSE