lilypond-user
[Top][All Lists]
Advanced

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

Re: Shortening volta brackets at two (and more) staves


From: David Nalesnik
Subject: Re: Shortening volta brackets at two (and more) staves
Date: Tue, 3 Feb 2015 19:50:44 -0600

Hi,

On Tue, Feb 3, 2015 at 4:35 PM, David Nalesnik <address@hidden> wrote:
Hi Kaj,

On Tue, Feb 3, 2015 at 1:37 PM, Kaj Persson <address@hidden> wrote:
In the snippet collection, the "Repeats" section, there is one named "Shortening volta brackets". I have use for just this, since in a piece of music I need some extra space in order to put a mark immediately after the volta alternative bracket. So I tested it, and, yes, the example promised well. The method is to work with the variable voltaSpannerDuration via the the statement:
    "\set Score.voltaSpannerDuration = #(ly:make-moment 2 4)"
This way you can shorten the bracket even down to one single strike:


But when I expand the system to this, hence two staves instead of one, this happens:



I'll have to look at this some more, but it seems there is a bug.  Even in the single staff example, there is a warning: "cannot end volta spanner".  I get this with the snippet you reference as well.   Possibly there is a flaw in lily/volta-engraver.cc.  And another "possibly": this might be related to what happens in your multi-staff example.

Yes, there is a problem in the file that defines the engraver.  Unfortunately, there would need to be a fix to this file to enable you to use the property voltaSpannerDuration to give you what you want (and this wouldn't be available until the next release).

Fortunately, there is a workaround, though you will need to "eyeball" it to get a good result.  Try this:

 \version "2.18.2"

StaffA = \relative c' {  
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
    {
      e4 e e e
    }
    {
      % Shorten the volta bracket
      \override Score.VoltaBracket.shorten-pair = #'(0.5 . 5)
     % OR:
    % \offset shorten-pair #'(0 . 5) Score.VoltaBracket
      f4 r4 r4 r4
    }
  }
  \repeat volta 2 {g4 g g g}
}

StaffB = \relative c'{  
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
    {
      e4 e e e
    }
    {
      % Shorten the volta bracket
      %\override Score.VoltaBracket.shorten-pair = #'(0.5 . 5)
      f4 r4 r4 r4
    }
  }
  \repeat volta 2 {g4 g g g}
}

\score {
  <<
    \StaffA
    % Remove the comment sign (%) on next line to get two staves.
    \StaffB
  >>
  \layout {
  }
}

%%%%%
Hope this helps,
David

reply via email to

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