Welcome, guest! We are a creative arts/general discussion community, and welcome guests and members alike to participate in our discussions. While registration is not required to post, we strongly recommend considering an account with us, as it a quick, free, and easy way to fully utilize all of the features on our forum. We hope you enjoy your stay!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Universal Midi support via JavaScript in browsers
#1
So as a Cyber Historian I figured I'd share this here with everybody.

recently I've been troubled by something, see with midi support nearly non existent a lot of old websites and designs are silent now and it's really really unfortunate because one of the cool Ideas I had for my site was to setup Midi's to play as background music... only to find out that this wasn't really possible anymore.

UNTIL NOW

It is my wonderful pleasure to introduce you to Midi.js!

see this bit of javascript actually plays midi's for you, in your browser!

I've tested it on my tablet, my phone, linux, mac OSX, windows 8.1, windows 10, and windows XP.

all working without issues!

to set it up you need to include the following.

Put this in your header:
Code:
<link rel="stylesheet" href="style.css" type="text/css" media="all">
     <script type='text/javascript' src='http://www.midijs.net/lib/midi.js'></script>

Change your <body> tag to this:
Code:
<body onload="MIDIjs.play('Location of midi file')">


do these simple changes and you can play just about any midi file as your website's background music.

you can also change the top bit to link to a local variant of midi.js if you decide to, there's no issue there.

it's not perfect, I haven't gotten it to let me load custom soundfonts yet but I'm sure I'll figure it out in due time Tongue
[Image: oEirbE7.png]
Reply
Thanks given by: Guardian
#2
That's a way to do it! Nice one.
Reply
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
  Midi playback on websites in 2019 SpookyZalost 2 251 February 22nd, 2019 at 9:25 PM
Last Post: SpookyZalost
  SMF Support Forums Hacked That Punk Guy 12 10,519 July 26th, 2013 at 5:23 PM
Last Post: simlink



Users browsing this thread: 1 Guest(s)

Contact Us | Makestation | Return to Top | Lite (Archive) Mode | RSS Syndication
Proudly powered by MyBB 1.8, © 2002-2019 MyBB Group. Hosted by Ramnode.
Design/theme © 2014 by Makestaton designers.
All rights reserved.
Also see Chatcave chat hosting (owned by us), Forumonic.com (a Harry-K community) and Zalost's Gridzone