Re: Shortcut for \repeat unfold

2021-09-30 Thread David Kastrup
Dan Eble writes: >> On Sep 24, 2021, at 19:32, Jean Abou Samra wrote: >> >> - "\rep n music", not as self-telling (and I think Lukas >> only calls his shortcut \rep because redefining \repeat >> is not syntactically valid); > > What about killing two birds with two stones? > > 1. convert-ly

Re: Shortcut for \repeat unfold

2021-09-29 Thread Dan Eble
> On Sep 24, 2021, at 19:32, Jean Abou Samra wrote: > > - "\rep n music", not as self-telling (and I think Lukas > only calls his shortcut \rep because redefining \repeat > is not syntactically valid); What about killing two birds with two stones? 1. convert-ly \times A/B into \tuplet B/A

Re: Shortcut for \repeat unfold

2021-09-29 Thread Lukas-Fabian Moser
28x { d a b fs | g d g a } https://gitlab.com/lilypond/lilypond/-/merge_requests/937 That is a clever proposal. I am already fond of it. Thank you. This looks so "natural" (in the non-computer science-way of the meaning) one is surprised it works. :-) What this means is that if you cre

Re: Shortcut for \repeat unfold

2021-09-29 Thread David Kastrup
Jean Abou Samra writes: > It's not unconceivable to build whitespace into the > lexer pattern and have { 5 x c'1 } work. > What this means is that if you create a custom note > name language (with the undocumented not-yet-having-interface > #(set! language-pitch-names (acons 'mylang my-pitch-al

Re: Shortcut for \repeat unfold

2021-09-28 Thread Werner LEMBERG
>> 28x { d a b fs | g d g a } >> >> https://gitlab.com/lilypond/lilypond/-/merge_requests/937 > > That is a clever proposal. I am already fond of it. Thank you. +1 >> I like that, thanks! Carl's concerns w.r.t. whitespace are valid, >> though. Would it be possible to make the invalid syntax

Re: Shortcut for \repeat unfold

2021-09-28 Thread Jean Abou Samra
Le 29/09/2021 à 01:50, Dan Eble a écrit : On Sep 24, 2021, at 19:32, Jean Abou Samra wrote: Other possibilities: - "\rep n music", not as self-telling (and I think Lukas only calls his shortcut \rep because redefining \repeat is not syntactically valid); - "music * n", attractive but the

Re: Shortcut for \repeat unfold

2021-09-28 Thread Werner LEMBERG
> 28x { d a b fs | g d g a } I like that, thanks! Carl's concerns w.r.t. whitespace are valid, though. Would it be possible to make the invalid syntax '28 x' produce a nice error message like invalid , did you mean '28x'? Werner

Re: Shortcut for \repeat unfold

2021-09-28 Thread Carl Sorensen
On 9/28/21, 6:16 PM, "Dan Eble" wrote: On Sep 28, 2021, at 20:12, Carl Sorensen wrote: > > Would >28 x { d a b fs | g d g a } > > Work with the current MR? No, the x is a suffix. 28 would be parsed as a duration (an invalid one) and x as a note na

Re: Shortcut for \repeat unfold

2021-09-28 Thread Dan Eble
On Sep 28, 2021, at 20:12, Carl Sorensen wrote: > > Would >28 x { d a b fs | g d g a } > > Work with the current MR? No, the x is a suffix. 28 would be parsed as a duration (an invalid one) and x as a note name (an invalid one). — Dan

Re: Shortcut for \repeat unfold

2021-09-28 Thread Carl Sorensen
On 9/28/21, 5:51 PM, "lilypond-devel on behalf of Dan Eble" wrote: > On Sep 24, 2021, at 19:32, Jean Abou Samra wrote: > > Other possibilities: > > - "\rep n music", not as self-telling (and I think Lukas > only calls his shortcut \rep because redefining \rep

Re: Shortcut for \repeat unfold

2021-09-28 Thread Dan Eble
> On Sep 24, 2021, at 19:32, Jean Abou Samra wrote: > > Other possibilities: > > - "\rep n music", not as self-telling (and I think Lukas > only calls his shortcut \rep because redefining \repeat > is not syntactically valid); > - "music * n", attractive but the difference between c1*5 >

Re: Shortcut for \repeat unfold

2021-09-28 Thread David Kastrup
Lukas-Fabian Moser writes: >>> I answer somewhat orthogonally to your question: I think that for many >>> people it's a lot easier to digest the information >>> >>> "\* creates unfolded repeats; this behaviour may be changed using >>> \defaultRepeatType percent" >> That is one step forward, one s

Re: Shortcut for \repeat unfold

2021-09-28 Thread Lukas-Fabian Moser
I answer somewhat orthogonally to your question: I think that for many people it's a lot easier to digest the information "\* creates unfolded repeats; this behaviour may be changed using \defaultRepeatType percent" That is one step forward, one step back: one advantage of a fixed shorthand i

Re: Shortcut for \repeat unfold

2021-09-28 Thread David Kastrup
Lukas-Fabian Moser writes: > I answer somewhat orthogonally to your question: I think that for many > people it's a lot easier to digest the information > > "\* creates unfolded repeats; this behaviour may be changed using > \defaultRepeatType percent" That is one step forward, one step back: on

Re: Shortcut for \repeat unfold

2021-09-28 Thread Lukas-Fabian Moser
Maybe it helps to give some context: The discussion started with the problem of skipping notes in lyrics (using \addlyrics {} / \lyricsto {}) in the documentation. In order to skip multiple notes, the documentation currently suggests ugly things like \repeat unfold 2 { \skip 1 } that a) ar

Re: Shortcut for \repeat unfold

2021-09-28 Thread David Kastrup
Jean Abou Samra writes: > This seems a likely cause for current success: > > > commit b0c6d48388c66aa12a472a6069f5b2ec07c579b2 > Author: Han-Wen Nienhuys > Date:   Sun Feb 14 11:15:17 2021 +0100 > >     Initialize session from a dedicated parser > >     The session mechanism reads the initializa

Re: Shortcut for \repeat unfold

2021-09-28 Thread Jean Abou Samra
Le 27/09/2021 à 23:52, David Kastrup a écrit : Jean Abou Samra writes: is not entirely true: once a function is defined, it can be relied on internally. Imagine my embarrassment when I had to explain on -user-fr the cause of the error occurring with the code (minimized here): cons = \markup \

Re: Shortcut for \repeat unfold

2021-09-27 Thread David Kastrup
Carl Sorensen writes: > On 9/27/21, 3:52 PM, "lilypond-devel on behalf of David Kastrup" > behalf of d...@gnu.org> wrote: > > Jean Abou Samra writes: > > > is not entirely true: once a function is defined, it can be > > relied on internally. Imagine my embarrassment when I had

Re: Shortcut for \repeat unfold

2021-09-27 Thread David Kastrup
Jean Abou Samra writes: > I *think* it means a token of lookahead is required > after most curly braces, which *may* have consequences > on synchronization between lexer and parser around mode > boundaries — at any rate, parser.yy contains the comment > > // We must not have lookahead tokens pars

Re: Shortcut for \repeat unfold

2021-09-27 Thread Carl Sorensen
On 9/27/21, 3:52 PM, "lilypond-devel on behalf of David Kastrup" wrote: Jean Abou Samra writes: > is not entirely true: once a function is defined, it can be > relied on internally. Imagine my embarrassment when I had to > explain on -user-fr the cause of the error occur

Re: Shortcut for \repeat unfold

2021-09-27 Thread David Kastrup
Jean Abou Samra writes: > is not entirely true: once a function is defined, it can be > relied on internally. Imagine my embarrassment when I had to > explain on -user-fr the cause of the error occurring with > the code (minimized here): > > cons = \markup \tiny "conséquent" > > { >   \stemDown >

Re: Shortcut for \repeat unfold

2021-09-27 Thread Jean Abou Samra
Le 25/09/2021 à 17:25, Dan Eble a écrit : On Sep 25, 2021, at 06:32, Lukas-Fabian Moser wrote: "\*" = #(define-music-function (n mus) (index? ly:music?) #{ \repeat $repeat-shorthand $n { #mus } #}) Instead of debating a default repeat type and function, why not provide access to repetit

Re: Shortcut for \repeat unfold

2021-09-26 Thread Hans Åberg
> On 26 Sep 2021, at 10:16, Jean Abou Samra wrote: > > Le 26/09/2021 à 09:57, Hans Åberg a écrit : >>> On 26 Sep 2021, at 06:49, Werner LEMBERG wrote: >>> >>> You might provide a MR, maybe it gets accepted. I still doubt that it >>> would be a good idea. >> There is a conflict in some contex

Re: Shortcut for \repeat unfold

2021-09-26 Thread Jean Abou Samra
Le 26/09/2021 à 09:57, Hans Åberg a écrit : On 26 Sep 2021, at 06:49, Werner LEMBERG wrote: The idea here is different, it is for identifiers, and in the input syntax only, does not change the internal semantics at all. It is good not having to type backslash when a command is used. Really

Re: Shortcut for \repeat unfold

2021-09-26 Thread Hans Åberg
> On 26 Sep 2021, at 06:49, Werner LEMBERG wrote: > The idea here is different, it is for identifiers, and in the input syntax only, does not change the internal semantics at all. It is good not having to type backslash when a command is used. >>> >>> Really? I highly doubt tha

Re: Shortcut for \repeat unfold

2021-09-25 Thread Werner LEMBERG
>>> The idea here is different, it is for identifiers, and in the >>> input syntax only, does not change the internal semantics at all. >>> It is good not having to type backslash when a command is used. >> >> Really? I highly doubt that. In particular, what about lyrics >> mode? > > The idea w

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Dan Eble writes: > On Sep 25, 2021, at 18:55, David Kastrup wrote: >> >> Subject: [PATCH] Allow partial \repeat commands without \alternative >> >> This allows using >> >>\repeat \etc >> >> and >> >>\repeat \etc >> >> to act like partial music functions in order to make it easy

Re: Shortcut for \repeat unfold

2021-09-25 Thread Dan Eble
On Sep 25, 2021, at 18:55, David Kastrup wrote: > > Subject: [PATCH] Allow partial \repeat commands without \alternative > > This allows using > >\repeat \etc > > and > >\repeat \etc > > to act like partial music functions in order to make it easy to define > abbreviations. Howev

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Dan Eble writes: > On Sep 25, 2021, at 14:27, David Kastrup wrote: >> >> Dan Eble writes: >> >> How about we change \repeat ... \alternative in its structure to be >> \repeat ... { \alternative ... }, namely introduce a separate music >> expression for \alternative? That way neither \repeat

Re: Shortcut for \repeat unfold

2021-09-25 Thread Dan Eble
On Sep 25, 2021, at 14:27, David Kastrup wrote: > > Dan Eble writes: > > How about we change \repeat ... \alternative in its structure to be > \repeat ... { \alternative ... }, namely introduce a separate music > expression for \alternative? That way neither \repeat nor \alternative > need to

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Dan Eble writes: > On Sep 25, 2021, at 06:32, Lukas-Fabian Moser wrote: >> >> >> "\*" = >> #(define-music-function (n mus) (index? ly:music?) >>#{ \repeat $repeat-shorthand $n { #mus } #}) >> > > Instead of debating a default repeat type and function, why not > provide access to repetitio

Re: Shortcut for \repeat unfold

2021-09-25 Thread Hans Åberg
> On 25 Sep 2021, at 19:25, Werner LEMBERG wrote: > Perhaps the LilyPond syntax might be tweaked so that identifiers starting with a UTF-8 multi-byte (high bit set) character do not need the backslash. Then simply ×2 would look good. >>> >>> This reminds me of TeX's 'active cha

Re: Shortcut for \repeat unfold

2021-09-25 Thread Werner LEMBERG
>>> Perhaps the LilyPond syntax might be tweaked so that identifiers >>> starting with a UTF-8 multi-byte (high bit set) character do not >>> need the backslash. Then simply ×2 would look good. >> >> This reminds me of TeX's 'active characters'. I think we shouldn't >> go this route. IMHO, a co

Re: Shortcut for \repeat unfold

2021-09-25 Thread Hans Åberg
> On 25 Sep 2021, at 18:37, Werner LEMBERG wrote: > >>> And I think it would be nice to have an even more natural variant >>> for that; I think it's reasonable to provide & show/recommend >>> convenient solutions for standard tasks (rather than say "you can >>> define your own abbreviation here

Re: Shortcut for \repeat unfold

2021-09-25 Thread Werner LEMBERG
>> And I think it would be nice to have an even more natural variant >> for that; I think it's reasonable to provide & show/recommend >> convenient solutions for standard tasks (rather than say "you can >> define your own abbreviation here if you know how to do so") - for >> example, >> >> \*2 "

Re: Shortcut for \repeat unfold

2021-09-25 Thread Dan Eble
On Sep 25, 2021, at 06:32, Lukas-Fabian Moser wrote: > > > "\*" = > #(define-music-function (n mus) (index? ly:music?) >#{ \repeat $repeat-shorthand $n { #mus } #}) > Instead of debating a default repeat type and function, why not provide access to repetition as a music function with a cl

Re: Shortcut for \repeat unfold

2021-09-25 Thread Hans Åberg
> On 25 Sep 2021, at 17:47, Lukas-Fabian Moser wrote: > > And I think it would be nice to have an even more natural variant for that; I > think it's reasonable to provide & show/recommend convenient solutions for > standard tasks (rather than say "you can define your own abbreviation here if

Re: Shortcut for \repeat unfold

2021-09-25 Thread Lukas-Fabian Moser
Hi Jean, I think it's a trap to see \repeat unfold as syntactic sugar for repeating a sequence of characters n times in the input. For instance, \relative { \repeat unfold 4 c'1 } is not the same as \relative { c'1 c'1 c'1 c'1 } Yes, of course. But I'd be very surprised if a large percentage

Re: Shortcut for \repeat unfold

2021-09-25 Thread Lukas-Fabian Moser
"\*" = #(define-music-function (n mus) (index? ly:music?) #{ \repeat $repeat-shorthand $n { #mus } #}) Instead of debating a default repeat type and function, why not provide access to repetition as a music function with a clear name like \repeatFunction type n music And let the us

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Jean Abou Samra writes: > Le 25/09/2021 à 09:46, Lukas-Fabian Moser a écrit : >> Hi, >> >>> In short, I propose to make the first argument to >>> \repeat optional, making \repeat n music equivalent to >>> \repeat unfold n music. >> >> Thanks for working on that! >> >> The issue I have with your i

Re: Shortcut for \repeat unfold

2021-09-25 Thread Jean Abou Samra
Le 25/09/2021 à 09:46, Lukas-Fabian Moser a écrit : Hi, In short, I propose to make the first argument to \repeat optional, making \repeat n music equivalent to \repeat unfold n music. Thanks for working on that! The issue I have with your idea is that to me, \repeat unfold and \repeta volt

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Jean Abou Samra writes: > Le 25/09/2021 à 14:44, David Kastrup a écrit : >> Aaron Hill writes: >>> Still, be pedantic and miss the forest for the trees, my point was >>> that \x is a good option if \* was going to be problematic. >> Sure, but the problem with \× is exactly that × is not part

Re: Shortcut for \repeat unfold

2021-09-25 Thread anthony
On 25/09/2021 10:19, Lukas-Fabian Moser wrote: Just as a counter-point, while I'm a light user / copyist, I don't think I've EVER used repeat unfold, while repeat percent happens a lot. I actually quite like the "\x16 d8" idea as a shortcut, but what I'm saying is don't think it's a good ide

Re: Shortcut for \repeat unfold

2021-09-25 Thread Jean Abou Samra
Le 25/09/2021 à 14:44, David Kastrup a écrit : Aaron Hill writes: Still, be pedantic and miss the forest for the trees, my point was that \x is a good option if \* was going to be problematic. Sure, but the problem with \× is exactly that × is not part of ASCII and thus does not uniformly

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Aaron Hill writes: > On 2021-09-25 5:11 am, David Kastrup wrote: >> Aaron Hill writes: >> >>> On 2021-09-25 12:46 am, Lukas-Fabian Moser wrote: Aaron: > If the asterisk feels overloaded, you could use the multiplication > sign: > > \version "2.22.0" > × = % U

Re: Shortcut for \repeat unfold

2021-09-25 Thread Aaron Hill
On 2021-09-25 5:11 am, David Kastrup wrote: Aaron Hill writes: On 2021-09-25 12:46 am, Lukas-Fabian Moser wrote: Aaron: If the asterisk feels overloaded, you could use the multiplication sign: \version "2.22.0" × = % U+00D7 I'd advise against introducing non-ASCII commands. Users won'

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Aaron Hill writes: > On 2021-09-25 12:46 am, Lukas-Fabian Moser wrote: >> Aaron: >> >>> If the asterisk feels overloaded, you could use the multiplication >>> sign: >>> >>> \version "2.22.0" >>> × = % U+00D7 >> I'd advise against introducing non-ASCII commands. Users won't be >> happy if th

Re: Shortcut for \repeat unfold

2021-09-25 Thread Aaron Hill
On 2021-09-25 12:46 am, Lukas-Fabian Moser wrote: Aaron: If the asterisk feels overloaded, you could use the multiplication sign: \version "2.22.0" × = % U+00D7 I'd advise against introducing non-ASCII commands. Users won't be happy if they can't find on their keyboards what the docume

Re: Shortcut for \repeat unfold

2021-09-25 Thread Lukas-Fabian Moser
IS unfold the best candidate? Just because the OP makes extensive use of it, doesn't mean everyone else does. I'd rather it was percent, but I suspect I genuinely am a minority. One of the reasons I argue against making \repeat $n \music equivalent to some \repeat X $n \music. An implemen

Re: Shortcut for \repeat unfold

2021-09-25 Thread Lukas-Fabian Moser
But your special-character argument made me think: Maybe it would be possible to get rid of the * sign? Maybe I'm missing something, but isn't \{unsigned int} still "available" so one could do \16 d8 instead of \*16 d8 ? Of course, probably only David K. can say for sure what implications that wou

Re: Shortcut for \repeat unfold

2021-09-25 Thread David Kastrup
Lukas-Fabian Moser writes: > But your special-character argument made me think: Maybe it would be > possible to get rid of the * sign? Maybe I'm missing something, but > isn't \{unsigned int} still "available" so one could do \16 d8 instead > of \*16 d8 ? Of course, probably only David K. can say

Re: Shortcut for \repeat unfold

2021-09-25 Thread Lukas-Fabian Moser
Just as a counter-point, while I'm a light user / copyist, I don't think I've EVER used repeat unfold, while repeat percent happens a lot. I actually quite like the "\x16 d8" idea as a shortcut, but what I'm saying is don't think it's a good idea, just because YOU do it a lot. Other people

Re: Shortcut for \repeat unfold

2021-09-25 Thread Werner LEMBERG
What about using '**' to indicate repetition? Other programming languages use '**' to indicate exponentiation, thus the analogy to repetition wouldn't be too far-fetched. c'*2*0.5 ** 5 { c'2 d } ** 4 No idea whether this is easily doable in LilyPond's grammar. Werner

Re: Shortcut for \repeat unfold

2021-09-25 Thread antlists
On 25/09/2021 08:46, Lukas-Fabian Moser wrote: Absolutely. Of course it depends on which type of music you engrave, but in my "common practice"-heavy everyday work, \repeat unfold 16 d8 comes up _very_ often. Just as a counter-point, while I'm a light user / copyist, I don't think I've EVER u

Re: Shortcut for \repeat unfold

2021-09-25 Thread Lukas-Fabian Moser
Hi, In short, I propose to make the first argument to \repeat optional, making \repeat n music equivalent to \repeat unfold n music. Thanks for working on that! The issue I have with your idea is that to me, \repeat unfold and \repeta volta/tremolo have slightly different semantics: \repea

Re: Shortcut for \repeat unfold

2021-09-24 Thread Aaron Hill
On 2021-09-24 4:32 pm, Jean Abou Samra wrote: - "\* n music", very short but doesn't read as nicely I think,   and I don't view repeats as special enough to warrant   this kind of syntax with many special characters. I would disagree. Such an abbreviation is sensible when repeating singleton