These are chat archives for brunchboy/afterglow

12th
Feb 2016
Benjamin Gudehus
@hastebrot
Feb 12 2016 00:03
Do I understand correctly, I should have a list of selectable cues when I run auto-bind *show*?
James Elliott
@brunchboy
Feb 12 2016 00:09
Sorry! I am running between events and misinformed you. Call (make-cues) to create them. I almost always call use-push which does that for me.
Home soon with better connectivity.
James Elliott
@brunchboy
Feb 12 2016 00:40
The function make-cues in the examples namespace creates a bunch of example cues in the sample show. They should show up on your Launchpad, and verify that the cue coloring and control features are working. You can see the corresponding cues in the web UI if you call (core/start-web-server 16000 true) and click on the Sample Show link, and you should be able to tie the web interface to your Launchpad so they scroll each other using the Linked controller menu which appears below the web cue grid when your Mk2 binding is active.
The cues and the sample show themselves won’t be much use to you beyond examples and early testing; when you want to start working with your actual lights, we’ll need to work on creating fixture definitions for them, put them into your own show that works with an OLA universe you set up, and create cues that work with those. At that point, you will probably want to create your own Leiningen project which uses Afterglow as a dependency, rather than working in the checkout of Afterglow itself. This is described in the Getting Started section of the online documentation. But for testing whether the Mk2 mapping works, the Afterglow checkout, sample show, and make-cues are great.
Benjamin Gudehus
@hastebrot
Feb 12 2016 00:44
So there is a lot wrong with the led positions.
James Elliott
@brunchboy
Feb 12 2016 00:44
That will be easy to fix, can you describe what is wrong?
(And you are up late again! :grin: )
Benjamin Gudehus
@hastebrot
Feb 12 2016 00:50
Using 1:1 as top-left and 8:8 as bottom right. Row 3 is empty, but 3:8 is cyan.
James Elliott
@brunchboy
Feb 12 2016 00:55
Hmm, none of the rows should be empty, unless it has scrolled. Do you have the web page up to compare? For reference, in Afterglow, [0,0] is at the bottom left, and cues go up and to the right.
Are there any errors in logs/afterglow.log?
(Not sure if you can also access it without Google account)
This is better (was missing the function buttons): https://drive.google.com/file/d/0B3BCleLtO5vHeVhlMDctb19iTDQ/view?usp=sharing
James Elliott
@brunchboy
Feb 12 2016 01:01
I do have a Google account, but don’t know if that was necessary. Anyway, thanks, that is very helpful. And strange.
Those colors are definitely wrong. Let me take another look at the programmer reference.
Do the arrows work to scroll you around?
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:02
Yes, I can scroll one page up and right.
James Elliott
@brunchboy
Feb 12 2016 01:02
And given that your function buttons actually have dedicated labels, I probably want to move some of my mappings to the right side.
Cool, so that is working at least.
None of the colors are right.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:05
All buttons in row 8 flicker. Which is wrong. Rows 2 and 7 are right with flickering.
James Elliott
@brunchboy
Feb 12 2016 01:06
All of them? Or just the first six? Those are supposed to strobe twice per beat, like the web UI does, to reflect the fact that they are strobes.
Oh!
Found one problem, the SysEx starts differently. Pushing a fix momentarily.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:09

Are there any errors in logs/afterglow.log?

I'll delete all old logs and restart the show.

James Elliott
@brunchboy
Feb 12 2016 01:09
No need to restart.
Deleting the log is enough, it will be recreated if something happens.
Oh, if you start the show (by pressing Start in the web UI or the Stop button on the controller) and don’t have a Universe 1 configured in OLA (and olad running), there will be a ton of errors about that.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:10
The first six in row 2 flickr (similar to the webpage).
James Elliott
@brunchboy
Feb 12 2016 01:11
Rats, I was wrong about what I thought was an error, I was just looking at the wrong line in the manual. The SysEx seems to be what the manual says it should be.
(This is line 88 in launchpad_mk2.clj and the middle of Page 12 in the Programmer Reference.)
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:14

Pressing "Start" in the web UI results in showing this error:

Unable to write UpdateDmxData message to OLA: Cannot connect, is it running?

