< Back to IRCAM Forum

Numbers rotated but minus on every second number

Hello! I’m looking for a more elegant solution to what I’ve done here.

Intervalls are rotated:

1 2 3 4 2 3 4 1 3 4 1 2 4 1 2 3

To get a zig-zag pattern I add minus at every second number:

1 -2 3 -4 2 -3 4 -1 3 -4 1 -2 4 -1 2 -3

In Row A every rotation begins on the next note in the contour.

In Row B every rotation begins on the first note in the contour.

Best, Dagfinn

Innskanning-3.jpeg

Hi Dagfinn.

Using the omloop factory you can do what you want. Whether you consider that elegant is a matter of personal taste.

But situations like these are where the Patterns lib shines, setting up and combining streams of arbitrary data of arbitrary lengths. Here you’ll want to combine two streams: your data to be rotated: (1 2 3 4), and modulation of these, the ‘signums’ '(1 -1) to cycle through. I’ve included an example patch showing how to achieve what you want using the Patterns lib.

-anders

pattern-stream-toggling-sign-of-every-other-number.omp (4.51 KB)

Dear Dagfinn,

Here is a patch using loop macro and mapcar for both options (rows…) and without any extra library.
You can also make it more compact using a red patch. But left it as is for clarity.
We may also have another option by rotating the (1 -1 1 ) intervals if you need so. This would be interesting if your have even notes

Best
K

zwei-gedichte-3.omp (37.1 KB)