You are on page 1of 12

Patrick Hill, Simon Holland, and Robin Laney

The Open University


An Introduction to Aspect-
Centre for Research in Computing
Walton Hall
Oriented Music
Milton Keynes MK7 6AA UK
http://www.computing.open.ac.uk/Themes/HCI Representation
PatrickHill@bcs.org.uk
{s.holland, r.c.laney}@open.ac.uk

Computer-music composition systems serve di- In these and other ways, most music representa-
verse purposes. Some draw on contrasting comput- tions allow music to be represented and manipu-
ing paradigms, including procedural, object-oriented, lated only within a prescribed range of preconceived
data-flow, functional, and logic programming. All musical ontologies. In contrast, AOMR has the dis-
such systems, provided they are sufficiently devel- tinctive aim of supporting whatever ontologies may
oped, are Turing-complete, but different paradigms be preferred by particular users. This is largely
can help facilitate different kinds approaches to mu- achieved by abstracting music constructs in terms
sic computing and new kinds of music manipulation. of discrete areas of interest, or concerns, that may
In general-purpose programming, there is a recent be composed together. In this way, AOMR attempts
development known as aspect-oriented programming to support any perspective as a first-class entity; its
(AOP) that has been claimed, along with related tech- operations, however, may crosscut or be scattered
niques,to offer new kinds of flexibility and ease of across existing organizational hierarchies.
variation. The system presented here, AspectMusic, In this article, we have focused on familiar and
is the first substantial work we are aware of to adapt relatively simple examples using Western tonal mu-
ideas from aspect-oriented programming and related sic to explain AOMR as clearly as possible. For clar-
techniques and explore how they might be applied ity, we proceed from the traditional dimensions of
to facilitate new approaches to musical exploration tonal music, and then we show how AOMR system-
and manipulation. AspectMusic is an implemented atically supports various operations and concep-
framework that applies ideas at the root of AOP to tions that crosscut these dimensions.
the manipulation of musical materials and struc- AOMR appears to be particularly relevant for
tures. To introduce AspectMusic,and more gener- those musical idioms in which musical composi-
ally, aspect-oriented music representation (AOMR), tion may be characterized in terms of a typically
we begin by reflecting on some various well-known limited set of musical raw materials that are
features of current computer-music systems. combined and reused in various ways, addressing
Interactive scoring systems effectively provide different musical areas of interest within a particu-
musical word-processor-style environments, lar piece of music. Well-known examples of such
enabling musical detail to be entered and edited on materials in Western tonal music include pitch se-
a note-by-note basis. Other approaches, such as quences, rhythmic figures, and harmonic progres-
JMusic and Common Music, attempt to provide a sions that may appear in exact and transformed
generalized music programming environment, al- forms throughout a musical work. Similar transfor-
beit with a prescribed musical ontology, embedded mational processes can occur at abstract levels in
within general-purpose programming languages. other idioms, with materials such as sequences of
Computer music environments such as Popes parameters that form the inputs to generative pro-
MODE system (Pope 1991) have evolved out of the cesses. Equally, AOMR is applicable to musical
requirement to support particular compositional works and fragments based on structural prototypes
needs, and therefore although multiple approaches that are formed through a finite set of combinatorial
are supported, ontological generality is not a prime operations. AOMR appears applicable wherever ex-
concern. plicit support for maintaining coherence across
representational or functional shifts is useful to a
Computer Music Journal, 31:4, pp. 4758, Winter 2007 composer.
2007 Massachusetts Institute of Technology. In traditional areas such as those idioms we focus

Hill et al. 47
Figure 1. (a) Tangled hier-
archical relationship of
pitch and rhythm; (b) poly-
archic pitch relationship.

on in this article, it is generally argued that the (a) P1 (b) P1

reuse of materials such as those just mentioned is


