I'm writing some scripts with pdlua that I want to initialize multiple instances of. I've declared my class and all of my variables as local and am not using any receivers. Whenever I update a variable within one object, the variable changes within every object, making them identical, and rendering my code not re-usable.
What could cause this?
I'm in the process of blind-cloning/porting parc (for monome/max) to pd (for livid block).
Picture an 8x8 grid, each row represents a note, each column represents a step.
When I have multiple rows selected on a step, I want pd to randomly choose a note from those steps (rather than playing a chord).
For this, I think I need to use [list] rather than [pack] or a [table], because it is dynamic. How can I choose a random element from a list, and how can I have a dynamic pack object?
For example, if I only have 4 notes selected on a step, I do not want to have [pack f f f f f f], but
[pack f f f f].
edit: by dynamic, I mean that it does not have a fixed length.