Interpolation between Arrays
tmhglnd opened this issue · 3 comments
tmhglnd commented
Include various forms of interpolation between arrays inspired by methods from the AC Toolkit.
ToledOmer commented
Hi,
Are you talking about the "Interpolating between two note structures" on page 93 ?
I can help you with that :)
tmhglnd commented
That would be one way indeed, which might be fitting for the Stochastic methods (since it uses randomness). Another more mathematical option I had in mind is actually more straightforward and just linearly interpolating between numbers from an array. So for example:
let arr1 = [0, 1, 2, 3, 4];
let arr2 = [0, 2, 4, 8, 16];
let arr3 = Mod.interpolate(arr1, arr2, 0.5);
console.log(arr3);
//=> [0, 1.5, 3, 5.5, 10]
I already started working on that in the utility.js
section. The method is called mix()
. Feel free to expand upon that, or start working on the interpolate method as described in the paper on p.93!