PA PB
the principal method by which a composer achieves PA PB PX PY
musical coherence and stability across different mu- RA RB RC P2
sical dimensions (Schoenberg 1967; Sloboda 1985;
Cook 1987; Belkin 1999). Additionally, of course, R1
composers may reuse materials inter-opus. In rele-
vant styles, the general process of musical composi- upon metrical location, or musical context, such as
tion therefore typically requires that the composer the occurrence of a particular chord type. More so-
merge together selected musical fragments to form phisticated examples include the derivation of parts
new constructs. As a consequence, musical materi- from musical events occurring in one or more other
als cannot generally be localized to any particular parts, such as accentuating particular notes through
musical construct. doubling. A key point is that the potential complex-
To take a simple example, non-problematic using ity of hierarchical tangling that may arise from such
conventional systems, a single melodic figure might derivations is, in principle, unlimited. Also, even
be merged with a number of rhythmic variants, simple hierarchical tanglings can lead to unlimited
forming different phrases. Musical materials there- complexity when multiplied or iterated. An equally
fore tend to be explicitly restated and transforma- important related point is that, in a finished score,
tional processes re-applied at each occurrence. compositional intent is often lost, and again these
Hierarchical structures are prominent in music, as derivation processes must be restated and reapplied
indicated by the analytical work of theorists such as wherever they recur. Moreover, if musical frag-
Schenker as well as Lerdahl and Jackendoff (1983). ments are to be specially treated, based upon fea-
However, because the hierarchies formed in differ- tures relating to their derivation, then this too must
ent dimensions do not necessarily align, musical be tracked by the composer because it may not be
compositions tend to contain tangled hierarchies readily apparent from the resultant material itself
and polyarchies. For example, consider a simple (Crochemore, Iliopoulos, and Pinzon 2001).
pitch sequence P1 consisting of two parts PA and Furthermore, whereas music is naturally experi-
PB, and a simple rhythmic sequence R1 consisting enced in a left-to-right fashion, it is not necessar-
of three parts RA, RB, and RC. A single melodic fig- ily composed in this way. Although it is true that
ure constructed from these sequences results in a some composers speak of a spontaneous vision of a
tangled hierarchic relationship in which there is work that simply requires transcription (Sloboda
not necessarily any correspondence between any of 1985), others (e.g., Spiegel 1988) describe detailed,
the parts of P1 and those of R1. This is shown in iterative, evolutionary processes, in which the
Figure 1a. Polyarchic relationships occur when a composition develops from possibly incomplete
node is shared between hierarchies. Consider, for sketches in different musical dimensions and at dif-
example, another pitch sequence P2 that also uses ferent levels of abstraction.
PB, shown in Figure 1b. Tangled polyarchies occur The representation of tangled, multi-dimensional,
when elements from polyarchies in different dimen- polyarchic relationships is difficult and generally
sions are combined. not explicitly represented in computer-music sys-
In addition to deriving core musical materials, in tems. However, recent developments in computer
composing and arranging a musical work composers software, collectively termed aspect-oriented pro-
often make associations between musical context gramming (AOP), seek to address similar types of
and events occurring in orthogonal dimensions. For problem that exist in software. In particular, AOP
example, another simple and non-problematic ex- approaches try to help manage the separation, en-
ample is the modification of dynamic level at a par- capsulation, and subsequent merging together, or
ticular point within a piece of music, either based weaving, of the implementations of separately

48 Computer Music Journal


specified areas of interest or concern. Modern Symmetric and Asymmetric Composition of
object-oriented approaches to software design and Concerns
implementation (e.g., Meyer 1997; Rumbaugh et al.
1991) represent a natural evolution of the module Approaches to AOP are diverse. Some, such as
paradigm suggested by Parnas (1972), enabling Aspectual Components (Lieberherr, Lorenz, and
application-domain and design concerns to be repre- Mezini 1999) apply to specific programming con-
sented as classes that encapsulate both data and the cerns, whereas others, such as AspectJ (Xerox 2002),
operations that may be performed upon that data. Hyper/J (Tarr and Ossher 2000), and Caesar (Mezini
Even so, certain areas of interest remain difficult and Ostermann 2003) address more general separa-
or impossible to encapsulate as classes (Hrsch and tion of concerns. General-purpose approaches
Lopes 1995). From one perspective, the fields and broadly adopt one of two paradigms: symmetric or
methods defined within a class might be further asymmetric. The following paragraphs briefly out-
grouped in terms of the concerns that they address line these approaches. In each case, the reader is di-
and the implementation of a given concern might rected to the references for further detail. Examples
involve a number of methods and fields that extend of these two approaches as applied to music are pre-
across multiple, possibly unrelated, classes. More- sented in later sections of this article.
over, multiple concern implementations may incor- Asymmetric approaches, such as AspectJ (Xerox
porate common code fragments that themselves 2002) and AspectS (Hirschfeld 2002), consider the
have no natural class association. Typical object- augmentation of a base decompositiontypically a
oriented approaches therefore impose a decomposi- standard OO-decomposed programwith cross-
tion scheme that is not sufficiently general to cutting concern implementations. In AspectJ (the
enable separation of concerns. This has been dubbed best-known example of this approach), the base de-
the tyranny of the dominant decomposition (Tarr composition is a normal Java program. Crosscutting
and Ossher 2000). At another level of abstraction, concern implementations, generically termed ad-
certain programming concerns relate to particular vice, are associated with well-defined points,
events that occur within the execution of a pro- termed joinpoints, in the static or dynamic struc-
gram. For example, a tracing concern that pro- ture of the base decomposition. Typically, join-
duces diagnostics that trace entry into selected points are at method calls and variable assignments.
methods typically requires the tracing implementa- Particular joinpoints of interest are specified as
tion to be restated in every method of interest. pointcut expressions, and advice may typically be
These complementary viewpoints identify that run before, after, or instead of (around) the join-
certain concerns tend to be scattered across mul- point. In this way, asymmetric approaches in gen-
tiple, possibly unrelated, classes and intertwined or eral enable standard programs to be non-invasively
tangled with other concern implementations. Be- augmented with separately encapsulated crosscut-
cause such concerns cannot be localized and encap- ting concern implementations.
sulated using the prevailing decomposition, they In contrast, symmetric approaches, such as multi-
are said to be crosscutting. Addressing such prob- dimensional separation of concerns (MDSoC; Ossher
lems is precisely the purpose of AOP and cognate and Tarr 1999) implemented by Hyper/J (Tarr and
techniques. Ossher 2000), consider the construction of software
In this article, we introduce an experimental systems from separately specified components
object-oriented (OO) software system called Aspect- (units) that each address just one concern. In MD-
Music that adapts ideas from AOP to realize an SoC, these components are organized into a multi-
aspect-oriented music representation. AOMR aims dimensional structure called a hyperspace, in which
to provide a general approach to the separation, or- each named unit is associated with a dimension
ganization, and composition of musical concerns name, and the name of a concern within that di-
from both viewpoints outlined herein. mension to which the unit relates. Broadly speak-

Hill et al. 49
Figure 2. HyperMusic class
structure.

ing, using an MDSoC approach, software systems HyperspaceLocator Hyperspace


are composed by specifying those dimensions and
concerns that the resultant system should contain.
As noted in Harrison, Ossher, and Tarr (2002), no
single composition method is suitable for all re-
quirements. Therefore, symmetric and asymmetric <<Dictionary>> <<OrderedCollection>>
ComposedMusicUnit MusicUnit
approaches should be regarded as complementary.

AspectMusic Overview
AspectMusic is an object-oriented, experimental <<OrderedCollection>>
implementation of an AOMR written in Visual- MusicUnitItem
MusicUnitItemCollection

Works Smalltalk (Goldberg and Robson 1989). The


system consists of two interrelated components,
HyperMusic and MusicSpace, that respectively im-
plement symmetric and asymmetric composition
approaches.
HyperMusic provides a framework for abstract- Primitive Composition History

ing, organizing, and representing musical ideas.


Using HyperMusic, the user defines musical materi-
als and transformational processes that are then or-
ganized according to user-defined criteria into a
hyperspace. Declarative specifications are used to the symmetric and asymmetric components of As-
compose new material from the components in the pectMusic in greater detail.
hyperspace. These new components may them-
selves be added to the hyperspace, and thus the
hyperspace becomes an evolving repository of Symmetric Composition of Musical Concerns
compositional ideas. Using AspectMusic
MusicSpace allows components from HyperMu-
sic to be arranged in time, in a manner similar to a The symmetric-composition component (HyperMu-
MIDI sequencer. However, MusicSpace enables mu- sic) of AspectMusic provides an extensible frame-
sic to be dynamically modified based upon context work that supports the definition, organization, and
using an approach that is similar to asymmetric combination of musical fragments (Hill, Holland,
AOP. In particular, modification-strategy imple- and Laney 2006). HyperMusic is heavily influenced
mentations can be modularized and associated with by the notion of hyperspaces (Ossher and Tarr 1999)
particular dynamic musical conditions in terms of and the Hyper/J (Tarr and Ossher 2000) implemen-
pointcut-like events that must be satisfied for the tation of hyperspaces for the Java programming lan-
strategy to be applied. guage. The principal class structure of HyperMusic
To link the two approaches, the construction of is shown in Figure 2.
materials using HyperMusic is audited through a
Composition History that is associated with each
symmetrically composed element. This history is Structuring in HyperMusic
available to MusicSpace. Thus, for any musical
event in MusicSpace, it is possible to determine not Fundamental to HyperMusic is its ability to support
only its current state, but also how it has been de- the separation and combination of musical ideas
rived. In the remainder of this article, we describe from discrete musical dimensions. In this context, a

50 Computer Music Journal


Figure 3. A simple music Figure 4. Schematic of a
fragment. CMU representing the frag-
ment shown in Figure 3.

ComposedMusicUnit

MusicUnit (pitch) MusicUnit (rhythm)

MusicUnitItemCollection MusicUnitItemCollection MusicUnitItemCollection MusicUnitItemCollection


Index #1 Index #2 Index #1 Index #2

MusicUnitItem MusicUnitItem MusicUnitItem MusicUnitItem MusicUnitItem MusicUnitItem


(Voice 1) (Voice 2) (Voice 1) (Voice 1) (Voice 2) (Voice 1)

PitchElement PitchElement PitchElement RhythmElement RhythmElement RhythmElement


G C A 1 beat 2 beats 1 beat

