new version
[Chiptunes-pms150c.git] / bsv.c
1 typedef unsigned char u8;
2
3 int i;
4
5 u8 notes[] = "Qj}6jQ6%BY}6YB6%";
6
7 u8 g(u8 x, u8 t, u8 o){
8 u8 notes_ix = t%8 + 8*!!(3&i>>16);
9 return((3&x&(i*(notes[notes_ix]+51)>>o))<<4);
10 }
11 void main(void){
12 i = 0;
13 for(;;) {
14 u8 sample;
15 u8 n = i >> 14;
16 u8 s = i >> 17;
17 sample = g(1,n,12);
18 { u8 tmp = n^i>>13;
19 sample += g(s,tmp,10);
20 } //tmp
21 { u8 tmp1 = s/3;
22 u8 tmp2 = n+((i>>11)%3);
23 sample += g(tmp1,tmp2,10);
24 } //tmp1, tmp2
25 { u8 tmp1 = s/5;
26 u8 tmp2 = 8+n-((i>>10)%3);
27 sample += g(tmp1,tmp2,9);
28 } //tmp1, tmp2
29 putchar(sample);
30 i++;
31 }
32 }
Imprint / Impressum