Page  00000051 MACSET: A FREE VISUAL CROSS-PLATFORM PITCH-CLASS SET THEORETICAL APPLICATION Mika Kuuskankare Sibelius Academy CMT Marcus Castrdn Sibelius Academy DocMus Mikael Laurson Sibelius Academy CMT ABSTRACT MacSet [4] is a computer application intended to assist in learning and teaching basic pitch class set theory and analysis of post-tonal music. It is an umbrella application under which several pitch class set (pcset) theoryrelated tools are collected. It is designed and programmed by Marcus Castren, Mikael Laurson and Mika Kuuskankare at the Sibelius Academy, Finland. The project's Web site can be located at www. siba. f i/MacSet (pending public release). The Web site provides some background information about MacSet and also allows to download the program for free. This paper introduces the MacSet version 4, a stand-alone application for Mac OS X, Windows, and Linux. 1. INTRODUCTION Theorists have introduced a number of computer programs focusing on applications of pcset theory. CMAP (Castine), SetMaker/pSetMaker (Buchler) and WinSIMS (Isaacson) are typical examples of applications that provide an assortment of observations presented mostly in a textual form. athenaCL [2], in turn, is an open-source composition tool that, among other things, provides a dedicated library for inspecting, searching, and visualizing the properties of set-classes, comparing and searching similarity measures. Yet another, albeit more specialized approach, is provided by Lisp-based Counterpoint Assistant [10]. Furthermore, Humdrum [9] provides a collection of tools specialized for serial analysis and both PWGL [12] and OpenMusic [3] provide libraries computer-aided music theory, analysis and composition (see, for example, OpenMusic's MathTools [1]). MacSet 4 is the result of recent efforts to port our pcset theoretical software to multiple platforms. The previous versions, dating back more than two decades, were developed exclusively for the Macintosh Operating System using the Macintosh Common Lisp. MacSet 4 is programmed with LispWorks Common Lisp (www. lispworks. com) and its CAPI (Common Application Programmers Interface) library for implementing the user interface (UI). Currently, MacSet 4 runs on three platforms: Macintosh OS X (Universal binaries), Windows XP, and Linux (Ubuntu 6.10 and SUSE 10.1 distributions). The following list enumerates some of the new features found in MacSet 4: (1) MacSet is modular and built out of a set of specialized UI components designed particularly for illustrating pcset-theoretical information; (2) there is a new module interface that makes MacSet extensible by using Lisp; (3) the data is interchangeable across platforms; (4) a dedicated tool can be used to create interactive content (e.g, presentations, demos, tutorials, teaching material) in a modular fashion; (5) by using the application preferences it is possible to adjust the appearance and behavior of MacSet to suit a particular user; and (6) the functionality and features of MacSet 4 are identical across all three platforms. The rest of the paper is organized as follows. First, we give an overview of the MacSet graphical user-interface (GUI). Then we present the default MacSet Workspace consisting of three built-in modules and discuss the new music notational capabilities of MacSet 4. In Section "MacSet Modules" we introduce the new interface that allows to create user-definable extensions (modules). The paper ends with some concluding remarks. 2. THE MACSET GUI The MacSet UI is completely rewritten from the ground up to create a modular, object-oriented UI that is based on direct manipulation [5]. Furthermore, MacSet 4 incorporates several enhancements, both in internal architecture and UI, that make it easier and more intuitive to use, allow extensibility, and make it more modular and open-ended. An important part of the rewriting process has been the reprogramming of the individual UI components. The functionality has been separated from the set theoretical code. The new UI components work as any button or widget provided by the operating system: they are reusable and in most cases also context free. They are are also dynamic, i.e, they adjust their size and content automatically. Furthermore, the functionality of the UI components has been streamlined and unified. Now, every component has a dedicated context sensitive menu, etc. There are also some new ways to interact with the components such as an on-screen keyboard entry. The UI components have undergone also some visual enhancements. A lighter touch in terms of color is applied (no more black and white UI components) and majority of the components now utilize transparent colors. MacSet GUI is based on several important concepts. First, MacSet is a multi-window system where the user 51

