Jump to content

Musical Keyboard


Paulie
 Share

Recommended Posts

I have made this script that uses the beep function to make noise as you type, it doesn't work very well for incedibly fast typers, but otherwise, its kinda cool, change the "$delay" to different numbers depending on how fast you type and it should work ok. the pitches go up from left to right and as of yet include no special keys, just 1-0 and a-z as pointless as it is... hope you guys enjoy!

order of pitch from low to high:

1234567890qwertyuiopasdfghjklzxcvbnm

feel free to add keys if you so desire

hotkeyset('{esc}', 'halt')
func halt()
    exit
endFunc
;----------------------Variables------------------------------------
#cs
Total Keys:
36
#ce
Global $freq
Global $delay=50
;----------------------------Default-----------------------------------

;---------------------------_IsPressed Function----------------------------
Func _IsPressed($hexKey)
; $hexKey must be the value of one of the keys.
; _IsPressed will return 0 if the key is not pressed, 1 if it is.
; $hexKey should entered as a string, don't forget the quotes!
; (yeah, layer. This is for you)
 
  Local $aR, $bO
 
  $hexKey = '0x' & $hexKey
  $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
  If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
     $bO = 1
  Else
     $bO = 0
  EndIf

  Return $bO
EndFunc;==>_IsPressed
;----------------------------What The Whole script is------------------
While 1
;~~~Numbers
If _IsPressed(30) then;0
   $freq = 1000
   While _IsPressed(30)
   Beep($freq, $delay)
   Wend
Endif
If _IsPressed(31) then;1
   $freq = 100
      While _IsPressed(31)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(32) then;2
   $freq = 200
         While _IsPressed(32)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(33) then;3
   $freq = 300
      While _IsPressed(33)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(34) then;4
   $freq = 400
      While _IsPressed(34)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(35) then;5
   $freq = 500
      While _IsPressed(35)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(36) then;6
   $freq = 600
      While _IsPressed(36)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(37) then;7
   $freq = 700
      While _IsPressed(37)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(38) then;8
   $freq = 800
      While _IsPressed(38)
   Beep($freq, $delay)
   WEnd
Endif
If _IsPressed(39) then;9
   $freq = 900
      While _IsPressed(39)
   Beep($freq, $delay)
   WEnd
Endif
;~~~Letters----------------------------------

If _IsPressed(41) then;a
   $freq = 2100
      While _IsPressed(41)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(42) then;b
   $freq = 3400
      While _IsPressed(42)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(43) then;c
   $freq = 3200
      While _IsPressed(43)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(44) then;d
   $freq = 2300
      While _IsPressed(44)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(45) then;e
   $freq = 1300
      While _IsPressed(45)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(46) then;f
   $freq = 2400
      While _IsPressed(46)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(47) then;g
   $freq = 2500
      While _IsPressed(47)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(48) then;h
   $freq = 2600
         While _IsPressed(48)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(49) then;i
   $freq = 1800
         While _IsPressed(49)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("4A") then;j
   $freq = 2700
         While _IsPressed("4A")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("4B") then;k
   $freq = 2800
         While _IsPressed("4B")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("4C") then;l
   $freq = 2900
         While _IsPressed("4C")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("4D") then;m
   $freq = 3600
         While _IsPressed("4D")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("4E") then;n
   $freq = 3500
         While _IsPressed("4E")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("4F") then;o
   $freq = 1900
         While _IsPressed("4F")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(50) then;p
   $freq = 2000
         While _IsPressed(50)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(51) then;q
   $freq = 1100
         While _IsPressed(51)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(52) then;r
   $freq = 1400
         While _IsPressed(52)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(53) then;s
   $freq = 2200
         While _IsPressed(53)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(54) then;t
   $freq = 1500
         While _IsPressed(54)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(55) then;u
   $freq = 1700
         While _IsPressed(55)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(56) then;v
   $freq = 3300
         While _IsPressed(56)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(57) then;w
   $freq = 1200
         While _IsPressed(57)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(58) then;x
   $freq = 3100
         While _IsPressed(58)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed(59) then;y
   $freq = 1600
         While _IsPressed(59)
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~
If _IsPressed("5A") then;z
   $freq = 3000
         While _IsPressed("5A")
   Beep($freq, $delay)
   WEnd
Endif
;~~~~~~

Wend

hope you guys like it!!

Edit:

REQUIRES BETA

Edited by Paulie
Link to comment
Share on other sites

Nice Paulie, fun script.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Thanks for the input all

EDIT...

oh... and thanks for the help Valuater

well i would have said that, but you help everyone(almost) so i just figured that that would be implied :)
Link to comment
Share on other sites

i have a problem running this and i really want to try this cool script:

Posted Image

Oh crap i shoulda said, this requires beta :"> sorry

you can download the latest version of beta in the stickey in the v3 support forum

Link to comment
Share on other sites

this is quite good. i like it!

hotkeyset('{esc}', 'halt')

$Key = "abcdefghijklmnop"

$Keys = StringSplit ($Key,"")
$KeysLen = $Keys[0]

$Delay = 100

For $n = 1 to $KeysLen
Hotkeyset($Keys[$n], $Keys[$n])
next


While 1
WEnd

Func a()
    Beep (2100,$Delay)
endFunc
Func b()
    Beep (3400,$Delay)
endFunc
Func c()
    Beep (3200,$Delay)
endFunc
Func d()
    Beep (2300,$Delay)
endFunc
Func e()
    Beep (1300,$Delay)
endFunc
Func f()
    Beep (2400,$Delay)
