Hello, I need some help with a patch. The problem is simple. I’m creating a series of intervals that I add to the starting pitch (dx->x). The resulting sequence of pitches initially ascend. Once it reaches its highest point (the given highest pitch), it begins to descend. Once it reaches the lowest pitch, it begins to ascend again. And so on, in a continuous cycle, until it has exhausted all pitches through this constant rising and falling.
For illustrative purposes, I call it a “snake” that “slidering” toward the upper limit. As soon as it detects that it has reached the bound or that adding another interval would cause it to break the upper limit, it begins to descend. As soon as it approaches the lower limit, it turns around and starts going up (it must not cross it). And so on, over and over.
I’m not able to write the process as a loop; I can only write the “rising” and “falling” parts themselves. The patch is attached;
thank you for your advice.
PetrH
a row of intervals.omp (11.8 KB)



