]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/relative-octaves.yo
41a97dd997f9223ebd7c5684b34096b080afb587
[lilypond.git] / Documentation / relative-octaves.yo
1 nsect(NAME)
2
3 Octaves --  how to do pitches
4
5 nsect(DESCRIPTION)
6
7 The LilyPond input language, Mudela (help, silly name), should be easy
8 to read and write.  In my experience Mudela is already quite convenient 
9 for entering music.  Every time I've entered a substantial piece of music, 
10 however, I found that I made quite a few mistakes.  The MIDI output helps 
11 a lot with locating and correcting the errors.  There's one type of error 
12 that seems to be frequent, stubborn and hard to catch, and that's the
13 octavation error.  The relative octave feature is an attempt to make
14 Mudela a bit easier to write.  In addition, this feature makes it harder 
15 to make octavation mistakes, yet if you made one, its a lot simpler to find 
16 and correct.
17
18 Here's how it works.  
19
20 itemize(
21 it()forget the old "\octave c';" command
22 it()forget the old octave boundaries with octaves c .. c'
23 )
24
25 You can enter a piece of music in relative mode, by typing
26
27 verb(
28     \melodic \relative c { ... }
29 )
30
31 From then on, the pitch of a note will be the closest to the last one,
32 assuming that large intervals are a lot more rare than small ones. 
33 Thus, you can enter a scale without using octavation quotes:
34
35 verb(
36     c d e f g a b c
37 )
38
39 the last c being an octave higher than the first.  If you have to
40 enter an interval that is greater than a fifth, you must specify
41 whether the pitch goes up, using post-quotes:
42
43 verb(
44     c c' % octave up
45     c g' % fifth up 
46 )
47
48 or down, using pre-quotes:
49
50 verb(
51     c c, % octave down
52     c f, % fifth down
53 )
54
55 nsect(CONVERTING)
56
57 COMMENT(Old? don't understand  -- jcn
58 To convert a piece of music from the old absolute-octave notation to
59 )
60 To convert a piece of music from absolute-octave notation to
61 relative octaves, lilypond provides the bf(-Q, --find-old-relative)
62 COMMENT(
63 urg, name was changed to 'old-relative'?  It simply helps convert
64 from absolute to relative, ie handy for mi2mu output?
65 )
66 feature to locate all big intervals in your music.
67
68 First, edit the .ly file, add "\relative c" to all melodic chunks:
69   
70 verb(
71     foo = \melodic \relative c { ... }
72 )
73
74 and remove all "\octave " commands.  See the example file 
75 file(input/test/find-fifths.ly).
76
77 Use lily to find the fifths:
78
79 verb(
80     lilypond -Q find-fifths.ly 2>&1 | tee fifths
81     ...
82     find-fifths.ly:3:18: warning: Interval greater than fourth, relative: g':
83                   c d c f c g
84                               c b, c g, c f, c c'' c
85
86     find-fifths.ly:3:20: warning: Interval greater than fourth, relative: c,:
87                   c d c f c g c
88                                 b, c g, c f, c c'' c
89 )
90
91 Then, load a copy of the original mudela file in your favourite editor, 
92 and let it parse the 'error file' file(intervals).  First you remove all 
93 octavation quotes.  Then, jumping from warning to warning, you enter quotes 
94 as suggested by LilyPond.
95