-
-(define (attached-to-stem slur dir)
- (let* ((note-columns (get-pointer slur 'note-columns))
- (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
- (stem (get-pointer col 'stem)))
- (and
- (eq? col (get-bound slur dir))
- stem
- (get-pointer stem 'heads))))
-
-
-;; FIXME: document this.
-(define slur-extremity-rules
- (list
- (cons (lambda (slur dir)
- ;; urg, code dup
- (let* ((note-columns (get-pointer slur 'note-columns))
- (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
- (stem (get-pointer col 'stem)))
- (and stem
- (not (= (get-property slur 'direction)
- (get-property stem 'direction)))))) 'head)
-
- (cons (lambda (slur dir)
- ;; if attached-to-stem
- (and (attached-to-stem slur dir)
- ;; and got beam
- ;; urg, code dup
- (let* ((note-columns (get-pointer slur 'note-columns))
- (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
- (stem (get-pointer col 'stem)))
- (and stem
- (get-pointer stem 'beam)
- ;; and beam on same side as slur
- (let ((beaming (get-property stem 'beaming)))
- (if (pair? beaming)
- (<= 1
- (if (= dir -1) (car beaming) (cdr beaming)))
- #f))))))
- 'stem)
-
- (cons (lambda (slur dir) (not (attached-to-stem slur dir))) 'loose-end)
-
- ;; default case, attach to head
- (cons (lambda (x y) #t) 'head)
- ))
-
-
-(define slur-extremity-offset-alist
- '(
- ((head 1 1) . (-0.25 . 0.2))
- ((head 1 -1) . (-0.25 . -0.25))
- ((head -1 1) . (-0.25 . 0.25))
- ((head -1 -1) . (-0.85 . -0.2))
-
- ((stem 1 1) . (0 . 0.5))
- ((stem -1 -1) . (0 . -0.5))
+;;;;
+;;;; slur.scm -- Slur scheme stuff
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;;
+ ;
+; this is put into the slur-details property of Slur and PhrasingSlur
+(define default-slur-details
+ '((region-size . 4)
+ (head-encompass-penalty . 1000.0)
+ (stem-encompass-penalty . 30.0)
+ (closeness-factor . 10)
+ (edge-attraction-factor . 4)
+ (same-slope-penalty . 20)
+ (steeper-slope-factor . 50)
+ (non-horizontal-penalty . 15)
+ (max-slope . 1.1)
+ (max-slope-factor . 10)
+ (free-head-distance . 0.3)
+ (free-slur-distance . 0.8)
+ (extra-object-collision . 50)
+ (accidental-collision . 3)
+ (extra-encompass-free-distance . 0.3)
+ (head-slur-distance-max-ratio . 3)
+ (head-slur-distance-factor . 10)
+ (edge-slope-exponent . 2)
))