09.09.2013 Views

LilyPond Beginnershandleiding

LilyPond Beginnershandleiding

LilyPond Beginnershandleiding

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Hoofdstuk 3: Fundamentele concepten 79<br />

We begin with a header section. Here go the title, name of composer, etc, then come any<br />

variable definitions, and finally the score block. Let’s start with these in outline and fill in the<br />

details later.<br />

We’ll use the first two bars of Bach’s prelude based on Jesu, meine Freude which is written<br />

for two manuals and pedal organ. You can see these two bars of music at the bottom of this<br />

section. The top manual part has two voices, the lower and pedal organ one each. So we need<br />

four music definitions and one to define the time signature and key:<br />

\version "2.17.21"<br />

\header {<br />

title = "Jesu, meine Freude"<br />

composer = "J S Bach"<br />

}<br />

keyTime = { \key c \minor \time 4/4 }<br />

ManualOneVoiceOneMusic = { s1 }<br />

ManualOneVoiceTwoMusic = { s1 }<br />

ManualTwoMusic = { s1 }<br />

PedalOrganMusic = { s1 }<br />

\score {<br />

}<br />

For now we’ve just used a spacer note, s1, instead of the real music. We’ll add that later.<br />

Next let’s see what should go in the score block. We simply mirror the staff structure we<br />

want. Organ music is usually written on three staves, one for each manual and one for the pedals.<br />

The manual staves should be bracketed together, so we need to use a PianoStaff for them. The<br />

first manual part needs two voices and the second manual part just one.<br />

\new PianoStaff % end ManualOne Staff context<br />

\new Staff = "ManualTwo" > % end ManualTwo Staff context<br />

>> % end PianoStaff context<br />

Next we need to add a staff for the pedal organ. This goes underneath the PianoStaff, but it<br />

must be simultaneous with it, so we need angle brackets around the two. Missing these out would<br />

generate an error in the log file. It’s a common mistake which you’ll make sooner or later! Try<br />

copying the final example at the end of this section, remove these angle brackets, and compile<br />

it to see what errors it generates.<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!