Mercurial > hg > amuse
diff 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 |
line wrap: on
line diff
--- a/utils/utils.lisp Fri Jul 27 12:24:29 2007 +0100 +++ b/utils/utils.lisp Fri Jul 27 12:25:07 2007 +0100 @@ -26,11 +26,13 @@ :datatype 'constituent))) (s 0)) (dolist (tempo tempi (/ s 1000000)) - (incf s (* (duration (period-intersection tempo object1)) - (amuse:microseconds-per-crotchet tempo)))))) + (incf s (if (disjoint tempo object1) + 0 + (* (duration (period-intersection tempo object1)) + (amuse:microseconds-per-crotchet tempo))))))) (defmethod beats-to-seconds ((object1 moment) (object2 constituent)) - (beats-to-seconds (time- (timepoint object1) + (beats-to-seconds (time- (onset object1) (make-moment 0)) object2))