note-summaries: Noteworthy string summaries

note-summariesR Documentation

Noteworthy string summaries

Description

Basic summary functions for noteworthy strings.

Usage

tally_notes(notes, rests = FALSE)

tally_pitches(notes, rests = FALSE)

octaves(notes)

tally_octaves(notes)

distinct_notes(notes, rests = FALSE)

distinct_pitches(notes, rests = FALSE)

distinct_octaves(notes)

pitch_range(notes)

semitone_range(notes)

semitone_span(notes)

octave_range(notes)

octave_span(notes)

Arguments

notes

character, a noteworthy string, space-delimited or vector of individual entries.

rests

logical, include rests r and silent rests s in tally.

Details

These functions provide basic summaries of noteworthy strings.

Returned object depends on the nature of the function. It can be integers, logical, character. Results can be a vector of equal length of a single value summary.

Use the ⁠tally_*⁠ and ⁠distinct_*⁠ functions specifically for summaries of unique elements.

distinct_notes() and distinct_pitches() filter a noteworthy string to its unique elements, respectively. These functions return another noteworthy string.

⁠*_span⁠ functions are just the size of a range, e.g., semitone_range() and semitone_span().

Value

varies by function

See Also

note-checks(), note-metadata(), note-coerce(), valid-notes()

Examples

x <- "r s e_2 a_, c#f#a#"
tally_notes(x)
tally_pitches(x)
octaves(x)
tally_octaves(x)
distinct_notes(x)
distinct_pitches(x)
distinct_octaves(x)

pitch_range(x)
semitone_range(x)
semitone_span(x)
octave_range(x)
octave_span(x)

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