Hello,
I have what I hope is a trivial maths question… I am writing a spatialisation process with spat in max. I simply would like to have a source move smoothly between a randomly selected loudspeaker e.g. 1-6 at a certain speed.
The patch design simply outputs one of the 6 loudspeaker positions at random every time there is a bang, generated by a metro object. The speaker positions form a hexagon, at -30 30 90 150 -150 -90 degrees. I use a line object to make the source glide between speaker positions with a time interval related to the speed of the bang interval. Patch copied below.
The problem is that the line object and list of positions are only 1D and so the line moves only back and forth along the list of speaker positions i.e. it doesn’t always take the shortest path on the circle e.g. between speakers 4 and 5 at 150 and -150 degrees it goes anticlockwise 300 degrees rather than clockwise 60 degrees.
Is there an alternative paradigm to work in a more circular manner that would enable the system to always glide the shortest path between speakers? I’m hoping it’s a trivial problem and I’m just a little ignorant with my bad teenage maths knowledge.
It would be great to know an alternative paradigm that might work for larger speaker arrays, and eventually in 3D too.
Thanks!
Nick
----------begin_max5_patcher----------
3129.3oc6cs0iahjE94t+UfrxaqiScEnFo4gYlUZdYizpYk1UqRV0BaWs6JA
CV.NcmLZ9uu0E.CXvtvFncFMcR6KUATmy24RcphCm92u+tYKiegmNy4Gb9fy
c2862e2c5lTMbW92ua11fWVEFjpOrYqh2tkGkMatouL9KY51WrXQ1Sbmz38I
q3NOKBCch3egm3jkD7EdnyZQBeUV3WcVxydlyibR2wC9LOI0g3DDs1gN2QjY
NufvmC9ZpylXG0ULLNZiirghQLTDwWEuOROrj7Fi1uMdeVHOSSjf7VEq0jV7
xO8Vhew4uKHa0ShnMOnnGCmiYjEf4NTO8aPJP8lq7Um+2gquHp3xCUs8G2eu
5k4VBaa4ooAa3GAauy.XuSN.KkfEbty6xAlhlbOzT56B9lyaw.G4+Y.Eg57V
8KLI8tLHZSOvHXKXjaw4aNtrutia.nYyJQhVfOHxaAf4Ac8AlefR1f3hMfIS
Clnt.SzE.lQ7mkz6QXYpj1nK9hf+LOYVqLMtElF2MSOO+2Sw7HleEcGOW0qn
N41BTOUZSr9A43KuNODjkkHVtOyXHdWISqFujfs7LdxC7nfkgZBCn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