< Back to IRCAM Forum

Concat for many

hello everybody,

I was looking for a function that can concatenate several chordseqs. I couldn’t find any. perhaps there is one in a om library? meanwhile I did the following with an internal lisp function:

[lista is a list of, say, chordseqs.]

(lambda (lista) (let ((buf (concat (first lista) (second lista))))
(loop for i from 2 to (1- (length lista)) collect (setq buf (concat buf (nth i lista))))
buf))

and it’s working ok. but couldn’t find a way to do it in proper graphical openmusic. is there any?
I know my inability to do it is related to my lack of understanding of recursion in openmusic. I owe to myself a better study on this matter.
sorry if this topic was addressed previously.
thanks in advance,
perti

Hi Perti,

Here is an example with voices. Should work also with Chord-seqs.

Best
K

1 Like

aha! that’s right. thank you so much Karim for enlighten me.
merci beaucoup!

1 Like

Hello,
I am currently using OM6.16, and have made my own lisp functions for many things.
Today I noticed that silences between concatenaed chord-seq’s are exponentially increasing for each loop iteration (code below). And this didn’t happen in earlier Open Music versions. There should be no extra silence in between.
I create a chord-seq lasting 300 ms with a few notes. I use repeat-n 10 times and used this as input to the function below. This should create 10 immediate repetitions of the notes.
But what happens is that the 10 fragments start at:
0 900 2100 4500 9300 18900 38100 etc. in a chord-seq lasting 153600 ms.
While the correct start times would be:
0 300 600 900 1200 1500 etc.
What happened to concat? Seems I now can’t rely on it any more and find a solution with lists.

Best
Ruben Gjertsen

(defun r-concat-chordseqs (list-of-chordseqs-for-concatenation)
(let*(
(recursive-chordseq (setf recursive-chordseq (make-instance 'chord-seq
:lmidic 'nil
:lonset 'nil
:ldur 'nil
:lvel 'nil
:loffset 'nil
:lchan 'nil
)))
(concatenation-loop (loop for chord-seq in list-of-chordseqs-for-concatenation
collect (let*(
(this-chord-seq (setf recursive-chordseq (concat recursive-chordseq chord-seq )))
)

                                           )
                                       ))

);end of main let declarations
recursive-chordseq
);end of main let
)

Hi Ruben,

Yes this is a bug that is now fixed. It will be released in the coming version pretty soon (vers 6.18).

For the time being, please try this patch (to be put in the init folder).
fixconcat1.lisp (1.1 KB)

Best
K

Hi Karim,
Thank you, that was quick!
Now it’s working again.
Best
Ruben