The mechanism behind the human creative process has been on my mind a lot lately, not least because A.I. creations seem to have increasingly become the talk of town. Computational investigation of creativity is nothing new. Preceding the recent resurgence in interest, the 1990s, the decade of Deep Blue, saw burgeoning applications of the then established technology to the arts. While society grapples with such questions as how we can train machines to compose like Bach, one cannot help but ask a more basic question: how did Bach write like Bach?
Right off the bat, we know that Bach did not try to write like Bach; instead, he copied out copious amounts of works by other composers, both ones before him and his contemporaries. While the exact purposes of some of these exercises are up for debate (see the storied Weimar concerto transcriptions, for example), it has been well established from both biographical materials and source evidence that there was a didactic component to this laborious process, if not largely so. By copying and transcribing works he admired, Bach was able to absorb and internalize musical elements of others, from which he developed his own compositional framework. This sounds astonishingly similar to how the current generation of bots are trained: large number of examples coupled with a feedback loop. Whereas the bot went through sophisticated iterations of explicit statistical calculations, the music composition learning machine happened all inside a human head. As Leibniz uncannily predicted in a letter to Goldbach (of the Goldbach Conjecture) in 1712: music is the hidden arithmetical exercise of a mind unconscious that it is calculating [Musica est exercitium arithmeticae occultum nescientis se numerare animi].
Leibniz’s statement not only predates modern artificial intelligent (and psychoacoustics) by about 300 years, but also gives clue to the intellectual backdrop against which Bach composed. Born in Leipzig in 1646, Gottfried Wilhelm Leibniz is perhaps most popularly known today as the rival to Isaac Newton in the dispute over priority of the development of calculus. However, as a true polymath, his influence went far beyond the infinitesimal and reached almost all corners of intellectual inquiry by seventeenth century standards. In an extended version of his doctorate thesis entitled Dissertatio de arte combinatoria (1666), Leibniz set out to device a system that generates all possible knowledge by way of combining elementary concepts through logical rules. The subsequent four years he spent in Paris allowed him access to writings by Descartes, which firmly set him on the path of rationalism and had profound impact on the later development of mathesis universalis, a universal science based on combinatorial treatments of an inventive system of notation.
The ambitious project rooted in the idea of combining primitive elements to generate complex ones harks back to the fourteenth century thinker Ramon Llull from the Kingdom of Majorca. In his Ars Magna, Llull proposed a machinery consisting of concentric circular discs each containing small elements of true statements. By turning the discs against each other whereby producing different combinations of statements, the device was thought to be one for systematic truth discovery. In typical medieval fashion, Llull’s program was steeped in mysticism and dealt mainly with the metaphysical. Nonetheless, through rational impulse he laid the intellectual foundation for the generative power of algebraic operations that gave rise to the mechanist view of creativity three centuries later.
Around the time Leibniz published his Dissertatio, Athanasius Kircher in neighboring Thuringia (Bach’s birth place) applied the same Lullist principles to music composition. The arca musarithmic, or Musical Ark, contained a collection of slats with preset notes and rhythmic patterns. By combination and permutation of these fixed musical elements using rules prescribed by the arca, a person with little music training was able to “compose” four-part polyphony with florid counterpoint. Of course, these rules were written down by Kircher himself and hardcoded into the device via a table (seventeenth century algorithmic composition!) that summarized harmony and voice leading conventions of his day.
It was with such activities leading up to the year of 1685 that Johann Sebastian Bach was born. Within music itself, the linage of learned counterpoint in the German speaking lands during Bach’s time perhaps owes its origin to Zarlino’s canons and invertible counterpoint. From Sweelinck to Praetorius and Reincken to Buxtehude, the prior generations left a vast repertory of compositional models many of which Bach studied diligently. Chief among his own pedagogical works, the Inventions and Sinfonias allowed Bach to lay out essential compositional rules and contrapuntal techniques - distilled from prior masters and refined with his own thoughts - in 30 short pieces. The full title in its awesome Baroque ridiculousness may be familiar to many, but nonetheless is worth a quotation here just to see things explained in Bach’s own words, of which we have precious few:
Honest method by which the amateurs of the keyboard - especially, however, those desirous of learning - are shown a clear way not only (1) to learn to play cleanly in two parts, but also, after further progress, (2) to handle three obligato parts correctly and well; and along with this not only to obtain good inventions (ideas) but to develop the same well; above all, however, to achieve a cantabile style in playing and at the same time acquire a strong foretaste of composition.
Here we understand “invention” to be the discovery of a musical idea - a theme - upon which more elaborate contrapuntal materials are derived. In this collection of miniatures, Bach presented a large variety of polyphonic designs made possible from carefully crafted individual themes, at the same time demonstrating how the chosen theme - the invention - determines compositional outcome.
The notion of invention originates in rhetoric, where inventio is the first of five canons. Evidence abounds that Bach studied rhetoric as a schoolboy and particularly Cicero, who advanced the five rhetorical canons in his De orator. Ars inveniendi, the art of invention or discovery, is also central to the Leibnizian-Cartesian program of mathesis universalis. In both cases, the products of the inventio serve as a basis from which more complex creations arise. In modern algebra terms, these elements effectively form a generating set of a group. Recall that a subset of a group generates the group if every element of the group can be expressed as combinations of elements of the set and their inverses. Remarkably, the algebraic framework not only formalizes the combinatorial nature of invention, but also highlights the pivotal role that theme invertibility plays in contrapuntal composition.
In the last decade of his life, Bach appeared increasingly preoccupied with the theoretical aspect of composition. Though he seldom verbally engaged in the theoretical discourse of his day - the closest to which probably came from Birnbaum’s defense on his behalf against Schiebe - Bach penned several works that lend a laparoscopic view into his mature thinking. The Art of Fugue is seen by many as a sort of empirical treatise, where the monothematic work spelled out almost unbounded contrapuntal possibilities. The Fourteen Canons (BWV 1087) on the Goldberg aria, on the other hand, more directly catalogued operations upon which thematic materials can be spun into musical elaborations. Particularly of interest is the “Etc.” at the bottom of the page below Canon 14:
Casual observation may render this an indication that Bach simply omitted further canonical procedures, perhaps because specific instances are endless, yet there is reason to think that this list was in fact meant to be exhaustive. In light of Leibnizian combinatorial thinking, it is quite possible that Bach understood - though not necessarily in such terms - the infinite generative potential of a finite set, and that these 14 canons were carefully organized so that they encompassed all canons under isomorphism.
At the turn of the twentieth century, French mathematician Henri Poincaré gave a seminal lecture on the nature of mathematical creation. In it, he said:
In fact, what is mathematical creation? It does not consist in making new combinations with mathematical entities already known. Anyone could do that, but the combinations so made would be infinite in number and most of them absolutely without interest. To create consists precisely in not making useless combinations and in making those which are useful and which are only a small minority. Invention is discernment, choice.
Since his own time, continuous attempts have been made to decode and codify the compositional genius of Johann Sebastian Bach. A stripped-down analysis of the oeuvre itself surely sheds light on the thinking behind the work, but as Bach shows us time and again, procedures generate aesthetically agnostic output, however abundant they are, and the art of the composer lies in the choosing.