lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bookOutputName still gets "-1" suffix added to SVG file names


From: Jeff Olson
Subject: Re: bookOutputName still gets "-1" suffix added to SVG file names
Date: Thu, 30 Mar 2023 18:31:05 -0600
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1

On 3/29/2023 11:57 PM, Jean Abou Samra wrote:

These "-1" suffices are messing with my URLs for the SVG files,
so I'd appreciate any ideas on how to get rid of them.  Thx.

They are there for good reason. If any of your \books got output on multiple pages, there would indeed be multiple files output.

Understood, but, like midi, the first file could (should) still have been un-suffixed.

And the current mismatch between layout files and midi files is a good reason for the opposite:

Consider this MWE named MidiMismatch.ly that generates pairs of svg and midi files:

\version "2.24.1"
#(ly:set-option 'backend 'cairo)
#(ly:set-option 'separate-page-formats 'svg)
#(ly:set-option 'use-paper-size-for-page #f)
#(ly:set-option 'point-and-click #f)
\header { tagline = ##f }
\paper { print-page-number = ##f }
\score { { f' } \layout { } \midi { } }
\pageBreak
\score { { a' } \layout { } \midi { } }
\pageBreak
\score { { b' } \layout { } \midi { } }

The suffices of its generated svg files are **off by one** from the midi files:

   1 -rwxrwxrwx+ 1 J None     119 Mar 30 17:15  MidiMismatch.mid*
   1 -rwxrwxrwx+ 1 J None     119 Mar 30 17:15  MidiMismatch-1.mid*
   1 -rwxrwxrwx+ 1 J None     119 Mar 30 17:15  MidiMismatch-2.mid*
   8 -rwxrwxrwx+ 1 J None    6496 Mar 30 17:15  MidiMismatch-1.svg*
   8 -rwxrwxrwx+ 1 J None    6502 Mar 30 17:15  MidiMismatch-2.svg*
   8 -rwxrwxrwx+ 1 J None    6510 Mar 30 17:15  MidiMismatch-3.svg*


By the way, in addition to simplifying automation (like lilypond-book),
The above example shows how this creates an automation nightmare.

having -1.svg even on the first page makes it possible to use both separate-page-formats and tall-page-formats at the same time.

So I added "#(ly:set-option 'tall-page-formats 'svg)" to the example above
and it produced MidiMismatch.svg (with three scores) which is what I assume you mean.
It had no effect on the off-by-one between midi and svg, of course.

Nevertheless, couldn't the suffixing algorithm in all cases still start with
the un-suffixed named and add suffices only to resolve actual collisions?

Removing the tall-page-formats line would then have begun with MidiMismatch.svg
matching MidiMismatch.mid (the note f') and all subsequent files would also match.

And that would also have enabled bookOutputName in my original example to have
complete control over the whole file name (with only one file per book).

As it stands, it seems I'd have to use techniques outside of lilypond,
as David W suggests, in order to correct the filenames.  Is that what you're implying?

Thx,
Jeff


  






reply via email to

[Prev in Thread] Current Thread [Next in Thread]