5 ms·
Bytebeat
- primitur 14y agoI'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.
- ralph 14y agoRe-formatted for reading, #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; } Can this be simplified to just use an incrementing t? Otherwise I'm not sure it's in keeping with the spirit of the original. :-) BTW, the increment and use of v without a sequence point in between may bite.
- ralph 14y agoWell, I suppose given it will cycle it can be simplified to an array indexed based on t; still don't think that's playing the game though.
- DanBC 14y agoI'd love to see some kind of combination of bytebeat with evolution algorithms - like Darwin Tunes (http://darwintunes.org/ http://darwintunes.org/)
- neumann_alfred 14y agothere is also this: https://github.com/greggman/html5bytebeat https://github.com/greggman/html5bytebeat check out this example first! http://goo.gl/lQyDd http://goo.gl/lQyDd
- RodgerTheGreat 14y agoThat's pretty spiffy. Nice to see the inclusion of a postfix expression mode.
- jgj 14y agoThe geek in me loves this and wants to see/hear what talented people in me will do with it. The person-with-ears in me wants it to die a quick death.
- monochromatic 14y agoI feel like an old fogey saying this, but does anyone actually enjoy listening to this stuff? I mean it's interesting, sure, but... really?
- minikomi 14y agowow! http://wurstcaptures.untergrund.net/music/?oneliner=t%20%3E%3E%2041%20*%2014%2Fcos(2%20%2B%20(t*(t%3E%3E11)*3.1422259)%2Bsin(t%2B2)%20%26%20t*.0008)%20%3E%3E%200.3%2Ftan(t%20*%203)&oneliner2=&t0=2&tmod=0&duration=30&separation=100&rate=8000 http://wurstcaptures.untergrund.net/music/?oneliner=t%20%3E%...