simplify_phrase: Simplify the LilyPond syntax of a phrase

View source: R/phrase.R

simplify_phraseR Documentation

Simplify the LilyPond syntax of a phrase

Description

This function can be used to simplify the LilyPond syntax of a phrase. Not intended for direct use. See details.

Usage

simplify_phrase(phrase)

Arguments

phrase

a phrase object.

Details

This function not intended to be used directly, but is available so that you can see how LilyPond syntax for phrases will be transformed by default in the process of creating a LilyPond file. This function is used by the lilypond() function and associated ⁠render_*⁠ functions. When using lilypond() directly, this can be controlled by the simplify argument.

The result of this function is a character string containing simpler, more efficient LilyPond syntax. It can be coerced back to a phrase with as_phrase(), but its print method colors will no longer display properly. More importantly, this simplification removes any possibility of transforming the phrase back to its original inputs. The more complex but nicely structured original representation does a better job at maintaining reasonable possibility of one to one transformation between a phrase object and the inputs that it was built from.

Value

character

Examples

notes <- "a~ a b c' c'e'g'~ c'e'g'"
info <- "8.. 8..-. 8- 8-^ 4.^ 4."
(x <- p(notes, info))
as_phrase(simplify_phrase(x))

(x <- p(notes, info, 5))
as_phrase(simplify_phrase(x))

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