"Christopher R. Maden" <cr...@maden.org> writes:

> I am trying to tackle the swing music problem that someone posted about
> earlier; it arises in traditional Irish music as well.
>
> I’m blocked on detecting eighth-notes, though (or quavers for you Brits).
>
> It seems like this should work (event is an EventChord):
>
>   (eq?
>    (ly:music-property
>     (car (ly:music-property
>           event
>           'elements))
>     'duration)
>    (ly:make-duration 3 0 1 1))
>
> However, this seems to return #f all the time, regardless of what event
> actually has.  If I use (eq? (ly:duration-log ...) 3), it works, so I
> know I am getting a duration.  Do I have to actually compare
> duration-log, duration-dot, and duration-factor?  That seems a bit annoying.
>
> What am I missing?

The guile manual?  eq? compares for identity, not equality of objects.
Composite objects constructed independently are not identical.

-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to