On Thu, Apr 19, 2012 at 6:10 PM, Matt Diamond
Has anyone had any experience with using ChucK in a web context? For example, two things I'd be interested in as a web developer:
1) streaming ChucK audio output from a NodeJS server to the browser 2) a javascript client-side ChucK implementation utilizing the Web Audio API
Has there been any work on either of these?
Links to these projects came up on the TOPLAP mailing list (worth subscribing and perhaps asking there too): http://livecoder.net/ http://www.charlie-roberts.com/gibber/ Some friends from undergrad made a collaborative browser-based ChucK editor that sounds like Noah's, though theirs was also not published. Someone should release something! At any rate, I've found the JavaScriptAudioNode interface to be fairly friendly and somewhat performant: https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html This experiment of mine works pretty well on my computer, though for some reason falls over on Windows without a much wider window size that kills interactivity: http://people.csail.mit.edu/tl/vocal/ http://people.csail.mit.edu/tl/vocal/audio.js It's a port of this ChucK script designed for joystick control: http://smelt.cs.princeton.edu/pieces/JoyOfChant/JoyOfChant.ck Anyway, running a virtual machine on top of Javascript in the audio callback would probably not work, but if you could compile the code to Javascript then you ought to be able to get away with a lot. Maybe extend CoffeeScript? (The only reason you'd want the compile step at all is that there's no easy way to emulate ChucK's syntax for yielding time because Javascript lacks continuation support in most implementations.) -- Tom Lieber http://AllTom.com/ http://infinite-sketchpad.com/