
PlaySong1
'PlaySong2

Stop

Label PlaySong1
	s1 = "Do Re Mi Do P1 Do Re Mi Do P1 "
	s1 = s1 + "Mi Fa Sol P1 Mi Fa Sol P1 "
	s1 = s1 + "Sol La Sol Fa Mi Do P1 "
	s1 = s1 + "Sol La Sol Fa Mi Do P1 "
	s1 = s1 + "Re P1 Sol3 P1 Do P2 "
	s1 = s1 + "Re P1 Sol3 P1 Do P2 "
	DecodeSong(s1)
Return

Label PlaySong2
	Load s1 "HappyBirthday.txt"
	DecodeSong(s1)
Return

Label DecodeSong
	Variable String NF1
	Variable String NF2
	Variable Numeric NF3
	For NF3 = 0 To GetSeparatedStringCount(NF1)
		NF2 = GetSeparatedString(NF1, NF3)
		Select NF2
			Case "Sol3"
				PlayNote(196.00)
				
			Case "Do"
				PlayNote(261.63)
			Case "Do#"
				PlayNote(277.18)
			Case "Re"
				PlayNote(293.66)
			Case "Re#"
				PlayNote(311.13)
			Case "Mi"
				PlayNote(329.63)
			Case "Fa"
				PlayNote(349.23)
			Case "Fa#"
				PlayNote(369.99)
			Case "Sol"
				PlayNote(392.00)
			Case "Sol#"
				PlayNote(415.30)
			Case "La"
				PlayNote(440.00)
			Case "La#"
				PlayNote(466.16)
			Case "Si"
				PlayNote(493.88)
			Case "P1"
				Wait Seconds 0.1
			Case "P2"
				Wait Seconds 0.2
			Case "P3"
				Wait Seconds 0.3
		EndSelect
	Next
Return

Label PlayNote
	Variable Numeric PN1
	'Slot(1) = PN1
	Beep PN1 400
	Wait Seconds 0.4
Return


