csound on the web - lac2014 - linux audio...
TRANSCRIPT
Csound on the WebLAC2014
Victor Lazzarini, Edward Costello, Steven Yi and John ffitch
National University of Ireland, Maynooth
LAC Karlsruhe, May 2014
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 1 / 21
Background
Introduction
Context of WorkGoals of WorkEmscriptenPNaClDemonstrationsConclusions
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 2 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound Ecosystem
Command Line - Use Csound as CompilerDesktop Applications - ShellDesktop Applications - APIMobile Applications - iOS, AndroidEmbedded - Raspberry Pi, BeagleBoneWeb - Server-sideWeb - Client-Side
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 3 / 21
Background
Csound on the Web - Goals
Build client-side web applications using common browsertechnologyNo extra installation required ⇒ Simplified DeploymentExpand return on investment in knowing CsoundNew way to share workPreserve works (dependencies are self-contained)Build using main Csound source code, always in sync with latestcode changes
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 4 / 21
Background
Csound on the Web - Goals
Build client-side web applications using common browsertechnologyNo extra installation required ⇒ Simplified DeploymentExpand return on investment in knowing CsoundNew way to share workPreserve works (dependencies are self-contained)Build using main Csound source code, always in sync with latestcode changes
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 4 / 21
Background
Csound on the Web - Goals
Build client-side web applications using common browsertechnologyNo extra installation required ⇒ Simplified DeploymentExpand return on investment in knowing CsoundNew way to share workPreserve works (dependencies are self-contained)Build using main Csound source code, always in sync with latestcode changes
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 4 / 21
Background
Csound on the Web - Goals
Build client-side web applications using common browsertechnologyNo extra installation required ⇒ Simplified DeploymentExpand return on investment in knowing CsoundNew way to share workPreserve works (dependencies are self-contained)Build using main Csound source code, always in sync with latestcode changes
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 4 / 21
Background
Csound on the Web - Goals
Build client-side web applications using common browsertechnologyNo extra installation required ⇒ Simplified DeploymentExpand return on investment in knowing CsoundNew way to share workPreserve works (dependencies are self-contained)Build using main Csound source code, always in sync with latestcode changes
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 4 / 21
Background
Csound on the Web - Goals
Build client-side web applications using common browsertechnologyNo extra installation required ⇒ Simplified DeploymentExpand return on investment in knowing CsoundNew way to share workPreserve works (dependencies are self-contained)Build using main Csound source code, always in sync with latestcode changes
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 4 / 21
Background
Web Technologies
NPAPI - Going out of useFlash - No option for integrating Csound, going out of useSilverlight - No option for integrating Csound, going out of use, notcross-platformJava Applet/Webstart - Going out of useJavaScript/WebAudio - HTML5 Standard, can use Emscriptencompiler to compile C/C++ to JavascriptPortable NativeClient (PNaCl) - works across Operating Systems,requires Chrome/Chromium/Chrome OS with PNaCl support
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 5 / 21
Background
Web Technologies
NPAPI - Going out of useFlash - No option for integrating Csound, going out of useSilverlight - No option for integrating Csound, going out of use, notcross-platformJava Applet/Webstart - Going out of useJavaScript/WebAudio - HTML5 Standard, can use Emscriptencompiler to compile C/C++ to JavascriptPortable NativeClient (PNaCl) - works across Operating Systems,requires Chrome/Chromium/Chrome OS with PNaCl support
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 5 / 21
Background
Web Technologies
NPAPI - Going out of useFlash - No option for integrating Csound, going out of useSilverlight - No option for integrating Csound, going out of use, notcross-platformJava Applet/Webstart - Going out of useJavaScript/WebAudio - HTML5 Standard, can use Emscriptencompiler to compile C/C++ to JavascriptPortable NativeClient (PNaCl) - works across Operating Systems,requires Chrome/Chromium/Chrome OS with PNaCl support
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 5 / 21
Background
Web Technologies
NPAPI - Going out of useFlash - No option for integrating Csound, going out of useSilverlight - No option for integrating Csound, going out of use, notcross-platformJava Applet/Webstart - Going out of useJavaScript/WebAudio - HTML5 Standard, can use Emscriptencompiler to compile C/C++ to JavascriptPortable NativeClient (PNaCl) - works across Operating Systems,requires Chrome/Chromium/Chrome OS with PNaCl support
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 5 / 21
Background
Web Technologies
NPAPI - Going out of useFlash - No option for integrating Csound, going out of useSilverlight - No option for integrating Csound, going out of use, notcross-platformJava Applet/Webstart - Going out of useJavaScript/WebAudio - HTML5 Standard, can use Emscriptencompiler to compile C/C++ to JavascriptPortable NativeClient (PNaCl) - works across Operating Systems,requires Chrome/Chromium/Chrome OS with PNaCl support
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 5 / 21
Background
Web Technologies
NPAPI - Going out of useFlash - No option for integrating Csound, going out of useSilverlight - No option for integrating Csound, going out of use, notcross-platformJava Applet/Webstart - Going out of useJavaScript/WebAudio - HTML5 Standard, can use Emscriptencompiler to compile C/C++ to JavascriptPortable NativeClient (PNaCl) - works across Operating Systems,requires Chrome/Chromium/Chrome OS with PNaCl support
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 5 / 21
Emscripten
Introduction
Created by Alon Zakai at MozillaTranscompiles LLVM bytecode into JavascriptAllowing software written in C or C++ to be compiled intoJavascript applications for the webUses web standards, no need for plugins
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 6 / 21
Emscripten
Introduction
Created by Alon Zakai at MozillaTranscompiles LLVM bytecode into JavascriptAllowing software written in C or C++ to be compiled intoJavascript applications for the webUses web standards, no need for plugins
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 6 / 21
Emscripten
Introduction
Created by Alon Zakai at MozillaTranscompiles LLVM bytecode into JavascriptAllowing software written in C or C++ to be compiled intoJavascript applications for the webUses web standards, no need for plugins
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 6 / 21
Emscripten
Introduction
Created by Alon Zakai at MozillaTranscompiles LLVM bytecode into JavascriptAllowing software written in C or C++ to be compiled intoJavascript applications for the webUses web standards, no need for plugins
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 6 / 21
Emscripten
Csound Emscripten
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 7 / 21
Emscripten
Csound Emscripten
Allows the compilation of .csd, .orc, .sco filesCsound may be controlled using software input channels, usingwebpage widgets or OSC; Web MIDI not yet supported in manybrowsersLive audio input is available, as is audio file inputPotential to access full Csound API
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 8 / 21
Emscripten
Csound Emscripten
Allows the compilation of .csd, .orc, .sco filesCsound may be controlled using software input channels, usingwebpage widgets or OSC; Web MIDI not yet supported in manybrowsersLive audio input is available, as is audio file inputPotential to access full Csound API
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 8 / 21
Emscripten
Csound Emscripten
Allows the compilation of .csd, .orc, .sco filesCsound may be controlled using software input channels, usingwebpage widgets or OSC; Web MIDI not yet supported in manybrowsersLive audio input is available, as is audio file inputPotential to access full Csound API
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 8 / 21
Emscripten
Csound Emscripten
Allows the compilation of .csd, .orc, .sco filesCsound may be controlled using software input channels, usingwebpage widgets or OSC; Web MIDI not yet supported in manybrowsersLive audio input is available, as is audio file inputPotential to access full Csound API
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 8 / 21
PNaCl
Introduction
Open-source, Developed by GoogleArchitecture Independent form of Native Client, which allowsrunning native code in a sandboxCompiles C/C++ into abstract, architecture-independent pexeexecutablesBi-directional communication with JavaScript via the Pepper APIPNaCl is available in Google’s Chrome, Chromium, and ChromeOS
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 9 / 21
PNaCl
Introduction
Open-source, Developed by GoogleArchitecture Independent form of Native Client, which allowsrunning native code in a sandboxCompiles C/C++ into abstract, architecture-independent pexeexecutablesBi-directional communication with JavaScript via the Pepper APIPNaCl is available in Google’s Chrome, Chromium, and ChromeOS
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 9 / 21
PNaCl
Introduction
Open-source, Developed by GoogleArchitecture Independent form of Native Client, which allowsrunning native code in a sandboxCompiles C/C++ into abstract, architecture-independent pexeexecutablesBi-directional communication with JavaScript via the Pepper APIPNaCl is available in Google’s Chrome, Chromium, and ChromeOS
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 9 / 21
PNaCl
Introduction
Open-source, Developed by GoogleArchitecture Independent form of Native Client, which allowsrunning native code in a sandboxCompiles C/C++ into abstract, architecture-independent pexeexecutablesBi-directional communication with JavaScript via the Pepper APIPNaCl is available in Google’s Chrome, Chromium, and ChromeOS
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 9 / 21
PNaCl
Introduction
Open-source, Developed by GoogleArchitecture Independent form of Native Client, which allowsrunning native code in a sandboxCompiles C/C++ into abstract, architecture-independent pexeexecutablesBi-directional communication with JavaScript via the Pepper APIPNaCl is available in Google’s Chrome, Chromium, and ChromeOS
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 9 / 21
PNaCl
Csound PNaCl
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 10 / 21
PNaCl
Csound PNaCl API
Play and PauseCompile ORC and SCO codeSend score messagesSend values over channelsNot full access to Csound API, similar to csound˜ and csoundapi˜No audio input (yet, Pepper API Beta has added support)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 11 / 21
PNaCl
Csound PNaCl API
Play and PauseCompile ORC and SCO codeSend score messagesSend values over channelsNot full access to Csound API, similar to csound˜ and csoundapi˜No audio input (yet, Pepper API Beta has added support)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 11 / 21
PNaCl
Csound PNaCl API
Play and PauseCompile ORC and SCO codeSend score messagesSend values over channelsNot full access to Csound API, similar to csound˜ and csoundapi˜No audio input (yet, Pepper API Beta has added support)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 11 / 21
PNaCl
Csound PNaCl API
Play and PauseCompile ORC and SCO codeSend score messagesSend values over channelsNot full access to Csound API, similar to csound˜ and csoundapi˜No audio input (yet, Pepper API Beta has added support)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 11 / 21
PNaCl
Csound PNaCl API
Play and PauseCompile ORC and SCO codeSend score messagesSend values over channelsNot full access to Csound API, similar to csound˜ and csoundapi˜No audio input (yet, Pepper API Beta has added support)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 11 / 21
PNaCl
Csound PNaCl API
Play and PauseCompile ORC and SCO codeSend score messagesSend values over channelsNot full access to Csound API, similar to csound˜ and csoundapi˜No audio input (yet, Pepper API Beta has added support)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 11 / 21
Demonstrations
Demonstrations
Emscripten and PNaCl Test SuitesWeb Sequencer (PNaCl)Csound Notebook (PNaCl)Processing.js Example (PNaCl)Manual Example (Emscripten)OSC Demo (Emscripten)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 12 / 21
Demonstrations
Emscripten and PNaCl Test Suites
Emscripten: http://eddyc.github.io/CsoundEmscriptenPNaCl: http://vlazzarini.github.io
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 13 / 21
Demonstrations
Web Sequencer
http://fcahoon.github.io/seq/
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 14 / 21
Demonstrations
Csound Notebook
http://csound-notebook.kunstmusik.com
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 15 / 21
Demonstrations
ProcessingJS Example
http://www.kunstmusik.com/processingjs example
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 16 / 21
Demonstrations
Manual Example
http://eddyc.github.io/CsoundManual
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 17 / 21
Demonstrations
OSC Demo
http://eddyc.github.io/CsoundEmscripten
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 18 / 21
Conclusion
Conclusions
Emscripten: More ubiquitous, less performant, faster loading time,limited by Web Audio APIPNaCl: More performant, less ubiquitous, design limitations withmessage passingBoth technologies are actively developed
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 19 / 21
Conclusion
Future Work
Continue to develop the two web API’s based on userrequirementsLook at unified API that can use either PNaCl or Emscriptenbuilds, depending on what is available (also keep an eye onPepperJS)
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 20 / 21
Conclusion
Acknowledgements
This work has been partly funded by the Irish HEA PRTLI-5 Digital Artsand Humanities programme.
Lazzarini, Costello, Yi and ffitch (NUIM) Csound on the Web LAC2014 21 / 21