Re: lilypond "preprocessor"?

2023-12-10 Thread Stefano Antonelli
On Sun, 2023-12-10 at 08:46 -0500, Michael Werner wrote:
> And then I would have anotherFile.ly containing something like:
> 
> \include "song.ly"
> 
> \book {
>   \myHeaders
>   \score {
> \theMusic
>   }
> }

Thanks for the suggestion Michael.  I like that idea, but it doesn't
help with the problem.

> I'm not at all familiar with ly2video, so I really have no idea if
> this'll be directly useful to you. But for getting the headers from
> an included file, this is how I do it with nearly all the music I
> engrave. Maybe it can serve as a starting point.

The issue is that ly2video parses anotherFile.ly directly and it can't
see the fields in the header block because they are defined in song.ly.
 It doesn't have lilypond's smarts to parse "\include song.ly".

Thanks,
Stef







Re: ly:set-option png backend broken?

2023-12-10 Thread Stefano Antonelli
On Sun, 2023-12-10 at 13:13 -0600, David Wright wrote:
> On Sun 10 Dec 2023 at 17:24:46 (+), Stefano Antonelli wrote:
> > Is there any way to produce png output without --png in the
> > command?
> 
> Postprocess with:
> 
>   $ convert a.pdf a.png
>   $ gm convert a.pdf a.png
> 
> ie, convert is in imagemagick and graphicsmagick.

I wasn't looking to do this with an external tool, but I will keep it
in mind.  Thanks for the suggestion.

-Stef


Re: lilypond "preprocessor"?

2023-12-10 Thread Stefano Antonelli
On Sun, 2023-12-10 at 10:56 +0100, Jean Abou Samra wrote:
> It would be better for ly2video not to modify the input file. 

Technically, it modifies a copy of the input file.  The scraping is
clunky and I don't like it though it seems necessary.  The idea, I
suppose, is to make it easy for the user.

There are quite a few little details that need to be right for making
the video.  I wouldn't want to put it on the user to enter those
details by hand.

We need a copy so we can introduce the space time dumper code which
boils down to a simple /include statement at the very top of the file.
 If it's placed after the /score block it doesn't appear to work.

What I would prefer to do is append snippets of code to the end of a
copy of the user's file rather than scrape the input.

If I could add some code that was like this:

\layout {
  \set Score.unroll-all-loops = #t
}

Then it would be simple to append.  But as far as I know that unroll
loops has to be done at the \score block in front of the music.  Which
means interfering with the input file.

Basically ly2video looks for:

