从Javascript生成实时MIDI [英] Generate live MIDI from Javascript

查看:136
本文介绍了从Javascript生成实时MIDI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些研究,似乎Javascript和MIDI这些天并不顺利。谷歌表示至少如此。

I made some research and it seems that Javascript and MIDI are not going well together these days. At least so Google says.

如本主题所述:
在javascript中生成MIDI ,可以在Javascript或服务器端创建文件,并像播放普通文件一样播放。

As stated in this topic: generating MIDI in javascript, it is possible to create a file, either in Javascript or server-side, and play it like one would play a usual file.

但是,我真的希望能够发送个人midi事件,直播,因为这将是一个持续的用户交互。
我想我的计划B是创建一个Java小程序来实现这一点,但是我的应用程序将不再是纯HTML5。

But, I really would like to be able to send individual midi events, "live", as it would be a constant user interaction. I guess my plan B would be to create a Java applet that does this, but then my app wouldn't be pure HTML5 anymore.

我也听说过HTML5的音频支持目前并不出名,所以我也想知道,如果现在没有可用的解决方案,未来会有什么结果?

I also heard HTML5's audio support isn't famous right now, so I also wondered, if no solution is available now, what are the possible future outcomes?

谢谢。

推荐答案

查看 John Resig撰写的这篇博客文章。 (出于某种原因,Resig链接到的马里奥游戏在Firefox中播放,而不是Chrome或Safari;它值得调查原因。)

See the music embedding portion of this blog post by John Resig. (For some reason, the Mario game that Resig links to plays sound for me in Firefox but not Chrome or Safari; it'd be worth investigating why).

这个想法是您使用数据URI 在HTML文件中嵌入base64编码的数据版本本身。所以你可以编写Javascript来连续生成 MIDI格式中的数据,然后在base64中编码,然后将其注入HTML5 < audio> ; 元素

The idea is that you use a data URI to embed a base64 encoded version of your data within the HTML file itself. So you could write Javascript to continuously generate data in the MIDI format, then encode it in base64, and then inject it into an HTML5 <audio> element

这篇关于从Javascript生成实时MIDI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