简体   繁体   English

网站中的跨平台MIDI

[英]Cross-platform MIDI in the website

I'm creating an ear training website for musicians. 我正在为音乐家创建一个耳朵训练网站。 In PHP, it generates simple MIDI file with an error (out-of-tune tone) which the user has to correct. 在PHP中,它会生成简单的MIDI文件,并带有用户必须纠正的错误(音调过高)。 It saves the MIDI file and the user should play it. 它会保存MIDI文件,用户应该播放它。 Here, the funny part begins. 在这里,有趣的部分开始了。

Problems: 问题:

  • I have to use MIDI, because the exercises are created on-the-fly with random errors. 必须使用MIDI,因为这些练习是动态创建的,并带有随机错误。
  • I cannot convert it to mp3/ogg serverside since webhostings usually don't come with timidity and lame bundled (correct me if I'm wrong). 无法将其转换为mp3 / ogg服务器端,因为虚拟主机通常没有胆怯和la脚的捆绑(如果我错了,请纠正我)。 The site is gonna be non-profit (or very low-profit at best), so dedicated hosting is not an option. 该站点将是非营利性的(或充其量是非常微薄的利润),因此不能选择专用托管。
  • There are billions of possible combinations, so preparing one large audio file is not possible. 有数十亿种可能的组合,因此无法准备一个大的音频文件。
  • The playback should be cross-platform. 播放应该是跨平台的。
  • I would like to have control over the playback via JS. 通过JS控制播放。

What I tried: 我试过的

  • <embed> and <object> - this way you let browser choose the plugin. <embed><object> -通过这种方式,浏览器可以选择插件。 It's inconsistent and you lose most control over the playback (not mentioning the visual side) 这是不一致的,您无法完全控制播放(更不用说视觉效果了)

  • <audio> - doesn't support MIDI at all <audio> -完全不支持MIDI

  • QuickTime in combination with antique AC_QuickTime.js 1.2, which uses <embed> and <object> dynamically - but I don't want to annoy users with installing extra plugin. QuickTime与古董AC_QuickTime.js 1.2结合使用,后者动态使用<embed><object> -但我不想让用户安装额外的插件烦人。

Question: 题:

Is there any other approach/technology I could use? 我可以使用其他方法/技术吗?

So I've finally set up a VPS, installed timidity and lame and everything works like charm. 因此,我终于设置了VPS,安装了怯tim和la脚的系统,一切都变得魅力十足。 Results here: yesmaestro.com 结果在这里: yesmaestro.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM