Search
Sponsors

Archive for the ‘music/sound’ Category

Changing Image - Click Sound

Saturday, January 10th, 2009

Put this part in the <head></head> tag.

You can change the  IMAGE FILE OFF, IMAGE FILE ON, and YOUR LINK LOCATION
<script language=”JavaScript”>
// Created by Parmjit (parmjit.sandhu@mailcity.com)
if ((navigator.appVersion.indexOf(”3.”) != -1) && (navigator.appName.indexOf(”Explorer”) != -1)){
check = false;}
else {
check = true;}
if (navigator.appName.indexOf(”Explorer”) != -1){
noplay = false;}
else {
noplay = true;}
image1= new Image();
image1.src = “IMAGE FILE OFF”;
image1on = new Image();
image1on.src = “IMAGE FILE ON”;

function imageon(name)   {
document[name].src = eval(name + “on.src”);
}
function imageoff(name)  {
document[name].src = eval(name + “.src”);
}

function on(name)  {
if (check == true){
imageon(name);
}
}
function off(name)  {
if (check == true){
imageoff(name);
}
}

function startTime(){
document.sound.play();
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;
closeTime+=1;
Timer();
}

function Timer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
location = “YOUR LINK LOCATION”}
else{
window.setTimeout(”Timer()”,1000)}
}
</script>

Now put this where ever you want you image to go.
<EMBED SRC=”YOUR SOUND FILE” autostart=false HIDDEN=TRUE NAME=”sound” MASTERSOUND>
<a href=”" onmouseover=”on(’image1′);” onmouseout=”off(’image1′)” onClick=”startTime(); return false;”><img src=”YOUR IMAGE OFF”  border=”0″ name=”image1″></a>

Random midi

Friday, January 9th, 2009

Insert into the <body> section and remember and change the midi file names

<SCRIPT>
// var nummidi is the number of MIDIs you will be using

var nummidi = 5
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*nummidi + 1,10)

if (ran == (1))   
midi=(”YOUR.mid”)
if (ran == (2))
midi=(”YOUR.mid”)
if (ran == (3))
midi=(”YOUR.mid”) 
if (ran == (4))
midi=(”YOUR.mid”) 
if (ran == (5))      
midi=(”YOUR.mid”) 

document.write(’<EMBED SRC= “‘ + midi + ‘” Autostart=true hidden=true loop=true>’)
document.write(’<BGSOUND SRC= “‘ + midi + ‘”  Autostart=true hidden=true loop=true>’)

</SCRIPT>

cd midi

Friday, January 9th, 2009

<Script Language=”JavaScript”>
song = new Array()
var x = 0

song[1] = “   Songname # 1″
song[2] = “   Songname # 2″
song[3] = “   Songname # 3″
song[4] = “   Songname # 4″
song[5] = “   Songname # 5″
song[6] = “   Songname # 6″

function prev(){
if (x>1)
{ x–
document.midi.typein.value=song [x]
}
}

function next(){
var max= song.length-1
if (x<max)
{ x++
document.midi.typein.value=song [x]
}
}

function go(){
if (x != 0){
location.href=’your midi in here.mid’
}
}

function start(){
x=1
document.midi.typein.value=song [x]
}

function end(){
x=song.length-1
document.midi.typein.value=song [x]
}

function cls(){
document.midi.typein.value=”  Select A Midi Song”
}
// Done Hiding –>

</Script>

<FORM Name=”midi”>
<INPUT NAME=”typein” TYPE=”text” SIZE=”25″ ALIGN=top><BR><!– You can change the size of the textbox if you need–>
<font size=2 face=”Helvetica”>
<INPUT TYPE=Button Value=”|<<” Align=center onclick=”start()”><INPUT TYPE=Button Value=”<<” Align=center onclick=”prev()”><INPUT TYPE=Button Value=”PLAY” Align=center onclick=”go()”><INPUT TYPE=Button Value=”>>” Align=center onclick=”next()”><INPUT TYPE=Button Value=”>>|” Align=center onclick=”end()”></FORM></font>

<body onload=”cls()”>

Random Midi

Friday, January 9th, 2009

Paste this into the <body> section

<script language=”Javascript”>
<!–
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var currentdate = 0
var theranmidi = ” ”
var core = 0

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ‘ ‘

  }
}

midi = new StringArray(10)
midi[0] = ‘midi1.mid’
midi[1] = ‘midi2.mid’
midi[2] = ‘midi3.mid’
midi[3] = ‘midi4.mid’
midi[4] = ‘midi5.mid’
midi[5] = ‘midi6.mid’
midi[6] = ‘midi7.mid’
midi[7] = ‘midi8.mid’
midi[8] = ‘midi9.mid’
midi[9] = ‘midi10.mid’

ran = 60 / midi.length
 
function ranmidi() {
  currentdate = new Date()
  core = currentdate.getSeconds()
  adcore = Math.floor(core/ran)
  core = adcore
    theranmidi = midi[core]
    return (theranmidi)
}

document.write(”RANDOM MIDI IS: <b>”+ranmidi()+”</b><br><br>”
+”<EMBED src=”+ranmidi()+” Width=200 Height=55 autostart=true hidden=true>”)

//–>
</script>

Mouseover Sound

Friday, January 9th, 2009

insert this into the <BODY> section

<script LANGUAGE=”JavaScript”><!–
var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = “sound1.wav”;
aySound[1] = “sound2.wav”;
// DO NOT edit below this line
IE = (navigator.appVersion.indexOf(”MSIE”)!=-1 && document.all)? 1:0;
NS = (navigator.appName==”Netscape” && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = “<DIV ID=’auEmb’ STYLE=’position:absolute;’></DIV>”;
document.body.insertAdjacentHTML(”BeforeEnd”,Str);
}
var Str = ”;
for (i=0;i<aySound.length;i++)
Str += “<EMBED SRC=’”+aySound[i]+”‘ AUTOSTART=’FALSE’ HIDDEN=’TRUE’>”
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:”;
else eval(”this.document.embeds[whSound].” + (play? “play()”:”stop()”))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//–></script>
<a href=”#” onMouseOver=”playSound(0)” onMouseOut=”stopSound(0)”>sound 1</a>
<a href=”#” onMouseOver=”playSound(0)” onMouseOut=”stopSound(0)”>sound 2</a>

Translate