scriptomator Posted October 21, 2010 Share Posted October 21, 2010 (edited) So.What do you think expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <String.au3> $SlidePitchRadioMin = 6001 $SlidePitchRadioMax = 12000 #Region ### START Koda GUI section ### Form= $Form1_1 = GUICreate("Sound Generator", 926, 275, -1, -1) $MenuItem1 = GUICtrlCreateMenu("&File") $MenuItem3 = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("Help") $MenuItem4 = GUICtrlCreateMenuItem("About", $MenuItem2) $Button1 = GUICtrlCreateButton("Generate", 144, 8, 648, 65, $WS_GROUP) $Slider1 = GUICtrlCreateSlider(0, 144, 924, 37) GUICtrlSetLimit(-1, $SlidePitchRadioMax, $SlidePitchRadioMin) GUICtrlSetData($Slider1, 9000.5) $Slider2 = GUICtrlCreateSlider(0, 208, 924, 45) GUICtrlSetLimit(-1, 4000, 0) GUICtrlSetData($Slider2, 500) $Label1 = GUICtrlCreateLabel("Pitch", 0, 125, 924, 17, BitOR($SS_CENTER,$SS_SUNKEN)) GUICtrlSetBkColor(-1, 0x99B4D1) $Label2 = GUICtrlCreateLabel("Duration 0-4 seconds", 0, 184, 924, 17, BitOR($SS_CENTER,$SS_SUNKEN)) GUICtrlSetBkColor(-1, 0x3399FF) $Radio1 = GUICtrlCreateRadio("Low pitch", 344, 96, 65, 25) $Radio2 = GUICtrlCreateRadio("Medium Pitch", 416, 96, 81, 25) GUICtrlSetState($Radio2, $GUI_CHECKED) $Radio3 = GUICtrlCreateRadio("High Pitch", 504, 96, 65, 25) $Label3 = GUICtrlCreateLabel(GUICtrlRead($Slider1) & " Hz", 16, 48, 76, 17, BitOR($SS_CENTER,$SS_SUNKEN)) $Label4 = GUICtrlCreateLabel("0.500 Sec", 16, 96, 76, 17, BitOR($SS_CENTER,$SS_SUNKEN)) $Frequency = GUICtrlCreateLabel("Frequency", 16, 24, 70, 17, $SS_CENTER) $Seconds = GUICtrlCreateLabel("Seconds", 16, 72, 78, 17, $SS_CENTER) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### HotKeySet("{END}","abort") While 1 $Msg = GUIGetMsg() Select Case $Msg = $Slider1 GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz") Case $Msg = $Slider2 $READ = GUICtrlRead($Slider2) If $READ = 0 Then GUICtrlSetData($Label4,"0.000 Sec") ElseIf $READ < 10 Then GUICtrlSetData($Label4,"0.00" & GUICtrlRead($Slider2) & " Sec") ElseIf $READ < 100 Then GUICtrlSetData($Label4,"0.0" & GUICtrlRead($Slider2) & " Sec") ElseIf $READ < 1000 Then GUICtrlSetData($Label4,"0." & GUICtrlRead($Slider2) & " Sec") Else $READ = String(GUICtrlRead($Slider2)) $READ1 = _StringInsert($READ, ".", -3) GUICtrlSetData($Label4,$READ1 & " Sec") EndIf Case $Msg = $GUI_EVENT_CLOSE Exit Case $Msg = $MenuItem3 Exit Case $Msg = $MenuItem4 MsgBox(32,"About Sound Generator","Version 1.00" & @crlf & "Made By: Scriptomator") Case $Msg = $Button1 Beep(GUICtrlRead($Slider1),GUICtrlRead($Slider2)) Case $Msg = $Radio1 $SlidePitchRadioMin = 1 $SlidePitchRadioMax = 6000 GUICtrlSetLimit($Slider1, $SlidePitchRadioMax, $SlidePitchRadioMin) GUICtrlSetData($Slider1, 3000.5) GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz") Case $Msg = $Radio2 $SlidePitchRadioMin = 6001 $SlidePitchRadioMax = 12000 GUICtrlSetLimit($Slider1, $SlidePitchRadioMax, $SlidePitchRadioMin) GUICtrlSetData($Slider1, 9000.5) GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz") Case $Msg = $Radio3 $SlidePitchRadioMin = 12001 $SlidePitchRadioMax = 18000 GUICtrlSetLimit($Slider1, $SlidePitchRadioMax, $SlidePitchRadioMin) GUICtrlSetData($Slider1, 15000.5) GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz") EndSelect WEnd Func abort() exit EndFunc Edited October 21, 2010 by scriptomator Link to comment Share on other sites More sharing options...
jaberwacky Posted October 21, 2010 Share Posted October 21, 2010 I still have good ears! I can hear 20,000hz. I have a fine pair of loudspeakers too. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
pierrotm777 Posted October 21, 2010 Share Posted October 21, 2010 Cool, I like:shifty: 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