Jump to content

Grace notes represented by symbol z?


Recommended Posts

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.

 

 

Link to comment
Share on other sites

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)

 

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