Welcome Guest.   Make a donation to an author on the site December 21, 2014, 06:07:08 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Simulate keystrokes to scalable BPM  (Read 2659 times)
Stephen66515
Animated Giffer in Chief
Honorary Member
**
Posts: 2,798



see users location on a map View Profile Give some DonationCredits to this forum member
« on: August 28, 2011, 12:27:09 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! cheesy



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

No trees were harmed during the creation of this message.  Millions of electrons, however, were terribly inconvenienced

"Think left and think right and think low and think high. Oh, the things you can think up if only you try!" - Dr. Seuss
mouser
First Author
Administrator
*****
Posts: 33,791



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: August 28, 2011, 03:31:55 AM »

fun idea..
Logged
Stephen66515
Animated Giffer in Chief
Honorary Member
**
Posts: 2,798



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: August 29, 2011, 07:07:56 PM »

No-one?  huh
Logged

No trees were harmed during the creation of this message.  Millions of electrons, however, were terribly inconvenienced

"Think left and think right and think low and think high. Oh, the things you can think up if only you try!" - Dr. Seuss
Ath
Supporting Member
**
Posts: 2,303



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: August 30, 2011, 01:51:05 AM »

Would it be something to add to WinSendKeys ? That comes with AutoIt source, so you could take a stab at it yourself Wink
Logged

skwire
Global Moderator
*****
Posts: 4,182



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: August 30, 2011, 07:31:12 AM »

Stephen, here's a simplified version of the script I gave you last night:

Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  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.  
  22.  
  23. F1::
  24. {
  25.    Loop, % tArray0
  26.    {
  27.        Loop, Parse, tArray%A_Index%, `n, `r
  28.        {
  29.            If ( A_Index = 1 )
  30.            {
  31.                StringSplit, myTimingArray, A_LoopField, %A_Space%
  32.                myBPMTime := Ceil( ( 60 / myTimingArray1 ) * 1000 )
  33.                myRepeat  := myTimingArray2
  34.            }
  35.            Else
  36.            {
  37.                myKeyBlock .= A_LoopField . " "
  38.            }
  39.        }
  40.    SendKeys( myKeyBlock, myBPMTime, myRepeat )
  41.    myKeyBlock := ""
  42.    }
  43. }
  44.  
  45.  
  46. SendKeys( sKeys, nBPM, nRepeat )
  47. {
  48.    Loop, % nRepeat
  49.    {
  50.        Loop, Parse, sKeys, %A_Space%
  51.        {
  52.            If ( A_LoopField != "" )
  53.            {
  54.                SendInput, % A_LoopField
  55.                Sleep, % nBPM
  56.            }
  57.        }
  58.    }
  59. }
  60.  
  61. ESC:: ExitApp
Logged

Stephen66515
Animated Giffer in Chief
Honorary Member
**
Posts: 2,798



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: August 30, 2011, 11:31:57 AM »

 cheesy

TYVM!
* Stephen66515 is happy now!
Logged

No trees were harmed during the creation of this message.  Millions of electrons, however, were terribly inconvenienced

"Think left and think right and think low and think high. Oh, the things you can think up if only you try!" - Dr. Seuss
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.072s | Server load: 0.02 ]