R/intervals.R
interval_semitones.Rd
Convert named intervals to numbers of semitones. For a complete list of valid interval names and abbreviations see mainIntervals(). interval may be a vector.
mainIntervals()
interval
interval_semitones(interval)
character, interval ID. See details.
integer
x <- c("minor third", "m3", "augmented second", "A2") y <- c("P1", "m2", "M2", "m3", "M3", "P4", "TT", "P5") interval_semitones(x) #> [1] 3 3 3 3 interval_semitones(y) #> [1] 0 1 2 3 4 5 6 7