tabr (version 0.4.9)

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

Description

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

Usage

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

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

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

Value

integer for rank and order, character for sort

Arguments

notes

character, a noteworthy string.

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.

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
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