ports that fact without providing any details on how
the line can be constructed using Westergaard’s rules;
the student must then download the composition as
a MusicXML file, open it in a music notation edi-
tor, and add annotations to indicate how the line is
constructed; this ensures that the student has internal-
ized the syntax rules. Voice leading reports detail all
infractions, but it is left to the student to figure out
how rectify matters. The student can also compose
offline in music notation editor and then upload a Mu-
sicXML file to the WesterParse site for testing.
WesterParse can also be deployed offline in a
Python environment. In this implementation, in-
tended for music theorists, the user inputs a Music-
XML file and has the option of sending the full set
of legitimate parses to be displayed in a notation pro-
gram. (I use the freeware program MuseScore, but
just about any program that accepts MusicXML files
could be used.) Having the option to display the full
set of final-state interpretations allows the user to as-
sess the reliability of the algorithms. The parser in
this implementation also logs every step of the pro-
cess, thus allowing the user to access all of the inter-
mediate states, like those shown in Figures 4 and 5.
7 THE WESTERPARSE CORPUS
A corpus of examples drawn from Westergaard’s text
was compiled in order to test the validity of the
WesterParse algorithms: 48 single lines and 29 com-
plete examples of species counterpoint. WesterParse
produces some minor deviations from Westergaard’s
analyses, attributable to minor differences in handling
ambiguity. Westergaard, for example, allows rule A1
to attach to a nonfinal pitch, whereas WesterParse
does not. On the whole, however, WesterParse re-
produces Westergaard’s analyses, where they are pro-
vided. The corpus also includes an additional col-
lection of 27 lines and 41 counterpoint compositions,
some of my own invention and others written by stu-
dents. Further testing was performed by a group of 11
students in my Fall 2020 music theory class.
Three samples from the corpus are shown in Fig-
ure 13. The first of these is taken from Westergaard’s
text, where it is intended to illustrate various issues
involving similar motion to a perfect fifth. The upper
line is interesting for the way in which the arrival of
B♭ in bar 7 requires the parser to reinterpret the arcs;
having previously decided that the E in bar 2 passed
to the F in bar 6, it must then reject that arc in order
to connect B♭ to the A in bar 3, effectively postponing
the resolution of E until the line arrives on F in bar 11.
The bass line is notable for the long descent from D to
A, interrupted by a number of secondary structures.
The bass line of the second example also requires
the parser to revise its interpretation in midstream.
The B in bar 4 initially seems to resolve the pass-
ing C in bar 2, but the low D♯ puts that into ques-
tion, requiring that the preceding B be demoted to an
insertion, and restoring the C to the list of open transi-
tions where it will remain until the arrival of B in bar
6. Shown here is one of the two interpretations that
WesterParse generates for the upper line; the other
takes the initial G as A2.
The upper line of the third example illustrates
some of the complexities of third species, where the
rules allow for the elaboration of local harmonies, as
can be seen in bars 5 and 7.
8 EXTENDING WESTERPARSE
Plans for further development of the WesterParse ped-
agogical environment include allowing the student
user to add a syntax interpretation to a line and having
the parser determine whether it is legitimate.
A longer-range goal is to incorporate Wester-
gaard’s analysis of the rhythm of linear elaborations
(chapters 3 and 7), and thus give the parser the abil-
ity to analyze rhythmically differentiated lines. In
order to handle longer lines, the contextualizer will
need to incorporate some form of grouping structure
constraints. Some of the computational challenges of
implementing this sort of analysis are addressed in
(Marsden, 2010).
Developing WesterParse into a program that can
parse more complex lines that unfold in a contrapun-
tal texture will require additional components. One
such component must be a stream segregator that is
able to sort simultaneous notes into different lines. If
the input source is a MusicXML file that is already
divided into single-line parts, as it is in the web ap-
plication, stream segregation is relatively simple. For
more complex contexts, the segregator needs to have
additional abilities. It needs to be able to split simulta-
neously sounding notes into separate streams.
8
It may
also need to monitor the texture, deciding when an ad-
ditional simultaneous note is supplemental and when
it is the inauguration of an additional stream. The seg-
regator also needs to be able to determine whether a
stream is a compound line; if so, it will need to ex-
tract the pitches of the compound line and re-assign
8
For a review of relevant literature on computational
stream segregation and a discussion of a neural network
model for automatic voice separation, see (Weyde and
de Valk, 2015). Also see (Temperley, 2009).