musical idea is generalized as an indexed collection pitch as, say, MIDI pitch values (0127), symbolic
of events relating to the same musical dimension, values such as C#4, or frequency values.
where each event may contain multiple elements Complete musical ideas are typically formed
organized into discrete voices. For example, a from multiple musical dimensions. A melody, for
monophonic rhythmic idea might be expressed as a example, can be viewed as being formed from pitch
sequence of events, where each event contains a and rhythm. In HyperMusic, MUs of different types
single object representing relative onset time and are aggregated into composed music units (CMUs),
duration. A sequence of chords, on the other hand, represented by the class ComposedMusicUnit, in
might be expressed as a sequence of events in which which each component MU is identified by the
each event contains pitch-value representations dis- name of the type it represents. To illustrate the
tributed across multiple voices. structure of CMUs, a simple musical fragment and
In HyperMusic, music units (MUs) represent dis- a schematic representation of the HyperMusic ob-
crete musical ideas in a single musical dimension, jects involved in a CMU representation of the frag-
organized as an ordered collection. Each element of ment are shown, respectively, in Figures 3 and 4.
the ordered collection within an MU contains an or-
dered collection (a MusicUnitItemCollection) of
MusicUnitItem objects that wrap user-defined Combining CMUs
objects representing musical information. The
MusicUnitItemCollection indexes its Music- CMUs are designed to be combined in various ways
UnitItems with values that correspond to discrete to form new CMUs that represent new musical
voices. Conceptually, the wrapped objects each per- material. We adopt the AOP term weaving to de-
tain to the same musical type, such as pitch, rhythm, scribe these combination processes. HyperMusic
or dynamic information. However, HyperMusic supports the musically fundamental notions of se-
does not prescribe the types that can be represented; quential and parallel weaving. However, it is easy
neither does HyperMusic mandate that all wrapped to extend the system to support other kinds of
objects within an MU are of the same class. For ex- weaving corresponding to any method through
ample, a pitch MU might contain MusicUnitItems which two CMUs can be combined, for example
that wrap a mixture of object types that represent weaving appoggiatura or acciaccatura (Honing 1993)

Hill et al. 51
configurations. It is important to note that CMUs code, generically termed transformations, to be
are not constrained to be complete. Although placed in the special MU type #Transform. Like
clearly for final realization, CMUs must contain all other types, the #Transform type is represented by
required musical elements in all required dimen- a MusicUnit structure, enabling ordering to be rep-
sions, at any intermediate stage a CMU can be in- resented. A common use might be to construct
complete in terms of the types that it contains CMUs that contain just one or more transforma-
(vertically) and the number of elements in each tions. However, as we will demonstrate later, the
type (horizontally). Because there is no implied cor- open-ended nature of the CMU structure means
respondence among arbitrary groupings within that the approach also naturally supports CMUs
each type, CMUs are able to support tangled inter- that contain both transformational code and other
dimensional relationships. musical information.

Sequential Weaving Combining and Executing Transformations


When two CMUs are woven in sequence, notated Although, like other types, the #Transform type is
with the binary operator +, those MUs with identi- an MU, the semantics of non-sequential weaving
cal type names are concatenated. If an MU type ap- are not defined for it. Consequently, #Transform is
pears in only one of the woven CMUs, then it is always woven sequentially. However, simply weav-
concatenated with an empty MU. Thus, the set of ing transformations into a CMU does not cause the
MU types contained in the resultant CMU is the transformations to be applied. Rather, transforma-
union of the set of MU types of both the combined tions are executed by evaluating the CMU. This ap-
CMUs. Usefully, this means that if, say, a CMU proach enables sequences of transformations to be
containing only a pitch dimension is sequentially constructed and allows the user to specify when
woven with a CMU containing only rhythm, then these transformations should be applied. Evalua-
the resultant CMU contains the pitch sequence in tion, notated with the unary operator @, causes all
parallel with the rhythm sequence. transformations in a CMUs #Transform MU to be
executed in index order and for a resultant CMU to
be produced that contains no #Transform type. A
Parallel Weaving
CMU without a #Transform type is said to be fi-
When two CMUs are woven in parallel, notated nal, and the result of evaluating a final CMU is the
with the binary operator |, the MusicUnitItem- CMU itself, unchanged.
Collections that exist at the same index in
MUs of the same type name are merged together,
Organizing and Combining CMUs
allowing, for example, the formation of chords.
Like sequential weaving, the resultant CMU con- CMUs represent raw musical data and transforma-
tains the union of the set of MU types of both com- tional processes. However, CMUs are of limited
bined CMUs. value in themselves. Rather, we want to be able to
organize CMUs according to our own ontology, and
by combination, to construct new CMUs by refer-
Transformations ence to this organization. The organizational struc-
ture of HyperMusic, like that of MDSoC, is the
In the foregoing sections, we have described the rep- hyperspace.
resentation of musical data within the CMU model.
However, music composition often involves the al-
Dimensions and Concerns
gorithmic transformation or generation of musical
material. The CMU model supports these require- In the hyperspace model presented in Ossher and
ments by enabling transformational or generative Tarr (1999), units are organized according to the di-

52 Computer Music Journal


