Re: Web Audio and Pro Sample Libraries

Hi Thom!

2013-09-27 08:04, TJ skrev:
> Greetings,
>
> Caught the amazing sounds of the Albion library by Spitfire yesterday. 
> Albion is packaged as a VSTi and I'm now wondering if there is anyway 
> to bridge between Web Audio and the world of VSTi? These very pro 
> sample libraries are top notch, it would be a shame if there is no way 
> to use them from Javascript.
>
> http://www.spitfireaudio.com/demos
>
> Cheers,
>
> Thom

Unfortunately, there's no simple way of running VST in JavaScript.

The problem is the architecture of VST plugins: they are compiled, 
binary DLLs that are intended to run as programs under a specific 
operating system (typically either Windows or Mac OS, and there are a 
bunch of Linux plugins too).

Actually, I once made an effort to make it possible to run Windows VST 
plugins under Linux (just as plain native VST plugins, nothing to do 
with browsers), but it's really complicated so I had to abandon the 
project...

For making a VST plugin work in JavaScript, I see two options:

1) If you have access to the source code (most VSTs are closed source, 
so this is big problem), you can either hand-translate the code to 
JavaScript, or use a C/C++-to-JavaScript compiler such as emscripten 
(https://github.com/kripken/emscripten). This would involve a lot of 
manual work for each plugin that you want to translate to JavaScript.

2) Make a Windows (or Mac) x86 emulator. It would have to emulate:
* An x86 CPU (preferrably using JIT-compilation of x86 instructions to 
some sort of JavaScript code). Similar to Fabrice Bellard's PC emulator: 
http://bellard.org/jslinux/tech.html.
* Huge parts of the Windows OS. This would basically be similar to 
porting Wine (http://www.winehq.org/) to JavaScript.

Pulling any of these off would be a real feat, but it's an enormous task 
that would take [insert arbitrarily long period here] to make a decent 
number of VST plugins work in JavaScript.

...and in any event, you'd find that the plugins would have fairly poor 
performance.

Instead I hope for another scenario: Once Web Audio gets some mainstream 
traction, I hope that we'll see a growing community of developers 
providing "plugins" for Web Audio. These could be implemented entirely 
in JavaScript, or they could make use of the existing building blocks in 
the Web Audio API.

/Marcus



-- 
Marcus Geelnard
Technical Lead, Mobile Infrastructure
Opera Software

Received on Friday, 27 September 2013 08:44:47 UTC