G.all(0) makes grid 64 40h flicker on norns shield

I got myself a norns shield and after a week I realised I really wanted to use a grid with it. There are no varibright grids available anywhere but I found a used grid 64 40h. It looks as if the case was 3D printed but I assume it was proper. I have tried it out with some different norns scripts after altering the code slightly but I always run into the same problem. When the script calls g.all(0) for the grid all the light flickers and is not properly redrawn. If I comment out all(0) everything works except lights are obviously not turned off properly.

I tried looking through the norns recipes and I searched the forum but I can’t find an explanation of why I am seeing this behaviour. I also tried slowing down the redraws but oddly that does not make any difference, which I was a bit surprised of.

Hopefully I haven’t overlooked something obvious. Thanks for your help!

hey hey! blast from the past :rocket:

after a quick conference, this is likely a libmonome issue. i’ve also worked on troubleshooting this a bit with another user who has an arduinome – you’re correct that the g:all(0) function doesn’t seem to perform as expected on these specific devices. but you can set state for each LED individually (see loom for a working example).

just wanted to confirm so you knew you weren’t overlooking something + we’ll follow back up with additional info after some digging :slight_smile:

this could also be a firmware issue. can you post a photo of the device? does it work with macos/etc?

Awesome! Thanks. I was scratching my head pretty thoroughly on this one :slight_smile:

@tehn: of course! Thanks for the excellent support

indeed it looks like a 40h-something. if you could get a photo of the circuitry we can discern if it’s an original 40h kit or a newer mk.

also let us know if you can get it working as expected with max/msp (etc) on a normal computer— that’ll help debug substantially.

I can’t take it apart right now (kids are approaching home and I need to cook) but I can run the examples from Grid Studies: Max - docs. I don’t seem to have lights on in the last patch (maybe I just haven’t studied it enough) but the first couple of patches deliver a nice steady light.

I can provide some info because I printed the case for this Grid. It is a Monome 40h DIY kit. It works on Win10 Ableton (e.g., Max for Live). In order to run it with the Norns Shield, the Lua scripts need to be “updated”. Unfortunately, I can not remember exactly how. I think in some scripts adding a further grid:refresh() to the gridredraw() function helped (which is a bit weird). Give this a try using the Awake script.

1 Like

I added another g:refresh() right after the g:all(0) and that worked! I wonder if the firmware is getting the order of the clear and the individual draw commands mixed up?

1 Like

Unfortunately, I can not say more about it. It seems to be a communication issue between the two devices. The help with the grid:refresh() works for some scripts (e.g. Foulplay), unfortunately not for all.

I finally managed to take the grid apart. Here is the board:

I hope that helps :blush:

1 Like

under the hood, norns only uses a single grid command: /grid/led/level/map.

this command is only sent from the grid.refresh() lua function. it is sent once per dirty quad (8x8 led grid region) with x,y offsets set to the “local zero” for each quad.

all other lua grid API functions simply update the buffered LED state and set dirty flags for each quad.

so one thing that happens is that norns assumes all grids have 4 quads. that means after g.all(), there will always be 4 led/map commands sent on the next g.refresh(). i guess this is technically a bug, but it doesn’t have any ill effects for newer grids. my guess is that the older HW/FW doesn’t handle the extraneous quads gracefully (or simply can’t keep up with the bandwidth.)

so here is a ticket to teach the norns grid middleware to respect device size. i will also check the driver code next time i am looking in libmonome.

in the meantime, a good question would be: what happens if you send, from max, four consecutive messages like:

/monome/grid/led/level/map 0  0  [0 ... x64]
/monome/grid/led/level/map 0  64 [0 ... x64]
/monome/grid/led/level/map 64 0  [0 ... x64]
/monome/grid/led/level/map 64 64 [0 ... x64]

(apologies, i’m not sure of the real max syntax for the char lists in level/map.)

1 Like