vpolajnar Posted May 13 Share Posted May 13 Dear Opmo users, i would like to merge voices from one single list. So I would like this (not-working) merge-voice function: (setf test '((s) (-s s) (-e s))) (merge-voices test) To work like this: (merge-voices '(s) '(-s s) '(-e s)) Does anyone has an Idea how to achieve it? Best, Vili Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted May 13 Share Posted May 13 merge-voices function is made for OMN expressions, not length lists. S. Quote Link to comment Share on other sites More sharing options...
vpolajnar Posted May 14 Author Share Posted May 14 Dear Stephane, thank you, even if try with "OMN expressions" in a list , if i understand it correctly, is pretty same. (setf test '((s c4) (-s s c4) (-e s c4))) (merge-voices test) (merge-voices '(s c4) '(-s s c4) '(-e s c4)) But anyways, does anyone knows how this function is programmed so I could program own one, with result I wanna achieve. Best, Vili Quote Link to comment Share on other sites More sharing options...
AM Posted May 14 Share Posted May 14 some "ugly code" ...but it works.... you want to use (merge-voices) with ONE list as input? (setf test '((w c2) (h c4 d4) (q g5 g5 g5 g5))) (defun your-merge-voices (alist) (merge-voices (first alist) (second alist) (third alist) (fourth alist) (fifth alist))) (your-merge-voices test) Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted May 14 Share Posted May 14 Dear friends, I got the result (z^w c2 z^h c4 q g5 g5 z^h d4 q g5 g5) in this operation, using André´s function. What is the meaning of z and ^ in the OMN language ? THanks, best, Julio Quote Link to comment Share on other sites More sharing options...
torutakaishi Posted May 15 Share Posted May 15 Common Lisp's APPLY function applies the function of the first argument to the remaining arguments. (setf test '((s c4) (-s s c4) (-e s c4))) (apply #'merge-voices test) => ((s c4) (s c4) (s c4)) vpolajnar 1 Quote Link to comment Share on other sites More sharing options...
AM Posted May 15 Share Posted May 15 oh, thx, did not know, that APPLY works on functions "first to the remaining arguments."! Quote Link to comment Share on other sites More sharing options...
vpolajnar Posted May 15 Author Share Posted May 15 thank you all, such a great community!!! Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted May 15 Share Posted May 15 22 hours ago, JulioHerrlein said: Dear friends, I got the result (z^w c2 z^h c4 q g5 g5 z^h d4 q g5 g5) in this operation, using André´s function. What is the meaning of "z" and "^" in the OMN language ? THanks, best, Julio This is OM polyphonic notation. S. Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted May 15 Share Posted May 15 Thanks, Stephane !! Is there some documentation about it ? Very good to know. Best, Julio 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.