Forum

Resampling points on a spline or graph

I often use the bspline node as a way to resample a set of values.

When doing this the input (control) values are assumed to be equally spaced along the spline (and can then be ‘sampled’ using a normalised value into the ‘input’ pin).

How can I achieve the same effect if the control values are not meant to be equally spaced along the spline? Ie they are not equally spread along the spline?

Note that I do not actually need spline interpolation for this, though it would be useful

Cheers

edit: to explain further, what I need is possible (without the spline interpolation) for a single input ‘sample’ using map (value interval advanced). The problem is I need to sample multiple input points and the number of these does not correspond to the number of control points. Don’t think I can use binsizes for this, but I may be wrong

Maybe the pathvectors plugin?

Hmmm. Very nearly works, but the ‘even spacing’ aspect of the path vectors plugin needs to only operate on one axis.

In my case this axis is time, as I’m trying to use this to resample recorded automation data to correct for missing/dropped frames that are inevitable when using vvvv.

Pathvectors spaces points evenly along all 3 axis, so the ‘playhead’ will move at a different speed depending on how large the change in automation data (the y axis) is.

It would be helpful if you post a patch with a generic example of what you get VS. what you need - because, as I understand your issue, it is already solved within the B-Spline (Value) helppatch.
In the helppatch, furthermore, its Input is fed with a LinearSpread and its Control is fed with random values: the opposite of the scenario you describe

if I got your point correctly.

I modified the following in pathvectors.cs

length += (helpers[i+1](i+1) - helpers[i](i)).Length;

to

length += Math.Abs[helpers[i+1](i+1).x - helpers[i](i).x](https://vvvv.org/documentation/helpers[i+1](i+1).x---helpers[i](i).x);

to make sure the length calculation is only on one axis and it appears to work.

Sorry for not posting a patch. It’s a bit of a mess!