mension and concern to which they relate. In this and CMUs. Thus, the hyperspace, represented by
context, dimension and concern are arbitrary tex- the Hyperspace class, is an organized repository of
tual names whose purpose is to represent an organi- musical and transformational fragments repre-
zational structure that transcends the explicit sented as CMUs.
structure of the software itself. In object-oriented A hyperslice is an abstract slice through a hyper-
software, for example, while a class may represent a space, defined by a partial specification of the coor-
prototypical object that exists within some universe dinates of CMUs of interest. For example, we might
of discourse, the fields contained within the class be interested in any CMU in the Themes dimen-
and the operations that may be performed on in- sion, or any CMU in a concern whose name begins
stances of that classmay conceptually pertain to with Ostinato.
different functions or concerns of the system. More-
over, the operations that pertain to a given concern
Combining CMUs
may exist in multiple classes. Thus, because the
dominant, class-based, decomposition of object- The purpose of organizing CMUs into a hyperspace
orientation does not support such a partitioning, it is to facilitate their subsequent composition into
is not easily possible in object-oriented program- new CMUs. The specification of such a composi-
ming to identify only those parts of the class graph tion, represented by an object of the Hypermodule-
that relate to a particular concern. Specification class, contains three key attributes:
There are many established musical representa- one or more hyperslice specifications, a composi-
tions, each with their own musical ontology, and tion expression, and a composition relationship
consequently there is no clear analog of a domi- specification.
nant decomposition in music. Nonetheless, mu-
sic can be considered in terms of independent
Composition Expressions
perceptual dimensions (Loy and Abbott 1985):
pitch, rhythm, dynamics, and timbre. We may also A composition expression specifies the hyperspace
consider music in terms of aggregates of a single coordinates of those CMUs that are to be woven
dimension, such as melodic themes, cells, tone and the weaving operations that are to be per-
rows, harmonic progressions, rhythmic motifs, formed on these CMUs to generate a new CMU.
ormore abstractlyarbitrary parameters and Typical weaving operations, as described previously,
their evolution through generative, transforma- are sequence (+) and parallel (|). Additionally, the
tional, and combinatorial processes throughout a composition expression may cause the evaluation
given musical work. We argue, therefore, that for of CMUs, using the unary operator @. Within the
many purposes it is useful to consider each newly composition expression, CMU coordinates are
generated musical structure as serving some iden- specified in the form dimension;concern;unit,
tifiable compositional purpose that can be attrib- where dimension, concern, and unit are regular
uted to some dimension and concern within the expressions.
work. For example, different melodic fragments For example, consider the two CMUs A and B,
might be used in an antecedent/consequent rela- shown in Figure 5, and the various weavings of
tionship, themes might be associated with extra- these CMUs, shown in Figures 68. For the pur-
musical events in similar ways to Wagners use of poses of this example, assume that A and B exist in
the leitmotiv. the C concern of dimension D. Assume also that A
and B each contain some musical information in
the #pitch dimension, and that A additionally con-
Hyperspace and Hyperslices
tains a transformation T that transposes pitch up by
In HyperMusic, a hyperspace is a data structure that one semitone.
maps between coordinates (consisting of the triplet As shown in Figure 6, the composition expression
of dimension name, concern name, and unit name) D;C;A + D;C;B causes A and B to be sequentially

Hill et al. 53
Figure 5. CMUs A and B. Figure 6. CMU resulting Figure 7. CMU resulting Figure 8. CMU resulting
from the composition from the composition from the composition
D;C;A + D;C;B. @D;C;A. @(D;C;A) + D;C;B.

Figure 7

Figure 5

Figure 8

space. Hyperslice specifications within a hyper-


module specification cause the search space to be
Figure 6 refined by restricting matched names to those exist-
ing in the specified hyperslices rather than the en-
woven, resulting in a CMU whose content is the tire hyperspace. Hyperslice specifications can be
pitch component of A followed by the pitch com- expressed as regular expressions. Figure 9 shows the
ponent of B, and that also contains the transfor- content of several example hyperslices of the fol-
mation T. lowing Hyperspace
The expression @D;C;A results in a CMU that
Themes;Theme1;Opening1
contains the pitch component of A that has been
Themes;Theme1;Closing1
transposed up by one semitone, owing to the evalu-
Rhythms;Theme1;Original
ation (@) of T. The evaluation also causes T to be re-
Rhythms;Theme2;Original
moved from the resultant CMU. This is shown in
Rhythms;Theme1;1stVariation
Figure 7. The expression @(D;C;A) + D;C;B re-
sults in a CMU containing the pitches of A trans-
posed up by one semitone, followed by the Composition Relationships
(untransposed) pitches of B, as shown in Figure 8.
Because composition expressions may specify CMU
Although specifying CMUs in terms of absolute
coordinates as regular expressions, it is possible for
hyperspace coordinates is clearly useful, greater ex-
multiple CMUs to match the specification. A com-
pressive power is achieved from partial specifica-
position relationship specifies how this situation is
tions using regular expressions. By default, CMUs
managed. HyperMusic contains two predefined
are woven in sequence. For example, the composi-
composition relationships, though it is possible to
tion expression Intro;BassGuitar;Fragment.*
add new relationships as required. In the event of
represents the sequential weaving of all CMUs
multiple matches for a CMU, the overrideByName
whose name begins with Fragment and that exist
relationship causes the last match found to be used.
in the BassGuitar concern of the Intro dimen-
Conversely, the mergeByName relationship causes
sion, subject to the hyperslice constraints subse-
all matching CMUs to be woven in sequence. The
quently described.
results of the matching process are always returned
in ascending ASCII order. Thus, in a hyperspace
Hyperslice Specifications containing CMUs given by
To select CMUs for weaving, the CMU coordinates Dim.Concern.Unit1
specified by a composition expression must be Dim.Concern.Unit2
matched against CMUs that exist in the hyper- Dim.Concern.Unit3

