You are on page 1of 11

Darrell Conklin and Mathieu Bergeron

Department of Computing
Feature Set Patterns in
City University London
United Kingdom
Music
conklin@city.ac.uk

Pattern discovery is an important part of computa- there is no melodic interval pattern that spans the
tional music-processing systems. The discovery of complete fragments, though some events do have
patterns repeated within a single piece is an impor- conserved melodic intervals.
tant step to segmentation according to thematic This article describes a new approach to pattern
structures (Ruwet 1966). Patterns found within a representation and discovery in music, where pat-
few works may be signatures that can be instanti- tern components can contain any number of fea-
ated for style emulation of novel musical material tures and can be as general or as specific as required
(Cope 1991; Rowe 1993) and can reveal a deep by the data. An important concept in this work is
similarity in musical material. Patterns that are subsumption, which provides a natural way to
conserved across many pieces in a large corpus can explore the pattern search space in a general to
represent structural building blocks and used for specific manner, pruning entire branches when
comparative style analysis and music genre recogni- patterns become infrequent. The space of patterns
tion (Huron 2001; Conklin and Anagnostopoulou that may be discovered is very rich, and patterns
2001; Lin et al. 2004). have highly flexible levels of abstraction, much
Pattern discovery methods can be discussed more than is possible with single attribute patterns.
according to the expressiveness of patternsin A well-known fact of knowledge representation is
particular, the levels of abstraction permitted by that increased expressiveness usually leads to in-
pattern components. Many approaches are re- creased time complexity of reasoning (Brachman
stricted to a representation in which every pattern and Levesque 2004). For pattern discovery in par-
component is described using the same musical ticular, allowing pattern components to contain a
attribute: pitch, duration, interval, or fixed combi- flexible and varying number of attributes substan-
nations of these (e.g., linked interval / duration, etc.). tially increases the size of the pattern search space.
In these approaches, an event has only one possible Though the size of this space is substantially re-
representation, and therefore patterns can be effi- duced by the restriction to frequent patterns, when
ciently found using general string algorithms (Gus- there are too many frequent patterns in the search
field 1997) after transforming the corpus to strings space, heuristic algorithms must be employed.
of attribute values. This article presents two algorithms to solve these
Recent methods have considered whether this pattern discovery problems: a complete algorithm
restriction can be relaxed by allowing patterns with and a heuristic probabilistic algorithm.
heterogeneous components and subsumption rela- A large number of patterns can be revealed in a
tions among possible pattern components (Lartillot single piece or corpus, and these patterns must
2004; Cambouropoulos et al. 2005; Conklin and somehow be filtered and ranked for presentation.
Bergeron 2007). The need for such patterns can be In this article, a statistical measure is used to order
motivated with a few melodic fragments (see Figure patterns according to the deviation of their observed
1) from the music of the famous twentieth-century from their expected frequency in the corpus.
French singer and songwriter Georges Brassens The methods developed here are applied to the
(19211981). In both pairs of fragments, the descrip- music of Georges Brassens. The style of Brassens,
tion of events by melodic interval or melodic con- described by Keefe (2002) as sophisticated simplic-
tour alone is inadequate. Though the fragments ity, is well suited for pattern discovery studies. It
within each pair have a common duration pattern, did not change substantially throughout his career,
and his output was prolific: he set over 170 texts to
Computer Music Journal, 32:1, pp. 6070, Spring 2008 music, in addition to over a dozen texts of other
2008 Massachusetts Institute of Technology. well-known French poets.

60 Computer Music Journal


Figure 1. (a)(b): First two
phrases of Brassenss Le
Bistrot; (c)(d): end of the
first two phrases of
Brassenss Tonton Nestor.

(a) (b)

(c) (d)

Methods Table 1. Glossary of Terminology and Notation


Used in This Study
This section provides the necessary definitions and
Term Definition
an overview of the algorithms for pattern discovery.
Some of the definitions and terminology are stan- viewpoint a function computing a property of a
dard in the data mining literature (Agrawal and music event
Srikant 1995; Ayres et al. 2002; Uno et al. 2003), but feature a viewpoint / value pair
there are also a few novelties dealing specifically
with music data mining. For reference, Table 1 an undefined value
provides a summary of notation and terminology feature set a set of features representing a
used in this section. logical conjunction
{} the empty feature set

