Automation Challenge

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 03 Nov 2020, 21:01

Here you go...
Attachments
Capture_2020_11_03_21_00_56_153.png
Capture_2020_11_03_21_00_56_153.png (117.79 KiB) Viewed 529 times
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 03 Nov 2020, 21:10

You write ini file like this?

Code: Select all

Global ini := "C:\Users\eladb\Desktop\TEST\test.ini" ; Path to your INI file
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 03 Nov 2020, 21:14

No sir,

I only wrote the file path without creating a *.INI file - I'm such an idiot :) LOL

Ok, this is the message i received after following your instructions
and Hitting OK

Seems more like a confirmation message than an error No?
Attachments
Capture_2020_11_03_21_12_43_54.png
Capture_2020_11_03_21_12_43_54.png (107.57 KiB) Viewed 518 times
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 03 Nov 2020, 21:16

OMG!!!!!!

I think it worked!!!!! :bravo: :bravo: :bravo:
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 03 Nov 2020, 21:20

We have two tiny issues to make it perfect and then you better give me your PayPal email address :) LOL

1. As I originally posted, I wanted SYSex to be captured and not Note. I would love to keep both functions but the Sysex is the main function that is necessary

2. The last thing is that I would like to activate the script in Reverse. What I mean by that is that if I activate the file manually from my computer, I would like the file to transmit the same Sysex message to my synth


In other words - The synth activates the file and the file activates the Synth. Both are happily married with the Sysex bond :)
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 04 Nov 2020, 11:02

It will be not easy, because as I said before there are not many ways to get event when file is opened.
I do not want to write driver or rootkit.
May be it can be done with parsing Change Journals. But it is only for NTFS.
To send Sysex to midi You can do like this

Code: Select all

SysexMessage := "F0 00 20 29 02 0C 09 00 F7"
DllCall("LoadLibrary", "str", "winmm.dll")
loop
{
   if DllCall("winmm.dll\midiOutOpen", "ptr*", midiOutHandle, "uint", A_Index-1, "ptr", 0, "uint", 0, "uint", 0)
   {
      msgbox done
      exitapp
   }
   SysexArray := StrSplit(SysexMessage, A_Space)
   VarSetCapacity(SysexBin, SysexArray.MaxIndex(), 0)
   loop % SysexArray.MaxIndex()
      NumPut("0x" SysexArray[A_Index], &SysexBin, A_Index-1, "uchar") 
   VarSetCapacity(MIDIHDR, 10*A_PtrSize+8, 0)
   NumPut(&SysexBin, MIDIHDR, 0)
   NumPut(SysexArray.MaxIndex(), MIDIHDR, A_PtrSize, "uint")
   NumPut(SysexArray.MaxIndex(), MIDIHDR, A_PtrSize+4, "uint")
   DllCall("winmm.dll\midiOutPrepareHeader", "ptr", midiOutHandle, "ptr", &MIDIHDR, "uint", 10*A_PtrSize+8)
   DllCall("winmm.dll\midiOutLongMsg", "ptr", midiOutHandle, "ptr", &MIDIHDR, "uint", 10*A_PtrSize+8)
   msgbox % A_Index-1
}
When message will be sent successful then You have to use id number in messagebox.
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:06

I'm so grateful to you and Mikey for what we have already accomplished that trust me, I have no expectation. So appreciative, really!

Trying it out now. Standby...
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:09

malcev wrote:
04 Nov 2020, 11:02
It will be not easy, because as I said before there are not many ways to get event when file is opened.
I do not want to write driver or rootkit.
May be it can be done with parsing Change Journals. But it is only for NTFS.
To send Sysex to midi You can do like this

Code: Select all

