tabr (version 0.3.5)

tab: Create tablature

Description

Create sheet music/guitar tablature from a music score.

Usage

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

Arguments

score

a score object.

file

character, output file ending in .pdf or .png. 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, output midi file in addition to tablature.

keep_ly

logical, keep LilyPond file.

path

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

details

logical, set to FALSE to disable printing of log output to console.

Value

nothing returned; a file is written.

Details

Generate a pdf or png of a music score using the LilyPond music engraving program. Output format is inferred from file extension. This function is a wrapper around lilypond, the function that creates the LilyPond (.ly) file.

For Windows users, add the path to the LilyPond executable to the system path variable. For example, if the file is at C:/Program Files (x86)/LilyPond/usr/bin/lilypond.exe, then add C:/Program Files (x86)/LilyPond/usr/bin to the system path.

See Also

lilypond, miditab

Examples

Run this code
# NOT RUN {
if(tabr_options()$lilypond != ""){
  x <- phrase("c ec'g' ec'g'", "4 4 2", "5 432 432")
  x <- track(x)
  x <- score(x)
  outfile <- file.path(tempdir(), "out.pdf")
  tab(x, outfile, details = FALSE) # requires LilyPond installation
}
# }

Run the code above in your browser using DataCamp Workspace