Mercurial > hg > amuse
comparison base/methods.lisp @ 307:a85c59bcd88b
add some time-related generic functions to base
Ignore-this: 8ad91dcfa5c8a0301c29dda7d2f27802
darcs-hash:20100212101520-16a00-6821cd98b78bf27be148e3e7e4b46c8f0b80928b.gz
author | j.forth <j.forth@gold.ac.uk> |
---|---|
date | Fri, 12 Feb 2010 10:15:20 +0000 |
parents | fbeaedd242c6 |
children | 6c57b16a7829 |
comparison
equal
deleted
inserted
replaced
306:d70ff27b1968 | 307:a85c59bcd88b |
---|---|
540 (next-start (time+ start bar-duration) (time+ start bar-duration))) | 540 (next-start (time+ start bar-duration) (time+ start bar-duration))) |
541 ((time> next-start moment) | 541 ((time> next-start moment) |
542 (make-standard-anchored-period (timepoint start) | 542 (make-standard-anchored-period (timepoint start) |
543 (duration bar-duration)))))) | 543 (duration bar-duration)))))) |
544 | 544 |
545 (defmethod ioi-from-bar ((event event)) | |
546 (- (timepoint (onset event)) | |
547 (timepoint (current-bar event (composition event))))) | |
548 | |
549 (defmethod ioi-from-bar ((constituent constituent)) | |
550 (- (timepoint (onset constituent)) | |
551 (timepoint (current-bar constituent constituent)))) | |
552 | |
553 (defmethod onset-in-bar ((o moment)) | |
554 (1+ (ioi-from-bar o))) | |
555 | |
545 (defmethod beat-period ((moment standard-moment) | 556 (defmethod beat-period ((moment standard-moment) |
546 (time-signature standard-time-signature) | 557 (time-signature standard-time-signature) |
547 (composition composition)) | 558 (composition composition)) |
548 ;; Simple example - standard-time-signature has constant tactus | 559 ;; Simple example - standard-time-signature has constant tactus |
549 (let* ((containing-bar (current-bar moment composition)) | 560 (let* ((containing-bar (current-bar moment composition)) |