Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-26 Thread Thomas Morley
2014-07-19 14:59 GMT+02:00 John McWilliam :
> That works for me too. Thanks!
> One last detail - I hope - when the difference between the first and
>
> second time involves a whole bar the spanners cannot be seperated by a
>
> transparent bar. In such cases is the following snippet acceptable or is
>
> there another tweak which can be used to seperate them?
> 
>
> \version "2.18.0"
>
> #(allow-volta-hook "|")
>
> music = \relative c''' {
> \key c \major
> \time 2/4
> \bar ".|:"
>
> \repeat volta 2 {
>   \partial 8 g8
>   a16. [g32 a16. f32] e8 [c32 a16.]
>   \set Score.repeatCommands = #'((volta "1."))
>   a8 a'16. [e32 f16. e32] c32 a16.
>   \set Score.repeatCommands = #'((volta #f)(volta "2."))
>   a'16. [g32 a16. e32] c32 [e16. a,16. e'32]
>   \set Score.repeatCommands = #'((volta #f))
>   c8 b b[ g']
>   \break
>   \set Score.measureLength = #(ly:make-moment 5 8)
>   a16. g32 a16. f32 e8
>   \set Score.repeatCommands = #'((volta "1."))
>   c32 [ a16.]
>   \once \hide Score.BarLine
>   \once \hide Score.SpanBar
>   \set Score.repeatCommands = #'((volta #f)(volta "2.") end-
>
> repeat)
>   c32 [e16.]
>   \set Score.repeatCommands = #'((volta #f))
>
>   \set Score.measureLength = #(ly:make-moment 4/8)
>   a,8 a'16. e32 f16. e32 c32 a16.
>   b16.[ c32 d16. e32] f32 [ a16. e16. b32]
>   c8 [a] a
> }
> \break
> } % end relative
>
> \score {
>\new Staff \music
> }

Well, there's a reason why a closing volta-bracket isn't allowed per
default for bar-type "|", if two subsequent brackets are printed, a
horizontal gap will hardly appear.
(The value for the gap is calculated from the span-bar extent, if a
span-bar is present or not.)

You have two possibilities to get this gap.

(1) use 'shorten-pair to adjust the volta-brackets, with the
disadvantage of trial and error for the values.

%

\version "2.18.0"

#(allow-volta-hook "|")

music = \relative c''' {
\key c \major
\time 2/4
\bar ".|:"

\repeat volta 2 {
  \partial 8 g8
  a16. [g32 a16. f32] e8 [c32 a16.]
  \once \override Score.VoltaBracket.shorten-pair = #'(0 . 0.3)
  \set Score.repeatCommands = #'((volta "1."))
  a8 a'16. [e32 f16. e32] c32 a16.
  \once \override Score.VoltaBracket.shorten-pair = #'(0.5 . 0)
  \set Score.repeatCommands = #'((volta #f)(volta "2."))
  a'16. [g32 a16. e32] c32 [e16. a,16. e'32]
  \set Score.repeatCommands = #'((volta #f))
  c8 b b[ g']
  \break
  \set Score.measureLength = #(ly:make-moment 5 8)
  a16. g32 a16. f32 e8
  \set Score.repeatCommands = #'((volta "1."))
  c32 [ a16.]
  \once \hide Score.BarLine
  \once \hide Score.SpanBar
  \set Score.repeatCommands = #'((volta #f)(volta "2.") end-repeat)
  c32 [e16.]
  \set Score.repeatCommands = #'((volta #f))

  \set Score.measureLength = #(ly:make-moment 4/8)
  a,8 a'16. e32 f16. e32 c32 a16.
  b16.[ c32 d16. e32] f32 [ a16. e16. b32]
  c8 [a] a
}
\break
} % end relative

\score {
   \new Staff \music
}

%%%

(2) define a new bar-line which mimics "|" but has more horizontal
extent. Much more involved coding, though very easy to use.

%

\version "2.18.0"

%% next two definitions are unchanged c/p from bar-line.scm
#(define (calc-blot thickness extent grob)
  "Calculate the blot diameter by taking @code{'rounded}
