tabr (version 0.3.5)

note-metadata: Noteworthy string metadata

Description

Inspect metadata for noteworthy strings.

Usage

n_steps(notes)

n_notes(notes)

n_chords(notes)

n_octaves(notes)

tally_notes(notes)

tally_pitches(notes)

tally_octaves(notes)

distinct_notes(notes)

distinct_pitches(notes)

distinct_octaves(notes)

pitch_range(notes)

semitone_range(notes)

semitone_span(notes)

octave_range(notes)

octave_span(notes)

octave_type(notes)

accidental_type(notes)

time_format(notes)

is_space_time(notes)

is_vector_time(notes)

Arguments

notes

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

Value

integer or character

Details

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. distinct_notes and distinct_pitches filter a noteworthy string to its unique elements, respectively. These functions return another noteworthy string.

The n_* functions give summary totals of the number of timesteps, number of individual note (non-chord) timesteps, number of chord time steps, and the number of distinct octaves present across timesteps. Use the tally_* and distinct_* functions specifically for summaries of unique elements.

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

Functions pertaining to type or format of a noteworthy string provide information on how a particular string is defined, e.g. time_format.

Examples

Run this code
# NOT RUN {
x <- "e_2 a_, c#f#a#"
n_steps(x)
n_notes(x)
n_chords(x)
n_octaves(x)

tally_notes(x)
tally_pitches(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)

octave_type(x)
accidental_type(x)
time_format(x)
is_space_time(x)
is_vector_time(x)
# }

Run the code above in your browser using DataCamp Workspace