endFunc
Func g()
    Beep (2500,$Delay)
endFunc
Func h()
    Beep (2600,$Delay)
endFunc
Func i()
    Beep (1800,$Delay)
endFunc
Func j()
    Beep (2700,$Delay)
endFunc
Func k()
    Beep (2800,$Delay)
endFunc
Func l()
    Beep (2900,$Delay)
endFunc
Func m()
    Beep (3600,$Delay)
endFunc
Func n()
    Beep (3600,$Delay)
endFunc
Func o()
    Beep (3500,$Delay)
endFunc
Func p()
    Beep (3500,$Delay)
endFunc

hotkeyset('{esc}', 'halt')
func halt()
    exit
endFunc

Anyone know how to assign Functions with a variable?

Edited by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

hotkeyset('{esc}', 'halt')

$Key = "abcdefghijklmnop"

$Keys = StringSplit ($Key,"")
$KeysLen = $Keys[0]

$Delay = 100

For $n = 1 to $KeysLen
Hotkeyset($Keys[$n], $Keys[$n])
next
While 1
WEnd

Func a()
    Beep (2100,$Delay)
endFunc
Func b()
    Beep (3400,$Delay)
endFunc
Func c()
    Beep (3200,$Delay)
endFunc
Func d()
    Beep (2300,$Delay)
endFunc
Func e()
    Beep (1300,$Delay)
endFunc
Func f()
    Beep (2400,$Delay)
endFunc
Func g()
    Beep (2500,$Delay)
endFunc
Func h()
    Beep (2600,$Delay)
endFunc
Func i()
    Beep (1800,$Delay)
endFunc
Func j()
    Beep (2700,$Delay)
endFunc
Func k()
    Beep (2800,$Delay)
endFunc
Func l()
    Beep (2900,$Delay)
endFunc
Func m()
    Beep (3600,$Delay)
endFunc
Func n()
    Beep (3600,$Delay)
endFunc
Func o()
    Beep (3500,$Delay)
endFunc
Func p()
    Beep (3500,$Delay)
endFunc

hotkeyset('{esc}', 'halt')
func halt()
    exit
endFunc

Anyone know how to assign Functions with a variable?

2 problems i see with this,

1)Copy Cat :)

2)Sorta defeats the purpose of the proggy(hotKetset steals key from other uses)

Link to comment
Share on other sites

2 problems i see with this,

1)Copy Cat :(

2)Sorta defeats the purpose of the proggy(hotKetset steals key from other uses)

I never mean`t for this to do anything useful, it was just a way for me to experiment with assigning functions via HotKeySet in a loop.

Lets see you use _ispressed in a loop to scan the keyboard :)

Hint: this is already on the forum... :D

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

cool

heres my song

cool

67668888888888888888888888888888888888888

67869999999999999999

676769999999999999999999

676768888888888888888

69696969696

454344543545455545

I know instead of requesting, I hsould edit yours with credit for original..you should make it though a musical keyboard guitar..

like:

ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 is String 1 or String E

` 1 2 3 4 5 6 7 8 9 0 - = is String 2 or String B

Tab q w e r t y u i o p [ ] is String 3 or String G

ETC all the way down ot string E or Sting 6...

and each key fomr left to right is one fret more..

like:

FRET #: 1 2 3 4 5 6 7 8 9 10 11 12 13 14

------------------------------------------------

tab q w e r t y u i o p [ ] \

and for every string..

NOW THIS WOULD TOTTALY OWN..

and with help form all the community..you can probb get it to save sounds? and repeat by typing in which keys to play'

Or you can jsut manually type them in another auto it script

Link to comment
Share on other sites

I know instead of requesting, I hsould edit yours with credit for original..you should make it though a musical keyboard guitar..

like:

ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 is String 1 or String E

` 1 2 3 4 5 6 7 8 9 0 - = is String 2 or String B

Tab q w e r t y u i o p [ ] is String 3 or String G

ETC all the way down ot string E or Sting 6...

and each key fomr left to right is one fret more..

like:

FRET #: 1 2 3 4 5 6 7 8 9 10 11 12 13 14

------------------------------------------------

tab q w e r t y u i o p [ ] \

and for every string..

NOW THIS WOULD TOTTALY OWN..

and with help form all the community..you can probb get it to save sounds? and repeat by typing in which keys to play'

Or you can jsut manually type them in another auto it script

its already been done

http://www.autoitscript.com/forum/index.ph...201&hl=.autsong

Link to comment
Share on other sites

Pretty cool. I made a program like this except it was meant to annoy my friend (the same sound for every key, copied it into his startup of course, and no tray icon, mainly because he stole one of my accounts on another site, we both got a good laugh)

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

Anyone know how to assign Functions with a variable?

Are you want to Eval() ?

Dim $ClientWidth = 800

Dim $ClientHeight = 600

$ItemsXA = GetPixelByRatio("Width", -0.5)

$ItemsYA = GetPixelByRatio("Height", -0.5)

$ItemsXB = GetPixelByRatio("Width", +0.5)

$ItemsYB = GetPixelByRatio("Height", +0.5)

;Search to Pickable Item

Func GetPixelByRatio($Prefix1, $Prefix2)

If $Prefix1 = "Width" Then

Return StringRight( "0000" & Floor ( ( @DesktopWidth + (Eval("Client" & $Prefix1) * $Prefix2) ) / 2 ) , 4 )

Else

Return StringRight( "0000" & Floor ( ( @DesktopHeight + (Eval("Client" & $Prefix1) * $Prefix2) ) / 2 ) , 4 )

EndIf

EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...