torstenanders Posted March 19, 2017 Share Posted March 19, 2017 I would like to algorithmically process rhythms that contain grace notes. The function omn turns grace notes into 0 lengths, which is useful. (omn :length '((acc 1/8 1/8) 1/2 1/4)) However, I have difficulties translating them back after whatever processing of the rhythm. The function make-omn turns 0 lengths into the symbol z, but this symbol is not supported by snippet preview. (make-omn :length (omn :length '((acc 1/8 1/8) 1/2 1/4))) What am I missing here? Best, Torsten PS: Apologies for submitting so many messages. Quote Link to comment Share on other sites More sharing options...
opmo Posted March 19, 2017 Share Posted March 19, 2017 You can processes OMN lengths but it is not that easy. To do that you need to use DISSEMBLE-OMN and then MAKE-OMN. (apply 'make-omn (disassemble-omn '(q c4 e d4 acc e acc h f4 q g4))) One day I will make documentation how to do that. Here is a short example: (defun add-len (omn add) (let ((plist (disassemble-omn omn))) (setf (getf plist :length) (loop for i in (getf plist :length) collect (+ add i))) (apply 'make-omn plist))) (add-len '(q c4 e d4 f4 h g4) '1/8) => (q. c4 q d4 f4 he g4) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.