Showing posts with label editing. Show all posts
Showing posts with label editing. Show all posts

Sunday, March 15, 2009

Tabula recompositoria: Amending/Improving Compositions Resembles Software ‘Refactoring’

W    hile composers were [in earlier Centuries] certainly able to work out music in their minds without recourse to writing, at some point the music had to assume a graphic form so that it could be preserved, transmitted, and performed. The evidence suggests that composers employed two different kinds of surfaces for writing down their music: (1) an ‘erasable tablet’ such as a slate that could be used many times and (2) paper. In the period [1450-1600 C.E.] we are considering, the pencil had not yet been invented, so writing on paper meant using pen and ink. Erasure could only be achieved by scraping the ink from the surface of the paper, often resulting in holes in the paper. Paper was therefore a ‘write-once’ medium. Despite the differences in the properties of the two kinds of writing surfaces, composers seem to have used them both in much the same way for all the written stages of a composition, from the earliest sketches to the final version.”
  —  Jessie Ann Owens, p. 74.
 Mozart K.581 Mvt.3 Trio II, mm. 1-12

    [20-sec clip, Umesh Shankar et al, UC Berkeley, 2003, Mozart, K. 581, Mvt. 3, ‘Trio II’, 0.4MB MP3]

M usical sourcecode (the musical score for a composition) is not sacrosanct: we honor the text in our reading of it, but we also take advantage of the interpretive latitude that it affords.

A nd any composer/arranger performs edits upon edits, to clean-up and perfect a work over a period of days to years. Or you create new versions to suit new and different purposes. It’s matter of what software developers would call ‘emergent design’.

Y ou may want to generate a piano reduction, exploding and imploding sectional structures, changing durations and meters, moving layers, manage instrument doublings, etc. .... Johnson’s book (link at bottom of the CMT post) has a good synopsis of these use-cases for MusicXML.

A lternatively, you may want to programmatically change your orchestration and timbres/sonorities, simplify or obfuscate/complexify the rhythms and horizontal relationships, de-risk the voice-leading to make it more natural to perform or sing, change the key to address the realities with regard to black-key biomechanics on keyboards or string-change biomechanics on stringed instruments. More and more use-cases for arrangers and composers!

S uzanne Clercx was the first to document the use of ‘erasable tablets’ by composers when in 1953 she published the discovery of a slate with six staves on each side [termed a ‘tabula compositoria’, ‘cartella’, ‘palierten schiffer stein’, ‘palimpsestus compositorius’, or ‘ardoyse’, depending on the country and century]. MusicXML is simply a latter-day tabula compositoria, that’s all.

W orking as I do on software in my day-job, I am impressed that compositions are homeomorphic to today’s object-oriented software and today’s data networks, including so-called ‘cloud’ computing or ‘software-as-a-service’ (‘SaaS’). All can be complex and difficult to manage.

I  suggest that the root of these problems lies in the complexity of the control and management planes—the orchestration and voice-leading and quasi-protocols coordinating the musical parts; the software and protocols coordinating the objects and network and distributed-services elements—and particularly the way the decision logic and the distributed-systems issues are inexorably intertwined.

I  am impressed that ‘refactoring’ the functionality can improve a composition just as it can improve a piece of software. There is no great profundity or earth-shattering novelty in such a view. It is just something that naturally occurs to any person who spends her/his days working on both software and music.

I  propose three key principles:

  • network-level objectives,
  • network-wide views, and
  • direct control
that I believe should underlie any [new/refactored] architecture, be it an object-oriented software system or a musical composition.

F ollowing these principles, I identify a design pattern that I call ‘4D’, after the architecture’s four planes: decision, dissemination, discovery, and data. A 4D architecture completely separates a network’s/composition’s decision logic from the compositional protocols and performance-practice/runtime protocols that govern the interactions among the network/musician elements.

I n creating a ‘4D’ design pattern, it’s important to remember that MusicXML score files do not represent ‘presentation-level’ primitives such as pages and staff-systems ... such details of formatting will change based on different paper and display sizes. But MusicXML does represent syntactic and semantic concepts of voices (parts) and synchronization among them, segmented into ‘movements’. In the MusicXML environment, in other words, formatting is handled separately from structure and semantics. The same applies for detailed interpretive performance information. Separate MusicXML supersets could be developed to represent individual printings and performances.

R efactoring of MusicXML can, of course, be done off-line—with generation of printed parts and score ahead of performance runtime. My MusicXML source for K.581 Mvt.3 Trio II is here. This (and several Beethoven string quartets) is what I have been testing my prototype MusicXML refactoring engine with this week.

