[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] spreading an array across multiple function arguments
> switch(args.size,
> 0, { na.sendMsg(obj, method) },
> 1, { na.sendMsg(obj, method, args[0]) },
> 2, { na.sendMsg(obj, method, args[0], args[1]) },
> ...
You're looking for Object.perform,
http://doc.sccode.org/Overviews/Methods.html#perform. It's the generic
way to do it.
// Normal call
myObject.myMethod(...args)
// Call with array
myObject.perform(\myMethod, args)
So the call you are looking for is
na.perform(\sendMsg, args)
You can wrap that in your helper, or you can use it directly as needed.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/