Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trill spanner with accidental #14

Closed
dbenjaminmiller opened this issue Dec 17, 2024 · 0 comments
Closed

Add trill spanner with accidental #14

dbenjaminmiller opened this issue Dec 17, 2024 · 0 comments

Comments

@dbenjaminmiller
Copy link
Contributor

I'm currently using a hack to achieve this; a slightly more general version would accept any character as an argument (currently doing manual positioning, but I'm certain a better way is obvious).

image image
#(define (ekm-trillspansharp grob)
  (let* ((ext (ly:stencil-extent (ly:grob-property grob 'stencil) X))
         (tr (ekm-ctext grob 0 (markup #:ekm-combine #xE566 2.3 0.5 #xE262 #:hspace 0.25) ))
         (tr (ly:stencil-translate-axis tr (car ext) X))
         (tempo (ly:grob-property grob 'text))
         (seg (- #xEAA4 (if (integer? tempo) (min 4 (max -4 tempo)) 0))))
    (ly:grob-set-property! grob 'stencil
      (ly:stencil-combine-at-edge
        tr
        X RIGHT
        (grob-interpret-markup grob
          (make-ekm-chars-markup (make-list
            (inexact->exact (floor
              (/ (- (interval-length ext) (ekm-extent tr X))
                 (ekm-extent (ekm-cchar grob 0 seg) X))))
            seg)))
        0))))
tr-igem added a commit that referenced this issue Jan 14, 2025
Added `\ekmStartTrillSpanScript` to specify any text (EXTEXT) instead of the tr symbol like an ornament with `\ekmScript`, e.g. making use of a ligature with

    \ekmStartTrillSpanScript #-1 #'(#xE262 #xE566)

Else, for a proper vertical positioning with tr, the standard accidentals for chord symbols U+ED60 ... should be used, e.g.

    \ekmStartTrillSpanScript
      #-1
      #(markup #:concat
        (#:ekm-char #xE566
         #:hspace 0.2
         #:fontsize -3 #:ekm-char #xED62
         #:hspace 0.2))

For "real" accidental glyphs, a general positioning is tricky.
@tr-igem tr-igem closed this as completed Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants