MatejGolian / ReaHotkey

An AutoHotkey script for blind musicians and REAPER users
9 stars 2 forks source link

Kontakt 7 overlay isn't working here yet #4

Closed ScottChesworth closed 4 months ago

ScottChesworth commented 8 months ago

I'm running Kontakt 7.7.2.0 here, tried the VST3 plug-in and standalone. Sending keyboard input in REAPER and there shouldn't be any need for admin privs in my case.

In the VST3 ReaHotkey doesn't trigger at all, standalone NVDA freezes when I hit any of the buttons in your overlay.

I'm new to ReaHotkey, any tips on troubleshooting would be much appreciated. I don't know much AHK yet but am keen to help wherever I can, probably docs, demos and the occasional PR if it's easy to tweak at first.

MatejGolian commented 8 months ago

Scott, Launch the included HotspotHelper script, insert a new track in reaper and add the Kontakt 7 VST on to it. Next open the FX chain, F6 into the plugin and directly after that hit Windows+Ctrl+Shift+C. A dialog should pop up. Answer yes. What value does it copy into your clipboard? Regarding the standalone version of Kontakt, the fact that you're getting the buttons means that at least something's working. No idea why it's freezing though. Is that the current dev version? In any case, try version 0.2.1 that can be downloaded under releases on GitHub. Does that freeze as well?

ScottChesworth commented 8 months ago

What value does it copy into your clipboard?

Qt632QWindowIcon{c972b1ce-3ba4-4161-9d7e-2aec8c19a2f1}1 Is that the current dev version?

Same results here with current dev version and the 0.2.1 from releases.

Does that class above help shed any light on anything?

MatejGolian commented 8 months ago

That pattern matches what the script is looking for, so I don't know...

ScottChesworth commented 8 months ago

It's just occurred that the answer might be really simple. Do you support Kontakt 7 Player? That's what I'm running here. Looking at the ReadMe, you didn't specifically say Player so I guess that was an assumption on my part that it would work. If you don't support player yet, I'd be happy to collect coordinates or whatever would be helpful.

Timtam commented 8 months ago

You are right, we don't support Player yet, at least that problem came up with some other guy on the REAPER WhatsApp group recently. We'd appreciate if you could gather some coordinates for us. I guess the coordinates for the 4 buttons (library, view, file and shop) could help for starters, I guess @MatejGolian will let us know if anything else is imporrtant as he did the Kontakt and KK bindings in the first place. Probably some kind of image to detect the Kontakt Player screen that we are in? Anyway, the Hotspot Helper script will proove useful for that, just launch it and check out the info message that pops up right after, that should contain all the info you need to get coordinates for buttons, just create a hotspot and copy them all to keyboard, I believe in plugin you need to hit "yes" for the compensate question, for standalone you don't, but i'm not sure.

MatejGolian commented 8 months ago

That is correct, you only have to hit yes in the plug-in. That being said, I'm not sure whether Kontakt player VS full really is the issue here. In case of the old mouse coordinate version, maybe to a certain extent, but if the menus in the player are at least approximately where they are in the full version, OCR in the dev version should find them., so mouse coordinates should not be necessary at all. But off course, if the player layout is radically different, that's a different situation. Another thing is that currently the development version of the script needs English to be installed as an OCR language in Windows. So that could be one possible cause for error. But in your case Scott, based on that control class you posted, ReaHotkey should still respond when pressing tab or shift+tab in the plug-in. Than if the player has a different layout, the response could be incorrect, but the script should still at least do something. I wish I had the player version here to experiment with, but that is not the case. But regarding Kontakt player standalone, the script does respond to key presses, it just doesn't do the correct thing. Is that correct?

ScottChesworth commented 8 months ago

Made a bit of progress here. Scanning with Win10 OCR (which does have English language installed here btw) some stuff seemed strange about how Kontakt was displaying, so I backed up the content in appdata/local/native instruments/kontakt7 for safety, removed it and relaunched. Now standalone Player seems to work reasonably well with your main branch here. Sometimes it takes me a few tries to get the expected result when I click the File menu, but hey, it works. The plug-in version is not being recognized here yet though. When I instantiate that in REAPER, the script gives me these options in its tab order:

There hasn't been any change in how ReaHotkey reacts to the plug-in version since I deleted the stuff in appdata.

Does that give anyone any ideas?

MatejGolian commented 8 months ago

That's good news, it means that the script is actually working/running in the plug-in as well, but for some reason it can not determine whether you have instantiated Kontakt or Komplete Kontrol. Differentiating between the Kontakt and Komplete Kontrol plug-ins is done based on image search, as there seems to be no other way. Is your screen resolution 1920 x 1080? And are you getting the same error with the Komplete Kontrol plug-in as well? You probably are. But hey, at least we've made some progress...

MatejGolian commented 8 months ago

And just to be sure I understand correctly: You say you're running the current code in the main branch; and not the released version. Right?

MatejGolian commented 8 months ago

And also, you should preferably have the zoom value in Kontakt set to 100%. That option can be found in the Kontakt View menu. So maybe try running OCR on the plug-in and taking a look there.

MatejGolian commented 8 months ago

If the Komplete Kontrol plug-in gets recognized, maybe we just need a new image for the player version of Kontakt we could feed to ImageSearch.

ScottChesworth commented 8 months ago

Is your screen resolution 1920 x 1080?

Yep, 1920 x 1080, landscape orientation.

