
Variable Numeric Frequency = 100
Variable Numeric Duration = 52

Key Space Gosub PlayBeep
Key Up Gosub KeyUp
Key Down Gosub KeyDown
Key Left Gosub KeyLeft
Key Right Gosub KeyRight

Print Frequency + " " + Duration

For v1 = 1 To 10000
	PlayBeep
	Wait Seconds 0.05
Next

Stop

' -------------------------------- Play Beep
Label PlayBeep
	Beep Frequency Duration
	Print Frequency + " " + Duration
	Wait Seconds duration / 1000
Return

' -------------------------------- Keys
Label KeyUp
	Delta = 1
	ChangeFrequency
Return

Label KeyDown
	Delta = -1
	ChangeFrequency
Return

Label KeyLeft
	Delta = -1
	ChangeDuration
Return

Label KeyRight
	Delta = 1
	ChangeDuration
Return

' -------------------------------- Modify delta
Variable Numeric Delta

Label ChangeFrequency
	ModifyDelta
	Frequency = Frequency + Delta
Return

Label ChangeDuration
	ModifyDelta
	Duration = Duration + Delta
Return

Label ModifyDelta
	If Key("shift")
		Delta = Delta * 100
	EndIf
	If Key("ctrl")
		Delta = Delta * 10
	EndIf
Return


