Bytebeat: make music with just a line of code

What is bytebeat?

Bytebeat is a playful way of making algorithmic music using very simple code. Instead of recording instruments or arranging notes on a timeline, you write a short mathematical expression that directly generates sound.

Because the sound is calculated by the code itself, bytebeat is also a form of generative sound, meaning the music is generated automatically rather than recorded or arranged by hand.

The idea became popular in the late 2000s among programmers who enjoyed experimenting with creative constraints. In bytebeat, a single variable — usually called t — represents time. For each moment in time, the expression produces a number, and that number is played as sound. That’s it.

Even though the rules are simple, the results can be surprisingly musical. With just basic math and logic, bytebeat can create beats, melodies, looping patterns, ambient textures, or strange digital noises.

Unlike traditional music production, there are no tracks, instruments, or samples. Everything comes from the code itself. This makes bytebeat a unique mix of music, coding, and experimentation, and a great entry point into creative coding for beginners.

How does bytebeat work?

Bytebeat works by repeating the same calculation over and over, very fast. Each time the calculation runs, it uses the current value of t (time) and outputs a number. That number becomes the audio signal you hear.

Most bytebeat formulas use simple operations like addition, multiplication, division, and bitwise operators. You don’t need advanced math — many classic bytebeats are made from trial and error, curiosity, and small tweaks.

Because the sound is generated live, you hear changes instantly when you edit the code. Change one number, press play, and the rhythm or melody might completely transform. This instant feedback makes bytebeat easy to explore, even if you’ve never written audio code before.

Today, bytebeat is most commonly implemented in JavaScript and runs directly in the browser. This makes bytebeat accessible as there’s nothing to install. You can experiment, break things, and discover new sounds just by editing a single line of code.

Bytebeat today: history, culture, and evolution

Bytebeat originally emerged as a form of low-complexity digital art, closely related to the demoscene and experimental programming culture. In the late 2000s and early 2010s, many bytebeat programs and experiments were shared on demoscene forums such as Pouët, where extremely small programs producing sound were valued as a form of technical and artistic expression.

Over time, bytebeat compositions have grown more sophisticated. While still constrained by minimal expressions, many modern bytebeat pieces explore harmony, rhythm, sound effects and structure, sometimes approaching the musical complexity found in traditional digital audio workstations (DAWs) such as Ableton Live orFL Studio — albeit through purely algorithmic means.

Bytebeat is also increasingly associated with live coding and algorithmic performance practices. It shares conceptual ground with live coding environments like Strudel and TidalCycles, and aligns with the ethos of the Algorave movement, where code itself becomes a performative musical instrument.

Beyond music, bytebeat techniques have occasionally appeared in unexpected technical contexts. One notable example is their use in malware such as sailwin.exe, where bytebeat formulas were employed to generate sound procedurally — illustrating how these simple algorithms can surface far outside artistic applications.

Bytebeat tools and platforms

Over time, several tools helped shape the bytebeat scene. Dollchan’s Bytebeat Composer and Greggman’s bytebeat engine are classic tools that introduced many people to the concept.

Building on this tradition, BytebeatCloud is a modern online bytebeat composer focused on creativity, sharing, and community. You can create bytebeats in your browser, listen to what others have made, and share your own experiments with the world.

Try bytebeat yourself

The best way to understand bytebeat is to hear it and play with it. Start with community creations or jump straight into coding — it only takes one line of code.