A formula reads the time and returns a sample. Three ways of writing it, three ways of sounding: bytebeat, floatbeat and funcbeat. Each one plays here, in the browser; edit it and listen.
Whole numbers, eight bits at a time. t counts samples (8000 a second); the formula's result is cut to 0..255 and that byte is the speaker's position. Shifts (>>) slow t down into rhythm, & | ^ mix the bits into melody: the grit is the arithmetic itself.
Bytebeat was found and shared in 2011 by viznut (Ville-Matias Heikkilä) and the people who answered him with formulas of their own: one line of C that is a whole piece of music.
Fractions instead of bytes. The result is a number from −1 to 1, at full rate (44100 a second here), so the formula can hold sines, phases, envelopes and filters: tones, bells, pads and basses, clean or as dirty as you write them. Here t is in seconds and Math's functions are at hand (sin, exp, tanh, PI).
Floatbeat is where the timbres are: the same idea as bytebeat, with the room of real numbers.
A function of time that knows the tempo. Besides t (seconds) it gets b, the beats, so a formula can write steps, chords and envelopes in musical time; with several lines, return gives the sample. Helpers here: step(n) the step (n a beat), ph(n) where you are inside it (0..1), note(k) the frequency k semitones over A 110.
Funcbeat is the formula as a musician: the clock is the song's, so the same line can be a sound and a part.