Events and Viewpoints closed feature set no subsumee feature set has the
same total count in the corpus
An event is a music object within a sequence. feature set pattern a sequence of feature sets occurring
Music objects can be notes, or structured objects in the corpus
such as simultaneities (Conklin 2002) and se-
Cp() the number of pieces having at least
quences (Conklin and Anagnostopoulou 2005). In
one occurrence of the specified
this article, we focus on melody, and we only con- feature set or pattern
sider note objects. A viewpoint is a function that
computes values for events in a sequence (Conklin Ct() the number of non-overlapping
and Witten 1995; Conklin 2006). For example, for occurrences of a feature set or a
the melodic interval viewpoint, the values in the pattern in the corpus
range of the viewpoint are integers representing the Et() pattern expected total count
difference in semitones between an event and its
I() pattern interest measure
predecessor.
Table 2 provides a catalog of viewpoints used in frequent occurring in the corpus with at least
this study. At the top of the table are the primitive the specified piece and total count
viewpoints, namely, those used to select the basic thresholds
attributes of notes. Following this are derived view- infrequent occurring in the corpus below the
points that compute values using the primitive specified piece count or total count
viewpoints. They can be further grouped into unary threshold
(computable from a single event, e.g., pitch class) and maximal frequent a more specific frequent
binary (requiring one preceding event to compute a pattern pattern cannot be found in the
value, e.g., melodic interval or melodic contour). A corpus
potentially unbounded set of derived viewpoints is
available through the use of constructors, which

Conklin and Bergeron 61


Table 2. Viewpoints Used in This Study build new viewpoints from existing ones. In this
study, constructors are not employed, but rather a
Viewpoint Description Range Set
fixed set of derived viewpoints is used.
pitch pitch of event as MIDI Viewpoints are used to transform sequences of
number {0, . . . , 127} concrete events into more abstract sequences. This
key MIDI key signature as is done simply by applying a viewpoint to every
number of sharps (+) event in a sequence. Table 3 illustrates how events
or flats () {7, . . . , +7} in a short melodic fragment (at a resolution of 192
onset onset of event in
ticks per beat) are transformed using the viewpoints
MIDI ticks Z+ of Table 2. The fragment is notated using three flats
in the MIDI key signature (key:-3). Though this
duration duration of event in fragment (and the MIDI files for the Brassens corpus
MIDI ticks Z+
used in the current study) does not contain indica-
ml1 first metric level {t} tion of mode or spelling of pitches, some quasi-
ml2 first or second metric diatonic features can still be computed from the
level {t} MIDI key signature. To do so, major mode is as-
sumed (e.g., E-flat major or ref:3), and quasi-
pc pitch class {0, . . . , 11}
diatonic intervals are computed between pitches
ref pitch class of tonic, standardized to that major key (whole scale steps
assuming major mode {0, . . . , 11} receive a natural n and modified scale steps an
intref pitch class interval augmented s sign on their interval).
from ref {0, . . . , 11} Table 3 also illustrates how a hierarchical attri-
int pitch interval Z bute is represented using feature sets. An event can
occur in the highest metric level beginning a bar
intu unordered pitch interval N (ml1:t and ml2:t), only in a second level (ml2:t;
intpc pitch class interval {0, . . . , 11} in triple meter, both the second and third beats are
intupc unordered pitch class in this level), or in neither (). Note that any binary
interval {0, . . . , 6} viewpoint is undefined () for the first event in the
fragment, and that the intscs and inuscs view-
intscs scale steps; natural or
points are defined only if the first pitch is a major
raised in major mode Z {n, s}
scale degree. Some viewpoints (contour classes,
intuscs unordered scale steps N {n, s} metric level viewpoints) return only a possible
repeat contour class {t} value of t (true). Negated classes for these view-
points (e.g., not a step, not in the highest metric
up contour class {t}
level) can easily be handled, but they do not usu-
down contour class {t} ally represent musically significant pattern compo-
step contour class {t} nents and are not used in this study.
leap contour class {t}
ioi inter-onset interval in Feature Sets and Patterns
MIDI ticks Z+
dc3 three-point duration A viewpoint / value pair is called a feature. These are
contour {<,=,>} notated by a viewpoint name and value separated by
dr duration ratio Q+ a colon, for example, pitch:63 or int:-4. A fea-
ture set represents a logical conjunction of features.
Here, N denotes natural numbers (including 0), Z all integers, Z+ A feature set is instantiated by an event if the event
positive integers, Q+ positive rational numbers, and t true.
has every feature within the set; the empty feature

62 Computer Music Journal


Table 3. Fragment of Brassenss Une jolie fleur Transformed Using the Viewpoints of Table 2

Primitive viewpoints
pitch 63 66 67 63 66 67 63 66 67 65
key 3 3 3 3 3 3 3 3 3 3
onset 0 192 288 384 576 672 768 960 1152 1344
duration 192 96 96 192 96 96 192 192 192 192
ml1 t t
ml2 t t t t
Derived viewpoints (unary)
pc 3 6 7 3 6 7 3 6 7 5
ref 3 3 3 3 3 3 3 3 3 3
intref 0 3 4 0 3 4 0 3 4 2
Derived viewpoints (binary)
int +3 +1 4 +3 +1 4 +3 +1 2
intu 3 1 4 3 1 4 3 1 2
intpc 3 1 8 3 1 8 3 1 10
intupc 3 1 4 3 1 4 3 1 2
intscs 1s 2n 1s 2n 1s 1n
intuscs 1s 2n 1s 2n 1s 1n
repeat
up t t t t t t
down t t t
step t t t t
leap t t t t t
ioi 192 96 96 192 96 96 192 192 192
dc3 < = > < = > = = =
dr 1/2 1/1 2/1 1/2 1/1 2/1 1/1 1/1 1/1
The onset time of the fragment has been shifted to time 0.

set {} is instantiated by any event. For example, the the taxonomy are feature sets, directed links repre-
feature set {pitch:63,int:-4} is instantiated by sent subsumption, transitive subsumption links are
the events at positions 4 and 7 of the melody frag- omitted, and a node is placed between its most spe-
ment in Table 3. A feature set can be specialized by cific subsumers and its most general subsumees.
adding one or more features to the set. The more Figure 2 shows a small feature set taxonomy
general feature set is said to subsume the special- using the five viewpoints step, down, repeat,
ized feature set: all instances of the specialized leap, and up. These viewpoints are used to repre-
feature set are also instances of the more general sent various levels of abstraction of melodic con-
feature set. For example, the feature set {pitch:63} tour classes (Conklin and Bergeron 2007). Note that
subsumes the feature set {pitch:63, int:-4} this taxonomy is not presented as a full lattice of
which in turn subsumes {pitch:63, int:-4, subsets, because some feature sets (e.g., the set
ml1:t}. {step:t, repeat:t}) cannot be instantiated by
The subsumption relation between feature sets any event and are therefore contradictory.
can be visualized as a taxonomy in which nodes of A pattern is a sequence of feature sets. A pattern

Conklin and Bergeron 63


Figure 2. Taxonomy of
melodic contours repre-
sented as feature sets. The
inverted triangle repre-
sents the empty feature set.

where Ct() represents the observed total count in a


corpus and Et() the expected total count. To define
the expected total count, consider a feature set
pattern P = f1, . . . , fn, and let N = Ct({}) (i.e., N is the
total number of events in the corpus). The (non-
down:t step:t repeat:t leap:t up:t overlapping) total count of the pattern can be no
more than N / n (the number of events in the corpus
divided by the length of the pattern). The expected
total count in the corpus is this maximum quantity
step:t leap:t step:t leap:t multiplied by the probability of the pattern:
down:t down:t up:t up:t N
Et(P) = p( f1 , . . . , fn) (2)
n
occurs in (i.e., is instantiated by) a contiguous event The probability of the pattern is computed using a
sequence if the component feature sets of the pat- zero-order model (assuming independence of suc-
tern are instantiated by the corresponding events. cessive events); this is the product of the relative
For example, the pattern [{int:+3,dc3:<}, frequencies within the corpus of the component
{int:+1}] occurs at positions 2 and 5 of the mel- feature sets of the pattern:
ody fragment in Table 3. In a corpus, the total count n
Ct( fi)
of a pattern is the number of positions in which it p( f1 , . . . , fn) = (3)
occurs (not counting overlapping occurrences). The i =1 N
piece count of a pattern is the number of pieces that The pattern interest can be computed rapidly since
have one or more occurrences of the pattern. A the raw feature set counts emerge directly from the
frequent pattern is one that occurs with at least a first phase of the pattern discovery algorithm, as
specified minimum total count and piece count. described below.
Consequently, a frequent pattern will not contain
infrequent feature sets as components. A maximal
frequent pattern is a frequent pattern whose compo- Pattern Discovery Algorithms
nent feature sets cannot be further specialized with-
out the pattern becoming infrequent. In this section, two algorithms for pattern discovery
are developed. The first algorithm is complete and
finds all maximal patterns, and the second is an
Pattern Interest Measure optimization algorithm that uses a probabilistic
hill-climbing approach and is suited to rapidly find a
Patterns can be ranked according to the difference single interesting pattern in one or two pieces. This
between observed and expected counts in a corpus algorithm is heuristic and therefore guarantees nei-
(Conklin and Anagnostopoulou 2001; Huron 2001), ther that the pattern found will be maximal nor the
similar to methods for ranking word collocations in most interesting, but it can be used to search large
natural language (Manning and Schutze 1999). Large search spaces that may arise when the specified
differences between observed and expected counts minimum total and piece count are low.
indicate potentially interesting patterns. Here, a
pattern P is given a pattern interest measure I(P)
Complete Algorithm
that represents the ratio of observed to expected
counts: A corpus (which may be one, two, or any number of
pieces) is first transformed to feature-set sequences
Ct(P) by saturation, i.e., applying each viewpoint in a
I(P) = (1)
Et(P) catalog to every event in every piece (as illustrated

64 Computer Music Journal


Figure 3. Taxonomy of
closed frequent feature
sets in Brassens, piece
count 132.

dc3:>
2921 0.26

intupc:2
3354 0.30

intref:4
1944 0.17

down:t
4635 0.41

intu:2 intu:2
dc3:=
intupc:2 intupc:2
dr:1/1
step:t intuscs:1n
5460 0.48
3294 0.29 step:t
11273 1.00
3114 0.28
dc3:<
intuscs:1n
2760 0.24
step:t
4338 0.38 intuscs:1n
step:t
step:t
4966 0.44
step:t ml2:t intuscs:1n
ml2:t 2264 0.20 step:t
intref:0 2604 0.23 ml1:t
2208 0.20
step:t ml2:t
ml1:t ml1:t 1414 0.13
ml2:t ml2:t ml2:t
5392 0.48 2958 0.26 1614 0.14

up:t up:t
4366 0.39 ml2:t
2132 0.19

in Table 3). The pattern discovery algorithm then efficiently computed using the method of Uno et al.
proceeds in two phases. In the first phase, all fre- (2003). This set is further pruned to those having at
quent feature sets are found and configured into a least the minimum specified piece count.
taxonomy using a description logic classification Figure 3 displays the subsumption taxonomy of
algorithm (Brachman and Levesque 2004), which closed feature sets from a corpus of 132 pieces com-
places each feature set between its most specific prising 11,273 events (the Results section describes
subsumers and its most general subsumees. Because this corpus in more detail), using the viewpoints
a frequent pattern cannot have an infrequent feature provided in Table 2 and restricted to feature sets
set as a component, the potential feature-set space occurring in all 132 pieces. At the bottom of each
may be restricted to those feature sets that actually node of the taxonomy are the total count of the
occur frequently in the corpus. Furthermore, it feature set and the relative frequency of the feature
suffices to consider only closed feature sets, namely, set in the corpus. For example, 48% of all events
those that do not subsume any other feature set have the feature ml2:t, and 19% of all events are
with the same total count. This is because all com- further specialized to include the feature up:t.
ponents of a maximal pattern must by implication The second phase of the discovery algorithm
be closed feature sets. The set of all closed feature explores the specialization space of frequent feature
sets that are frequent in their total count can be set patterns in the search for maximal frequent pat-

Conklin and Bergeron 65


terns. This space can be fully visited by recursively minimal changes to its instance map and will there-
applying two refinement operators (Ayres et al. 2002) fore usually lead to a frequent pattern. To avoid
beginning at the empty pattern: an I-step, which reporting maximal patterns that end with chains of
specializes the right-most component of a pattern empty feature sets, every node in the search space
by walking one step down the feature set subsump- contains a pointer back to the node of the last I-step
tion taxonomy (there may be several such special- in the specialization chain, and when a maximal
izations), and an S-step, which appends the empty frequent pattern is reported, this link is followed to
feature set {} to a pattern. For example, referring to determine the appropriate pattern for presentation.
the closed feature set taxonomy of Figure 3, I-steps Avoiding patterns beginning with an empty feature
applied to the single component pattern [{step:t}] set is accomplished simply by requiring the first
would yield the three patterns [{intu:2, refinement applied in the search to be an I-step.
intupc:2,step:t}], [{intuscs:1n,step:t}],
and [{step:t,ml2:t}]. The S-step would yield
Heuristic Probabilistic Algorithm
the single pattern [{step:t},{}].
A depth-first search using these refinement opera- The size of the search space of frequent patterns is
tors is used to explore the pattern space. All search determined by several factors including the number
nodes have an instance map, implemented as an of viewpoints in the catalog, the size of the corpus,
associative array that maps piece / position pairs to a and the specified piece-count and total-count
Boolean value indicating whether the pattern at the thresholds. For corpus analysis tasks in which
node occurs in the piece at the indicated position. patterns are required to occur in a substantial
When an S-step or I-step is applied, a new instance fraction of the pieces, entire branches of the search
map is generated by intersection with the maps of space can be pruned quite early. For larger search
the empty feature set (S-step) or the specialized spaces, a heuristic probabilistic hill-climbing
feature set (I-step), taking into account an appropri- method can be used. This method is similar to the
ate position offset. The empty feature set {} has a Gibbs sampling methods used for protein motif
fully saturated instance map, as it occurs in every discovery (Lawrence et al. 1993). The interest mea-
piece at every position. After the initial construc- sure (Expression 1) is computed for all candidate
tion of the instance maps for all closed feature sets, specializations (produced by all possible I-steps and
the corpus does not need to be probed again, and the S-step), and one of these is sampled. The prob-
pattern counts emerge directly from instance-map ability p of sampling a pattern P from the set Q of
intersection. If the pattern counts indicate that a all candidate specializations is
candidate specialization is infrequent, the current
branch of the search can be safely terminated. This I(P)
p(P,Q) = (4)
is because any pattern that is a specialization of an q Q I(q)
infrequent pattern will also be infrequent.
To avoid redundant computation, it is important and the sampled pattern then becomes the new
to avoid visiting any pattern in the search space current pattern. The process begins at the empty
more than once. This can be achieved by converting pattern and is iterated until there are no further
the taxonomy into a tree after the first phase by candidate specializations (i.e., until no candidate
breaking all but one subsumption link pointing specialization is frequent). To reduce the effect of
into a node, thereby ensuring that no feature set is climbing to solutions with low pattern interest, a
visited by more than one chain of I-steps. The random restart method is employed. The probabilis-
dashed links in Figure 3 indicate one possible set of tic hill-climbing search is restarted a fixed number
subsumption links that can be removed to produce of times, and the most interesting pattern arising
a tree. from all iterations is reported. In the heuristic algo-
An S-step (appending the empty feature set) ap- rithm, the taxonomy of frequent feature sets is not
plied to a frequent pattern will usually produce only converted to a tree, because it is necessary to in-

66 Computer Music Journal


spect all specializations of a pattern to compute the Table 4. Some Feature Set Patterns Found in the
set Q (used in Expression 4). Brassens Corpus
Pattern Cp Ct

Results [{dc3:>},{dc3:<}] 132 2114


