Jump to content

Recommended Posts


(defun testp (n1 n2 &key (test '=))
  (progn 
    (cond ((pitchp n1)
           (setf n1 (pitch-to-midi n1)
                 n2 (pitch-to-midi n2)))
          ((velocityp n1)
           (setf n1 (get-velocity n1)
                 n2 (get-velocity n2))))

    (eval (list test n1 n2))))


(testp 'cs4 'd4 :test '<)
(testp 'cs4 'd4 :test '/=)
(testp 'cs4 'cs4 :test '=)

(testp 'mp 'mf :test '<)
(testp 12 13 :test '=)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy