reducing gap between vertical volta lines

2023-05-19 Thread Werner LEMBERG

As the attached image shows (Henle, Beethoven's violin sonatas
vol. 1), the vertical lines of the volta repeat are very near, much
nearer than what LilyPond produces by default.  What is the best way
to achieve this layout?


Werner


Re: N.C. No Chord poll

2023-05-19 Thread Knute Snortum
On Fri, May 19, 2023 at 8:56 PM David Wright 
wrote:

> On Fri 19 May 2023 at 22:35:04 (-0400), David Olson wrote:
> > 
>
> >
> >
> > the default setting for LilyPond chord engraving is: whenever there is a
> rest, to display "N.C."
> > Iteration after iteration, this default setting has persisted in all the
> versions of Lilypond I have ever used.
> >
> > Having always found this bizarre, I'm wondering now what other's think.
> >
> > 1. How many Lilyponders think that "N.C." is elegant?
> >


It seems fine and standard.


>
> > 2. How many guitar teachers instruct their students to keep strumming
> when they see a rest?
> >
> > 3. In what genres is it normative for guitars to continue strumming
> through every rest?
> >
> > 4. If genres exist where it is normative for guitar players to strum
> throughout a rest, in these genres is it also normative for the other
> musicians to sustain or fiddle throughout a rest?


Putting N.C. over rests seems to me to be perfectly acceptable behavior.


>
> >
> >
> > MORE SPECIFICALLY, the  page has a section:
> >
> > Customizing the no-chord symbol
> > By default, rests in a ChordNames context cause the “N.C.” symbol to be
> printed. This markup can be customized.
> >
> > • Two options are given for customization: a bar over the rest, and the
> text
> > "Ssh!"
> >
> > 5. Has anyone ever seen sheet music that uses the convention "Ssh!" over
> a rest?
>

Explanations often use funny examples.  I don't think anyone is seriously
suggesting to put a "Shh!" over a rest.


> > 6. Has anyone ever seen sheet music that places a bar over the rest?
> >
> > 7. The decision with every LilyPond iteration not to allow a third
> option, namely, normative blank over the rest, i.e. suppress the "N.C."
> gimmick -- what are the reasons which LilyPond insiders have found so
> persuasive over the years?
> >
> > 8. How many people feel that LilyPond is being clueless when it comes to
> making "N.C." the default setting?
> >
> > 9. How many people feel frustrated that the  page
> does not contain any information, or links to information, on suppressing
> the "N.C." symbol?
>

I find that people are very willing to get suggestions on how to improve
the manuals.  Why don't you write out what you think it should say?


> > NOTE THAT
> >
> >
> > \set noChordSymbol = ""
> > \set noChordSymbol = " "
> >
> > still results in "N.C." being engraved.
> >
> > Even in songs for children, I've never seen "Shh!" appear above a rest
> in the chords line. Has anybody?
> >
> > Why is this helpful?
> >
> > If the intention is not to be helpful, but cute, then it's an insult to
> anyone who wants to suppress the "N.C."


No one's trying to insult you.  It's just an example to illustrate that you
can change "N.C." to whatever you want.  Why not ask some honest questions
about what you want and how you want things changed?


Re: N.C. No Chord poll

2023-05-19 Thread Tim's Bitstream
Or s1 rather than r1.