are you getting the same error with the Komplete Kontrol plug-in as well?

No, the KK plug-in loads the KK overlay and it gives me a Menu button that works.

you're running the current code in the main branch; and not the released version. Right?

Correct.

you should preferably have the zoom value in Kontakt set to 100%. That option can be found in the Kontakt View menu. So maybe try running OCR on the plug-in and taking a look there.

Zoom is already at 100% in standalone here. Confusingly, I'm not finding a View menu using any OCR tricks I know of in the Player plug-in. Will try to get eyes on that tonight.

If the Komplete Kontrol plug-in gets recognized, maybe we just need a new image for the player version of Kontakt we could feed to ImageSearch.

What does the image need to be exactly? I can ask my partner to help get that.

MatejGolian commented 8 months ago

The image can be anything that's constantly there and unique to the Kontakt player plugin. In case of Kontakt full, my sighted assistance said that there's basically nothing in the UI like that apart from the text that says "Kontakt". So maybe there will be some text saying "Kontakt Player" or "Kontakt 7 Player" or something like that there. Just use the Windows Snipping Tool to extract that portion of the screen and save out a PNG file. It's always better to extract the smallest image possible, so you don't have to keep too much blank area surrounding the text. It will most likely just be black anyway. You don't have to do anything else with the image though. Maybe the player version has some other unique visual element, but I'm guessing that it will be the text.

Than if you want to test it, you can either launch HotspotHelper and once you're in the plugin press Win+Ctrl+Shift+S and browse for the image, or you can replace the ReaHotkey Kontakt image in Images\KontaktKompleteKontrol with your new image. With HotspotHelper ImageSearch can fail at times, so if that happens, try and repeat the process. If the image is correctly extracted, it should find it eventually.

And the fact that the Komplete Kontrol part works for you bodes well...

MatejGolian commented 8 months ago

If you manage to extract an image, with the latest code you can just name it "KontaktPlayer.png" (without spaces) and place it in the Images\KontaktKompleteKontrol folder. The buttons that eventually get loaded up on detection are currently identical to those for the full version of the plug-in, so we'll see whether something will need to be adjusted/changed. We have to get detection working, before we can move on.

ScottChesworth commented 8 months ago

Making some progress here. Got an image that works to detect Player, everything in Standalone and VST3 working nicely accept for the Library menu. I can't work out what that's actually useful for in Player. When Library is clicked it reveals a single option labeled "load or create an instrument", clicking that throws us into a mini player window with zero accessibility. Thing is, focus doesn't move to that single option like it does with other menus, so you 1) don't know it's there, and 2) doesn't seem like you can do anything with it that's accessible yet anyways. I'm tempted to remove it from the Player overlay for now, would prefer to say support for Player exists sooner rather than later. Thoughts?

MatejGolian commented 8 months ago

The Library item behaves the same overhere as well. Judging by OCR results I have the impression that it also toggles the visibility of the library browser, although I don't know whether that's its main purpose and if that really is the case. Maybe I'm just fooled by the window that popsup after you click that item. But in case it really does that, perhaps keeping it inthere could be useful. I'm thinking about cases where you might want to OCR the UI of a particular library. Having the browser disabled could theoretically come in handy there. On the other hand, if it doesn't do anything of value to us, we don't have to include it, although it doesn't bother me there personally. But if you and @Timtam would prefer it being removed, we can do it. Either way, good that you've managed to obtain a functional image. I think you could create a pull request for it regardless of what we decide to do with that library thing. Them maybe it would be a good idea to send out the 'demo' version to more Kontakt Player users before we make it official, although I hope that since it works for you, it will work for others as well.

ScottChesworth commented 8 months ago

Yeah I thought perhaps clicking Library showed/hid the library too. My helpful eyes isn't a Kontakt expert, but going on what they described that didn't seem to be the case.

MatejGolian commented 8 months ago

That's useful to know. So away the buttons went... 🙂

MatejGolian commented 4 months ago

With the latest Kontakt update, ReaHotkey is on the way out, at least if one was using it solely for accessing the Kontakt menus. That being said, parts of it are still useful. @ScottChesworth, would you be willing to create a new image file for Kontakt Player nevertheless? Unfortunately it seems that something has changed in the graphics department and Kontakt Player has become less supported - although at this point this is mostly relevant to users of the supported Audio Imperia libraries. Alternatively, any ideas on how I could get the Player version of Kontakt on to my system without creating a new NI account and probably messing my system up? BTW, I have managed to integrate the new accessible buttons directly into the ReaHotkey overlays, so there is no mouse clicking or OCR now. Many thanks...

ScottChesworth commented 4 months ago

Alternatively, any ideas on how I could get the Player version of Kontakt on to my system without creating a new NI account and probably messing my system up?

I did that here by refusing to buy Kontakt full. Works flawlessly. Wanna borrow a time machine? :)

ScottChesworth commented 4 months ago

Sure, will get a new image tomorrow.

MatejGolian commented 4 months ago

I did that here by refusing to buy Kontakt full. Works flawlessly. Wanna borrow a time machine? :) It would have to be more like some kind of parallel universe shenanigan thing. So if you can get me to a universe where I have not yet purchased Kontakt full, I'm all in... 😀

MatejGolian commented 4 months ago

I have cooked up an alternative solution that requires no images for Kontakt or Komplete Kontrol, so I'll close this. Thanks for the effort though... 👍