Software

< This area is under construction >

In addition to composing music, I have had a perptual interest in software development (and politics). I am a contributer to numerous open source projects as well as the author of my own software toolkit, Turn-key Linux Audio (soon to be generalized for all Unix and Unix-like flavors). Much of what is linked below are patches and examples. You are free to take and use these as you like, all are released under a GPL (Gnu Public License).

Free software links and information

I have been using free (as in "freedom") software for over a decade. It has become a primary means for me and for many of my students. Apart from its low/no cost, it tends to provide unique functionality and, through source code availability, unrivaled (unrivalable?) flexibility for the user. There are now thousands of high-quality software tools available. Indeed, the free software movement is now a force of nature. In the future, there will likely be nothing else. The days of shrink-wrapped boxes with 4 DVD's are coming to an end as networks create new models of sharing and distribultion and the enforcement of the ownership of ideas becomes both futile and unproductive (as well as socially self-destructive).

Of the many thousands of available tools, several stand out for my own work. Below is a list of these programs, included as a resource for other composers as well as a public display of gratitude to their authors. Without their hard work and skill I would not be making music with computers. This list is by no means complete, just the highlights:

GNU/Linux operating system (Fedora, Ubuntu, and Mandriva, in particular)

PlanetCCRMA (the best audio distribution on the "planet")

PureData (PD) by Miller Puckette

Csound and Cecilia graphical front end

Score11 (Csound event generator) by Alec Brinkman

Cecilia Csound front end and uber-app

Audacity soundfile editor

AudioMove high-quality audio conversion

Ardour Digital Audio Workstation by Paul Davis (and many others)

JACK audio connection kit by Paul Davis (and many others)

JACK ultils (jack.*) by Rohan Drape

SuperCollider by James McCartney

PVC phase vocoder programs by Paul Koonce

Sndtools from the Princeton Soundlab

Praat spectral analysis and high-resolution display/printing

GNU Image Manipulation Program (GIMP)

Inkscape SVG graphics, Illustrator/Freehand replacement

Drupal CMS by Dries Buytaert (and many others)

FFMpeg/Mplayer audio/video encoder/converter

Mplayer video and audio player

VLC video player and streaming

Handbrake DVD conversion and compression

PureData performance patches

Miller Puckette's PureData (PD) has become a central tools for me, both as a mechanism for constructing sound creation and manipulation routines, and as a generalized environment for building graphical interfaces for performance. PD is extremely powerful, open, and efficient...and it runs on every operating system I use (primarily Linux, OSX, and SGI IRIX). As opensource software it has the added benefit of easy distribution to performers and publishers as well as students at CEMC (Cornell Electroacoustic Music Center) looking to expand their arsenal of software tools. I recommend the "Pd-extended" distribution for users. Installers for your operating system can be found on the puredata.info download page or if you prefer the "bleeding edge, in the nightly builds archive.

Roses don't need perfume for guitar and electronics, PD patch

This is the live performance patch for my solo guitar and electronics piece, Roses Don't Need Perfume. It's a simple example of a user interface and had to be fool-proof so that the guitarist, Ken Meyer, could run it on his own system, edit it as needed for a particular performance. The patch utilizes my sfplayer abstraction, a reusable soundfile player object with a nice user interface. The patch is documented internally and may be used and modified under the GPL (GNU Public License).

PureData Tutorials

Documentation for PureData is under constant development. The Help system and HTML docs provide an initial resource, information for getting started, but real-world examples are always useful -- several of my performance patches can be found here. This page is an attempt in that direction and is intended primarily for new PD users. The example patches are often very practically driven. I like very much that PD can be used in this way as a geeralized problem solver. Every musician should have a tools like this, one that is, essentially, infinitely available to them for everything from simple (recording, MIDI traffic cop, etc) to complex (network sync of laptop quartet) projects.

These patches assume that the user is running Pd-extended but uses core objects wherever possible.

Tutorial 1 - A simple event counter

A great composer does not borrow, he steals

On of the motivations of open source software is to share software solutions, hoping to save the time and energy of "reinventing the wheel" but providing a base for others to extend and make better, more capable, or part of something larger.  For this reason, I recommend whole-sale "stealing" of working open source code from me or wherever you can find it. In this case, the PD Help system provides several solutions to the initial problem of builiding an event counter, that of the couter machanism itself. Here's one stolen from "2.control.examples.pd -> 06.more.counters.pd":