> On May 19, 2023, at 10:56 PM, David Wright  wrote:
> 
> On Fri 19 May 2023 at 22:35:04 (-0400), David Olson wrote:
>>  
>> 
>> 
>> the default setting for LilyPond chord engraving is: whenever there is a 
>> rest, to display "N.C." 
>> Iteration after iteration, this default setting has persisted in all the 
>> versions of Lilypond I have ever used. 
>> 
>> Having always found this bizarre, I'm wondering now what other's think. 
>> 
>> 1. How many Lilyponders think that "N.C." is elegant? 
>> 
>> 2. How many guitar teachers instruct their students to keep strumming when 
>> they see a rest? 
>> 
>> 3. In what genres is it normative for guitars to continue strumming through 
>> every rest? 
>> 
>> 4. If genres exist where it is normative for guitar players to strum 
>> throughout a rest, in these genres is it also normative for the other 
>> musicians to sustain or fiddle throughout a rest? 
>> 
>> 
>> MORE SPECIFICALLY, the  page has a section: 
>> 
>> Customizing the no-chord symbol 
>> By default, rests in a ChordNames context cause the “N.C.” symbol to be 
>> printed. This markup can be customized. 
>> 
>> • Two options are given for customization: a bar over the rest, and the text 
>> "Ssh!" 
>> 
>> 5. Has anyone ever seen sheet music that uses the convention "Ssh!" over a 
>> rest? 
>> 
>> 6. Has anyone ever seen sheet music that places a bar over the rest? 
>> 
>> 7. The decision with every LilyPond iteration not to allow a third option, 
>> namely, normative blank over the rest, i.e. suppress the "N.C." gimmick -- 
>> what are the reasons which LilyPond insiders have found so persuasive over 
>> the years? 
>> 
>> 8. How many people feel that LilyPond is being clueless when it comes to 
>> making "N.C." the default setting? 
>> 
>> 9. How many people feel frustrated that the  page does 
>> not contain any information, or links to information, on suppressing the 
>> "N.C." symbol? 
>> 
>> NOTE THAT 
>> 
>> 
>> \set noChordSymbol = "" 
>> \set noChordSymbol = " " 
>> 
>> still results in "N.C." being engraved. 
>> 
>> Even in songs for children, I've never seen "Shh!" appear above a rest in 
>> the chords line. Has anybody? 
>> 
>> Why is this helpful? 
>> 
>> If the intention is not to be helpful, but cute, then it's an insult to 
>> anyone who wants to suppress the "N.C." 
>> 
>> How can it be otherwise? 
> 
> Try   \set noChordSymbol = ##f
> 
> Cheers,
> David.
> 
> 




Re: N.C. No Chord poll

2023-05-19 Thread David Wright
On Fri 19 May 2023 at 22:35:04 (-0400), David Olson wrote:
>  
> 
> 
> the default setting for LilyPond chord engraving is: whenever there is a 
> rest, to display "N.C." 
> Iteration after iteration, this default setting has persisted in all the 
> versions of Lilypond I have ever used. 
> 
> Having always found this bizarre, I'm wondering now what other's think. 
> 
> 1. How many Lilyponders think that "N.C." is elegant? 
> 
> 2. How many guitar teachers instruct their students to keep strumming when 
> they see a rest? 
> 
> 3. In what genres is it normative for guitars to continue strumming through 
> every rest? 
> 
> 4. If genres exist where it is normative for guitar players to strum 
> throughout a rest, in these genres is it also normative for the other 
> musicians to sustain or fiddle throughout a rest? 
> 
> 
> MORE SPECIFICALLY, the  page has a section: 
> 
> Customizing the no-chord symbol 
> By default, rests in a ChordNames context cause the “N.C.” symbol to be 
> printed. This markup can be customized. 
> 
> • Two options are given for customization: a bar over the rest, and the text 
> "Ssh!" 
> 
> 5. Has anyone ever seen sheet music that uses the convention "Ssh!" over a 
> rest? 
> 
> 6. Has anyone ever seen sheet music that places a bar over the rest? 
> 
> 7. The decision with every LilyPond iteration not to allow a third option, 
> namely, normative blank over the rest, i.e. suppress the "N.C." gimmick -- 
> what are the reasons which LilyPond insiders have found so persuasive over 
> the years? 
> 
> 8. How many people feel that LilyPond is being clueless when it comes to 
> making "N.C." the default setting? 
> 
> 9. How many people feel frustrated that the  page does not 
> contain any information, or links to information, on suppressing the "N.C." 
> symbol? 
> 
> NOTE THAT 
> 
> 
> \set noChordSymbol = "" 
> \set noChordSymbol = " " 
> 
> still results in "N.C." being engraved. 
> 
> Even in songs for children, I've never seen "Shh!" appear above a rest in the 
> chords line. Has anybody? 
> 
> Why is this helpful? 
> 
> If the intention is not to be helpful, but cute, then it's an insult to 
> anyone who wants to suppress the "N.C." 
> 
> How can it be otherwise? 

Try   \set noChordSymbol = ##f

Cheers,
David.



Re: Defining variables mid-stream in a music expression using tags.

2023-05-19 Thread dfro

On 5/19/23 05:38, Valentin Petzel wrote:

Hello David,


My conundrum is that I want to call the same music expression (that is
declared as a variable) from different staves, but also cause markup
functions inside the music expression to behave differently from outside
the music expression. Using tags is the only way I have found to do
that. I am glad that I have a method that works. Thank you for clearly
conveying to me that I should keep global variables static!

There is nothing that speaks against using tags for this, but you can do this
totally fine using music function. Not that it is necessary here, but if you
want to create scores in a more dynamic manner at some point going for music
functions is a way to go.


