repeats | R Documentation |
Create a repeat section in LilyPond readable format.
rp(phrase, n = 1)
pct(phrase, n = 1, counter = FALSE, step = 1, reset = TRUE)
volta(phrase, n = 1, endings = NULL, silent = FALSE)
phrase |
a phrase object or equivalent string to be repeated. |
n |
integer, number of repeats of |
counter |
logical, if |
step |
integer, print the measure percent repeat counter above the
staff only at every |
reset |
logical, percent repeat |
endings |
a single phrase or a list of phrases, alternate endings. |
silent |
if |
These functions wraps a phrase object or a character string in LilyPond
repeat syntax. The most basic is rp()
for basic wrapping a LilyPond
unfold
repeat tag around a phrase. This repeats the phrase n
times, but
it is displayed in the engraved sheet music fully written out as a literal
propagation of the phrase with no repeat notation used to reduce redundant
presentation. The next is pct()
, which wraps a percent()
repeat tag
around a phrase. This is displayed in sheet music as percent repeat notation
whose specific notation changes based on the length of the repeated section
of music, used for beats or whole measures. volta()
wraps a phrase in a
volta()
repeat tag, used for long repeats of one or more full measures or
bars of music, optionally with alternate endings.
Note that basic strings should still be interpretable as a valid musical
phrase by LilyPond and such strings will be coerced to the phrase class by
these functions. For example, a one-measure rest, "r1"
, does not need to be
a phrase object to work with these functions, nor does any other character
string explicitly written out in valid LilyPond syntax. As always, see the
LilyPond documentation if you are not familiar with LilyPond syntax.
VOLTA REPEAT: When silent = TRUE
there is no indication of the number
of plays above the staff at the start of the volta section. This otherwise
happens automatically when the number of repeats is greater than one and no
alternate endings are included (which are already numbered).
This override creates ambiguity on its own, but is important to use multiple
staves are present and another staff already displays the text regarding the
number or plays. This prevents printing the same text above every staff.
PERCENT REPEAT: As indicated in the parameter descriptions, the arguments
counter
and step
only apply to full measures or bars of music.
It does not apply to shorter beats that are repeated using pct()
.
a phrase.
phrase()
x <- phrase("c ec'g' ec'g'", "4 4 2", "5 432 432")
e1 <- phrase("a", 1, 5) # ending 1
e2 <- phrase("b", 1, 5) # ending 2
rp(x) # simple unfolded repeat, one repeat or two plays
rp(x, 3) # three repeats or four plays
pct(x) # one repeat or two plays
pct(x, 9, TRUE, 5) # 10 plays, add counter every 5 steps
pct(x, 9, TRUE, 5, FALSE) # as above, but do not reset counter settings
volta(x) # one repeat or two plays
volta(x, 1, list(e1, e2)) # one repeat with alternate ending
volta(x, 4, list(e1, e2)) # multiple repeats with only one alternate ending
volta(x, 4) # no alternates, more than one repeat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.