tabr (version 0.3.5)

chord_is_major: Check if chords are major or minor

Description

Check if chords are major or minor where possible.

Usage

chord_is_major(chords)

chord_is_minor(chords)

Arguments

chords

character, a noteworthy string.

Value

logical vector

Details

These functions operate based only on ordered pitches. They do not recognize what a human might interpret and name an inverted chord with a root other than the lowest pitch. This imposes limitations on the utility of these functions, which scan the intervals for a minor or major third in a chord whose notes are sorted by pitch.

In several cases including single notes or no major or minor third interval present, NA is returned. TRUE or FALSE is only returned if such an interval is present. If more than one is present, it is based on the lowest in pitch. It prioritizes major/minor and minor/major adjacent intervals (recognizing a common triad). If these do not occur adjacent, the lowest third is selected. This is still imperfect, but a useful method. Second and higher unknown chord inversions are problematic.

Examples

Run this code
# NOT RUN {
x <- "c cg, ce ce_ ceg ce_gb g,ce g,ce_ e_,g,c e_,g,ce_ e_,g,c"
chord_is_major(x)
identical(chord_is_major(x), !chord_is_minor(x))
# }

Run the code above in your browser using DataLab