Hi Jaques,
thanks for the hint!
By now, the hidden measure does the trick. The main drawback is the time
change, that can led to some issue. In my previous example, since the repeat
mark is on a bar before a break, adding the hidden measure there print a time
change hint at the end of the line, as well as a useless new line at the end of
the song (adding the hidden measure part after the mark in the repeatMark
function).
To get rid of this, I created a function to print section titles and added the
hidden measure there. In this way the time change will never be displayed.
Here is the new code:
%%%%%%%%%%%%%%%%%%%%%%%
\version "2.18.0"
chorus = \relative c'' { c d e c | c d e c | \break }
verse = \relative c'' { c c d d | c c d d | \break }
Time = \time 4/4
HiddenMeasureAndBarLine =
{
\cadenzaOn
\once \omit Score.TimeSignature
\time 1/16
s16 \bar ""
\cadenzaOff
}
repeatMark =
#(define-music-function
(parser location volte visible)
(number? boolean?)
(if visible
#{
\once \override Score.RehearsalMark #'break-visibility =
#begin-of-line-invisible
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\once \override Score.RehearsalMark #'font-size = #0
\mark \markup $(string-join (list "repeat" (number->string volte)
"times"))
#}
))
sectionTitleMark =
#(define-music-function
(parser location sectionTitle)
(string?)
#{
\HiddenMeasureAndBarLine
\Time
\mark \markup { $sectionTitle }
#}
)
song =
{
\new Staff
{
\Time
\verse
\repeat volta 4
{
\sectionTitleMark "Chorus"
\chorus
\repeatMark #4 ##t
}
\repeat volta 6
{
\sectionTitleMark "Solo"
\chorus
\repeatMark #6 ##t
}
}
}
\score {
\song
}
%%%%%%%%%%%%%%%%%%%%%%%
Still, the time change can be tricky if the song changes time, so the
sectionTitleMark function can't use the \Time variable, but a new function
parameter with the current time is needed.
It is enough for me at the moment.
By the way, if someone have further hints let us know.
Thanks!
Il Lunedì 12 Maggio 2014 15:14, Jacques Menu <imj-muz...@bluewin.ch> ha scritto:
Hello Carlo,
Adding:
HiddenMeasureAndBarLine = { % from the snippets repository
% the hidden measure and bar line
% \cadenzaOn turns off automatic calculation of bar numbers
\cadenzaOn
% \once \override Score.TimeSignature #'stencil = ##f
\once \omit Score.TimeSignature
\time 1/16
s16 \bar ""
\cadenzaOff
}
and replacing:
\mark "Solo"
with:
\HiddenMeasureAndBarLine
\time 4/4
\mark "Solo"
solves the issue.
But you’ll probably be better of placing the equivalent of this in repeatMark
itself?
JM
Le 12 mai 2014 à 14:11:03, Carlo Vanoni <vanoniiscrizi...@yahoo.it> a écrit :
Hi everyone,
>
>I'm using this nice function to add a right-aligned text that states the
>number of repeats of a repeat block:
>repeatMark =
>#(define-music-function
> (parser location volte visible)
> (number? boolean?)
> (if visible
> #{
> \once \override Score.RehearsalMark #'break-visibility =
> #begin-of-line-invisible
> \once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
> \once \override Score.RehearsalMark #'font-size = #0
> \mark \markup $(string-join (list "repeat" (number->string volte)
> "times"))
> #}
> #{ #}
> ))
>
>It is called with this code at the end of a section
>\repeatMark #4 ##t % writes "repeat 4 times"
>
>I usually wrote section name using a markup on single notes (a1^\markup{ \bold
>Intro}). Now I'm separating the various song sections in different variables.
>Since the same section can be used, e.g., as a chorus and during the solo, I
>need to write the section name using a \mark before the section in the main
>score. This unfortunately generates a "multiple mark" error
when repeats are involved.
>Here is an example code:
>
>%%%%%%%%%%%%%%%%%%%%%%%
>\version "2.18.0"
>
>chorus = \relative c'' { c d e c | c d e c | \break}
>verse = \relative c'' { c c d d | c c d d | \break }
>
>repeatMark =
>#(define-music-function
> (parser location volte visible)
> (number? boolean?)
> (if visible
> #{
> \once \override Score.RehearsalMark #'break-visibility =
> #begin-of-line-invisible
> \once \override Score.RehearsalMark #'self-alignment-X =
#RIGHT
> \once \override Score.RehearsalMark #'font-size = #0
> \mark \markup $(string-join (list "repeat" (number->string volte)
> "times"))
> #}
> #{ #}
> ))
>
>song =
>{
> \new Staff
> {
> \verse
> \repeat volta 4
> {
> \mark "Chorus"
> \chorus
> \repeatMark #4 ##t
> }
> \repeat volta 6
> {
> \mark "Solo"
> \chorus
> \repeatMark #6 ##t
> }
> }
>}
>
>\score {
> \song
>}
>%%%%%%%%%%%%%%%%%%%%%%%
>
>Here, the "Solo" mark is dropped, due to the previous
\repeatMark. What I want is to have the "Solo" mark written like the "Chorus"
one. And, of course, the "reapeat N times" mark, too.
>Is there a better (more correct) approach to get this behavior? Maybe with a
>little different \repeatMark function...
>
>Thanks!
>
>
>
>
>_______________________________________________
>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