Am 23.04.2017 um 13:00 schrieb Johannes Roeßler:
any ideas how to get a more even - ot lets say rhythmic - distribution of the notes with lyrics?

To add to Kieren’s suggestions:
– Obviously, fonts with an overall smaller width help. LilyPond’s default (Century Schoolbook) isn’t the best choice in that regard. – I even use a script to automatically tweak self-alignment-X for longer syllables, see attachment. It greatly reduces the need for manual intervention. – <https://sourceforge.net/p/testlilyissues/issues/2456/> and <https://sourceforge.net/p/testlilyissues/issues/2453/>: there’s a lot of work to be done on lyrics, and Janek put some of it up as this ‘Lyrics project’, which unfortunately nobody has tackled yet…

HTH, Simon
\version "2.19.25"

#(define (lyric-text::interpolate-alignment grob)
   (let*
    ((width (cdr (ly:grob-property grob 'X-extent)))

     (lower-threshold 3)
     (upper-threshold 11)
     (maximum (- 4/5))
     
     ;; calculate parameters for use in the ‘sigmoid’ cubic function with
     ;; (sigmoid lower-threshold) --> 0
     ;; (sigmoid upper-threshold) --> maximum
     ;; and zero ‘slope’ in both these points, i.e. a smooth transition between
     ;; constants and interpolation
     
     (a (/ (* 2 maximum)
          (+ (- (expt upper-threshold 3))
            (* 3 upper-threshold upper-threshold lower-threshold)
            (* -3 upper-threshold lower-threshold lower-threshold)
            (expt lower-threshold 3))))
     (b (/ (- maximum (* a (+ (expt upper-threshold 3)
                             (* 2 (expt lower-threshold 3))
                             (* -3 upper-threshold (expt lower-threshold 2)))))
          (expt (- upper-threshold lower-threshold) 2)))
     (c (/ (- maximum
              (* b (- (expt upper-threshold 2) (expt lower-threshold 2)))
              (* a (- (expt upper-threshold 3) (expt lower-threshold 3))))
           (- upper-threshold lower-threshold)))
     (d (- maximum
          (* upper-threshold c)
          (* (expt upper-threshold 2) b)
          (* (expt upper-threshold 3) a)))

     (sigmoid (lambda (x) (+ (* a x x x) (* b x x) (* c x) d))))

    ;(format #t "The four parameters have been determined as: \n a ~a \n b ~a 
\n c ~a \n d ~a\n" a b c d)

    (cond
     ((<= width lower-threshold) 0)
     ((< lower-threshold width upper-threshold)
      (sigmoid width))
     ((>= width upper-threshold) maximum))))

\layout {
  \context {
    \Lyrics
    \override LyricText.self-alignment-X = #lyric-text::interpolate-alignment
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to