Possibilities#2: Audio Layer

2 Mar

Our desired application is modular and layered, which means apart from the interface module (whose possibilities we’ve explored in the last post)

Here there’s probably one million ways to go, all very different in possibilities and in scope of programming (from low level languages to higher and even visual programming). In this post I explore only a few – due to my own limitations (programming skills, knowledge and time available).

The choices available

Here’s some simple info (just for those that are not familiar with most audio synthesis environments)

Name Primary Purpose(s) License Development status
ChucK
Realtime synthesis, live coding, pedagogy, acoustic research, algorithmic composition
GPL
Immature
Csound
Realtime performance, sound synthesis, algorithmic composition, acoustic research
LGPL
Mature
Impromptu
Live coding, algorithmic composition, hardware control, realtime synthesis, 2d/3d graphics programming
Proprietary
Stable
Max/MSP
Realtime synthesis, hardware control
Proprietary
Mature
nsound
Realtime synthesis, offline audio rendering, algorithmic composition, acoustic research
GPL
Mature
Pure Data
Realtime synthesis, hardware control, acoustic research
BSD-like
Stable
Reaktor
Realtime synthesis, hardware control
Proprietary
Mature
SuperCollider
Realtime synthesis, live coding, algorithmic composition, acoustic research
GPL
Mature
Table1. Comparison of Audio Engines/Environments (taken from Wiki)

Of course some of these are not OpenSource nor Free, so as far as I’m interested they are taken out (namely Reaktor from NI, Impromptu and Max/MSP – the last can be replaced with PureData, which Open Source and Free).

Choosing Free and Open Source alternatives

So our table looks like this:

Name Primary Purpose(s) License Development status
ChucK Realtime synthesis, live coding, pedagogy, acoustic research, algorithmic composition GPL Immature
Csound Realtime performance, sound synthesis, algorithmic composition, acoustic research LGPL Mature
nsound Realtime synthesis, offline audio rendering, algorithmic composition, acoustic research GPL Mature
Pure Data Realtime synthesis, hardware control, acoustic research BSD-like Stable
SuperCollider Realtime synthesis, live coding, algorithmic composition, acoustic research GPL Mature

Measuring the knowledge in each of the possible choices

So our table looks like this:

Name Knowledge Years using
ChucK none none
Csound none
none
nsound none none
Pure Data Medium User
2
SuperCollider Starter (just started)

So from this table its understandable that probably PureData or SuperCollider are the reasonable choices as far as minimizing the learning curve. Let’s take a look at what’s under the hood of each “audio environment”.

Interfacing Protocols and possibilities

See this table

This validates that our possibly selected languages (PureData and SuperCollider) have all the features we need (OSC, MIDI, HID…).

Technical Info on PureData and SuperCollider

Pure Data Mac OS X, Linux, Windows, iPod C C, C++, FAUST, Haskell, Java, Lua, Python, Q, Ruby, Scheme, others
SuperCollider Mac OS X, Linux, Windows, FreeBSD C, C++, Objective C C++ Client-server architecture; client and server can be used independently, command-line access

They both run on various Operating Systems (Ive used PureData on Linux/Win and SuperCollider on Win but I’m installing it to Linux soon).

Getting acquainted

Just a small fact, PureData is often referred as PD Or Pd) and SuperCollider as SC (or Sc#, where # denotes the version).

In depth Analysis!

a) PureData (The open source Max/Msp phenomena)

Historical notes: Pure Data (or Pd) is a graphical programming language developed by Miller Puckette in the 1990’s for the creation of interactive computer music and multimedia works. Pd is very similar in scope and design to Puckette’s original Max program (developed while he was at IRCAM), and is to some degree interoperable with Max/MSP, the commercial successor to the Max language. Both Pd and Max are arguably examples of Dataflow programming languages. In such languages, functions or “objects” are linked or “patched” together in a graphical environment which models the flow of the control and audio.

Advantages: Because it draws from Dataflow programming and is a graphical programming language, Pd is fairly easy to learn, all functions and objects are coupled into a program (called a “patch”, probably because it resembles a patch of cords and strings connecting the objects). External objects are a big potential of PureData (and luckily, due to the wide community of developers, there’s almost every flavor in the world as far as choosing a programing language to write the external objects).  Its a fast language towards audio and can respond to various types of messages (OSC, MIDI, etc..) can be coupled with sockets to make it a remote application (client<->server like).

(my) Opinion: Pd is in a very mature level, with a huge amount of effort form users and developers. It has been evolving seriously into a complete solution towards multimedia (with GEM from graphics and other packages for more esoteric purposes…). I’ve used it to various projects, it has a simple binding with the OSC or TUIO  protocol as I’ve posted in this blog earlier (see post or video below). Also in a disadvantage point of view (as far as my experience) certain OO concepts are hard to use/find in Pd graphical programming language, such as instanciating and manipulating large lists of objects (spawning..etc..).
http://vimeo.com/moogaloop.swf?clip_id=6919702&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1

First Try of PureData and TUIO (homemade multitouch) from PedroLopes on Vimeo.

First Try of PureData and TUIO (homemade multitouch) from PedroLopes [turn up the volume because its very lo

Literature concerning Pd

Pd~graz (ed.), ed (2006). bang. Pure Data. Wolke Verlag Hofheim. ISBN 978-3936000375. http://pd-graz.mur.at/label/book/bangbook.pdf.

Puckette, Miller Smith (2007). The Theory and Technique of Electronic Music. World Scientific Press, Singapore. ISBN 978-9812705419. http://www-crca.ucsd.edu/~msp/techniques.htm.

b) SuperCollider (Fast synthesis client-server engine!)

Historical notes: SuperCollider is an environment and programming language originally released in 1996 by James McCartney for real-time audio synthesis and algorithmic composition. Since then it has been evolving into a system used and further developed by both scientists and artists working with sound. It is an efficient and expressive dynamic programming language which makes it an interesting framework for acoustic research, algorithmic music and interactive programming.

Advantages: Being an interactive and dynamic language it is by far one of its main advantages. Its fairly easy to debug and create programs incrementally. The other advantage comes from the concept behind the SC itself: server-client schema.

In SC you type code in the client, thus creating synths (synths are actually DSP blocks that can generate or process sound) that are executed in the server. Client <-> Server metaphor uses OSC as the primary medium (which makes SC an interesting tool for our purposes).

The Language has certain advantages because it supports methods of reflective, conversational and literate programming,

Finally and this is important: Sc is suitable for realtime audio, probably over performing PD (I will test before I can assure it) and a number o other interfaces are supported (see this entry of SCWiki) making it easier to develop.

Disadvantages:  Well the main disadvantage (for my programming skills point of view) is that SC language is a bit tough to learn in few time (like most complex langs are).

Literature on SuperCollider

James McCartney: SuperCollider: a new real time synthesis language ICMC96

David S. Sullivan Jr., Stephan Moore, and Ichiro Fujinaga: Realtime Software Synthesis for Psychoacoustic Experiments ICMPC98

Platform Independency

All of the proposed solutions here are software independent, this is of course a mandatory detail that we must fulfill in order to achieve maximum portability/modularity.

Testing SC and Pd

http://vimeo.com/moogaloop.swf?clip_id=9732948&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1

Prototype for Flash to PureData (pd) from PedroLopes on Vimeo.

Well, as you can see above the prototype already tested Pd for the development of a small 2 channel Dj mixer, so now I have to do the same prototype with SuperCollider and analyze the results. A comparison will be posted soon!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: