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

undefined method `change' for #<SurfaceMaster::Launchpad::Device:0x0055d7fd1e6178> (NoMethodError) #1

Open
movitto opened this issue Jan 21, 2018 · 2 comments

Comments

@movitto
Copy link

movitto commented Jan 21, 2018

Hey there! I just gave your surface_master project a quick whirl but was unable to get the 'launchpad_playground' example working. I didn't spend an extensive amount of time on it but figure I'd shout out here.

The first issue was similar to thomasjachmann#7 in that the library isn't correctly detecting the launchpad mini. By changing the following line, it can be made compatible but obviously removes support for the MK2:

diff --git a/lib/surface_master/launchpad/device.rb b/lib/surface_master/launchpad/device.rb
index 31ad4c9..3136e3d 100644
--- a/lib/surface_master/launchpad/device.rb
+++ b/lib/surface_master/launchpad/device.rb
@@ -5,7 +5,7 @@ module SurfaceMaster
       include MIDICodes
 
       def initialize(opts = nil)
-        @name = "Launchpad MK2"
+        @name = "Launchpad Mini MIDI 1"
         super(opts)
         reset! if output_enabled?
         raw         = (0..8)

The next error seemed to be more involved:

$ ruby -Ilib ./examples/launchpad_playground.rb 
D, [2018-01-21T09:14:44.335627 #17876] DEBUG -- : Initializing SurfaceMaster::Launchpad::Interaction#47420070064800 with {}
D, [2018-01-21T09:14:44.335871 #17876] DEBUG -- : writing messages to launchpad:
  {:message=>[176, 0, 0], :timestamp=>0}
D, [2018-01-21T09:14:44.336430 #17876] DEBUG -- : Setting response to :grid for state :both with nil
D, [2018-01-21T09:14:44.336508 #17876] DEBUG -- : Setting response to :scene1 for state :down with nil
D, [2018-01-21T09:14:44.336548 #17876] DEBUG -- : Setting response to :scene2 for state :down with nil
D, [2018-01-21T09:14:44.336602 #17876] DEBUG -- : Setting response to :scene3 for state :down with nil
D, [2018-01-21T09:14:44.336655 #17876] DEBUG -- : Setting response to :scene4 for state :down with nil
D, [2018-01-21T09:14:44.336689 #17876] DEBUG -- : Setting response to :mixer for state :down with nil
/home/mmorsi/workspace/lp/surface_master/lib/surface_master/interaction.rb:22:in `change': undefined method `change' for #<SurfaceMaster::Launchpad::Device:0x005641b0dcd320> (NoMethodError)
Did you mean?  changes
	from ./examples/launchpad_playground.rb:177:in `<main>'

I notice that this 'change' method is not defined in either of the launchpad or touch_osc device classes. This is where is stopped debugging.

Hope this helps!

@MrJoy
Copy link
Owner

MrJoy commented Jan 24, 2018

This was all code written in a sleep-deprived, fevered state (wedding prep). I suspect I got caught up mid-way through refactoring / redesigning things and never came back to it. As such the examples are probably pretty grossly out of date. You might try poking around in the git history to find a stable point to branch off from.

@MrJoy
Copy link
Owner

MrJoy commented Jan 24, 2018

This commit is probably the root of your issue. So you could either update the launchpad playground to the new interface implied by this, or cut a branch of this commit's parent and go from there:

7a5d7f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants