[CM] is x a rhythm/a keynum?

Rick Taube taube@uiuc.edu
Tue, 25 Nov 2003 08:37:18 -0600


you are correct, currently there are no predicates that test for rhythm 
or keynum. however, depending on how simple your rhythm/keynumber 
testing needs to be you may be able to use the undertlying functions 
for this. assuming you are using CLTL try:

(defun rhythmp (x) (gethash x *rhythms*))

(defun keynump (x) (and (numberp x) (<= 0 x 127))


limitations; the rhythmp function will fail for things like w-s and the 
keynump function assumes the standard (midi) scale and doesnt allow 
note names.


On Monday, Nov 24, 2003, at 13:30 America/Chicago, Johannes Quint wrote:

> how can i test, if x is a rhythm (if x is a keynum)?
>
> i want to have something like:
>
> (defun rhythm-or-keynum (x)
> 	(cond ((rhythmp x) "i am a rhythm")	; but rhythmp/keynump doesn't 
> exist
> 	          ((keynump x) "i am a keynum")
> 	          (t "no rhythm, no keynum")))
>
> thanks for help
>
> j.q.
>
>
>
> __
>
> Johannes Quint
> Rilkestr.55
> D-53225 Bonn
> 0228 468256
> johannes.quint@web.de