Forums > Javascript

list / array with vectors (js)

December 16, 2013 | 5:12 am

i have a pretty simple js that takes a list with 15 numbers (f.e. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) and performs some maths on these numbers. But actually each of the items is a vector (f.e 1 = 1 2 3); Is there a simple way to modify this script to operate on vectors?

function list()
{
var siz = arrayfromargs(arguments);
siz[0] = siz[0]*siz[1];
siz[3] = siz[3]*siz[1];
siz[6] = siz[6]*siz[1];
siz[4] = siz[4]*siz[3];
siz[5] = siz[5]*siz[4];
siz[7] = siz[7]*siz[6];
siz[8] = siz[8]*siz[7];
siz[9] = siz[9]*siz[2];
siz[11] = siz[11]*siz[2];
siz[10] = siz[10]*siz[9];
siz[13] = siz[13]*siz[10];
siz[12] = siz[12]*siz[11];
siz[14] = siz[14]*siz[12];
outlet(0, siz);
}


December 16, 2013 | 5:39 am

Max only has flat lists. No hierarchical lists-containing-lists-containing lists (if you’re used to LISP, you can forget that sort of structure here).

So you’re going about things the right way as it stands.


December 16, 2013 | 5:59 am

thanks, so i went that road and found a zl-/cycle-based solution to join them


Viewing 3 posts - 1 through 3 (of 3 total)