O r the refactoring of MusicXML can be done in realtime—with refactored parts rendered with streaming MusicXML interpreter to be sight-read by the performers, with (I suppose) considerable surprise for artists who are deeply familiar with the original texts—and for listeners as well.

T he realtime MusicXML refactoring works okay so long as the lead-time for the canonical refactoring service is at least one measure ahead of where the musicians are playing. That, to me, seems to be about the minimum for proper scansion and so that phrasing and other effects are not too disrupted.

O f course, this depends on the meter and tempo and the prevailing complexity—things that are making cognitive demands on each performer. If a streaming realtime refactoring is too elaborate, then the aesthetics (and the fun) will undoubtedly suffer.

B eyond this, in principle I suppose one could mike each member of the ensemble and do analog-to-digital conversion of each signal—perform digital signal processing (DSP) and pattern-recognition to impute pitch and interval and rhythm and dynamics deviations from the score—and then use those imputed deviations to drive a refactoring server, to further permute the parts or effect meta-alteration of the downstream score. That’s beyond anything that I’m prepared to attempt right now, but CMT readers with enough studio gear and computational resources may be interested to try it.

    K. 581 Clarinet Quintet (‘Stadler’ Quintet) [1789]
  1. Allegro (A major)
  2. Larghetto (D major)
  3. Menuetto (A major), Trio I (A minor), Trio II (A major)
  4. Allegretto con variazioni (A major)
T he clarinet predominates in K.581 as ‘primus inter pares’ (‘first amongst equals’) as Alfred Einstein once wrote, yet the parts’ roles are more discursive and autonomous than they would be if this were a ‘concertante’ form where the soloist rules.

M y simple experiments initially have dwelt on Mozart’s K. 581, primarily because it is straightforward and familiar. Its interpretive history and performance practice are pretty transparent and well-understood. I wondered, “What if we refactored the Trio II, to render it as an exuberant/obstinate ‘recovery’ from the A-minor Trio I of the 3rd movement?” Okay. Here’s what I get with my canonical XML parser—scanning for and phrase and repeat boundaries in the tokenized MusicXML source.

 Mozart K.581 Mvt.3 Trio II, mm. 1-12
becomes  

 Mozart K.581 Mvt.3 Trio II, mm. 1-12
B asically, my “light” refactoring of K.581 treats every ‘repeat’ structure as a MusicXML ‘class’. You play it through the first time as originally written—that’s the first ‘invocation’ or programmatic ‘call’ to the ‘repeat’ class method with the contents of the bars between the repeat-delimiters as an argument. When you get to the end of the first time through, the method in the ‘main’ class (call it ‘A’) bumps an ‘excursion counter’ and calls the repeat class (call it ‘B’)—with a canonical refactoring argument to dynamically alter the articulation syntax in each part, according to rules I created for my refactoring engine to use.

 DSM Refactoring Engine Architecture
B ut the simple as-written MusicXML source then involves a ‘cycle’ between the ‘main’ class ‘A’ and the ‘repeat’ class ‘B’. If this were a software refactoring, generally we try to eradicate cycles, to localize and manage features and dependencies and to improve reliability and for other reasons. How about doing the same thing in MusicXML, with similar justification? Sure...

 DSM – removing cycles with dependency-inversion DIP
W hat my refactoring of the score does is this:
  • Extract a ‘repeat interface’ BI class from class B. BI contains the methods of class B that are needed by A, to implement the articulations (or other canonical changes that propagate through the quintet’s 5 parts) that we want to be associated with the repeats. The new, refactored class B implements BI.
  • Set all references in class A that aren’t required for object generation from B to BI.
A  simple ‘toy’ example, to be sure, but it is non-trivial—non-trivial in terms of the parser and its embedded logic, and non-trivial in terms of the expressive effects that this has.

I n the end, what we get in this example is a canonical cascading propagation of accents, tenutos, and decrescendos—explicitly amending the expressive sense of the K.581 Trio II. Cool. It works. And it suggests how we could implement other, fancier refactorings and canonical edits.

 Mozart K.581 Mvt.3 Trio II, mm. 1-12 repeat, after canonical XML mark-up with accents, tenutos, diminuendos
M y particular example refactoring of the MusicXML sourcecode for K.581 Trio II is directly analogous to what in the Roock-Lippert software refactoring book is called ‘dependency inversion’ or DIP (see. pp.130-43). Again, I was only exploring here what can be done with current-version MusicXML and refactoring techniques operating on music scores; I am not saying that anything wonderful has been done to K.581 with this attempt. I am only saying that it is interesting, and that it works, and that it may be of interest to you as a composer/arranger or as a music theorist. For CMT readers who are performing artists and avid users of PC-based digital music readers (like Hugh Sung or Nicholas Kitchen) maybe this stuff has interest as well.

T o me, the effort so far seems worthwhile. Yes, MusicXML is not ideal. It’s not a ‘causal encoding format’ and therefore and commands are [must be] used to encode single parts with multiple staves or multiple voices—and so on. While not ideal, MusicXML is the reigning standard that has market-share; it is the ‘bandwagon’ to jump on.

I t’s possible that these refactoring explorations will lead to new MusicXML enhancement-requests or new requirements-specifications for future versions of MusicXML. I’d welcome dialogue with you if you have observations or concerns in that regard. Please email me or comment here if you like. Thanks!

B    rian Foote suggested the name [‘speculative generality’] for a smell to which we are very sensitive. You get this smell when people say, ‘Oh, I think we need the ability to do this kind of thing someday’ and consequently specify all sorts of ‘hooks’ and special-case requirements—to handle things that aren’t in fact required. The result is often harder to understand and maintain. If all this machinery were being used, it would be worth it. But if it isn’t being used, it isn’t [worth it]. The extra machinery [to provide abstract generality] just gets in the way [of clean, effective, testable, maintainable source-code and non-defective solutions] ... Any structure or class that isn’t doing enough to pay for itself should be eliminated ...”
  —  Martin Fowler, p. 83.

A   ndrew Monk and others at University of York in the U.K. It is useful to think about software usability problems as forming a hierarchy with each successive level in the hierarchy requiring more contextualized knowledge. By contextualized knowledge we mean knowledge about a particular user and the goals and priorities which are relevant when the problems are identified. An example of a problem at the bottom of the hierarchy is a user having difficulty in correcting typographical errors because of inadequate delete facilities. This may be a quite general problem independent of the particular user and the task being performed. An example of a problem near the top of the hierarchy is the difficulty that a user might have in understanding how to carry out a database search task on some new system. The problem arises from the user's experience with the system, with other systems and with the task it is being used for and so depends very much on the context. Such problems often have a large impact on usability. By definition, these problems require information about the user's knowledge and beliefs in order to diagnose their cause, and to recommend the changes needed. Work at University of York has attempted to develop methods which elicit increasing amounts of context-sensitive data which can be used to diagnose problems at successively higher levels of this hierarchy and have identified four diagnostic levels. At the first level are problems that can be identified from system logs recorded from unknown users during free use. An approach was developed which identifies problems by isolating redundant user input. These problems can be diagnosed with minimal user-specific or task-specific information. A second level involved the analysis of log data from users completing tasks which have been set by the evaluator of the system. When these tasks are well constrained the system evaluator can use them to gain partial information about the users’ plans and goals when problems occur. This method is not always adequate since strategic differences amongst subjects can make plans and goals difficult to infer. A third level used verbal protocol methods to elicit users’ plans and goals directly. Two methods have been used re-enactment. Re-enactment proved particularly useful for diagnosing problems that could not be diagnosed from log data alone. In this method the user and evaluator discuss problems that the user had experienced during previous sessions.

Techniques that allow for more abstraction
  • Encapsulate Field - force code to access the field with getter and setter methods
  • Generalize Type - create more general types to allow for more code sharing
  • Replace type-checking code with State/Strategy
  • Replace conditional with polymorphism
Techniques for breaking code apart into more logical pieces
  • Extract Method, to turn part of a larger method into a new method. By breaking down code in smaller pieces, it is more easily understandable. This is also applicable to functions
  • Extract Class moves part of the code from an existing class into a new class
Techniques for improving names and location of code
  • Move Method or Move Field - move to a more appropriate Class or source file
  • Rename Method or Rename Field - changing the name into a new one that better reveals its purpose
  • Pull Up - in object-oriented programming (OOP), move to a superclass
  • Push Down - in OOP, move to a subclass
  • Shotgun surgery - in OOP, when a single change affects many classes—all affected code is kept in a single class, so that the change is made only in one place.”


Sunday, September 16, 2007

New England Bassoon Quartet: Re-voicing the Canon

