chord-mapping: Chord mapping

chord-mappingR Documentation

Chord mapping

Description

Helper functions for chord mapping.

Usage

gc_info(
  name,
  root_octave = NULL,
  root_fret = NULL,
  min_fret = NULL,
  bass_string = NULL,
  open = NULL,
  key = "c",
  ignore_octave = TRUE
)

gc_fretboard(
  name,
  root_octave = NULL,
  root_fret = NULL,
  min_fret = NULL,
  bass_string = NULL,
  open = NULL,
  key = "c",
  ignore_octave = TRUE
)

gc_notes_to_fb(
  notes,
  root_octave = NULL,
  root_fret = NULL,
  min_fret = NULL,
  bass_string = NULL,
  open = NULL
)

gc_notes(
  name,
  root_octave = NULL,
  root_fret = NULL,
  min_fret = NULL,
  bass_string = NULL,
  open = NULL,
  key = "c",
  ignore_octave = TRUE
)

gc_is_known(notes)

gc_name_split(name)

gc_name_root(name)

gc_name_mod(name)

Arguments

name

character, chord name in tabr format, e.g., "bM b_m b_m7#5", etc.

root_octave

integer, optional filter for chords whose root note is in a set of octave numbers. May be a vector.

root_fret

integer, optional filter for chords whose root note matches a specific fret. May be a vector.

min_fret

integer, optional filter for chords whose notes are all at or above a specific fret. May be a vector.

bass_string

integer, optional filter for chords whose lowest pitch string matches a specific string, 6, 5, or 4. May be a vector.

open

logical, optional filter for open and movable chords. NULL retains both types.

key

character, key signature, used to enforce type of accidentals.

ignore_octave

logical, if TRUE, functions like gc_info() and gc_fretboard() return more results.

notes

character, a noteworthy string.

Details

These functions assist with mapping between different information that define chords.

For gc_is_known(), a check is done against chords in the guitarChords dataset. A simple noteworthy string is permitted, but any single-note entry will automatically yield a FALSE result.

gc_info() returns a tibble data frame containing complete information for the subset of predefined guitar chords specified by name and key. Any accidentals present in the chord root of name (but not in the chord modifier, e.g., m7_5 or m7#5) are converted according to key if necessary. gc_notes() and gc_fretboard() are wrappers around gc_info(), which return noteworthy strings of chord notes and a named vector of LilyPond fretboard diagram data, respectively. Note that although the input to these functions can contain multiple chord names, whether as a vector or as a single space-delimited string, the result is not intended to be of equal length. These functions filter guitarChords. The result is the set of all chords matched by the supplied input filters.

gc_name_split() splits a vector or space-delimited set of chord names into a tibble data frame containing separate chord root and chord modifier columns. gc_name_root() and gc_name_mod() are wrappers around this.

Value

various, see details regarding each function.

Examples

gc_is_known("a b_,fb_d'f'")

gc_name_root("a aM b_,m7#5")
gc_name_mod("a aM b_,m7#5")

gc_info("a") # a major chord, not a single note
gc_info("ceg a#m7_5") # only second entry is a guitar chord
gc_info("ceg a#m7_5", key = "f")

gc_info("a,m c d f,")
gc_fretboard("a,m c d f,", root_fret = 0:3)
gc_notes_to_fb("a,eac'e' cgc'e'g'")

x <- gc_notes("a, b,", root_fret = 0:2)
summary(x)


leonawicz/tabr documentation built on Sept. 24, 2023, 2:49 p.m.