SysexMessage := "F0 00 20 29 02 0C 09 00 F7"
DllCall("LoadLibrary", "str", "winmm.dll")
loop
{
   if DllCall("winmm.dll\midiOutOpen", "ptr*", midiOutHandle, "uint", A_Index-1, "ptr", 0, "uint", 0, "uint", 0)
   {
      msgbox done
      exitapp
   }
   SysexArray := StrSplit(SysexMessage, A_Space)
   VarSetCapacity(SysexBin, SysexArray.MaxIndex(), 0)
   loop % SysexArray.MaxIndex()
      NumPut("0x" SysexArray[A_Index], &SysexBin, A_Index-1, "uchar") 
   VarSetCapacity(MIDIHDR, 10*A_PtrSize+8, 0)
   NumPut(&SysexBin, MIDIHDR, 0)
   NumPut(SysexArray.MaxIndex(), MIDIHDR, A_PtrSize, "uint")
   NumPut(SysexArray.MaxIndex(), MIDIHDR, A_PtrSize+4, "uint")
   DllCall("winmm.dll\midiOutPrepareHeader", "ptr", midiOutHandle, "ptr", &MIDIHDR, "uint", 10*A_PtrSize+8)
   DllCall("winmm.dll\midiOutLongMsg", "ptr", midiOutHandle, "ptr", &MIDIHDR, "uint", 10*A_PtrSize+8)
   msgbox % A_Index-1
}
When message will be sent successful then You have to use id number in messagebox.

1. Do I combine this with the current script or run it by itself
2. I saw inside that you already wrote the Sysex message = F0 00 20 29 02 0C 09 00 F7 - Is this normal? Because we are supposed to listen to the message and capture it - not predefined (Just asking)
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 04 Nov 2020, 11:15

You have to test this particular script.
Change SysexMessage to Yours and test it.
Mine SysexMessage turns off lighting on my Launchpad X when I send it to id = 1.
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:24

Got it

Hold on: Is it suppose to send the Sysex command out? To my synth?

I gives me a count 1,2,3,4 done! ???
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 04 Nov 2020, 11:31

You have to send those message to Your synth that You can see or detect.
User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Automation Challenge

Post by mikeyww » 04 Nov 2020, 11:32

I can also test it when I get my controller.

The file trigger will be easy with the F4 example noted earlier.

I think the tricky part might be the MIDI trigger, but with a routine to listen for MIDI-- as I think @malcev provided, this seems straightforward (?).
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 04 Nov 2020, 11:36

If elad770 will open all files manually with f4 then it will be easy.
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:39

OMG!!

Oh...Hi Mikey, thank you for joining here.

Ok, I copy-paste the relevant message to the script

I then, executed the script and click on 1 - nothing happened
clicked again, the picture showed 2 - nothing happened
Clicked again - and my synth responded !!!! When picture 3 was up
had to click twice and basically, it worked!!

How can we implement this now?
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 04 Nov 2020, 11:42

As I understand after You click on picture with number 2 - it will work and shows 3?
How do You plan to open files manually?
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:49

Just executing the file as a double mouse click or tap on it if I have a touch screen but nothing from the computer will execute it. I'm doing it

I basically asked, how can we merge the Sysex function with the automapping script we have (I mean, you :) LOL) already made?

Here's the flow

1. got to file, F3 deploys the capture screen
2. I click on the Synth to transmit the Sysex message
3. Message is captured

application:

- Every time I transmit the captured Sysex message that fil will activate
- Every time I open the file (manually, by my self), the Sysex will transmit out from the computer into my Synth and activate the function
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Automation Challenge

Post by malcev » 04 Nov 2020, 11:52

You dont answer
As I understand after You click on picture with number 2 - it will work and shows 3?
Do You work on drive NTFS?
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:53

malcev wrote:
04 Nov 2020, 11:42
As I understand after You click on the picture with number 2 - it will work and shows 3?
How do You plan to open files manually?

As I understand after You click on the picture with number 2 - it will work and shows 3? ------>That is correct!!!

I believe you are referring to the hard drive. Fat32, NTFS etc - I believe it is NTFS. see capture below

We just need to implement this in our workflow as I mentioned in my previous message above
Last edited by elad770 on 04 Nov 2020, 12:54, edited 1 time in total.
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 11:59

This is how it works exactly

https://youtu.be/YVSTOz5JutM

Please see the attach picture - It looks like my C: drive is indeed NTFS
Attachments
Capture_2020_11_04_11_58_01_712.png
Capture_2020_11_04_11_58_01_712.png (77.83 KiB) Viewed 391 times
elad770
Posts: 82
Joined: 30 Oct 2020, 16:21

Re: Automation Challenge

Post by elad770 » 04 Nov 2020, 20:51

mikey, do you think I made malcev upset?

I hope not. I literally refresh the page every few minutes to see when you are online! LOL

I'm very excited to get this thing going! I feel we are almost there
Post Reply

Return to “Ask for Help (v1)”