Mercurial > hg > amuse
diff base/generics.lisp @ 175:7e8d95d00267
Bars independant of time sigs
darcs-hash:20080313112352-40ec0-0805528027499f30d3812fa6c4e65596d1ff40fe.gz
author | d.lewis <d.lewis@gold.ac.uk> |
---|---|
date | Thu, 13 Mar 2008 11:23:52 +0000 |
parents | 4a0e15e2829a |
children | c18f795f4463 3180b03d436a |
line wrap: on
line diff
--- a/base/generics.lisp Thu Mar 13 11:22:29 2008 +0000 +++ b/base/generics.lisp Thu Mar 13 11:23:52 2008 +0000 @@ -409,3 +409,49 @@ ;;; Dynamics ;;; Voice ;;; Boundary Strength (phrasing) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Experimental: +;; + +;;; Proposed new metre functions +;; These should provide sufficient functionality that the users need +;; not refer to get-applicable-time-signatures unless they really mean +;; it. In turn, this means that barline based representations have a +;; better chance at guessing. + +;; Notes: +;; * iteration is possible with +;; (do ((beat (current-beat (make-moment 0) composition)) +;; (current-beat (cut-off beat) composition))) ... +;; [That's probably not very efficient. there must be better ways] +;; * gsharp and tabcode can answer bar questions, but not beat +;; questions. Appropriate conditions and restarts will be needed. +;; * a good test of this functionality will prob be amuse-harmony. + +(defgeneric bar-period (time-signature implementation-object) + (:documentation "Returns a <period> with a duration equal to the + duration of a bar in the given time signature for the given + implementation. FIXME: this isn't guaranteed to be + meaningful (double time signatures break this")) +(defgeneric current-bar (moment composition) + (:documentation "Returns an <anchored-period> representing the + bar which contains moment")) + +(defgeneric beat-period (moment time-signature implementation-object) + (:documentation "Takes a moment, time signature object and crotchet and returns + an <anchored-period> for the containing beat containing moment. This + is more useful when there's a complex time signature (not currently + possible) in which tactus is different in different parts of the + bar (e.g. 3+3+2/8)")) +(defgeneric current-beat (moment composition) + (:documentation "Returns an <anchored-period> representing the + tactus unit which contains moment")) + + +;;;;;;;;;;;;;; +;; +;; + +(defgeneric get-applicable-clefs (anchored-period constituent))