Search
Sponsors

Posts Tagged ‘midi’

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>

Translate