Menu

#5397 Doc: NR - Measure_grouping_engraver needs beatStructure and baseMoment set as well to work as expected

New
nobody
None
Documentation
2018-08-08
2018-08-05
No

Hi,

while playing with the Measure_grouping_engraver
see:
http://lilypond.1069038.n5.nabble.com/changing-symbols-used-by-Measure-grouping-engraver-td215283.html
I noticed ....

I tried to get MeasureGrouping in default 4/4-time, but nothing happened.
One has to set beatStructure and baseMoment accordingly. The current
docs make it sound it should work out of the box, though.

\version "2.19.82"

\new Staff \with { \consists "Measure_grouping_engraver" }
  {
      %% to get MeasureGrouping, next two lines need to be uncommented
    %\set Timing.beatStructure = 4,4
    %\set Score.baseMoment = #(ly:make-moment 1/8)
    \repeat unfold 8 a'8
  }

Discussion

  • Anonymous

    Anonymous - 2018-08-05

    Is this just a documentation issue though?

    should it work out of the box (to use your phrase) and so documentation is correct and the bug is in the code?

    We don't document bugs after all.

    James

     
    • Anonymous

      Anonymous - 2018-08-05

      From Harm:

      Hi James,

      this is not a bug in the code, afaik.

      But the functionality of MeasureGrouping relies on appropriate
      settings for beatStructure and baseMoment.
      This should be documented, that's all.

      In my example the default settings for 4/4-time prevent any output
      from Measure_grouping_engraver.
      The user should be told about the need to adjust those settings in
      certain cases.

      The IR states Measure_grouping_engraver is reading following context-properties:
      baseMoment (moment)
      beatStructure (list)
      currentMusicalColumn (graphical (layout) object)
      measurePosition (moment)

      Imho, we should explain in the NR how to use them for MeasureGrouping.

      Cheers,
      Harm

       
  • Simon Albrecht

    Simon Albrecht - 2018-08-05
    • summary: Doc: NR - Measure_grouping_engraver needs beatStructure and beaseMovement set as well to work as expected --> Doc: NR - Measure_grouping_engraver needs beatStructure and baseMoment set as well to work as expected
     
  • Anonymous

    Anonymous - 2018-08-08
     
  • Anonymous

    Anonymous - 2018-08-08

    From Harm:

    Hi James,

    If I understand correctly:

    In general the time-signature says about a measure:
    how many beats are present and how long are those beats.
    P.e. in 3/8 there are 3 beats, each a 8th note long

    In LilyPond we add a structure (beatStructure) to those beats (baseMoment),
    reflecting the most common accents and determine the auto-beaming.
    p.e. 9/8 is structered as three groups of three 8th-notes.
    For beamings not according to beatStructure we set beamExceptions,
    p.e. for 3/8

    Now, MeasureGrouping may annotate groups of beats, if groups are defined by
    beatStructure, see 9/8. Single beats will not cause any MeasureGrouping,
    see 3/8.

    Here some test-code:

    displaySomeContextPoperties =
    \context Timing
    \applyContext
       #(lambda (ctx)
         (newline)
         (format #t
           "timeSignatureFraction: ~a\n\tbeatStructure: ~a\n\tbaseMoment: ~a
           \tbeamExceptions: ~a\n"
           (ly:context-property ctx 'timeSignatureFraction)
           (ly:context-property ctx 'beatStructure)
           (ly:context-property ctx 'baseMoment)
           (ly:context-property ctx 'beamExceptions)))
    
    \new Staff \with { \consists "Measure_grouping_engraver" }
    {
       \time 3/8 \displaySomeContextPoperties \repeat unfold 3 { a'8 }
       \time 4/8 \displaySomeContextPoperties \repeat unfold 4 { a'8 }
       \time 5/8 \displaySomeContextPoperties \repeat unfold 5 { a'8 }
       \time 6/8 \displaySomeContextPoperties \repeat unfold 6 { a'8 }
       \time 7/8 \displaySomeContextPoperties \repeat unfold 7 { a'8 }
       \time 8/8 \displaySomeContextPoperties \repeat unfold 8 { a'8 }
       \time 9/8 \displaySomeContextPoperties \repeat unfold 9 { a'8 }
       \time 1/4 \displaySomeContextPoperties \repeat unfold 2 { a'8 }
       \time 2/4 \displaySomeContextPoperties \repeat unfold 4 { a'8 }
       \time 3/4 \displaySomeContextPoperties \repeat unfold 6 { a'8 }
       \time 4/4 \displaySomeContextPoperties \repeat unfold 8 { a'8 }
    }
    
    Terminal-output:
    timeSignatureFraction: (3 . 8)
         beatStructure: (1 1 1)
         baseMoment: #<Mom 1/8>
               beamExceptions: ((end (1/8 3)))
    
    timeSignatureFraction: (4 . 8)
         beatStructure: (2 2)
         baseMoment: #<Mom 1/8>
               beamExceptions: ()
    
    timeSignatureFraction: (5 . 8)
         beatStructure: (3 2)
         baseMoment: #<Mom 1/8>
               beamExceptions: ()
    
    timeSignatureFraction: (6 . 8)
         beatStructure: (3 3)
         baseMoment: #<Mom 1/8>
               beamExceptions: ()
    
    timeSignatureFraction: (7 . 8)
         beatStructure: (1 1 1 1 1 1 1)
         baseMoment: #<Mom 1/8>
               beamExceptions: ()
    
    timeSignatureFraction: (8 . 8)
         beatStructure: (3 3 2)
         baseMoment: #<Mom 1/8>
               beamExceptions: ()
    
    timeSignatureFraction: (9 . 8)
         beatStructure: (3 3 3)
         baseMoment: #<Mom 1/8>
               beamExceptions: ()
    
    timeSignatureFraction: (1 . 4)
         beatStructure: (1)
         baseMoment: #<Mom 1/4>
               beamExceptions: ()
    [
    timeSignatureFraction: (2 . 4)
         beatStructure: (1 1)
         baseMoment: #<Mom 1/4>
               beamExceptions: ()
    
    timeSignatureFraction: (3 . 4)
         beatStructure: (1 1 1)
         baseMoment: #<Mom 1/4>
               beamExceptions: ((end (1/8 6) (1/12 3 3 3)))
    
    timeSignatureFraction: (4 . 4)
         beatStructure: (1 1 1 1)
         baseMoment: #<Mom 1/4>
               beamExceptions: ((end (1/8 4 4) (1/12 3 3 3 3)))
    

    So, MeasureGrouping does not happen for time-signatures where the
    beatStructure is a list of single beats, like 3/8 or 7/8 or 3/4 etc.
    At least not per default. One can try playing with beatStructure and probably
    baseMoment to get MeasureGrouping, though.

    See:

    \new Staff \with { \consists "Measure_grouping_engraver" }
    {
       \time 3/8
       a'8 8 8
       \set Timing.beatStructure = #'(3)
       8 8 8
    }
    

    Changing beatStructure and probably baseMoment ofcourse affects
    auto-beaming.
    We explain this already elsewhere, but probably we'll should mention
    it in the section for
    MeasureGrouping as well.

    HTH,
    Harm

     
  • Anonymous

    Anonymous - 2018-08-08

    2018-08-07 12:23 GMT+02:00 James Lowe pkx166h@runbox.com:

    timeSignatureFraction: (4 . 8)
    beatStructure: (2 2)
    baseMoment: #<mom 1="" 8="">
    beamExceptions: ()</mom>

    I have on supplementary based on what you have said.

    If you look at one of the original examples (I'll attach it here as well),
    you can see engravings for 'single' notes (which may not be the same as
    'beats' hence my supplementary.

    Indeed, in 4/8 the beat (baseMoment) is 1/8 not 1/4

    This is 4/8 time but the notes are crotchets (i.e. 4 not 8) so is this
    effectively '2' beats in this context ?

    True as well, beatStructure in 4/8 is '(2 2)

    So below works as expected:

    \new Staff \with { \consists "Measure_grouping_engraver" }
    {
      \time 4/8
      a'4 4
    }
    

    Though, there is another not yet mentioned point.
    MeasureGrouping also relies on the actual music rhythmically matching
    the beatStructure.

    \new Staff \with { \consists "Measure_grouping_engraver" }
    {
      \time 4/8
      a'2
    }
    

    Will print only one bracket.

    To get two brackets a second voice could be inserted, easily:

    \new Staff \with { \consists "Measure_grouping_engraver" }
    <<
        { \time 4/8 a'2 }
        { s4 s }
    >>
    

    No bug I'd say, but likely worth explaining.

    Though, why is the a first bracket printed, even if no music
    rhythmically matches the beatStructure?
    See 3rd measure of:

    \new Staff \with { \consists "Measure_grouping_engraver" }
    {
      \time 4/8
      a'4 4
      a'2*7/4 a'8
      |
    }
    

    That I can't explain.
    Others?

    Cheers,
    Harm

     
  • Anonymous

    Anonymous - 2018-08-08

    On 07/08/18 13:32, Simon Albrecht wrote:

    On 07.08.2018 13:08, Thomas Morley wrote:

    MeasureGrouping also relies on the actual music rhythmically matching
    the beatStructure.

    \new Staff \with { \consists "Measure_grouping_engraver" }
    {
    \time 4/8
    a'2
    }
    Will print only one bracket.

    That doesn’t seem helpful, does it? IIUC, Measure_grouping_engraver is supposed to show the properties of the meter regardless of notes, so that a conductor will have a visual aid in cases like

    {
      \time 4/8
      a'2
      \time 5/8
      4.~ 4
      \time 6/8
      2.
      \time 3/4
      2.
    }