Why is Live's Session View Immune to the Java Robot Class??????!!!
This is a first post, mostly out of desperation. I started out, like a lot of folks here, trying to find a way to emulate keystrokes via MIDI on the Windows platform. Why this function still doesn’t exist since people have been begging for it for many, many, many years is a topic for a different thread. I know all about Bome’s, Autohotkey, Autobot, ring_keyPress. I also know that the two mxj solutions WILL NOT WORK with the Delete key, the cursor keys, etc, in Session View. I originally thought this might be a Max for Live issue, so I started experimenting. I threw together a quick max patch (outside of Live) that uses a metro to bang a keypress 40 (Cursor Down) to autobot every 500ms. I opened Excel, Notepad, every program I can find, and these programs see and respond to the Max patch pumping out cursor keystrokes. Live does nothing in Session View.
Now thinking it might be a Max-only issue, I downloaded Eclipse & the JDK, and learned enough Java to throw together a quick app to run Robot in a loop, spitting out Cursor Downs every 500ms. All the other programs hear and obey. Again, Live does not.
Here’s the fun part: I can throw together a script in Autohotkey that does the exact same thing, and Live recognizes the emulated Cursor Down keystrokes, navigating downward through the scenes…
What the heck is the issue w/ Live & Java? I have found threads as far back as 2005 (google "ableton java robot class", without quotes), and NOBODY has ever answered this, more disappointingly, no one from either Ableton or Cycling74 has ever commented on it that I have been able to find.
Look, I’m not a programmer, just a hack who will learn as much as I need to of whatever I need to in order to realize my writing/performing visions. I’m afraid of the extra layers of potential vulnerability by using Bome’s or Autohotkey to do something as critical as a cursor navigation or delete in live performance. I’m a guitarist, planning on using this for live looping without needing my eyes glued to the monitor, and I need to do this stuff with my feet. Max I would trust, if I can just find some way to emulate the missing MIDI to keystroke functionality in Live.
Sorry for the rant, I’ve just been spinning my tires for days on this, and I’m a bit frustrated, mostly with myself for not coming up with any solution…
Thanks for reading.
OK, so it looks like I can partially answer my own question, for the benefit of anyone who stumbles on this with the same problem. It appears there’s a bug in the actual Java Robot Class which causes it to send cursor control keys, del, insert, etc., as if they were being typed on the numeric keypad. I tested it by turning off numlock on a desktop keyboard, and Live does not recognize the keypad for navigation. Lovely.
I don’t think Bome’s+AHK would be any more fragile in this situation than Max TBH.
Bome’s is near universally used for the purpose, as you gathered . . . and while my experience with AHK (scripting) is quite limited I’m using a couple of what I’m convinced are compiled AHK scripts as background utilities that function and perform as well as a native Win32 app.
Clearly you’ll want to torture-test any such setup before walking out on stage – but you’d do that anyway.
Sorry for the delayed response. I can’t find a way to turn on email notification for subscribed threads…
I’m a big believer in AHK, and I’ve used it successfully. It has an incredibly rich script language for what it is. I prefer it to Bome’s because it has the critical ability to call focus to a specified windows/app, last time I checked, Bome’s didn’t. Between AHK & Bidule, nearly anything that can be imagined can somehow be hacked together re: MIDI & remote control. The problem for PC-based Max users is that I don’t think we have anything similar to Leigh Hunts’ MIDI_In/MIDI_Out externals. I’m very new to Max/Live, and honestly, being limited to one MIDI port/channel per track is a big step backward from how I usually work. The fact that Live isn’t mulit-timbral per track amazes me. Yeah, I know there are "workarounds", but they shouldn’t be necessary in a product this mature. There are a lot of things I’m using Bidule & AHK to do within Live that I’d rather do w/ Max, but I’m gonna use up a lot of tracks/virtual ports in the process without the ability to address multiple ports/channels per track from within the Max environment.
But back to the original issue, I’ve got a passable workaround. I’ll post it for the benefit of anyone who winds up here searching for a way to send keystrokes to Live, particularly cursor & delete keys in Session View. It ain’t pretty, but it does work.
Basically, we can use Autohotkey to remap the rogue simulated numeric keypad variants of the cursor & delete keys generated by Autobot back to the "normal" keystrokes that Live needs. Here’s the AHK script:
If you’re already using AHK, add this to your script, otherwise this is all you need. Assuming you’ve already installed the Autobot.class in Max’s javaclasses folder, create a new session in Live, create the device below & drag it into a MIDI track. You’ll need to map the buttons in the device to a h/w MIDI controller generating NoteOn/Off to test it properly, since the Live window, of course, needs to retain focus for any simulated keystroke solution to work.
Here’s the demonstration patch (also commented internally):
----------begin_max5_patcher---------- 3194.3oc6cs0baaiE9Y2Y5+Ar5gzjrxJhW0k2baZa7twIYxklcm5cx.IBIwX J.NjfV1am8+9dN.jRjRj1xNxUJMHOPYBBBbt9gC9Lh7e78e2QsFIthk1hLj7 6jiN5OfVNR0F1xQEMbTq4zqFGQSUcrEmsPL5ysZ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klyco4bWZN2kF1KOfXu7Cw0tWRm6I0k5+yc4nW1vZ+Q coKL4OvG6xRVtuw4sbkkvPZogzx8BokPH3etLV51sNbSuGbFK8b69Wlyao+g Dgkd5kqLG2RCgkFBKMDVZHrzPXogvRCgkFBKMG2RywszbbKMDVdfPXI9seYc alr28kwREJo9agt84+Qw8zeiE+PdXKqX59Fmyxx1BCqkFVK2KrVpBB2k7V13 2J6W84hupkqC6z8A+ql87CZokqshRm6H8Z6guNPATj5rTNO3D75q+kmMPsNP OmutORp1GRL7hVVOECulijpggWCCuFFdML7ZX30vvqggWCCulijp4HoZNRpF FdOHX3kEU2lIumeQfZo+6Am9+M8Nc2eD75CUX5oH38A6HoV1x8sN+tqLEF5c Mz6ten2EhA2kr6FS40CMZ089gMd7JxobzUTZ0qRddC+QcpH7e43OZYX6MdDK USjF3yulYaZBMvZEVjkUOeT5Fz0qeea0OA6R21aMrnFgEwgytX3rbGzUMF8c 7.DM7mr0fcUFrDQFOPSYUu07S5NUsX3b+150wT38tkhean1E6pcZy5VZnlkZ Co1dQq21Hat6GYy8vU15e3JZdGth1fsQzb1KhlyAbdf81HaCNb8nV2YrMeMS O8UeKS6me57Keik5aXDe8eNwva1IZyVAF5eWUFOW8WGJ4+IOzdiarT+lP775 VbyNQY72Fko2dIpYqryd6mjssBHn+9Q11pBIrbNfMbqqB2tv45oJWsuClb35 3twMVpe+ttd1E2raTmsJ8w5NGj534rJ+2wweiazfANdt6Tv.qspp.K+8Sny1 Yq2Sq9tcKwse.Rs1p5PsFbHa4tyXo1ddq.Ar0GblJ2nQDr87aDQ.a.93+C3P mpsD -----------end_max5_patcher-----------
I sure hope this saves someone some head-banging
Oh hey man hells yeah!
Live, as brilliant as it is (and it is) – has some bone-jarring design issues. But I mean . . . it’s only 9. How mature were you at that age?
Why Live hasn’t even got hair on its Behles yet!
^ That would make more sense if the man was bald.
I’m an absolute novice when it comes to AHK. The limit of my prowess is a little compiled .exe to remove the titlebar from windows (Windows) so I can run apps pseudo-fullscreen and still keep the menubar visible. Originally this was specifically for Live, but I’ve found it occasionally useful for other apps where pixels are at a premium. Handy for laptop use.
In the spirit of leveraging many small tools, it kinda requires another utility for moving the window sans titlebar (avec mouse / ctrl-key mod) – but it’s all quite slick to operate.
For all I know, the tool I use for the window moving could have an AHK lineage of its own. The .exe compiler feature is fantastic. I’ve pondered the notion of compiled AHK stuff as part of Max standalones or otherwise . . . vague ideas on domain-specific problem-solvers for distribution stuff.
^ Like I said . . . vague.
Thanks a whole bunch for this, very useful indeed! :)
Been trying to create mouse clicks using mxj autobot for a day or so, simply doesn’t work… Aka.mouse doesn’t seem to be 64bit compatible either… Any other ideas?
None other than the theme so far, AHK for Win (and I suppose Automator for OS X?).
I’m curious now to wonder if / how etc.one could or would go about making .mxe externals from compiled (to .exe) AHK scripts? Is this possible . . . feasible . . . am I on crack?
S4racen: PC or Mac? Is your device throwing errors in the Max debug window? Aka.mouse is mac-only, I believe. Can’t help you there (I’m in windows). If you want to post your autobot device here, I’ll try it on a PC.
Johnny: I’m not aware of any way to "package" a windows .exe in an mxj, however, it might be possible to find some type of a java class to act as a wrapper for the exe and then present it to Max through the mxj. But that would probably be pretty tricky. But then again, I know almost nothing about Java/Max at this stage. That hasn’t kept me from having some fun trying to learn it though…
Hi FC . . . I didn’t mean packaging or wrapping the .exe as Java anything (I am not a fan).
I was just speculating (idly) about the possibility of converting or otherwise . . . I don’t know the jargon or procedure > .mxe (the Max equiv of an .exe External?).
I suppose the idea was that AHK is extremely useful for many kinds of interaction outside of Max I currently see people using other methods to access – could it become an almost standard method, can it be incorporated within the patcher structure itself etc.
I’m not addressing these questions at you specifically, rather just throwing them out there for general perusal. Cheers.