c_major <- c(0, 4, 7)
tn(c_major, 2)
tn(c_major, -10)
tn(c_major, -10, optic="p") # Equivalent to tn(c_major, -10, octave_equivalence=FALSE)
tni(c_major, 4)
tni(c_major, 4, sorted=FALSE)
# If no index is supplied for tni, n is chosen to fix the first and last entries of the set:
tni(c_major)
tn(c(0, 1, 6, 7), 6)
tn(c(0, 1, 6, 7), 6, sorted=FALSE)
##### Difference between startzero and tnprime
e_maj7 <- c(4, 8, 11, 3)
startzero(e_maj7)
tnprime(e_maj7)
isTRUE(all.equal(tnprime(e_maj7), charm(e_maj7))) # True because inversionally symmetrical
##### Derive minimal voice leading from ionian to lydian
ionian <- c(0, 2, 4, 5, 7, 9, 11)
lydian <- rotate(tn(ionian, 7, sorted=FALSE), 3)
lydian - ionian
##### Easy to create a 12-tone matrix
row <- c(9, 10, 6, 8, 5, 7, 1, 2, 3, 11, 0, 4)
matrix_from_0 <- sapply(row, tni, set=row, optic="o")
matrix_from_9 <- tn(matrix_from_0, 9, optic="o")
print(matrix_from_0)
print(matrix_from_9)
Run the code above in your browser using DataLab