ssb22 / jianpu-ly

Jianpu in Lilypond
http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html
Apache License 2.0
70 stars 18 forks source link

Chords #6

Closed ssb22 closed 4 years ago

ssb22 commented 4 years ago

Doable as below in Lilypond 2.20, but:

Might have to say to begin with that accidentals are not allowed in chords? (better than nothing?)

#(define (chord-flatthree-five grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (markup (#:lower 0.5
          (#:override (cons (quote direction) 1)
          (#:override (cons (quote baseline-skip) 0.5)
          (#:dir-column (
              #:halign 1 #:line ((#:fontsize -5 (#:raise 0.7 (#:flat))) (#:bold "3"))
              #:halign 1 #:line (#:bold "5")
          ))))))
          )))))

The #:halign 1 shouldn't be needed if there are no accidentals. Presumably a chord could in principle have octave dots both above and below. Need to check if individual notes of the chord can have their own octave dots (may cross over with #5 if so), and does this mean more space is required.