[{down:t},{up:t}] 132 1935
Georges Brassenss songs (Brassens 1993) in MIDI
format were collected from various online sources [{down:t},{ml2:t}] 132 1852
and prepared for analysis. The onsets and durations [{dc3:>},{dc3:<},{},
of notes were appropriately quantized, the melody {dc3:=, dr:1 / 1}] 129 988
line was isolated, instrumental introductory and
[{step:t},{down:t,
concluding material were removed, and repetitions
ml2:t},{dc3:<}] 125 602
of stanza and chorus material were also removed.
Internal key and time signature changes were cor- [{up:t},{},{intuscs:1n,
rectly handled. This process led to a corpus of 132 step:t},{down:t}] 126 760
melodies, comprising a total of 11,273 notes. The The top half shows three patterns found in all pieces; the bottom
corpus was then saturated as described herein with half contains three patterns found in at least 125 pieces.
all 23 viewpoints presented in Table 2.
Three types of analysis are illustrated here using has length 4 and covers an event sequence of length
the pattern discovery method: corpus analysis 5, because the first feature set contains the binary
(patterns found in many pieces), comparative anal- feature up:t. Instances of the pattern begin with a
ysis (patterns found in two pieces), and intra-opus melodic motion upwards, then any event can follow
analysis (patterns occurring two or more times in a and the pattern ends with an event having a down-
single piece). Patterns were allowed to have at most ward melodic motion. In addition, the penultimate
one empty feature set, and they were required to event in the sequence is further restricted according
have a pattern interest of greater than 1. For com- to a scale step feature and must be a step of exactly
parative and intra-opus analyses, the piece count one scale degree. The pattern occurs in 126 pieces of
was set to 2 and 1, respectively, the minimum total the corpus and has a total count of 760.
count was set to 2, and the heuristic probabilistic The musical relevance of the pattern can be il-
algorithm was used with 10 iterations. lustrated by two instances of the pattern within
the song Le vieux Lon (see Figure 4: the pattern
covers the last five events of each fragment). Note
Corpus Analysis how the empty feature set in the second position
is filled by a leap up in the first instance and by a
With a piece-count threshold of 132 pieces (i.e., step movement down in the second. Though the
requiring patterns to be present in all pieces in the presented pattern is maximal for the corpus, it is
corpus), there are 20 closed frequent feature sets not for the particular instances of Figure 4. The
(Figure 3) and only three general patterns are re- instances from Le vieux Lon could be captured
ported (the top three patterns of Table 4). With a more precisely by specialization, for example, add-
piece-count threshold of 125 pieces (i.e., 95% of the ing the feature intscs:-1n to the last feature set.
corpus), there are 134 closed frequent feature sets, The resulting specialized pattern, however, would
and 100 patterns with interest greater than 1 are not be maximal, as it would be found within less
found; three selected patterns are displayed in Table than 95% of all pieces in the corpus. Finally, note
4. The first pattern refers only to duration features, that the third component of the pattern could be
the second to a mix of duration and pitch features, presented more succinctly, because the feature
and the last only to pitch features. The last pattern intuscs:1n implies the feature step:t. (This is
is chosen here to illustrate the results. This pattern further highlighted by the fact that the feature set

Conklin and Bergeron 67


Figure 4. Two instances of Figure 5. First two phrases
the last pattern of Table 4 of Brassenss (a) Les quatre
in Brassenss Le vieux bacheliers and (b) Rien
Lon. jeter.

(a)

(b)

intuscs:1n is not closed in the corpus; see


Figure 3.)
The patterns in Table 4 all have an observed to major tonic (intref:2), a melodic interval of 2
expected ratio greater than 1, computed using the occurring at the second metric level, with a dura-
zero-order model of expectation (Expressions 2 and tion of a dotted eighth, three times that of the pre-
3). To verify this against a different model of expec- ceding note. Note again that this pattern component
tation, the Essen folksong collection (Schaffrath is not presented in the most compact form, as the
1995), comprising approximately 6,000 songs con- melodic interval feature int:-2 implies several
taining a total of about 300,000 events, was scanned other features (e.g., intu:2, step:t, down:t) that
with each pattern in Table 4. All patterns were could be omitted to improve readability.
found to have higher relative total count in the
Brassens corpus. Interestingly, the fifth pattern in
Table 4 has a relative total count three times that of Intra-Opus Analysis
the Essen corpus. This pattern covers four events,
with a melodic motion of a step, a motion down to The motivating musical fragments presented earlier
the second metric level, followed by a note of in Figure 1 were both identified using the probabi-
shorter duration. listic heuristic, pattern discovery method. In Le
Bistrot, a pattern of length 15 is discovered, cover-
ing exactly the first two phrases of the piece. For
Comparative Analysis example, the pattern components aligning the first
and last events of the Le Bistrot fragments are the
Comparative analysis, taken here to mean the com- feature sets
parison of two pieces for shared patterns, is a very
{pitch:60, pc:0, intref:9, key:-3, ref:3,
challenging task outside of the typical application
ml1:t, ml2:t, duration:96}
of comparison of melodic variations of a theme.
{key:-3, ref:3, step:t, dc3:>, ml2:t, ioi:96,
Figure 5 shows two phrases from Brassenss Les
intu:1, intupc:1}
quatre bacheliers and Rien jeter. The pieces have
a similar overall form: four phrases, each having The last feature set is satisfied by any event in-
initial notes in a convex shape, followed by a few volving one scale step (either up or down) a key of
cadential notes. A pattern was found that aligns the 3 (major tonic 3, or E-flat major), a longer duration
first two phrases of the pieces; the feature set of one than previous note, and an inter-onset interval of
component of the pattern, covering the B3 / E4 in the one eighth-note in duration. This and all feature
second bar, is sets appearing in the pattern are naturally quite
specific, as they are required only to occur twice in
{intuscs:1n, intref:2, down:t, step:t, dc3:>,
the piece.
dr:3 / 1, ml2:t, duration:288, ioi:96,
In Tonton Nestor, a pattern of length 14 is discov-
int:-2, intu:2, intpc:10, intupc:2,
ered, covering the two fragments presented in Fig-
intscs:-1n}
ure 1. For example, the pattern components aligning
This pattern component refers to several specific the first and last events of the Tonton Nestor frag-
features: an interval of two semitones from the ments are the feature sets

