Dynamic lists
I am trying to find a way to create a list that can grow dynamically. By that I mean that I don't know how long the list will end up being, but I need to feed a stream of integers in one end and have a list that grows each time a new integer is fed in being output the other end. Any ideas?
Max Patch
Copy patch and select New From Clipboard in Max.
This can grow fairly far, though it all depends on what you're recording. If you need something bigger than this, you might look into storing data in coll/buffer~, but this will likely handle what you need.
Alternatively you could use js for that:
var myList = [];
var intIn = function(x) {
var temp = myList.length;
myList[temp] = x;
outlet(0, myList);
};
Max Patch
Copy patch and select New From Clipboard in Max.
var clearList = function() {
myList = [];
};
Perfect, many thanks guys!
Max Patch
Copy patch and select New From Clipboard in Max.