Reprogramming the piano

Dan Tepfer plays jazz with code.

Dan Tepfer is an acclaimed jazz pianist and composer who has played venues from Tokyo's Sumida Triphony Hall to New York's Village Vanguard. He also has a degree in astrophysics and writes computer programs.

Born to a mother who sang in the Paris Opera and a plant-geneticist father who brought a Macintosh Plus home in the 1980s, Tepfer sees the worlds of art and science as entirely complementary. Algorithms and improvisation both drive his work.

In his latest project, Acoustic Informatics, Tepfer uses a player piano, the automated instrument that occasionally appears in airports and Wild West saloons. Next month, he will present his first concert in New York City -- where he's lived for more than a decade -- to showcase this project at the Jazz Gallery, a venue known for its experimentation.

Essentially, Tepfer has hacked and rewritten the way a piano works.

Every time Tepfer hits a note, the Yamaha Disklavier -- his digital player piano -- sends the information via MIDI to his laptop, which instantly shoots back an algorithmic response that causes other keys to play themselves.

Using SuperCollider, an open-source programming environment for musicians, Tepfer writes rules that determine how the player piano reacts to his every manual strike of the keyboard. Mostly, these rules create echoes of the melodies Tepfer plays. One algorithm plays the same note but one octave further down the piano; another turns each musical phrase eerie by following it with cascading sets of five notes in a pattern called a minor ninth.

When Tepfer strings together a melody, extra keys start to shimmer on their own alongside his fingers. The effect makes it seem as if he has four hands playing simultaneously, all of them in sync. The architecture of the piece was created by algorithms, but the notes themselves are improvised. "I'm writing how the music works rather than writing the actual music," says Tepfer. The sounds his Disklavier creates are deeply organic but would not be possible without technology.

As Tepfer plays, SuperCollider sends the data to a programming environment called Processing, which Tepfer uses to write visualizations. Each algorithm has a different graphical style that maps out both Tepfer's notes and the player piano's.

"Dan is, perhaps you could say, part of a new breed of improviser-slash-technologist that really has a strong foothold in both camps," says Joseph Branciforte, another jazz musician and programmer who has been friends with Tepfer for two years. "I don't know that there are that many generations of people that would have grown up knowing these types of possibilities from a young age."

Born to parents from Oregon but raised in Paris, the bilingual Tepfer is predisposed to think outside basic binaries like American versus French, art versus science, structure versus freedom.

"Part of growing up in several cultures at once is that I think I take institutions a little bit less seriously," he says. "You grow up as a very young kid realizing that all these cultural norms are very relative, and that really influences the way you see things."

Around age nine, Tepfer began playing with HyperCard, a pre-internet programming tool on early Mac computers. By the time he was in his teens, he was coding in BASIC before teaching himself the programming language C from a book. Tepfer made games of Pong, 3D renders and line art from equations.

At the same time, he was studying classical piano at Paris' Conservatoire Paul Dukas music school while learning jazz and writing music. College took him to Edinburgh, Scotland, for a bachelor's degree in astrophysics before a master's in jazz at New England Conservatory, in Boston. Today, in his Brooklyn apartment adjacent to Prospect Park, Tepfer keeps photos of pianists Glenn Gould, Thelonious Monk and Igor Stravinsky on the wall beside his grand piano. Next to those are digitally rendered visualizations of harmonic frequencies.

For Tepfer, science and art have always been compatible. "I think you're greatly enriched if you can go between those two viewpoints," he says. "There only is a tension between those two ways of seeing the world if you're approaching music at what I would say is a relatively basic level."

His point is that freedom only really exists, and therefore has meaning, within an underlying, objective structure. Unlimited freedom in music would sound like a garble of notes, sheer chaos.

After all, music, on one level, is physics -- frequencies relating to each other mathematically to create harmony. Keys and timing create a logical structure in which meaningful sound exists. Classical composers like Bach imposed their own rules, such as playing the same musical phrase over and over but in different timing and different spots across the musical scale -- a touchstone for some of Tepfer's algorithms.

In improvisational jazz, the back and forth between sticking to rules and deliberately flouting them is part of the joy. The musical narrative through which a skilled performer guides the audience, through stability and instability, keeps listeners on their toes.

In Tepfer's Disklavier project, the algorithms create the structure and stability but are still a creative invention as much as the notes he conjures later have their basis in logic. "You put yourself in a system of constraints and then you see how much fun you can have," he says. "The question I want to be asking myself is, 'Here I am in this cage. How much wiggle room can I find?'"

Technology has pushed musical advances in the past half of a decade from the electric guitar in rock to sampling in hip-hop and more or less everything about EDM. Jazz is no exception, even as the mainstream view of the genre is that it emphasizes acoustic instruments, live performance and free-form improvisation.

Algorithmic composition traces back to the 1950s and composer Lejaren Hiller, who founded the Experimental Music Studios at the University of Illinois at Urbana–Champaign and collaborated with John Cage. In the 1970s and '80s, trombonist and composer George Lewis pioneered improvisational AI, including his program Voyager, which jams with collaborators as well as on its own. Jazz guitarist Pat Metheny's Orchestrion, from 2010, involves an entire band of self-playing instruments.

In contrast, Tepfer is always in control of his music. The Disklavier has no agency of its own, no artificial creativity. Though Tepfer may experiment with neural networks in the future, for now he is more interested in the human inspiration that technology can trigger.

The idea is not to use technology as a substitute for his own creativity but as a catalyst. Tepfer wants his algorithms to stimulate new thoughts, shock his system, expand his conception of how the piano can sound.

Your browser does not support the audio element

One of Tepfer's improvisations

He started experimenting with the Disklavier four years ago and now ends up trying to recreate its style in solo concerts with an acoustic piano. "Those sounds are in my ears now, and I find myself actually reaching for those sounds that the computer would be creating," he says. "That's really what I look for in a situation where I'm using new technology. It's in artistic results, a window opening up at the artistic level."

When combining music and technology, the essential question Tepfer always asks himself is: Am I enabling music that couldn't have been created any other way?

He is conscious that he doesn't want his programs to be a gimmick or to simply automate the same music he could play without a machine. He wants his music to have "integrity."

"What is technology on its own, from an artistic perspective? I don't think it's anything," he says.

"Technology has to be at the service of this artistic impulse. And artistic impulse -- at the end of the day, you have to spend a lot of time alone figuring out what it is you want to say," he says.

Part of his solution is that the more he innovates with new forms, the deeper he digs into musical theory and history. "If you look at a tree, the higher it reaches up, the deeper its roots have to go to support that," Tepfer says.

It is the classic artist's tension, provoked by the host of creative technology at his disposal today: To steep himself in the knowledge of his forebears without getting stuck in tradition; to dive into the innovations of his time without privileging style over substance. The tension is one Tepfer may be well positioned to solve as a musician and technologist. Reconciling different worlds seems to be one of his assets.

"I'm writing how the music works rather than writing the actual music."

Music, on one level, is physics -- frequencies relating to each other mathematically to create harmony.

"What is technology on its own, from an artistic perspective? I don't think it's anything."