Topic: Javascript chould dynamicly generate MIDI (Quicktime needed, not for IE again) (Page 1 of 1) |
|
---|---|
Obsessive-Compulsive (I) Inmate From: |
posted 10-22-2008 20:46
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>
|
Paranoid (IV) Inmate From: Norway |
posted 10-22-2008 21:01
Javascript can generate absolutely ANYTHING. |
Paranoid (IV) Inmate From: schillmania.com |
posted 10-23-2008 00:48
^ Yes, you should! |
Nervous Wreck (II) Inmate From: |
posted 10-23-2008 10:17
Spammer. Please cease existing. |
Paranoid (IV) Inmate From: schillmania.com |
posted 11-16-2008 18:35
"The man in blue" has a nifty JS+QuickTime drum machine, JS-909 demo based on feeding data: URIs to QT - it actually seems to work pretty well. |
Nervous Wreck (II) Inmate From: |
posted 05-31-2011 11:10
Edit TP: spam removed
|