68 Computer Music Journal


{intuscs:r, key:4, ref:4, repeat:t, dc3:<, cal measure based on the deviation of observed from
dr:1 / 3, ml1:t, ml2:t, duration:64, expected pattern total count in the corpus. In this
ioi:192, int:0, intu:0, intpc:0, intupc:0, study, for simplicity, the analysis corpus itself was
intscs:0} used to construct a zero-order model of pattern
{key:4, ref:4, leap:t, dc3:>, dr:4 / 1, ml1:t, component frequencies, which, though not optimal,
ml2:t, duration:384, ioi:96} does in practice yield some interesting patterns
toward the top of the report. More realistic back-
The last feature set refers to a key of 4 (major ground models and interest measures employing
tonic E major), a duration of a half-note, and a leap relative frequencies in comparison repertoires could
to a longer event (with a duration of four times the be explored.
previous note) on a strong beat. The aim of this research is that an analyst should
have available a large feature catalog and should not
need to restrict a priori the features used to describe
Discussion and Future Work the data nor to predict how they will combine into
interesting feature sets and patterns. The algorithm
This article has developed and applied a new pattern and results presented here suggest the practicality
representation for music data mining. The represen- of moving towards this more expressive representa-
tation, inspired by sequential data mining represen- tion for music patterns.
tations (Agrawal and Srikant 1995), allows any
number of features in components of patterns, with-
out restriction to a single viewpoint. The feature-set Acknowledgments
representation captures and extends recent innova-
tions (Lartillot 2004; Cambouropoulos et al. 2005; An earlier report of this work was presented at the
Conklin and Bergeron 2007) in the field of musical IJCAI 2007 Music-AI Workshop (Bergeron and
pattern discovery in a simple and elegant way. For Conklin 2007), and we thank the workshop organiz-
pattern discovery, pattern components may con- ers for making the event possible. Taxonomies were
tain as many or as few features (including the pos- drawn with the Graphviz tool and music layout
sibility of an empty feature set) as are necessary to performed with the Lilypond package. Mathieu
ensure that the whole pattern is frequent yet also Bergeron is supported by a scholarship from Fonds
maximal. The methods were illustrated on melo- Qubcois de la Recherche sur la Nature et les
dies by the French composer and songwriter Technologies (FQRNT) and a Ph.D. fellowship from
Georges Brassens. City University London.
The tasks of melodic similarity (Mongeau and
Sankoff 1990) and intra-opus pattern discovery in
music are closely related; conserved patterns can References
indicate melodic similarity. In contrast to the work
on melodic similarity and on sequential pattern Agrawal, R., and R. Srikant. 1995. Mining Sequential
mining (Agrawal and Srikant 1995), the pattern- Patterns. Proceedings of the Eleventh International
discovery method developed here does not permit Conference on Data Engineering. New York: IEEE
Computer Society Press, pp. 314.
insertions or deletions of events while computing
Ayres, J., et al. 2002. Sequential Pattern Mining Using a
pattern occurrences. Such a facility could be intro- Bitmap Representation. Proceedings of the Interna-
duced, but care should be taken in the algorithm to tional Conference on Knowledge Discovery and Data
handle binary features that refer to previous events Mining. New York: ACM Press, pp. 429435.
and to manage the increase in the complexity of Bergeron, M., and D. Conklin. 2007. Representation and
pattern-occurrence counting. Discovery of Feature Set Patterns in Music. Proceed-
The method used for ranking patterns is a statisti- ings of the International Workshop on Artificial Intel-

