rakyll / launchpad

Talk to your Novation Launchpad in Go
131 stars 12 forks source link

1-8 Keys Not Lighting Up #3

Closed ghost closed 10 years ago

ghost commented 10 years ago

I have been playing with the step sequencer example code. I increased the grid so I can try to utilize the 1-9 and A-H controls.

I want to control the 1-9 keys along the top, so I can use them to control tick speed and pages. I can use A-H without trouble.

I have not been able to use the pad.Light(0, 8, 4, 0) (and I also tried pad(0, 9, 4, 0)) which should light up 1 but I can do pad.Light(9, 0, 4, 0) which is H.

rakyll commented 10 years ago

The package currently only supports the 64-button grid. I'll add support for the control buttons soon.

ghost commented 10 years ago

Great, thanks. My plan is to first improve the stepseq example then I will try making other examples.

ghost commented 10 years ago

I will try adding this feature to the library. I mostly get how to do it but I have some confusion over the hit function. If I get something working Ill submit a pull request.

x = evt.Status % 8                   # why is this modulo 8?
y = 7 - ((evt.Status - x) / 16)    # why is this divided by 16 then -7 and how is x involved?
rakyll commented 10 years ago

I ported them from an existing library in python without much questioning. Novation has a programmer's guide on http://www.novationmusic.com/download/668/ Maybe we should use it as a reference. If you're not actively working on this, I can take a look at this weekend.

ghost commented 10 years ago

I'm working on it when I have time, thanks for linking to the guide. If you could do it this weekend that would be great but if not I will keep trying.

ghost commented 10 years ago

Maybe I'm just not understanding it, but does that guide explain how to use the top row of control keys?

I only see it explaining how it addresses the right row of control keys.

rakyll commented 10 years ago

It doesn't explain but I reverse engineered. I also found a crucial bug on the portmidi package, changes are about to be pushed soon.

rakyll commented 10 years ago

d469570b9ef2997535767564128aa19bbc890f36 fixes this issue, check out [1] for the new coordinate system.

[1] https://github.com/rakyll/launchpad#light-buttons

ghost commented 10 years ago

You are my hero, I can't wait to make awesome instruments using this library. Thank you so much.