< Back to IRCAM Forum

Fake Gregorian music. :-)

Hello, I have a question where I think OM-Loop is the answer. But I haven’t grasped the function to its full extend. I’m afraid I’m stuck.

Let say I have the following row:
(0 2 4 6 5 6 7)
I want each of the numbers to be repeated
(3 2 2 3 2 1 3)
Resulting in:
(0 0 0 2 2 4 4 6 6 6 5 5 6 7 7 7)
It would be cool if the lists can be of different lengths.

Best from the “land in the North”, Dagfinn

Hi Dagfinn,

Here are two solutions using mapcar and loop:

Now if you need the result as a list of list, you just remove the flat.

Best
K

Although Karims solutions are superb, i can’t miss a chance like this to advocate the Patterns lib :slight_smile:

(Thats using the :for keyword-arg to both the p-cycle and the p-copier)

1 Like

Hi Karim, thanks a lot for the enlightening answers. Using the two examples is a great didactic approach to OM-Loop; a function I really try to grasp in its fullness. I’ve programmed your patches, and it’s pure joy! Cf. Gregorian chant. smiling

Best, Dagfinn

Hi Anders, thanks a lot! I’ll look more into your library which I have installed including the tutorial patches.

I have a question, I didn’t manage to find the short cut for making extra inputs where &key is stated in the documentation. I’m used to &optional doing that. What have I missed? Best, Dagfinn

Hi Dagfinn.

I have a question, I didn’t manage to find the short cut for making extra inputs where &key is stated in the documentation. I’m used to &optional doing that. What have I missed?

Hitting the ‘k’-key while the object is highlighted will add inputs for successive keyword-arguments. Select the keyword-arg you want access to by clicking on the input, and choosing from the pop-up menu.

You can hit ‘h’ on the patch-background to get a list of shortcuts.

This is explained more clearly in the manual:
http://support.ircam.fr/docs/om/om6-manual/co/AdditionalInputs.html

-anders

2 Likes

Thanks Anders! Kind of embarrassing that I haven’t learn &key after using PatchWork and Open Music for over 20 years. :slight_smile: Best, Dagfinn

Dear Dagfinn,

No worries about that. This feature was added a couple of yrs ago and was discretely documented.

Best
K