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 http://monome.org/docs/tech:osc 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


    ----------begin_max5_patcher----------
    1469.3oc0asrbiZEDcs7WAEqkstuAxtrKYSxGPpToPRL1LQ.p.ji8L07uGna
    vCRhGWj3hjKUVPiPh9bneewe+gE1qSdKHy15Wr9KqEK99CKV.Gp7.KpjWXG4
    +1lc9YvoYGG7eIq+p8R7ixCdKGNbZxg7.KJy0hIU0eZ7gnhCuKHG9p7pihGJ
    +88A3001dY0eV+c0or2OeyKgwO+OoAaxwyhK7dhrzhxkkabg2YjmHe7cB2BJ
    Rgx8HuVA9RRbdreDbgr+0zP+cM+jrvuAeBkU7i8gFGF+gBWdre7vCkusbJnm
    nj3jBkoU1g0K6nAy34BDiaeDCcZHF1DRLVQqS7S29XVR1lGAXWcJaR1kjhHj
    7DSR7bWVriSwVhnbuBQZCTdLaR6jM0fIknkFA230NUJZmK+sfcuFjGtw25OB
    NDzJoRamTIW.otIIJJHN+LVMKHuzOzxOyx25eCdGn31s6HcSGBVopZw8fMTI
    oWSKWMrsRedMbM+fAzwZiNwDiRbs7hBh9HUDc3EmOK7RYv6qjX3PzGEwQGhQ
    cOQLcDdJ2ZM9pctPzUXl09wOWF3t0s8EBhgAeXdhpHQxdXP1zDN+R3q0GxyS
    hsGWv2AQOkCnmKU0VN8fdp8TAlnfrL+mCN6t+JL2zpmSC2tZWv1UQ96sbKdQ
    coVdDKpC87csmvDRLlnz.Px3.sPw.wtsSHd2tj6ih.IkDXaLW8tFfAEXNLN0
    oOFz8SBC5Vvgjt4PSve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wG5SADIAjLB9z.di8NDpxxpLnU
    8DXpLnvzhMPU.38B7I9uHA74RLA+nJD3FDeC6EMx4f4z7I0uJ+pjXPDb8s0e
    5cHVy7m0dTfnI.gF2D3W3bIvkUwe+9WCRyp9IAEwNx+q3+JTpkfXXLJBKPjc
    Zvqg0mObMr8S27RX4S2ygTbkrdyUY+P404GO7+DYiNFF
    -----------end_max5_patcher-----------

  • 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.