Midigrid: use launchpads & midi grid controllers with Norns

Could be, I also have a mix of hardware revisions (mini mk1 + mini mk2) so I may not be testing under “ideal” conditions either.

Nice try but I just tried it and unfortunately it made no difference.

1 Like

Getting hooked on the idea of buying a Norns Shield BUT money’s too tight to mention so… I was wondering how the Lunchpad may be the easiest of the available Connectable Grid as seen in many videos on the tube, does it need a special hack? how difficult it is to make it work with Norns?

You’re looking for Midigrid.

1 Like

Thanks, will look forward to that solution

1 Like

Trying to make the excellent orgn script (orgn) working with MIdigrid without success… received a reply from the dev about using -nest for grid implementation. Does anyone have the knowledge to make it compatible with midigrid? Thanks!!

hi, here are some code changes to test. I’ll share instructions in the orgn thread once you can confirm it’s working

first, on 187-189 (for the 64 button template, skip this if you want to use two midigrids)

local g64 = function()
-     return g and g.device and g.device.cols < 16 or false
+     return true
 end

then on 185

- local g = grid.connect()
+ local grid = util.file_exists(_path.code.."midigrid") and include "midigrid/lib/mg_128" or grid
+ local g = grid.connect()

errrr I’ve edited this a few times because the docs on the norns.communuty page are confusing me - you’re supposed to call .connect() on the object returned from midigrid.lua right ?

3 Likes

thanks Andrew!
Tried your instructions and works!! but only with the change in the “return true” line, for 64 button (single Launchpad)… without that I get a init error.
So I changed that line to “return false” and now works with my dual lauchpad minis emulating the grid 128! :heart_eyes:

Thanks!!

3 Likes

What a wonderful thing to read in the morning.
I got a bit confused with the 64 grid only working on Orgn for me last night too but changing the line to “return false” has fixed it up a treat. Great stuff.

So yep can confirm this works here for me too. 64 grid was nice but now I’m looking forward to embarking on an Orgn journey with a full set.

Thanks for this @andrew and @Klinik

2 Likes

If the logic here can encompass midigrid existing then it could be wrapped into the script because the second edit falls back gracefully if there is no midigrid.

Thanks for your work to make this accessible to us. Looking forward to playing with your script.

ah that’s true - though it doesn’t sound like there’s a way to detect 128 vs. 64 grid sizing like I can with monome grids ? (& from what it sounds like device.cols is always either absent or returning 8). so people would have to edit code anyway to ensure they’re getting the right sizing ?

1 Like

The 128 midigrid code handles only having 1 launchpad, two of the outside buttons allow you to switch between the left and right sides the grid.

So you don’t need to adjust the UI.

But having said that midigrid folks are also fine editing code.

i already have a separate version of the ui made for 64 grids though - is there a way to check whether someone has one or two midi grids plugged in ?

like you said through its not a huge deal if people have to edit code

I just got my Norns today and I am trying to follow various directions for getting my Launchpad Pro MK3 working with the device for more than just MIDI. I have read the following:

The code I inserted into Awake is:

local grid = include("midigrid/lib/midigrid")
local grid = util.file_exists(_path.code.."midigrid") and include "midigrid/lib/mg_128" or grid
g = grid.connect()

The code I inserted into MIDIGrid is:

    { midi_base_name= 'Launchpad Pro MK3 1',    device_type='launchpad_rgb' }

I am getting this error when I try to load Awake:

# script clear
# script load: /home/we/dust/code/awake/awake.lua
including /home/we/dust/code/awake/lib/halfsecond.lua
including /home/we/dust/code/midigrid/lib/midigrid.lua
including /home/we/dust/code/midigrid/lib/vgrid.lua
including /home/we/dust/code/midigrid/lib/supported_devices.lua
### SCRIPT ERROR: load fail
/home/we/dust/code/midigrid/lib/supported_devices.lua:37: '}' expected (to close '{' at line 2) near '{'
stack traceback:
	/home/we/norns/lua/core/norns.lua:145: in function </home/we/norns/lua/core/norns.lua:145>
	[C]: in function 'dofile'
	/home/we/norns/lua/core/startup.lua:42: in function 'include'
	/home/we/dust/code/midigrid/lib/midigrid.lua:15: in main chunk
	[C]: in function 'dofile'
	/home/we/norns/lua/core/startup.lua:42: in function 'include'
	/home/we/dust/code/awake/awake.lua:42: in main chunk
	[C]: in function 'dofile'
	/home/we/norns/lua/core/script.lua:192: in function </home/we/norns/lua/core/script.lua:192>
	[C]: in function 'xpcall'
	/home/we/norns/lua/core/norns.lua:146: in field 'try'
	/home/we/norns/lua/core/script.lua:192: in function 'core/script.load'
	/home/we/norns/lua/core/menu/preview.lua:23: in function 'core/menu/preview.key'
	/home/we/norns/lua/core/menu.lua:140: in function </home/we/norns/lua/core/menu.lua:117>
# script clear
lua: 
/home/we/norns/lua/core/clock.lua:59: bad argument #1 to 'resume' (thread expected)
stack traceback:
	[C]: in function 'coroutine.resume'
	/home/we/norns/lua/core/clock.lua:59: in function 'core/clock.resume'

I also tried to follow the directions in the guides above to get the LP working with Arcologies, but that doesn’t seem to work, either.

EDIT: I have tried the local grid = include("midigrid/lib/midigrid") code with some other scripts and it’s failing to load them, as well.

Thanks!

I can’t speak to the midigrid edit but you don’t need this line:

local grid = include("midigrid/lib/midigrid")

The line after that one basically does the same job but also works if midigrid isn’t installed.

2 Likes

If that’s the case, then something else isn’t working right. Besides normal MIDI note control, the LP isn’t reflecting anything like what I’ve seen other people doing with it. I’m definitely missing something.

It’s also now effecting other scripts, it seems. I was able to load PITFALLS earlier, but now I’m getting a similar load fail error as the AWAKE one.

You have a syntax error in your edit to supported_devices.lua I can’t say exactly what from your post, but maybe a missing comma after the device you added unless it’s the last device?

2 Likes

THAT WORKED!!! I reinstalled MIDIGrid so I could start with a fresh file and just added the “1” to the midi_base_name line. I had originally pasted the line in and it had a comma even though it was at the end. Perhaps that was the issue. Thank you all!

2 Likes

Has anyone got Less Concepts 3 working with Midigrid? I put the midigrid code on line 627. Key presses work but there’s no lights.

I’ve removed both my Launchpad mk2 Minis from Devices>MIDI by setting them to ‘none’ but they pop up again sometimes. Sometimes the screen itself doesn’t update but the buttons, knobs and grid keys are working. grid_redraw() sometimes works manually in repl and I get lights for the current state. I get the following clock error in Maiden -

/home/we/norns/lua/core/clock.lua:65: /home/we/dust/code/midigrid/lib/vgrid.lua:147: attempt to index a nil value (field '?')
stack traceback:
[C]: in function 'error'
/home/we/norns/lua/core/clock.lua:65: in function 'core/clock.resume'

Any suggestions? I’m just poking around semi-randomly in the code and not really getting anywhere…

edit - LP mk2 not 3

Hello everyone,
first of all thank you for this great tool! I am new to the game and I got now a launchpad mini mk3 for christmas. I was just wondering if you need the same model if you want to create a full grid (128 by 64). Thanks a lot. I hope this was not answered along the way and I just missed it.