topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 7, 2024, 2:22 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Simulate keystrokes to scalable BPM  (Read 7612 times)

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,761
    • View Profile
    • Donate to Member
DONE: Simulate keystrokes to scalable BPM
« on: August 28, 2011, 12:27 AM »
Anybody willing to code the following:

It would need to simulate key strokes, and send them to the active window, at a specific BPM

For instance, I would want to send the following keystrokes, to the active window:

Q E T I T E Q E T I T E
N Q E Y E Q N Q E Y E Q
V N Q R Q N V N Q R Q N
B M W T W M B M W T W M

They would be sent at the rate of 128 BPM (In this respect, for the left hand segment of Rufus Wainwright - Hallelujah)

If possible, I would like to also be able to set the program to be able to loop X times, then follow with a new set of orders (so looping that 4 times, then sending the next set of keys to the active window) - It would send each set, a designated number of times.

It should also be able to send multiple strokes at once, so if I wanted to send B Q E at the same time, it would do (at EXACTLY the same time)

BPM is hugely important in this, as its going to be used in conjunction with a Virtual MIDI Piano, So I would obviously want to be able to set a specific BPM for each song.

I know I'm pushing my luck, but I would also be able to set "BPM Markers" within the keymap file, so if it plays X at Y BPM, for N number of times, it could then also change BPM

As an extension (yay, more options), I would also be able to designate shortcuts to be sent to the active window (which will in-turn, change the transposition, the octave etc) (These are set by the MIDI Piano software itself)

IE

*128 4 (<--- signifies, 128 BPM, Repeat 4 times)
Q E T I T E Q E T I T E
N Q E Y E Q N Q E Y E Q
V N Q R Q N V N Q R Q N
B M W T W M B M W T W M
*192 8 (<---192 BPM, Repeat x4)
Q E T I T E Q E T I T E
N Q E Y E Q N Q E Y E Q
V N Q R Q N V N Q R Q N
B M W T W M B M W T W M
*128 8 CTLRA CTLRA (Change BPM back to 128, repeated 8 times, moving the transposition up 2 notches by sending CTRL-Right Arrow to the software)
Q E T I T E Q E T I T E
N Q E Y E Q N Q E Y E Q
V N Q R Q N V N Q R Q N
B M W T W M B M W T W M


It would be cool if those shortcuts are all able to be chosen and changed at any point using this softwares control menu, so I can add/remove shortcuts, or change stuff around to make life easier.


Its a big ask, so I thank in advance.

If you need any more information, ask! :D



« Last Edit: August 28, 2011, 03:58 AM by Stephen66515 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: (Request) Simulate keystrokes to scalable BPM
« Reply #1 on: August 28, 2011, 03:31 AM »
fun idea..

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,761
    • View Profile
    • Donate to Member
Re: (Request) Simulate keystrokes to scalable BPM
« Reply #2 on: August 29, 2011, 07:07 PM »
No-one?  :huh:

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: (Request) Simulate keystrokes to scalable BPM
« Reply #3 on: August 30, 2011, 01:51 AM »
Would it be something to add to WinSendKeys ? That comes with AutoIt source, so you could take a stab at it yourself ;)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: (Request) Simulate keystrokes to scalable BPM
« Reply #4 on: August 30, 2011, 07:31 AM »
Stephen, here's a simplified version of the script I gave you last night:

Code: Autohotkey [Select]
  1. myTunes =
  2. (
  3. *128 4
  4. Q E T I T E Q E T I T E
  5. N Q E Y E Q N Q E Y E Q
  6. V N Q R Q N V N Q R Q N
  7. B M W T W M B M W T W M
  8. *192 8
  9. Q E T I T E Q E T I T E
  10. N Q E Y E Q N Q E Y E Q
  11. V N Q R Q N V N Q R Q N
  12. B M W T W M B M W T W M
  13. *128 8
  14. Q E T I T E Q E T I T E
  15. N Q E Y E Q N Q E Y E Q
  16. V N Q R Q N V N Q R Q N
  17. B M W T W M B M W T W M
  18. )
  19.  
  20. StringSplit, tArray, myTunes, *
  21. Return
  22.  
  23.  
  24. F1::
  25. {
  26.     Loop, % tArray0
  27.     {
  28.         Loop, Parse, tArray%A_Index%, `n, `r
  29.         {
  30.             If ( A_Index = 1 )
  31.             {
  32.                 StringSplit, myTimingArray, A_LoopField, %A_Space%
  33.                 myBPMTime := Ceil( ( 60 / myTimingArray1 ) * 1000 )
  34.                 myRepeat  := myTimingArray2
  35.             }
  36.             Else
  37.             {
  38.                 myKeyBlock .= A_LoopField . " "
  39.             }
  40.         }
  41.     SendKeys( myKeyBlock, myBPMTime, myRepeat )
  42.     myKeyBlock := ""
  43.     }
  44. }
  45. Return
  46.  
  47.  
  48. SendKeys( sKeys, nBPM, nRepeat )
  49. {
  50.     Loop, % nRepeat
  51.     {
  52.         Loop, Parse, sKeys, %A_Space%
  53.         {
  54.             If ( A_LoopField != "" )
  55.             {
  56.                 SendInput, % A_LoopField
  57.                 Sleep, % nBPM
  58.             }
  59.         }
  60.     }
  61. }
  62.  
  63. ESC:: ExitApp

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,761
    • View Profile
    • Donate to Member
Re: (Request) Simulate keystrokes to scalable BPM
« Reply #5 on: August 30, 2011, 11:31 AM »
 :D

TYVM!
* Stephen66515 is happy now!