rotate {musicMCT} | R Documentation |
Circular rotation of an ordered tuple
Description
Changes which element of a circularly-ordered series is in the first position without otherwise changing the order. Used primarily to generate the modes of a scale. Single application moves one element from the beginning of a tuple to the end.
Usage
rotate(x, n = 1, transpose_up = FALSE, edo = 12)
Arguments
x |
Vector to be rotated |
n |
Number of positions the vector should be rotated left.
Defaults to |
transpose_up |
Boolean, defaults to |
edo |
Number of unit steps in an octave. Defaults to |
Value
(Rotated) vector of same length as x
Examples
rotate(c(0, 2, 4, 5, 7, 9, 11), n=2)
rotate(c(0, 2, 4, 5, 7, 9, 11), n=-2)
rotate(c(0, 2, 4, 5, 7, 9, 11), n=2, transpose_up=TRUE)
rotate(c(0, 2, 4, 5, 7, 9, 11), n=2, transpose_up=TRUE, edo=15)
rotate(c("father", "charles", "goes", "down", "and", "ends", "battle"),
n=4)
[Package musicMCT version 0.2.0 Index]