So I've finally set up a VPS, installed timidity and lame and everything works like charm. Results here: yesmaestro.com
Cross-platform MIDI in the website
-
25-07-2022 - |
Question
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. It saves the MIDI file and the user should play it. Here, the funny part begins.
Problems:
- I have to use MIDI, because the exercises are created on-the-fly with random errors.
- 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). 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.
What I tried:
<embed>
and<object>
- this way you let browser choose the plugin. It's inconsistent and you lose most control over the playback (not mentioning the visual side)<audio>
- doesn't support MIDI at allQuickTime 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.
Question:
Is there any other approach/technology I could use?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow