[Stk] Realtime Effect Processing Using Callback

Stephen Sinclair sinclair at music.mcgill.ca
Mon Jan 5 07:13:30 PST 2009


Hi,

2009/1/5 BEN SHEPHERD <benshep at roadrunner.com>:
>
> I'm attempting to read from an input, process with a delay, and output in
> realtime and my program stops when delay->tick is called with an "access
> segmentation" or memory error.  I'm on Windows XP, using ASIO only.  I have
> been able to successfully use the Duplex program which uses memcpy to copy
> the inputBuffer to outputBuffer.  I've tried different classes including
> Chorus but with the same result.  I apologize in advance if I'm missing
> something simple, but I've poured through all the documentation and examples
> I could find.

"memory error" sounds like something not initialized or out of bounds.
 I would try stepping through it with a debugger to see if anything is
strange.  Your callback looks okay to me but I can't tell more without
seeing the whole program.

You say you're able to run the examples without problems?

Steve


> int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
>          double streamTime, RtAudioStreamStatus status, void *dataPointer )
> {
>  Delay *delay = (Delay *) dataPointer;
>  StkFloat *oSamples = (StkFloat *) outputBuffer;
>  StkFloat *iSamples = (StkFloat *) inputBuffer;
>
>     for ( int i=0; i<nBufferFrames; i++ )
>        *oSamples++ = delay->tick(*iSamples++);
>
>  return 0;
> }
>



More information about the Stk mailing list