and the dimensions of the extent into account."
  (let* ((rounded (ly:grob-property grob 'rounded #f))
 (blot (if rounded
   (let ((blot-diameter (layout-blot-diameter grob))
 (height (interval-length extent)))

 (cond ((< thickness blot-diameter) thickness)
   ((< height blot-diameter) height)
   (else blot-diameter)))
   0)))

blot))

#(define (make-simple-bar-line grob extent)
  "Draw a simple bar line."
  (let* ((line-thickness (layout-line-thickness grob))
 (thickness (* (ly:grob-property grob 'hair-thickness 1)
   line-thickness))
 (blot (calc-blot thickness extent grob))
 (extent (bar-line::widen-bar-extent-on-span grob extent)))

(ly:round-filled-box (cons 0 thickness)
 extent
 blot)))

#(define (make-thickier-thin-bar-line grob extent)
  "Draw a thin-bar line with more X-extent."
  (let* ((thin-stil (make-simple-bar-line grob extent))
 (line-thickness (layout-line-thickness grob))
 (thickness (* (ly:grob-property grob 'hair-thickness 1)
   

Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-19 Thread John McWilliam
That works for me too. Thanks!
One last detail - I hope - when the difference between the first and 

second time involves a whole bar the spanners cannot be seperated by a 

transparent bar. In such cases is the following snippet acceptable or is 

there another tweak which can be used to seperate them?


\version "2.18.0"

#(allow-volta-hook "|")

music = \relative c''' {
\key c \major
\time 2/4
\bar ".|:"

\repeat volta 2 {
  \partial 8 g8
  a16. [g32 a16. f32] e8 [c32 a16.]
  \set Score.repeatCommands = #'((volta "1."))
  a8 a'16. [e32 f16. e32] c32 a16.
  \set Score.repeatCommands = #'((volta #f)(volta "2."))
  a'16. [g32 a16. e32] c32 [e16. a,16. e'32]
  \set Score.repeatCommands = #'((volta #f))
  c8 b b[ g']
  \break
  \set Score.measureLength = #(ly:make-moment 5 8)
  a16. g32 a16. f32 e8
  \set Score.repeatCommands = #'((volta "1."))
  c32 [ a16.]
  \once \hide Score.BarLine
  \once \hide Score.SpanBar
  \set Score.repeatCommands = #'((volta #f)(volta "2.") end-

repeat)
  c32 [e16.]
  \set Score.repeatCommands = #'((volta #f))

  \set Score.measureLength = #(ly:make-moment 4/8)
  a,8 a'16. e32 f16. e32 c32 a16.
  b16.[ c32 d16. e32] f32 [ a16. e16. b32]
  c8 [a] a
}
\break
} % end relative

\score {
   \new Staff \music
}




-
John McWilliam
--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Repeat-volta-not-at-beginning-of-piece-doesn-t-get-initial-repeat-bar-line-tp163676p164642.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-18 Thread Thomas Morley
2014-07-17 19:29 GMT+02:00 John McWilliam :
> I am deeply grateful for sorting out these problems associated with the
> bagpipe tune format and in particular those associated with repeats. I have
> another irritating glitch in the same grain. A measure can have two
> alternative structures depending on whether it is played the first or second
> time. This is illustrated in the following snippet. My approach to this
> works, however, i get a warning: "already have a volta spanner, ending that
> one prematurely" and the second spanner remains open to the right. Any
> suggestions will be most welcome.
>
> \version "2.18.0"
>
> music = \relative c''' {
> \key c \major
> \time 2/4
> \bar ".|:"

Why not use \repeat volta 2 { ... } here?

> \set Score.repeatCommands = #'(start-repeat)
> \partial 8 g8
> a16. [g32 a16. f32] e8 [c32 a16.]
> a8 a'16. [e32 f16. e32] c32 a16.
> a'16. [g32 a16. e32] c32 [e16. a,16. e'32]
> c8 b b[ g']
> \break
>
> \set Score.measureLength = #(ly:make-moment 5 8)
> a16. g32 a16. f32 e8
> \set Score.repeatCommands = #'((volta "1.")) c32 [ a16.]

You can't accumulate different repeatCommands at the same point of
time, one will override the other.
Put the settings in one list as shown below.

Or use my setRepeatCommand-function from
http://lists.gnu.org/archive/html/lilypond-user/2014-07/msg00376.html
This custom function was developed for exactly this reason: to
accumulate repeatCommands.

Additionally, because we're mid-measure and no BarLine is present,
there will be no gap between the two VoltaBrackets.
I'd insert 'end-repeat (will print bar-line-type ":|.") and make this
BarLine (and the SpanBar) transparent.
See below.

> \set Score.repeatCommands = #'((volta #f))
> \set Score.repeatCommands = #'((volta "2.")) c32 [e16.]
> \set Score.repeatCommands = #'((volta #f))

The VoltaBracket will not be closed, because the volta-hook isn't
allowed for bar-type "|"
This can be changed, ofcourse.
You might be interested in this recent thread, too:
http://lilypond.1069038.n5.nabble.com/Adding-right-side-to-volta-bracket-spanner-td164571.html

> \set Score.measureLength = #(ly:make-moment 4/8)
> a,8 a'16. e32 f16. e32 c32 a16.
> b16.[ c32 d16. e32] f32 [ a16. e16. b32]
> c8 [a] a
> \set Score.repeatCommands = #'(end-repeat)
> \break
> } % end relative
>
> \score {
>\new Staff \music
> }


Now the code as I'd do it:

\version "2.18.0"

#(allow-volta-hook "|")

music = \relative c''' {
\key c \major
\time 2/4
\bar ".|:"

\repeat volta 2 {
  \partial 8 g8
  a16. [g32 a16. f32] e8 [c32 a16.]
  a8 a'16. [e32 f16. e32] c32 a16.
  a'16. [g32 a16. e32] c32 [e16. a,16. e'32]
  c8 b b[ g']
  \break
  \set Score.measureLength = #(ly:make-moment 5 8)
  a16. g32 a16. f32 e8
  \set Score.repeatCommands = #'((volta "1."))
  c32 [ a16.]
  \once \hide Score.BarLine
  \once \hide Score.SpanBar
  \set Score.repeatCommands = #'((volta #f)(volta "2.") end-repeat)
  c32 [e16.]
  \set Score.repeatCommands = #'((volta #f))

  \set Score.measureLength = #(ly:make-moment 4/8)
  a,8 a'16. e32 f16. e32 c32 a16.
  b16.[ c32 d16. e32] f32 [ a16. e16. b32]
  c8 [a] a
}
\break
} % end relative

\score {
   \new Staff \music
}

HTH,
  Harm

P.S.
No need to send me a second private mail, with the same content.
I read the list :)
Ofcourse you can cc me.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-17 Thread John McWilliam
I am deeply grateful for sorting out these problems associated with the
bagpipe tune format and in particular those associated with repeats. I have
another irritating glitch in the same grain. A measure can have two
alternative structures depending on whether it is played the first or second
time. This is illustrated in the following snippet. My approach to this
works, however, i get a warning: "already have a volta spanner, ending that
one prematurely" and the second spanner remains open to the right. Any
suggestions will be most welcome.  

\version "2.18.0"  
  
music = \relative c''' {
\key c \major
\time 2/4
\bar ".|:"

\set Score.repeatCommands = #'(start-repeat)
\partial 8 g8
a16. [g32 a16. f32] e8 [c32 a16.]
a8 a'16. [e32 f16. e32] c32 a16.
a'16. [g32 a16. e32] c32 [e16. a,16. e'32]
c8 b b[ g']
\break 

\set Score.measureLength = #(ly:make-moment 5 8)
a16. g32 a16. f32 e8 
\set Score.repeatCommands = #'((volta "1.")) c32 [ a16.]
\set Score.repeatCommands = #'((volta #f))
\set Score.repeatCommands = #'((volta "2.")) c32 [e16.]
\set Score.repeatCommands = #'((volta #f))
\set Score.measureLength = #(ly:make-moment 4/8)
a,8 a'16. e32 f16. e32 c32 a16.
b16.[ c32 d16. e32] f32 [ a16. e16. b32]
c8 [a] a 
\set Score.repeatCommands = #'(end-repeat)
\break 
} % end relative

\score {
   \new Staff \music
}




-
John McWilliam
--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Repeat-volta-not-at-beginning-of-piece-doesn-t-get-initial-repeat-bar-line-tp163676p164563.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-15 Thread Thomas Morley
2014-07-15 20:08 GMT+02:00 John McWilliam :
> Thanks Thomas for your input. I have applied your first alternative - the
>
> simpler one - to a four part piece. This is the classical length of a
>
> march in piping. The enclosed snippet illustrates the result. The end of
>
> the first part looses its repeat barline. I have tried introducing a \bar
>
> ":|." at the end of the first part, however, this causes the repeat
>
> barline at the begining of the second part to be surpressed. Using manual
>
> commands instead of the \repeat volta format for the first part doesn't
>
> improve the situation. I feel that we are very close to a solution and
>
> would appreciate any suggestions you may be able to offer.
>
> 
>
> \version "2.18.0"
>
> \defineBarLine ".|:-|." #'("|." ".|:" "|.") % needed to allow the
>
> % "volta-hook" mid-line:
> #(allow-volta-hook ".|:-|.")
>
> music = \relative c' {
> \key c \major
> \time 4/4
>  \bar ".|:"
>
> %Part 1
> \repeat volta 2 {
> a4. a8 b4. b8
> c4. c8 d4. d8
> \break }
>
> %Part 2
> \set Score.repeatCommands = #'(start-repeat)
> e4. e8 f4. f8
> \set Score.repeatCommands = #'((volta "1."))
> g4. g8 a4. a8
> \set Score.repeatCommands = #'((volta #f) (volta "2. --1,2")
>
> end-repeat)
> b4. b8 c4. c8
> \bar ".|:-|."
> \set Score.repeatCommands = #'((volta #f))
>
> \break
>
> %Part 3
> \repeat volta 2 {
> a4. a8 b4. b8
> c4. c8 d4. d8
> \break }
>
>
> %% not changed:
> %Part 4
> \repeat volta 2 {
> e4. e8 f4. f8
> \set Score.repeatCommands = #'((volta "1."))
> g4. g8 f4.f8
> \set Score.repeatCommands = #'((volta #f))
> }
>
> }% end relative
>
> \score  {
>\new Staff { \music }
> }

how about:

\version "2.18.0"

\defineBarLine ".|:-|." #'("|." ".|:" "|.")

% needed to allow the "volta-hook" mid-line:
#(allow-volta-hook ".|:-|.")

music = \relative c' {
\key c \major
\time 4/4
\bar ".|:"

%Part 1
\repeat volta 2 {
a4. a8 b4. b8
c4. c8 d4. d8
\bar ":..:"
\break }

%Part 2
\set Score.repeatCommands = #'(start-repeat)
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 a4. a8
\set Score.repeatCommands = #'((volta #f) (volta "2. --1,2") end-repeat)
b4. b8 c4. c8
\bar ".|:-|."
\set Score.repeatCommands = #'((volta #f))
\break

%Part 3
\repeat volta 2 {
a4. a8 b4. b8
c4. c8 d4. d8
\break }

%Part 4
\repeat volta 2 {
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 f4.f8
\set Score.repeatCommands = #'((volta #f))
}

}% end relative

\score {
   \new Staff \music
}


2014-07-15 20:06 GMT+02:00 John McWilliam :
[...]
>   You advise against combining the two approaches to writing repeats, the 
> \repeat volta and the manual approach, however, the second part of the 
> snippet does just that. Do the problems only arise when using the 
> \alternative option?

Well, it's possible to combine them, though you need to use correct code/syntax

> Finally, should my comments have been posted on the forum instead of
> via a personal email?

Yes.
Please always reply to all!

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-15 Thread Paul Morris
Marc Hohl wrote
> Looks nice! Do you think that \setRepeatCommand should be included in 
> the sources? I'd always found the manual tweaking of the text in the 
> volta brackets somewhat clumsy...

Or at least it could be added to the LSR?

-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Repeat-volta-not-at-beginning-of-piece-doesn-t-get-initial-repeat-bar-line-tp163676p164504.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-15 Thread John McWilliam
Thanks Thomas for your input. I have applied your first alternative - the 

simpler one - to a four part piece. This is the classical length of a 

march in piping. The enclosed snippet illustrates the result. The end of 

the first part looses its repeat barline. I have tried introducing a \bar 

":|." at the end of the first part, however, this causes the repeat 

barline at the beginning of the second part to be supressed. Using manual 

commands instead of the \repeat volta format for the first part doesn't 

improve the situation. I feel that we are very close to a solution and 

would appreciate any suggestions you may be able to offer.



\version "2.18.0"

\defineBarLine ".|:-|." #'("|." ".|:" "|.") % needed to allow the   

% "volta-hook" mid-line:
#(allow-volta-hook ".|:-|.")

music = \relative c' {
\key c \major
\time 4/4
 \bar ".|:"
 
%Part 1
\repeat volta 2 {
a4. a8 b4. b8
c4. c8 d4. d8   
\break }
 
%Part 2 
\set Score.repeatCommands = #'(start-repeat)
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 a4. a8
\set Score.repeatCommands = #'((volta #f) (volta "2. --2,4") 

end-repeat)
b4. b8 c4. c8
\bar ".|:-|."
\set Score.repeatCommands = #'((volta #f))

\break

%Part 3
\repeat volta 2 {
a4. a8 b4. b8
c4. c8 d4. d8   
\break }


%% not changed:
%Part 4
\repeat volta 2 {
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 f4.f8
\set Score.repeatCommands = #'((volta #f))
}

}% end relative

\score  {
   \new Staff { \music }
}




-
John McWilliam
--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Repeat-volta-not-at-beginning-of-piece-doesn-t-get-initial-repeat-bar-line-tp163676p164502.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-14 Thread Marc Hohl

Am 14.07.2014 19:00, schrieb Thomas Morley:

2014-07-14 18:47 GMT+02:00 Thomas Morley :

2014-07-14 14:03 GMT+02:00 John McWilliam :



I'd not mix \repeat volta ... and \alternative ... with manual repeat settings.


Correction, you _can_ mix them, _if_ you use correct syntax.
Though, it's a little complicated I think.
Therefore I made the following code sometime ago (and had completely
forgotten about it):


Looks nice! Do you think that \setRepeatCommand should be included in 
the sources? I'd always found the manual tweaking of the text in the 
volta brackets somewhat clumsy...


Marc


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-14 Thread Thomas Morley
2014-07-14 18:47 GMT+02:00 Thomas Morley :
> 2014-07-14 14:03 GMT+02:00 John McWilliam :

> I'd not mix \repeat volta ... and \alternative ... with manual repeat 
> settings.

Correction, you _can_ mix them, _if_ you use correct syntax.
Though, it's a little complicated I think.
Therefore I made the following code sometime ago (and had completely
forgotten about it):

\version "2.16.2"

setRepeatCommand =
#(define-music-function (parser location arg)(scheme?)
#{
  \applyContext #(lambda (ctx)
   (let* ((where (ly:context-property-where-defined ctx 'repeatCommands))
  (repeat-commands (ly:context-property where 'repeatCommands))
  (to-append
(cond ((symbol? arg)
   (list arg))
  ((or (boolean? arg) (markup? arg))
   (list (list 'volta arg)))
  (else '(
  (appended-settings (append repeat-commands to-append)))

;(newline)
;(display appended-settings)
;(newline)

(ly:context-set-property! where 'repeatCommands appended-settings)))
#})

%% maybe:
% #(allow-volta-hook "|")


startRepeat = \setRepeatCommand #'start-repeat
endRepeat = \setRepeatCommand #'end-repeat
startVolta-I = \setRepeatCommand #"1."
startVolta-II-IV = \setRepeatCommand \markup \fontsize #3 "2. - 4."
endVolta = \setRepeatCommand ##f

\relative c' {

a1
\startRepeat
b
\startVolta-I
c
\endRepeat
\endVolta
\startVolta-II-IV
d
\endVolta
e
}

voltaOne = \setRepeatCommand \markup { \text \fontsize #2 \bold "1.– " }
voltaTwo = \setRepeatCommand \markup { \text \fontsize #2 \bold "Fine" }

\relative c'' {
  \time 4/2
  \repeat volta 2 {
f2 g a4. (g8 f4) e
  }
  \alternative {
{
  \voltaOne
  d\breve
}
{
  \endVolta
  \endRepeat
  \voltaTwo
  d\breve
}
  }
  \bar "|."
}

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-14 Thread Thomas Morley
2014-07-14 14:03 GMT+02:00 John McWilliam :
> Hi,
> I have followed this discussion with interest having had a similar
> problem myself. Bagpipe music (marches) have a standard format, usually four
> parts and each part is repeated and may have alternative endings. The repeat
> bars are shown at the beginning and end of each part (including the
> beginning)
> and alternative endings may be the same for up to two parts. When this
> involves
> the fourth (last) part the alternative ending is usually closed with \bar
> "|."
>
> I have had problems following this format in Lilypond.
> - visuallising all repeat bars.
> - combining \repeat volta and \set Score.repeatCommands causes warnings and
>   premature closure of the volta spanner.
> - using \bar "|." in the middle of a piece (This you seem to have solved
>   as far as using \bar "||" is concerned but the solution doen't work for
>   \bar "|."
> I enclose the following snippet to illustrate my problem and hope that
> somebody
> will be able to respond with suggestions.
>
> ---
>
> \version "2.18.0"
>
>
> music = \relative c' {
> \key c \major \time 4/4
>
> %Part I with two alternative repeat ends
> \repeat volta 2 {
> e4. e8 f4. f8 }
> \alternative { {
> g4. g8 a4. a8 }
> {

I'd not mix \repeat volta ... and \alternative ... with manual repeat settings.

> % If the following volta text is introduced the previous repeat bar
> disappears
> % and a warning reports premature closure of the volta spanner. The spanner
> % remains open to the right.
> %   \set Score.repeatCommands = #'((volta "2. --1,2"))
> b4. b8 c4. c8
> %   \set Score.repeatCommands = #'((volta #f))
> \bar ".|:-||" \break }
> % The second ending should finish with \bar "|." as this is also the ending
> for
> % the second part and as such the end of the piece. Introducing \bar "|.",
> % however, surpresses the repeat bar at the beginning of the second part. I
> also

\bar ".|:-|." isn't defined!
You can define it yourself, though

> % tried \bar ".|:-|." with a similar result.
> }
> %Part II with the same repeat end as part I
> \repeat volta 2 {
> e4. e8 f4. f8
> \set Score.repeatCommands = #'((volta "1."))
> g4. g8 f4.f8
> \set Score.repeatCommands = #'((volta #f))
> }
>
> }% end relative
>
> \score  {
>\new Staff { \music }
> }
> %..


how about:

\version "2.18.0"

\defineBarLine ".|:-|." #'("|." ".|:" "|.")
%% needed to allow the "volta-hook" mid-line:
#(allow-volta-hook ".|:-|.")

music = \relative c' {
\key c \major
\time 4/4
\bar ".|:"
\set Score.repeatCommands = #'(start-repeat)
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 a4. a8
\set Score.repeatCommands = #'((volta #f) (volta "2. --1,2") end-repeat)
b4. b8 c4. c8
\bar ".|:-|."
\set Score.repeatCommands = #'((volta #f))

\break

%% not changed:
\repeat volta 2 {
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 f4.f8
\set Score.repeatCommands = #'((volta #f))
}

}% end relative

\score  {
   \new Staff { \music }
}

HTH,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-07-14 Thread John McWilliam
Hi,
I have followed this discussion with interest having had a similar
problem myself. Bagpipe music (marches) have a standard format, usually four
parts and each part is repeated and may have alternative endings. The repeat
bars are shown at the beginning and end of each part (including the
beginning)
and alternative endings may be the same for up to two parts. When this
involves
the fourth (last) part the alternative ending is usually closed with \bar
"|." 

I have had problems following this format in Lilypond.
- visuallising all repeat bars.
- combining \repeat volta and \set Score.repeatCommands causes warnings and
  premature closure of the volta spanner.
- using \bar "|." in the middle of a piece (This you seem to have solved 
  as far as using \bar "||" is concerned but the solution doen't work for
  \bar "|."
I enclose the following snippet to illustrate my problem and hope that
somebody
will be able to respond with suggestions.

---

\version "2.18.0"


music = \relative c' {
\key c \major \time 4/4

%Part I with two alternative repeat ends
\repeat volta 2 {
e4. e8 f4. f8 }
\alternative { {
g4. g8 a4. a8 }
{
% If the following volta text is introduced the previous repeat bar
disappears
% and a warning reports premature closure of the volta spanner. The spanner 
% remains open to the right.
%   \set Score.repeatCommands = #'((volta "2. --1,2"))
b4. b8 c4. c8 
%   \set Score.repeatCommands = #'((volta #f))
\bar ".|:-||" \break }
% The second ending should finish with \bar "|." as this is also the ending
for 
% the second part and as such the end of the piece. Introducing \bar "|.", 
% however, surpresses the repeat bar at the beginning of the second part. I
also
% tried \bar ".|:-|." with a similar result.
}
%Part II with the same repeat end as part I
\repeat volta 2 {
e4. e8 f4. f8
\set Score.repeatCommands = #'((volta "1."))
g4. g8 f4.f8
\set Score.repeatCommands = #'((volta #f))
}

}% end relative

\score  {
   \new Staff { \music }
}
%..




-
John McWilliam
--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Repeat-volta-not-at-beginning-of-piece-doesn-t-get-initial-repeat-bar-line-tp163676p164443.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-28 Thread Peter Gentry
Funny it works fine for me without the \score. 
I thought this was implied if omitted. 
I did edit the music variable to make sure I was expecting a different output.

regards
Peter Gentry 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-27 Thread David Kastrup
Patrick or Cynthia Karl  writes:

>> Message: 6
>> Date: Thu, 26 Jun 2014 20:20:16 +0200
>> From: Marc Hohl 
>> Subject: Re: Repeat volta not at beginning of piece doesn't get
>>  initial repeat  bar line
>> [...]
>>> Sorry, that doesn't work for me, result is the same.  I assume you're 
>>> saying to replace the \bar "||" with \bar ".|:-||".
>> 
>> Typo?
>
> No, I cut and pasted.
>
> It turns out that in my zeal to come up with a minimal example, I
> omitted "\score { \new Staff { \music }}.  My example compiled, but
> didn't generate the initial repeat bar line.  Putting it in makes it
> work.  Thanks for the info.
>
> Do you know why omitting the \score info causes the initial repeat to also be 
> omitted?

Without a score, no PDF file is written, so you get to see the result
from the last run that _did_ produce a PDF.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-27 Thread Patrick or Cynthia Karl

> Message: 6
> Date: Thu, 26 Jun 2014 20:20:16 +0200
> From: Marc Hohl 
> Subject: Re: Repeat volta not at beginning of piece doesn't get
>       initial repeat  bar line
> [...]
>> Sorry, that doesn't work for me, result is the same.  I assume you're saying 
>> to replace the \bar "||" with \bar ".|:-||".
> 
> Typo?

No, I cut and pasted.

It turns out that in my zeal to come up with a minimal example, I omitted 
"\score { \new Staff { \music }}.  My example compiled, but didn't generate the 
initial repeat bar line.  Putting it in makes it work.  Thanks for the info.

Do you know why omitting the \score info causes the initial repeat to also be 
omitted?

> 
> \version "2.18.2"
> 
> music = \relative b' {
>a1 a a a
>\bar ".|:-||"
> 
>\break
> 
>\repeat volta 2 { a4 b c d }
> }
> 
> \score  {
>   \new Staff { \music }
> }
> 
> compiles for me and yields in a || at the end of the first and a .|: at
> the beginning of the next line.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread Jay Anderson
On Thu, Jun 26, 2014 at 2:05 PM, James  wrote:
> On 26/06/14 16:53, Jay Anderson wrote:
>> You're right that the \bar "||" is overriding the repeat bar. I assume
>> you're wanting a double bar before the break. Use \bar ".|:-||"
>> instead. You can lookup valid bar strings in bar-line.scm.
>>
>> -Jay
>>
> So does the documentation need changing as it is not clear here; and if
> so can you let me know what it should be?

To me the bar line situation is pretty clear here:
http://www.lilypond.org/doc/v2.19/Documentation/notation/bars

and here:
http://www.lilypond.org/doc/v2.19/Documentation/notation/long-repeats

When I'm looking for a specific bar line I tend to look directly in
bar-line.scm.

-Jay

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread James
On 26/06/14 16:53, Jay Anderson wrote:
> On Thu, Jun 26, 2014 at 8:37 AM, Patrick or Cynthia Karl  
> wrote:
>> Section 1.4 of the Notation Manual says about volta repeats:
>>
>> volta   The repeated music is not written out but enclosed between 
>> repeat bar lines. If the repeat is at the 
>> beginning of a piece, a repeat bar line is only printed at the end of the
>>   repeat.
>>
>> But the following snippet does not generate the initial repeat bar line, 
>> apparently because of the "||" bar line.  But the "||" bar line does not 
>> indicate the end of a piece.
>>
>> I have tried several things to get the inital repeat bar line to appear 
>> without success.  I suspect it's not very difficult.  Can anyone please tell 
>> me how to do it?  And if I'm correct about the problem being caused by the 
>> "||" bar line, the documentation should probably be changed.
>>
>> \version "2.18.2"
>>
>> music = \relative b' {
>> a1 a a a
>> \bar "||"
>>
>> \break
>>
>> \repeat volta 2 { a4 b c d }
>> }
> You're right that the \bar "||" is overriding the repeat bar. I assume
> you're wanting a double bar before the break. Use \bar ".|:-||"
> instead. You can lookup valid bar strings in bar-line.scm.
>
> -Jay
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
So does the documentation need changing as it is not clear here; and if
so can you let me know what it should be?

James

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread Marc Hohl

[...]

Sorry, that doesn't work for me, result is the same.  I assume you're saying to replace the \bar 
"||" with \bar ".|:-||".


Typo?

\version "2.18.2"

music = \relative b' {
   a1 a a a
   \bar ".|:-||"

   \break

   \repeat volta 2 { a4 b c d }
}

\score  {
  \new Staff { \music }
}

compiles for me and yields in a || at the end of the first and a .|: at
the beginning of the next line.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread Marc Hohl

[sorry, forgot to reply to list]
Am 26.06.2014 18:22, schrieb Patrick or Cynthia Karl:

In lilypond-user Digest, Vol 139, Issue 98 Message: 6, Jay Anderson wrote:



Date: Thu, 26 Jun 2014 08:53:23 -0700
From: Jay Anderson 
To: Patrick or Cynthia Karl 
Subject: Re: Repeat volta not at beginning of piece doesn't get
    initial repeat  bar line

On Thu, Jun 26, 2014 at 8:37 AM, Patrick or Cynthia Karl  wrote:

Section 1.4 of the Notation Manual says about volta repeats:

volta   The repeated music is not written out but enclosed between 
repeat bar lines. If the repeat is at the beginning 
of a piece, a repeat bar line is only printed at the end of the 
 repeat.

But the following snippet does not generate the initial repeat bar line, apparently because of the 
"||" bar line.  But the "||" bar line does not indicate the end of a piece.

I have tried several things to get the inital repeat bar line to appear without success.  
I suspect it's not very difficult.  Can anyone please tell me how to do it?  And if I'm 
correct about the problem being caused by the "||" bar line, the documentation 
should probably be changed.

\version "2.18.2"

music = \relative b' {
a1 a a a
\bar "||"

\break

\repeat volta 2 { a4 b c d }
}


You're right that the \bar "||" is overriding the repeat bar. I assume
you're wanting a double bar before the break. Use \bar ".|:-||"
instead. You can lookup valid bar strings in bar-line.scm.


Sorry, that doesn't work for me, result is the same.  I assume you're saying to replace the \bar 
"||" with \bar ".|:-||".


It should work with \bar ".|:-||" instead of \bar "||", though.


I still don't understand why the "||" bar is overriding the repeat bar, as "||" 
doesn't signify end-of-piece so the \repeat volta is not at the beginning of a piece so the initial 
repeat bar line should be printed.


Lilypond's bar lines have four values: the unbroken bar line, the parts
that are used if the bar line is at a line break, and a corresponding 
span bar line.


If you manually set \bar "||", then lilypond sets the corresponding
bar line types for the end of the line and the beginning of the
new line, which overrides the \repeat settings.

I must admit that the workaround above is in no way an ideal solution,
but it is not that simple to convince Lilypond to do the right thing
out of the box ...

HTH,

Marc


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread Patrick or Cynthia Karl
> In lilypond-user Digest, Vol 139, Issue 98 Message: 6, Jay Anderson wrote:

> Date: Thu, 26 Jun 2014 08:53:23 -0700
> From: Jay Anderson 
> To: Patrick or Cynthia Karl 
> Subject: Re: Repeat volta not at beginning of piece doesn't get
>       initial repeat  bar line
> 
> On Thu, Jun 26, 2014 at 8:37 AM, Patrick or Cynthia Karl  
> wrote:
>> Section 1.4 of the Notation Manual says about volta repeats:
>> 
>> volta   The repeated music is not written out but enclosed between 
>> repeat bar lines. If the repeat is at the 
>> beginning of a piece, a repeat bar line is only printed at the end of the
>>   repeat.
>> 
>> But the following snippet does not generate the initial repeat bar line, 
>> apparently because of the "||" bar line.  But the "||" bar line does not 
>> indicate the end of a piece.
>> 
>> I have tried several things to get the inital repeat bar line to appear 
>> without success.  I suspect it's not very difficult.  Can anyone please tell 
>> me how to do it?  And if I'm correct about the problem being caused by the 
>> "||" bar line, the documentation should probably be changed.
>> 
>> \version "2.18.2"
>> 
>> music = \relative b' {
>>a1 a a a
>>\bar "||"
>> 
>>\break
>> 
>>\repeat volta 2 { a4 b c d }
>> }
> 
> You're right that the \bar "||" is overriding the repeat bar. I assume
> you're wanting a double bar before the break. Use \bar ".|:-||"
> instead. You can lookup valid bar strings in bar-line.scm.

Sorry, that doesn't work for me, result is the same.  I assume you're saying to 
replace the \bar "||" with \bar ".|:-||".

I still don't understand why the "||" bar is overriding the repeat bar, as "||" 
doesn't signify end-of-piece so the \repeat volta is not at the beginning of a 
piece so the initial repeat bar line should be printed.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread Jay Anderson
On Thu, Jun 26, 2014 at 8:37 AM, Patrick or Cynthia Karl  wrote:
> Section 1.4 of the Notation Manual says about volta repeats:
>
> volta   The repeated music is not written out but enclosed between 
> repeat bar lines. If the repeat is at the 
> beginning of a piece, a repeat bar line is only printed at the end of the 
>  repeat.
>
> But the following snippet does not generate the initial repeat bar line, 
> apparently because of the "||" bar line.  But the "||" bar line does not 
> indicate the end of a piece.
>
> I have tried several things to get the inital repeat bar line to appear 
> without success.  I suspect it's not very difficult.  Can anyone please tell 
> me how to do it?  And if I'm correct about the problem being caused by the 
> "||" bar line, the documentation should probably be changed.
>
> \version "2.18.2"
>
> music = \relative b' {
> a1 a a a
> \bar "||"
>
> \break
>
> \repeat volta 2 { a4 b c d }
> }

You're right that the \bar "||" is overriding the repeat bar. I assume
you're wanting a double bar before the break. Use \bar ".|:-||"
instead. You can lookup valid bar strings in bar-line.scm.

-Jay

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Repeat volta not at beginning of piece doesn't get initial repeat bar line

2014-06-26 Thread Patrick or Cynthia Karl
Section 1.4 of the Notation Manual says about volta repeats:

volta   The repeated music is not written out but enclosed between 
repeat bar lines. If the repeat is at the beginning 
of a piece, a repeat bar line is only printed at the end of the 
 repeat.

But the following snippet does not generate the initial repeat bar line, 
apparently because of the "||" bar line.  But the "||" bar line does not 
indicate the end of a piece.

I have tried several things to get the inital repeat bar line to appear without 
success.  I suspect it's not very difficult.  Can anyone please tell me how to 
do it?  And if I'm correct about the problem being caused by the "||" bar line, 
the documentation should probably be changed.

\version "2.18.2"

music = \relative b' {
a1 a a a
\bar "||"

\break

\repeat volta 2 { a4 b c d }
}


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user