Lilypond is a typesetting system for sheet music (think LaTeX for music). It takes a text format file containing a few commands which tell how the notes are, and produces two things:
1) a very nice pdf of the score
2) a midi file which plays exactly like the score
So basically this can be very useful for educational uses, for example a teacher can write down a few simple songs and obtain a clean score with a corresponding midi file where left and right hand are clearly separated. After some work (detailed below) these midi files can then be used in Pianobooster for exercise.
LilyPond can be obtained here:
http://lilypond.org/web/ (where also full tutorials and docs are available!)
Let's see a sample Lilypond file (everything preceded by a % sign is treated as a comment):
----------------------------------------------------------------------------------------
% the following line tells lilypond to print a header on the sheet
\header{
title = "Some Exercises"
}
% now let us define the variable "right" as a sequence of notes relative to middle c
% notes are specified by the letters, and, if followed by a dash and a number, also fingerings are printed
right= \relative c' {
c-1 e-3 d-2 f-4
c-1 d-2 f-4 e-3
c-1 e-3 f-4 d-2
f-4 e-3 d-2 c-1
e-3 c-1 f-4 d-2
c-1 d-2 e-3 f-4
}
left= \relative c' {
c-1 a-3 b-2 g-4
c-1 b-2 g-4 a-3
c-1 a-3 g-4 b-2
g-4 a-3 b-2 c-1
a-3 c-1 g-4 b-2
c-1 b-2 a-3 g-4
}
% ok, now let us put everything together as a new score with a pianostaff (treble+bass keys)
\score {
\new PianoStaff <<
\set PianoStaff.instrumentName = #"acoustic grand" % specify instrument name for the midi file
\new Staff = "upper" {
\clef treble % print a treble clef
\right % import "right" as defined above
}
\new Staff = "lower" {
\clef bass % print a bass clef
\left % import "left" as defined above
}
>>
\layout{} % this tells lilypond to print the score creating a pdf
\midi{} % this tells lilypond to create a midi file
}
----------------------------------------------------------------------------------------
After saving the above as a text file (lets call it exercise.ly), just run "lilypond exercise.ly" from the command line to compile the file and obtain pdf and midi files.
Looking at the just created midi file, one will notice that it has three channels, called "control" (this is always created, independent of user), "upper" and "lower". Basically, lilypond creates a separate channel for each staff it encounters in the .ly file.
Unfortunately, pianobooster expects midi files with the piano parts on channel 3 (right hand) and 4 (left hand), so in order to obtain a midi file which works fine in PianoBooster, a few changes are necessary. In the .ly file, the part which defines the score has to be modified like this:
----------------------------------------------------------------------------------------
\score {
\new PianoStaff <<
\set PianoStaff.instrumentName = #"acoustic grand" % specify instrument name for the midi file
\new Staff ="" {} % create an empty staff which will go in channel 2 of the midi file
% now we will switch "upper" and "lower", so that "lower" goes in channel 3 and "upper" in channel 4
\new Staff = "lower" {
\clef bass % print a bass clef
\left % import "left" as defined above
}
\new Staff = "upper" {
\clef treble % print a treble clef
\right % import "right" as defined above
}
>>
\layout{} % this tells lilypond to print the score creating a pdf
\midi{} % this tells lilypond to create a midi file
}
----------------------------------------------------------------------------------------
Now compile again and you will have a midi file which works fine in PianoBooster.
There is a large collection of free sheet music on www.mutopiaproject.org, and for each piece there is also the .ly file available, so following the example above it is very easy to convert each piece into a midi file which works fine in PianoBooster.
It would also be nice if someone put up a repository for some simple sheet music to be used for learning purposes with PianoBooster. Also, I hope sooner or later PianoBooster will allow to select midi channels to be used for left and right hand more easily so that nonstandard midi files can be used with this wonderful program more easily.
Cheers
Chris