X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fbeam.scm;h=6698e1fd623339236d1902ae655ada2774c02e60;hb=b4499a5881bb1fcc2a4ec3270aafb23303effde8;hp=f3d0de99517db0f091647a15c8c92307c21d6864;hpb=46c5beb169abbc5a03bd57562cda1669640e4c72;p=lilypond.git diff --git a/scm/beam.scm b/scm/beam.scm index f3d0de9951..6698e1fd62 100644 --- a/scm/beam.scm +++ b/scm/beam.scm @@ -29,6 +29,11 @@ ;; ;; We have our doubts, so we simply provide all sensible alternatives. + +;; +; +; DOCME: what goes into this func, what comes out. + (define (dir-compare up down) (sign (- up down))) @@ -36,7 +41,14 @@ (define (beam-dir-majority count total) (dir-compare (car count) (cdr count))) -(beam-dir-majority '(0 . 0) '(0 . 0)) +(define (beam-dir-majority-median count total) + "First try majority. If that doesn't work, try median." + (let ((maj (dir-compare (car count) (cdr count)))) + (if (not (= maj 0)) + maj + (beam-dir-median count total)) + )) + (define (beam-dir-mean count total) (dir-compare (car total) (cdr total)))