Main Archive Specials Wiki | FAQ Links Submit Forum


antialiased square generator

Type : 1st April edition
References : Posted by Paul Sernine

Notes :
It is based on a code by Thierry Rochebois, obfuscated by me.
It generates a 16bit MONO raw pcm file. Have Fun.


Code :
//sqrfish.cpp
#include
#include
//obfuscation P.Sernine
int main() {float ccc,cccc=0,CC=0,cc=0,CCCC,
CCC,C,c; FILE *CCCCCCC=fopen("sqrfish.pcm",
"wb" ); int ccccc= 0; float CCCCC=6.89e-6f;
for(int CCCCCC=0;CCCCCC<1764000;CCCCCC++ ){
if(!(CCCCCC%7350)){if(++ccccc>=30){ ccccc =0;
CCCCC*=2;}CCC=1;}ccc=CCCCC*expf(0.057762265f*
"aiakahiafahadfaiakahiahafahadf"[ccccc]);CCCC
=0.75f-1.5f*ccc;cccc+=ccc;CCC*=0.9999f;cccc-=
2*(cccc>1);C=cccc+CCCC*CC; c=cccc+CCCC*cc; C
-=2*(C>1);c-=2*(c>1);C+=2*(C<-1); c+=1+2
*(c<-1);c-=2*(c>1);C=C*C*(2 *C*C-4);
c=c*c*(2*c*c-4); short cccccc=short(15000.0f*
CCC*(C-c )*CCC);CC=0.5f*(1+C+CC);cc=0.5f*(1+
c+cc); fwrite(&cccccc,2,1,CCCCCCC);}
//algo by Thierry Rochebois
fclose(CCCCCCC);
return 0000000;}



Comments


Added on : 14/04/06 by cortex[ AT ]gmx[ DOT ]net
Comment :
you can shove your obfuscated code up your ass :]



Added on : 20/04/06 by Paul
Comment :
So, what ? What's your problem ?      



Added on : 01/05/06 by myk[ AT ]golg[ DOT ]com
Comment :
     nice fishy pattern... a bit hard to read :),
     but very organized and readable
     i wonder why pro's don't write their code    like this????
whats with all the C's and

ccc=CCCCC*expf(0.057762265f*
"aiakahiafahadfaiakahiahafahadf"[ccccc]);CCCC
=0.75f-1.5f*ccc;cccc+=ccc;
    
insert quote from the first comment here :)    




Added on : 05/05/06 by bonbon[ AT ]elisa[ DOT ]com
Comment :
obfuscated code is stupid but it was done on fools day...
it sounds good, no aliasing.
it is quite ez to deobfuscate but i still don't get the algo.

bonaveture rosignol




Added on : 05/05/06 by bonbon[ AT ]elisa[ DOT ]com
Comment :
i think i got it.
it looks like a sort of looped fm/waveshaping thing.




Added on : 05/05/06 by fisher man
Comment :
I tried it and it works fine.
It is easy to decipher.
It uses a single phase accumulator, it is offseted and it feeds two self FM modulated sinewaves (sort of bandlimited saw). The sinewaves are approximated with polynomials and are substracted from each other to obtain a square like sound.
    




Added on : 13/04/08 by ccccfffaaakakakak[ AT ]hotmail[ DOT ]com
Comment :
              Complete waste of bandwidth thank you.



Added on : 03/07/08 by kfkgff[ AT ]gmail[ DOT ]com
Comment :
Wouldn't it be easier to create a tab of the waveform (in this case a 2 element table), and address it with  float instead of int with linear interpolation?



Add your own comment
Comments are displayed in fixed width, no HTML code allowed!
Email:

Comment:

Are you human?



Site created and maintained by Bram
Graphic design by line.out | Server sponsered by fxpansion