[Stk] Realtime Effect Processing Using Callback
BEN SHEPHERD
benshep at roadrunner.com
Mon Jan 5 08:18:06 PST 2009
Thanks for the quick response. I have tried and am able to run the
duplex and sine programs. I don't believe either of them call the tick
method though. I have used the debugger to show that the tick call
(tested on both chorus and delay) is where the program generates the
error. I don't currently have access to my code, but I'll send more
later.
-Ben
On Jan 5, 2009, at 10:13 AM, "Stephen Sinclair" <sinclair at music.mcgill.ca
> wrote:
> 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