< Back to IRCAM Forum

Applying interval structure iteratively

Good evening All,

I’m having trouble formalizing, and therefore thinking of, a solution to the following:

I have a 5 pitch melodic contour (though it could be n pitches) with an (n) interval order, for example (in mc) 400 -600 1100 -300 that I’d like to apply in successive rotations, (rotation 1 would be -600 1100 -300 400, rotation 2 1100 -300 400 -600 etc) at a designated point point in the original five pitches. To be clear, for example choosing the final pitch of the set: 1 2 3 4 5, with interval structure above, then take last pitch (though it could be n pitch) and apply rotated interval structure then repeat until exhausted. Perhaps this is clearer:
a b c d e with original intervals, e then becomes the starting pitch and 1st rotation of intervals, new e then becomes first pitch again and the 2nd rotation of intervals is applied etc etc.
I am confident of understanding how to produce the interval structure in rotation but not applied recursively.
Would anyone have any hints on how to proceed? Mapcar or calling a function in lambda?
Thanks for any assistance,
krhes

Hi krhes.

If you’re looking for a ready-made solution you can just apply the p-rotation pattern to your data, something like this:
Skjermbilde%20fra%202019-07-16%2021-41-30
But as you suggest, it would perhaps be more preferable to build a more general solution, using omloop or similar.

Hi Anders,

Thanks for this which is a great help! I’ll try it out and see if I can replicate the principle in omloop. However, getting the ‘dots’ out is always preferable to being stuck in patch purgatory so at least I can apply this in a real compostional scenario!
Krhes

Hello Krhes,

I’d say you can do it like this - just in case you didn’t figure it out yourself already…

Best
Peter

even simpler:

Dear Peter,

Thanks so much for your time and knowledge - I love mapcar and the simplicity! I fear however that I’ve not been clear enough in my question, something I hope to rectify now. Please see the attached for details.

There are a few extra features that will be included (such as scaling the size of the intervals) but they won’t affect the current problem.

Would you (or anyone finding this interesting) have a solution?

Thanks again,
Krhes

Hey krhes,

If i read your shedule on the bottom right correctly, the point is, that you’re doing two different rotations in opposite directions: pitches from back to forth and intervalls from front to back.
So the concept would be:
take the intervall-series of a given pitch series and apply it’s succesive (so to say:) front-to-back rotations to the respective first pitch of a analoguous back-to-front rotation of that pitch-series? So it could go like this:

I lately took my time to get a bit deeper into lisp as I share your enthusiasm for it’s “black-boxiness” (put something in - get something out). So you are welcome!

Happy chopping,
Peter

… ups: no (- length 1): 07

Peter,

This is perfect! Thank you so much for unraveling this. It’s clarity is great and the simple listloop in the zipper is so simple. I keep dipping into Lisp (and it’s too easy to adapt things like solutions to the 99 problems in lisp) so I really have to commit to consistent study!
Best wishes,
Krhes

If i understand the problem you’ve set up correctly, it can be given a recursive solution, to be able to use the newly calculated last pitch of the series each time through (in any case it’s useful for illustration purposes):

Hey Anders,

that’s cool (…far more)!

(And thanks for not proving me too overtly wrong with my “criterion in itself”-argument by giving the list length “manually”. -smile-)

Best
Peter

Hello Anders,

Thank you very much for your thoughts and for further streamlining this process. I’m very much enjoying (and learning from I hope!) the different ways to ‘skin a cat’.
Have a great weekend and thank you, and Peter too,
Krhes

yet another one. simplifying loop…

I have a very simple (!) task I want to achieve … to program/add in an iterative/mechanical way intervals and extensions to any note/chord ie so as to populate progressions based on those instructions ( ie if I have a list of minor 3rd intervals and wish to add maj 3rds or any extension… how do I do this … using nth random and lisp random will not coordinate with om+ except in eval1 mode… Next question will be is there the possibility of writing super scripts to sequence chord progression ie I V vi IV and so on and so forth… v.best