Primary colors
Description
In traditional pitch-class set theory, concepts like normal order and
primeform() establish a canonical representative for each equivalence
class of pitch-class sets. It's useful to do something similar in MCT
as well: given a family of scales, such as the collection of modes or a
scale_palette(), we can define the "primary color" of the family as the
one that comes first when the scales' sign vectors are ordered lexicographically.
primary_hue() uses ineqsym() to return a specific representative of
the primary color which belongs to the same palette of hues as the input.
Because primary_hue() focuses on hues rather than colors, it may not
highlight the fact that two scales have the same primary color. Thus, for
information about broader families, primary_colornum() returns the color
number of the primary color, primary_signvector() returns the sign vector,
and primary_color() itself uses quantize_color() to return a consistent
representative of each color.
Usage
primary_hue( set, type = c("all", "half_palette", "modes"), ineqmat = NULL, edo = 12, rounder = 10 ) primary_colornum(set, type = "all", signvector_list = NULL, ...) primary_signvector(set, type = "all", ...) primary_color(set, type = "all", nmax = 12, reconvert = FALSE, ...)primary_hue( set, type = c("all", "half_palette", "modes"), ineqmat = NULL, edo = 12, rounder = 10 ) primary_colornum(set, type = "all", signvector_list = NULL, ...) primary_signvector(set, type = "all", ...) primary_color(set, type = "all", nmax = 12, reconvert = FALSE, ...)
Arguments
set |
Numeric vector of pitch-classes in the set |
type |
How broad of an equivalence class should be considered? May be one of three options:
|
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 |
signvector_list |
A list of signvectors to use as the reference by
which |
... |
Arguments to be passed to |
nmax |
Integer, essentially a limit to how far the function should search before giving up.
Although every real color should have a rational representation in some mod k universe, for some colors
that k must be very high. Increasing nmax makes the function run longer but might be necessary
if small chromatic universes don't produce a result. Defaults to |
reconvert |
Boolean. Should the scale be converted to the input edo? Defaults to |
Value
A numeric vector representing a scale for primary_hue(); a
single integer for primary_colornum(); a signvector() for
primary_signvector(); and a list like quantize_color() for
primary_color().
Examples
major_64 <- c(0, 5, 9) primary_hue(major_64) primary_hue(major_64, type="modes") viennese_trichord <- c(0, 6, 11) # Same primary color as major_64: apply(cbind(major_64, viennese_trichord), 2, primary_signvector) # But a different primary hue: primary_hue(viennese_trichord) # Only works with representative_signvectors loaded: primary_colornum(major_64) == primary_colornum(viennese_trichord) primary_color(major_64) primary_color(viennese_trichord)major_64 <- c(0, 5, 9) primary_hue(major_64) primary_hue(major_64, type="modes") viennese_trichord <- c(0, 6, 11) # Same primary color as major_64: apply(cbind(major_64, viennese_trichord), 2, primary_signvector) # But a different primary hue: primary_hue(viennese_trichord) # Only works with representative_signvectors loaded: primary_colornum(major_64) == primary_colornum(viennese_trichord) primary_color(major_64) primary_color(viennese_trichord)