Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launchpad Pro support (and a bunch of refactoring) #2

Merged
merged 11 commits into from Jan 3, 2020

Conversation

@tildebyte
Copy link
Contributor

@tildebyte tildebyte commented Jan 2, 2020

@miker2049 - PTAL! I started out wanting to support the LP Pro, and ended up doing a lot more :P

I'd suggest reviewing commit-by-commit, as the final diffs are too different to reason about easily.

I'm a Pythonista by trade and by calling, so I have to tell you that learning Lua has been PAINFUL. I tried to avoid making changes just for the sake of making changes, or to look at it another way, I only made changes which I felt would help (me and others) when trying to reason about the data structures and logic herein.

I could only test with my LP Pro - I have no other devices. OTOH e.g. Loom is a pretty complex script, grid-display-wise, and works perfectly, so I feel pretty good about this PR, ie. that it should work OOB for other devices.

Changes which aren't strictly for the LP Pro:

  • it should be easier to add new devices (create config file, add an entry to the supported_devices table in midigrid/midigrid_2pages
  • code paths are in place to work with sysex and CCs
  • midigrid and midigrid_2pages are enough alike now that it should be easy (for someone with more Lua-fu than me) to refactor the whole business into e.g. 'midigrid.lua', 'mg_64', 'mg_128', and yes, even 'mg_256' (I might try this myself, after I take a break :), where 'midigrid.lua' contains common code.
@timm052
Copy link
Collaborator

@timm052 timm052 commented Jan 3, 2020

Thanks for the work esspecially on sysex and you also seem to have solved the button latching issue just had a quick look on my launchpad mk2 and the pro config file actully works with sysex commands with very minor changes to the profile. The only issue i've come across is trying to run a script with the launchpad disconnected casues loading the script to fail with this error which is not ideal if you're not using the norns with the launchpad.

# script load: /home/we/dust/code/awake/awake.lua
# cleanup
# script clear
including /home/we/dust/code/awake/lib/halfsecond.lua
including /home/we/dust/code/midigrid/lib/midigrid.lua
No supported device found
### MISSING INCLUDE: none
### SCRIPT ERROR: load fail
/home/we/dust/code/midigrid/lib/midigrid.lua:30: MISSING INCLUDE: none
stack traceback:
	/home/we/norns/lua/core/norns.lua:126: in function </home/we/norns/lua/core/norns.lua:126>
	[C]: in function 'error'
	/home/we/norns/lua/core/startup.lua:45: in function 'include'
	/home/we/dust/code/midigrid/lib/midigrid.lua:30: 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:44: in main chunk
	[C]: in function 'dofile'
	/home/we/norns/lua/core/script.lua:149: in function </home/we/norns/lua/core/script.lua:149>
	[C]: in function 'xpcall'
	/home/we/norns/lua/core/norns.lua:127: in field 'try'
	/home/we/norns/lua/core/script.lua:149: in function 'core/script.load'
	/home/we/norns/lua/core/menu/preview.lua:21: in function 'core/menu/preview.key'
	/home/we/norns/lua/core/menu.lua:139: in function </home/we/norns/lua/core/menu.lua:116>
# script clear
@miker2049 miker2049 merged commit 05dac5b into miker2049:master Jan 3, 2020
@tildebyte tildebyte deleted the tildebyte:lp-pro branch Jan 3, 2020
@tildebyte
Copy link
Contributor Author

@tildebyte tildebyte commented Jan 3, 2020

Thanks for the work esspecially on sysex and you also seem to have solved the button latching issue just had a quick look on my launchpad mk2 and the pro config file actully works with sysex commands with very minor changes to the profile.

Awesome!

The only issue i've come across is trying to run a script with the launchpad disconnected casues loading the script to fail with this error which is not ideal if you're not using the norns with the launchpad.

I never even thought to try it without an LP plugged in; I was too busy trying to get it to work :P

I'll definitely take a look at trapping this so it's possible to modify a script to use a launchpad, but is not necessary for it to work (i.e. same behavior as a monome grid)

robmckinnon pushed a commit to robmckinnon/midigrid that referenced this pull request Feb 6, 2021
Vgrid wip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants