diff base/methods.lisp @ 250:b3260d1d2419

Add onset-in-bar-relative-to-tactus. This depends on tactus-duration, which needs revisiting.
author Jamie Forth <j.forth@gold.ac.uk>
date Thu, 24 Feb 2011 11:23:18 +0000
parents 70969555ca07
children aac79c0ac1b9
line wrap: on
line diff
--- a/base/methods.lisp	Thu Feb 24 11:23:18 2011 +0000
+++ b/base/methods.lisp	Thu Feb 24 11:23:18 2011 +0000
@@ -553,8 +553,16 @@
      (timepoint (current-bar constituent constituent))))
 
 (defmethod onset-in-bar ((o moment))
+  "FIXME: Won't actually work for standard-moments because they do not
+  have a composition slot! So either we allow for 'linked moments', or
+  change the method to have an optional composition parameter."
   (1+ (ioi-from-bar o)))
 
+(defmethod onset-in-bar-relative-to-tactus ((o moment))
+  (1+ (/ (ioi-from-bar o)
+	 (tactus-duration
+	  (car (get-applicable-time-signatures o (composition o)))))))
+
 (defmethod beat-period ((moment standard-moment)
                         (time-signature standard-time-signature)
                         (composition composition))