New England Bassoon Quartet
DSM: The New England Bassoon Quartet performance at The Boston Conservatory this afternoon was excellent. NEBQ was founded in May this year. The Quartet is comprised of Ardith Keef (University of Southern Maine, Portland Symphony, Maine Chamber Ensemble, Maine Baroque Ensemble, Isaac Ensemble), Suzanne Nelsen (Boston Conservatory and BSO), Margaret Phillips (Berklee College of Music, Boston Philharmonic, Rhode Island Philharmonic, Portland Symphony), and Janet Polk (University of New Hampshire and Dartmouth College, Vermont Symphony).

CMT: Besides the performance today, NEBQ will also be performing at University of New Hampshire on Saturday 22-SEP.

  • Michel Corrette: Le Phenix
  • Christopher Kies: Arietta in Memory of Francis Poulenc
  • William Schuman: Quartettino
  • Serge Prokofiev: Scherzo
  • Vaclav Nelhybel: Concert Etudes
  • Lowell Shaw: Fripperies Vol. 1

DSM: The Kies arietta was gorgeous. Kies is a pianist and composer at UNH. This arietta was composed earlier this year, expressly for NEBQ. According to Ardith Keef, Poulenc left an unfinished bassoon quartet, which he was writing about the time that he died. Kies’s arietta was composed with that in mind.

CMT: So we have New York Bassoon Quartet, South Minneapolis Bassoon Quartet, Caliban Quartet, and now NEBQ. Are there gender issues that dispose toward all-women bassoon quartets, do you think?

T o paraphrase Jerry Seinfeld, ‘What is it with these all-girl bassoon quartets?’ ”
  —  Jeff Lyman, International Double-Reed Society.

DSM: I don’t think so—nothing different from any other quartet type. No matter the gender of the players, bassoon ensembles can be especially beautiful when they achieve balance and stylistic unity, as the New England Bassoon Quartet members do. There’s superb music-making here, with solid musicianship powering it. Wonderfully lyrical, wonderfully ‘vocal’. Reminds me of Dunn’s and Jones’s ‘Embodied Voices’.

CMT: In Leslie Dunn’s and Nancy Jones’s book, I really admire the essays by Rebecca Pope (‘The diva doesn’t die: George Eliot’s Armgart’) and Elizabeth Tolbert (‘The voice of lament: Female vocality and performative efficacy in the Finnish-Karelian itkuvirsi’). Pope examines the female voice as a means of redress—for disparities and injustices of various kinds—and as instrumental in the exercise of freedom—singing as an act of full-fledged, independent personhood.

Dunn & Jones
DSM: Pope’s diva revises the conceptions of women’s roles and voice—restores a mode and a metaphor of female empowerment. The NEBQ members are not divas per se, but they surely are empowered! And the baritone register of the bassoon suits each of them well.

M en did not say, when I had sung last night, ‘Twas good, nay, wonderful, considering she is a woman’—and then turn to add ‘A baritone would have sung her songs better of course.’ ”
  —  Armgart, George Eliot, Middlemarch, p. 478.

CMT: Tolbert’s essay concerns women’s voices in a Finnish-Karelian idiom (itkuvirsi) that is historically women-only. The cultural function of the laments is iconic—it orchestrates the collective experience of sorrow and grief by the community. The style is also lyrical—emotional to the point of ecstasy; shamanic, even. The women lamenter vocalists serve as conduits to Tuonela, the Finnish-Karelian land of the dead. The singer ‘finds the words’ (löytää sanoja)—and the words gain power through performance. Much like lays and skaldic poetry in other Scandinavian cultures.

W omen cry with words, as opposed to men, who merely cry with the eyes.”
  —  Elizabeth Tolbert, in Dunn & Jones, Embodied Voices, p. 180.

K laudia Rahikainen, while not a lamenter herself, heard lamenting in funeral contexts in her youth and is quite sensitive to the increasing decontextualization and aestheticization of Karelian traditional practices. She criticizes today’s lamenters who ‘lament for money and not for a real occasion ... Prasniekka is a church holiday, but it is also a general word for festival ... Before there weren't laments at prasniekkas, but now there are. It’s now a performance ... The prasniekkas now are lammitetty [‘warmed over’].’ ”
  —  Elizabeth Tolbert in Dunn & Jones, Embodied Voices, p. 183.

DSM: It’s essential that there be genuine improvisation then—extemporaneity in the performance. The voices’ authenticity, living and breathing: the NEBQ are very spontaneous. Engaging interaction with the approximately 90 attendees at their Boston Conservatory recital, too.

