Hi all,
On Thu, Oct 23, 2014 at 9:41 AM, David Nalesnik <david.nales...@gmail.com>
wrote:
>
>
> On Thu, Oct 23, 2014 at 8:31 AM, Kieren MacMillan <
> kieren_macmil...@sympatico.ca> wrote:
>
>> Hi David,
>>
>> > I think that if you want automation your best approach would be to look
>> at modifying the position of BarNumber.
>>
>> I thought of that at first, but rather hoped the InstrumentName thing
>> would work out… =\
>>
>
Turns out that it will work after all--the bar number is, in fact,
accessible. Learn something every day!
> [Currently pursuing another line of inquiry suggested to me--will report
> back.]
>
>
OK, the attached should give you what you need.
I've left the default bar numbers in so you can check if it's right with
whatever you want to feed it.
Notice that you do need an instrument name for this to work. Something
would have to be worked out if you want both the short instrument name and
the measure number.
Best,
David
\version "2.19.15"
#(define (use-measure-numbers grob)
(let* ((orig (ly:grob-original grob))
(siblings (if (ly:grob? orig)
(ly:spanner-broken-into orig)
'())))
(let loop ((sibs siblings))
(if (pair? sibs)
(begin
(let* ((bound (ly:spanner-bound (car sibs) LEFT))
(location (ly:grob-property bound 'rhythmic-location))
(measure (car location)))
(set! (ly:grob-property (car sibs) 'text)
(number->string measure))
(loop (cdr sibs))))))))
music = {
\partial 2 c4 d
\repeat unfold 20 {
c4 d e f
}
}
\score {
\new PianoStaff \with { shortInstrumentName = "foo" } <<
\new Staff {
\relative c'' {
\music
}
}
\new Staff {
\clef bass
\music
}
>>
\layout {
\context {
\Score
\override InstrumentName.after-line-breaking = #use-measure-numbers
%\omit BarNumber
}
}
}
music = {
\partial 2 c4 d
\repeat unfold 20 {
c4 d e f
}
\break
\partial 2 c4 d \break
c d e f
}
\score {
\new PianoStaff \with { shortInstrumentName = "foo" } <<
\new Staff {
\relative c'' {
\music
}
}
\new Staff {
\clef bass
\music
}
>>
\layout {
\context {
\Score
\override InstrumentName.after-line-breaking = #use-measure-numbers
%\omit BarNumber
}
}
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user