Mercurial > hg > amuse
changeset 260:f5836b2bf334
add bps (analogous to bpm)
author | Jamie Forth <j.forth@gold.ac.uk> |
---|---|
date | Sat, 19 Mar 2011 18:51:23 +0000 |
parents | c4e9a7bb9897 |
children | 8e5f306b7e47 |
files | base/generics.lisp base/methods.lisp base/package.lisp |
diffstat | 3 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/base/generics.lisp Sat Mar 19 18:50:24 2011 +0000 +++ b/base/generics.lisp Sat Mar 19 18:51:23 2011 +0000 @@ -189,6 +189,10 @@ (defgeneric bpm (tempo) (:documentation "Basic tempo query")) ;; in bpm + +(defgeneric bps (tempo) + (:documentation "Basic tempo query")) ;; in bps + (defgeneric microseconds-per-crotchet (tempo) ;; As used (when rounded) in MIDI (:method (tp) (/ 60000000 (bpm tp)))
--- a/base/methods.lisp Sat Mar 19 18:50:24 2011 +0000 +++ b/base/methods.lisp Sat Mar 19 18:51:23 2011 +0000 @@ -165,6 +165,9 @@ (defmethod bpm ((tempo standard-tempo)) (%tempo-bpm tempo)) +(defmethod bps ((tempo standard-tempo)) + (/ (%tempo-bpm tempo) 60)) + (defmethod print-object ((tempo standard-tempo) stream) (print-unreadable-object (tempo stream :type t) (write (bpm tempo) :stream stream)))