how to use string set number of outlets in objects like pack/ unpack/ sel etc.

Apr 3, 2013 at 10:55pm

how to use string set number of outlets in objects like pack/ unpack/ sel etc.

Hi!

JavaScript seems to be nice and easy but I’ve already got first problem :)
I would like to create object (let say unpack) with outlets equal to the specific argument (let say unpack_length). So when unpack_length = 5, unpack with 5 outlets is created.

The problem is – how to put those args in this line of code:
unpack = this.patcher.newdefault(500, 100, “unpack”, “unpack_length”);

I now how to split a string in js, but got no idea how to put single args in the line of code above.

Any help will be appreciated!

#67512
Apr 3, 2013 at 11:50pm

włala:

function make_unpack(unpack_len) {
var unpack_args = [];
for (i=0; i < unpack_len; i++) unpack_args[i] = "i";
this.patcher.newdefault(500, 100, “unpack”, unpack_args);
}

#242922
Apr 15, 2013 at 9:38am

Thank you so much for this solution :) I’ve send you a prv, check it please!

#242923

You must be logged in to reply to this topic.