I've been playing with these for a while .. here's my favourite one so far:
#include <math.h>
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; }
I run it like this on Linux: $ gcc 1linesynth.c -o 1linesynth -lm && ./1linesynth | sox -t raw -r 8k -e unsigned -b 8 -c 1 - -t raw -r 48k - | jack-stdin -e u -b 8 "firewire_pcm:000a9200c7110222_Output 1L_out"
Of course, ymmv .. you could use aplay too, but I'm a Jack kind of guy with a big multi-io rig, so I have to do all that malarky.