]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/beam.scm
release commit
[lilypond.git] / scm / beam.scm
index f3d0de99517db0f091647a15c8c92307c21d6864..b1b1b6a9f3b134bb69fafb509b449301680f6e9c 100644 (file)
@@ -3,13 +3,13 @@
 ;;;;
 ;;;; source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2000--2001 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;
 
 ;;
 ;; width in staff space.
 ;;
-(define (default-beam-flag-width-function type)
+(define (beam-flag-width-function type)
   (cond
    ((eq? type 1) 1.98) 
    ((eq? type 1) 1.65) ;; FIXME: check what this should be and why
 ;;     
 ;; 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)))
 
 ;; arguments are in the form (up . down)
-(define (beam-dir-majority count total)
+(define-public (beam-dir-majority count total)
   (dir-compare (car count) (cdr count)))
 
-(beam-dir-majority '(0 . 0) '(0 . 0))
+(define-public (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)
+(define-public (beam-dir-mean count total)
   (dir-compare (car total) (cdr total)))
 
-(define (beam-dir-median count total)
+(define-public (beam-dir-median count total)
   (if (and (> (car count) 0)
           (> (cdr count) 0))
       (dir-compare (/ (car total) (car count)) (/ (cdr total) (cdr count)))