Mercurial > hg > amuse
comparison 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 |
comparison
equal
deleted
inserted
replaced
249:bba5e8571b92 | 250:b3260d1d2419 |
---|---|
551 (defmethod ioi-from-bar ((constituent constituent)) | 551 (defmethod ioi-from-bar ((constituent constituent)) |
552 (- (timepoint (onset constituent)) | 552 (- (timepoint (onset constituent)) |
553 (timepoint (current-bar constituent constituent)))) | 553 (timepoint (current-bar constituent constituent)))) |
554 | 554 |
555 (defmethod onset-in-bar ((o moment)) | 555 (defmethod onset-in-bar ((o moment)) |
556 "FIXME: Won't actually work for standard-moments because they do not | |
557 have a composition slot! So either we allow for 'linked moments', or | |
558 change the method to have an optional composition parameter." | |
556 (1+ (ioi-from-bar o))) | 559 (1+ (ioi-from-bar o))) |
560 | |
561 (defmethod onset-in-bar-relative-to-tactus ((o moment)) | |
562 (1+ (/ (ioi-from-bar o) | |
563 (tactus-duration | |
564 (car (get-applicable-time-signatures o (composition o))))))) | |
557 | 565 |
558 (defmethod beat-period ((moment standard-moment) | 566 (defmethod beat-period ((moment standard-moment) |
559 (time-signature standard-time-signature) | 567 (time-signature standard-time-signature) |
560 (composition composition)) | 568 (composition composition)) |
561 ;; Simple example - standard-time-signature has constant tactus | 569 ;; Simple example - standard-time-signature has constant tactus |