tabr (version 0.3.5)

lilypond: Save score to LilyPond file

Description

Write a score to a LilyPond format (.ly) text file for later use by LilyPond or subsequent editing outside of R.

Usage

lilypond(score, file, key = "c", time = "4/4", tempo = "2 = 60",
  header = NULL, string_names = NULL, paper = NULL, endbar = TRUE,
  midi = TRUE, path = NULL)

Arguments

score

a score object.

file

character, LilyPond output file ending in .ly. May include an absolute or relative path.

key

character, key signature, e.g., c, b_, f#m, etc.

time

character, defaults to "4/4".

tempo

character, defaults to "2 = 60".

header

a named list of arguments passed to the header of the LilyPond file. See details.

string_names

label strings at beginning of tab staff. NULL (default) for non-standard tunings only, TRUE or FALSE for force on or off completely.

paper

a named list of arguments for the LilyPond file page layout. See details.

endbar

character, the end bar.

midi

logical, add midi inclusion specification to LilyPond file.

path

character, optional output directory prefixed to file, may be an absolute or relative path. If NULL (default), only file is used.

Value

nothing returned; a file is written.

Details

All header list elements are character strings. The options for header include:

  • title

  • subtitle

  • composer

  • album

  • arranger

  • instrument

  • meter

  • opus

  • piece

  • poet

  • copyright

  • tagline

All paper list elements are numeric except page_numbers, which is logical. The options for paper include:

  • textheight

  • linewidth

  • indent

  • first_page_number

  • page_numbers

  • fontsize

See Also

tab, midily,

Examples

Run this code
# NOT RUN {
x <- phrase("c ec'g' ec'g'", "4 4 2", "5 432 432")
x <- track(x)
x <- score(x)
outfile <- file.path(tempdir(), "out.ly")
lilypond(x, outfile)
# }

Run the code above in your browser using DataLab