Matrixctl + Setting a default grid state

  • I'm working on a patch and I want both the button press and LED states to be set a certain way.

    For example, the entire bottom row toggled and lit up as a default state when the patch loads.

    I'm currently using matrixcntl objects if that helps...

  • have a look at the messages to set a full quad here and the /grid/led/map message

    for example i had in a patch to draw the leds as a chromatic set of notes after detecting the size of the grid with this message

    /grid/led/map 0 0 0 181 171 90 181 171 90 181

    the first 0 0 is the column / row offset (i.e. for a 128 it would be 8 0) then the rest are bitmaps for each row.

    here's the patch if that doesn't make sense


  • if you're using matrixctl you could just have a default state and have it load from a preset when the device gets focused.

    there are numerous ways to get what you want, which is great but potentially overwhelming i know.

  • Ah yes! I think using matrixctl default states + presets is what I want here.

    Just sending a [/grid/led/map 7 7 255 255] message indeed gives me the LEDs behavior I want, but since my patch is wired functionally through the matrixctl objects I need button press and light data to be synced.

  • Some good progress:

    /monome/grid/led/row 7 7 255 255 [is what I I'm using to set the 8th row of leds]

    0 7 1 1 7 1 2 7 1 3 7 1 4 7 1 5 7 1 6 7 1 7 7 1 8 7 1 9 7 1 10 7 1 11 7 1 12 7 1 13 7 1 14 7 1 15 7 1 [to set the matrixcrl object(s)]

    By the way --- If I want only the bottom row of a matrixctl grid, how to do I display the 8th row of a 16 column 1 row object? offsets?

    Right now I set it to 16 X 1 and my bottom row monome presses dont show.

  • Both the matrixctrl and the monome grids start from 0 0 so you'd need to use 15 x 1

  • @ jhindsight

    I realize the messages that come in and out of matrixctl begin with 0 0. I am talking about the properties of the Matrixctl inside the Inspector. This is represented with rows and columns and they start at 1. For example, the Matrixcntl objects inside the monome test patch are 16X16 to support up to a 256.

    Anyway, if I am dealing with the bottom row of my 128, how can I get the Matrixctl object to display 1X16 and show my presses?

  • "if you're using matrixctl you could just have a default state and have it load from a preset when the device gets focused."

    honestly wish i knew this when i started using max :(

  • What I often see, when you're treating one row differently than all others, is multiple matrixctrl objects. e.g., a 16x15 grid and a 16x1. Simple [route] or [routepass] commands send your button presses where appropriate. And then in max 6, you can send a message into those objects to set which row (8 or 16) is the oddball. You can also reset the height of your matrixctrl object with a "height 7" or "height 15" message, and of course, change the offset that you're using to recombine those for display.

    This may or may not have any functional advantage in terms of dynamically associating your preset with a variable row number, but it can be more visually intuitive to code around.

  • @karaokaze and @all

    Hi guys, I'm eager to explore 'saving matrixcntl states with preset/pattr system'

    Currently I've got a boatload of messages that all get banged on init and I'd love to know how to do this more efficiently (if possible).

    Anyway, I currently have 8 separately routed rows each with their own matrixcntl objects. I want to recall press/led states for a few of the rows. I'll use row 7 for example.

    Currently, I'm taking the BANG from SERIALOSC's sosc-focus and triggering messages and sending them along to the matrixcntl object.

    Row 7

    (Button Presses defaulted to on)
    [0 6 1 1 6 1 2 6 1 3 6 1 4 6 1 5 6 1 6 6 1 7 6 1 8 6 1 9 6 1 10 6 1 11 6 1 12 6 1 13 6 1 14 6 1 15 6 1] to [matrixcntl]

    (LEDs default to on with variable brightness level set)
    [/monome/grid/led/level/row 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6] to [TO-SERIALOSC]


    Is there a better way to do this with presets?

  • @karaokaze

    Thanks! Will take a look shortly.

    "if all you're doing is triggering those 2 messages, then the way you're doing it is fine,"

    That was actually just row 7 for post brevity so I do in fact, have loads of other states that need to get set.