]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/relative-octaves.yo
release: 1.0.1
[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 fourth, you must specify
41 whether the pitch goes up, using post-quotes:
42
43 verb(
44     c c' % octave up
45     c g' % fourth up 
46 )
47
48 or down, using pre-quotes:
49
50 verb(
51     c c, % octave down
52     c f, % fourth down
53 )
54
55 nsect(CONVERTING)
56
57 To convert a piece of music from the old absolute-octave notation to
58 relative octaves, lilypond provides the bf(-Q, --find-fourths) feature
59 to locate all big intervals in your music (sorry, fully automated convert 
60 is too complex).
61
62 First, edit the .ly file, add "\relative c" to all melodic chunks:
63   
64 verb(
65     foo = \melodic \relative c { ... }
66 )
67
68 and remove all "\octave " commands.  See the example file 
69 file(input/test/find-fourths.ly).
70
71 Use lily to find the fourths
72
73 verb(
74     lilypond -Q find-fourths.ly 2>&1 | tee fourths
75     ...
76     find-fourths.ly:3:18: warning: Interval greater than fourth, relative: g':
77                   c d c f c g
78                               c b, c g, c f, c c'' c
79
80     find-fourths.ly:3:20: warning: Interval greater than fourth, relative: c,:
81                   c d c f c g c
82                                 b, c g, c f, c c'' c
83 )
84
85 Then, load a copy of the original mudela file in your favourite editor, 
86 and let it parse the 'error file' file(intervals).  First you remove all 
87 octavation quotes.  Then, jumping from warning to warning, you enter quotes 
88 as suggested by LilyPond.
89