Learn R Programming

tabr (version 0.5.1)

note_ngram: 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)

Value

list of noteworthy objects or a tibble

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.

Examples

Run this code
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

Run the code above in your browser using DataLab