tabr (version 0.3.5)

interval-helpers: Interval helpers

Description

Helper functions for musical intervals defined by two notes.

Usage

pitch_interval(note1, note2, ignore_octave = FALSE)

scale_interval(note1, note2, format = c("mmp_abb", "mmp", "ad_abb", "ad"), ignore_octave = FALSE)

tuning_intervals(tuning = "standard")

Arguments

note1

character, first note. Must be a single note.

note2

character, second note.

ignore_octave

logical, reduce the interval to that defined by notes within a single octave.

format

character, format of the scale notation: major/minor/perfect, augmented/diminished, and respective abbreviations. See argument options in defaults.

tuning

character, string tuning.

Value

a musical interval, integer or character depending on the function.

Details

Intervals are directional. pitch_interval returns the number of semitones defining the distance between two notes. The interval is negative if note1 has higher pitch than note2. For scale_interval, a character string is returned that provides the named main interval, simple or compound, defined by the two notes. This function will return NA for any uncommon interval not listed in mainIntervals.

See Also

mainIntervals

Examples

Run this code
# NOT RUN {
pitch_interval("b", "c4")
pitch_interval("c,", "d")
scale_interval("c", "e_")
# }

Run the code above in your browser using DataCamp Workspace