Csound on the Web

Victor LAZZARINI and Edward COSTELLO and Steven YI and John FITCH Department of Music National University of Ireland Maynooth, Ireland, {[email protected], [email protected], [email protected], jpff@codemist.co.uk }

Abstract 2 Audio Technologies for the Web

This paper reports on two approaches to provide a The current state of audio systems for world- general-purpose audio programming support for web wide web applications is primarily based upon applications based on Csound. It reviews the cur- three technologies: Java1, Adobe Flash2, and rent state of web audio development, and discusses HTML5 Web Audio3. Of the three, Java is the some previous attempts at this. We then introduce oldest. Applications using Java are deployed via a Javascript version of Csound that has been crea- the web either as Applets4 or via Java Web ted using the Emscripten compiler, and discuss its Start5. Java as a platform for web applications features and limitations. In complement to this, we has lost popularity since its introduction, pri- look at a Native Client implementation of Csound, which is a fully-functional version of Csound running marily due to historically sluggish start-up ti- in Chrome and Chromium browsers. mes as well as concerns over security breaches. Also of concern is that major browser vendors have either completely disabled Applet loading Keywords or disabled them by default, and that NPAPI plugin support, with which the Java plugin for Music Programming Languages; Web Applications; browsers is implemented, is planned to be drop- ped in future browser versions6. While Java sees 1 Introduction strong support on the server-side and desktop, its future as a web-deployed application is te- The web browser has become an increasingly nuous at best and difficult to recommend for viable platform for the creation and distributi- future audio system development. on of various types of media computing appli- as a platform has seen large- cations[Wyse and Subramanian, 2013]. It is no scale support across platforms and across brow- surprise that audio is an important part of these sers. Numerous large-scale applications have be- developments. For a good while now we have be- en developed such as AudioTool7, Patchwork8, en interested in the possibilities of deployment and Noteflight9. Flash developers can choose to of client-side Csound-based applications, in ad- deploy to the web using the Flash plugin, as dition to the already existing server-side capa- well as use Adobe Air10 to deploy to desktop bilities of the system. Such scenarios would be and mobile devices. While these applications de- ideal for various uses of Csound. For instance, monstrate what can be developed for the web in Education, we could see the easy deployment of Computer Music training software for all le- 1http://java.oracle.com vels, from secondary schools to third-level in- 2http://www.adobe.com/products/flashruntimes. html stitutions. For the researcher, web applications 3 can provide an easy means of creating proto- http://www.w3.org/TR/webaudio/ 4http://docs.oracle.com/javase/tutorial/ types and demonstrations. Composers and me- deployment/applet/index.html dia artists can also benefit from the wide reach 5http://docs.oracle.com/javase/tutorial/ of the internet to create portable works of art. deployment/webstart/index.html In summary, given the right conditions, Csound 6http://blog.chromium.org/2013/09/ can provide a solid and robust general-purpose saying-goodbye-to-our-old-friend-npapi.html 7http://www.audiotool.com/ audio development environment for a variety of 8http://www.patchwork-synth.com uses. In this paper, we report on the progress 9http://www.noteflight.com towards supporting these conditions. 10http://www.adobe.com/products/air.html using Flash, the Flash platform itself has a Csound on the server is Oeyvind Brandtsegg’s number of drawbacks. The primary tools for VLBI Music 18, where Csound is running on the Flash development are closed-source, commer- server and publishes its audio output to an au- cial applications that are unavailable on Linux, dio stream that end users can listen to. A simi- though open source Flash compilers and IDEs lar architecture is found in [Johannes and To- do exist11. There has been a backlash against shihiro, 2013]. Since version 6.02, Csound also Flash in browsers, most famously by includes a built-in server, that can be activa- and Apple12, and the technology stack as a who- ted through an option on start up. The server le has seen limited development with the gro- is able to receive code directly through UDP wing popularity of HTML5. At this time, Flash connections and compile them on the fly. may be a viable platform for building audio ap- Using Csound server-side has both positives plications, but the uncertain future makes it dif- and negatives that should be evaluated for a ficult to recommend. project’s requirements. It can be appropriate to Finally, HTML5 Web Audio is the most re- use if the project’s design calls for a single audio cent of technologies for web audio applications. stream/Csound instance that is shared by all Examples include the “Recreating the sounds of listeners. In this case, users might interact with the BBC Radiophonic Workshop using the Web the audio system over the web, at the expen- Audio API” site13, Gibberish14, and WebPd15. se of network latency. Using multiple realtime Unlike Java or Flash, which are implemented Csound instances, as would be the case if there as browser plug-ins, the Web Audio API is a was one per user, would certainly be taxing for W3C proposed standard that is implemented by a single server and would require careful resour- the browser itself.16 Having built-in support for ce limiting. For multiple non-realtime Csound Audio removes the security issues and concerns instances, as in the case of NetCsound, multi- over the future of plug-ins that affect Java and ple jobs may be scheduled and batch processed Flash. However, the Web Audio API has limita- with less problems than with realtime systems, tions that will be explored further below in the though resource management is still a concern. section on Emscripten. An early project to employ client-side audio computation by Csound was described in [Casey 3 Csound-based Web Application and Smaragdis, 1996], where a sound and music Design description system was proposed for the rende- Csound is a music synthesis system that has ring of network-supplied data streams. A possi- roots in the very earliest history of computer bly more flexible way to use Csound in client- music. Csound use in Desktop and Mobile app- side applications, however, is to use the web lications has been discussed previously in [Laz- browser as a platform. Two attempts at this ha- zarini et al., 2012b], [Yi and Lazzarini, 2012], ve been made in the past. The first was the now- and [Lazzarini et al., 2012a]. defunct ActiveX Csound (also known as AXC- 19 Prior to the technologies presented this pa- sound) , which allowed embedding Csound into per, Csound-based web applications have em- a webpage as an ActiveX Object. This technolo- ployed Csound mostly on the server-side. For gy is no longer maintained and was only availa- example, NetCsound 17 allows sending a CSD ble for use on Windows with Internet Explo- file to the server, where it would render the rer. A second attempt was made in the Mobile project to disk and email the user a link to Csound Project[Lazzarini et al., 2012b], where a the rendered file when complete. Another use of proof-of-concept Csound-based application was developed with Java and deployed using Java 11http://www.flashdevelop.org/ Web Start, achieving client-side Csound use via 12http://www.apple.com/hotnews/ the browser. However, the technology required thoughts-on-flash/ special permissions to run on the client side and 13 http://webaudio.prototyping.bbc.co.uk/ required Java to be installed. Due to those issu- 14Available at https://github.com/ charlieroberts/Gibberish, discussed in [Roberts es and the unsure future of Java over the web, et al., 2013] 15https://github.com/sebpiq/WebPd 18http://www.researchcatalogue.net/view/55360/ 16http://caniuse.com/audio-api lists current brow- 55361 sers that support the Web Audio API 19We were unable to find a copy of this online, but one 17Available at http://dream.cs.bath.ac.uk/ is available from the CD-ROM included with [Boulanger, netcsound/, discussed in [ffitch et al., 2007] 2000] the solution was not further explored. semantic emulation in order to achieve the best The two systems described in this paper are execution performance [Zakai, 2011]. browser-based solutions that run on the client- Implementations of the C and C++ runti- side. The both share the following benefits: me libraries have been created for applicati- ons compiled with Emscripten. These allow pro- • Csound has a large array of signal proces- grams written in C/C++ to transparently per- sing opcodes made immediately available form common tasks such as using the file sys- to web-based projects. tem, allocating memory and printing to the con- • They are compiled using the same source sole. Emscripten allows a virtual filesystem to code as is used for the desktop and mo- be created using its FS library, which is used 21 bile version of Csound. They only require by Emscripten’s libc and libcxx for file I/O . recompiling to keep them in sync with the Files can be added or removed from the virtual latest Csound features and bug fixes. filesystem using Javascript helper functions. It is also possible to directly call C functions from • Csound code that can be run with the- Javascript using Emscripten22. These functions se browser solutions can be used on other must first be named at compile time so they platforms. Audio systems developed using are not optimised out of the resulting compi- Csound code is then cross-platform across led Javascript code. The required functions are the web, desktop, mobile, and embed- then wrapped using Emscripten’s cwrap functi- ded systems (i.e. Raspberry Pi, Beaglebo- on, and assigned to a Javascript function name. ne; discussed in [Batchelor and Wignall, The cwrap function allows many Javascript va- 2013]). Developers can reuse their audio co- riables to be used transparently as arguments to de from their web-based projects elsewhere, C functions, such as passing Javascript strings and vice versa. to functions which require the C languages const char array type. 4 Emscripten Although Emscripten can successfully compi- Emscripten is a a project created by Alon Za- le a large section of C/C++ code there are still kai at the Mozilla Foundation that compiles the a number of limitations to this approach due to assembly language used by the LLVM compi- limitations within the Javascript language and ler into Javascript [Zakai, 2011]. When used in runtime. As Javascript doesn’t support threa- combination with LLVM’s Clang frontend, Em- ding, Emscripten is unable to compile codeba- scripten allows applications written in C/C++ ses that make use of threads. Some concurrency or languages that use C/C++ runtimes to be is possible using web workers, but they do not run directly in web browsers. This eliminates share state. It is also not possible to directly im- the need for browser plugins and takes full ad- plement 64-bit integers in Javascript as all num- vantage of web standards that are already in bers are represented using 64-bit doubles. This common use. results in a risk of rounding errors being intro- In order to generate Javascript from C/C++ duced to the compiled Javascript when perfor- sourcecode the codebase is first compiled into ming arithmetic operations with 64-bit integers LLVM assembly language using LLVM’s Clang [Zakai, 2011]. frontend. Emscripten translates the resulting LLVM assembly language into Javascript, speci- 4.1 CsoundEmscripten fically an optimised subset of Javascript entitled CsoundEmscripten is an implementation of the asm.js. The asm.js subset of Javascript is inten- Csound language in Javascript using the Ems- ded as a low-level target language for compilers cripten compiler. A working example of Csoun- and allows a number of optimisations which are dEmscripten can be found at http://eddyc. 20 not possible with standard Javascript . Code github.io/CsoundEmscripten/. The compiled semantics which differ between Javascript and Csound library and CsoundObj Javascript class LLVM assembly can be emulated when accu- can be found at https://github.com/eddyc/ rate code is required. Emscripten has built-in CsoundEmscripten/. CsoundEmscripten con- methods to check for arithmetic overflow, si- gning issues and rounding errors. If emulation 21https://github.com/kripken/emscripten/wiki/ is not required, code can be translated without Filesystem-API 22https://github.com/kripken/emscripten/wiki/ 20http://asmjs.org/spec/latest/ Interacting-with-code sists of three main modules: buffer. It takes as its arguments: a pointer to the CsoundObj structure self, an integer • The Csound library compiled to Javascript inNumberFrames specifying the number using Emscripten. of samples to be copied, a pointer to a • A structure and associated functions writ- buffer containing the input samples named ten in C named CsoundObj implemented inputBuffer and a pointer to a destination on top of the Csound library that is com- buffer to copy the output samples named piled to Javascript using Emscripten. outputBuffer.

