changeset 267:89c20fd8abc0

make sure ioi-from-bar is normalised to crotchet duration
author Jamie Forth <j.forth@gold.ac.uk>
date Mon, 11 Apr 2011 12:14:49 +0100
parents d605fd37b0ee
children
files base/methods.lisp implementations/mtp/methods.lisp
diffstat 2 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/base/methods.lisp	Sun Apr 10 18:28:27 2011 +0100
+++ b/base/methods.lisp	Mon Apr 11 12:14:49 2011 +0100
@@ -570,14 +570,16 @@
 time-signatures? We should at least be checking."
   (cond
     ((within-short-bar-p event)
-     (+ (timepoint (onset event))
-	(- (duration (bar-period (car (get-applicable-time-signatures
-				       event (composition event)))
-				 event))
-	   (duration (current-bar event (composition event))))))
+     (/ (+ (timepoint (onset event))
+	   (- (duration (bar-period (car (get-applicable-time-signatures
+					  event (composition event)))
+				    event))
+	      (duration (current-bar event (composition event)))))
+	(duration (crotchet event))))
     (t
-     (- (timepoint (onset event))
-	(timepoint (current-bar event (composition event)))))))
+     (/ (- (timepoint (onset event))
+	   (timepoint (current-bar event (composition event))))
+	(duration (crotchet event))))))
 
 (defmethod ioi-from-bar ((constituent constituent))
   "FIXME: Check for short bars, or maybe just use the first event?"
--- a/implementations/mtp/methods.lisp	Sun Apr 10 18:28:27 2011 +0100
+++ b/implementations/mtp/methods.lisp	Mon Apr 11 12:14:49 2011 +0100
@@ -319,4 +319,5 @@
 ;;; Metre related
 
 (defmethod ioi-from-bar ((event mtp-event))
-  (mod (timepoint event) (%mtp-barlength event)))
+  (/ (mod (timepoint event) (%mtp-barlength event))
+     (duration (crotchet event))))