Create an arpeggio from a chord.
Usage
chord_arpeggiate(
chord,
n = 0,
by = c("note", "chord"),
broken = FALSE,
collapse = FALSE
)
Arguments
- chord
character, a single chord.
- n
integer, number of steps, negative indicates reverse direction (decreasing pitch).
- by
whether each of the
n
steps refers to individual notes in the chord (an inversion) or raising the entire chord in its given position by one octave.- broken
logical, return result as an arpeggio of broken chords.
- collapse
logical, collapse result into a single string ready for phrase construction.
Details
This function is based on chord_invert
. If n = 0
then chord
is returned
immediately; other arguments are ignored.
Examples
chord_arpeggiate("ce_gb_", 2)
#> <Noteworthy string>
#> Format: vectorized time
#> Values: <ce_gb_> <e_gb_c4> <gb_c4e_4>
chord_arpeggiate("ce_gb_", -2)
#> <Noteworthy string>
#> Format: vectorized time
#> Values: <ce_gb_> <b_2ce_g> <g2b_2ce_>
chord_arpeggiate("ce_gb_", 2, by = "chord")
#> <Noteworthy string>
#> Format: vectorized time
#> Values: <ce_gb_> <c4e_4g4b_4> <c5e_5g5b_5>
chord_arpeggiate("ce_gb_", 1, broken = TRUE, collapse = TRUE)
#> <Noteworthy string>
#> Format: space-delimited time
#> Values: c e_ g b_ e_ g b_ c4