[PD] questions

Olaf Matthes olaf.matthes at gmx.de
Wed Aug 28 16:41:20 CEST 2002

Mathieu Bouchard schrieb:

> using C, how do i create a timer callback? e.g. PD would call my procedure
> after 50 ms. A kind of [metro] for C code.

To call a function "function(t_yourobject *x) use:

clock_delay(x->x_clock, time_in_ms);

with x_clock being of type t_clock. You also have to set up the clock in the
new routine:

x->x_clock = clock_new(x, (t_method)function);    /* here you associate the
function with x->x_clock */

and free it in the free routine:



More information about the Pd-list mailing list