Re: Changing volta number text

2021-05-18 Thread Jean Abou Samra


Le 18/05/2021 à 21:57, Carl Sorensen a écrit :


On 5/18/21, 1:46 PM, "lilypond-user on behalf of Kieren MacMillan" 
 wrote:

 Hi Ralph,
 
 > I have to admit, after learning from you that the documentation is accurate, and spending some time examining the various examples in the documentation, I think I could achieve what I want. It takes some real effort, and I think it would be difficult for someone who has little experience with LilyPond. And isn't that the point of the documentation?
 
 Absolutely. My comment was meant as a [gentle] criticism of the documentation, not of you or other users. Even if it explicitly pointed out that one needs to *not use* the \repeat volta command, that would be [more] helpful!
 
 > I think it would be helpful to include an appropriate example in the manual repeat marks section of the documentation.
 
 Given that the combination of the first three examples at  is sufficient to solve your example, and the fourth example is almost exactly what you needed, what would a more appropriate example look like? Would that be in addition to the existing examples, or as a replacement to one of them?
 
 The sheer size of the Lilypond docs is already pretty overwhelming; just adding more examples won’t necessarily make it easier for users.
 
 > I guess I'll make a note of the solution!
 
 Some syntactic sugar might be nice… I could imagine a function that took a list of string+moment pairs and “unfolded” a volta automagically. If my life ever calms down, maybe I’ll give that a try.


It seems to me that, for right now, Aaron's changeVoltaText function is the 
preferred way to do it, as it preserves the \unfoldRepeats behavior (albeit 
with warnings).

I'd be in favor of Aaron's snippet being added to the Docs.

Carl


It is worth noting that the \volta command added by Dan Eble in the 2.23 
development series does exactly the job requested here, if I understood 
correctly.


\version "2.23.2"

\language english

{
  \time 3/4
  \repeat volta 4
  {
    a'4 b' c' |
    b'4 c' d' |
  }
  \alternative {
    \volta 1,3 {
  e'4 f' g' |
    }
    \volta 2 {
  d'4 c' b' |
    }
    \volta 4 {
  g'4 a' b' |
    }
  }
  c'2.
}

Updated documentation is here:

http://lilypond.org/doc/v2.23/Documentation/notation/long-repeats.html#alternative-endings

Best,
Jean


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


Re: Changing volta number text

2021-05-18 Thread Carl Sorensen


On 5/18/21, 1:46 PM, "lilypond-user on behalf of Kieren MacMillan" 
 wrote:

Hi Ralph,

> I have to admit, after learning from you that the documentation is 
accurate, and spending some time examining the various examples in the 
documentation, I think I could achieve what I want. It takes some real effort, 
and I think it would be difficult for someone who has little experience with 
LilyPond. And isn't that the point of the documentation?

Absolutely. My comment was meant as a [gentle] criticism of the 
documentation, not of you or other users. Even if it explicitly pointed out 
that one needs to *not use* the \repeat volta command, that would be [more] 
helpful!

> I think it would be helpful to include an appropriate example in the 
manual repeat marks section of the documentation.

Given that the combination of the first three examples at 

 is sufficient to solve your example, and the fourth example is almost exactly 
what you needed, what would a more appropriate example look like? Would that be 
in addition to the existing examples, or as a replacement to one of them?

The sheer size of the Lilypond docs is already pretty overwhelming; just 
adding more examples won’t necessarily make it easier for users.

> I guess I'll make a note of the solution!

Some syntactic sugar might be nice… I could imagine a function that took a 
list of string+moment pairs and “unfolded” a volta automagically. If my life 
ever calms down, maybe I’ll give that a try.

It seems to me that, for right now, Aaron's changeVoltaText function is the 
preferred way to do it, as it preserves the \unfoldRepeats behavior (albeit 
with warnings).

I'd be in favor of Aaron's snippet being added to the Docs.

Carl
 

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


Re: Changing volta number text

2021-05-18 Thread Kieren MacMillan
Hi Ralph,

> I have to admit, after learning from you that the documentation is accurate, 
> and spending some time examining the various examples in the documentation, I 
> think I could achieve what I want. It takes some real effort, and I think it 
> would be difficult for someone who has little experience with LilyPond. And 
> isn't that the point of the documentation?

Absolutely. My comment was meant as a [gentle] criticism of the documentation, 
not of you or other users. Even if it explicitly pointed out that one needs to 
*not use* the \repeat volta command, that would be [more] helpful!

> I think it would be helpful to include an appropriate example in the manual 
> repeat marks section of the documentation.

Given that the combination of the first three examples at 

 is sufficient to solve your example, and the fourth example is almost exactly 
what you needed, what would a more appropriate example look like? Would that be 
in addition to the existing examples, or as a replacement to one of them?

The sheer size of the Lilypond docs is already pretty overwhelming; just adding 
more examples won’t necessarily make it easier for users.

> I guess I'll make a note of the solution!

Some syntactic sugar might be nice… I could imagine a function that took a list 
of string+moment pairs and “unfolded” a volta automagically. If my life ever 
calms down, maybe I’ll give that a try.

Best,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info


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


Re: Changing volta number text

