phrase2: phrase with possibility of anchor points

View source: R/phrase2.R

phrase2R Documentation

phrase with possibility of anchor points

Description

The function phrase2 and its alias p2 extend the function tabr::phrase (and its alias p) with the possibility to insert an anchorpoint of the form '^' or '^n' with 'n' an integer. In this way it is possible When editing/copying a musical score to insert an easily recognisable point that later can be changed in e.g. a bar end.

Usage

phrase2(notes, info = NULL, string = NULL, bar = NULL)

p2(notes, info = NULL, string = NULL, bar = NULL)

Arguments

notes

noteworthy and note info strings. When info = NULL, it is assumed that notes refers to a music object or string formatted as such.

info

noteworthy and note info strings. When info = NULL, it is assumed that notes refers to a music object or string formatted as such.

string

space-delimited character string or vector (or integer vector if simple string numbers). This is an optional argument that specifies which instrument strings to play for each specific timestep. Otherwise NULL.

bar

character or NULL (default). Terminates the phrase with a bar or bar check. See Details. Also see the LilyPond help documentation on bar notation for all the valid options.

Details

See for details the documentation of tabr::phrase.
If an anchorpoint is specified in notes a corresponding info element should be present, but the value is ignored. In the examples 3 notes and 1 anchorpoint are specified in notes and therefore the info parameter must describe 4 elements.

A PR to include this functionality directly in the package tabr was rejected because it did not fit in the overall setup of the package.
Because this function is dependent on the internals of tabr it is sensitive to changes in that package.

Examples

## Not run: 
notes <- "e3 ^ f g"
info  <- "8*4"
phrase2(notes,info,bar= ":|.")
 # <Musical phrase>
 # <e>8 ^ <f>8 <g>8 \bar ":|."

notes <- "e3 ^2 f g"
info  <- "8 1 8 8"
phrase2(notes,info,bar= ":|.")
 # <Musical phrase>
 # <e>8 ^2 <f>8 <g>8 \bar ":|."

## End(Not run)

HanOostdijk/tabraux documentation built on Nov. 17, 2022, 3:02 a.m.