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 <options to control video output>

On any of their files and it just works.

-Stef



Reply via email to