- An Overview of PWGL, a Visual Programming Environment for Music
This article provides an overview of our free Lisp-based, cross-platform, visual programming environment called PWGL (the name is an acronym for PatchWork Graphical Language). PWGL can be used for computer-aided composition, music analysis, and sound synthesis. Our work is influenced by our past experience with PatchWork (Laurson 1996; Assayag et al. 1999). However, PWGL has been completely rewritten and redesigned in our attempt to develop and improve many of the useful concepts behind PatchWork.
PWGL and several of its applications have already been discussed in our previous work, including Laurson and Kuuskankare (2002, 2006), Kuuskankare and Laurson (2006), and Laurson, Norilo, and Kuuskankare (2005). Since 2002, PWGL has undergone several revisions and additions including the public release, launching of the PWGL home page, inclusion of the tutorials and new programming interfaces, etc.; each of these have been attempts to make our system more available and more easily approachable within the computer music community. The main purpose of the present article is to give a general overview of the current state of the system with an emphasis on features that are useful for potential PWGL users, such as composers, music analysts, and researchers.
PWGL is programmed ANSI Common Lisp (Steele 1990) from LispWorks (www.lispworks.com), which is source-code compatible across several different operating systems, such as Macintosh OS X, Microsoft Windows, and Linux. LispWorks provides support for Foreign Language Interfaces, by which a program written in one programming language can call routines or make use of services written in another. LispWorks also supports the OpenGL graphics library API. (The graphics part of PWGL is based on OpenGL.) The use of the same codebase aids the development process and in distribution to multiple platforms.
PWGL integrates several programming paradigms (functional, object-oriented, and constraint-based) with high-level visual representation of data, and it can be used to solve a wide range of musical problems. A PWGL patch is the main workspace where the user can add boxes and create relations among them using connections. In its simplest form, a PWGL patch can be seen as a visualization of Lisp: a patch consists of boxes that represent Lisp functions or Common Lisp Object System (CLOS) methods. As PWGL provides a direct interface to its base languages, every Lisp function or CLOS method can be automatically transformed into a box. As a result, PWGL offers the flexibility of both a traditional text-based programming language and a visual programming language. Besides a library of basic boxes (e.g., arithmetic, Lisp functions, list handling, loops, abstractions, and conversion), PWGL contains several large-scale applications, such as the Expressive Notation Package or ENP (Kuuskankare and Laurson 2006), 2D-Editor (Laurson and Kuuskankare 2004), PWGLSynth (Laurson, Norilo, and Kuuskankare 2005), and PWGLConstraints (Laurson and Kuuskankare 2005).
Currently, PWGL runs under Macintosh OS X 10.4 and 10.5 (Universal Binaries) and Windows XP operating systems. PWGL is distributed in two different configurations: as a standalone application—PWGL Application—that is targeted mainly to end-users, and as a developers version—PWGL Binaries—that requires the LispWorks programming environment. The latter version is made available as a pre-compiled module that is loaded on top of LispWorks. The downloads are made available through our projects home page at www.siba.fi/PWGL. Our Web page also includes links to some introductory material, examples, news, and a comprehensive support section. [End Page 19]
The most important key features of PWGL are its high-quality visual appearance; its ergonomic, uniform, and efficient graphical user interface; the ability to operate visually and directly with high-level musical data; powerful intermixing of textual and visual programming; tight integration of its major tools (i.e., music notation, sound synthesis, scripting, and constraint-based programming); and cross-platform code-base.
The rest of this article is organized as follows. We start by comparing PWGL to two other Lisp-based composition environments. Then we compare text-based and visual programming in general, and we describe how PWGL is positioned within these categories. After this, we enumerate the most important design issues that...