\score {

and replaces it with:

\score {
\unfoldRepeats

It looks like ly2video also removes any \break, \noBreak, and
\pageBreak it finds in the input.

If you're interested, the relevant code lives here:

<
https://github.com/aspiers/ly2video/blob/41364ad9c5d512c502de2c9b06f7878bd88b77e1/ly2video/cli.py#L1411C1-L1519C1
>

> Normally, you'd spell out the \unfoldRepeats and stuff in the input
> file directly.

I don't think the user should do this.  What I mean is that it's not
user friendly.

The approach I've been perusing is to create a new ly file that
includes the user's file.  However, this only works if the user's file
conforms to a certain format:  music defined in a macro, no score
block.  I don't think it's user friendly.  And the header (in a
separate file) isn't easy to parse.

From what I've seen around most people have a score block in the same
file as the music.  To make a video from this file, as you suggest, the
user would need to either temporarily modify the input file (yuck), or
make a copy of that file and modify it (now the music is in two places,
yucky).

What would be better is to take most of what the user has entered and
strip off the things ly2video absolutely don't need.  That's what
ly2video does, but it also has to inject the unroll loops.

Unless there are better ways to do this in a user friendly manner?

Ideally the user just does:

ly2video -i myfile.ly 

On any of their files and it just works.

-Stef





Re: ly:set-option png backend broken?

2023-12-10 Thread David Wright
On Sun 10 Dec 2023 at 17:24:46 (+), Stefano Antonelli wrote:
> On Sun, 2023-12-10 at 09:30 +0100, Jean Abou Samra wrote:
> > There is simply not "png" backend. The three available backends are
> > "ps" (generates PostScript, and PDF or PNG by conversion through
> > Ghostscript), "svg" (generates SVG only), and, in more recent
> > versions, "cairo" (generates PostScript, PDF, PNG or SVG through the
> > Cairo library).
> 
> I could have sworn I read that in the documentation, but it appears
> not.  I must have made it up late one night...  Apologies for the
> noise.
> 
> > Changing the backend is independent from changing the output format
> > since there can be multiple backends to produce the same format.
> 
> Is there any way to produce png output without --png in the command?

Postprocess with:

  $ convert a.pdf a.png
  $ gm convert a.pdf a.png

ie, convert is in imagemagick and graphicsmagick.

Cheers,
David.



Re: ly:set-option png backend broken?

2023-12-10 Thread Stefano Antonelli
On Sun, 2023-12-10 at 09:30 +0100, Jean Abou Samra wrote:
> There is simply not "png" backend. The three available backends are
> "ps" (generates PostScript, and PDF or PNG by conversion through
> Ghostscript), "svg" (generates SVG only), and, in more recent
> versions, "cairo" (generates PostScript, PDF, PNG or SVG through the
> Cairo library).

I could have sworn I read that in the documentation, but it appears
not.  I must have made it up late one night...  Apologies for the
noise.

> Changing the backend is independent from changing the output format
> since there can be multiple backends to produce the same format.

Is there any way to produce png output without --png in the command?



LilyPond 2.25.11

2023-12-10 Thread Jonas Hahnfeld via LilyPond user discussion
We are happy to announce the release of LilyPond 2.25.11. This is
termed a development release, but these are usually reliable for
testing new features and recent bug fixes. However, if you require
stability, we recommend using version 2.24.3, the current stable
release.
Please refer to the Installing section in the Learning Manual for
instructions how to set up the provided binaries:
https://lilypond.org/doc/v2.25/Documentation/learning/installing

Starting with this release, the binaries are built with Guile 3.0.
Please report back if there are any problems caused by this. At a later
point, we will switch to requiring Guile 3.0 and eventually drop
support for Guile 2.2.


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


Re: lilypond "preprocessor"?

2023-12-10 Thread Michael Werner
Hi Stef,

On Sat, Dec 9, 2023 at 11:07 PM Stefano Antonelli <
santone...@algosolutions.com> wrote:

> Any other options for getting the header block from an included file?
>

 I don't know if this'll be directly usable in your use case, but I do
something like this with most of the music I engrave. The way I handle this
is my song.ly would be something like:

myHeaders =  \header {
% author and stuff
}

theMusic = new DrumStaff {
% the music
}

And then I would have anotherFile.ly containing something like:

\include "song.ly"

\book {
  \myHeaders
  \score {
\theMusic
  }
}

I'm not at all familiar with ly2video, so I really have no idea if this'll
be directly useful to you. But for getting the headers from an included
file, this is how I do it with nearly all the music I engrave. Maybe it can
serve as a starting point.
-- 
Michael


Re: Lilypond on Linux/Fedora 39 error after system update.

2023-12-10 Thread Laurie Savage
Thanks, it worked.
Here are the last three lines of the compilation!

Converting to `Blue_Trane-2lines.pdf'...
Success: compilation successfully completed

Compilation finished at Sun Dec 10 22:53:43

Laurie Savage
https://www.queensofthewest.com/

The Latest Queens of The West clips
https://www.youtube.com/playlist?list=PLgkDbfgWIb8_tQgEZRKeRWVSukoM2xoC_


On Sun, 10 Dec 2023 at 19:53, Jean Abou Samra  wrote:

> Never mind, I can reproduce it after updating my own system. Filed as
> https://bugzilla.redhat.com/show_bug.cgi?id=2253842
>
> For now, please try sudo dnf install ghostscript-10.01.2
>


Re: lilypond "preprocessor"?

2023-12-10 Thread Jean Abou Samra
> I know I can run lilypond on song.ly and it will implicitly wrap it in
> a \score block, but is that contained in an intermediate file somewhere
> I can get access to?


No, there is no such file. The implicit wrapping happens at the level of
LilyPond's data structures, it's not a textual macro expansion.

It would be better for ly2video not to modify the input file. Normally, you'd
spell out the \unfoldRepeats and stuff in the input file directly.


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


Re: Lilypond on Linux/Fedora 39 error after system update.

2023-12-10 Thread Jean Abou Samra
Never mind, I can reproduce it after updating my own system. Filed as 
[https://bugzilla.redhat.com/show_bug.cgi?id=2253842](https://bugzilla.redhat.com/show_bug.cgi?id=2253842)

For now, please try `sudo dnf install ghostscript-10.01.2`


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


Re: Lilypond on Linux/Fedora 39 error after system update.

2023-12-10 Thread Jonas Hahnfeld via LilyPond user discussion
On Sun, 2023-12-10 at 14:09 +1100, Laurie Savage wrote:
> Hi,
> 
> I was editing a lead sheet for my combo and it compiled fine. I
> closed Frescobaldi, accepted Fedora's nags to update and went to
> bed. I opened Frescobaldi this morning and get this error message
> on any file I try to compile.
> 
> /usr/share/lilypond/2.25.4/ly/init.ly:64:2: error: Guile signaled an error 
> for the expression beginning here
> 
> #
> 
>  (let ((book-handler (if (defined? 'default-toplevel-book-handler)
> 
> Throw to key `ly-file-failed' with args `()'.
> 
> I have the correct version of Lilypond set in my source files with
> convert-ly. Any file I try to compile worked fine before the system
> update. The system update was very comprehensive and I have no idea
> what might have broken. I tried a re-installation of Lily but that
> didn't work.
> 
> Fedora 39, last updated 10/12/2023.

This is a known incompatibility with Ghostscript 10.02.1 that Fedora
updated to. Please file a bug with their LilyPond packaging to update
to a version with the fix. While you are at it, you might as well
remind them that odd numbers are "unstable" versions, and they should
consider only the even "stable" versions...

In the mean time, you can download the official binaries from
https://lilypond.org/download.html which come with their own version of
Ghostscript and do not have this problem.

Jonas


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


Re: Lilypond on Linux/Fedora 39 error after system update.

2023-12-10 Thread Jean Abou Samra
There must be some other error message before this one that is causing it.
Please include it as well.


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


Re: ly:set-option png backend broken?

2023-12-10 Thread Jean Abou Samra
The option is working as 
[documented](https://lilypond.org/doc/v2.25/Documentation/usage/advanced-command_002dline-options-for-lilypond.html)
 (although the failure mode could be better).

There is simply not "png" backend. The three available backends are "ps" 
(generates PostScript, and PDF or PNG by conversion through Ghostscript), "svg" 
(generates SVG only), and, in more recent versions, "cairo" (generates 
PostScript, PDF, PNG or SVG through the Cairo library).

Changing the backend is independent from changing the output format since there 
can be multiple backends to produce the same format.


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


Re: Unexpected bar boundaries with volta repeats and lyrics.

2023-12-10 Thread Paul Hodges
Here's my (rather tedious) suggestion for a workaround: so that the alternative 
starts with a note, not a rest, provide a note and hide it, then patch the rest 
in using another voice; the lyrics need a skip to avoid the dummy note.  It 
works (see below).



Paul


%



\version "2.25.10" 


music = \relative { 
   \time 4/4 
   \repeat volta 2 { 
      d'1 | 
      \alternative { 
         { d1 | } 
         { | << { \hideNotes d4 \unHideNotes } \new Voice { b'4\rest } >> d,2 
d4 | d1 } 
      } 
   } 
   \bar "|." 
} 


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


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


%%%



 From:   Kevin Pye  
 To:   Michael Werner  
 Cc:   Lilypond User  
 Sent:   09/12/2023 21:14 
 Subject:   Re: Unexpected bar boundaries with volta repeats and lyrics. 



Thank you,



Unfortunately, in this case (the real score from which the example was 
extracted) I need the words to be repeated so I can unfold them for midi 
output. I'll just have to do the unfold manually.



Kevin.



On Sat, 9 Dec 2023, at 23:45, Michael Werner wrote:


Hi Kevin,




On Fri, Dec 8, 2023 at 11:31 PM Kevin Pye  wrote:





What silly mistake am I making here?



Not all that silly. Though the docs do talk about putting lyrics into the same 
repeat structure as the music, there's one detail in 
http://lilypond.org/doc/v2.25/Documentation/notation/lyrics-and-repeats that 
you may have missed:



"... when one of the \alternative blocks starts with a rest, a repeat construct 
cannot be used around the words"



Change the lyrics block to just



words = \lyricmode {


    a b c d e 

}



and it should behave itself a bit better for you.

--




Michael