[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LSR 507 (ghost voice) broken since 2.15.28
From: |
David Kastrup |
Subject: |
Re: LSR 507 (ghost voice) broken since 2.15.28 |
Date: |
Thu, 16 May 2013 15:06:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> David Kastrup <address@hidden> writes:
>
>> Eluze <address@hidden> writes:
>>
>>> LSR 507 <http://lsr.dsi.unimi.it/LSR/Item?id=507> produces erroneous
>>> code since version 2.15.28:
>>>
>>> mus = { c4 d e f |}
>>>
>>> \displayLilyMusic \ghostMusic \mus
>>
>> That's fallout from issue 2240, Patch: Don't wrap EventChord around
>> rhythmic events by default. It won't be the only affected item.
>>
>> The basic question is when should we be migrating the LSR to 2.16.
>>
>> In this particular case, only the first of several "adjacent" spacers is
>> retained. The reason for that apparently is to avoid <c e> getting
>> turned into what amounts to <s s>. I don't think that this
>> simple-minded approach is all too likely to lead to sane results without
>> more effort, even pre-2.15.28. So my take on this would be to just junk
>> the music-filter expression. This is going to lead to constructs
>> occasionally that one can't actually enter, but which should at least
>> compile reasonably well.
>
> In a nutshell:
>
> ghostMusic =
> #(define-music-function (parser location music) (ly:music? )
> (music-map (lambda (x)
> (let ((dur (ly:music-property x 'duration)))
> (if (ly:duration? dur)
> (apply make-music 'SkipEvent
> (flatten-alist
> (ly:music-mutable-properties x)))
> x)))
> music))
>
>
> notes = { a2-"hello" b4 r b2 a-"bye" <c e g c' e' g'>1-"oho ;-)" }
>
> \ghostMusic \notes
>
>
> This is not going to work out of the box with chord repetitions.
And here is a version that should work both with 2.14 as well as 2.16
and be fine with chord repetitions.
ghostMusic =
#(define-music-function (parser location music) (ly:music?)
(music-map
(lambda (x)
(if (music-is-of-type? x 'rhythmic-event)
(apply make-music 'SkipEvent
(flatten-alist
(ly:music-mutable-properties x)))
x))
music))
notes = { a2-"hello" b4 r b2 a-"bye" <c e g c' e' g'>1-"oho ;-)" }
\ghostMusic \notes
With 2.16 proper, one would likely rather use map-some-music and
(lambda (x) (and (music-is-of-type? ...) (apply ...)))
--
David Kastrup