Mercurial > hg > amuse
comparison base/generics.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 | 6a3adca16910 |
comparison
equal
deleted
inserted
replaced
249:bba5e8571b92 | 250:b3260d1d2419 |
---|---|
158 (defgeneric time-signature-denominator (time-signature) | 158 (defgeneric time-signature-denominator (time-signature) |
159 (:method (ts) (beat-units ts)) | 159 (:method (ts) (beat-units ts)) |
160 (:documentation "Not obviously meaningful for non fraction-like | 160 (:documentation "Not obviously meaningful for non fraction-like |
161 time signatures")) | 161 time signatures")) |
162 (defgeneric tactus-duration (time-signature) | 162 (defgeneric tactus-duration (time-signature) |
163 ;; basic, but should do? NO! This defines 6/4 as compound. We need | 163 ;; basic, but should do? NO! FIXME. This defines 6/4 as compound. We |
164 ;; proper simplep and compoundp predicates. | 164 ;; need proper simplep and compoundp predicates. The below hack |
165 ;; seems to work for me, but we need to revisit this. | |
165 (:method (ts) | 166 (:method (ts) |
166 (warn "FIXME: tactus-duration is broken") | |
167 (cond | 167 (cond |
168 ;; ((and (not (= (beat-units-per-bar ts) 3)) | 168 ;; ((and (not (= (beat-units-per-bar ts) 3)) |
169 ;; (= (rem (beat-units-per-bar ts) 3) 0)) | 169 ;; (= (rem (beat-units-per-bar ts) 3) 0)) |
170 ((and (= (beat-units ts) 8) | 170 ((and (= (beat-units ts) 8) |
171 (= (rem (beat-units-per-bar ts) 3) 0)) | 171 (= (rem (beat-units-per-bar ts) 3) 0)) |
463 (defgeneric ioi-from-bar (moment) | 463 (defgeneric ioi-from-bar (moment) |
464 (:documentation "Returns the IOI of moment (i.e. an event) from the | 464 (:documentation "Returns the IOI of moment (i.e. an event) from the |
465 bar line.")) | 465 bar line.")) |
466 | 466 |
467 (defgeneric onset-in-bar (moment) | 467 (defgeneric onset-in-bar (moment) |
468 (:documentation "The position of moment in the bar, measured in | 468 (:documentation "The position of moment in the bar, measured in the |
469 beats.")) | 469 timebase of the composition (e.g. crochets regardless of the |
470 prevailing time-signature.")) | |
471 | |
472 (defgeneric onset-in-bar-relative-to-tactus (moment) | |
473 (:documentation "The position of moment in the bar, measure in | |
474 tactus beats.")) | |
470 | 475 |
471 ;;;;;;;;;;;;;; | 476 ;;;;;;;;;;;;;; |
472 ;; | 477 ;; |
473 ;; | 478 ;; |
474 | 479 |