54 Computer Music Journal


Figure 9. Example hyper-
slice specifications and
their content.

Hyperslice that R1, say, can be reused within the composition.


Hyperslice Specification
Content We term this kind of adjustment refactoring.
Themes;.* Themes;Theme1;Opening1 In its present form, HyperMusic does not contain
Themes;Theme1;Closing1
any support for automatic refactoring operations.
.*;Theme1 Themes;Theme1;Opening1 However, if we imagine the composition of CMUs
Themes;Theme1;Closing1 being described as a sequence of weaving opera-
Rhythms;Theme1;Original tions, then it is a simple matter to adjust this se-
Rhythms;Theme1;1stVariation
quence such that R is described as being constructed
Rhythms;Theme1 Rhythms;Theme1;Original from R1 and R2, thus making R1 and R2 available
Rhythms;Theme1;1stVariation within the hyperspace but leaving all existing refer-
ences to R intact.

Themes;Theme1;Opening1
Asymmetric Composition of Musical Concerns
the regular expression Dim;Concern;Unit.* using AspectMusic
would be matched by all three CMUs. If the over-
rideByName relationship were used, then The HyperMusic approach to AOMR seeks to en-
Dim.Concern.Unit3 would be returned. If the able musical material, encapsulated as CMUs, to be
mergeByName relationship were used, then a CMU represented, organized, and woven together to form
formed by the sequential composition of Dim.Con- new material through declarative specifications.
cern.Unit1 + Dim.Concern.Unit2 + Although it is possible to realize CMUs as, for ex-
Dim.Concern.Unit3 would be returned. ample, MIDI sequences, the range of musical com-
positions that can be represented in this way is
naturally limited.
Composition History
MusicSpace provides an environment in which
An important feature of music is that musical ideas the events contained within CMUs can be arranged
evolve both inter- and intra-opus. The HyperMusic in time. In this respect, MusicSpace resembles a
approach enables evolution to be defined declara- typical MIDI sequencer. However the distinguish-
tively as hypermodule specifications that define the ing feature of MusicSpace is its ability to enable
weaving or transformation of existing CMUs to music to be modified in relation to context through
form new CMUs. As part of the composition of an approach that mirrors asymmetric aspects in
CMUs, each MusicUnitItem is annotated with a software. The chief advantages of this approach are,
composition history that provides an audit first, that modification processes that occur at mul-
trail of the various weavings and transformations tiple locations (and are therefore crosscutting) can
that have been performed and have caused the item be modularized, requiring them to be stated only
to be in its present location. once, and second, aspects are non-invasivethere is
no requirement to make any particular a priori
arrangements within a CMU for aspects to be ap-
Refactoring
plied to the content of that CMU.
Music composition is obviously a creative and gen- The MusicSpace approach enables compositional
erally iterative process. As such, decisions that are intent to be explicitly and declaratively expressed.
made at some point in the process might be modi- For example, consider Beethovens Sonata in C Mi-
fied at a later point. For example, a CMU might be nor No. 8, Op. 13 (Pathetique). At bars 57, there
constructed as a single rhythmic figure R. At some is a fragment in which the theme is played pp and
later point, it might be decided that R can be use- interspersed with ff interludes. We might suggest
fully considered as two components, R1 and R2, and that Beethovens structural plan was to have pp

Hill et al. 55
Figure 10. MusicSpace
structure.

sections followed by ff sections, irrespective of what Melody CMU1 CMU2 CMU3 CMU4
musical content these sections ended up contain- Bass CMUA CMUB CMUC

ing. Alternatively, Beethoven might have consid-


