mode-helpers {tabr}R Documentation

Mode helpers

Description

Helper functions for working with musical modes.

Usage

modes(mode = c("all", "major", "minor"))

is_mode(notes, ignore_octave = FALSE)

mode_rotate(notes, n = 0, ignore_octave = FALSE)

mode_modern(
  mode = "ionian",
  key = "c",
  collapse = FALSE,
  ignore_octave = FALSE
)

mode_ionian(key = "c", collapse = FALSE, ignore_octave = FALSE)

mode_dorian(key = "c", collapse = FALSE, ignore_octave = FALSE)

mode_phrygian(key = "c", collapse = FALSE, ignore_octave = FALSE)

mode_lydian(key = "c", collapse = FALSE, ignore_octave = FALSE)

mode_mixolydian(key = "c", collapse = FALSE, ignore_octave = FALSE)

mode_aeolian(key = "c", collapse = FALSE, ignore_octave = FALSE)

mode_locrian(key = "c", collapse = FALSE, ignore_octave = FALSE)

Arguments

mode

character, which mode.

notes

character, for mode, may be a noteworthy string of seven notes, space- or vector-delimited.

ignore_octave

logical, strip octave numbering from modes not rooted on C.

n

integer, degree of rotation.

key

character, key signature.

collapse

logical, collapse result into a single string ready for phrase construction.

Details

For valid key signatures, see keys().

Modern modes based on major scales are available by key signature using the ⁠mode_*⁠ functions. The seven modes can be listed with modes. Noteworthy strings of proper length can be checked to match against a mode with is_mode(). Modes can be rotated with mode_rotate(), a wrapper around note_rotate().

Value

character

See Also

keys(), scale-helpers()

Examples

modes()
mode_dorian("c")
mode_modern("dorian", "c")
mode_modern("dorian", "c", ignore_octave = TRUE)

identical(mode_rotate(mode_ionian("c"), 1), mode_dorian("d"))
identical(
  mode_rotate(mode_ionian("c", ignore_octave = TRUE), 1),
  mode_dorian("d", ignore_octave = TRUE)
)

x <- sapply(modes(), mode_modern, ignore_octave = TRUE)
setNames(data.frame(t(x)), as.roman(1:7))

[Package tabr version 0.5.0 Index]