My noob thought is - why not allow custom variables to be declared when
making a \new Staff in its \with statement? These variables would have
the scope of working only on those calls to them that are from within
that particular staff. Different staves could create the same variable
with different values in their \with statement and thus change the
behavior of different functions within the same called music expression.
These variables would take precedence over global variables of the same
name. Please, take or leave.

We can in fact do that to some extent, which is context properties. The
problem with this is again the time at which things are evaluated. Basically
Lilypond works more or less like this:

  1) Parse and evaluate your ly file
  2) Now we should have a collection of scores. For each score:
  3) Iterate over the music expressions and send the events therein to the
relevant engravers in the relevant contexts
  4) We should now have a collection of grobs created by the engravers
  5) Position the grobs
  6) Position the scores
  7) Render everything

Context relevant properties only matter in step 3. The problem is that music
expressions are resolved in step 1, where we do not have such information.

What you are thinking about would need to get the context variables into the
music expression before it is evaluated, so you’d need some sort of
preprocessing step before step 1.

One way to do this would be to write your music function as string and parse
it everywhere you need it

#(define a "1")

myLilyCode = "
  { c'^\markup #a }
"

{ $(ly:parser-include-string myLilyCode) }

#(define a "2")
{ $(ly:parser-include-string myLilyCode) }

But essentially this will provide the same function as a music function, just
more prone to errors. Of course you could also do some non standard evaluation
stuff like this

myCode = #'#{ c^\markup #var #}

#(define var "1")
{ $(primitive-eval myCode) }

#(define var "2")
{ $(primitive-eval myCode) }

Of course, if we want to get funky we can do something like this:

evalWith =
#(define-scheme-function (alist expr) (list? scheme?)
(primitive-eval `(let ,(map (lambda (x) `(,(car x) ,(cdr x))) alist)
,expr)))

#(define var "1")

expr = #'#{ c'^\markup#var #}

{
  \evalWith #'() \expr
  \evalWith #'((var . "2")) \expr
}

which is like doing a music function, but will allow us to inject any kinds of
variables into an expression, while resolving to global bindings by default.
But I do not think it would be a particularly good idea to do so...

Cheers,
Valentin



Valentin,
Yes! Thank you for the explanation! You are really helping me to sort 
out some important basic concepts.


I am finally getting what you have been saying all along - that this all 
can be done with a music function.
I was not seeing that the whole music expression for the two staves can 
be wrapped inside a music function. For some reason I could not see it.

What I want can be accomplished with:


\version "2.24.1"

%Global variables
#(define global-var " gl-var-1")

music =
#(define-music-function
  (local-var)
  (markup?)
  #{
    c'^\markup \concat { #local-var #global-var }
  #})

\new StaffGroup
<<
  \new Staff
  { \music "lc-var-1" }
  \new Staff
  { \music "lc-var-2" }
>>



I do have a difference in the the output of the code below, which does 
not use \new Staff.


Without \textLengthOn, it makes two staves. With \textLenthOn, it 
combines the two music expressions into one stave. Why is that happening?



\version "2.24.1"

%Global variables
#(define global-var " gl-var-1")

music =
#(define-music-function
  (local-var)
  (markup?)
  #{
    \textLengthOn
    c'^\markup \concat { #local-var #global-var }
    c'^\markup \concat { #local-var #global-var }
  #})

\new StaffGroup
<<
{ \music "lc-var-1" }
{ \music "lc-var-2" }
>>


I like your "non-music function" examples. I see that your second and 
third example use primitive-eval. What does primitive-eval do and where 
could I read about it?


The third example uses scheme code that is beyond my comprehension, at 
the moment. I do not understand how you declared the music expression 
with myCode = #'#{ ... #}.  I have not seen that construction before.



Thank you for helping me write better code.


Peace,

David




N.C. No Chord poll

2023-05-19 Thread David Olson
 


the default setting for LilyPond chord engraving is: whenever there is a rest, 
to display "N.C." 
Iteration after iteration, this default setting has persisted in all the 
versions of Lilypond I have ever used. 

Having always found this bizarre, I'm wondering now what other's think. 

1. How many Lilyponders think that "N.C." is elegant? 

2. How many guitar teachers instruct their students to keep strumming when they 
see a rest? 

3. In what genres is it normative for guitars to continue strumming through 
every rest? 

4. If genres exist where it is normative for guitar players to strum throughout 
a rest, in these genres is it also normative for the other musicians to sustain 
or fiddle throughout a rest? 