• A handwritten Javascript class also named Each of the other functions that use the Cso- CsoundObj that contains the public in- undObj structure simply wrap existing functi- terface to CsoundEmscripten. The Javas- ons present in the Csound C API. The relevant cript class both wraps the compiled Cso- functions are: undObj structure and associated functions, and connects the Csound library to the • csoundGetKsmps(csound) - This function Web Audio API. takes as its argument a pointer to an in- stance of Csound and returns the number 4.1.1 Wrapping the Csound C API for of specified audio frames per control sam- use with Javascript ple. In order to simplify the interface between the Csound C API and the Javascript class contai- • csoundGetNchnls(csound) - This functi- ning the CsoundEmscripten public interface, a on takes as its argument a pointer to an structure named CsoundObj and a number of instance of Csound and returns the num- functions which use this structure were created. ber of specified audio output channels. The structure contains a reference to the cur- • csoundGetNchnlsInput(csound) - This rent instance of Csound, a reference to Csound’s function takes as its argument a pointer input and output buffer, and Csound’s 0dBFS to an instance of Csound and returns the value. Some of the functions that use this struc- number of specified audio input channels. ture are: • csoundStop(csound) - This function takes • CsoundObj_new() - This function alloca- as its argument a pointer to an instance tes and returns an instance of the Csound- of Csound stops the current performance Obj structure. It also initialises an instan- pass. ce of Csound and disables Csound’s default handling of sound I/O, allowing Csound’s • csoundReset(csound) - This function ta- input and output buffers to be used direct- kes as its argument a pointer to an instance ly. of Csound and resets its internal memory and state in preparation for a new perfor- • CsoundObj_compileCSD(self, mance. filePath, samplerate, controlrate, buffersize) - This function is used • csoundSetControlChannel(csound, to compile CSD files, it takes as its name, val) - This function takes as its arguments: a pointer to the CsoundObj arguments: a pointer to an instance of structure self, the address of a CSD file Csound, a string given by name, and given by filePath, a specified sample rate number given by val, it sets the numerical given by samplerate, a specified control value of a Csound control channel specified rate given by controlrate and a buffer by the string name. size given by buffersize. The CSD file at The CsoundObj structure and associated the given address is compiled using these functions are compiled to Javascript using Em- arguments. scripten and added to the compiled Csound Ja- • CsoundObj_process(self, vascript library. Although this is not necessary, inNumberFrames, inputBuffer, keeping the compiled CsoundObj structure and outputBuffer) - This function copies functions in the same file as the Csound library audio samples to Csound’s input buffer makes it more convenient when including Cso- and copies samples from Csound’s output undEmscripten within web pages. 4.1.2 The CsoundEmscripten cessorNode and stops the audio process Javascript interface callback. If required this method also dis- The last component of CsoundEmscripten is the connects any audio inputs. CsoundObj Javascript class. This class provi- • addControlChannel(name, des the public interface for interacting with the initialValue) This method adds an compiled Csound library. As well as allocating object to a Javascript array that is used an instance of Csound this class provides me- to update Csound’s named channel values. thods for controlling performance and setting Each object contains a string value given the values of Csound’s control channels. Addi- by name, a float value given by initialValue tionally, this class interfaces with the Web Au- and additionally a boolean value indicating dio API, providing Csound with samples from whether the float value has been updated. the audio input bus and copying samples from Csound to the audio output bus. Audio I/O • setControlChannelValue(name, value) and the Csound process are performed in Javas- This method sets a named control channel cript using the Web Audio API’s ScriptProces- given by the string name to the specified sorNode. This node allows direct access to input number given by the value argument. and output samples in Javascript allowing au- • getControlChannelValue(name) This dio processing and synthesis using the Csound method returns the current value of a library. named control channel given by the string Csound can be used in any webpage by crea- name. ting an instance of CsoundObj and calling the available public methods in Javascript. The me- 4.1.3 Limitations thods available in the CsoundObj class are: Using CsoundEmscripten, it is possible to add Csound’s audio processing and synthesis capa- • compileCSD(fileName) This method ta- bilities to any web browser that supports the kes as its argument the address of a CSD Web Audio API. Unfortunately this approach file fileName and compiles it for perfor- of bringing Csound to the web comes with a mance. The CSD file must be present in number of drawbacks. Emscripten’s virtual filesystem. This me- Although Javascript engines are constant- thod calls the compiled C function Csoun- ly improving in speed and efficiency, running dObj compileCSD. It also creates a Script- Csound entirely in Javascript is a processor in- ProcessorNode instance for Audio I/O. tensive task on modern systems. This is especi- • enableAudioInput() This method enables ally troublesome when trying to run even mode- audio input to the web browser. When cal- rately complex CSD files on mobile computing led, it triggers a permissions dialogue in the devices. host web browser requesting permission to Another limitation is due to the design of allow audio input. If permission is gran- the ScriptProcessorNode part of the Web Au- ted, audio input is available for the running dio API. Unfortunately, the ScriptProcessorNo- Csound instance. de runs on the main thread. This can result in audio glitching when another process on the • startAudioCallback() This method main thread—such as the UI—causes a delay in connects the ScriptProcessorNode to the audio processing. As part of the W3Cs Web Au- audio output and, if required, the audio dio Spec review it has been suggested that the input. The ScriptProcessorNodes audio ScriptProcessorNode be moved off of the main processing callback is also started. During thread23. There has also been a resolution by each callback, if required, audio samples the Web Audio API developers that they will from the ScriptProcessorNodes input are make it possible to use the ScriptProcessorNo- copied into Csound’s input buffer and any de with web workers24. Hopefully in a future new values for Csound’s software channels version of the Web Audio API the ScriptPro- are set. Csound’s csoundPerformKsmps() cessorNode will be more capable of running the function is called and any output samples are copied into the ScriptProcessorNodes 23https://github.com/w3ctag/ output buffer. spec-reviews/blob/master/2013/07/WebAudio. md#issue-scriptprocessornode-is-unfit-for-purpose-section-15 • stopAudioCallback() This method dis- 24https://www.w3.org/Bugs/Public/show_bug.cgi? connects the current running ScriptPro- id=17415#c94 kind complex audio processing and synthesis ca- Csound, the pthread library. However, absent pabilities allowed by the Csound library. from the PNaCl toolchain are dlopen() and fri- This version of Csound also does not support ends, which means no dynamic loading is availa- plugins, making some opcodes unavailable. Ad- ble there. ditionally, MIDI I/O is not currently supported. Javascript client-side code is responsible for This is not due to the technical limitations of requesting the loading of a NaCl module. On- Emscripten, rather it was not implemented due ce the module is loaded, execution is controlled to the current lack of support for the WebMIDI through Javascript event listeners and messa- standard in Mozilla Firefox25 and in the Webkit ge passing. A postMessage() method is used by library26. Pepper to allow communication from Javascript to PNaCl module, triggering a message handler 5 Beyond Web Audio: Creating in the C/C++ side. In the opposite direction, a Audio Applications with PNaCl message event is issued when C/C++ code calls As an alternative to the development of audio the equivalent PostMessage() function. applications for web deployment in pure Javas- Audio output is well supported in Pepper cript, it is possible to take advantage of the Na- with a mid-latency callback mechanism (ca. 10- 27 tive Clients (NaCl) platform . This allows the 11ms, 512 frames at 44.1 or 48 KHz sampling use of C and C++ code to create components rate). Its performance appears to be very uni- that are accessible to client-side Javascript, and form across the various platforms. The Audio run natively inside the browser. NaCl is descri- API design is very straightforward, although the bed as a sandboxing technology, as it provides a library is a little rigid in terms of parameters. It safe environment for code to be executed, in an supports only stereo at one of the two sampling OS-independent manner [Yee et al., 2009][Sehr rates mentioned above). Audio input is not yet et al., 2010]. This is not completely unlike the available in the production release, but support use of Java with the Java Webstart Technology can already be seen in the development reposi- (JAWS), which has been discussed elsewhere in tory. relation to Csound [Lazzarini et al., 2012b]. The most complex part of NaCl is access to There are two basic toolchains in NaCl: nati- the local files. In short, there is no open access ve/gcc and PNaCl [Donovan et al., 2010]. Whi- to the client disk, only to sandboxed filesys- le the former produces architecture-dependent tems. It is possible to mount a server filesystem code (arm, x86, etc.), the latter is completely (through httpfs), a memory filesystem (memfs), independent of any existing architecture. NaCl as well as local temporary or permanent file- is currently only supported by the Chrome and systems (html5fs). For those to be useful, they Chromium browsers. Since version 31, Chrome can only be mounted and accessed through the enables PNaCl by default, allowing applications NaCl module, which means that any copying created with that technology to work complete- of data from the user disk into these partitions ly out-of-the-box. While PNaCl modules can be has to be mediated by code written in the NaCl served from anywhere in the open web, native- module. For instance, it is possible to take ad- toolchain NaCl applications and extensions can vantage of the file HTML5 tag and to get data only be installed from Google’s Chrome Web from NaCl into a Javascript blob so that it can Store. be saved into the user’s disk. It is also possible 5.1 The Pepper Plugin API to copy a file from disk into the sandbox using An integral part of NaCl is the Pepper Plu- the URLReader service supplied by Pepper. gin API (PPAPI, or just Pepper). It offers va- 5.2 PNaCl rious services, of which interfacing with Javas- cript and accessing the audio device is particu- The PNaCl toolchain compiles code down to larly relevant to our ends. All of the toolchains a portable bitcode executable (called a pexe). also include support for parts of the standard When this is delivered to the browser, an ahead- C library (eg. stdio), and very importantly for of-time compiler is used to translate the code in- to native form. A web application using PNaCl 25 https://bugzilla.mozilla.org/show_bug.cgi? will contain three basic components: the pexe id=836897 26https://bugs.webkit.org/show_bug.cgi?id= binary, a manifest file describing it, and a client- 107250 side script in JS, which loads and allows interac- 27https://developers.google.com/native-client tion with the module via the Pepper messaging system. As it starts, the PNaCl module will call a moduleDidLoad() function, if it exists. This can 5.3 Csound for PNaCl be defined in the application script. Also the fol- A fully functional implementation of Csound for lowing callbacks are also definable: Portable Native Clients is available from http: //vlazzarini.github.io. The package is com- • function handleMessage(message): cal- posed of three elements: the Javascript modu- led when there are messages from Csound le (csound.js), the manifest file (csound.nmf), (pnacl module). The string message.data and the pexe binary (csound.pexe). The sour- contains the message. ce for the PNaCl component is also available from that site (csound.cpp). It depends on the • function attachListeners(): this is cal- Csound and Libsndfile libraries compiled for led when listeners for different events are PNaCl and the NaCL sdk. A Makefile for PNaCl to be attached. exists in the Csound 6 sources. In addition to Csound-specific controls, the 5.3.1 The Javascript interface module also includes a number of filesystem fa- Users of Csound for PNaCl will only inter- cilities, to allow the manipulation of resources act with the services offered by the Javascript in the server and in the sandbox: module. Typically an application written in HTML5 will require the following elements to • csound.CopyToLocal(src, dest) - copies use it: the file src in the ORIGIN directory to the local file dest, which can be accessed at ./lo- • the csound.js script cal/dest. The “Complete” message is issued on completion. • a reference to the module using a div tag with id=“engine” • csound.CopyUrlToLocal(url,dest) - co- pies the url url to the local file dest, which • a script containing the code to control can be accessed at ./local/dest. Current- Csound. ly only ORIGIN and CORS urls are allo- The script will contain calls to methods in wed remotely, but local files can also be csound.js, such as: passed if encoded as urls with the web- kitURL.createObjectURL() javascript me- • csound.Play() - starts performance thod. The “Complete” message is issued on completion. • csound.PlayCsd(s) - starts performance from a CSD file s, which can be in ./http/ • csound.RequestFileFromLocal(src) - (ORIGIN server) or ./local/ (local sand- requests the data from the local file src. box). The “Complete” message is issued on completion. • csound.RenderCsd(s) - renders a CSD file s, which can be in ./http/ (ORIGIN server) • csound.GetFileData() - returns the most or ./local/ (local sandbox), with no RT au- recently requested file data as an ArrayOb- dio output. The “finished render” message ject. is issued on completion. A series of examples demonstrating this API • csound.Pause() - pauses performance is provided in github. In particular, an introduc- • csound.CompileOrc(s) - compiles the tory example is found on http://vlazzarini. Csound code in the string s github.io/minimal.html. 5.3.2 Limitations • csound.ReadScore(s) - reads the score in the string s (with preprocessing support) The following limitations apply to the current release of Csound for PNaCl: • csound.Event(s) - sends in the line events contained in the string s (no preprocessing) • no realtime audio input (not supported yet in Pepper/NaCl) • csound.SetChannel(name, value) - sends the control channel name the value • no MIDI in the NaCl module. However, it value, both arguments being strings. might be possible to implement MIDI in JavaScript (through WebMIDI), and using John ffitch, James Mitchell, and Julian Pad- the csound.js functions, send control da- get. 2007. Composition with sound web ser- ta to Csound, and respond to the various vices and workflows. In Suvisoft Oy Ltd, channel messages. editor, Proceedings of the 2007 International Computer Music Conference, volume I, pages • no plugins, as pNaCl does not support 419–422. ICMA and Re:New, August. ISBN dlopen() and friends. This means some 0-9713192-5-1. Csound opcodes are not available as they reside in plugin libraries. It might be possi- Tarmo Johannes and Kita Toshihiro. 2013. V`a, pensiero!“ - Fly, thought! Experi- ble to add some of these opcodes statically ” to the Csound pNaCl library in the future. ment for interactive internet based piece using Csound6 . http://tarmo.uuu. 6 Conclusions ee/varia/failid/cs/pensiero-files/ pensiero-presentation.pdf. Accessed: In this paper we reviewed the current state of February 2nd, 2014. support for the development of web-based au- dio and music applications. As part of this, we Victor Lazzarini, Steven Yi, and Joseph Ti- explored two approaches in deploying Csound money. 2012a. Digital audio effects on mobile as an engine for general-purpose media softwa- platforms. In Proceedings of DAFx 2012. re. The first consisted of a Javascript version Victor Lazzarini, Steven Yi, Joseph Timoney, created with the help of the Emscripten com- Damian Keller, and Marco Pimenta. 2012b. piler, and the second a native C/C++ port for The Mobile Csound Platform. In Proceedings the Native Client platform, using the Portable of ICMC 2012. Native Client toolchain. The first has the advan- Charles Roberts, Graham Wakefield, and tage of enjoying widespread support by a varie- Matthew Wright. 2013. The Web Browser As ty of browsers, but is not yet fully deployable. Synthesizer And Interface. Proceedings of the On the other hand, the second approach, whi- International Conference on New Interfaces le at the moment only running on Chrome and for Musical Expression. Chromium browsers, is a robust and ready-for- production version of Csound. David Sehr, Robert Muth, Cliff Bife, Victor Khimenko, Egor Pasko, Karl Schimpf, Bennet 7 Acknowledgements Yee, and Brad Chen. 2010. Adapting Softwa- This research was partly funded by the Program re Fault Isolation to Contemporary CPU Ar- of Research in Third Level Institutions (PRTLI chitectures. In 19th USENIX Security Sym- 5) of the Higher Education Authority (HEA) of posium. Ireland, through the Digital Arts and Humani- Lonce Wyse and Srikumar Subramanian. ties programme. 2013. The Viability of the Web Browser as a Computer Music Platform. Computer Mu- References sic Journal, 37(4):10–23. Paul Batchelor and Trev Wignall. 2013. Be- Bennet Yee, David Sehr, Gregory Dardyk, aglePi: An Introductory Guide to Csound on J. Bradley Chen, Robert Muth, Tavis Orman- the BeagleBone and the Raspberry Pi, as well dy, Shiki Okasaka, Neha Narula, and Nicho- other Linux-powered tinyware. Csound Jour- las Fullagar. 2009. Native Client: A Sandbox nal, (18). for Portable, Untrusted x86 Native Code. In 2009 IEEE Symposium on Security and Pri- Richard J. Boulanger, editor. 2000. The vacy. Csound Book: Tutorials in Software Synthesis and Sound Design. MIT Press, February. Steven Yi and Victor Lazzarini. 2012. Csound for Android. In Linux Audio Conference, vo- Michael Casey and Paris Smaragdis. 1996. lume 6. Netsound. In On the Edge. ICMA and HKUST, August. Alon Zakai. 2011. Emscripten: an llvm-to- javascript compiler. In Proceedings of the Alan Donovan, Robert Muth, Brad Chen, and ACM international conference companion on David Sehr. 2010. PNaCl: Portable Native Object oriented programming systems langua- Client Executables. Google White Paper. ges and applications, pages 301–312. ACM.