< Back to IRCAM Forum

Remove notes that are repeated and sum durations

Hi everyone!

I little help,

I have this list:

(t t nil t nil nil nil nil t nil t t t t nil t)

and this one:

(44 43 44 44 44 43 44 44 43 44 44 44 43 44 44 44)

Is it possible to added the number with the next when I have nil in the first list?

For example, the 3º number will be added with the 4º (because the 4º is t).

The 5º, 6º, 7º, 8º will be add to the 9º number, because just the 9º number is true?

Thank you very much for the help!

Hi Charles,

Maybe this is not a so “elegant” solution, but using lisp in this case is so easy and practical:

charles1.lisp (422 Bytes)

You can of course use this in a lisp “Lisp Function” object as so:

Here is the zipped folder:
charles-patches.zip (1.9 KB)

Best
K

Thank you prof. Karim.

I thought a lot but couldn’t solve it. Thank you very much!