On a computer, Sonic Pi looks like any other coding language. It’s a mess of numbers, parentheticals, punctuation marks and keywords, splattered over an LCD screen. But offscreen — and through a set of quality speakers — those keystrokes produce music you might dance to on a Friday night.

Some artists have eschewed traditional acoustic and electronic instruments to compose with computer code. Colloquially, this is called “live coding” — a D.J. takes the stage with a laptop, opens up a coding interface and constructs melodies in real time. Today, there are live coding shows (sometimes called “algoraves”) almost every weekend in New York City, Moscow, Mexico City and India. Sonic Pi — which can find middle C, summon the Amen Break and play dozens of different synth sounds with just a few commands — has become a favored software among the D.J.s at these live events.

Originally, Sonic Pi was built to be a teaching aid. Sam Aaron , a software designer , was working at the University of Cambridge and wanted to combine the toils of programming with the joy of music. The goal was to invent a coding environment that functioned as an instrument, allowing children to type out rhythm and melody.