Re: clefs, time signatures, and key signatures

2023-12-08 Thread Werner LEMBERG

> I’ve just looked at the images and especially w/r to the Alto clef I
> strongly prefer the new spacing.  For the others there are spots
> where I’m not sure it is too tight but overall the new spacing
> appears to be more balanced.
> 
> I thus think the new spacing is better overall.

Thanks, but I would like to know whether you prefer the top
(alto-based) or bottom (treble-based) image on

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2188


Werner


Re: clefs, time signatures, and key signatures

2023-12-08 Thread Michael Gerdau
I’ve just looked at the images and especially w/r to the Alto clef I strongly 
prefer the new spacing.
For the others there are spots where I’m not sure it is too tight but overall 
the new spacing appears to be more balanced.

I thus think the new spacing is better overall.

Kind regards 
Michael 

Mobil gesendet

> Am 09.12.2023 um 08:12 schrieb Werner LEMBERG :
> 
> 
>>> please have a look at Merge Request 2188 and comment there on how
>>> to proceed with the new distances between clefs and time
>>> signatures, together with the new distances between clefs and key
>>> signatures.
>>> 
>>>  https://gitlab.com/lilypond/lilypond/-/merge_requests/2188
>>> 
>>> The question is whether the new distances should be based on the
>>> widest standard clef glyph (which is the alto clef, and which is
>>> done currently in the MR), or whether they should be based on the
>>> most common one, the treble clef.
>> 
>> For better comparison, I've updated/added the screenshots in the MR
>> so that you can do a blink-comparison of the images.
> 
> A few people responded, and the opinions are exactly 50:50.  It would
> be great if more people could chime in!
> 
> 
>Werner
> 




Re: clefs, time signatures, and key signatures

2023-12-08 Thread Werner LEMBERG


>> please have a look at Merge Request 2188 and comment there on how
>> to proceed with the new distances between clefs and time
>> signatures, together with the new distances between clefs and key
>> signatures.
>> 
>>   https://gitlab.com/lilypond/lilypond/-/merge_requests/2188
>> 
>> The question is whether the new distances should be based on the
>> widest standard clef glyph (which is the alto clef, and which is
>> done currently in the MR), or whether they should be based on the
>> most common one, the treble clef.
> 
> For better comparison, I've updated/added the screenshots in the MR
> so that you can do a blink-comparison of the images.

A few people responded, and the opinions are exactly 50:50.  It would
be great if more people could chime in!


Werner



Unexpected bar boundaries with volta repeats and lyrics.

2023-12-08 Thread Kevin Pye
Compiling the following lilypond code:

\version "2.25.10" 

music = \relative { 
   \time 4/4 
   \repeat volta 2 { 
  d'1 | 
  \alternative { 
 { d1 | } 
 { | r4 d2 d4 | d1 } 
  } 
   } 
   \bar "|." 
} 

words = \lyricmode { 
   \repeat volta 2 { 
  a 
  \alternative { 
 { b } 
 { c d e } 
  } 
   } 
} 

\score { 
   \new Staff << 
  \new Voice \music 
  \addlyrics \words 
   >> 
}

gives the following output:

> lilypond test.ly 
GNU LilyPond 2.25.10 (running Guile 2.2) 
Processing `test.ly' 
Parsing... 
Interpreting music... 
test.ly:9:20: warning: bar check failed at: 3/4 
   { | r4 d2 d4 
| d1 } 
Preprocessing graphical objects... 
Finding the ideal number of pages... 
Fitting music on 1 page... 
Drawing systems... 
Converting to `test.pdf'... 
Success: compilation successfully completed

and the produced score is:


The same result is produced with 2.24.3 and 2.25.10.

Removing the lyrics, gives:
with no error messages and bar lines where I would expect them.

Similarly, if the bar "r4 d2 d4" is replaced with "d4 d2 d4", then the 
resultant output is:


which also has no error message and bar lines where I would expect.

What silly mistake am I making here?

Kevin.





Re: Video generation from multiple pages

2023-12-08 Thread Jean Abou Samra

> The after-line-breaking callback appears to be in stable/2.20 from git.
> At least in system.cc.


Yes, but it was not called for System specifically until

commit 782f5528e014cc3c7f705298a83f777306541e89
Author: Jean Abou Samra 
Date:   Mon Mar 21 21:21:28 2022 +0100

Also call after-line-breaking/before-line-breaking/springs-and-rods on 
System

This makes System consistent with other grobs and allows for
customizations and debugging.


which appeared in 2.23.7.


