Mail Archives: djgpp/1998/02/11/21:15:25
Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk> 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)
- Raw text -