Rank, order and sort chords and notes by various definitions.
integer for rank and order, character for sort
There are three options for comparing the relative pitch position of chords provided: comparison of the lowest or root note of each chord, the highest pitch note, or taking the mean of all notes in a chord.
x <- "a2 c a2 ceg ce_g cea"
chord_rank(x, "min")
#> [1] 1.5 4.5 1.5 4.5 4.5 4.5
chord_rank(x, "max")
#> [1] 1.5 3.0 1.5 4.5 4.5 6.0
chord_rank(x, "mean")
#> [1] 1.5 3.0 1.5 5.0 4.0 6.0
chord_order(x)
#> [1] 1 3 2 4 5 6
chord_order(x, "mean")
#> [1] 1 3 2 5 4 6
chord_sort(x, "mean")
#> <Noteworthy string>
#> Format: space-delimited time
#> Values: a2 a2 c <ce_g> <ceg> <cea>