Grid Capture

Grid Capture

Screenshot/Recording tool for grid and norns.

image

Requirements

  • norns
  • grid (any size should work, only tested on 128)
  • Imagemagick installed on norns

Example

local g = grid.connect()
local gcap = require 'GridCapture/GridCapture'

function init()
  g:all(0)
  g:refresh()
  gcap:set_grid(g)
end

function g.key(x,y,z)
  g:led(x,y,15)
  g:refresh()
end

function key(n,z)
  if n == 2 then
    gcap:record(24, 5, 'home/we/image.gif')
  elseif n == 3 then
    gcap:screenshot('home/we/screenshot.png')
  end
end

Github Link

Themes

(p.s. please share any themes you make!)

22 Likes

This looks great! My only thought is the yellow is a bit hard to read, something with a little more weight to it might help legibility. Maybe #fff03e or #fff139 if you’re going with yellow?

4 Likes

What does it screenshot?

1 Like

A grid :slight_smile: It can take stills of your grid state, like a screenshot, and even record gif’s!

1 Like

nice!

+1 on the yellow - kind of hard to read on my laptop screen

1 Like

Yes, it’s hard to replicate the glow of the real thing. I think I’ll go with a more visible yellow as a default. Maybe I could make the colors settable.

GridCaptyure:set_colors(args)

Then I could have a table of themes, that could be unpacked for the args.

3 Likes

Here’s a color combo I’m using for some of my docs.

6 Likes

first theme,

“bw”

screenshot
image
bw

3 Likes

this is super rad.

i should get imagemagik into the base norns install

5 Likes

Also, does anyone know how to cancel os.execute() while it’s in progress? I’d like to effectively Ctrl+C it when I mess up a recording.

Oh yeah, this is gorgeous. Amazing work.

Should be possible to use io.popen instead of os.execute, and close() the handle to kill the process.

> handle = io.popen('yes')
<ok>
> handle:read('*line')
y
> handle:read('*line')
y
> ret = {handle:close()}
yes: standard output
: Broken pipe
<ok>
> ret[1]
nil
> ret[2]
exit
> ret[3]
1  -- process exit code, I think?

opposite of cancel but thought you’d be interested;

i made a threaded os command queue, where you can assign a callback per command so it will be non-blocking:

2 Likes