[sharing] matrixctrl move contents forward or backward

Robin Price's icon

Someone said in an interview that they found the forum most useful when people didn't post whole patches but design patterns so here's my contribution. I'm stuck in the past and still think step sequencers are kind of cool and matrixctrl is one of my favourite ways of creating them (remember a matrixctrl will interpolate with pattr while a coll or seq~ won't - this is where the fun is).

Sometimes you've created something funky but the downbeat isn't in the right place so you need to rotate the pattern. This is how I do it, it's got my favourite object that I think beginners overlook the power of when designing algorithms, 'grab'. That and a bit of list processing.

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

Just my two cents.

nicnut's icon

This is really cool and useful. Thank you.

When I first opened it the patch didn't work because two of the zl objects had the arguments written in wrong so I fixed it.

Here it is with the fixes:

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

Robin Price's icon

Yeah sorry I think the zl[DOT]arg thing is a max 6 'feature'. Glad you liked it.

ygreq's icon

Nice!!

Thank you

Wetterberg's icon

wouldn't matrixctrl be a lot more fun if you didn't have to do the row/column/value thing all the time?

Like, it would accept "getall" and "setall" messages and just output a long list? That would make working with it so much easier for me.

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

That's not very hard to do:

Wetterberg's icon

that... doesn't really work for me; an empty matrix shows up like:

0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 0 1 0 1 1 0 2 1 0 3 1 0 4 1 0 5 1 0 6 1 0 7 1 0 0 2 0 1 2 0 2 2 0 3 2 0 4 2 0 5 2 0 6 2 0 7 2 0 0 3 0 1 3 0 2 3 0 3 3 0 4 3 0 5 3 0 6 3 0 7 3 0

and there is no real way to send the full matrix back in.

Peter Ostry's icon
Max Patch
Copy patch and select New From Clipboard in Max.

It works, Chris just used a message box to show the long list. Connect a second [matrixctrl] to the same [patcher] outlet and you can copy from the first [matrixctrl] to the second by clicking the bang button:

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Maybe you were expecting just the data?

Wetterberg's icon

exactly, Chris. My wish is that the iter, counter, pack magic that we do in order to format the data wouldn't be neccesary, as we would be able to just feed in the list.

And even then we still need to set the col/row size in order to properly format. Wouldn't it be great to just have a long list wrap around? I'd love that, and I would certainly be using matrixctl a lot more if it worked like that.

Mariano Sibilia's icon

Hey, I am struggling to make this work using only 1 row in the matrixctrl. Example: 16 channels, 1 row. Any idea on how to do it?

Thanks xx

Source Audio's icon

to do what exactly ?

Mariano Sibilia's icon

to move content of matrixctrl object forward and backward, like in the patch by ROBIN PRICE but with a matrixctrl with only 1 row and 16 columns.

When I set matrixctrl to 1 row in the inspector, I get an error message in the Max console that says "matrixctrl: cell coordinate(s) out of range".

I'm not sure how to fix this. Any ideas on how to get it working?

Source Audio's icon

you probably have wrong order of cell messages

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

Mariano Sibilia's icon

Thank you for your response and help. However, I am not sure whether your patch has resolved the issue, as it appears to only move predetermined content within the matrixctrl. Basically I need to replicate the patch below, with the matrixctrl settings configured for 1 row and 16 channels without having error message.

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

Source Audio's icon

you asked how to shift matrix cells in 1 x 16 matrixctrl.
patch I posted does that.
so there is no issue to resolve.
you posted patch with 12x16 matrixctrl with complicated
uzi -> getcolumn etc stuff

reduce it to what you need and don't query uneeded stuff.


Mariano Sibilia's icon

This last example is perfect! I also managed to make the previous patch to work by changing the arguments of the counter to 0 0 0, however your latest version is way better and cleaner. Thank you so much.

m. bender's icon
ghost from the past's icon
m. bender's icon