lilypond-devel
[Top][All Lists]
Advanced

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

Re: Allow music of nominally zero duration to be typeset. (issue 6810087


From: David Kastrup
Subject: Re: Allow music of nominally zero duration to be typeset. (issue 6810087)
Date: Sat, 17 Nov 2012 08:29:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Reinhold Kainhofer <address@hidden> writes:

> On 2012-11-16 23:57, address@hidden wrote:
>> I have not actually tried to understand the code.  I just added checks
>> for existing array elements before access until I could no longer make
>> LilyPond segfault or produce programming errors.
>>
>> So this is, indeed, strictly a patch on the "won't make things worse"
>> basis, except for the one, initial removal of a zero-duration check,
>> necessary for sane behavior in things like incipits without notes.
>
>
> But that check was added for exactly that reason: To warn the user
> that no output was produced (apparently, no regtest was added back
> then).

No, the warning for no output is _still_ being produced if you indeed
have no music.  And "no time consumed" is not the same as "no output
produced".

If I write something like

{ c1*0 }

you can't really claim that no output is produced.  And the problem
prompting this change was exactly that LilyPond did not produce output
when it should have.


> With this patch, even for an empty music, lilypond tries to do
> the pagebreaking (and reports 0 pages):

It reports 0 pages if it produces 0 pages, and it reports the actual
number of pages in case the material not consuming any time produces
output.

I can't see that as a problem.  It would be quite easy to suppress the
page breaking report in the case of 0 pages, but I consider that
non-sensical as the number of pages is the result of the input.

> -) With this patch applied
>
> address@hidden:~$ lilypond empty.ly
> GNU LilyPond 2.17.7
> »empty.ly« wird verarbeitet
> Analysieren...
> Interpretation der Musik...
> Warnung: keine Musik in der Partitur gefunden
> Vorverarbeitung der grafischen Elemente...
> Ideale Seitenanzahl wird gefunden...
> Musik wird auf 0 Seiten angepasst...
> Systeme erstellen...
> Kompilation erfolgreich beendet
>
> -) Without that patch:
>
> address@hidden:~$ lilypond empty.ly
> GNU LilyPond 2.17.7
> »empty.ly« wird verarbeitet
> Analysieren...
> Warnung: keine Musik in der Partitur gefunden
> Kompilation erfolgreich beendet
>
>
> So there is a difference (to me, pagebreaking does not make much sense
> if we already know there will be not output).

But we _don't_ know that just from seeing that we have a zero total
duration of material.  Not every output has a positive duration.

> But that doesn't mean that I'll veto that patch.
>
>> The downside are problems with material that indeed produces no
>> output.  The basic change is simple and just in
>> lily/global-context-scheme.cc.  All the rest is attempting to remove
>> programming errors and warnings occuring for basically empty systems.
>>
>> The current state is that
>>
>> \new Staff { }
>>
>> will segfault,
>
> Really? With lilypond 2.17.7 it didn't crash here...

"The current state" was the state of the _patch_ at the time I wrote the
initial summary.

-- 
David Kastrup



reply via email to

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