;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 2000--2014 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 2000--2015 Jan Nieuwenhuizen <janneke@gnu.org>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
(let ((value (ly:context-property context name)))
(if (not (null? value)) value default)))
- (define (ending-moments group-list start-beat base-length)
- (if (null? group-list)
- '()
- (let ((new-start (+ start-beat (car group-list))))
- (cons (* new-start base-length)
- (ending-moments (cdr group-list) new-start base-length)))))
+ (define (ending-moments group-list base-length)
+ (let ((beat 0))
+ (map-in-order (lambda (x)
+ (set! beat (+ beat x))
+ (* base-length beat))
+ group-list)))
(define (larger-setting type sorted-alist)
(assoc type sorted-alist <=))
(time-signature-fraction
(get 'timeSignatureFraction '(4 . 4)))
(beat-structure (get 'beatStructure '(1 1 1 1)))
- (beat-endings (ending-moments beat-structure 0 base-length))
+ (beat-endings (ending-moments beat-structure base-length))
(exceptions (sort (map
(lambda (a)
(if (pair? (car a))
type))
(exception-moments (and exception-grouping
(ending-moments
- exception-grouping 0 grouping-moment))))
+ exception-grouping grouping-moment))))
(if (= dir START)
;; Start rules -- #t if beam is allowed to start