ered that the ff markings were to be associated with
the musical content of the interludes, irrespective CMUs are not constrained to be contiguous within
of where they were placed. Perhaps, Beethoven a part.
wanted to accentuate those sections that were
played in the lower registers, and so ff should be ap-
plied to any section in which all parts fell below Joinpoints
middle C. From an analytical perspective this is pure
speculation, with some explanations being more As in software, some of types of crosscutting con-
plausible than others. Clearly, whatever the motiva- cerns, termed code-level crosscuts (Bockisch et al.
tion, the resultant score would look the same, and 2004), can be directly mapped to loci in the base de-
the composers intent has therefore been lost. composition. For example, referring to the logging
An example from a more contemporary style example outlined earlier, it would be a relatively
might be to consider a section of a musical work simple matter to automatically modify a programs
containing pitch clusters that have been generated source code by inserting logging calls into the meth-
using a transformation based upon, for example, ods of interest. This type of crosscut could be easily
three parameters; mode, cluster size, and root. As implemented (with the potential loss of traceability
part of this work, the composer wishes to reinforce and intent) as a search-and-replace-style function
particular pitches through doubling on another in- operating on MusicSpacePart objects, for example,
strument, depending, say, upon the mode of the modifying duration to achieve articulation effects.
cluster in which they appear. However, dynamic crosscuts (Bockisch et al. 2004),
Using MusicSpace, the special treatment of whose loci can only be determined at run time,
events, such as alteration of dynamic level or repli- present a potentially more useful class of crosscut-
cation to a different instrumental part, may be sepa- ting concern. In the case of logging, for example, we
rately and reusably encapsulated. Moreover, the might be interested in logging one method but only
compositional intent that associates such addi- if it has been called by another method. Similarly,
tional behaviors with specific conditions, which we might be interested in making particular notes
may include not only features of specific events, but in a given CMU staccato, but only when they are
also features of their derivation, may be declara- played at the same time as another CMU. To sup-
tively specified. port dynamic crosscutting, the aspect model used in
MusicSpace is event-based, conceptually resembling
Axon (Aussmann and Haupt 2003) and the Event-
MusicSpace Structure Condition-Action (ECA) type triggers that are
common in database applications. To generate
A MusicSpace can be considered as a container for joinpoint events and process aspects, the Music-
one or more named MusicSpaceParts. A Music- Space is compiled against an AspectManager object
SpacePart is analogous to a part on an instrumental with which all required aspect objects have been
score, or a track within a MIDI sequencer, and con- registered.
tains CMUs arranged in time, with the restriction When a MusicSpace is compiled, tick events
that CMUs cannot overlap within a Music- are generated and propagated to all MusicSpace-
SpacePart. Figure 10 shows the basic structure of a Parts. These ticks, which by default are generated at
MusicSpace that has been populated with two Mu- a rate of 480 times per beat (giving good resolution
sicSpaceParts: Melody and Bass. The CMUs of n-tuplets), simulate the ticks of a clock source,
within a part cannot overlap; CMUs can, however, such as a MIDI clock. However, it should be noted
overlap between parallel parts. Note also that that, in the current implementation, ticks are not

56 Computer Music Journal


generated in real time, and therefore MusicSpace is history, to be exposed as a set of AspectMusic logic
not a live-performance environment. predicates expressed in the PROLOG-like Smalltalk
Open Unification Language (SOUL; Gybels 2001).
The symbiosis that exists between Smalltalk and
MusicSpace Aspects SOUL enables expressions in either language to be
evaluated from the other.
MusicSpace aspects are implemented as standard
Smalltalk classes that define crosscutting behavior
(advice), along with a representation of the condi- Rendering
tions under which this behavior is to be executed
(pointcuts). An instance of each such class is regis- The current implementation of AspectMusic en-
tered with the AspectManager against which the ables MusicSpace instances to be rendered as MIDI
MusicSpace is to be compiled. sequences by transforming information relating to
At each clock tick, the contents of all Music- pitch, rhythm, and dynamics into MIDI events.
SpaceParts within the MusicSpace are queried to This provides a convenient method of auditioning
build a context that describes all the events that and visualizing generated musical compositions us-
commence at the current tick value. This context ing external MIDI tools. However, it should be
includes all of the composition history that is asso- noted that AOMR and AspectMusic systematically
ciated with each event. The advice associated with a avoid the limitations of any design bias towards par-
MusicSpace aspect is invoked if the current context, ticular rendering means such as MIDI.
including temporal location, satisfies the pointcut
expressions associated with the aspect. In general,
an AspectMusic aspect can modify the content of Conclusions
the current temporal location by manipulating the
events contained within the context. The advice We have proposed an approach to music representa-
may also modify future (or prior) events within the tion that is particularly applicable to styles of music
MusicSpace itself. Both before and after advice types in which musical ideas across various musical and
are supported. Before advice is executed before the non-musical dimensions are merged together to
MusicSpace events contained by the current con- form new musical elements, resulting in tangled,
text are rendered into the resultant MusicSpace, en- polyarchic relationships. We have described aspect-
abling the advice to veto or modify the rendering of oriented music representation, which draws from
any component event of the context. After advice aspect-oriented programming, as a means to explic-
executes once this process has been completed, and itly and declaratively support the organization and
therefore cannot modify the current event. combination of musical and procedural elements
One of the perceived benefits, particularly of separately from the musical material itself. AOMR
asymmetric AOP, is that pointcuts are defined de- supports the symmetric composition of musical
claratively. As MusicSpace is an object-oriented materials in which no one musical dimension is
Smalltalk system, determining whether a pointcut dominant, using a musical hyperspace as a dynamic
is satisfied or not often requires procedural code repository of musical ideas. Moreover, AOMR does
that navigates and queries the object structures of not limit the kinds of musical information that can
the joinpoint context. These kinds of query may be be represented. AOMR also features an asymmetric,
arbitrarily complex and are, therefore, difficult to context-dependent, joinpoint-interception model
generalize in an object-oriented system. This kind through which the selective modification of these
of problem is, largely, more easily solved using logic materials is possible. Because the implementation
programming languages such as PROLOG. To sup- of our AOMR system is open, the full expressive
port declarative pointcut queries, MusicSpace en- power of a general-purpose programming language
ables joinpoint contexts, including composition in this case, Smalltalkis available within AOMR.

