lilypond-user
[Top][All Lists]
Advanced

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

Shortening volta brackets at two (and more) staves


From: Kaj Persson
Subject: Shortening volta brackets at two (and more) staves
Date: Tue, 03 Feb 2015 20:37:40 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

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:


The compilation works ok, with the message " Success: compilation successfully completed. Completed successfully in 1.2". But the volta alternative 2 has disappeared, and the figure 2 has moved left, close to the first adjacent bracket. In the compilation log there also has come a lot of messages: "warning: Found infinity or nan in output.  Substituting 0.0". I can count up to twelve such messages, all together just before the "Success..." message.

I have tested a lot of parameter settings in the ly:make-moment. Nothing but 4 4 works when more than one staff, which means the bracket ends at the repeat bar in the example above, and you get no shortening of the bracket.

My knowledge of programming LilyPond is not good enough to do any troubleshooting, so I have to rely on the community to tell if I am doing anything wrong and if so what? Else the result might be the information that this is the behaviour of this function and there is no solution to my task. But at least I can not see any hint of that when I read the description of the variable in the "Internals Reference".

The LilyPond code producing this is:

\version "2.18.2"

voltaLength = {
  \set Score.voltaSpannerDuration = #(ly:make-moment 2 4) }

StaffA = \relative c' { 
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
    {
      e4 e e e
    }
    {
      % Shorten the volta bracket
      \voltaLength
      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
      \voltaLength
      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 { }
}



reply via email to

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