Jump to content

"gen-stacc" -> question

Recommended Posts

don't know if somthing like that exists... generates "stacc"-rhythms = splitting lengths for example 7/32 to 1/32 -6/32 (works with single values or lists)
-> only "1 bug"... when i want to do this with 4/32 -> then lisp *reduces it" to 1/8, so it don't work for such rhythms...?!? any ideas?




(defun gen-stacc (n)
  (if (numberp n) 
    (if (> (numerator n) 1)
      (list (/ 1 (denominator n)) (/ (* -1 (- (numerator n) 1)) (denominator n)))
      (list n))
    (loop for i in n
      append (if (> (numerator i) 1)
      (list (/ 1 (denominator i)) (/ (* -1 (- (numerator i) 1)) (denominator i)))
      (list i)))))

(gen-stacc '(7/32 9/32 17/32))
(gen-stacc 4/32)


Link to comment
Share on other sites

Yes, I have also experienced this difficulty, for example, can't distinguish between 4/4 and 2/2 because both reduce to 1! As JP points out, this is a Lisp issue, nothing to do with OM. If we are adventurous, we could implement our own "data type", for example keeping numerator and denominator separately as a cons pair (numerator . denominator) or something similar. We can write a set of functions that operate on this, and then apply reduction when actually needed. More work, of course, but Lisp gives you control.




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.

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