comparison utils/utils.lisp @ 120:d2f68cedf573

Bug fixes darcs-hash:20070727112507-f76cc-ba8beff74a42f9dfd8b64fb2ff50f712e8f95305.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 27 Jul 2007 12:25:07 +0100
parents 8ea75cc8bc2c
children bfe5afcad183
comparison
equal deleted inserted replaced
119:f07d4596290b 120:d2f68cedf573
24 (signal 'undefined-action 24 (signal 'undefined-action
25 :operation 'beats-to-seconds 25 :operation 'beats-to-seconds
26 :datatype 'constituent))) 26 :datatype 'constituent)))
27 (s 0)) 27 (s 0))
28 (dolist (tempo tempi (/ s 1000000)) 28 (dolist (tempo tempi (/ s 1000000))
29 (incf s (* (duration (period-intersection tempo object1)) 29 (incf s (if (disjoint tempo object1)
30 (amuse:microseconds-per-crotchet tempo)))))) 30 0
31 (* (duration (period-intersection tempo object1))
32 (amuse:microseconds-per-crotchet tempo)))))))
31 (defmethod beats-to-seconds ((object1 moment) 33 (defmethod beats-to-seconds ((object1 moment)
32 (object2 constituent)) 34 (object2 constituent))
33 (beats-to-seconds (time- (timepoint object1) 35 (beats-to-seconds (time- (onset object1)
34 (make-moment 0)) 36 (make-moment 0))
35 object2)) 37 object2))
36 38
37 ;; Not as simple as it seems - have to take into account numbering 39 ;; Not as simple as it seems - have to take into account numbering
38 ;; practices and leading silences in representations where bar number 40 ;; practices and leading silences in representations where bar number