BobiusMaximus Posted December 23, 2006 Share Posted December 23, 2006 Not much to say...I got bored and made a piano. Can be played with F1-F8 or by clicking, haven't figured out how to make it play for as long as you hold down though Suggestions are welcome. expandcollapse popup;By Robert Woollins AKA BobiusMaximus Hotkeyset("{F1}","F1") Hotkeyset("{F2}","F2") Hotkeyset("{F3}","F3") Hotkeyset("{F4}","F4") Hotkeyset("{F5}","F5") Hotkeyset("{F6}","F6") Hotkeyset("{F7}","F7") Hotkeyset("{F8}","F8") #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Bobs Piano", 336, 106, 256, 155) $C1 = GUICtrlCreateButton("C", 8, 8, 33, 81, 0) $D1 = GUICtrlCreateButton("D", 48, 8, 33, 81, 0) $E1 = GUICtrlCreateButton("E", 88, 8, 33, 81, 0) $F1 = GUICtrlCreateButton("F", 128, 8, 33, 81, 0) $G1 = GUICtrlCreateButton("G", 168, 8, 33, 81, 0) $A1 = GUICtrlCreateButton("A", 208, 8, 33, 81, 0) $B1 = GUICtrlCreateButton("B", 248, 8, 33, 81, 0) $C2 = GUICtrlCreateButton("C", 288, 8, 33, 81, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() If $nMsg = $C1 Then Call("F1") If $nMsg = $D1 Then Call("F2") If $nMsg = $E1 Then Call("F3") If $nMsg = $F1 Then Call("F4") If $nMsg = $G1 Then Call("F5") If $nMsg = $A1 Then Call("F6") If $nMsg = $B1 Then Call("F7") If $nMsg = $C2 Then Call("F8") Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func F1() Beep(264, 500) EndFunc Func F2() Beep(297, 500) EndFunc Func F3() Beep(330, 500) EndFunc Func F4() Beep(352, 500) EndFunc Func F5() Beep(396, 500) EndFunc Func F6() Beep(440, 500) EndFunc Func F7() Beep(495, 500) EndFunc Func F8() Beep(523.3, 500) EndFunc -Bob Photoshop User and Noob AutoIt user. Link to comment Share on other sites More sharing options...
James Posted December 23, 2006 Share Posted December 23, 2006 (edited) Lol, I like this. Its fun!expandcollapse popupHotkeyset("{F1}","F1") Hotkeyset("{F2}","F2") Hotkeyset("{F3}","F3") Hotkeyset("{F4}","F4") Hotkeyset("{F5}","F5") Hotkeyset("{F6}","F6") Hotkeyset("{F7}","F7") Hotkeyset("{F8}","F8") #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Bobs Piano", 336, 106, 256, 155) $C1 = GUICtrlCreateButton("C", 8, 8, 33, 81, 0) $D1 = GUICtrlCreateButton("D", 48, 8, 33, 81, 0) $E1 = GUICtrlCreateButton("E", 88, 8, 33, 81, 0) $F1 = GUICtrlCreateButton("F", 128, 8, 33, 81, 0) $G1 = GUICtrlCreateButton("G", 168, 8, 33, 81, 0) $A1 = GUICtrlCreateButton("A", 208, 8, 33, 81, 0) $B1 = GUICtrlCreateButton("B", 248, 8, 33, 81, 0) $C2 = GUICtrlCreateButton("C", 288, 8, 33, 81, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() If $nMsg = $C1 Then Call("F1") If $nMsg = $D1 Then Call("F2") If $nMsg = $E1 Then Call("F3") If $nMsg = $F1 Then Call("F4") If $nMsg = $G1 Then Call("F5") If $nMsg = $A1 Then Call("F6") If $nMsg = $B1 Then Call("F7") If $nMsg = $C2 Then Call("F8") Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func F1() If WinActive("Bobs Piano") Then Beep(264, 500) EndIf EndFunc Func F2() If WinActive("Bobs Piano") Then Beep(297, 500) EndIf EndFunc Func F3() If WinActive("Bobs Piano") Then Beep(330, 500) EndIf EndFunc Func F4() If WinActive("Bobs Piano") Then Beep(352, 500) EndIf EndFunc Func F5() If WinActive("Bobs Piano") Then Beep(396, 500) EndIf EndFunc Func F6() If WinActive("Bobs Piano") Then Beep(440, 500) EndIf EndFunc Func F7() If WinActive("Bobs Piano") Then Beep(495, 500) EndIf EndFunc Func F8() If WinActive("Bobs Piano") Then Beep(523.3, 500) EndIf EndFuncEdit: Just got slightly annoyed when it still played on other windows. Added If WinActive() Edited December 23, 2006 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
dandymcgee Posted December 23, 2006 Share Posted December 23, 2006 Hmmm.... Paulie made something very similar to this, but his was designed to programs a song into a script then play it. There have been other Piano GUI attempts but I think they've all run into the same problem... the sound just won't stop. I've tried everything there is to try to get the sound to stop playing when the key is let up, but I just can't seem to get the script to interrupt that beep command. Nice script, but if you search the forums it has been done. - Dan [Website] Link to comment Share on other sites More sharing options...
Paulie Posted December 23, 2006 Share Posted December 23, 2006 (edited) Nice, I thought about doing something like this when I made my Beep Piano stuff but, There is an unecessary use of the "call" function This: While 1 $nMsg = GUIGetMsg() If $nMsg = $C1 Then Call("F1") If $nMsg = $D1 Then Call("F2") If $nMsg = $E1 Then Call("F3") If $nMsg = $F1 Then Call("F4") If $nMsg = $G1 Then Call("F5") If $nMsg = $A1 Then Call("F6") If $nMsg = $B1 Then Call("F7") If $nMsg = $C2 Then Call("F8") Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd oÝ÷ Ù(hºW[y«¢+Ø)]¡¥±Ä(ÀÌØí¹5ÍôU%Ñ5Í ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ä ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸È ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ì ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ð ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ô ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ø ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ü ¤(%ÀÌØí¹5ÍôÀÌØíÈQ¡¸à ¤(MÝ¥Ñ ÀÌØí¹5Í( ÍÀÌØíU%}Y9Q} 1=M(á¥Ð((¹MÝ¥Ñ )]¹ Edited December 23, 2006 by Paulie Link to comment Share on other sites More sharing options...
BobiusMaximus Posted December 23, 2006 Author Share Posted December 23, 2006 Nice, I thought about doing something like this when I made my Beep Piano stuff but, There is an unecessary use of the "call" function This: While 1 $nMsg = GUIGetMsg() If $nMsg = $C1 Then Call("F1") If $nMsg = $D1 Then Call("F2") If $nMsg = $E1 Then Call("F3") If $nMsg = $F1 Then Call("F4") If $nMsg = $G1 Then Call("F5") If $nMsg = $A1 Then Call("F6") If $nMsg = $B1 Then Call("F7") If $nMsg = $C2 Then Call("F8") Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd oÝ÷ Ù(hºW[y«¢+Ø)]¡¥±Ä(ÀÌØí¹5ÍôU%Ñ5Í ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ä ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸È ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ì ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ð ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ô ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ø ¤(%ÀÌØí¹5ÍôÀÌØíÄQ¡¸Ü ¤(%ÀÌØí¹5ÍôÀÌØíÈQ¡¸à ¤(MÝ¥Ñ ÀÌØí¹5Í( ÍÀÌØíU%}Y9Q} 1=M(á¥Ð((¹MÝ¥Ñ )]¹ I can't see that making a large difference TBH, just saves a few characters. The other idea seemed useful... But there is no way of making it last for however long you have it pushed down? -Bob Photoshop User and Noob AutoIt user. Link to comment Share on other sites More sharing options...
James Posted December 23, 2006 Share Posted December 23, 2006 Yeah, I noticed that when you hold down something, it keeps playing the note and it lags for ages. So I would suggest making an exit function. Other than that, I have no idea. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
theguy0000 Posted December 23, 2006 Share Posted December 23, 2006 I can't see that making a large difference TBH, just saves a few characters.The other idea seemed useful...But there is no way of making it last for however long you have it pushed down?-Bobthe Call command has special purposes and properties, and should not be used when it's not needed. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 23, 2006 Share Posted December 23, 2006 (edited) inspired by helge this is untested expandcollapse popupHotkeyset("{F1}","Play") Hotkeyset("{F2}","Play") Hotkeyset("{F3}","Play") Hotkeyset("{F4}","Play") Hotkeyset("{F5}","Play") Hotkeyset("{F6}","Play") Hotkeyset("{F7}","Play") Hotkeyset("{F8}","Play") #include <GUIConstants.au3> $Form1 = GUICreate("Bobs Piano", 336, 106, 256, 155) $C1 = GUICtrlCreateButton("C", 8, 8, 33, 81, 0) $D1 = GUICtrlCreateButton("D", 48, 8, 33, 81, 0) $E1 = GUICtrlCreateButton("E", 88, 8, 33, 81, 0) $F1 = GUICtrlCreateButton("F", 128, 8, 33, 81, 0) $G1 = GUICtrlCreateButton("G", 168, 8, 33, 81, 0) $A1 = GUICtrlCreateButton("A", 208, 8, 33, 81, 0) $B1 = GUICtrlCreateButton("B", 248, 8, 33, 81, 0) $C2 = GUICtrlCreateButton("C", 288, 8, 33, 81, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $C1 Then Play("F1") If $nMsg = $D1 Then Play("F2") If $nMsg = $E1 Then Play("F3") If $nMsg = $F1 Then Play("F4") If $nMsg = $G1 Then Play("F5") If $nMsg = $A1 Then Play("F6") If $nMsg = $B1 Then Play("F7") If $nMsg = $C2 Then Play("F8") If $nMsg = $GUI_EVENT_CLOSE Then Exit WEnd Func Play($hotkey ="") If $hotkey = "" Then $hotkey = @HotKeyPressed Else $hotkey = "{" & $hotkey & "}" EndIf Global $beep[8] = [264,297,330,352,396,440,495,523.3] Beep($beep[StringTrimLeft(StringTrimRight($hotkey,1),2)],500) EndFunc Edited December 23, 2006 by Thatsgreat2345 Link to comment Share on other sites More sharing options...
dandymcgee Posted December 23, 2006 Share Posted December 23, 2006 @Thatsgreat - Doesn't work. - Dan [Website] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 23, 2006 Share Posted December 23, 2006 woops forgot to subtract 1 and declare $hotkey, i dont have a beep speaker so i cant test it expandcollapse popupHotkeyset("{F1}","Play") Hotkeyset("{F2}","Play") Hotkeyset("{F3}","Play") Hotkeyset("{F4}","Play") Hotkeyset("{F5}","Play") Hotkeyset("{F6}","Play") Hotkeyset("{F7}","Play") Hotkeyset("{F8}","Play") #include <GUIConstants.au3> Global $hotkey $Form1 = GUICreate("Bobs Piano", 336, 106, 256, 155) $C1 = GUICtrlCreateButton("C", 8, 8, 33, 81, 0) $D1 = GUICtrlCreateButton("D", 48, 8, 33, 81, 0) $E1 = GUICtrlCreateButton("E", 88, 8, 33, 81, 0) $F1 = GUICtrlCreateButton("F", 128, 8, 33, 81, 0) $G1 = GUICtrlCreateButton("G", 168, 8, 33, 81, 0) $A1 = GUICtrlCreateButton("A", 208, 8, 33, 81, 0) $B1 = GUICtrlCreateButton("B", 248, 8, 33, 81, 0) $C2 = GUICtrlCreateButton("C", 288, 8, 33, 81, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $C1 Then Play("F1") If $nMsg = $D1 Then Play("F2") If $nMsg = $E1 Then Play("F3") If $nMsg = $F1 Then Play("F4") If $nMsg = $G1 Then Play("F5") If $nMsg = $A1 Then Play("F6") If $nMsg = $B1 Then Play("F7") If $nMsg = $C2 Then Play("F8") If $nMsg = $GUI_EVENT_CLOSE Then Exit WEnd Func Play($hotkey = "") If $hotkey = "" Then $hotkey = @HotKeyPressed Else $hotkey = "{" & $hotkey & "}" EndIf Global $beep[8] = [264,297,330,352,396,440,495,523.3] Beep($beep[StringTrimLeft(StringTrimRight($hotkey,1),2)-1],500) $hotkey = "" EndFunc Link to comment Share on other sites More sharing options...
Paulie Posted December 24, 2006 Share Posted December 24, 2006 Maybe this thread will give you some inspiration:http://www.autoitscript.com/forum/index.php?showtopic=30069 Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 24, 2006 Share Posted December 24, 2006 poly on ur script u did a shit load of un needed work xD Link to comment Share on other sites More sharing options...
Paulie Posted December 24, 2006 Share Posted December 24, 2006 poly on ur script u did a shit load of un needed work xDyeah, but it works, right? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 24, 2006 Share Posted December 24, 2006 Kat , did gafrost teach you how to use it? Link to comment Share on other sites More sharing options...
Paulie Posted December 24, 2006 Share Posted December 24, 2006 (edited) Ya know, You are an ass. And an idiot. And a complete freaking waste of time, my time, to talk to. You have no respect for anyone, showing that you have little respect for yourself in the process. Either get your act together or go plague some other Forum. Go to AHK, they might appreciate your caliber of person. *click**Bah-Zing* *Gives Kat a HUGE High-5* Thanks too btw That, deserves one of these:@ThatsgreatYHBT•YHL•HAND -- If you don't know what it means, google it, you might learn sumfin' Edited December 24, 2006 by Paulie Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 24, 2006 Share Posted December 24, 2006 Ya know, YOu are an ass. And an idiot. And a complete freaking waste of time, my time, to talk to. You have no respect for anyone, showing that you have little respect for yourself in the process. Either get your act together or go plague some other Forum. Go to AHK, they might appreciate your caliber of person. *click*... it was a simple question i wasn't meaning to attack u or something , and i wasn't attacking paulie or anything i was merely stating that there was a faster way he could of performed his script, sorry for making it seem like i was implying something Link to comment Share on other sites More sharing options...
Paulie Posted December 24, 2006 Share Posted December 24, 2006 ... it was a simple question i wasn't meaning to attack u or something , and i wasn't attacking paulie or anything i was merely stating that there was a faster way he could of performed his script, sorry for making it seem like i was implying somethingSo which was it? a question or a statement? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 24, 2006 Share Posted December 24, 2006 well i do not use punctuations, the question was me asking if gary helped her, the statement was about there being a faster way, got it? Link to comment Share on other sites More sharing options...
Valik Posted December 24, 2006 Share Posted December 24, 2006 Thatsgreat, I'm strongly advising you to tone it down a bit. Clearly you're getting on the nerves of a few of the regulars and I'm getting tired of your crap, too. You have a brain, use it. Try thinking before typing for once and see how that works out for you. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 24, 2006 Moderators Share Posted December 24, 2006 Oh goody... A "Kat" Fight!! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now