I've installed OLA, but I think it doesn't run.
James Elliott
@brunchboy
Feb 12 2016 01:15
You may be right. We can troubleshoot that another time.
I am mystified about what is going on here, I may need to take Novation up on their offer of loaning me an Mk2, but that would take a long time to arrive.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:19
James Elliott
@brunchboy
Feb 12 2016 01:19
You could try sending various colors: I realized that what I said earlier about the pads being updated 15 times per second won’t cause us problems if we use a pad that has a static color, because Afterglow only sends changed colors on each grid update.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:20
set-pad-color throws a NPE.
James Elliott
@brunchboy
Feb 12 2016 01:21
I’m working on the exact syntax for you to try.
(mk2/set-pad-color @( :controller mk2-watcher) 0 0 (create-color "white"))
The :controller key holds an atom, so you need to dereference it using @ or (deref ...).
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:26
Ahh, thanks. So, origin [0,0] is at the bottom-left.
James Elliott
@brunchboy
Feb 12 2016 01:26
Correct. What did that color end up looking like?
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:26
And maroon is cyan.
is defined maroon as [128, 0, 0] in RGB
And red is green.
James Elliott
@brunchboy
Feb 12 2016 01:29

If you have a MIDI monitoring tool, it might be nice to call

(def c @(:controller mk2-watcher))
(mk2/deactivate mk2-watcher)

That will stop afterglow sending stuff, then you can call (mk2/set-pad-color c 0 0 (create-color "white")) and see exactly what bytes are being sent to the controller, and if they match what the reference manual says they should.

Benjamin Gudehus
@hastebrot
Feb 12 2016 01:34
KMidimon can monitor a MIDI data stream, in order to diagnose a malfunctioning piece of equipment or to examine the contents of a MIDI sequence during playback.
James Elliott
@brunchboy
Feb 12 2016 01:34
Excellent.
Deactivating the binding will stop the tempo flashes, rainbow cues, and other such messages that would drown out what we are looking for.
I wonder if I can find anyone with an Mk2 to borrow locally?
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:37
I deactivated the sample show in order to check every button one-by-one.
James Elliott
@brunchboy
Feb 12 2016 01:38
I am not sure what you meant by deactivating the show. You can start or stop the OLA update thread, but other than that, once a show is created it exists. Or did you restart the REPL without creating the sample cues?
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:38
Yes. Uncommented the make-cues.
This is strange in second column every position is right
James Elliott
@brunchboy
Feb 12 2016 01:41
Are the colors coming out correct?
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:42
No again maroon is cyan and red is (dark) green.
James Elliott
@brunchboy
Feb 12 2016 01:43
Have you been able to see the SysEx bytes?
Wait!
There is clearly an error in the manual. For the hex version of the command they have the value 0b, and for decimal they have 11.
Sorry, for decimal they have 10.
0b is 11.
Let’s try sending 11 rather than 10 and see if it works.
Would you like to edit the file or have me push the change?
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:45
I could edit it if you show me the line number :)
James Elliott
@brunchboy
Feb 12 2016 01:46
Line 88 of launchpad_mk2.clj.
Change 24 10 led to 24 11 led.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:46
Done. And now I have to reload my file into the REPL?
James Elliott
@brunchboy
Feb 12 2016 01:47
Just that function
(the whole file should be harmless, but if you can find the key for just the function, that is safest)
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:49
Hmm, so I just call mk/set-pad-color and it will automatically use the changed source code?
James Elliott
@brunchboy
Feb 12 2016 01:49
Correct.
REPL-based development is awesome like that.
(If you have reloaded that function.)
There must be a command in Cursive for that.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:53
Sync files in REPL (Ctrl-Shift-M)
Whoa!
Now it is correct.
James Elliott
@brunchboy
Feb 12 2016 01:55
Syncing all the files is way overkill, I still am trying to find how you could have just evaluated that one form, but EXCELLENT.
I will let the person at Novation I am working with about this error in the manual!
How strange that it was doing anything at all with the wrong SysEx prefix.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:56
Loading src/afterglow/controllers/launchpad_mk2.clj... done
Cursive intelligently knows which files were changed.
James Elliott
@brunchboy
Feb 12 2016 01:57
The reason I want to do just the function, not the whole file, is that sometimes protocols get redefined, which causes incompatibilities with things that were created before reloading the file.
In this case that did not happen, but in other parts of Afterglow, it does cause issues.
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:57
Ahh, ok.
James Elliott
@brunchboy
Feb 12 2016 01:57
(It won’t be an issue when you are in your own project.)
Benjamin Gudehus
@hastebrot
Feb 12 2016 01:59
Sample cues are also correct.
James Elliott
@brunchboy
Feb 12 2016 02:00
That’s great.
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:09
(mk2/deactivate mk2-watcher)
CompilerException clojure.lang.ExceptionInfo: Invariant violation in `afterglow.controllers.launchpad-mk2:564` [pred-form, val]:
 [(#{:launchpad-mk2 :launchpad-mk2-watcher} (type controller)), :launchpad-pro] {:*?data* nil, :elidable? true, :dt #inst "2016-02-12T02:08:55.758-00:00", :val :launchpad-pro, :ns-str "afterglow.controllers.launchpad-mk2", :val-type clojure.lang.Keyword, :?err nil, :*assert* true, :?data nil, :?line 564, :form-str "(#{:launchpad-mk2 :launchpad-mk2-watcher} (type controller))"}, compiling:(/home/benjamin/Sources/clojure/afterglow/test/afterglow/afterglow_sample.clj:16:1)
James Elliott
@brunchboy
Feb 12 2016 02:10
I can’t see anything after the first line.
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:11
Added the rest.
Don't know if this is caused by (def mk2-controller @(:controller mk2-watcher)).
James Elliott
@brunchboy
Feb 12 2016 02:11
I am giving up on fighting Cursive to try to figure out how you can run Tools :arrow_forward: REPL :arrow_forward: Run sexp before cursor
That is the command I wanted you to be able to use, but I will leave Cursive support to a Cursive user. I would suggest you explore Edit :arrow_forward: Structural Editing and Navigate :arrow_forward: Structural Movement when you have time.
What does (type c) give you?
Oh, I see!
Yes, my mistake.
Line 686 needs to be {:type :launchpad-mk2})]
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:14