> 
> It doesn't work on my version.
> 
> Drawing systems...mwe.ly:36:4: In expression (when (eqv? LEFT #) (let #
> #)):
> mwe.ly:36:4: Unbound variable: when
> 
> Unless there is a syntax error I don't see.
> 
> I tried it in 2.24.3 and it didn't work there either.  Same error.
> There might be an extra parens in there, but I don't understand all
> the syntax.
> 
> For fun I also tried:
> 
> \layout {
>   \context {
>     \Score
>     \override System.after-line-breaking = #dump-col-info
>   }
> }
> 
> to see if that error would trigger on System.after-line-breaking and
> the error didn't occur on 2.24.3.  This implies that the after-line-
> breaking callback is broken for the System object.



Please triple check that you are actually running 2.24.3.

System.after-line-breaking not working hints at a pre-2.23.7 version,
and 'when' being unbound means it's built with Guile 1 as opposed to
Guile 2 or Guile 3, which is impossible in LilyPond 2.24.



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


Re: Video generation from multiple pages

2023-12-08 Thread Stefano Antonelli
On Tue, 2023-12-05 at 11:23 +0100, Jean Abou Samra wrote:
> Is this the sort of thing you're looking for?
> 
> #(define (dump-system-info sys)
>(let* ((right (ly:spanner-bound sys RIGHT))
>   (time (ly:grob-property right 'when 0)))
>  (format #t "\nline break at ~f" (ly:moment-main time
> 
> \layout {
>   \context {
> \Score
> \override System.after-line-breaking = #dump-system-info
>   }
> }
> It should work on LilyPond 2.23.7 or later (current stable is 2.24). 

It doesn't work on 2.20 which is what I have installed (Ubuntu 20.04).
It also doesn't work on 2.24.3.  Doesn't work means I don't see any
"line break" prints.

> This:
> 
> > \layout {
> >   \context {
> > \Staff
> > \override System.after-line-breaking = #printPage
> >   }
> > }
> > should work. And it doesn't. I tried \Score context,
> > 
> 
> probably means you're running an older version.

The after-line-breaking callback appears to be in stable/2.20 from git.
 At least in system.cc.

<
https://github.com/lilypond/lilypond/blob/2a3a1ed05c3129a76e6531d3bc8b9d4f717a0175/lily/system.cc#L191C1-L191C58
>

I assume that get_property is used to evaluate a scheme expression?  Or
am I not looking at the right thing?

> Listening to page-break-event in an engraver is not what you're
> looking for — these are only emitted for explicit \break commands.

As I suspected, thanks for confirming.

> Another way would be
> 
> #(define (dump-col-info col)
>(when (eqv? LEFT (ly:item-break-dir col))
>  (let ((time (ly:grob-property col 'when 0)))
>(format #t "\nline break at ~f" (ly:moment-main time)
> 
> \layout {
>   \context {
> \Score
> \override NonMusicalPaperColumn.after-line-breaking = #dump-col-
> info
>   }
> }

It doesn't work on my version.

Drawing systems...mwe.ly:36:4: In expression (when (eqv? LEFT #) (let #
#)):
mwe.ly:36:4: Unbound variable: when

Unless there is a syntax error I don't see.

I tried it in 2.24.3 and it didn't work there either.  Same error.
 There might be an extra parens in there, but I don't understand all
the syntax.

For fun I also tried:

\layout {
  \context {
\Score
\override System.after-line-breaking = #dump-col-info
  }
}

to see if that error would trigger on System.after-line-breaking and
the error didn't occur on 2.24.3.  This implies that the after-line-
breaking callback is broken for the System object.

> which prints the time of all NonMusicalPaperColumn grobs that are
> just before a line break. Note the difference between a PaperColumn,
> which is on a vertical alignment of notes, and a
> NonMusicalPaperColumn, which is between two PaperColumns (or at one
> extreme end of the system). There is a diagram here about ly:item-
> break-dir.
> 
> Both of these methods will print at each line break, but since you
> have just one system per page, that's equivalent to printing page
> breaks in your case.

Right, that's the workaround I had in mind.



Re: accessing current file name in markup function

2023-12-08 Thread Werner LEMBERG

>> The name "sip" is a bit weird; looking in the commit that added the
>> code 19 years ago, it looks like it was meant as "smob input"
>> (where smob = Scheme object = LilyPond C++ object made available to
>> Scheme).

Quickly written documentation by an insider.  It should be eventually
replaced with better wording...

> The technical glossary
> (https://lilypond.org/doc/v2.24/Documentation/notation/technical-glossary)
> does include smob but not sip.

... so that we don't have to explain it.

> And I had misinterpreted *location* as either an attempt at emphasis
> in email and/or short for insert-your-location-here rather than
> literally executable scheme code.
> 
> Is that construct (*location*) a general scheme syntax (so that some
> *foo* could be also be meaningful), or perhaps is it a reserved
> word?

Yes, `*` is nothing special – in Scheme you can use almost all
characters for function and variable names.  You might try LilyPond's
Scheme sandbox:

```
lilypond scheme-sandbox
[...]
scheme@(#{ g125}#)> *location*
$1 = #
scheme@(#{ g125}#)> (*location*)
$2 = #
scheme@(#{ g125}#)> (ly:input-file-line-char-column (*location*))
$3 = (".../scheme-sandbox.ly" 34 1 1)
```

And of course, documentation for `*location*` is missing, too.  You
might open an issue for this.


Werner


Re: accessing current file name in markup function

2023-12-08 Thread Jeff Olson

On 12/7/2023 12:21 PM, Jean Abou Samra wrote:


Documentation question from trying to understand *location* in 
David's solution:




Guessing, is sip a stream input pointer? _Where would I look to find 
the definition/example of sip?_






 *location* doesn't return a string but a special type of 
location/input object.


The name "sip" is a bit weird; looking in the commit that added the 
code 19 years ago, it looks like it was meant as "smob input" (where 
smob = Scheme object = LilyPond C++ object made available to Scheme).


Thanks for the explanation, Jean.

The technical glossary 
(https://lilypond.org/doc/v2.24/Documentation/notation/technical-glossary) 
does include smob but not sip.


And I had misinterpreted *location* as either an attempt at emphasis in 
email and/or short for insert-your-location-here rather than literally 
executable scheme code.


Is that construct (*location*) a general scheme syntax (so that some 
*foo* could be also be meaningful), or perhaps is it a reserved word?


My attempts to search the Lilypond index for *location* seemed to ignore 
the asterisks or take them as wild-cards.  Ditto when trying the sphinx 
search icon in your https://extending-lilypond.gitlab.io/en/scheme/.


Not to snark, but perhaps I should cease my hunting of the elusive *sip* 
for fear that it is a boojum, causing me to softly and suddenly vanish away.


Thanks,
Je...


ly2video windows build

2023-12-08 Thread Stefano Antonelli
Hello list,

I don't know if this is of use to anyone, but please let me know if it
is.  I'm going to see if I can get github to produce this zip file
through a github action.

This is a modified version of ly2video.git.  The modifications are not
hosted anywhere yet.

Python is not required on the target machine.  All the python
dependencies have been compiled into ly2video.exe.  Also ffmpeg and
timidity have been included and there is a soundfont included too.

The soundfont is FluidR3_GM.sf2 which is the same as used on my linux
machine.  I also copied the timidity.cfg from my linux machine.  I have
no idea if it's any good for what people need it for.

This file will be hosted for 30 days:

https://ufile.io/cwpc7ny7

The zip file is 183MB.  The soundfont is 148 of those MBs.

Once the paths have been modified, you should be able to run from where
you unpacked it:

ly2video -i test.ly

Below is the readme from the zip:

ly2video windows build

This is a selfcontained build of ly2video using pyinstaller in wine.

Additionally, two of the three external dependencies have been bundled.

To make this work, two files must be modified:

timidity.cfg
ly2video.cfg

In both files edit the paths.  For example, if you unpacked this zip
file in:

C:\Users\Me\My Documents

then modify timidity.cfg to:

dir C:\Users\Me\My Documents\ly2video\TiMidity++-2.15.0

and ly2video.cfg to:

lilypond-windows=C:\path\to\your\lilypond\bin\
ffmpeg-windows=C:\Users\Me\My Documents\ly2video\ffmpeg-master-latest-
win64-gpl\bin\
timidity-windows=C:\Users\Me\My Documents\ly2video\TiMidity++-2.15.0\

The trailing backslash is required in ly2video.cfg.

Known issues:

1. ly2video attempts to run convert.ly on the file if there is a
   version number that is different from the version of lilypond
   being used.  However, when ly2video tries to run convert.ly, 
   it will fail.  The convert.ly script must be handled differently
   on Windows.  The workaround is to omit the version string from
   the input file.  It can't just be commented out.

2. There is an unhandled exception when ly2video tries to remove
   the temporary directory.  The temporary directory will need to
   be removed by hand.

-Stef