From: myknees AT aol DOT com (Myknees) Newsgroups: comp.os.msdos.djgpp Subject: Re: Audio recording and mixing Date: 12 Feb 1998 02:04:54 GMT Lines: 53 Message-ID: <19980212020401.VAA28982@ladder02.news.aol.com> NNTP-Posting-Host: ladder02.news.aol.com References: Organization: AOL http://www.aol.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Shawn Hargreaves writes: > Myknees writes: > >I read a short tutorial on digital audio mixing that > >basically said > >that one must program the mixing routines in assembly. > >Do you think > >that has any truth to it? > > I don't see why. Sample mixing is exactly the same as > any other > programming task: you can use whatever language you > like. The Allegro > mixing code is regular C. I am smiling now. > >Also, I have accidentally caused mixing to occur with > >this loop (based on > >ex17.c): > > do { > > if (key[KEY_Q]){ > > play_sample(the_sample, 255, pan, pitch, FALSE); > > rest(50); > > } > > else if(key[KEY_W]){ > > play_sample(the_sample, 255, pan, pitch*2, FALSE) > > FALSE); > > rest(50); > > } > > } while ((!key[KEY_ESC]) && (!key[KEY_SPACE])); > > > >It makes reverb. Where is the mixing occurring? > > I presume you only get the overlapping samples if you > press the Q and W > keys in rapid succession? No, (sorry I was not clear) I hear reverb since the rest value is only 50ms. If I hit Q for, say, a quarter second, I'll hear a rapid succession of five played samples. But you go on to answer the question... > Allegro can mix up to 32 > simultaneous samples > (the exact number depending on the config file and how > many voices you > reserve when setting up the sound module). The code for > this is in the > mixer.c file. > [snip] I will go ruminate on the rest of your post. --Ed (Myknees)