Page  00000052 can create windows out of provided prototypes. Each window, in turn, has its own individual state which can be saved. There is no limit of how many windows the user can create. Second, MacSet windows are event-driven. The user interacts with the current window using various input devices such as mouse, computer keyboard or MIDI keyboard. Third, MacSet, tries to use optimal representation for input and output. For instance, when entering set-class names, pitches or chords, the system provides visual tools such as pop-up menus or on-screen piano keyboards. For output MacSet uses besides textual format various dynamic graphical objects, such as clock-face representation, matrices and music notation. Fourth, graphical objects can be manipulated directly. If the state of an object is modified then all related objects are also modified accordingly. Thus the state of an active window is always up to date. 3. THE MACSET WORKSPACE MacSet is built out of modules. There are three builtin modules that comprise the default MacSet Workspace. The modules are Sets, Inclusions, and Chords. There is no specific order or hierarchy between them. Each one is specialized for a certain task. The current scheme also allows the user to extend MacSet by defining of his/her own modules which can coexist alongside with the builtin ones reusing the UI components of MacSet. The Sets Module (Figure 1) is for basic operations on pcsets. There are two input methods. The user plays an on-screen keyboard, or clicks into a pop-up menu of setclass names. Pcsets are represented visually with the help of a clock-face: small circles or hours on its perimeter represent pitch-classes. A set can be transposed or inverted with a click of the mouse. Among other immediately observable aspects are types of symmetry, successiveinterval arrays, interval-class vectors, set-class names, etc. 0.:@-. ^ jg:.E|:::|i|:....::::::i:.... ~i::::::..:::::...... ~ ~ ~ ~ i:: ","-C.....::::::::::::::::::::::::::::::::::::::::::::::::::: = S:i,::i-----------i::::::::::ii ii:::::: i I i i ) i;,:,. ; ',: iiI i .-,:1iZ Z:;::i::i:i::i:i 1 iiii11::11:i::i:ii:i::iiig:;: i::?iiiZ1~ Figure 2. The Inclusions Module. ured bass structures, etc). With it the user can also prepare analyses that can be saved to a file. 3 4 6 7 2 3 7 1 3 4 6 9 3 3 31 21 ii i 21 t 2 1 12 1 2 3 22 [',; i 2 3 4 2::2:::::: - i 5 6 7 8 -. o 2 3 5 - 2-7 -1-3I ~rv11~2 -676764] i665534323100 2252221 2241220110001 Figure 3. The Chords Module. 4. ENHANCED MUSIC NOTATION The music notational front-end of MacSet 4 has been substantially enhanced and augmented when compared to the previous versions. Currently, the Music Notation Pane (MN) can be used to display musical material in several different ways: as individual chords, chord sequences, and as piano-roll notation. Figure 4 gives and example of the MN displaying a fragment of a J.S. Bach chorale written in the piano roll notation. The Pitch information inside this panel is editable. The notes can be transposed, added and deleted using the mouse and keyboard. There is also now an annotation system that provides a collection of predefined annotations and also allows the user to create new ones. The annotations can be used to display analytical information directly in the score attached to the relevant musical objects. Furthermore, it is possible to play the musical material entered in the MN. MacSet uses MidiShare [7] for playback. 3 - 1 3*118 Figure 1. The Sets Module. In the Inclusions Module (Figure 2) the user selects a referential pcset and some cardinality-classes (1-12). All pcsets of cardinalities that realize the inclusion relation with the referential set will then be returned. The Chords Module (Figure 3) allows the user to examine the set-class identities of chords and/or melodic lines, as well as study their intervallic properties (interval successions, interval-class and mod-12 interval vectors, fig --s---------------. Figure 4. A Music Notation Pane displaying a musical fragment written in the piano roll notation. 52

Page  00000053 4.1. File I/O The native format of the MN is a list of executable Lisp objects. This format also retains the annotation information attached to chords (see Subsection 4.2). There are currently several ways to export data from the MN. The following list enumerates the current set of supported file formats: ASCII (Lisp), LilyPond [13], MIDI, and MusicXML [8]. It is also possible to import MIDI files (MacSet utilizes the AllegroConvert [6] utility for MIDI file I/O). a Figure 5. The Music Notation Pane with an automatically created annotations and UI components (check-box). 4.2. Annotations Through a simple protocol the user can create different kinds of annotations to be displayed as a part of the music notation. The annotations are positioned automatically according to a predefined scheme. In the following we examine the system through two short examples. First, we create an annotation that displays the harmonic interval between two consecutive notes. The following gives the complete definition: (add-annotation *pane*:name " IV":placement:right-between-notes:active-p t:datum-function:interval:add-tool t) (defmethod datum((self c-chord) (func (eql:interval))) (loop for notel in (notesnself) for note2 in (cdr (notes self)) collect (format () "~a" (- (midi note2) (midi notel))))) The datum -method (above) calculates the intervals between two consecutive notes inside a chord. Here, the:placement attribute is set to: right -between-note s. The effect can be seen in Figure 5. The interval information is placed horizontally on the right side of the chords and vertically between the corresponding notes. The information is also calculated dynamically. Thus, in case the user changes the pitch material the annotations update automatically the displayed information and positioning. Note, that the intervals are arranged in alternating columns in order to avoid collision between the pieces of information. Furthermore, the use of the: add-tool attribute allows us to quickly add a rudimentary UI component (check-box) in the Music Notation Pane. The check-box can be used to turn the annotation display on or off. Our next example is relatively more complex as it requires some Lisp programming. Here we define a dynamic contour break-point function that is displayed above the staff lines. Figure 6 shows how the annotation looks in a score and Figure 7, in turn, gives the annotation definition in Lisp. As can be seen in the previous examples there is actually very little that needs to be defined in order to display 1 ) a Figure 6. The Music Notation Pane with annotations displaying the contour of the notes as a break-point function. quite elaborate information along with the music notation. The various side effects provided by this system make it quite powerful. It is also important to note that all the annotations are able to adapt themselves to the different notation styles in MacSet. 5. THE MACSET MODULES Finally, we give an example of a user-defined module that implements a chord multiplication application in the spirit of Pierre Boulez [11]. Due to the space limitations the code that produced this example cannot be shown here. Suffice to say that it consists of 46 lines of Lisp and takes advantage of the UI component scheme of MacSet. Our new module consists of two separate views (see Figure 8). The top view gives the pitch material (i.e. series) that in this case comprises of four sets that together the fill the chroma. The bottom view gives the resulting multiplication matrix consisting of 16 chords. Using the built-in functionality of MacSet the user can edit the series by transposing or adding and removing notes. Each operation is visualized directly in the multiplication matrix as MacSet updates the result dynamically when the user edits the pitch material. 6. CONCLUSIONS This paper presents MacSet, a free visual cross-platform computer application aimed at pitch-class set theoretical applications of music. MacSet runs on several platforms including Macintosh OS X (both Intel and PowerPC), Windows XP, and Linux. MacSet can be used as an assistant in learning and teaching basic pitch class set theory and in analysis of post-tonal music. It can also be used to produce presentations, demos, tutorials, and teaching material. MacSet is modular and can be extended by the user. The data produced by MacSet is interchangeable across all the supported platforms. Currently, MacSet provides 53

