[PD] puredata external tutorial
IOhannes m zmölnig
zmoelnig at iem.at
Wed Jul 23 09:39:43 CEST 2014
hi,
On 07/23/2014 03:02 AM, dougall wrote:
> Hi,
>
> Thanks for your great tutorial on writing Puredata externals. It had me up
> and running in no time.
great to hear
>
> I found a small bug.The pan~ example code doesn't assign the pan_tilde_free
> function pointer in the pan_tilde_setup function. It is explained clearly
> in the document but the example code itself doesn't match.
thanks, i'll fix it asap.
>
> Perhaps you can answer a question for me. I've been writing some externals
> to read data from analog sensors on an i2c device. I have a separate
> thread and use sys_lock() and sys_unlock() to output to the data to pd from
> inside the thread. Is this best practice? I've seen a number of different
> approaches to this situation.
first of all, the best place to ask such questions is the pd-dev
mailinglist [1].
imho, the best practice is:
- setup a clock-callback that converts the data from your representation
to an atom-list and then outputs the data.
- in your reading thread trigger the clock in a protected way:
sys_lock();
clock_delay(x->x_clock, 0);
sys_unlock();
- this will call the clock asap within the main thread of Pd.
fmadsr
IOhannes
[1] http://lists.puredata.info/listinfo/pd-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140723/d6ef9f67/attachment-0001.sig>
More information about the Pd-list
mailing list