2 (define (attached-to-stem slur dir)
3 (let* ((note-columns (get-pointer slur 'note-columns))
4 (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
5 (stem (get-pointer col 'stem)))
7 (eq? col (get-bound slur dir))
9 (get-pointer stem 'heads))))
11 (define slur-extremity-rules
15 (let* ((note-columns (get-pointer slur 'note-columns))
16 (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
17 (stem (get-pointer col 'stem)))
19 (not (= (get-property slur 'direction)
20 (get-property stem 'direction)))))) . head)
23 ;; if attached-to-stem
24 (and (attached-to-stem slur dir)
27 (let* ((note-columns (get-pointer slur 'note-columns))
28 (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
29 (stem (get-pointer col 'stem)))
31 (get-pointer stem 'beam)
32 ;; and beam on same side as slur
33 (let ((beaming (get-property stem 'beaming)))
36 (if (= dir -1) (car beaming) (cdr beaming)))
39 ((lambda (slur dir) (not (attached-to-stem slur dir))) . loose-end)
41 ;; default case, attach to head
42 ((lambda (x y) #t) . head)
46 (define slur-extremity-offset-alist
48 ((head 1 1) . (-0.25 . 0.2))
49 ((head 1 -1) . (-0.25 . -0.25))
50 ((head -1 1) . (-0.25 . 0.25))
51 ((head -1 -1) . (-0.85 . -0.2))
53 ((stem 1 1) . (0 . 0.5))
54 ((stem -1 -1) . (0 . -0.5))