tabr (version 0.3.5)

chord_set: Generate a chord set

Description

Generate a chord set for a music score.

Usage

chord_set(x, id = NULL)

Arguments

x

character, n-string chord description from lowest to highest pitch, strings n through 1. E.g., "xo221o". See details.

id

character, the name of the chord in LilyPond readable format, e.g., "a:m". Ignored if x is already a named vector.

Value

a named list.

Details

The chord set list returned by chord_set is only used for top center placement of a full set of chord fretboard diagrams for a music score. chord_set returns a named list. The names are the chords and the list elements are strings defining string and fret fingering readable by LilyPond. Multiple chord positions can be defined for the same chord name. Instruments with a number of strings other than six are not currently supported.

When defining chords, you may also wish to define rests or silent rests for chords that are to be added to a score for placement above the staff in time, where no chord is to be played or explicitly written. Therefore, there are occasions where you may pass chord names and positions that happen to include entries r and/or s as NA as shown in the example. These two special cases are passed through by chord_set but are ignored when the chord chart is generated.

Examples

Run this code
# NOT RUN {
chord_names <- c("e:m", "c", "d", "e:m", "d", "r", "s")
chord_position <- c("xx997x", "x5553x", "x7775x", "ooo22o", "232oxx", NA, NA)
chord_set(chord_position, chord_names)
# }

Run the code above in your browser using DataLab