new version
[Chiptunes-pms150c.git] / bsv.c
CommitLineData
b3a565e1
TG
1typedef unsigned char u8;
2
f3768c26
TG
3int i;
4
c320426f
TG
5u8 notes[] = "Qj}6jQ6%BY}6YB6%";
6
f3768c26
TG
7u8 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);
c395d5c8 10}
f3768c26
TG
11void main(void){
12 i = 0;
13 for(;;) {
fef0e35b 14 u8 sample;
f3768c26
TG
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
fef0e35b 29 putchar(sample);
f3768c26 30 i++;
fef0e35b 31 }
c395d5c8 32}
Imprint / Impressum