Je viens de faire un Piano BEEP, en 1 heure. Pareil que DJSIR, mais avec les demis-tons.
► Afficher le texteCode de Piano BEEP
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\autoit\piano beep.lxf
$Form1 = GUICreate("Piano Beep", 771, 576, 192, 124)
$Button2 = GUICtrlCreateButton("DO#", 64, 40, 67, 209, $WS_GROUP)
$Button3 = GUICtrlCreateButton("RE#", 152, 40, 67, 209, $WS_GROUP)
$Button4 = GUICtrlCreateButton("FA#", 359, 40, 67, 209, $WS_GROUP)
$Button5 = GUICtrlCreateButton("SOL#", 448, 40, 67, 209, $WS_GROUP)
$Button6 = GUICtrlCreateButton("LA#", 542, 40, 67, 209, $WS_GROUP)
$Button7 = GUICtrlCreateButton("DO", 32, 256, 75, 313, $WS_GROUP)
$Button8 = GUICtrlCreateButton("RE", 123, 255, 75, 313, $WS_GROUP)
$Button9 = GUICtrlCreateButton("MI", 220, 256, 75, 313, $WS_GROUP)
$Button10 = GUICtrlCreateButton("FA", 307, 254, 75, 313, $WS_GROUP)
$Button11 = GUICtrlCreateButton("SOL", 404, 252, 75, 313, $WS_GROUP)
$Button12 = GUICtrlCreateButton("LA", 494, 251, 75, 313, $WS_GROUP)
$Button13 = GUICtrlCreateButton("SI", 593, 253, 75, 313, $WS_GROUP)
$Button14 = GUICtrlCreateButton("DO", 679, 253, 75, 313, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Bienvenu(e) dans le piano electrique.", 72, 8, 167, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
If $nMsg = $Button2 Then Call("do2")
If $nMsg = $Button3 Then Call("re2")
If $nMsg = $Button4 Then Call("fa2")
If $nMsg = $Button5 Then Call("sol2")
If $nMsg = $Button6 Then Call("la2")
If $nMsg = $Button7 Then Call("do1")
If $nMsg = $Button8 Then Call("re")
If $nMsg = $Button9 Then Call("mi")
If $nMsg = $Button10 Then Call("fa")
If $nMsg = $Button11 Then Call("sol")
If $nMsg = $Button12 Then Call("la")
If $nMsg = $Button13 Then Call("si")
If $nMsg = $Button14 Then Call("do3")
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
#Region Touches Dièses
Func do2()
Beep(277, 500)
EndFunc ;==>do2
Func re2()
Beep(311, 500)
EndFunc ;==>re2
Func fa2()
Beep(375, 500)
EndFunc ;==>fa2
Func sol2()
Beep(425, 500)
EndFunc ;==>sol2
Func la2()
Beep(475, 500)
EndFunc ;==>la2
#EndRegion Touches Dièses
#Region Touches Normales
Func do1()
Beep(264, 500)
EndFunc ;==>do1
Func re()
Beep(297, 500)
EndFunc ;==>re
Func mi()
Beep(330, 500)
EndFunc ;==>mi
Func fa()
Beep(352, 500)
EndFunc ;==>fa
Func sol()
Beep(396, 500)
EndFunc ;==>sol
Func la()
Beep(440, 500)
EndFunc ;==>la
Func si()
Beep(495, 500)
EndFunc ;==>si
Func do3()
Beep(523.3, 500)
EndFunc ;==>do3
#EndRegion Touches Normales
Mais c'est toujours amusant
Alex1205