comparison base/methods.lisp @ 233:eb4d239f5437

add some time-related generic functions to base Ignore-this: 8ad91dcfa5c8a0301c29dda7d2f27802 darcs-hash:20100212101520-16a00-6821cd98b78bf27be148e3e7e4b46c8f0b80928b.gz committer: Jamie Forth <j.forth@gold.ac.uk>
author j.forth <j.forth@gold.ac.uk>
date Thu, 24 Feb 2011 11:23:18 +0000
parents 32b40c50075e
children 70969555ca07
comparison
equal deleted inserted replaced
232:061ae49a0b41 233:eb4d239f5437
542 (next-start (time+ start bar-duration) (time+ start bar-duration))) 542 (next-start (time+ start bar-duration) (time+ start bar-duration)))
543 ((time> next-start moment) 543 ((time> next-start moment)
544 (make-standard-anchored-period (timepoint start) 544 (make-standard-anchored-period (timepoint start)
545 (duration bar-duration)))))) 545 (duration bar-duration))))))
546 546
547 (defmethod ioi-from-bar ((event event))
548 (- (timepoint (onset event))
549 (timepoint (current-bar event (composition event)))))
550
551 (defmethod ioi-from-bar ((constituent constituent))
552 (- (timepoint (onset constituent))
553 (timepoint (current-bar constituent constituent))))
554
555 (defmethod onset-in-bar ((o moment))
556 (1+ (ioi-from-bar o)))
557
547 (defmethod beat-period ((moment standard-moment) 558 (defmethod beat-period ((moment standard-moment)
548 (time-signature standard-time-signature) 559 (time-signature standard-time-signature)
549 (composition composition)) 560 (composition composition))
550 ;; Simple example - standard-time-signature has constant tactus 561 ;; Simple example - standard-time-signature has constant tactus
551 (let* ((containing-bar (current-bar moment composition)) 562 (let* ((containing-bar (current-bar moment composition))