Page 1 of 1 1
Topic Options
#109101 - 2003-11-27 02:25 PM Christmas jingle
Mit Offline
Fresh Scripter

Registered: 2002-06-05
Posts: 36
Loc: Derby, UK
Does anyone have "We wish you a merry Christmas" or any other festive tune as a quick KiX jingle? I'm thinking of inflicting this on everyone as they log into the network on the final day of work this year

Top
#109102 - 2003-11-27 02:33 PM Re: Christmas jingle
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I just play them a WAV that I convert from MP3
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#109103 - 2003-12-02 04:34 AM Re: Christmas jingle
PaulMoxey Offline
Getting the hang of it

Registered: 1999-07-22
Posts: 90
Loc: Villawood, NSW, Australia
Hi folks... loooooong time no post.
I was just on the hunt for some new ASCI art for my modified Xmas login script and came across this thread.
I use the below to play random Xmas tunes. They' cut down version of the full thing so they're not too long.
There's probably quicker/easier methods but this has always worked well for me for the last 4 or 5 years!
The tunes came from kixspk.zip retrieved from kixtart.to all those years ago...

Code:

$Seed=@time ; 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
sleep 5
goto TheEnd
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


_________________________
Paul Moxey POS & Senior Network Administrator BarloworldCoatings (AUST) Pty Ltd

Top
#109104 - 2003-12-02 08:10 AM Re: Christmas jingle
NTDOC Administrator Offline
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
#109105 - 2003-12-03 04:47 PM Re: Christmas jingle
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
it is that time of the year again....

wow, i would love to have had these back when i wrote this little bit of code.

Top
#109106 - 2003-12-03 05:05 PM Re: Christmas jingle
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
why not change those if statement to a case...
select
case $song < 100
case $song < 200
case $song < 300
etc

you will not need the other half of the conditional as it it only do the first match...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#109107 - 2003-12-04 08:00 PM Re: Christmas jingle
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Okay... here is a modified version that uses the CASE as requested by Radimus.

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
Select
Case $SONG <= 100
play "0g256t 0g5d659f f f 0f 659f f f 0f 659f 784f 523f 587f 2g19d659f " ;Jingle Bells
Case $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...
Case $SONG <= 300
play "0g256t 1g10d1047f 0g7d988f 2d880f 2g14d784f 0g5d698f 1g10d659f 587f 2g14d523f 0g5d784f 2g14d880f
0g5df 2g14d988f 0g5df 2g20d1047f "
; Joy To The World
Case $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
Cae $SONG <= 500
play "0g256t 0g12d349f 4d392f 8d349f 24d294f 12d349f 4d392f 8d349f 24d294f 16d523f 1d0f 8d523f 24d440f
16d466f 1d0f 8d466f 24d349f"
; Silent Night
Case $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
Case $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
Case $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
Case $SONG <= 900
play "0g256t 0g6d392f 4d0f 18d392f 9d294f 392f 18d440f 294f 9d494f 440f 494f 523f 18d494f 9d440f"
; Oh come all ye faithful
Case $SONG > 900
play "0g256t 2g7d262f 1g5d349f 0g2df 1g5df 3d392f 5d440f 0g2df 3g10df 1g3df 392f 440f 2g7d466f 330f
392f 349f 1g3d0f"
; Oh Xmas tree
EndFunction

Top
#109108 - 2003-12-04 08:57 PM Re: Christmas jingle
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Doc,

Small error

Should be:
Case $SONG <= 500

Instead of:
Cae $SONG <= 500

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#109109 - 2003-12-09 09:29 PM Re: Christmas jingle
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Thanks Kent.

Yeah, I caught that on my co-workers system.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org