< Back to IRCAM Forum

Another simple question: how to include merger or concat into omloop

I would like to combine a list of several chord sequences into a single chord sequence. So far, I suspected this would work but I get the error below. Any help would be appreciated!

Screen Shot 2020-09-04 at 8.19.00 PM

Hi brandonc!

You’re right, #'merger expects 2 sequences as input (it should possibly include a method where one argument is 'nil, just passing the other input through).

In your case you can either #'reduce the #'merger function across the list of chord-seqs, or, if you prefer using omloop, take care to pass the first element (car) of the input list as the second argument to the 'accum-box, and iterate over the rest of the input list (cdr):

bilde

-anders

1 Like

(it should possibly include a method where one argument is 'nil, just passing the other input through)

2 methods to allow #'merger to handle empty arguments:

(defmethod merger ((self1 score-element) self2)
  self1)

(defmethod merger (self1 (self2 score-element))
  self2)

I’ll test these a bit more, and if Karim approves, add them into the code.

-anders

2 Likes

Hi

Here is a straight and easy way to do it without a loop as Anders said:

But all suggestions are welcome.

Best
K

1 Like