Learn R Programming

musicMCT (version 0.3.0)

normal_form: Hook's OPTIC normal forms

Description

Following Hook (2023, 416-18, ISBN: 9780190246013), calculates a normal form for the input set using any combination of OPTIC symmetries.

Usage

normal_form(set, optic = "opc", edo = 12, rounder = 10)

Value

Numeric vector with the desired normal form of set

Arguments

set

Numeric vector of pitch-classes in the set

optic

String: the OPTIC symmetries to apply. Defaults to "opc".

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.

Details

This function is designed for flexibility in the optic parameter, not speed. In situations where you need to calculate a large number of OPTIC- or OPTC-normal forms, you should use primeform() or tnprime() respectively, which are considerably faster.

See Also

primeform(), tnprime(), and startzero() for faster functions dedicated to specific symmetry combinations

Examples

Run this code
# See Exercise 10.4.8 in Hook (2023, 420):
eroica <- c(-25, -13, -6, -3, 0, 3)
normal_form(eroica, optic="pti")
normal_form(eroica, optic="op")

# See Table 10.4.1 in Hook (2023, 417):
alpha <- c(-5, -11, 14, 9, 14, 14, 2)
num_symmetries <- sample(0:5, 1)
random_symmetries <- sample(c("o", "p", "t", "i", "c"), num_symmetries)
random_symmetries <- paste(random_symmetries, collapse="")
print(random_symmetries)
normal_form(alpha, optic=random_symmetries)

Run the code above in your browser using DataLab