An Interactive Programming Environment for Composition And
Total Page:16
File Type:pdf, Size:1020Kb
Andrew Sorensen Impromptu: An MOSO Corporation 15/925 Brunswick St interactive programming New Farm, 5004 Australia environment for [email protected] composition and performance. intellectually grasp the structures and abstractions Abstract of a work even before it has been rendered sonically. And perhaps even more important is the Interactive development environments are making a opportunity for performers to connect with each resurgence. The traditional batch style of programming, other, freely exchanging ideas of both micro and edit -> compile -> run, is slowly being reevaluated by macro structure. Additionally, there is a the development community at large. Languages such as performance practice, a level of virtuosity evident Perl, Python and Ruby are at the heart of a new in Live Programming that will hopefully provide a programming culture commonly described as extreme, stage presence that has often been missing in live agile or dynamic. Musicians are also beginning to laptop performance. Above all, the author hopes embrace these environments and to investigate the that this interactive medium for music making will opportunity to use dynamic programming tools in live provide an environment for the novel exploration performance. This paper provides an introduction to of structure through abstraction and combination, Impromptu, a new interactive development environment the building blocks of digital art. for musicians and sound artists. A Brief History Introduction The first documented Live Programming Impromptu is a new programming environment performance was at a concert performed by Ron being developed to explore the manipulation of Kuivila at STEIM in 1985. Ron used his Formula musical structure in live performance. Live, real- programming language (A language based on time or on-the-fly programming is a performance Forth) for this half hour performance. Forth and paradigm stemming from laptop performance, but Lisp systems were used for various real-time with an emphasis on the crafting of algorithms in performances during the late 80s and early 90s. real-time. Impromptu is designed to provide a The League of Automatic Composers (later dynamic, real-time, interpreted, multi-user runtime becoming the Hub) were a performance group that capable of supporting the creation, modification, made use of real-time programming methods in distribution and evaluation of source code in live live performance, encouraging audience members performance. Impromptu consists of a to walk between performers in order to see the synthesis/DSP engine, a real-time scheduling code being created and executed during the engine, a Scheme interpreter and an Integrated performance. (Gresham 1998). Development Environment. With the exception of small pockets of activity live coding seems to have been largely Live Programming absent during the 90s. Live Programming during this period appears to have been restricted to the The use of computers in the creative runtime manipulation of signal paths in Max process mandates that we think of patches. communicative and creative processes A resurgence in the use of text based in terms of abstract structures and the languages for Live Programming can be dated to manipulation of such structures. 2000 and Julian Rohrhuber’s real-time (Holtzman 1994) Supercollider experiments. Other important work at this time was Alex McCleans work with SLUB Live Programming is a performance practice that and Adrian Ward’s REALbasic environment “Pure emphasizes the creation and manipulation of Events” (Collins et al 2003). algorithms in real-time. Live Programming Recently Live Programming has been emphasizes the cerebral nature of algorithmic given a broader treatment due to the attentions of development and mandates that this process computer music luminary Perry Cook. Ge Wang should be transparent and accessible. “Give us and Perry Cook have developed a new access to the performer's mind, to the whole human programming language specifically tailored for on- instrument.” (www.toplap.org) the-fly creation of DSP algorithms. The language Live Programming offers a novel ChucK provides novel concepts such as the ability opportunity for audience members to participate in to embed time primitives directly into the program the creation of a work as it unfolds; an exciting flow (Wang and Cook 2003). medium allowing audience members to Figure 1: The Impromptu Integrated Development Environment. Supercollider, having always been at the creation and delivery. The AIME engine is based forefront of this field is playing an ever-increasing around a simple, flexible real-time scheduling role in Live Programming. The success of the now engine providing sample accurate callbacks to C++ open source SC3 server has seen a proliferation of methods. AIME does not implement a control-rate, client architectures making use of the successful instead allowing scheduled callbacks to effect OSC communication protocol. There are SC3 signal processing units at any frame boundary. clients available for many languages including Although this approach has inherent performance Java, Scheme, Ruby and the more traditional penalties the relative simplicity of the architecture SCLang. Many of these environments support Live and an ever-increasing supply of gigahertz make Programming. this a musically and architecturally satisfying solution. Impromptu Inter-object communication is made through the central scheduling engine promoting a Impromptu is an interactive development high degree of temporal control across all aspects of environment being built by the author. Impromptu the engine. This convention applies equally to both has been designed to provide an interactive synthesis/DSP units and event/control structures. environment for the exploration of real-time AIME includes a growing array of musical algorithm crafting and performance. synthesis instruments including a flexible STK Impromptu is designed to support wrapper that allows STK generators, filters, effects multiple users operating within a shared runtime and instruments to be chained at runtime (Cook & environment. Impromptu also includes an Scavone 1999). AIME provides extensive Integrated Development Environment (IDE) parametric control of all sound sources through the designed for both live and non-live programming. scheduler. Impromptu emerged at the juncture of The AIME library has been designed to three separate paths: (1) an interest in dynamic integrate directly into 3rd party applications. languages and interactive development AIME’s primary design consideration was non- environments (2) a desire to explore programming linear environments, and more particularly as a live performance tool and (3) the development computer game engines. This design goal of AIME, a new C++ synthesis/scheduling engine. influenced the expectoration that a scripting The result of this merger is the close coupling of a language or other real-time mechanism would be high-level language runtime, Scheme, and a used to control AIME. This design made it an synthesis/scheduling engine, AIME. obvious candidate for coupling with a high-level language such as Scheme. AIME AIME is a BSD licensed project hosted at AIME has been developed over the past 12 months http://sourceforge.net/projects/aime-lib. by the author with support from the Australian CRC for Interaction Design (ACID) dynamic Scheme content project. The engine has been designed to Scheme is a dialect of Lisp, a dynamic language provide a vehicle for exploring dynamic content designed by John McCarthy in 1958. Scheme is a small, elegant yet powerful language developed by should be relatively intuitive to the real-time Gerald Sussman and Guy Lewis Steel at MIT in the programmer that code evaluation is not late 1970’s (Abelson & Sussman 1996). instantaneous and it is a relatively trivial matter to Impromptu uses a modified scheme circumvent the problem by scheduling callbacks interpreter based on TinyScheme (Souflis). The ahead of time. interpreter is written in C and is integrated directly into the AIME engine. Communication between (define (long-function T) the Scheme runtime and the AIME engine happens ; schedule callback 4100 frames through a combination of Scheme/C bindings and ; ahead of desired sounding time. Scheme opcodes. These integration points provide (generate-and-play-100-notes T) (callback (+ T 40000) Scheme with “native” access to the AIME 'long-function scheduling engine, and therefore to any C++ (+ T 44100)) method available to the scheduling engine. In effect this gives the scheme engine complete access This code shows an example of calling back ahead to AIME C++ objects at runtime. This integration is of time. The example sets the callback 4100 frames transparent to Impromptu programmers who ahead of the desired sounding time. This gives the should be unaware of any distinction between interpreter 4100 frames in which to evaluate the scheme -> scheme calls and scheme -> C++ calls. function (generate-and-play-100-notes <scheduled The Impromptu scheme interpreter time>) that internally schedules all 100 notes for currently supports most of the scheme RSR5 evaluation at <scheduled time>. In reality many standard (Abelson, H. etal 1998) including macro operations do not need to worry about timing support. While RSR5 only includes a tiny standard issues this accurately and are free to call library there is vast array of public domain Scheme Impromptu’s (now) function, which returns the code readily available for use in Impromptu. Most audio engines