Conklin and Bergeron 69


ligence and Music. San Francisco, California: Morgan Huron, D. 2001. What is a Musical Feature? Fortes
Kaufmann, pp. 112. Analysis of Brahmss Opus 51, No. 1, Revisited. Mu-
Brachman, R., and H. Levesque. 2004. Knowledge Rep- sic Theory Online 7(4). Available online at www
resentation and Reasoning. San Francisco, California: .societymusictheory.org / mto / .
Morgan Kaufmann. Keefe, S. 2002. Sophisticated Simplicity: Text and Music
Brassens, G. 1993. Pomes & Chansons. Paris: ditions in the Early Songs of Georges Brassens. Tijdschrift
du Seuil. voor Muziektheorie 7(1):1123.
Cambouropoulos, E., et al. 2005. A Pattern Extraction Lartillot, O. 2004. A Musical Pattern Discovery System
Algorithm for Abstract Melodic Representations That Founded on a Modeling of Listening Strategies. Com-
Allow Partial Overlapping of Intervallic Categories. puter Music Journal 28(3):5367.
Proceedings of the Sixth Annual International Confer- Lawrence, C., et al. 1993. Detecting Subtle Sequence
ence on Music Information Retrieval. London: Queen Signals: A Gibbs Sampling Strategy for Multiple Align-
Mary University of London, pp. 167174. ment. Science 262(5131):208214.
Conklin, D. 2002. Representation and Discovery of Lin, C.-R., et al. 2004. Music Classification Using Sig-
Vertical Patterns in Music. In C. Anagnostopoulou, nificant Repeated Patterns. Proceedings of the Eighth
M. Ferrand, and A. Smaill, eds. Music and Artificial International Conference on Database Systems for
Intelligence: Lecture Notes in Artificial Intelligence Advanced Applications. Berlin: Springer, pp. 508518.
2445. Berlin: Springer-Verlag, pp. 3242. Manning, C., and H. Schutze. 1999. Foundations of
Conklin, D. 2006. Melodic Analysis with Segment Statistical Natural Language Processing. Cambridge,
Classes. Machine Learning 65:349360. Massachusetts: MIT Press.
Conklin, D., and C. Anagnostopoulou. 2001. Representa- Mongeau, M., and D. Sankoff. 1990. Comparison of
tion and Discovery of Multiple Viewpoint Patterns. Musical Sequences. Computers and the Humanities
Proceedings of the 2001 International Computer Music 24(3):161175.
Conference. San Francisco, California: International Rowe, R. 1993. Interactive Music Systems: Machine
Computer Music Association, pp. 479485. Listening and Composing. Cambridge, Massachusetts:
Conklin, D., and C. Anagnostopoulou. 2005. Segmental MIT Press.
Pattern Discovery in Music. INFORMS Journal on Ruwet, N. 1966. Mthodes dAnalyse en Musicologie.
Computing 18(13):285293. Revue Belge de Musicologie 20:6590.
Conklin, D., and M. Bergeron. 2007. Discovery of Gen- Schaffrath, H. 1995. The Essen Folksong Collection in
eralized Interval Patterns. Proceedings of the Fourth the Humdrum Kern Format. Stanford, California:
Sound and Music Computing Conference. Lefkada, Center for Computer Assisted Research in the Human-
Greece: National and Kapodistrian University of Ath- ities at Stanford University.
ens, pp. 149152. Uno, T., et al. 2003. LCM: An Efficient Algorithm
Conklin, D., and I. H. Witten. 1995. Multiple Viewpoint Enumerating Frequent Closed Item Sets. Proceed-
Systems for Music Prediction. Journal of New Music ings of the Workshop on Frequent Itemset Mining
Research 24(1):5173. Implementations. Aachen, Germany: CEUR Workshop
Cope, D. 1991. Computers and Musical Style. Madison, Proceedings.
Wisconsin: A-R Editions.
Gusfield, D. 1997. Algorithms on Strings, Trees, and Se-
quences. Cambridge, UK: Cambridge University Press.

70 Computer Music Journal

You might also like