[PD] [PD-dev] What goes on during dsp ticks?
czhenry at gmail.com
Sun Jun 15 09:02:15 CEST 2008
On Sat, Jun 14, 2008 at 10:20 PM, PSPunch <shima at pspunch.com> wrote:
> Hi, Charles,
> I think it is just the matter of WHERE the code goes.
> My understanding (as for now) is that the method registered with
> gensym("dsp") is called,
> >> anytime when either the block size or sample rate changes or when the
> >> signal graph is rebuilt.
> so that running this check,
> > if (x->n != n)
> > x->is_new_or_resized=1;
> may be redundant if it is in the DSP chain (typically
> classname_tilde_perform) compared to including it in the call back
> function. (typically classname_tilder_dsp).
ok, I get it now. cool
There's the dsp routine and the perform routine separately. Makes a
lot of sense to me, now.
> Someone please correct me if I am wrong.
> David Shimamoto
>> On Sat, Jun 14, 2008 at 5:15 PM, Thomas Grill <gr at grrrr.org> wrote:
>>> Am 14.06.2008 um 18:37 schrieb PSPunch:
>>> That's definitely bad practice.
>>> Instead of that you can do the allocation in the "dsp" callback, that's
>>> where you add your dsp processing to the signal chain. This callback will be
>>> called anytime when either the block size or sample rate changes or when the
>>> signal graph is rebuilt.
>> What is the dsp callback? This is new to me, too.
>> I had a different approach when it comes to building static arrays
>> that depend on block size. I used three variables in the struct,
>> x->n, x->array_pointer, and x->is_new_or_resized
>> Then, example use in perform routine:
>> if (x->n != n)
>> if (x->is_new_or_resized)
>> if (x->array_pointer != NULL)
>> malloc(x->array_pointer, n);
>> So, you can see the problem. It would be useful to know another way.
>>> Pd-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management ->
>> Pd-list at iem.at mailing list
>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> Pd-dev mailing list
> Pd-dev at iem.at
More information about the Pd-list