/    Sign up×
Community /Pin to ProfileBookmark

little help with embedded midi files plz?

I’ve got this script for playing midi, where i can change the background of the midi player. But I also have this script for a random midi to play everytime the page is refreshed. Does anyone know how I can combine the two? I want to be able to play random midis, yet retain the ability to customise the background, and do away with the console’s controls (in this instance, Quicktime). Can anyone help? The codes are below.

[B]Midi player with customised background:[/B]

[CODE]<script> function stoperror(){ return true } window.onerror=stoperror </script><center><div style=visibility:hidden;position:absolute;top;>
<OBJECT ID=mp classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 type=application/x-oleobjectcodebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112 width=1 height=1>
<PARAM NAME=AutoRewind VALUE=true>
<PARAM NAME=Balance VALUE=0>
<PARAM NAME=AutoStart VALUE=true>
<PARAM NAME=ShowDisplay VALUE=false>
<PARAM NAME=ShowControls VALUE=false>
<PARAM NAME=ShowTracker VALUE=flase>
<PARAM NAME=PlayCount VALUE=0>
<PARAM NAME=FileName VALUE=”InuPics/Music/TokiOKoeruOmo01.mid”>
</OBJECT></div><table border=0 id=midi oncontextmenu=”return false” onselectstart=”return false” ondragstart=”return false” background=InuPics/Music/MidiPlayer01.gif width=108 height=55><tr>
<td style=”padding-left:4px; padding-top:27px;”>
<div style=height:20; width:50″>
<input type=button value=4 style=”font-size: 8pt; font-family: webdings; color:#588460; background:; border:0px none;cursor:hand” ONCLICK=mp.Play()><input type=button value=; style=”font-size: 8pt; font-family: webdings; color:#588460; background:; border:0px none;cursor:hand” ONCLICK=mp.Pause()><input type=button value=”<” style=”font-size: 8pt; font-family: webdings; color:#588460; background:; border:0px none;cursor:hand” ONCLICK=mp.Stop()></div>[/CODE]

[B]Random midi player[/B]

[CODE]<SCRIPT LANGUAGE=”JavaScript”>
// Courtesy of SimplytheBest.net – http://simplythebest.net/scripts/
<!– Begin
nummidi = 3
day = new Date()
z = day.getTime()
y = (z – (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*nummidi,10) + 1
if (x == (1))
midi=(“midi_1.mid”)
if (x == (2))
midi=(“midi_2.mid”)
if (x == (3))
midi=(“midi_3.mid”)
document.write(‘<EMBED SRC= ‘ + midi + ‘ autostart=true loop=true ‘)
document.write(‘volume=100 align=”center” width=50 height=25 controls=smallconsole>’)
// End –>
</SCRIPT>[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KarterJKAug 30.2005 — to change the button colors:

where color=#588460

just change it to the HEX color value you want

or use simple tags

color=red;

color=aqua;

color=orange;

etc

for each button

The OBJECT CODE is placed in the body along with its script




<body>

<script...blah blah blah></script>

<OBJECT ......blah blah>

<input type=button value=4 style="font-size: 8pt; font-family: webdings; color:#588460; background:; border:0px none;cursor:hand" ONCLICK=mp.Play()>

<input type=button value=; style="font-size: 8pt; font-family: webdings; color:#588460; background:; border:0px none;cursor:hand" ONCLICK=mp.Pause()>

<input type=button value="<" style="font-size: 8pt; font-family: webdings; color:#588460; background:; border:0px none;cursor:hand" ONCLICK=mp.Stop()></div>

</OBJECT>

</body>

[/QUOTE]

and the other (random player script) you put the script in between the head html

<html>

<head>

<title></title>

<script the random player script>

</script>

</head>

if that makes sense

and is what you want?
Copy linkTweet thisAlerts:
@PhoniqueauthorAug 31.2005 — Thanks for helping, but somehow, it didn't turn out right. I tried it out and ended up with two players, with the random midi player not working. My original player has a customisable bkg, where I can put an image as the background, instead of just colours. but the random midi player is just a quicktime console player. When I put those two together as you said, the random midi player says that an error has occured.

Thanks for you help tho! I'll see if I can fiddle around with it and get it to work somehow. ?
×

Success!

Help @Phonique spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...