tabr (version 0.3.5)

chord-compare: Rank, order and sort chords and notes

Description

Rank, order and sort chords and notes by various definitions.

Usage

chord_rank(chords, pitch = c("min", "mean", "max"), ...)

chord_order(chords, pitch = c("min", "mean", "max"), ...)

chord_sort(chords, pitch = c("min", "mean", "max"), decreasing = FALSE, ...)

Arguments

chords

character, a noteworthy string, may include individual notes and chords.

pitch

character, how ranking of chords is determined; lowest pitch, mean pitch, or highest pitch.

...

additional arguments passed to rank or order.

decreasing

logical, sort in decreasing order.

Value

integer for rank and order, character for sort

Details

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.

Examples

Run this code
# NOT RUN {
x <- "a2 c a2 ceg ce_g cea"
chord_rank(x, "min")
chord_rank(x, "max")
chord_rank(x, "mean")

chord_order(x)
chord_order(x, "mean")
chord_sort(x, "mean")
# }

Run the code above in your browser using DataLab