MORE SPECIFICALLY, the  page has a section: 

Customizing the no-chord symbol 
By default, rests in a ChordNames context cause the “N.C.” symbol to be 
printed. This markup can be customized. 

• Two options are given for customization: a bar over the rest, and the text 
"Ssh!" 

5. Has anyone ever seen sheet music that uses the convention "Ssh!" over a 
rest? 

6. Has anyone ever seen sheet music that places a bar over the rest? 

7. The decision with every LilyPond iteration not to allow a third option, 
namely, normative blank over the rest, i.e. suppress the "N.C." gimmick -- what 
are the reasons which LilyPond insiders have found so persuasive over the 
years? 

8. How many people feel that LilyPond is being clueless when it comes to making 
"N.C." the default setting? 

9. How many people feel frustrated that the  page does not 
contain any information, or links to information, on suppressing the "N.C." 
symbol? 

NOTE THAT 


\set noChordSymbol = "" 
\set noChordSymbol = " " 

still results in "N.C." being engraved. 

Even in songs for children, I've never seen "Shh!" appear above a rest in the 
chords line. Has anybody? 

Why is this helpful? 

If the intention is not to be helpful, but cute, then it's an insult to anyone 
who wants to suppress the "N.C." 

How can it be otherwise? 

David Olson 


Re: Defining variables mid-stream in a music expression using tags.

2023-05-19 Thread Valentin Petzel
Hello David,

> My conundrum is that I want to call the same music expression (that is
> declared as a variable) from different staves, but also cause markup
> functions inside the music expression to behave differently from outside
> the music expression. Using tags is the only way I have found to do
> that. I am glad that I have a method that works. Thank you for clearly
> conveying to me that I should keep global variables static!

There is nothing that speaks against using tags for this, but you can do this 
totally fine using music function. Not that it is necessary here, but if you 
want to create scores in a more dynamic manner at some point going for music 
functions is a way to go.

> My noob thought is - why not allow custom variables to be declared when
> making a \new Staff in its \with statement? These variables would have
> the scope of working only on those calls to them that are from within
> that particular staff. Different staves could create the same variable
> with different values in their \with statement and thus change the
> behavior of different functions within the same called music expression.
> These variables would take precedence over global variables of the same
> name. Please, take or leave.

We can in fact do that to some extent, which is context properties. The 
problem with this is again the time at which things are evaluated. Basically 
Lilypond works more or less like this:

 1) Parse and evaluate your ly file
 2) Now we should have a collection of scores. For each score:
 3) Iterate over the music expressions and send the events therein to the 
relevant engravers in the relevant contexts
 4) We should now have a collection of grobs created by the engravers
 5) Position the grobs
 6) Position the scores
 7) Render everything

Context relevant properties only matter in step 3. The problem is that music 
expressions are resolved in step 1, where we do not have such information.

What you are thinking about would need to get the context variables into the 
music expression before it is evaluated, so you’d need some sort of 
preprocessing step before step 1.

One way to do this would be to write your music function as string and parse 
it everywhere you need it

#(define a "1")

myLilyCode = "
 { c'^\markup #a }
"

{ $(ly:parser-include-string myLilyCode) }

#(define a "2")
{ $(ly:parser-include-string myLilyCode) }

But essentially this will provide the same function as a music function, just 
more prone to errors. Of course you could also do some non standard evaluation 
stuff like this

myCode = #'#{ c^\markup #var #}

#(define var "1")
{ $(primitive-eval myCode) }

#(define var "2")
{ $(primitive-eval myCode) }

Of course, if we want to get funky we can do something like this:

evalWith =
#(define-scheme-function (alist expr) (list? scheme?)
   (primitive-eval `(let ,(map (lambda (x) `(,(car x) ,(cdr x))) alist) 
,expr)))

#(define var "1")

expr = #'#{ c'^\markup#var #}

{
 \evalWith #'() \expr
 \evalWith #'((var . "2")) \expr
}

which is like doing a music function, but will allow us to inject any kinds of 
variables into an expression, while resolving to global bindings by default. 
But I do not think it would be a particularly good idea to do so...

Cheers,
Valentin


signature.asc
Description: This is a digitally signed message part.


Re: Moving note in three-voice context

2023-05-19 Thread Andrew Bernard
Which is needless to say, the whole philosophical basis of Lilypond and 
it's huge strength.


Andrew

On 19/05/2023 6:11 am, Jakob Pedersen wrote:

there's really very little to tweak!