Perfect. Our event counter will do the same, count to 10 and then reset...assuming our piece has 10 events.

The center of the action is the [float] object, a simple place holder for a number (all numbers in PD are floats). [metro] is a metronome that sends a bang every time increment, in this case every 500ms (0.5 sec). The bangs from metro tell [float] to pass along the number it's holding, initally "0". On the first bang, that "0" goes on to the [+ 1], adding 0+1, and the new value is returned to [float] at it's left, "cold" inlet. The new value, "1", is thus waiting in [float] to be passes along at the next bang to the left or "hot" outlet. 500ms later, [metro] bangs [float] once again. [float] passes the "1", which is again passed to [+1] and back into [float] as "2" (1+1), and so on. The only thing stopping [float] from counting forever is [select]. When [select] sees "10", it sends a bang out of its left-most outlet, banging a [stop ( message for [metro] and stopping the counter.

Counting in response to a click

We'll make several small changes to this mechanism, removing the metronome so that the counter only advances when the mouse it clicked, and using [select 10] to reset the [float] value to "0". Of course there is also an object in PD, taken from Max/MSP, called "counter" which integrates this behaviour. 

Lately, I have taken to building mouse foot pedals for performers out of old one-button Mac mice, a process I will document here in the future. The key object is from the GEM library, called "MouseState" which checks whether the mouse is clicked, where it is on the screen, etc. In our case I just want the click state, up or down (0 or 1). In the patch below I use "select" to set the "polarity" of the mouse foot swtich so that it clicks when the foot is released/up. When select gets a "0" (mouse click up) it bangs our counter. Many players prefer this but it is easily reversed ([select 1 0] for those who don't.

Tutorial 2 - Send and receive with graphical objects


Send and Receive

The send and receive mechanism in PD provides a wireless message communication system, a way of sending data from place to place, patch to subpatch, etc, without making cable connections. There are several ways to do this: with send/receive objects, with message boxes and semicolon separated values, from one graphical object to another within its properties, and from a qlist (an advanced topic we will get to in a future tutorial). Please see PD's Help system, "2.control.examples/send_and_receive.pd" for examples of the first two.

The third, sending and receiveing to/from graphical objects, is very handy but somewhat problematic. One of the stated goals of PD is to have printable patches with all of the logic visible. This is a great idea for examples and tutorials like this one. However, when building interfaces for performance, it is often useful to hide the wires, showing the performer only wht they need to execute the piece. Graphical send/receive is a perfect solution.

Properties of graphical objects

To find these send/receive pairs, just right-click on any GUI object (numbers, sliders, VU, radios, etc) and choose "Properties". You will be greeted with a dialog box with many options, depenind on the object. We're interested in the send receive section. Below is the send/receive section of a "bang" GUI object.

Here, adding a name, for example "go" to the send field. Now our "bang" GUI will send a "bang" to the receive "go". If we create another "bang" GUI object and set it's receive field to "go", the first "bang" GUI will "bang" the second.

Any graphical object can communicate with any other in this way. Send messages fro GUI opbjects can also be received at an ordinary [receive] object as well. The send/receive names simply have to match.

Example patch

Attached is an example of communicating numbers to and from graphical objects across subpatches, in this case to do exactly what I stated earlier, to hide the "guts" of the patch from the user/performer. In this patch, sliders on the front page send values to the frequency of an amplitude modulator (ring modulator) and to the volume of the overall outlut. Two VU's on the front page also receive the signal level from the patch's "guts", giving the performer visual feedback about what's happening to the audio.

For fun, I have added an extra trick, using semicolon delimited messages to send numbers into the Properties dialog directly. See the numbers displayed on top of the graphical sliders as well as the message system under the hood (click on [pd guts]).

 

Tutorial 3 - Audio input and recording

Audio input and output, [adc~] and [dac~]

Audio input and output in PD is done via [adc~] (analog to digital converter) and [dac~] (digital to analog converter). In most cases this is simply a number-by-number mapping to and from physical hardware. Setting [adc~] to [adc~ 3] tells PD to take in audio from the 3rd hardware input. By default both [adc~] and [dac~] use the frst two inputs/outputs.

A simple recorder

To build a recording mechanism we need to steps, audio input and audio writing. We'll assume, for now, using the first two audio inputs, as if you were going to try this patch out on a laptop. The only other object we need is [writesf~], although there are several other ways to write audio in PD (see tabwrite~, soundfiler, and sfrecord). [writesf~] simply writes the audio it receives to disk given a filename with [open filename.wav] and a [start ( or [stop ( message. So the patch in it's most basic form is just:

Note that this gives us no control over the level in (except the hardware level) and no way to do anything except overwrite the same file, filename.wav, over and over. Not very useful.

To fix the problem, we need to insert audio multipliers before the signal reaches [writesf~]. A multiplier of "1" means what multiplying by 1 always means, you get "itself". Multiplying by .5 gives you half, etc. We also want a way to change the filename, the simplest thing would be for the recorder to simply make a ew filename each time you start a new recording. The new, fancy, little hand-held recorders do this but we're going to save you some cash with a free PD solution.

Example patch

Like the patch in tutorial 2, we're going to build a patch with a graphical front end, giving the user a simple interface to interact with. In this case, we want:

  1. Ability to enable/control signal mic level
  2. Ability to start recording to a new file (value added: something to tell us the name of the new file)
  3. A set of meters to show the signal level so we can avoid clipping

So in addition to the basic [writesf~] mechanism we want to create something to control mic levels (a multiplier), something to increment through a set of filenames, and as wtih the Tutorial 2 patch, VU meters to show the audio level.

The fist one is easy, just insert an audio multiplier that can be turned up and down from the front page via send/receive. Here a toggle object, which sends "0" or "1" when off or on, is sent to a [line] which ramps up and down over 200ms. So the level is raised when the toggle is checked and lowered when it is not.

The filename question is a little more complicated but essentially we want to write a new file with a new name each time (avoiding overwriting the previous file), something like soundfile1.wav, soundfile2.wav, soundfileN.wav, etc. So we need our [open filename ( message to change each time, ideally with something that can just substitute a new number at the end of the filename.

The solution is to use [makefilename]. See its help patch for the available options. Here we are using %d to substitute a new number at the end of the filename. Beyond that, this patch is almost identical to the counter patch from Tutorial 1 ("never design what you can steal").

Like the counter, numbers increment within float and this number is added to the end of the filename soundfile%d.wav at the %d position. This filename is then send to [writesf~] as the file to [open (.

Finally, we want all of this information to be accesible via a graphical front end. We want to be able to enable and.or adjust the mic level, we want to see the level in a set of VU meters, we want to be able to enable the recording, and we want to see what filename is curretly in use. This can all be done via send and receive to and from the guts of the path. See attached.

Turn-key Linux Audio distribution

Around 8 years ago, I sought to "scratch an itch, intending to solve the software installation, dependencies, and configuration issues then associated with Linux for music. At the time I was working in the Eastman Computer Music Center (ECMC) where the troubles of setup and use caused frequent problems for composers who wanted to run the most advanced tools.  In a mixed environment of NeXT, SGI, OSX, Windows, and Linux, open source was (and is) the best thing going. My mentor and ECMC Director, Allan Schindler, already had his own in-house scripts and documentation (based on the Berkeley/IRCAM/CARL[BICSF] system), providing an excellent foundation for a complete music system on Linux.  It was just a matter of organization and troubleshooting. I wanted to solve the installation problems once and (quite literally) for all, bundling together a complete music software installation system that any user could setup and use.

So TKLA was born. The project has taken a backseat to composing and teaching of late, but I intend to work on it again, making available the environment I use at the Cornell Electroacoustic Music Center on Linux and Mac OSX.

Many of the ideas in TLKA found their way into other projects, particularly CCRMA's excellent PlanetCCRMA. One of the ideas in TLKA was the "turnkey" package (these have come to be called "meta" pakages), a top-level package containing no files beyond a list of dependencies. Through Linux's package managements system, one could ask for this empty package and the system would automatically install all dependencies. This idea came out of an interesting exchange with PlanetCCRMA's primary developer, Ferndando Lopez-Lezcano.

Turn-key Linux Audio has been featured in many places in print and on the web. Here are several:

Computer Music Journal (Computer Music and the Linux Operating System)

Slashdot.org (geek central)

Linux Journal (alongside other similar projects)

ALSA wiki pages

Desktop Linux ("A Practical Guide to get started using Linux")

Mike Raznick's Digital Audio And The Linux Operating System, PDF