View source: R/cps_functions.R
cps_chord_table | R Documentation |
Creates a chord table for a combination product set scale based on an even number of harmonic factors.
cps_chord_table(scale_table)
scale_table |
a CPS scale table based on an even number of harmonic factors. It will abort via
if it receives one with an odd number. |
The algorithm used only works for a combination product set built from an even number of harmonic factors, so it aborts if it receives one with an odd number.
In the following, the symbol n)m
is Erv Wilson's notation for the
number of combinations of m
items taken n
at a time. n_harmonics
is the number of harmonic factors, the resulting chords will have
choose <- n_harmonics / 2 + 1
notes. There will be
choose)n_harmonics
"harmonic" chords and choose)n_harmonics
"sub-harmonic" chords.
a data.table with four columns:
chord
: the chord expressed as colon-separated harmonics. A
subharmonic chord is prefixed with a "~".
degrees
: the chord expressed as colon-separated scale degrees
chord_index
: the row number of the chord in the combination output
is_subharm
: zero if it's harmonic, one if it's subharmonic.
The resulting data.table is sorted into harmonic-subharmonic pairs using
data.table::setkey.
# compute the tetrads of the 1-3-5-7-9-11 Eikosany
eikosany <- cps_scale_table(root_divisor = 33)
print(eikosany_chords <- cps_chord_table(eikosany))
# compute the pentads of the 1-3-5-7-9-11-13-15 Hebdomekontany
hebdomekontany <- cps_scale_table(
harmonics = c(1, 3, 5, 7, 9, 11, 13, 15),
choose = 4,
root_divisor = 3 * 5 * 7
)
print(hebdomekontany_chords <- cps_chord_table(hebdomekontany))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.