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