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

chord-compareR Documentation

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, ...)

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.

Value

integer for rank and order, character for sort

Examples

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

tabr documentation built on Sept. 12, 2024, 6:18 a.m.