Piano vs. Code2015-10-09
3 min read | 779 words
Learning piano is remarkably similar to writing and debugging code, except instead of git repos, you work in muscle memory and mindfulness. Instead of merge conflicts, resolve contradicting interpretations. Instead of commits, apply a solid night of sleep.
Piano and software really are similar creatures. However, people often assume the opposite, and find it mystifying that I do both professionally. After spending most my life behind the keyboards, I’d like to share some of that perspective.
Much like initially skimming a codebase, when tackling something substantial like Gaspard de la Nuit, I begin with the overall landscape. I trace the large sweeping structures, the crucial transition points which indicate how themes interface and develop with each other. This is the search for the story beyond compositional form, the essence, the way the piece delivers emotional impact and memorability, the reason why the music is compelling - much like discovering why code fits together the way it does to accomplish a desired function.
Just as programs are constructed of functions and classes and data structures related by inheritance and encapsulation and recursion… music is composed of phrases and melodies and harmonies related by rhythm and tonality and dynamics (and sometimes recursion as well).
Just as frequently useful algorithms are provided in the base class or standard library… frequently useful musical ideas and technique may be generally ingrained into the hands and ears once, retrievable for any context, rather than painstakingly relearned each time.
Just as it requires patience to craft and maintain readable, correct, tested, and elegant code… it requires patience to build up from slow metronomic work to familiarity and periodic polishing to maintain a personalized musicality and technical ease and fluidity.
Just as a high-level language compiles into machine code, which must reliably execute without memory leaks, generating towering call stacks, continuously and concurrently evolving through time and cache layers, system calls, hardware instructions, registers, the informational migration of electrons across transistors… A pianist interprets music notation into a sequence of reliable muscular and mechanical movements, ideally without tension or exhaustion, generating towering hierarchies of melodies and harmonies, to describe ineffable colors and cadences in rich layers of frequencies which massage the cochlea, acquire emotional root on limbic systems, generate physiological spine-chilling frisson – the cathartic migrations of electrons across neurons, unfolding through time as beautiful music.
On the surface, it appears that code requires the objective, analytical mind, while piano the subjective, aesthetic mind. In reality, both aspects are required in both domains.
However, once I’ve flown above the landscape, I have to actually execute. Here I trek, then crawl over every path. I climb every hill, rustle every leaf, trip over every rock, insufflate every flower cultivated by the composer, inch by inch. Here indeed are the details in which devils live. If you code, this is probably familiar – in the sense that the
last 10% of a project consumes 90% of the time.
This is the endless process of drilling down, isolating and quashing bugs systematically. Time consuming, yes, but when encountering difficulties with the instrument, it is unhelpful to give up and remain bad. One fixes oneself, just as one fixes code.
It’s important to reflect on all error messages and clues, test and shrink possibilities for where the bug lives into ever smaller portions of code, tracing through the offending module, file, parent class, method, until clarity arrives, logical mishap or missing comma glaring from the screen.
Likewise, when musical problems occur, examine both the sound and physicality of ever smaller sections, melodies, and phrases, until that particular approach, jump, or turn of the hand also glares in its need for a better fingering, different timing, or perhaps simply lots of slow repetition. Rinse and repeat forever.
After many years, it is possible to collect a useful personal toolkit built of experience, a greater understanding of patterns and antipatterns, and everything hopefully gets easier and better. Maybe even mastery of some sort occurs.
But what we’re really talking about here is the skill of obtaining skill. Everybody acquires that metaskill to some degree, since basic existence as a human involves continuously considering your problems and asking the right questions about them. Maybe more people could develop this metaskill to a higher degree if certain educational and societal paradigms shifted, increasing the overall competence of human civilization, which would be both cool and desperately needed.
Furthermore, it seems once aptitude in one domain reaches a particularly lofty threshold, that experience becomes abstractly transferable, easing the climbs in any other domain, sort of like a remedy to Dunning-Kruger. Or maybe I’m full of nonsense and should really get back to practicing.
Ghent, Oct 2015