X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fslur.scm;h=51445d3a54a00e467286902e2ea0e300ec44090f;hb=3471866d047b2e22f6d42eedb936d5eddcb5a06a;hp=66cb8c2e6642eb2a14f61575679914ca5a6d4a6b;hpb=b344e98da40fcb239ac0599ba5df7dec329a688a;p=lilypond.git diff --git a/scm/slur.scm b/scm/slur.scm index 66cb8c2e66..51445d3a54 100644 --- a/scm/slur.scm +++ b/scm/slur.scm @@ -1,19 +1,19 @@ -;;; -;;; slur.scm -- Slur scheme stuff -;;; -;;; source file of the GNU LilyPond music typesetter -;;; -;;; (c) 2000 Jan Nieuwenhuizen -;;; +;;;; +;;;; slur.scm -- Slur scheme stuff +;;;; +;;;; source file of the GNU LilyPond music typesetter +;;;; +;;;; (c) 2000--2001 Jan Nieuwenhuizen +;;;; (define (attached-to-stem slur dir) - (let* ((note-columns (ly-get-elt-property slur 'note-columns)) + (let* ((note-columns (ly-get-grob-property slur 'note-columns)) (col (if (= dir 1) (car note-columns) (car (reverse note-columns)))) - (stem (ly-get-elt-property col 'stem))) + (stem (ly-get-grob-property col 'stem))) (and (eq? col (ly-get-spanner-bound slur dir)) stem - (ly-get-elt-property stem 'heads)))) + (ly-get-grob-property stem 'heads)))) ;; Slur-extremity-rules is a list of rules. Each rule is a pair @@ -37,7 +37,7 @@ ;; urg: don't crash on a slur without note-columns (cons (lambda (slur dir) - (< (length (ly-get-elt-property slur 'note-columns)) 1)) 'head) + (< (length (ly-get-grob-property slur 'note-columns)) 1)) 'head) ;; (cons (lambda (slur dir) (begin (display "before loose-end") (newline))#f) #f) (cons (lambda (slur dir) (not (attached-to-stem slur dir))) 'loose-end) @@ -46,12 +46,12 @@ (cons (lambda (slur dir) ;; urg, code dup - (let* ((note-columns (ly-get-elt-property slur 'note-columns)) + (let* ((note-columns (ly-get-grob-property slur 'note-columns)) (col (if (= dir 1) (car note-columns) (car (reverse note-columns)))) - (stem (ly-get-elt-property col 'stem))) + (stem (ly-get-grob-property col 'stem))) (and stem - (not (= (ly-get-elt-property slur 'direction) - (ly-get-elt-property stem 'direction)))))) 'head) + (not (= (ly-get-grob-property slur 'direction) + (ly-get-grob-property stem 'direction)))))) 'head) ;; (cons (lambda (slur dir) (begin (display "before stem") (newline))#f) #f) @@ -60,20 +60,21 @@ (and (attached-to-stem slur dir) ;; and got beam ;; urg, code dup - (let* ((note-columns (ly-get-elt-property slur 'note-columns)) + (let* ((note-columns (ly-get-grob-property slur 'note-columns)) (col (if (= dir 1) (car note-columns) (car (reverse note-columns)))) - (stem (ly-get-elt-property col 'stem))) + (stem (ly-get-grob-property col 'stem))) (and stem - (ly-get-elt-property stem 'beam) + (ly-get-grob-property stem 'beam) ;; and beam on same side as slur - (let ((beaming (ly-get-elt-property stem 'beaming))) + (let ((beaming (ly-get-grob-property stem 'beaming))) + ;; (display "beaming (") (display dir) (display "): ") (write beaming) (newline) (if (pair? beaming) - (<= 1 - (if (= dir -1) (car beaming) (cdr beaming))) + (>= (length (if (= dir -1) (cdr beaming) (car beaming))) + 1) #f)))))) 'stem) - ;;(cons (lambda (slur dir) (begin (display "before loose-end") (newline))#f) #f) + ;; (cons (lambda (slur dir) (begin (display "before loose-end") (newline))#f) #f) (cons (lambda (slur dir) (not (attached-to-stem slur dir))) 'loose-end) ;; (cons (lambda (slur dir) (begin (display "after loose-end") (newline))#f) #f) @@ -92,13 +93,33 @@ ;; stem: Default position is on stem X, at stem end Y (define default-slur-extremity-offset-alist '( - ((head 1 1) . (-0.25 . 0.25)) - ((head 1 -1) . (-0.25 . -0.25)) - ((head -1 1) . (-0.25 . 0.25)) - ((head -1 -1) . (-0.85 . -0.25)) + ((head 1 1) . (-0.25 . 0.75)) + ((head 1 -1) . (-0.25 . 0.75)) + ((head -1 1) . (-0.25 . 0.75)) + ((head -1 -1) . (-0.85 . 0.75)) + + ((stem 1 1) . (-0.125 . 0.5)) + ((stem -1 -1) . (-0.125 . 0.5)) + + ((loose-end 1 1) . (-0.4 . 0)) + ((loose-end 1 -1) . (-0.4 . 0)) + ((loose-end -1 -1) . (-4 . 0)) + ((loose-end -1 1) . (-4 . 0)) + )) + +;; This is a bit of a hack: slurs and phrasing slurs +;; attaching at the same note must not collide. +;; However, slurs (and phrasing slurs) should look +;; at scripts and eachother. +(define default-phrasing-slur-extremity-offset-alist + '( + ((head 1 1) . (-0.25 . 1.25)) + ((head 1 -1) . (-0.25 . 1.25)) + ((head -1 1) . (-0.25 . 1.25)) + ((head -1 -1) . (-0.85 . 1.25)) - ((stem 1 1) . (0 . 0.5)) - ((stem -1 -1) . (0 . -0.5)) + ((stem 1 1) . (-0.25 . 1.5)) + ((stem -1 -1) . (-0.25 . 1.5)) ((loose-end 1 1) . (-0.4 . 0)) ((loose-end 1 -1) . (-0.4 . 0)) @@ -107,24 +128,3 @@ )) -(define default-basic-slur-properties - `( - (molecule-callback . ,Slur::brew_molecule) - (thickness . 1.2) - (spacing-procedure . ,Slur::set_spacing_rods) - (minimum-length . 1.5) - (after-line-breaking-callback . ,Slur::after_line_breaking) - (extremity-rules . ,default-slur-extremity-rules) - (extremity-offset-alist . ,default-slur-extremity-offset-alist) - (de-uglify-parameters . ( 1.5 0.8 -2.0)) - (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) - (bezier-pct-c0 . -0.2) (bezier-pct-c3 . 0.000006) - (bezier-pct-out-max . 0.8) (bezier-pct-in-max . 1.2) - (bezier-area-steps . 1.0))) - (beautiful . 0.5) - (y-free . 0.75) - (attachment-offset . ((0 . 0) . (0 . 0))) - (slope-limit . 0.8) - (meta . ,(element-description "Slur" slur-interface)) - ) - )