C-one liners to generate music ..

Jay Vaughan EMAIL HIDDEN
Tue Sep 27 13:51:25 CEST 2011


Lovely:

	http://www.youtube.com/watch?v=GtQdIYUtAHg&feature=youtu.be


My favourite one of these, though, is still:

#include <math.h>
#include <cstdio>

int main()
{    int v, i, z, n, u, t; for (v = -1;;) { for (n = pow(1.05946309, "CWG[Cgcg[eYcb^bV^eW^be^bVecb^"[++v & 31] + (v & 64) / 21), i = 999; i; putchar(128 + ((8191 & u) > i ? 0 : i / 8) - ((8191 & (z += n)) * i-- >> 16))) { u += v & 1 ? t / 2 : (t = v & 6 ? t : n / 4); } }
    return 0;
}




.. not a one-liner, but nevertheless mind-bogglingly beautiful for what it does and how it works ..



More information about the music-bar mailing list