Check if chords are major or minor where possible.

chord_is_major(notes)

chord_is_minor(notes)

## Arguments

notes character, a noteworthy string.

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

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)#>  [1]    NA    NA  TRUE FALSE  TRUE FALSE  TRUE FALSE  TRUE  TRUE  TRUEidentical(chord_is_major(x), !chord_is_minor(x))#> [1] TRUE