lilypond-user
[Top][All Lists]
Advanced

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

Comparing durations in Scheme


From: Christopher R. Maden
Subject: Comparing durations in Scheme
Date: Thu, 05 May 2011 18:25:47 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

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?

Thanks in advance,
Chris
-- 
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
Does this mean we can have our civil liberties back now?
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319



reply via email to

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