Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Florida
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Random Midi Script

    I searched the web for a script that would play MIDI files randomly or sequentially BUT without the need for the visitor to reload the page. I want the MIDI files to play automatically one after the other.

    Can someone suggest me one or direct me to a site where I could find one.
    Many Thanks for your kind help,
    Clem

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's a script which plays any number
    of random midi's one after another.


    <SCRIPT TYPE="text/javascript">
    /*************************************
    written by:WillyDuitt@hotmail.com
    http://www.angelfire.com/art/img/


    var numsong equals number of songs
    midi=(your song url)
    song=(your song title)
    time=(number of seconds song plays)
    URL=(your midiplayer addy)

    **************************************/

    var numsong=6
    play=Math.round(Math.random()*numsong)
    if (play == 1)
    {
    midi=("BlueJeans.mid")
    song=("Baby Got Her Bluejeans On")
    time=("200")
    }
    else if (play == 2)
    {
    midi=("BootSctn.mid")
    song=("Boot Scootin'")
    time=("200")
    }
    else if (play == 3)
    {
    midi=("GoodbyeEarl.mid")
    song=("GoodBye Earl")
    time=("250")
    }
    else if (play == 4)
    {
    midi=("HighwayMan.mid")
    song=("Highway Man")
    time=("180")
    }
    else if (play == 5)
    {
    midi=("Trouble.mid")
    song=("There's Your Trouble")
    time=("190")
    }
    else if (play == 6)
    {
    midi=("Wabash.mid")
    song=("Wabash Cannonball")
    time=("150")
    }

    document.write('<meta http-equiv="refresh" content="' + time + ';URL=http://YOUR MIDIPLAYER URL">');
    document.write('<EMBED SRC= "' + midi + '" HIDDEN="TRUE" AUTOSTART="TRUE" LOOP="FALSE" VOLUME="100%">');
    document.write('<br>Now Playing: ' + song + ' ');
    </SCRIPT>


    An example can be found here:
    http://transload.net/~cyberrite/Will...iPlayer3.shtml
    Last edited by Willy Duitt; 09-28-2003 at 07:21 PM.

  • #3
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Florida
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thanks Willy. This is what I was looking for. I will try it out this week. Have a good day.

    Clem

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your Welcome

    Let me know if you have any problems installing it. To prevent the page it appears on from "flashing" it should be put in a FRAME, IFRAME or external Javascript file.

    Also, it could probably use BGSOUND support but I wrote that a year or so ago before I knew any better.

    ....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •