Change list value by index at midi event
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,
Try the [sel] object
Or maybe this is what you were asking for…
----------begin_max5_patcher---------- 387.3ocyTssaCBCC8Y3qHJZOxpHPoWlTeXeGSUUAvklozPEIn0sp9uuj.T5l XT5VU0dAKrcrOmSb7AWGbb9dPhQOgdA43bv0ww5x3vo9eG7V59DNUZSCqxyx 3.1qJjnbadohCJaPRs2JWp22AUUFyDJLZYczcTUxFlHaUAjnpRHX77Q9dHRv LiIvu46oyvRsMOO90GID7oBUP2BJnXEHnwbay7aAFSbBWFeGccMe7FHOiKUp bwUxyXpHqehNMxxs4jKSz43+4bIXxf4xzaFWDva5B1TNEr2hFrD3HBxuw+5b gRnGNrwdtfQ4cy9vdYuWqsUILkVx9vlHIXj+EmpCBsRy3I8IPQcJPg2NAhsF 8.ifVrPKSpMfPa.tDtdI6GGX9CRDY1XqILpOMJ7hCQ1Sg4Lw22oYasw+WENY dYQRC9quFzBSSuSAohInJl9wSaN52knV7sgklBhyW8jxjlsQVb624E3PQiYU 2Yspa3Dd2fSz.Pyz6FZBG.Zh9knAsz8n6m.Qc8Yj -----------end_max5_patcher-----------
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.
----------begin_max5_patcher---------- 572.3ocyW00aaBCE8Y3Wgk0djgrM3Br21uiopJC3k3IvDANZYsp+2G1NgQ6B ekPR6KVxW6XeNGN2qu4EWGXZ0AdCD7MvO.NNu353XBoC3bbtCrjcHqf0X1FT x+cU5ufd1kT7CJSXEHETbJ5OqjJIqjaV460BV2Jx8kU6UEbk4vHGiZCo9yNt EIvTlbCzC.gfG6cjMhmMa.i8oITbbzw01wTYaExMOUyyT1S.Si8od.BJxG4A BH1I9ntySja.WKU9JNHpG7DxSnCqi8pqqdvalpSIuogsg+exyWv.jOco5CdH 84Z0k18n0kPhdDGOjtDeVcgbA5R6Ajxqml+pZQSFqvrBxOYYtFgToMMFyy0J POPMFmX83vFmjyab5N95VRp30OwkrzijZEMUDvVwGukhfCLYWXjQqhG0REhV OK04KDsqt0F.jpsEsp1RUGzEZZhstEjg7QAiZZBwqV0lojf6E8CH8nOkLN8I qF8S2qTUxE5yea0gywFrMom18YbL1Dbye5fBd.DAhAI.LpEbe7I7QXSExHiL YeHY378vac99yEZmNHX0583556vlJPrhCMYbyCcRww76fEB46aRyb253uUwZ p1WmchIcM2.vc2eNuQIjLknMwo2tzPo2t1Jxy4x9kDxEM5mvxG9MrkgHzrPD 5Ngn34fn2g6aKhRlEhhueHR+x8L+pcm7Q5Zuet7Q5pcexPDcVY+3IPToHeWU aSEMm52w7DP.x9+GRB6l8uaZk4vzpJ4BUUvitu59WnQMlAC -----------end_max5_patcher-----------
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.
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.
Forums > Max For Live