< Back to IRCAM Forum

Interpolation between closest points

Hi all,
in relation to the brilliant lisp routine conceived and kindly provided by the forum user Jialin (to be found here http://forumnet.ircam.fr/user-groups/openmusic/forum/topic/rearrange-point-pairs-list-with-closest-pairs-algorithm/), I’m looking for a code that interpolates an arbitrary number of points (i.e. samples, like in the om-sample object) between a point and its closest one, then repeats the operation for the next closest point pairs and so on. In short, it would be a recursive resampling within all the nearest points. Thanks as always for your attention.
Best,
Francesco Vitale

Hi Francesco,

I am sorry that I have not seen the forum in last days until this morning, we had the same problem, perhaps you can check the code I have submitted under the other topic.
The function points-toward-xy could be a good start-point to do that. (You could input sth like (0.0 0.1 0.2 0.3 … ) into the third inlet – generated by the function interpolation or the function arithm-ser).

Best,
Jialin

Dear Jialin,
your om-sample-pro (besides the function points-toward-xy) seems to be a surprisingly good starting point for the purpose I expressed in this post, and I can’t thank you enough for having solved this important bpc sampling issue!
All the best,
Francesco

Dear Francesco,

you are welcome, have fun with that and I hope you will have a very successful work!

Best,
Jialin

Dear Jialin,
forgive me if I’m bothering you again, but I having some trouble in using your function “points-toward-xy” inside a loop for all the points of a BPC. The error I get is “Error while evaluating the box OMLOOP : No applicable methods for #<standard-generic-function distance-2-points 406004441C> with args (7.59 28.431002)”. Here attached you’ll find the .omp and the screenshot of the error. What am I doing wrong? Thanks for your patience.
Best,
Francesco

points-toward-xy-loop.omp (4.39 KB)

Dear Francesco,

I think you could use the onlistloop instead of listloop.
Because the method points-toward-xy just accept the point pair, not a number.

Best,
Jialin

points-toward-xy-loop-new.omp (5.27 KB)

Hi Jialin,
great suggestion, it works fine! Many thanks again.
Francesco