Run sexp before cursor

You mean "Send form before caret to REPL"?

James Elliott
@brunchboy
Feb 12 2016 02:14
Ah, sounds good! The page I was looking at was outdated.
So if you had put your cursor after the closing paren of set-pad-color and issued that command, it would have redefined just that function for us.
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:15
Ahh!
James Elliott
@brunchboy
Feb 12 2016 02:16
Do you want to make a pull request with these two fixes, or shall I just do them locally?
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:16
I first thought something like (reload 'afterglow.controllers....set-led-color)..
James Elliott
@brunchboy
Feb 12 2016 02:17
Ah, I don’t think Clojure itself offers any way of reloading just part of a file like that. But Cursive and CIDER do.
I’m afraid the easiest way to recover from the fact that I gave your controller the wrong type tag is to shut down and reload the REPL after that line is fixed.
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:18
I'll make a PR :)
James Elliott
@brunchboy
Feb 12 2016 02:18
Great!
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:19
Do you have a contributors guideline? Or I'll just put these changes into two commits in a new branch and create the PR.
James Elliott
@brunchboy
Feb 12 2016 02:21
Yeah, this is simple and clear. That sounds like a good approach.
I do not yet have contributor guidelines, but we both know what these are about. In the commit messages say something like “correct error in reference manual” for the first, and “correct copy paste error” for the second.
I have a house full of people practicing LED glove performances, and the pizza has just arrived. An interesting Thursday. :grinning:
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:25
Bon appetit!
Benjamin Gudehus
@hastebrot
Feb 12 2016 02:38
So PR was send. Have fun and thanks for help. I learnt a lot.
James Elliott
@brunchboy
Feb 12 2016 02:39
I just merged it! Thank you for helping figure this out. I’ll be happy to continue to help as you explore other areas of Afterglow. I am also happy to see how well it seems to work in Linux.
I will look at photos of the Mk2 and think about where to move the non-arrow round buttons. If you have any thoughts, please let me know. The are the tap-tempo, shift, stop (starts and stops sending DMX for the show) and user-mode buttons (suspends the mapping to let you switch between it and Ableton Live).