> I can't suggest a fix, so I suppose the alternatives are to use the
> function I gave you within narrow(ing) constraints, or eyeballing
> values for '(bound-details left padding) to justify the left text to
> the bar line case-by-case.

The "narrow constraint" for my scores is a show-stopper: not able to
use two voices on one staff.

I have reduced the example of this to a lean 1.5KiB, attached, which
works fine (one voice only);
and uncommenting line 50 (to include melody and bass voices on the one
staff) produces the error:
"
Drawing systems.../tmp/frescobaldi-IwGYWD/tmptXInwu/capoVHalf-test.ly:14:16:
In procedure find in expression (find (lambda # #) (find-tail # #)):
/tmp/frescobaldi-IwGYWD/tmptXInwu/capoVHalf-test.ly:14:16: Wrong type
argument in position 2 (expecting list): #f
"

Is it sensible to report this as a bug (and useful to the developers)?

TIA
Zenaan

(PS managed to upgrade to 2.16 this evening.)
\version "2.16.0"

#(define (capo grob)
  (let* ((orig (ly:grob-original grob))
         (siblings (if (ly:spanner? orig)
                       (ly:spanner-broken-into orig) '()))
         (total-found (length siblings)))

    (define (adjust-first-left piece)
      (let* ((sys (ly:grob-system piece))
             (cols (ly:grob-object sys 'columns))
             (cols-list (ly:grob-array->list cols))
             (nearest-non-musical
               (find
                 (lambda (col) (eq? #t (ly:grob-property col 'non-musical)))
                 (find-tail
                   (lambda (col)
                     (eq? col (ly:grob-object (ly:spanner-bound piece LEFT) 'axis-group-parent-X)))
                   (reverse cols-list)))))
        (ly:spanner-set-bound! piece LEFT nearest-non-musical)))

    (if (>= total-found 1)
        (if (eq? grob (car siblings))
            (adjust-first-left grob))
        (adjust-first-left grob))))

capoVHalf = {
  \override TextSpanner #'to-barline = ##t
  \override TextSpanner #'after-line-breaking = #capo
  \override TextSpanner #'(bound-details left text) = \markup { \teeny { "½ Capo V" } }
}

startCapo = <> \startTextSpan
endCapo = <> \stopTextSpan

melody = \relative c' {
  c2 c
  \capoVHalf \startCapo
  c c c c
  \endCapo
  c c
}

bass = \relative c, { e1  e  a  a }

<<
  \new StaffGroup <<
    \new Staff {
      \clef "treble_8"
      %<< \melody \\ \bass >> % Line 50
      \melody
    }
  >>
>>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to