Hill et al. 57
An AspectMusic tutorial is available in the Hrsch, W., and C. Lopes. 1995. Separation of Con-
Open University Department of Computing Tech- cerns. Technical Report NU-CCS-95-03. Boston, Mas-
nical Report TR2006/12 (available online at sachusetts: College of Computer Science, Northeastern
computing-reports.open.ac.uk/index.php/2006/ University.
200612). Lerdahl, F., and R. Jackendoff. 1983. A Generative Theory
of Tonal Music. Cambridge, Massachusetts: MIT Press.
Lieberherr, K., D.-H. Lorenz, and M. Mezini. 1999. Pro-
gramming with Aspectual Components. Technical
References Report NU-CCS-99-01. Boston, Massachusetts: College
of Computer Science, Northeastern University.
Aussmann, S., and M. Haupt. 2003. AxonDynamic Loy, G., and C. Abbott. 1985. Programming Languages
AOP through Runtime Inspection and Monitoring. for Computer Music Synthesis, Performance, and Com-
Technical Report. Darmstadt, Germany: 2003 ASARTI position. ACM Computing Surveys 17(2):235265.
Workshop. Meyer, B. 1997. Object-Oriented Software Construction,
Belkin, A. 1999. A Practical Guide to Musical Composi- 2nd Edition. Upper Saddle River, New Jersey:Prentice-
tion. Available online at www.musique.umontreal.ca/ Hall.
personnel/Belkin/bk/. Mezini, M., and K. Ostermann. 2003. Conquering As-
Bockisch, C., M. Haupt, M. Mezini, and K. Ostermann. pects with Caesar. Proceedings of the 2nd Interna-
2004. Virtual Machine Support for Dynamic Join tional Conference on Aspect-Oriented Software
Points. Proceedings of the 3rd International Confer- Development. New York: Association for Computing
ence on Aspect-Oriented Software Development. New Machinery, pp. 9099.
York, New York: Association for Computing Machinery, Ossher, H., and P. Tarr. 1999. Multi-Dimensional Separa-
pp. 8392. tion of Concerns in Hyperspace. Technical Report RC
Cook, N. 1987. A Guide to Musical Analysis. London: 21452 (96717) 16APR99. Yorktown Heights, New York:
Oxford University Press. IBM T. J. Watson Research Center.
Crochemore, M., C. S. Iliopoulos, and Y. J. Pinzon. 2001. Parnas, D. L. 1972. On the Criteria to be used in Decom-
Computing Evolutionary Chains in Musical Se- posing Systems into Modules. Communications of
quences. The Electronic Journal of Combinatorics the ACM 15(12):10531058.
8(2). Available online at www.combinatorics.org/ Pope, S. T. 1991. Introduction to MODE: The Musical
Volume_8/v8i2toc.html. Object Development Environment. In S. T. Pope, ed.
Goldberg, A., and D. Robson. 1989. Smalltalk-80: The The Well-Tempered Object: Musical Applications of
Language. Boston, Massachusetts: Addison-Wesley. Object-Oriented Software Technology. Cambridge,
Gybels, K. 2001. Aspect-Oriented Programming using a Massachusetts: MIT Press, pp. 83106.
Logic Meta-Programming Language to Express Cross- Rumbaugh, J., et al. 1991. Object-Oriented Modeling and
Cutting Through a Dynamic Joinpoint Structure. Design. Upper Saddle River, New Jersey: Prentice-Hall.
Licentiate Dissertation, Vrije Universiteit Brussels. Schoenberg, A. 1967. Fundamentals of Music Composi-
Harrison, W., H. Ossher, and P. Tarr. 2002. Asymmetri- tion. London: Faber and Faber.
cally vs. Symmetrically Organized Paradigms for Soft- Sloboda, J. A. 1985. The Musical Mind: The Cognitive
ware Composition. Technical Report RC22685 Psychology of Music. London: Oxford University Press.
(W0212-147). Yorktown Heights, NY: IBM. Spiegel, L. 1988. Old-Fashioned Composing from the In-
Hill, P., S. Holland, and R. Laney. 2006. Symmetric side Out: On Sounding Un-Digital on the Composi-
Composition of Musical Concerns. Proceedings of the tional Level. Paper presented at the 8th Symposium
5th International Conference on Aspect-Oriented Pro- on Small Computers in the Arts, 25 November,
gramming (AOSD06). New York, New York: Associa- Philadelphia.
tion for Computing Machinery, pp. 226236. Tarr, P., and H. Ossher. 2000. Hyper/J User and Installa-
Hirschfeld, R. 2002. Aspect-Oriented Programming tion Manual. Technical Report. Yorktown Heights,
with AspectS. Technical Report. Munich, Germany: NY: IBM.
DoCoMo Communications Laboratories Europe. Xerox. 2002. The AspectJ Programming Guide. Technical
Honing, H. 1993. Issues in the Representation of Time Report. Stamford, Conneticut: Xerox Corporation.
and Structure in Music. Contemporary Music Review
9:221239.

58 Computer Music Journal

You might also like