lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with learning lilypond


From: Simon Mackenzie
Subject: Re: problems with learning lilypond
Date: Sun, 09 Aug 2009 21:05:41 +0700

Hope this helps to clarity things for you...

I have been looking at ways to tidy up my lilypond scripts. So, I've made an attempt to follow the good supply of examples in the various lilypond documents.
One adapted suggestion I've sourced from the Lilypond Learning Manual (5.1.3) runs as follows...

MUSICBOOK.ly contains the list of all music sheets for the music book.
CHORDSNOTES_###.ly contains the chords and notes for an individual music sheet. I may yet separate this into two files, say CHORDS_###;ly and NOTES_###.ly.
SHEET_###.ly contains an individual music sheet. And here I may yet also separate out the lyrics into an individual file, LYRICS_###.ly. 

By taking this approach I feel each individual SHEET_###.ly is clear and concise to read. With the music separated into individual files I can have a person working on chords / notes and another working on the lyrics and yet another linking all the parts together. All in parallel.

By re-assigning the variables "lyricsOne" to "n" (where "n" is the maximum number of lyrics appearing in any one music sheet for the entire book, so far 5) as well as the "notes" and "chords" variables for each music sheet I can save myself having to make 1000+ global declarations with assignments at the top level scope in my MUSICBOOK.ly. Converting 300+ music sheets and an average around 3+ verses per music sheet. Cumbersome and messy to manage. I should also add here that I am reusing the CHORDSNOTES_###.ly with lyrics in additional languages, currently two languages (Thai and Lua') but this could go as high as 5 languages (Thai, Lua', Akha, Lahu and English). Thus saving myself one hugh amount of typing.

So again my question is, how can I assign a new value to a variable so I can make all this happen and keep my global declarations / assignments to an absolute minimum and meet my goal of ensuring good clarity in my lilypond code for whomever inherits my project in the future?

=== Start - MUSICBOOK.ly ======
\version "blah blah"
\include "init/init-macros.ly"
\include "init/init-common.ly"
/book {
\bookpart {
\inlcude "music/SHEET_061.ly"
}
\bookpart {
\include "music/SHEET_62.ly"
}

...
}
=== End - MUSICBOOK.ly ======

=== Start - SHEET_061.ly ======
\version "blah blah"
\header { }
\page { }
\include "CHORDSNOTES_061.ly" % Currently this include will fail because I need to declare variables at the top level scope. I.e. outside all existing brackets.
lyricsOne = \lyricmode { % will probably also separate out the lyrics into a separate file for each sheet to aid clarity.
\set stanza = "1. "
ชี -- วิต
เรา พระ เจ้า ทรง สร้าง
เป็น หน
ทาง ให้ ไป สู่ ส --
วรรค์ ความ กา --
...
ชัย อ -- ภัย พวก
เรา ความ ซึม
เศร้า พวก เรา หาย
ไป
}
lyricsTwo = \lyricmode {
\set stanza = "2. "
จะ มี
ใคร ที่ ไหน กัน เล่า
นำ พวก
เรา ช่วย ประ ชา รอด
พ้น ทำ ความ 
...
เอ่ย ไม่ เคย เลย ลืม พวก
เรา
}
\score {
<<
\new ChordNames { \chords }
\new Voice = "one" { \notes }
\new Lyrics \lyricsto "one" \lyricsOne
\new Lyrics \lyricsto "one" \lyricsTwo
>>
\layout { }
\midi { }
}
=== End - SHEET_061.ly ======

=== Start - CHORDSNOTES_061.ly ======
\version "blah blah"
chords = \chordmode {
s8 s8 
c4.:m s8 s4 s8 s8 
s2. s8 s8 
ees4. s8 s4 s8 s8 
c2.:m s8 s8 
...
f4.:m s8 s4 s8 s8
c2:m s4 s4
f4.:m s8 s4 s8 s8
c1:m
}
notes = \relative c'' {
\key c \minor
\fractionalTime
\time 4/4
\clef "treble"
\partial 8*2
g8[ b8] |
g4. b8 f4 e8[ e8]( |
c2.) g'8[ b8] |
g4. c8 b4 e,8[ f8] |
g2. c8[ c8] | \break

...
f4. e8 c4 e8[( b8)] |
c2 f4 f4 |
f4. e8 c4 b8[( e8)] |
c1 | \bar "|."
}
=== End - CHORDSNOTES_061.ly ======

Cheers
Simon


On 08/08/2009, at 22:30, Tim McNamara wrote:


On Aug 8, 2009, at 8:54 AM, Simon Mackenzie wrote:

Here is my scenario

If I create a variable at the top scope how do I reassign its value in a subsequent scope eg.

aVariable = \markup { \bold bananas }

\book {
\bookpart {
\aVariable % "bananas"
\score {
aVariable = \markup { \bold now \italic { equals this string } % want to be to reassign aVariable a new value so that...
\aVariable % "now equals this string"
}
}
}

Why do you want to change the value of "\aVariable"?  That doesn't make any sense to me.


_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]