diff --git a/f2.c b/f2.c index d240a7c..65199f4 100644 --- a/f2.c +++ b/f2.c @@ -1,5 +1,5 @@ #include "sounds.h" -int main(){ +int main() { sound_loop_1(sound_2,0); } // vim:set sw=2 sts=2 et ai: diff --git a/f4.c b/f4.c index 61394b6..eac4d0f 100644 --- a/f4.c +++ b/f4.c @@ -1,12 +1,5 @@ -#include "audio.h" +#include "sounds.h" int main() { - int t; - for (t = 0;;t++) { - int i; - i = (t>>7-(t>>15)&-t>>7-(t>>15)); - if (i==0) - continue; - p(t>>4|t&(t>>5)/i); - } + sound_loop_1(sound_4,0); } // vim:set sw=2 sts=2 et ai: diff --git a/f5.c b/f5.c index 7fea5e4..6eeeace 100644 --- a/f5.c +++ b/f5.c @@ -1,5 +1,5 @@ #include "sounds.h" -main(){ +int main() { sound_loop_1(sound_5,0); } // vim:set sw=2 sts=2 et ai: diff --git a/f6.c b/f6.c index c527aaf..1e35aa1 100644 --- a/f6.c +++ b/f6.c @@ -1,17 +1,5 @@ -#include "audio.h" - -main(int ac, char** av){ - long t, y, x; - - //init(); - for(t=0;;t++) - { - x=t*"6689"[t>>16&3]/24&127; - y=t&16383; - if (y==0 || x==0) - continue; - - p((30000000000/(y)&1)*35+(x)*y/400000000+((t>>8^t>>10|1>>14|x)&63)); - } +#include "sounds.h" +int main() { + sound_loop_1(sound_6,0); } // vim:set sw=2 sts=2 et ai: diff --git a/sounds.c b/sounds.c index f58ba33..974afaa 100644 --- a/sounds.c +++ b/sounds.c @@ -19,8 +19,30 @@ int sound_2(int t) { int sound_3(int t) { return (t*9&t>>4|t*5&t>>7|t*3&t/1024); } + +int sound_4(int t) { + int i = 0; + + while (i == 0) { + i = (t>>7-(t>>15)&-t>>7-(t>>15)); + t++; + } + return (t>>4|t&(t>>5)/i); +} + int sound_5(int t) { return (((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)); } +int sound_6(int t) { + int y = 0, x = 0; + + while (y == 0 && x == 0) { + x=t*"6689"[t>>16&3]/24&127; + y=t&16383; + t++; + } + return ((30000000000/(y)&1)*35+(x)*y/400000000+((t>>8^t>>10|1>>14|x)&63)); +} + // vim:set sw=2 sts=2 et ai: diff --git a/sounds.h b/sounds.h index 577aaa4..cb5f5b4 100644 --- a/sounds.h +++ b/sounds.h @@ -3,6 +3,8 @@ void sound_loop_1(int (*sp)(int i), int t); int sound_1(int t); int sound_2(int t); int sound_3(int t); +int sound_4(int t); int sound_5(int t); +int sound_6(int t); // vim:set sw=2 sts=2 et ai: