register_chord_quality: Register chord quality

register_chord_qualityR Documentation

Register chord quality

Description

This function registers a new chord quality in the database used by the decode_chord_quality function. Unless overwritten, this chord quality will persist for the remainder of the R session.

Usage

register_chord_quality(key, value, overwrite = FALSE)

Arguments

key

(Character scalar) Textual key identifying the chord quality.

value

(Integer vector) Chord quality, provided as an integer vector of non-duplicated pitch classes in ascending order.

overwrite

(Logical scalar) If FALSE, an error will be thrown when trying to redefine a pre-existing key.

Details

If you have some chord qualities to add to the hrep package, please register an issue or submit a pull request at https://github.com/pmcharrison/hrep.

See Also

  • decode_chord_quality for accessing the database.

  • initialise_chord_qualities for resetting the database.

Examples

decode_chord_quality("my_chord") # returns NULL
register_chord_quality("my_chord", c(0, 1, 2))
decode_chord_quality("my_chord") # returns c(0, 1, 2)


pmcharrison/hrep documentation built on Feb. 18, 2024, 2:33 a.m.