LEFT | RIGHT |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 (parameterize ((*indent* 0) | 226 (parameterize ((*indent* 0) |
227 (*previous-duration* (ly:make-duration 2)) | 227 (*previous-duration* (ly:make-duration 2)) |
228 (*force-duration* force-duration)) | 228 (*force-duration* force-duration)) |
229 (display (music->lily-string expr parser)) | 229 (display (music->lily-string expr parser)) |
230 (newline))) | 230 (newline))) |
231 | 231 |
232 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 232 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
233 | 233 |
234 (define-public (shift-one-duration-log music shift dot) | 234 (define-public (shift-one-duration-log music shift dot) |
235 "Add @var{shift} to @code{duration-log} of @code{'duration} in | 235 "Add @var{shift} to @code{duration-log} of @code{'duration} in |
236 @var{music} and optionally @var{dot} to any note encountered. This | 236 @var{music} and optionally @var{dot} to any note encountered. |
237 scales the music up by a factor `2^@var{shift} * (2 - (1/2)^@var{dot})'." | 237 The number of dots in the shifted music may not be less than zero." |
238 (let ((d (ly:music-property music 'duration))) | 238 (let ((d (ly:music-property music 'duration))) |
239 (if (ly:duration? d) | 239 (if (ly:duration? d) |
240 (let* ((cp (ly:duration-factor d)) | 240 (let* ((cp (ly:duration-factor d)) |
241 (nd (ly:make-duration | 241 (nd (ly:make-duration |
242 (+ shift (ly:duration-log d)) | 242 (+ shift (ly:duration-log d)) |
243 (max 0 (+ dot (ly:duration-dot-count d))) | 243 (max 0 (+ dot (ly:duration-dot-count d))) |
244 (car cp) | 244 (car cp) |
245 (cdr cp)))) | 245 (cdr cp)))) |
246 (set! (ly:music-property music 'duration) nd))) | 246 (set! (ly:music-property music 'duration) nd))) |
247 music)) | 247 music)) |
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 (define-public (event-chord-notes event-chord) | 1546 (define-public (event-chord-notes event-chord) |
1547 "Return a list of all notes from @var{event-chord}." | 1547 "Return a list of all notes from @var{event-chord}." |
1548 (filter | 1548 (filter |
1549 (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name))) | 1549 (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name))) |
1550 (ly:music-property event-chord 'elements))) | 1550 (ly:music-property event-chord 'elements))) |
1551 | 1551 |
1552 (define-public (event-chord-pitches event-chord) | 1552 (define-public (event-chord-pitches event-chord) |
1553 "Return a list of all pitches from @var{event-chord}." | 1553 "Return a list of all pitches from @var{event-chord}." |
1554 (map (lambda (x) (ly:music-property x 'pitch)) | 1554 (map (lambda (x) (ly:music-property x 'pitch)) |
1555 (event-chord-notes event-chord))) | 1555 (event-chord-notes event-chord))) |
LEFT | RIGHT |