lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Measure_counter_engraver examples


From: David Nalesnik
Subject: Re: Measure_counter_engraver examples
Date: Sat, 15 Dec 2012 09:58:47 -0600

Hi Kieren,

On Sat, Dec 15, 2012 at 9:00 AM, Kieren MacMillan
<address@hidden> wrote:
> Hi all,
>
> Just wondering if there are any docs or example snippets regarding the 
> Measure_counter_engraver that is [supposed to be] in 2.17.8.
>

The Measure_counter_engraver is part of LilyPond as of 2.17.7.  There
isn't any documentation yet.  (For one thing, I'm unsure of where to
put it as it requires adding the engraver to a context.  Would a
snippet be the best way to tackle this issue?)

Anyway, there are two regression tests (attached), which show how the
engraver might be used.

I remember that you posted a question about the feasibility of using
the engraver to number bars below a system, centered on the measure's
extents.  Below I've included a simple example which does this by
attaching the measure counter to a Dynamics context.  It also shows
how to modify the appearance of the numbers in various ways.  In
addition, I've broken a measure midway so you can see how the number
will appear in parentheses for the broken bit.

I hope this is helpful!
-David

%%% The Example %%%

\version "2.17.8"

notes = {
  \repeat unfold 20 {
    c' d' e' f'
  }
}

\score {
  \new StaffGroup <<
    \new Staff {
      \notes
    }
    \new Staff {
      \notes
    }
    \new Dynamics {
      \startMeasureCount
      s1*12
      s2 \bar ""
      \break
      s2
      s1*7
      \stopMeasureCount
    }
  >>
  \layout {
    \context {
      \Dynamics
      \consists #Measure_counter_engraver
      \override MeasureCounter.direction = #DOWN
      \override MeasureCounter.font-encoding = #'latin1
      \override MeasureCounter.font-shape = #'italic
      % to control the distance of the Dynamics context from the staff:
      \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #2
    }
    \context {
      \Score
      \remove "Bar_number_engraver"
    }
  }
}

Attachment: measure-counter.ly
Description: Binary data

Attachment: measure-counter-broken.ly
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]