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:
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