]> git.donarmstrong.com Git - lilypond.git/blob - scm/auto-beam.scm
patch::: 1.3.103.jcn2
[lilypond.git] / scm / auto-beam.scm
1 ;;;
2 ;;; auto-beam.scm -- Auto-beam-engraver settings
3 ;;;
4 ;;; source file of the GNU LilyPond music typesetter
5 ;;; 
6 ;;; (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 ;;;
8
9 ;;; specify generic beam begin and end times
10
11 ;;; format:
12 ;;;
13 ;;;   function shortest-duration-in-beam time-signature
14 ;;;
15 ;;; where
16 ;;;
17 ;;;     function = begin or end
18 ;;;     shortest-duration-in-beam = numerator denominator; eg: 1 16
19 ;;;     time-signature = numerator denominator, eg: 4 4
20 ;;;
21 ;;; unspecified or wildcard entries for duration or time-signature
22 ;;; are given by * *
23
24 ;;; maybe do:  '(end shortest-1 16 time-3 4) ?
25
26 ;;; in 3 2 time:
27 ;;;   end beams each 1 2 note
28 ;;;   end beams with 16th notes each 1 4 note
29 ;;;   end beams with 32th notes each 1 8 note
30
31 (define auto-beam-settings
32    `(
33      ((end * * 3 2) . ,(make-moment 1 2))
34      ((end 1 16 3 2) . ,(make-moment 1 4))
35      ((end 1 32 3 2) . ,(make-moment 1 8))
36
37      ((begin 1 8 3 4) . ,(make-moment 1 4))
38
39      ((end * * 3 4) . ,(make-moment 3 4))
40      ((begin 1 16 3 4) . ,(make-moment 1 16))
41      ((end 1 16 3 4) . ,(make-moment 1 4))
42      ;;((begin 1 32 3 4) . ,(make-moment 1 8))
43      ((end 1 32 3 4) . ,(make-moment 1 8))
44
45      ((begin 1 16 3 8) . ,(make-moment 1 8))
46      ((end * * 3 8) . ,(make-moment 3 8))
47
48      ;; in common time:
49      ;;   end beams each 1 2 note
50      ;;   end beams with 32th notes each 1 8 note
51      ;;   end beams with 1 8 triplets each 1 4 note
52
53      ((end * * 4 4) . ,(make-moment 1 2))
54      ((end 1 12 4 4) . ,(make-moment 1 4))
55      ((end 1 16 4 4) . ,(make-moment 1 4))
56      ((end 1 32 4 4) . ,(make-moment 1 8))
57
58      ((end * * 2 4) . ,(make-moment 1 4))
59      ((end 1 12 2 4) . ,(make-moment 1 4))
60      ((end 1 16 2 4) . ,(make-moment 1 4))
61      ((end 1 32 2 4) . ,(make-moment 1 8))
62
63
64      ((end * * 4 8) . ,(make-moment 1 4))
65      ((end 1 16 4 8) . ,(make-moment 1 4))
66      ((end 1 32 4 8) . ,(make-moment 1 8))
67
68      ((end * * 4 16) . ,(make-moment 1 8))
69
70      ((end * * 6 8) . ,(make-moment 3 8))
71      ((end 1 16 6 8) . ,(make-moment 3 8))
72      ((end 1 32 6 8) . ,(make-moment 1 8))
73
74      ((end * * 9 8) . ,(make-moment 3 8))
75      ((end 1 16 9 8) . ,(make-moment 3 8))
76      ((end 1 32 9 8) . ,(make-moment 1 8))
77
78      ((end * * 12 8) . ,(make-moment 3 8))
79      ((end 1 16 12 8) . ,(make-moment 3 8))
80      ((end 1 32 12 8) . ,(make-moment 1 8))
81      (meta . ,(element-description  "autoBeamSettings"))
82      ))
83
84 ;;; Users may override in most cases, simply by issuing
85 ;;;
86 ;;;    % from here on consider ending beam every 1 4 note
87 ;;;    \property Voice.autoBeamSettings \push #'(end * * * *) = #(make-moment 1 4)
88 ;;;
89 ;;;    % no autobeaming
90 ;;;    \property Voice.beamAuto = ##f  
91 ;;;
92 ;;; or, more globally, by doing:
93 ;;;
94 ;;; \paper{
95 ;;;        \translator{
96 ;;;            \VoiceContext
97 ;;;            % consider ending beam at every 1 2 note
98 ;;;            autoBeamSettings \push #'(end * * * *) = #(make-moment 1 2)
99 ;;;        }
100 ;;;    }
101 ;;;
102 ;;; see also input test auto-beam-override.ly
103