#109104 - 2003-12-02 08:10 AM
Re: Christmas jingle
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Hey Paul... pretty cool for this time of season. I forgot all about the speak files. Haven't played with them since probably this time last year.
I modified your code some. Took out the GOTO and removed the SLEEP also set the SEED to @MSecs and wrapped it into a function for easier use.
Debug Off Break On Dim $iRC $iRC=SetOption('Explicit','ON') $iRC=SetOption('NoVarsInStrings','ON')
PlayChristmasTunes()
Function PlayChristmasTunes() Dim $Seed,$Song $Seed=@MSecs ; Default a value that will almost always be different $Seed=substr($Seed, len($Seed)-1, 2) ; Now use the seconds... srnd(1+$seed) ; Insert seed randomiser $Song = RND(100) ; the first is always 0 $SONG = RND(1000) ; Pick a random number between 1 and 1000 if $SONG <= 100 play "0g256t 0g5d659f f f 0f 659f f f 0f 659f 784f 523f 587f 2g19d659f " ;Jingle Bells endif if $SONG > 100 and $SONG <= 200 play "0g256t 1g11d587f 0g4d523f 1g7d494f 440f 392f 440f 494f 392f 0g4d440f 494f 523f 440f 1g11d494f 0g4d0f 440f 1g7d392f 370f 11d392f 0g4d0f " ; Deck the halls... endif if $SONG > 200 and $SONG <= 300 play "0g256t 1g10d1047f 0g7d988f 2d880f 2g14d784f 0g5d698f 1g10d659f 587f 2g14d523f 0g5d784f 2g14d880f 0g5df 2g14d988f 0g5df 2g20d1047f " ; Joy To The World endif if $SONG > 300 and $SONG <= 400 play "0g256t 0g4d262f f 1g7df 0g4d349f f 1g7df 0g4d330f 349f 392f 440f 466f 392f 1g11d440f 0g4d466f 1g7d523f 0g4d587f 466f 440f 349f 1g7d392f 3g22d349f" ; Twelve Days of Xmas endif if $SONG > 400 and $SONG <= 500 play "0g256t 0g12d349f 4d392f 8d349f 24d294f 12d349f 4d392f 8d349f 24d294f 16d523f 1d0f 8d523f 24d440f 16d466f 1d0f 8d466f 24d349f" ; Silent Night endif if $SONG > 500 and $SONG <= 600 play "0g256t 0g5d659f 587f 2g14d523f 0g5d587f 659f 698f 2g20d784f 0g5d880f 988f 1g10d1047f 988f 880f 2g20d784f 0g5d880f 988f 1g10d1047f 988f 880f 784f 880f 988f 1047f 784f 698f 2g20d659f" ; The First Noel endif if $SONG > 600 and $SONG <= 700 play "0g256t 0g5d523f 698f 2df 784f 698f 659f 5d587f f f 784f 2df 880f 784f 698f 5d659f 523f f 880f 2df 932f 880f 784f 5d698f 587f 2d523f f 5d587f 784f 659f 1g10d698f" ; We wish you a merry Xmas endif if $SONG > 700 and $SONG <= 800 play "0g256t 1g10d494f 0g5d440f 1g10d392f 0g5d330f 370f 392f 370f 1g10d330f 0g5d0f 1g10d494f 0g5d440f 1g10d392f 0g5d330f 370f 392f 370f 1g10d330f 0g5d0f" ; We 3 Kings endif if $SONG > 800 and $SONG <= 900 play "0g256t 0g6d392f 4d0f 18d392f 9d294f 392f 18d440f 294f 9d494f 440f 494f 523f 18d494f 9d440f" ; Oh come all ye faithful endif if $SONG > 900 play "0g256t 2g7d262f 1g5d349f 0g2df 1g5df 3d392f 5d440f 0g2df 3g10df 1g3df 392f 440f 2g7d466f 330f 392f 349f 1g3d0f" ; Oh Xmas tree endif EndFunction |
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 764 anonymous users online.
|
|
|