diff --git a/Makefile b/Makefile index 33920f0..22abc83 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ MUSIC_FILES := $(basename $(wildcard f*.c)) TMP_FILES := $(wildcard *~) $(wildcard *.o) - +CFLAGS += +LDFLAGS += -static -s all: $(MUSIC_FILES) audio.o: audio.c audio.h %: %.c audio.o - $(CC) -static -s -o $@ $^ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ clean: rm -rf $(MUSIC_FILES) $(TMP_FILES) diff --git a/README b/README index 695ceba..b1d0365 100644 --- a/README +++ b/README @@ -1,4 +1,11 @@ to play these, just compile and run like: -$> ./f1 | aplay + $> ./f1 > /dev/audio +or (fancier) + $> ./f1 | aplay +or (fanciest) (this way you can play with the rate) + $> ./f1 | play -r 8k -t raw -b 8 -c 1 -e signed - +or (fanciester) + $> ./f1 | sox -r 8k -t raw -b 8 -c 1 -e signed - audio.mp3 # mp3 requires 8khz rate + $> play audio.mp3 diff --git a/audio.c b/audio.c index 8c45c5f..eab7d9e 100644 --- a/audio.c +++ b/audio.c @@ -9,6 +9,7 @@ void init() { } void p(int i) { - fputc(i, audio); + //fputc(i, audio); + putchar(i); } diff --git a/f1.c b/f1.c index 1711db2..02f130c 100644 --- a/f1.c +++ b/f1.c @@ -1,7 +1,7 @@ #include "audio.h" int main() { - init(); + //init(); int t; for (t = 0;;t++) { p((t >> 6 | t | t >> (t >> 16)) * 10 + ((t >> 11) & 7)); diff --git a/f2.c b/f2.c index 63d970c..3d7b9e4 100644 --- a/f2.c +++ b/f2.c @@ -1,6 +1,6 @@ #include "audio.h" int main(t){ - init(); + //init(); for(t=0;;t++) { p(t*(((t>>12)|(t>>8))&(63&(t>>4)))); } diff --git a/f3.c b/f3.c index 3e9a66e..0f89578 100644 --- a/f3.c +++ b/f3.c @@ -1,6 +1,6 @@ #include "audio.h" main(int t) { - init(); + //init(); for(;;t++) { p(t*9&t>>4|t*5&t>>7|t*3&t/1024); diff --git a/f4.c b/f4.c index 6c73431..e3092e2 100644 --- a/f4.c +++ b/f4.c @@ -1,6 +1,6 @@ #include "audio.h" int main(int t) { - init(); + //init(); for (t = 0;;t++) { int i; i = (t>>7-(t>>15)&-t>>7-(t>>15)); diff --git a/f5.c b/f5.c index b8f1f11..f203438 100644 --- a/f5.c +++ b/f5.c @@ -1,6 +1,6 @@ #include "audio.h" main(t){ - init(); + //init(); for(t=0;;t++) { p(((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)); } diff --git a/f6.c b/f6.c index 0b63bc1..a17fdaa 100644 --- a/f6.c +++ b/f6.c @@ -2,7 +2,7 @@ main(t){ int y,x; - init(); + //init(); for(t=0;;t++) { x=t*"6689"[t>>16&3]/24&127;