/    Sign up×
Community /Pin to ProfileBookmark

Embedding a MIDI in a webpage

Okay, this is a little embarassing. I’ve forgotten how to embed a MIDI in an XHTML 1.0 webpage.

The player should be something viewers of my page can start, stop, or replay themselves as they please. I know–being a MIDI–I need to use an <object> element, but the file isn’t playing, so I must be doing something wrong!

The code for the object thus far is:
`
<div id=”Recording”>
<object id=”MIDI” type=”audio/midi” width=”100″ height=”100″ data=”./Recordings/MIDIs/puzzpal2.mid”>
<param name=”filename” value=”./Recordings/MIDIs/puzzpal2.mid” />
<param name=”autostart” value=”false” />
<param name=”loop” value=”false” />
</object>
</div>

`

to post a comment

8 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 14.2020 — I won't be much help: I've forgotten how to do _anything_ in a XHTML 1.0 webpage. ;) :P
Copy linkTweet thisAlerts:
@HarshShahSep 15.2020 — @Mr_Initial_Man#1623275

Please refer to the below link for your better understanding.

[http://w3schools.sinsixx.com/media/media_browsersounds.asp.htm](url)

[https://www.tutorialspoint.com/html/html_embed_multimedia.htm](url)

[http://www.angelfire.com/fl5/html-tutorial/music.htm](url)
Copy linkTweet thisAlerts:
@SempervivumSep 15.2020 — This subject is discussed here:

https://stackoverflow.com/questions/5662293/how-to-play-a-midi-file-in-html

I had the same task some time ago and converted the midi file to mp3 so that I was able to use the standard audio tag.

Web Audio API would be fine, however browser support is insufficient at this time.
Copy linkTweet thisAlerts:
@Mr_Initial_ManauthorSep 15.2020 — @NogDog#1623277 If that's a suggestion to finally upgrade to HTML5, the answer is no. HTML5 does not exist in my coding world. 😛

I ended up doing something similar: I created the MIDIs using a music-writing program (Finale 2011, if you're curious), that allows me to "Save As" a MIDI file--but also had the capability to export the file into another audio format (I used MP3s).
Copy linkTweet thisAlerts:
@ralf98Sep 21.2020 — maybe try what the other user said, you know, converting midi to mp3?
Copy linkTweet thisAlerts:
@Mr_Initial_ManauthorOct 05.2020 — @ralf98#1623483 Look at my post above yours.
Copy linkTweet thisAlerts:
@cootheadOct 05.2020 — Hi there Mr_Initial_Man,

you may find this link...

[url=https://html.com/media/midi/][u][color=navy]Midi Files – Here’s What To Do When You Can’t Download Them[/color][/u][/url]

...to be helpful to you. ;)

Of course, it will not enable visitors to your site to hear them.

[i]coothead[/i]
Copy linkTweet thisAlerts:
@VITSUSAOct 06.2020 — I agree with coothead, this is good source to understand the problem with solution.
×

Success!

Help @Mr_Initial_Man 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 4.25,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...