Providing LilyPond compatible input
A function (in development!) that writes a file to be processed by LilyPond by extracting the relevant information (e.g. pitch, length, ...) from columns of a data frame. The music notation software LilyPond can “transcribe” such an input file into sheet music.
lilyinput(X, file = "Rsong.ly", Major = TRUE, key = "c", clef = c("treble", "bass", "alto", "tenor"), time = "4/4", endbar = TRUE, midi = TRUE, tempo = "2 = 60", textheight = 220, linewidth = 150, indent = 0, fontsize = 14)
A data frame containing 4 named components (columns):
note: Integer - the notes' pitch in halftones from diapason (a), i.e. 0 for diapason a, 3 for c', ...
duration: Integer - denominator of lengths of the notes, e.g. 8 for a quaver.
punctate: Logical - whether to punctate a note.
slur: Logical -
TRUEindicates to start a slur, or to end it. That means that the first, third, ... occurences of
TRUEstart slurps, while the second, fourth, ... occurences end slurps. Note that it is only possible to draw one slur at a time.
The file to be written for LilyPond's input.
Logical indicating major key (if
TRUE) or minor key.
Keynote, necessary to set sharps/flats.
Integer indicating the kind of clef, supported are
Character indicating which meter to use, examples are:
Logical indicating whether to set an ending bar at the end of the sheet music.
Logical indicating whether Midi output (by LilyPond) is desirable.
Character specifying the tempo to be used for the Midi file if
midi = TRUE. The default,
"2 = 60"indicates: 60 half notes per minute, whereas
"4 = 90"indicates 90 quarters per minute.
Textheight of the sheet music to be written by LilyPond.
Linewidth of the sheet music to be written by LilyPond.
Indentation of the sheet music to be written by LilyPond.
Fontsize of the sheet music to be written by LilyPond.
Details will be given when development has reached a stable stage ...!
Nothing is returned, but a
file is written.
This function is in development!!! Everything (and in particular its user interface) is subject to change!!!
The LilyPond development team (2005): LilyPond - The music typesetter. http://www.lilypond.org/, Version 2.7.20.
Preu<df>er, A., Ligges, U. und Weihs, C. (2002): Ein R Exportfilter f<U+32824873> Notations- und Midi-Programm LilyPond. Arbeitsbericht 35. Fachbereich Statistik, Universit<e4>t Dortmund. (german)