Create a fretboard diagram for a single chord or a general progression.
plot_fretboard(
string,
fret,
labels = NULL,
mute = FALSE,
label_size = 10,
label_color = "white",
point_size = 10,
point_color = "black",
point_fill = "black",
group = NULL,
horizontal = FALSE,
left_handed = FALSE,
fret_range = NULL,
accidentals = c("flat", "sharp"),
tuning = "standard",
show_tuning = FALSE,
asp = NULL,
base_size = 20
)
plot_chord(
chord,
labels = NULL,
label_size = 10,
label_color = "white",
point_size = 10,
point_color = "black",
point_fill = "black",
group = NULL,
horizontal = FALSE,
left_handed = FALSE,
fret_range = NULL,
accidentals = c("flat", "sharp"),
tuning = "standard",
show_tuning = FALSE,
asp = NULL,
base_size = 20
)
integer or as a space-delimited character string; instrument string numbers.
integer or as a space-delimited character string; fret numbers.
character, optional text labels, must be one for every point.
logical vector or specific integer indices, which notes to mute.
numeric, size of fretted note labels.
character, label color.
numeric, size of fretted note points.
character, point color.
character, point fill color.
optional vector to facet by.
logical, directional orientation.
logical, handedness orientation.
fret limits, if not NULL
, overrides limits derived
from fret
.
character, when labels = "notes"
represent accidentals:
"flat"
or "sharp"
.
explicit tuning, e.g., "e, a, d g b e'"
, or a pre-defined
tuning. See details.
logical, show tuning of each string.
numeric, aspect ratio, overrides default aspect ratio derived from number of strings and frets.
base size for ggplot2::theme_void()
.
character, a single chord given in fret notation. See details.
a ggplot object
These functions are under development and subject to change. They each return a ggplot object.
Use plot_chord()
to create a fretboard diagram of a specific chord.
plot_chord()
accepts a character string in simple fretboard format,
e.g., chord = "xo221o"
.
Zero is allowed in place of "o"
. This only works when no spaces or
semicolons are detected. The function checks for spaces first, then
semicolons, to split fret numbers.
Do not mix formats. For example, you can use chord = "xo221o"
,
chord = "x 8 10 10 9 8"
or chord = "x;8;10;10;9;8"
.
Trailing delimiters are ignored (LilyPond format: "x;8;10;10;9;8;"
).
If there are fewer fret values than there are strings on the instrument, as
inferred from tuning
, then muted strings, x
, are inferred for
the remaining lower-pitch strings.
plot_fretboard()
produces a more general fretboard diagram plot. It is
intended for scales, arpeggios and other patterns along the fretboard. For
this function, provide vectors of string and fret numbers. mute
is
available but not as applicable for this function. For single chord diagrams,
use plot_chord()
.
Number of strings is derived from tuning
. See tunings()
for pre-defined tunings and examples of explicit tunings.
tuning
affects point labels when labels = "notes"
.
# General patterns: scale shifting exercise
string <- c(6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1)
fret <- "2 4 5 2 4 5 2 4 6 7 9 6 7 9 7 9 10 7 9 10" # string input accepted
plot_fretboard(string, fret, labels = "notes")
# Single chord diagrams
# open chord
idx <- c(1, 1, 2, 2, 2, 1)
fill <- c("white", "black")[idx]
lab_col <- c("black", "white")[idx]
plot_chord("xo221o", "notes", label_color = lab_col, point_fill = fill)
# moveable chord
plot_chord("355433", horizontal = TRUE, show_tuning = TRUE)
plot_chord("0231") # leading x inferred; same as plot_chord("xxo321")
plot_chord("10 12 13 11", fret_range = c(10, 14))