]> git.donarmstrong.com Git - lilypond.git/blob - input/test/beam-dir-function.ly
update syntax in .ly files.
[lilypond.git] / input / test / beam-dir-function.ly
1 \version "1.7.6"
2
3 \header{
4   texidoc="
5
6 There are several ways to calculate the direction of a beam
7
8 @table @samp
9 @item majority
10 number count of up or down notes
11 @item mean
12 mean centre distance of all notes
13 @item median
14 mean centre distance weighted per note
15 @end table
16
17 These beam direction functions are defined in @file{scm/beam.scm}.  If
18 your favourite algorithm isn't one of these, you can hook up your own.
19
20 Of course, this depends on the neutral-direction for the middle line,
21 down by default.  We set that to 1 (up) in the lower staff."  }
22
23 \score {
24   \context PianoStaff <
25     \context Staff \notes \relative c'' {
26       \property Voice.Beam \set #'dir-function = #beam-dir-majority
27       [c8^"down" g]
28       \property Voice.Beam \set #'dir-function = #beam-dir-mean
29       [c^"up" g] 
30       \property Voice.Beam \set #'dir-function = #beam-dir-median
31       [c^"up" g]
32       
33       \time 3/8
34       \property Voice.Beam \set #'dir-function = #beam-dir-majority
35       [c8^"down" c g]
36       \property Voice.Beam \set #'dir-function = #beam-dir-mean
37       [c^"down" c g] 
38       \property Voice.Beam \set #'dir-function = #beam-dir-median
39       [c^"up" c g]
40     }
41     \context Staff=lower \notes \relative c'' {
42       \property Voice.Beam \set #'neutral-direction = #1
43       \property Voice.Beam \set #'dir-function = #beam-dir-majority
44       [d8_"up" a]
45       \property Voice.Beam \set #'dir-function = #beam-dir-mean
46       [d_"down" a] 
47       \property Voice.Beam \set #'dir-function = #beam-dir-median
48       [d_"down" a]
49       
50       \property Voice.Beam \set #'dir-function = #beam-dir-majority
51       \time 3/8
52       [d8_"up" a a]
53       \property Voice.Beam \set #'dir-function = #beam-dir-mean
54       [d_"up" a a] 
55       \property Voice.Beam \set #'dir-function = #beam-dir-median
56       [d_"down" a a] 
57
58     }
59   >
60 }
61
62 %% Local variables:
63 %% LilyPond-indent-level:2
64 %% End:
65 %% new-chords-done %%