Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ AUDIO THREAD PART III

Name: Anonymous 2008-05-24 3:21

#include <stdio.h>
#include <stdlib.h>

main() {
 int i,j,k,l;
 while(1) {
  l=rand()%100;
  for(k=0;k<l;k++) {
   for(i=0;i<255;i+=128)
    for(j=0;j<k;j++)
     putchar(i);
   for(;i;i-=128)
    for(j=0;j<k;j++)
     putchar(i);
  }
 }
}


gcc -o lolsound lolsound.c
./lolsound > /dev/dsp


First one to hack this into saying "Have you read your SICP today?" gets an internet.

Name: Anonymous 2008-05-25 22:50

I think I've finally understood[1] how basic sound works. It's like a digital raw description of actual analogic sound. But, damn, that imples that i must build the waves myself with sin(). What if i want to play two different tones simultaneously?

Does anyone know a good introduction to ``sound theory''? Because I'd prefer reading something myself than filling this thread with questions. Due to geographical conditions i'm unable to buy books, so links are preferred. But I don't know what to search.

[1]Being the faggot I am, I had to do this:

$ ./satori.o | od -tu1 -w7 | head
0000000 127 161 193 220 239 251 253
0000007 246 230 206 176 143 108  75
0000016  45  22   6   0   3  15  35
0000025  63  95 129 163 195 221 241
0000034 251 253 245 228 204 174 140
0000043 105  72  43  20   5   0   3
0000052  16  37  65  97 132 166 197
0000061 223 242 252 253 244 226 202
0000070 171 137 103  70  41  19   5
0000077   0   4  17  39  67 100 135

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List