note_ngram: Note/chord n-gram

View source: R/notes.R

note_ngramR Documentation

Note/chord n-gram

Description

Convert a noteworthy string to a list of noteworthy n-grams.

Usage

note_ngram(notes, n = 2, tally = FALSE, rests = FALSE)

Arguments

notes

a noteworthy string.

n

Number of grams. Must be >= 1 and <= number of timesteps in notes.

tally

logical, tally n-grams in a data frame. Otherwise a list.

rests

logical, exclude rests. Affects the number of timesteps.

Value

list of noteworthy objects or a tibble

Examples

x <- as_noteworthy("c r ceg dfa ceg dfa")
note_ngram(x)
(x <- note_ngram(x, tally = TRUE))
x$ngram <- as.character(x$ngram)
x

leonawicz/tabr documentation built on Sept. 24, 2023, 2:49 p.m.