lilypond-user
[Top][All Lists]
Advanced

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

Re: RhythmicStaff issues in a snippet


From: Dominique Faure
Subject: Re: RhythmicStaff issues in a snippet
Date: Sat, 21 Jul 2012 02:31:49 +0200

On Fri, Jul 20, 2012 at 9:52 PM, David Kastrup <address@hidden> wrote:
> Reedmace Star <address@hidden> writes:
>
>> * 2012-07-20 17:39 +0200 David Kastrup:
>>> Dominique Faure <address@hidden> writes:
>>> > Despite the RhythmicStaff is simplifying the process, how
>>> > could I make it display chord of dotted notes as single dotted
>>> > notes?
>>> > Dots are kept unmerged. Is it a bug?
>>>
>>> Calling it a bug seems like a reasonable interpretation of the
>>> behavior.
>>
>> Sounds like issue #185.
>>
>> <http://code.google.com/p/lilypond/issues/detail?id=185>
>>
>> (Last time I checked, this was the eleventh-oldest open issue in the
>> tracker.)
>>
>>> You might want to pass your music through the following
>>> music function.  It goes to a bit of effort to make sure that accents
>>> survive.
>>>
>>> thinout =
>>> #(define-music-function (parser location music) (ly:music?)
>>>    (for-some-music
>>>     (lambda (m)
>>>       (and (music-is-of-type? m 'event-chord)
>>>            (let ((elts (ly:music-property m 'elements)))
>>>           (if (pair? elts)
>>>                  (set-cdr!
>>>                elts
>>>                (filter!
>>>                 (lambda (m) (not (ly:music-property m 'duration #f)))
>>>                 (cdr elts))))
>>>           #t)))
>>>     music)
>>>    music)
>>>
>>> \new RhythmicStaff
>>> \thinout
>>> \relative c  { <d, g d'>4 e f8 g a4 <d b g>2. c4 d4. e8 f4 g }
>>
>> Similar workarounds have been posted on this list before, but I think
>> this is the most compact one I have seen so far. I'm adding a comment to
>> the report to document it.
>
> Well, my first version was
>
> thinout =
> #(define-music-function (parser location music) (ly:music?)
>    (map-some-music
>     (lambda (m)
>       (and (music-is-of-type? m 'event-chord)
>            #{ c$(duration-of-note m) #}))
>     music))
>
> which is quite funnier but loses accents on chords.
>

Thanks, that's very nice.

BTW, how could I bind this with the context redefinition I made, ie.
without the need to explicitely call the function?

-- 
Dominique



reply via email to

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