3 ;;; if ((note_column_drul[d] == get_bound (d))
4 ;;; && note_column_drul[d]->first_head ()
5 ;;; && (note_column_drul[d]->stem_l ()))
7 ;;; *Need: Score_elment::pointer_alist_
8 ;;; Score_elment::property_alist_
9 ;;; Spanner::Drul_array<Item*> spanned_drul_;
10 ;;; spanner:: (cons get_bound (LEFT) get_bound (RIGHT))
12 (define (attached-to-stem slur dir)
13 (let* ((note-columns (get-pointer slur 'note-columns))
14 (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
15 (stem (get-pointer col 'stem)))
17 (eq? col (get-bound slur dir))
19 (get-pointer stem 'heads))))
21 (define slur-extremity-rules
25 (let* ((note-columns (get-pointer slur 'note-columns))
26 (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
27 (stem (get-pointer col 'stem)))
29 (not (= (get-property slur 'direction)
30 (get-property stem 'direction)))))) . head)
33 ;; if attached-to-stem
34 (and (attached-to-stem slur dir)
37 (let* ((note-columns (get-pointer slur 'note-columns))
38 (col (if (= dir 1) (car note-columns) (car (reverse note-columns))))
39 (stem (get-pointer col 'stem)))
41 (get-pointer stem 'beam)
42 ;; and beam on same side as slur
43 (let ((beaming (get-property stem 'beaming)))
46 (if (= dir -1) (car beaming) (cdr beaming)))
49 ((lambda (slur dir) (not (attached-to-stem slur dir))) . loose-end)
51 ;; default case, attach to head
52 ((lambda (x y) #t) . head)
54 ;; silly rule, just to check
56 (and (attached-to-stem slur dir)
57 (= (get-property slur 'direction) dir))) . stem)
61 (define slur-extremity-offset-alist
63 ((head 1 1) . (-0.25 . 0.2))
64 ((head 1 -1) . (-0.25 . -0.25))
65 ((head -1 1) . (-0.25 . 0.25))
66 ((head -1 -1) . (-0.85 . -0.2))
68 ((stem 1 1) . (0 . 0.5))
69 ((stem -1 -1) . (0 . -0.5))