
' ------------------------------------- Audio InOut devices
Button 1 Label Title0
Button Title0 Label "Audio InOut devices"
Button Title0 Color Green2
Button 2 Label "AudioIn random"
Button 3 Label "AudioOut random"
Button 4 Label "Open AudioIn"
Button 5 Label "Open AudioOut"
'
' ------------------------------------- Wave generators
Button 7 Label Title1
Button Title1 Label "Wave generators"
Button Title1 Color Green2
Button 8 Label Gen1_ON
Button 9 Label Gen1_OFF
Button 10 Label "Gen1_Wave random"
Button 11 Label "Gen1_Freq random"
Button 12 Label "Gen1_Db random"
Button 13 Label "Gen1_Pwm random"
'
' ------------------------------------- AudioIn scope
Button 17 Label Title2
Button Title2 Label "AudioIn scope"
Button Title2 Color Green2
Button 18 Label Negative ON
Button 19 Label Negative OFF
Button 20 Label Trigger ON
Button 21 Label Trigger OFF
Button 22 Label "Amplitude random"
Button 23 Label "Base Time random"
'
' ------------------------------------- FHT Bands
Button 25 Label Title3
Button Title3 Label "FHT Bands"
Button Title3 Color Green2
Button 26 Label "Bands random"
Button 27 Label AGC ON
Button 28 Label AGC OFF
Button 29 Label "OutSlot random"
'
' ------------------------------------- FHT Bands
Button 33 Label Title4
Button Title4 Label "FHT Bands"
Button Title4 Color Green2
Button 34 Label "MaxDB random"
Button 35 Label "MinDB random"
Button 36 Label "MaxFreq random"
Button 37 Label "MinFreq random"
Button 38 Label "Speed random"
Button 39 Label LogX ON
Button 40 Label LogX OFF
Button 41 Label LogY ON
Button 42 Label LogY OFF
'
' ------------------------------------- FHT Spectrum
Button 49 Label Title5
Button Title5 Label "FHT Spectrum"
Button Title5 Color Green2
Button 50 Label "_MaxDB random"
Button 51 Label "_MinDB random"
Button 52 Label "_MaxFreq random"
Button 53 Label "_MinFreq random"
Button 54 Label "_Speed random"
Button 55 Label _LogX ON
Button 56 Label _LogX OFF
Button 57 Label _LogY ON
Button 58 Label _LogY OFF
Button 59 Label "Window random"


' =============================================================
'  START AND STOP PROGRAM
' =============================================================
Variable Numeric Slot_Commands = 31
'Variable Numeric Slot_Responses = 32

Load Theremino_SlotViewer.exe
Window MinSize
Stop

Label EventStop
	For v1 = 0 To 128
		Button v1 Text ""
	Next
	Window Sizable
End


' =============================================================
'  SEND COMMAND (default timeout = 0.5 Sec)
' =============================================================
Label SendCommand
	Variable String SC1           '<-- Parameter Command-String
	SlotText Slot_Commands = SC1
	Variable Numeric SC2
	For SC2 = 0.1 To 0.5 Step 0.1 ' <-- 0.5 seconds timeout
		If SlotText(Slot_Commands) = ""
			Exit
		EndIf
		Wait Seconds 0.1
	Next
Return


' =============================================================
'  COMMANDS
' =============================================================

' ------------------------------------- Audio InOut devices
Label AudioIn Random
	SendCommand("AudioIn " + Int(Rnd * 4))
Return
Label AudioOut Random
	SendCommand("AudioOut " + Int(Rnd * 4))
Return
Label Open AudioIn
	SendCommand("OpenAudioIn")
Return
Label Open AudioOut
	SendCommand("OpenAudioOut")
Return

' ------------------------------------- Wave generators
Label Gen1_ON
	SendCommand("Gen1_ON")
Return
Label Gen1_OFF
	SendCommand("Gen1_OFF")
Return
Label Gen1_Wave random
	SendCommand("Gen1_Wave " + Int(Rnd * 5))
Return
Label Gen1_Freq random
	SendCommand("Gen1_Freq " + Int(Rnd * 20000))
Return
Label Gen1_Db random
	SendCommand("Gen1_Db " + (Int(Rnd * 120)-120))
Return
Label Gen1_Pwm random
	SendCommand("Gen1_Pwm " + Int(Rnd * 100))
Return

' ------------------------------------- AudioIn scope
Label Negative ON
	SendCommand("AudioIn_NegativeON")
Return
Label Negative OFF
	SendCommand("AudioIn_NegativeOFF")
Return
Label Trigger ON
	SendCommand("AudioIn_TriggerON")
Return
Label Trigger OFF
	SendCommand("AudioIn_TriggerOFF")
Return
Label Amplitude random
	SendCommand("Amplitude " + Int(Rnd * 13))
Return
Label Base Time random
	SendCommand("BaseTime " + Int(Rnd * 10))
Return

' ------------------------------------- FHT Spectrum bands
Label Bands random
	SendCommand("Bands " + Int(Rnd * 100))
Return
Label AGC ON
	SendCommand("Agc_ON")
Return
Label AGC OFF
	SendCommand("Agc_OFF")
Return
Label OutSlot random
	SendCommand("FirstOutSlot " + Int(Rnd * 99))
Return

' ------------------------------------- FHT Bands
Label MaxDB random
	SendCommand("BandsMaxDb " + (Int(Rnd * 120)-120))
Return
Label MinDB random
	SendCommand("BandsMinDb " + (Int(Rnd * 120)-120))
Return
Label MaxFreq random
	SendCommand("BandsMaxFreq " + (1000 + Int(Rnd * 20000)))
Return
Label MinFreq random
	SendCommand("BandsMinFreq " + Int(Rnd * 1000))
Return
Label Speed random
	SendCommand("BandsSpeed " + Int(Rnd * 99))
Return
Label LogX ON
	SendCommand("BandsLogX_ON")
Return
Label LogX OFF
	SendCommand("BandsLogX_OFF")
Return
Label LogY ON
	SendCommand("BandsLogY_ON")
Return
Label LogY OFF
	SendCommand("BandsLogY_OFF")
Return
'
' ------------------------------------- FHT Spectrum
Label _MaxDB random
	SendCommand("SpectrumMaxDb " + (Int(Rnd * 120)-120))
Return
Label _MinDB random
	SendCommand("SpectrumMinDb " + (Int(Rnd * 120)-120))
Return
Label _MaxFreq random
	SendCommand("SpectrumMaxFreq " + (1000 + Int(Rnd * 20000)))
Return
Label _MinFreq random
	SendCommand("SpectrumMinFreq " + Int(Rnd * 1000))
Return
Label _Speed random
	SendCommand("SpectrumSpeed " + Int(Rnd * 99))
Return
Label _LogX ON
	SendCommand("SpectrumLogX_ON")
Return
Label _LogX OFF
	SendCommand("SpectrumLogX_OFF")
Return
Label _LogY ON
	SendCommand("SpectrumLogY_ON")
Return
Label _LogY OFF
	SendCommand("SpectrumLogY_OFF")
Return
Label Window random
	SendCommand("SpectrumWindow " + Int(Rnd * 21))
Return


'BOOKMARKS 

'EDITEDLINES 19 1 22 2 25 3 26 4 27 5 28 6 29 7 30 8 160 9 157 10 

'WATCH SewTo_Speed
'EXEC Button 5 Text Button5
