[PD] [PD-dev] What goes on during dsp ticks?

PSPunch shima at pspunch.com
Sat Jun 14 18:37:34 CEST 2008


Thomas,


Thanks a lot!
Wow, yes that seems to be the case.

Now having some mysteries solved, I can go get some sleep in comfort.
Seriously, you might have just saved my life :)


While you are there, can you please tell me just a bit more?

So, I've made a cache to copy the original signal to before processing.

Because the block size may change anytime, I am malloc & freeing a cache 
the size of the block on each DSP cycle.

I hear that malloc is a "relatively" expensive task.
Is it bad practice to run this each cycle, or is a kilobyte or two not a 
bid deal?


--
David Shimamoto



> Hi David,
> 
> Am 14.06.2008 um 03:08 schrieb PSPunch:
>>
>>
>> =====================
>> == PROCESS BLOCK.2 ==
>> =====================
>>
>>   while (n--) {
>> //    *out++ = *in++;
>>   }
>>
>>
>> Remarks: Action is commented out but signal goes through.. Why?
>>
> 
> that's because in and out can point to the same memory... signal vectors 
> are reused in PD for cache-friendlyness.
> 
>>
>> =====================
>> == PROCESS BLOCK.4 ==
>> =====================
>>
>>   n--;
>>   *out++ = 0;
>>   while (n--) {
>>     *out++ = *in++;
>>   }
>>
>>
>> Remarks: Expecting first sample of the block to be zero and others
>> delayed by 1 sample. Instead, I get an constant output of zero.
> 
> As above... you have to be aware that when you are writing to the 
> output, you change the input.
> Either cache the input or use a different algorithm (in this case start 
> from the end)
> 
> gr~~~
> 





More information about the Pd-list mailing list