need help by Matrix optimization

Jonas Vorwerk's icon

Hello everybody,

For one of my graduation projects I'm building a step sequencer which controls my installation. The thing works but the code is way too much lines. I would like to build it more generic.

I use a matrix for the gui and the getcolumn output linked on to my audiotracks. Works great.

Now I want to control a led board. So I use 2 routes so set a led on and off and de decode to show the time steps. And this part is a bit of a mess. please take a look my code.

Probably a newbee question again but at least it's not a DJ patch.

The max patch 4.5:

Max Patch
Copy patch and select New From Clipboard in Max.