tabr (version 0.4.9)

dyad: Construct a dyad

Description

Construct a dyad given one note, an interval, and a direction.

Usage

dyad(
  notes,
  interval,
  reverse = FALSE,
  octaves = c("tick", "integer"),
  accidentals = c("flat", "sharp"),
  key = NULL
)

Value

character

Arguments

notes

character, a noteworthy string, single notes only, no chords. Number of timesteps must equal the length of interval.

interval

integer or character vector; semitones or interval ID, respectively. See details.

reverse

logical, reverse the transposition direction. Useful when interval is character.

octaves, accidentals, key

See transpose().

Details

The interval may be specified by semitones of by common interval name or abbreviation. See examples. For a complete list of valid interval names and abbreviations see mainIntervals(). key enforces the use of sharps or flats. This function is based on transpose(). notes and interval may be vectors, but must be equal length. Recycling occurs only if one argument is scalar.

See Also

mainIntervals()

Examples

Run this code
dyad("a", 4)
x <- c("minor third", "m3", "augmented second", "A2")
dyad("a", x)
dyad("c'", x, reverse = TRUE)

x <- c("M3", "m3", "m3", "M3", "M3", "m3", "m3")
dyad(letters[c(3:7, 1, 2)], x)

x <- c("P1", "m3", "M3", "P4", "P5", "P8", "M9")
dyad("c", x)
dyad("c", x, reverse = TRUE)
dyad("d e", "m3")

Run the code above in your browser using DataLab