Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Merge-voices from list

Featured Replies

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

  • Author

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

 

 

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)

 

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

 

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))

oh, thx, did not know, that APPLY works on functions "first to the remaining arguments."!

  • Author

thank you all, such a great community!!!

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.

Thanks, Stephane !!

 

Is there some documentation about it ? 

Very good to know. 

Best,

Julio

Create an account or sign in to comment

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.