Use JACK to Record Web Audio Synths in Your DAW

16 Oct 2015

There are several interesting browser-based synths out there.  I wrote about some of them in my Web Audio/MIDI Synth Roundup post awhile back, and one very good synth is the VIKTOR-NV1 by Nikolay Tsenkov.

Wouldn't it be cool if you could take the audio output from a synth running in your browser and send it into your DAW for recording?  You can do just that using the JACK audio connection kit!

What is JACK?  It's like Audiobus for desktop systems, but more flexible because there's no need for apps to natively support JACK.  JACK acts as a sort of proxy that can intercept all the audio on your machine letting you route it between applications arbitrarily.  For example, rather than using your computer's default audio output and input, you could change the default audio device to JACK, which would let you send audio from, say, your web browser, to your DAW.

itunes-to-logic-using-jack An example from the JACK OSX manual of using JACK to route audio from iTunes into Logic. Unfortunately this doesn't work on OS X under Yosemite due to a bug.

In fact, the JACK OS X manual uses an example of taking the audio output from iTunes and routing it into Logic.  Sound too good to be true?  Well, it is. Sort of.  If you're running on Linux (then you're probably already familiar with JACK!) this works great.  Unfortunately, there is a long-standing known issue with JACK under OS X Yosemite (and likely El Capitan) that prevents JACK from being used as the system's default audio interface, which rules out a lot of interesting use cases.

From the GitHub issue report:

Jack OSX works on OS X 10.10 (so does the updated installer addressing the previous 64-bit issue), but the JackRouter system output device doesn't seem to work when selected under System Preferences -> Sound -> Output.

And from the JACK OS X user group:

Problem confirmed.

I did some tests yesterday but could not understand the reason (did not see any error message in the console for instance). My guess is that "once again"... Apple has changed the way default audio devices have to interact with the system (more exactly with the "coreaudiod" system deamon….), probably related to some more constrained "sandbox" or "security" reasons...

No idea how this can be solved, no idea when I'll find time to have a closer look…

Unfortunately, this makes JACK much less appealing for OS X users.  One user responded to the GitHub issue saying they were able to work around the problem using the Soundflower kernel extension, which lets you set Soundflower as the default audio device on OS X and you can configure Soundflower to use JACK as an output.  I'm reluctant to install kernel extensions on my machine so I'm not going to give this a try personally.  Hopefully one of the JACK OS X devs or someone from the community will step in to resolve the issue and breathe some new life back into JACK for OS X.

If you use Linux this approach will let you use browser-based instruments alongside your other virtual instruments, which might open up some new creative possibilities for the Web Audio and MIDI APIs.

And let me know if you have other ideas for integrating browser instruments with desktop DAWs.  I'd love to hear about other approaches.