Change list value by index at midi event
Hi,
I want to programm a Step Sequencer which I can operate with an external controller and so I want to be able to change the list value representing the state of a step by an index number (There are only 2 states, 0 and 1 and so everytime I hit the Button for a certain step I want this number to be changed either to 1 or to 0)
But I wasn't able to find a nice object in Max to do this. I Could only find this mxj list.replace java implementation but it didn't worked properly for me.
Thanks a lot,
Greetings Sparsepix
Try the [sel] object
Or maybe this is what you were asking for...
yeah thanks, that works for inverting the value but I can't see any way how to change the internal value of a list with this object. Could you help me out ?
have a look at the [zl nth] object. there you can replace any index of a list with a new value... I think that's what you are asking for...
nth: accepts a list in the left inlet and outputs the nth element of the list out the left outlet.
the tooltips of the outlets say that they output the nth element of the list on the left and the list without the nth element on the right ... but I cant find a way to just change the nth element / put a new element in at the nth position ;/
if the lenght of your sequencer is fixed or at least limited to a known length, [pack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] will be your friend.
not to seem grumpy, but read the entire help file for [zl nth]: extra argument to right inlet specifies . nth element will be replaced with in right oulet list.
oh you're so kind ! I where the hell did you find this ? I thought I looked up the whole reference page for zl ^^
Anyway thanks a lot I think that will fix my problem.
Greets Sparsepix
hey i'm having a similar step sequencer related problem. I'm using the coloured buttons on an xbox 360 controller to input dater into the matrix control object. The butons work on 1's and 0's so when i press a button it show up on the matrixctrl.
any help would be appreciated.