CMT: What does it mean for a bassoon to be ‘vocal’ though? The term ‘vocal’ isn’t synonymous with ‘easy’, but, just the same, any song or part is ‘vocal’ if it can be readily sung—with effort but without strain—by the type of voice for which it’s written. This is true of a ‘vocal’ instrumental part as much as is of a ‘vocal’ vocal part.

DSM: Neither an uncomforably high nor an uncomfortably low tessitura, then.

CMT: Right. Vocality is something we’d ascribe to a part that is ‘in-character’, even when that part is recounting or mimicking the experiences of another character. Compositions that are truly ‘vocal’ have, I think, a unity of affect—a coherence of character—a recognizable and natural and stable embodiment of a character.

New England Bassoon Quartet
DSM: The Nelhybel Etudes were delicious. Difficult, the large-scale Allegro vivo forces the players through a long serpentine line. The second and third bassoonists’ music is ‘vocal’ but more angular—less like melody than a rebuttal. The other bassoonists antagonize the first bassoon; imparting a sensation of individual vs. imposter, of false-doubles and the anxiety they generate.

CMT: This sense of anxiety becomes more palpable in the slow third movement. This Canon moves with lyrical introspection and gaunt lines. The first bassoon transgresses reflective borders, from sparse soloistic dimensions into a chamber of throbbing, perseverative shadings. These aren’t saccharine-sweet Etudes to be played quietly on Mothers’ Day.

DSM: The Canon leads into an Allegro fourth movement, where the quartet’s intensity has full expression. The first bassoon spins a line of endless transformation, like a demented singer long having forgotten the actual melody. The other bassoons all the while grow—like an infestation—and eventually converge on the first bassoon. Through this proliferation of musical ideas—evocative of madness? fervor? euphoria?—the first bassoon never ceases. Iconic and shamanistic, a la Tolbert’s Finnish-Karelian lamenters. The four players’ songful convergence on the high unison—not so much an agreement as a fervent concession, don’t you think?

M usical melancholy arises when the protagonist of a work – be it the vocal character in a song or the ‘composer’s voice’ in an instrumental work – exhibits an ironic distance from his or her own pain. The musical dialectics in these works prompt listeners, for their part, to take a step back to contemplate the borders and limits of emotional experience and communication.”
  —  Nancy November, 2007.

CMT: Jonathan Dunsby wrote several years ago that he was unhappy with Lawrence Kramer’s concept of ‘songfulness’ because it’s overly complex, not intuitive enough to adequately cover emotional extremes. The New England Bassoon Quartet’s performance today provides evidence to support Dunsby’s argument—their performance is surely amenable to analysis, but it’s more compelling and accessible and intuitive than would ever require any analysis. Their musical discourse is straightforward, immanent, and aesthetically transparent—not complex or scholarly. Nice!

W hat we hear in a performance of a song is also what we brought to that performance from our own experience, what we remember of it, and what it will become. This is actually the most obvious single challenge to music analysis, and even more of a challenge to that very poor relation of analysis, music criticism: How do you know what you will say about a piece of music tomorrow?”
  —  Jonathan Dunsby, Making Words Sing, p. 140.

S uppose that a particular quality of ‘voice’ attracts your attention, one that is not captured precisely by another performer, or perhaps even by the same performer at another time (or in a different acoustic environment). A recognition of its individual quality implies that some compariston has informed your listening. That comparison can, however, remain entirely tacit until a moment of critical reflection, when it becomes more articulate.”
  —  Naomi Cumming, The Sonic Self, p. 74.

S ongfulness is a fusion of vocal and musical utterance judged to be both pleasurable and suitable independent of verbal content. It is the positive quality of singing-in-itself: ‘just singing.’”
  —  Lawrence Kramer, Beyond Words and Music, in Musical Meaning, p. 53.

A n expressivity of ‘voice’, or ‘singing’, is heard as **belonging** to a sound, not as something that can be separately known in all its specificity. It may well be termed ‘innocent’ in its purity or ‘warm’ in its broad timbral palette, leading to subsequent reflection on why sounds have been marked as conveying such qualities ... The capacity of some violin sounds to convey a quasi-vocal ‘innocence’ or ‘warmth’ as their embedded object is established within a community of discourse—one which habitually links ‘violin’ [or bassoon] with attributes of ‘vocality’.”
  —  Naomi Cumming, The Sonic Self, p. 73.


The Boston Conservatory