OZONE Asylum
Forums
DHTML/Javascript
Javascript chould dynamicly generate MIDI (Quicktime needed, not for IE again)
This page's ID:
30609
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
[code] <html> <head> <title>MIDI from Javascript using QuickTime</title> <!-- http://d.hatena.ne.jp/brazil/20071003/1191381382 --> </head> <body> <script type="text/javascript"> var MIDI_DATA = 'data:audio/midi,' + 'MThd%00%00%00%06%00%01%00%01%00%C0' + // ファイルヘッダ 'MTrk%00%00%00%0E' + // data length '%00%C0%05' + '%00%90%30%64' + '%70%30%00' + '%00%FF%2F%00'; var midi = document.body.appendChild(setAttributes(document.createElement('embed'), { src : MIDI_DATA, type : 'video/quicktime', controller : 'false', autoplay : 'true', loop : 'false', width : '1px', height : '1px' })); function setAttributes(elm, attrs){ for(var attr in attrs) elm.setAttribute(attr, attrs[attr]); return elm; } </script> </body></html> [/code] Credits: http://d.hatena.ne.jp/brazil/20071003/1191381382 video demo: http://vimeo.com/886342 Now we can chrunch midi using javascript, and playback using Quicktime. Great! I think this works on browsers both in Win/Linux/Mac, but again sadly IE does not support data: protocol. Tip: If you are using Quicktime Alternative, be sure to tick "Install plugin for Firefox/Mozilla/Netscape/Opera/Chrome" option when install QTAlt. [small](Edited by [url=http://www.ozoneasylum.com/user/6734]electronixtar[/url] on 10-22-2008 20:48)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »