Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 ;;;; default-beam-settings.scm -- Default auto-beam and subdivide-beam settings | 1 ;;;; default-beam-settings.scm -- Default auto-beam and subdivide-beam settings |
2 ;;;; | 2 ;;;; |
3 ;;;; source file of the GNU LilyPond music typesetter | 3 ;;;; source file of the GNU LilyPond music typesetter |
4 ;;;; | 4 ;;;; |
5 ;;;; (c) 2009 Carl Sorensen <c_sorensen@byu.edu> | 5 ;;;; (c) 2009 Carl Sorensen <c_sorensen@byu.edu> |
6 | 6 |
7 ;;; specify default beaming rules | 7 ;;; specify default beaming rules |
8 | 8 |
9 ;;; format: | 9 ;;; format: |
10 ;;; | 10 ;;; |
(...skipping 27 matching lines...) Expand all Loading... | |
38 (((2 . 8) end) . ((* . (1 1)))) | 38 (((2 . 8) end) . ((* . (1 1)))) |
39 (((2 . 16) end) . ((* . (1 1)))) | 39 (((2 . 16) end) . ((* . (1 1)))) |
40 | 40 |
41 ;; in 3 2 time: | 41 ;; in 3 2 time: |
42 ;; default: end beams on beats | 42 ;; default: end beams on beats |
43 ;; end beams with 32nd notes each 1 4 beat | 43 ;; end beams with 32nd notes each 1 4 beat |
44 (((3 . 2) end) . | 44 (((3 . 2) end) . |
45 ((* . (1 1 1)) | 45 ((* . (1 1 1)) |
46 ((1 . 32) . (8 8 8 8 8 8)))) | 46 ((1 . 32) . (8 8 8 8 8 8)))) |
47 | 47 |
48 ;; in 3 4 time: | 48 ;; in 3 4 time: |
Neil Puttock
2009/07/22 23:23:04
decided not to restore original setting?
| |
49 ;; default: end beams on beats | 49 ;; default: end beams on beats |
50 ;; group 1/8 note beams on measure | 50 ;; group 1/8 note beams on measure |
51 (((3 . 4) end) . ((* . (1 1 1)) | 51 (((3 . 4) end) .((* . (3)) |
52 ((1 . 8) . (6)))) | 52 ((1 16) . (4 4 4)) |
53 ((1 32) . (8 8 8)) | |
54 ((1 64) . (16 16 16)) | |
55 ((1 128) . (32 32 32)))) | |
53 | 56 |
54 ;; in 3 8 and 3 16 time time: | 57 ;; in 3 8 and 3 16 time time: |
55 ;; default: group on 3 | 58 ;; default: group on 3 |
56 (((3 . 8) end) . ((* . (3)))) | 59 (((3 . 8) end) . ((* . (3)))) |
57 (((3 . 16) end) . ((* . (3)))) | 60 (((3 . 16) end) . ((* . (3)))) |
58 | 61 |
59 ;; in 4 2 time: | 62 ;; in 4 2 time: |
60 ;; default: end beams on beats | 63 ;; default: end beams on beats |
61 ;; end beams with 16th notes each 1 4 beat | 64 ;; end beams with 16th notes each 1 4 beat |
62 ;; end beams with 32nd notes each 1 8 beat | 65 ;; end beams with 32nd notes each 1 8 beat |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 | 148 |
146 ;; in 5 8 time: | 149 ;; in 5 8 time: |
147 ;; default: group (3 2) | 150 ;; default: group (3 2) |
148 (((5 . 8) end) . ((* . (3 2)))) | 151 (((5 . 8) end) . ((* . (3 2)))) |
149 | 152 |
150 ;; in 8 8 time: | 153 ;; in 8 8 time: |
151 ;; default: group (3 3 2) | 154 ;; default: group (3 3 2) |
152 (((8 . 8) end) . ((* . (3 3 2)))) | 155 (((8 . 8) end) . ((* . (3 3 2)))) |
153 )) ; end of alist definition | 156 )) ; end of alist definition |
154 | 157 |
155 ;;;; Functions for overriding beam settings | 158 ;;; Functions for overriding beam settings |
Neil Puttock
2009/07/22 23:23:04
indentation of function bodies
| |
156 ;;; | 159 ;;; |
157 | 160 |
158 (define (overridden-property-alist context property setting value) | 161 (define (overridden-property-alist context property setting value) |
159 "Return an alist containing the current @{context} value of | 162 "Return an alist containing the current @{context} value of |
160 @code{property} overriden by @code{(setting . value)}. " | 163 @code{property} overriden by @code{(setting . value)}. " |
161 (cons (cons setting value) (ly:context-property context property))) | 164 (cons (cons setting value) (ly:context-property context property))) |
162 | 165 |
163 (define-public (override-property-setting context property setting value) | 166 (define-public (override-property-setting context property setting value) |
164 "Like the C++ code that executes \\override, but without type | 167 "Like the C++ code that executes \\override, but without type |
165 checking. " | 168 checking. " |
166 (ly:context-set-property! | 169 (ly:context-set-property! |
167 context property | 170 context property |
168 (overridden-property-alist context property setting value))) | 171 (overridden-property-alist context property setting value))) |
169 | 172 |
170 (define (revert-property-setting context property setting) | 173 (define (revert-property-setting context property setting) |
171 "Like the C++ code that executes \revert, but without type | 174 "Like the C++ code that executes \revert, but without type |
172 checking. " | 175 checking. " |
173 | 176 |
174 (define (revert-member alist entry new) | 177 (define (revert-member alist entry new) |
175 "Return ALIST, with ENTRY removed. ALIST is not modified, instead | 178 "Return ALIST, with ENTRY removed. ALIST is not modified, instead |
176 a fresh copy of the list-head is made." | 179 a fresh copy of the list-head is made." |
177 (cond | 180 (cond |
178 ((null? alist) new) | 181 ((null? alist) new) |
179 ((equal? (car alist) entry) (revert-member (cdr alist) entry new)) | 182 ((equal? (car alist) entry) (revert-member (cdr alist) entry new)) |
180 (else (revert-member (cdr alist) entry (cons (car alist) new))))) | 183 (else (revert-member (cdr alist) entry (cons (car alist) new))))) |
181 | 184 |
182 (ly:context-set-property! | 185 (ly:context-set-property! |
183 context property | 186 context property |
184 (revert-member (ly:context-property context property) setting '()))) | 187 (revert-member (ly:context-property context property) setting '()))) |
185 | 188 |
186 (define-public (override-beam-setting | 189 (define-public (override-beam-setting |
187 time-signature rule-type rule . rest) | 190 time-signature rule-type rule . rest) |
188 "Override the beam settings for the context in @var{rest}, | 191 "Override the beam settings for the context in @var{rest}, |
189 for @var{time-signature} and @var{rule-type}, with the | 192 for @var{time-signature} and @var{rule-type}, with the |
190 new rule alist @var{rule}. " | 193 new rule alist @var{rule}. " |
191 (define (make-setting c) | 194 (define (make-setting c) |
192 (let ((new-settings | 195 (let ((new-settings |
193 (overridden-property-alist | 196 (overridden-property-alist |
194 c | 197 c |
195 'beamSettings | 198 'beamSettings |
196 (list time-signature rule-type) | 199 (list time-signature rule-type) |
197 rule))) | 200 rule))) |
198 (ly:context-set-property! c 'beamSettings new-settings))) | 201 (ly:context-set-property! c 'beamSettings new-settings))) |
199 | 202 |
200 (let ((music-to-export | 203 (let ((music-to-export |
201 (context-spec-music | 204 (context-spec-music |
202 (make-apply-context make-setting) | 205 (make-apply-context make-setting) |
203 (if (and (pair? rest) (symbol? (car rest))) | 206 (if (and (pair? rest) (symbol? (car rest))) |
204 (car rest) | 207 (car rest) |
205 'Voice)))) | 208 'Voice)))) |
206 (ly:export music-to-export))) | 209 (ly:export music-to-export))) |
207 | 210 |
208 (define-public (score-override-beam-setting | 211 (define-public (score-override-beam-setting |
209 time-signature rule-type rule) | 212 time-signature rule-type rule) |
210 (override-beam-setting | 213 (override-beam-setting |
211 time-signature rule-type rule 'Score)) | 214 time-signature rule-type rule 'Score)) |
212 | 215 |
213 (define-public (revert-beam-setting | 216 (define-public (revert-beam-setting |
214 time-signature rule-type . rest) | 217 time-signature rule-type . rest) |
215 (ly:export | 218 (ly:export |
216 (context-spec-music | 219 (context-spec-music |
217 (make-apply-context | 220 (make-apply-context |
218 (lambda (c) | 221 (lambda (c) |
219 (revert-property-setting | 222 (revert-property-setting |
220 c | 223 c |
221 'beamSettings | 224 'beamSettings |
222 (list time-signature rule-type)))) | 225 (list time-signature rule-type)))) |
223 (if (and (pair? rest) (symbol? (car rest))) | 226 (if (and (pair? rest) (symbol? (car rest))) |
224 (car rest) | 227 (car rest) |
225 'Voice)))) | 228 'Voice)))) |
LEFT | RIGHT |