songcode

Introducing songcode

Describe a track and get it back as code you can read, edit and play in your browser.

intro3 min read

songcode turns a prompt into a track. The track arrives as source code: a short program, usually a few dozen lines at most, that your browser plays the moment it lands.

Type “driving techno. rolling bass, metallic hats, a single dark stab.” A language model writes something like this:

// title: iron oxide
setcpm(130/4)
form('loop:8')

kick: s("bd*4").bank("RolandTR909").gain(.9)
  .duckorbit(2).duckdepth(.7).duckattack(.12)

hats: s("hh*16").bank("RolandTR909")
  .gain("[.34 .13 .2 .15]*4").hpf(420).degradeBy(.15)

clap: s("~ cp ~ cp").bank("RolandTR909").late(.008).room(.3).gain(.42)

bass: note("c1*16").s("sawtooth")
  .lpf(sine.range(320, 1500).slow(8)).lpq(7)
  .decay(.08).sustain(0).orbit(2).gain(.6)

stab: note("<[c3,eb3,g3] ~ ~ [bb2,d3,f3]>").s("square").hpf(330)
  .room(.45).delay(.3).delaytime(.375).gain(.4)

That is the whole track: a tempo, a form, and five named stems. No audio file sits behind it. Your browser reads those lines and makes the sound live, with oscillators, filters and drum machine samples. Change 130 to 124 and the tempo drops. Change "bd*4" to "bd(3,8)" and the kick leaves the grid.

What sets it apart

The output is source. Text-to-music services hand you a rendered recording. You keep it or you roll again. songcode hands you the thing that makes the sound, so a track that is almost right is one edit away from right.

There is no audio model. We trained nothing, and no recording passes through songcode. The model that writes your track is a general-purpose language model from Anthropic or OpenAI, the same kind that writes Python, and it outputs text. We wrote down exactly what that claim covers, including where it stops.

It is built for people who open the lid. If you own a cheap synth and have opinions about its firmware, you already know why source beats a bounce. That post is here.

What you can do today

  • Generate a loop built to run for ten minutes without wearing out, or a full arranged track of three to five minutes.
  • Pick from 51 genres in nine families: techno, house, trance, bass, hip hop and breaks, synth, global, funk and jazz, ambient and experimental.
  • Steer with 30 advanced controls, from tempo and scale to drum machine, swing, filter movement and sidechain pump. Anything you leave alone stays the model’s call.
  • Edit the code while it plays and apply the change without stopping.
  • Switch from code to stems and work on the same track as a mixer and a piano roll: mute, solo, set levels, draw notes, or regenerate one stem with a direction. Note edits are written back into the code.
  • Trust the first play a little more. Each new track is compiled and tested in your browser before you hear it, and the model gets one pass to repair what the test finds.
  • Save a track and get a link. Whoever opens it gets the source too, and can remix it.
  • Download the source, or render a WAV or MP3 in your browser, faster than real time. Nothing is uploaded.

songcode runs on your own API key from Anthropic or OpenAI. The key stays in your browser, travels with each request, and is never stored on our side.

What it does not do

No vocals. No lyrics. No guitars that would fool anyone. Most of the genres are electronic because that is what synthesis and drum machines do well, and the ones that are not (bossa, jazz, funk) come out sounding like a good keyboard player’s version of them. If you need a finished song with a singer in thirty seconds, Suno will serve you better, and we say so plainly in what songcode can’t do.

Why code

Electronic music has been written as code for a long time. songcode stands on Strudel, the browser port of TidalCycles, a pattern language that live coders have performed with for years. One line of it can hold a drum part, its accents and the way it changes every fourth bar.

That density is what makes this work. A pattern language is compact enough for a language model to write well and plain enough for a person to read. The model does the first draft. You get a track and the reasons it sounds the way it does, on the same screen.

Describe a song.
Get it in code.

open songcode