[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New, more powerful version of \shape!
From: |
David Kastrup |
Subject: |
Re: New, more powerful version of \shape! |
Date: |
Fri, 18 Oct 2013 09:52:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Janek Warchoł <address@hidden> writes:
> 2013/10/18 David Kastrup <address@hidden>:
>> #(define slur-count 0)
>>
>> oldSlur = (
>>
>> "(" =
>> #(define-event-function (parser location) ()
>> (set! slur-count (1+ slur-count))
>> oldSlur)
>>
>> ...
>> #(format #t "\nSlur count: ~S\n" slur-count)
>
> That's nice! Could you make it work with 2.17.3 (we had to freeze
> LilyPond version to ensure that no regressions in the scores appear,
> and so we're using 2.17.3 for almost all scores)?
No. It's not just a matter of replacing "(" with parenthesisOpenSymbol.
Previous to 2.17.25, the parser had quite hardwired expectations and
won't take well at all to seeing an event-function instead of an event
here. And looking at the old parser code, it does not even go through
any hook you could reasonably hijack. Either you modify the C++ code of
the parser for your counting or you are out of luck.
You really need to use the more complex output slur approach via an
engraver for 2.17.3, putting an acknowledger on slur-interface or
something like that.
But "regressions in the score" should not really be an issue if you are
just counting slurs once in a while. It's not like you need perfect
output from the same run of LilyPond.
And the grob acknowledger can also keep statistics on the number of
tweaked slurs. The event function can't, since the slur is getting
tweaked after it has done its job.
--
David Kastrup
- Re: New, more powerful version of \shape!, (continued)
- Re: New, more powerful version of \shape!, David Nalesnik, 2013/10/17
- Re: New, more powerful version of \shape!, Paul Morris, 2013/10/17
- Re: New, more powerful version of \shape!, David Kastrup, 2013/10/18
- Re: New, more powerful version of \shape!, Urs Liska, 2013/10/18
- Re: New, more powerful version of \shape!, Urs Liska, 2013/10/18
- Re: New, more powerful version of \shape!, David Kastrup, 2013/10/18
- Re: New, more powerful version of \shape!, Urs Liska, 2013/10/18
- Re: New, more powerful version of \shape!, Janek Warchoł, 2013/10/18
- Re: New, more powerful version of \shape!,
David Kastrup <=
- Re: New, more powerful version of \shape!, Janek Warchoł, 2013/10/18
- Re: New, more powerful version of \shape!, Urs Liska, 2013/10/18
Re: New, more powerful version of \shape!, Jan-Peter Voigt, 2013/10/18