Page  00000054 (defclass g-annotation(annotation) 0) (defmethod draw-annotation-internal (pane (chord c-chord) (annotation g-annotation) (placement t) (datum t) sx dx sy dy left right top bottom font) (when (cdr (notes chord)) (let* ((notes (notes chord)) (xs (mapcar #'x notes)) (ys (mapcar #'y notes)) (max-y (apply #'max ys)) (min-y (apply #'min ys)) (y-origo (- (min (or (read-hash pane:staff-top) 0) sy) 30 (* dy -1.0))) (scaled-ys (mapcar #'(lambda(y) (+ (* (/ (- y min-y) (max (- max-y min-y) 1)) 30) y-origo)) ys))) (macset-draw-rectangle pane (car xs) (1- y-origo) (- (car (last xs)) (car xs)) 32:foreground (background annotation):filled t) (macset-draw-rectangle pane (car xs) (1- y-origo) (- (car (last xs)) (car xs)) 32:foreground (foreground annotation)) (loop:for xl:in xs:for x2:in (cdr xs):for yl:in scaled-ys:for y2:in (cdr scaled-ys):do (macset-draw-line pane xl yl x2 y2:forground (foreground annotation)))))) Figure 7. Lisp code that implements an annotation that displays in a score a break-point function that follows the contour of the associated pitch material. 14 Figure 8. A user defined "Chord Multiplication" module that implements a Boulezian chord multiplication matrix. extensive music notational facilities where analytical information can be viewed and visualized in many different ways. 7. ACKNOWLEDGMENTS The work of Mikael Laurson and Mika Kuuskankare have been supported by the Academy of Finland (SA 105557 and SA 114116). 8. REFERENCES [1] Andreatta, M., C. Agon Amado, T. Noll, and E. Amiot. "Towards pedagogability of mathematical music theory: Algebraic models and tiling problems in computer-aided composition", Proceedings of Bridges 2006, Mathematical Connections in Art, Music, and Science, pp. 277-284, 2006. [2] Ariza, C. An Open Design for Computer-AidedAlgorithmic Music Composition. PhD thesis, New York University, New York, NY, USA, 2005. [3] Assayag, G., C. Rueda, M. Laurson, C. Agon, and O. Delerue. "Computer Assisted Composition at IRCAM: From PatchWork to OpenMusic", Computer Music Journal, vol. 23, pp. 59-72, Fall 1999. [4] Castren, M., M. Laurson, and M. Kuuskankare. "MacSet: A Pcset-Theoretical Computer Application", 26th Annual Meeting of the Society for Music Theory, (Madison, USA), 2003. [5] Cooper, A. About Face. The Essentials of User Interface Design. Foster City, CA: IDG Books, 1995. [6] Dannenberg, R. B. Allegro Music Representation Language. http: //www. cs. cmu. edu/~rbd/ software/allegro. htm, 2000. [7] Fober, D., Y. Orlarey, and S. Letz. "Midishare joins the open source softwares", Proceedings of the International Computer Music Conference (ICMA, ed.), pp. 311-313, 1999. [8] Good, M. and G. Actor. "Using MusicXML for File Interchange", Third International Conference on WEB Delivering of Music, (Los Alamitos, CA), p. 153, IEEE Press, 2003. [9] Huron, D. "Music information processing using the humdrum toolkit: Concepts, examples, and lessons", Computer Music Journal, vol. 26, no. 2, pp. 15-30, 2002. [10] Jones, D. E. "A computational composer's assistant for atonal counterpoint", Computer Music Journal, vol. 24, pp. 33-43, Winter 2000. [11] Koblyakov, L. The World of Harmony of Pierre Boulez: Analysis of Le marteau sans malitre. PhD thesis, Hebrew University of Jerusalem, 1981. [12] Laurson, M. and M. Kuuskankare. "Recent Trends in PWGL", International Computer Music Conference, (New Orleans, USA), pp. 258-261, 2006. [13] Nienhuys, H.-W. and J. Nieuwenhuizen. "LilyPond, a system for automated music engraving", XIV Colloquium on Musical Informatics (XIV CIM 2003), (Firenze, Italy), 2003. 54