2021-05-18 Thread Ralph Palmer
On Tue, May 18, 2021 at 6:35 AM Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Ralph,
>
> > I think it would be helpful to either have a snippet that shows how to
> change a "normal" volta number setup (i.e., change the numbers and/or add
> text), or to add something to the documentation.
>
> The documentation is accurate, if not entirely clear…  =)


> This is what I got using <
> https://lilypond.org/doc/v2.21/Documentation/notation/long-repeats#manual-repeat-marks
> >:
>
> %%
> \version "2.21.0"
> \include "english.ly"
>
> test = {
>   \time 3/4
>   a'4 b' c' |
>   b'4 c' d' |
>   {
> {
>   \set Score.repeatCommands = #'((volta "1., 3."))
>   e'4 f' g' |
> }
> {
>   \set Score.repeatCommands = #'(end-repeat (volta "2."))
>   d'4 c' b' |
> }
> {
>   \set Score.repeatCommands = #'(end-repeat (volta "4."))
>   g'4 a' b' |
>   \set Score.repeatCommands = #'((volta #f))
> }
>   }
>   c'1
> }
>
> \score {
>   \test
> }
> %%%
>
> Note that I deleted the \repeat volta command, but kept the bracketing of
> your \alternative block for readability.
>
> Hope this helps!
> Kieren.
>>
>>
Thanks, Kieren.

I have to admit, after learning from you that the documentation is
accurate, and spending some time examining the various examples in the
documentation, I think I could achieve what I want. It takes some real
effort, and I think it would be difficult for someone who has little
experience with LilyPond. And isn't that the point of the documentation?

I've run into this problem before while doing transcription, and solved the
problem somehow, but I couldn't (can't) find the exact file where I used
the solution. I've also seen the pattern occasionally while playing music.
I think it would be helpful to include an appropriate example in the manual
repeat marks section of the documentation. Then again, this hasn't exactly
come up as a problem very often, has it? . . . I guess I'll make a note of
the solution!

All the best,

Ralph

-- 
Ralph Palmer
Seattle
USA
(he, him, his)
palmer.r.vio...@gmail.com
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Changing volta number text

2021-05-18 Thread Ralph Palmer
On Fri, May 14, 2021 at 7:26 PM Aaron Hill  wrote:

> On 2021-05-14 6:40 pm, Ralph Palmer wrote:
> > Excellent! Thank you, Aaron. I wish I could understand what your
> > function
> > does - how it works.
>
> The technique involves querying the current Score.repeatCommands and
> replacing any existing (volta "...") command with the user-provided
> version.  This preserves the other repeat commands such as (end-repeat)
> and (volta #f).
>
> Here is a minorly-refactored version with some documentation, comments,
> and a helpful usage warning:
>
> 
> \version "2.22.0"
> \include "english.ly"
>
> changeVoltaText =
> #(define-music-function
>(text) (markup?)
>(_i "Replaces the volta text within the currently-set
> @code{repeatCommands}.")
>
>(define (volta-text? cmd)
> ;; Look for the (volta "...") pattern.
> (and (pair? cmd)
>  (eq? 'volta (car cmd))
>  (markup? (cadr cmd
>(define (replacer cmd)
> (if (volta-text? cmd) `(volta ,text) cmd))
>(define (proc ctxt)
> (let ((cmds (ly:context-property ctxt 'repeatCommands '(
>  (if (any volta-text? cmds)
>   (ly:context-set-property! ctxt 'repeatCommands (map replacer cmds))
>   (ly:input-warning (*location*) "No volta text was replaced."
>
>#{ \context Score \applyContext #proc #})
>
> test = {
>\time 3/4
>\repeat volta 3
>{
>  a'4 b' c' |
>  \changeVoltaText "dud"
>  #(ly:expect-warning "No volta text was replaced.")
>  b'4 c' d' |
>}
>\alternative {
>  {
>\changeVoltaText "1., 3."
>e'4 f' g' |
>  }
>  {
>d'4 c' b' |
>  }
>  {
>\changeVoltaText \markup \with-color #red "4."
>g'4 a' b' |
>  }
>}
>c'1
> }
>
> \score {
>\test
> }
> 
>
>
>
> -- Aaron Hill
>

Thanks for this modification, Aaron Hill.
Ralph


-- 
Ralph Palmer
Seattle
USA
(he, him, his)
palmer.r.vio...@gmail.com
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Changing volta number text

2021-05-18 Thread Kieren MacMillan
Hi Ralph,

> I think it would be helpful to either have a snippet that shows how to change 
> a "normal" volta number setup (i.e., change the numbers and/or add text), or 
> to add something to the documentation.

The documentation is accurate, if not entirely clear…  =)

This is what I got using 
:

%%
\version "2.21.0"
\include "english.ly"

test = {
  \time 3/4
  a'4 b' c' |
  b'4 c' d' |
  {
{
  \set Score.repeatCommands = #'((volta "1., 3."))
  e'4 f' g' |
}
{
  \set Score.repeatCommands = #'(end-repeat (volta "2."))
  d'4 c' b' |
}
{
  \set Score.repeatCommands = #'(end-repeat (volta "4."))
  g'4 a' b' |
  \set Score.repeatCommands = #'((volta #f))
}
  }
  c'1
}

\score {
  \test
}
%%%

Note that I deleted the \repeat volta command, but kept the bracketing of your 
\alternative block for readability.

Hope this helps!
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info


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