and the last two sounds

This commit is contained in:
Vincent Batts 2012-11-19 15:47:44 -05:00
parent 2ddb925d27
commit 8de884e177
6 changed files with 31 additions and 26 deletions

2
f2.c
View File

@ -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:

11
f4.c
View File

@ -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:

2
f5.c
View File

@ -1,5 +1,5 @@
#include "sounds.h"
main(){
int main() {
sound_loop_1(sound_5,0);
}
// vim:set sw=2 sts=2 et ai:

18
f6.c
View File

@ -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:

View File

@ -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:

View File

@ -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: