Regression in docs: Output-suffix does not work as documented in AU 3.2.1

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Regression in docs: Output-suffix does not work as documented in AU 3.2.1

Ian Hulin

This is AU section 3.2.1

3.2.1 Invoking lilypond

The lilypond executable may be called as follows from the command line.

lilypond [option]… file

When invoked with a filename that has no extension, the ‘.ly’ extension is tried first. To read input from stdin, use a dash (-) for file.

When ‘filename.ly’ is processed it will produce ‘filename.ps’ and ‘filename.pdf’ as output. Several files can be specified; they will each be processed independently. 1

If ‘filename.ly’ contains more than one \score block, then the rest of the scores will be output in numbered files, starting with ‘filename-1.pdf’. In addition, the value of output-suffix will be inserted between the basename and the number. An input file containing

#(define output-suffix "violin")
\score { … }
#(define output-suffix "cello")
\score { … }
  

will output base-violin.pdf’ and base-cello-1.pdf’.

____________________________________________________________________________________________________________________________

This is a regression:  you need to use \book instead of \score for the compilation to produce two files.

E.g.

#(define output-suffix "violin")
\book { … }
#(define output-suffix "cello")
\book { … }
  

Here's my (not-so) minimal version, if you change the \book to a \bookpart or \score you only get an output file using the last setting of output-suffix in the score,

\version "2.12.1"
\header {
  title = "Exsultate, Jubilate"
  subtitle = "Motet"
  subsubtitle = "K. 165"
  instrument = "Soprano Solo and Orchestra"
  composer = "W. A. Mozart"
  opus = "KV 165"
}
movonesettings = {
 \key f \major
 \time 4/4
 \tempo "Allegro" 4=128
  
 }
movtwosettings = {
 \key a \major
 \time 3/4
 \tempo "Andante" 4=72
 }
BCmovoneMusic = \relative c {
  \movonesettings
  \clef bass f8 f f f f f f f |
}
BCmovtwoMusic = \relative c {
\movtwosettings
  \clef bass
  \partial 8 r8
  r4 a'4 a, |
}
#(define output-suffix "Allegro")
\book {
\header {
        subtitle = "I Allegro"
    }
\score {
   
    \BCmovoneMusic
}
}
#(define output-suffix "Andante")
\book {
\header {
    subtitle = "II. Andante"
}
\score {
    \BCmovtwoMusic
}
}

Reply | Threaded
Open this post in threaded view
|

Regression in docs: Output-suffix does not work as documented in AU 3.2.1

Carl Sorensen
> I am top posting.

This is an example of something that should be sent to lilypond-devel,
rather than to the frogs list.  There are many developers who are not on the
frogs list.

Therefore, I've forwarded this to the -devel list.

Thanks,

Carl Sorensen


On 8/5/09 5:12 PM, "Ian Hulin" <[hidden email]> wrote:

> This is AU section 3.2.1
>
> 3.2.1 Invoking lilypond
> The lilypond executable may be called as follows from the command line.
>>  
>> lilypond [option]S fileS
>>  
> When invoked with a filename that has no extension, the O.ly¹ extension is
> tried first. To read input from stdin, use a dash (-) for file.
>
> When Ofilename.ly¹ is processed it will produce Ofilename.ps¹ and
> Ofilename.pdf¹ as output. Several files can be specified; they will each be
> processed independently. 1
> <http://lilypond.org/doc/v2.13/Documentation/user/lilypond-program/Invoking-li
> lypond#FOOT2>
>
> If Ofilename.ly¹ contains more than one \score block, then the rest of the
> scores will be output in numbered files, starting with Ofilename-1.pdf¹. In
> addition, the value of output-suffix will be inserted between the basename and
> the number. An input file containing
>>  
>> #(define output-suffix "violin")
>> \score { S }
>> #(define output-suffix "cello")
>> \score { S }
>>  
> will output baseO-violin.pdf¹ and baseO-cello-1.pdf¹.
> ______________________________________________________________________________
> ______________________________________________
> This is a regression:  you need to use \book instead of \score for the
> compilation to produce two files.
>
> E.g.
>
>>  
>> #(define output-suffix "violin")
>> \book { S }
>> #(define output-suffix "cello")
>> \book { S }
>>  
> Here's my (not-so) minimal version, if you change the \book to a \bookpart or
> \score you only get an output file using the last setting of output-suffix in
> the score,
>
> \version "2.12.1"
> \header {
>   title = "Exsultate, Jubilate"
>   subtitle = "Motet"
>   subsubtitle = "K. 165"
>   instrument = "Soprano Solo and Orchestra"
>   composer = "W. A. Mozart"
>   opus = "KV 165"
> }
> movonesettings = {
>  \key f \major
>  \time 4/4
>  \tempo "Allegro" 4=128
>   
>  }
> movtwosettings = {
>  \key a \major
>  \time 3/4
>  \tempo "Andante" 4=72
>  }
> BCmovoneMusic = \relative c {
>   \movonesettings
>   \clef bass f8 f f f f f f f |
> }
> BCmovtwoMusic = \relative c {
> \movtwosettings
>   \clef bass
>   \partial 8 r8
>   r4 a'4 a, |
> }
> #(define output-suffix "Allegro")
> \book {
> \header {
>         subtitle = "I Allegro"
>     }
> \score {
>    
>     \BCmovoneMusic
> }
> }
> #(define output-suffix "Andante")
> \book {
> \header {
>     subtitle = "II. Andante"
> }
> \score {
>     \BCmovtwoMusic
> }
> }
>


---

----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Regression in docs: Output-suffix does not work as documented in AU 3.2.1

Graham Percival
In reply to this post by Ian Hulin
On Thu, Aug 06, 2009 at 12:12:59AM +0100, Ian Hulin wrote:
> This is AU section 3.2.1
------
> If ‘filename.ly’ contains more than one \score block, then the rest of the
> scores will be output in numbered files, starting with ‘filename-1.pdf’.
------

> This is a regression:  you need to use \book instead of \score for the
> compilation to produce two files.
> E.g.
>
>
>     #(define output-suffix "violin")
>     \book { … }
>     #(define output-suffix "cello")
>     \book { … }

Good catch!  Personally, I'm ok with the current program behavior.
I'd be happy to adjust the docs to reflect the "1 pdf per \book"
behavior.

Does anybody object to this?  i.e. should this be considered a
program regression bug and changed, rather than simply adjusting
the docs to match the current behavior?

Cheers,
- Graham

---

----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Regression in docs: Output-suffix does not work as documented in AU 3.2.1

Trevor D-2

Graham Percival wrote Thursday, August 06, 2009 7:51 AM


> On Thu, Aug 06, 2009 at 12:12:59AM +0100, Ian Hulin wrote:
>> This is AU section 3.2.1
> ------
>> If ‘filename.ly’ contains more than one \score block, then the
>> rest of the
>> scores will be output in numbered files, starting with
>> ‘filename-1.pdf’.
> ------
>
>> This is a regression: you need to use \book instead of \score for
>> the
>> compilation to produce two files.
>> E.g.
>>
>>
>>     #(define output-suffix "violin")
>>     \book { … }
>>     #(define output-suffix "cello")
>>     \book { … }
>
> Good catch!  Personally, I'm ok with the current program behavior.
> I'd be happy to adjust the docs to reflect the "1 pdf per \book"
> behavior.

I'm with you on this - splitting the output pdf 1 per book is
more intuitive and sensible.  Change the docs.

Trevor



---

----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Regression in docs: Output-suffix does not work as documented in AU 3.2.1

Ian Hulin
In reply to this post by Graham Percival
Graham Percival wrote:

> On Thu, Aug 06, 2009 at 12:12:59AM +0100, Ian Hulin wrote:
>> This is AU section 3.2.1
> ------
>> If ‘filename.ly’ contains more than one \score block, then the rest of the
>> scores will be output in numbered files, starting with ‘filename-1.pdf’.
> ------
>
>> This is a regression:  you need to use \book instead of \score for the
>> compilation to produce two files.
>> E.g.
>>
>>
>>     #(define output-suffix "violin")
>>     \book { … }
>>     #(define output-suffix "cello")
>>     \book { … }
>
> Good catch!  Personally, I'm ok with the current program behavior.
> I'd be happy to adjust the docs to reflect the "1 pdf per \book"
> behavior.
>
> Does anybody object to this?  i.e. should this be considered a
> program regression bug and changed, rather than simply adjusting
> the docs to match the current behavior?
>
Errrm, sort of, because I found this while I was having a look at some
low-level trackers (714 and 404)  about output-file naming.

You're right:
o there's a one-to-one relationship between \book blocks and the
output graphical back-end files.
o if there's no \book block in a file, lilypond assumes there is one,
so conceptually
        lilypond-source-file :== {book-block, [book-block...]}
o each \book produces one copy of whatever graphical back-end file
the user has asked for .pfd, .svg, .png, whatever.
HOWEVER
o each \score block (which lily also puts in if there isn't one), in
conjunction with a \midi block will produce a .mid/.midi file.

o a \book block or source-file without a \book can legally contain
more than one \score block.
        ==> There's a one-to-many relationship between source-files/book
blocks and resulting midi files.
        In this case the resulting .mid from the last \score block would
overwrite the previous \score block's efforts because they were all
using the same filename.
o the output-count and output-suffix parser variables were introduced
to prevent this.  Using output-suffix used to produce unwanted
output-count suffix to the filename, even when the output-suffix had
just been changed.

I have a patch with changes to lily-library.scm which Marek Klein
prototyped which fixes the problem described in the last bullet-point,
but it needs a little more work to split the file-name handling stuff
into a seperate Scheme function.

I'd like to submit a patch as the first stage of work on 714/404, and
then would like to see about putting in a true lilypond language
interface to this rather than having to drop into Scheme to set the
value for output-suffix.

For the moment changing the docs looks like the way to go, but I'd like
output-suffix to appear in the index eventually.

Sorry if this is noise, but I'm still very aware I'm swimming around in
the shallow end of the bug-fixing pool here.

Cheers,
Ian


---

----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Regression in docs: Output-suffix does not work as documented in AU 3.2.1

Mats Bengtsson-3
In reply to this post by Graham Percival


Graham Percival wrote:
>
> Good catch!  Personally, I'm ok with the current program behavior.
> I'd be happy to adjust the docs to reflect the "1 pdf per \book"
> behavior.
>  
??? We've had one PDF output per \book block as long as there have been
\book blocks, as far as I can recall. This has also been documented in
http://lilypond.org/doc/v2.13/Documentation/user/lilypond/File-structure#File-structure 
for a long time. The text in AU seems like a typo.

    /Mats

---

----
Join the Frogs!