[sdiy] New to list - and DSP development

Richard Wentk richard at skydancer.com
Sun Dec 12 16:06:13 CET 2004


At 00:20 12/12/2004 -0500, Kenneth Elhardt wrote:
>Paul Maddox writes:
> >>well, thats the hard part, thats what aliasing in softsynths/VAs is all
>about. You can write the data to an output buffer at whatever speed you
>want, but if theres too much in there you get harmonic frequency inversion,
>or aliasing..<<
>
>Actually, aliasing shouldn't have anything to with what I'm talking about.
>No matter what, I'll only be calculating and outputting data at 44.1KHz.
>It's just that if I want to process one sample at a time and then output it,
>I was just wondering about how I know when the last sample has already been
>sent to the DAC so I can load up a new sample.  When looking at the
>Chameleon developer kit, they had one example that just takes a sample from
>the audio input then sends it right out to the output with only a one sample
>delay.  Just not sure how to do a similar thing on a PC.

No, you still need to understand what Paul was saying.

If you try to synthesize a 440Hz saw wave with a sampling rate of 44.1KHz, 
you can easily hear the upper harmonics folding back into the audio range.

So you can't use use procedural synthesis (i.e. using a counter for your 
ramp, or looking up the ramp wave from a ROM) but to have to do some more 
complicated tricks instead.

>ASSI writes:
> >>You would use at least three buffers: one that is currently playing, one
>that is queued for swap with the one that is currently playing when
>it's played back to the end and the third that you fill. Size and
>number of the buffers depend on the interrupt rate the OS allows you to
>use and how much variance you have in the interrupt latency for the
>sound producer thread. The buffer swapping needs to be a very tight and
>high priority interrupt routine, <<
>
>Thanks for the more technically oriented info.  On the Mac or PC I'll have
>plenty of free time where the processor it just waiting so I don't want to
>have to resort to interrupts.  I just plan on polling whatever I need until
>a buffer is done playing.  I guess that will limit the speed of my code to
>the audio throughput rate needed.  I just hope the OS will let me know when
>one buffer is finished so it can be swapped before the next stream of
>samples is needed, or whether it can start the queued sound on its own, or
>whether I specifically need a callback function to do it.  Since nobody
>really knows for sure I guess I'll have to experiment on my own.

These features are part of the Windows API in C/++ and Vis Basic. They're 
not particularly hard to use, especially in VB.

Richard





More information about the Synth-diy mailing list