manipulating (reversing) Function

Ben Casey's icon

Hey guys, I'm trying to create some controls to manipulate the points in a function. Ideally I'll be able to make a button to flip or reverse the sequence of the points.

I was thinking I'd use zl to reverse the list of a dump, however a "dump" outputs a series of lists.

Any suggestions, tips or a good tutorial to point me to?

Thanks!

seejayjames's icon

You might try using the other outlet, where the points come out in line format, so each pair can be flipped with [zl iter 2] --> [zl rev]. Or if you know the domain beforehand, you can send all the domain values through [!- x] where x is the total domain size, which will flip them on the horizontal. Could also modify to flip vertical in the same way, if that's useful... scaling the range points is also easy... essentially once you get the values as pairs, you can do a lot of fiddling before you send them back in. And don't forget [preset].

Ben Casey's icon

Hey thanks, that works like a charm.

Perhaps you have some advice on the next step. I want to send these reversed values back into the same function object but I'm either getting nothing at all or an overflow. I tried using zl reg to store the values then send them back out again however it appears to only work with integers and not floats.

So I have a working version where one function sends the reversed numbers to another function, clears itself, then sends the contents of the second function back to the first.

Is there a tidy way to get rid of the second function?

Luke Hall's icon

Something like this for the inversion? You can put a [!- 1000.] on the left outlet of the [unpack] if you want to reverse it instead.

lh

Max Patch
Copy patch and select New From Clipboard in Max.

Ben Casey's icon

Oh that is MUCH tidier! thanks, looks like I need to learn more about zl group.