X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fauto-beam.scm;h=9ba08705ef0102cab09683c8e2747411f7a23704;hb=HEAD;hp=176f9a496baffbce18c58f0327a24643554883d0;hpb=1d25e8fff80c70dce8064fb535f7d72479b251ed;p=lilypond.git diff --git a/scm/auto-beam.scm b/scm/auto-beam.scm index 176f9a496b..9ba08705ef 100644 --- a/scm/auto-beam.scm +++ b/scm/auto-beam.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2000--2012 Jan Nieuwenhuizen +;;;; Copyright (C) 2000--2015 Jan Nieuwenhuizen ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -38,12 +38,12 @@ (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 <=)) @@ -64,7 +64,7 @@ (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)) @@ -95,7 +95,7 @@ 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