Simulate velocity sensitivity on a pc keyboard

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
serifpersia
Posts: 6
Joined: 14 May 2018, 06:21

Simulate velocity sensitivity on a pc keyboard

14 May 2018, 06:33

Hello guys.
i wonder if its possible to simulate velocity sensitivity on a pc keyboard using AutoHotkey
I'm using program called EveryonePiano, its a piano software that allows you to play piano using computer keyboard
It has a layout that uses all the keys from z x c v and so on to even enter keys and numpad keys.
Within the software exist a function to change the velocity using F9 to increase and F10 to decrease the velocity for the left hand and F11 and F12 for the right hand. The only problem with this is that i need to press those keys in order to to change the velocity.
So I was thinking is there a way like to measure the time between the key presses using autohotkey script and that way bring the velocity that changes depending on the time between the key presses. Is this possible to do?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 07:03

how do u map 'time between keypresses' to 'velocity'? time between keypresses is just that, the time between keypresses. velocity is how hard u hit a particular key. wheres the connection?
serifpersia
Posts: 6
Joined: 14 May 2018, 06:21

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 07:22

The program has the velocity keys(F9,10,11 and F12) which are used to change the dynamics. But i need to figure out a way to trigger those keys using script.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 10:02

my question doesnt pertain to the inner workings of your particular app. what im asking is how do u figure what the velocity of a particular keypress should be? what does the 'time between keypresses' have to do with it?
serifpersia
Posts: 6
Joined: 14 May 2018, 06:21

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 11:18

The time between presses is the method to simulate the velocity effect. Old Yamaha DX 21 for example has no velocity sensitive keys but instead it tries to emulate it by calculating the attack like how fast the key was pressed. Of course that is not legit velocity but it can help with the dynamics of the keyboard if its not velocity sensitive. That's what I'm trying to emulate can AutoHotkey do that?
Like measure the attack of the pressed key and map that to the velocity function inside this third party program which I use.
serifpersia
Posts: 6
Joined: 14 May 2018, 06:21

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 11:29

Lets say for example I press the U key. The scripts takes that input, measures the time that key was held and after that it outputs that to a Function key that increases the velocity by X amount. So after the key was released the scripts takes the earlier time held and outputs that again to a function key to decrease the velocity by X amount. Its not like I want full velocity from 0 to 100. I just want just a little more expression while playing.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 11:34

What must it do after measuring how long you have pressed a certain key?

Also what is the function key in this case? Give us all specifics that would make it easier for us. But you need to tell exactly what you want because I don't know how this works.
Depending on how long the key was pressed what should be done to the function key?
I am your average ahk newbie. Just.. a tat more cute. ;)
serifpersia
Posts: 6
Joined: 14 May 2018, 06:21

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 11:47

I tried simple send command seems like it won't work inside the program but it does work outside the software. It locks the keyboard so external source like AutoHotkey is not working. Is there a solution to this?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 11:59

yeah, thats cuz MIDI controllers are capable of measuring how fast the key was pressed. How do u suggest u do that using a regular ol computer keyboard, which only has ON/OFF button states?

i dont think your idea is applicable here. if im misunderstanding something feel free to correct me: so what youre suggesting is you press a key, start measuring how long youre holding the key down for, and based on that u in-/decrease the velocity in your app, then when u release the key, u 'play' the key in your app and presumably reset the velocity. how would that work if u had to hold the notes, for example? are all sustained notes just gonna be super loud? also, wouldnt all this delaying business fuck with your timing when playing?
serifpersia
Posts: 6
Joined: 14 May 2018, 06:21

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 12:06

Yes the delay would definitely mess up my timing. In order for this to work the script must wait for command but even simple send command wont work so.. Yeah need to find another way.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Simulate velocity sensitivity on a pc keyboard

14 May 2018, 13:45

Well that just got that complex that quick lol.
I am your average ahk newbie. Just.. a tat more cute. ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ccqcl, DataLife, Rohwedder and 163 guests