About bytebeat
๐ต What is Bytebeat?
Classic simple bytebeats are generally pieces of rhythmic and somewhat melodic music generated with no score, no instruments, and no traditional synthesizers or oscillators.
Instead, the music is produced by a single mathematical expression that defines a waveform as a function of time (t).
Evaluated usually 8,000 times per second, this formula outputs an audio stream with a 256-step resolution, ranging from complete silence (0) to full amplitude (255).
When you put this expression into a loop that increments the time variable t++, it generates a headerless, unsigned 8-bit mono PCM stream directly to the audio output.
Because these equations require minimal computational overhead, they can easily run on even the weakest embedded devices, like an Arduino or tiny microcontrollers.
๐ History & Original Resources
Bytebeat music officially dates back to September 2011, emerging directly from the demoscene community where programmers constantly try to squeeze maximum art out of minimal file sizes. Initially, expressions were strictly written in C-syntax or were C-compatible mathematical formulas running in early JavaScript environments.
Over the years, bytebeat has evolved dramatically. Modern composers often move past simple one-liners, utilizing complex JavaScript code, multiple operational channels, custom sample rates (like 11kHz, 32kHz, or 44.1kHz), and advanced math equations to simulate complex synthesizers, drums, filters and DAW. You can explore a vast variety of these historical and modern algorithmic pieces in the library on this site.
To dive deeper into the early history of bytebeat, explore the essential write-ups:
- Read the comprehensive article by Kragen covering the earliest days of bytebeat experiments.
- Check out Viznut's blog posts: Algorithmic Symphonies from One Line of Code and Deep Analysis of One-Line Music Programs.
- Watch the original YouTube videos that started the craze: Iteration #1, Iteration #2, and Iteration #3.
๐งพ Facts & Concepts
- The Pioneer: Invented by Finnish demoscene coder and artist Ville-Matias Heikkilรค (known as Viznut) in September 2011.
- Sierpinski Harmony: The famous formula
t&t>>8automatically plots and plays a structural auditory equivalent of the fractal Sierpinski triangle. - The 42 Melody: One of the earliest discovered algorithmic melodies is
t*(42&t>>10), which creates a complex rhythmic structure using just a bitwise AND operator. - Standard Playback: Historically executed via Linux command line.
โญ Other online bytebeat players
- by Bemmu and Rarefluid — this is one of the first players.
- by Paul Hayes — also is one of the first. Dollchan Player is a very deeply modified fork of it.
- by Greggman — a source of inspiration for creating Dollchan Player, but in turn, Greggman took the songs library from here.
- by SArpnt — a fork of Dollchan Player, but in turn Dollchan took many technologies and ideas from SArpnt.
About the Dollchan Player
This is a web-based algorithmic music generator and player for real-time live-coding, featuring a rich collection of bytebeat songs.
This project has been under development by SthephanShi since 2018 (official announcement in January 2019), and is a heavily modified fork of 8-bit Generative Composer by Paul Hayes.
Please refer to the README for full information regarding functionality, installation, configuration, as well as the changelog.
๐น Supported Playback modes
- Bytebeat: Outputs value as an unsigned 8-bit integer (uint8) (0 to 255). Values outside this range wrap around, decimals are truncated.
- Signed Bytebeat: Outputs as a signed 8-bit integer (int8) (-127 to 128). Required for classic demoscene music ports (e.g., *Longline Theory*).
- Floatbeat: Uses floating-point values (float) from -1.0 to 1.0. This mode provides clean sound without 8-bit distortion or noise on quiet songs.
- Funcbeat: Statement-based tracking. Runs a wrapper function once at startup and expects it to return a function evaluated in seconds.
- Stereo sound: Return a two-element array
[left, right]to separate channels. For example,[t*(t>>10&42), t*(t>>11&42)]
โ Visualizer Scope modes
- Points: Renders raw calculated values as separate coordinate dots on the grid.
- Waveform: Connects points with lines, keeping the wave clean and legible at high zoom.
- Diagram: Draws vertical lines where brightness changes based on the signal amplitude.
- Combined: Overlays the Waveform line on top of the Diagram background.
- FFT (Fast Fourier Transform): Renders a real-time frequency spectrum map. Uses a logarithmic grid marked in Hertz (10 Hz to 24 kHz) and Decibels (-20 dB to -120 dB).
๐ Visualizer Scope features
- Interactive Timeline Cursor: Renders a moving playback cursor that you can color-customize. At high zoom levels, it moves faster and stops being displayed.
- Stereo Channel Splitting: Renders left and right audio channels using distinct colors, with multiple color preset configurations available.
- Visual Error Tracking: Audio overflows, out of bounds, and invalid calculations (NaN) automatically colors in warning red.
- Playback Toggling: Click directly on the scope timeline to pause or to resume the playback.
๐๏ธ Playback & Control Panel
- Time counter: Click the
tbutton to switch to measuring in seconds. Click the counter number field to pause. Type a number and pressEnterto jump to that specific time. - Lag indicator: Shows a slowdown coefficient if heavy or unoptimized code overloads the audio worker. Use this value to monitor lag and to fix audio crackling.
- Stop and reset: Click the โน๏ธ button to stop playback and to reset the time to 0.
- Reset: Click the โฎ๏ธ button to set time back to 0 without stopping playback.
- Pause: Click the โธ๏ธ button to pause playback.
- Playback speed: Click the fast-forward โฉ or fast-reverse โช buttons multiple times to speed up or slow down playback (2x, 4x, ... up to 64x).
- Zoom controls: Use the
+and-buttons to scale the visual scope. Zooming in helps you see the wave details, while zooming out gives a broader view of the pattern. - Zoom indicator: Click the
1/xbutton to reset the zoom to 1. - Visual mode: Switch between different view types like
Waveform(classic wave line),Diagram(2D pixel pattern), orFFT(frequency spectrum) to see your code's visual footprint. - Playback mode: Switch between different playback types like
Bytebeat,Signed Bytebeat,FloatbeatorFuncbeat. - Sample rate: Select standard frequencies from lo-fi 4000 Hz to 48000 Hz. Type your own numbers into the sample rate selector input to set custom frequencies.
- Sample rate divisor: Located next to the sample rate selector. If your song is too heavy or you are on a weak mobile device, increase this value. It skips calculation steps to reduce CPU load (note: this causes sound stepping and visual distortion).
- Copy link: Click the chain/link ๐ button to copy the unique URL of your song. It saves your code, sample rate, and playback mode so you can easily share your creation with others.
- Record audio: Click the record button โบ๏ธ to capture the output directly from the playback. It renders the audio into a downloadable
.oggfile. - Clean view: Use the expand
โถbutton to hide the code editor and settings, leaving only the visual scope and basic playback controls on the screen. Available on mobile devices or small screens. - Byte counter: Tracks your code size in real-time. This helps you fit into classic bytebeat limits like 256 bytes or 1 KB.
๐ Code Editor
- Syntax Highlighting: Includes 12 themes (
Atom,GitHub,VSCode, etc.) in both Dark and Light variants. - Smart Shortcuts: Global aliases let you type
Math.functions directly (sin,cos,abs,min, etc) and useint()shorthand instead ofMath.floor(). - Code Utilities: Includes full-text search (
Ctrl+F), line numbers, and collapsible code blocks (function folding). - Advanced Bracket Pairing: Highlights matching brackets in yellow and highlights orphan brackets in red to instantly spot syntax mistakes.
๐ผ Song Library & Discovery
The composer includes a structured song catalog compiled from communities like Battle of the Bits and Reddit:
- Library filters: Quickly filter songs by size limits (
all,<256,<1k,big), by audio types (all,Bytebeat,Signed Bytebeat,Floatbeat,Funcbeat), by tags, and to sort songs by author or by date. - Library search: Type in the search field to find songs by name, author or description.
- Remix Tree Navigation: If a song is a remix of another song, click the
โทarrow button to load parent metadata right below it. This lets you browse nested remix histories without losing your place. - Code Format Toggles: Each song entry can contain code execution buttons:
min(minified),orig(original), andformat(pretty-printed). Switch between them instantly to load necessary code. - Auto Zoom Syncing: Clicking a song with
drawingtag automatically syncs the visualizer's zoom level and mode to what the author intended.
๐ท๏ธ Song Tags
Some songs in the library have visible tags:
- stereo: for stereo songs;
- drawing: if the code does something in the visualiser;
- c: for C-compatible songs;
- console: for when a song uses throw to display arbitrary text;
- port: for songs ported to bytebeat from other platform formats;
- slow: for songs that are very demanding on performance;
- sample: for songs that use encoded audio samples (by PCM, for example).