# Need help for a new module "Phase (Spreads)"

hi everyone.

i wanted to create a little module that is able to shift the indices of a spread but with a smooth transition from the old value to the new one that follows… something similar to the phase pin of linear spread but applicable for all sorts of input spreads…

i made a solution that works somehow but i have a problems to understand how to do it exactly.

the problem with my solution are that if phase is 0 the output is allready shiftet and i cant correct that because i dont really understand my own solution… and that really is driving me nuts… maybe someone can help me becuase try allready the whole afternoon to get it work correctly.

couldnt be that difficult but i have some knots in my brain!

so i f anyone needs a little challenge, downolad the attached module…
cheers ele

I think I have what you want. It was hard to understand and set up, but I’ll try to explain. For starters, I used scroll instead of shift. It was easier for me to understand.

Scroll apparently fills in its output with all slices with a lower index in the input than what the output index is set at. If output index is 5 it takes slices 4, 3, 2, etc. from the input. Setting the input index the same as the output is zero shift. Setting it higher shifts foward. If output index is 6 and input index is 7, all slices in the output are shifted foward once.

To allow the patch to shift through a complete cycle required remaping the input so that it is repeated once. The scroll does not automatically repeat its input. It fills in a default value instead.

I don’t think I explained scroll well but basically I figured out how to get the same offset that you have in your patch. I used map instead of regular mathamatical operations to get the number I needed for the scroll. I mapped the 0 to 1 of the phase to a destination of 0 to the total count of the input.

Actually, looking at it again, I’m not sure if it is quite what you wanted, but I think its on the right track. Check it out and give me some feedback.

–Rick

in my solution the morphing is done by just sampling points within a 1d linear b-spline (with degree 1). when the phase is 0 all sampling points will exactly fit the control points of the curve.

notes:
linearspread output range should match “input room” of the b-spline node.
linearspread is leftjustified, so that the first sample point will match first control point.
b-spline is closed. internally the first control point is copied and added to the end of the control point list. but in the case phase=0 we don’t want to sample this imaginary last point. that’s why we use a leftjustified linearspread.

Thats quite impressive, gregsn. Its an interesting patch. What did you plan to use it for, elektromeier?
–Rick

the idea and math behind a b-spline is very simple (lerp, linear interpolation between control points). so because of this it should be considered as a very basic node.
did you notice that a degree of zero will result in a scroll or shift behaviour (without interpolation at all)?

most of the time you won’t need its advanced features.

however when doing camera path animation Out’ and Out’’ can be useful for computing the orientation of the camera.
also Inputs per Curve and Control per Curve are interseting when you want to distort a b-spline grid.

have a look at the “girlpower/ + curves” folder to see some advanced examples.

also a b-spline sequencer should be easily possible to create with this node.

Thanks a lot for your help guys !

rick, thanks it encouraged me to play around with scroll instead of shift and helped me to locate the problem with the jumps.
i think the problem with your and mine solution is to shift or scroll the spread in the right moment means when inputmorph hast finished its morph not inbetween.
i use that module to animate the thickness (could be any other parameter) of a ropeobject. i like to draw a thicknessprofile and shift that along the rope. it looks a bit like a snake that eats a mouse :)

the solution with bspline is really amazing, never thought that this node can solve this problem and in such an elegant way.
are there some examples for (camera) path animation with bspline? that would be really interessting for a lot of poeple i think.

i attached a camera path example. hope you like it.
movingtriad is also used in rollercoater patches and in “Deform by 3d B-Spline Curve”. it is also a node of the day. a node worth looking at.

cam.zip (5.5 kB)

ah! you have to put the module b-spline (3d) into the modules folder! i added two outputs…

birthday somebody?

ps: the module is again NEW.

REAL rollercoaster.zip (13.2 kB)