Digital Music Programming II: floatmetro




This lab demonstrates how to manage the creating, using and destroying of clock variables which are used to schedule events in the futures. In particular, read pages 53-56 in the manual Writing External Objects for Max 4.0 and MSP 2.0 by David Zicarelli.

Important clock functions:

    clock_new(MyObject *mo, method FutureAction);
    A function which is called when first creating your object which will setup the clock and associate a function to call when the clock is triggered.

    clock_unset(void* clock);
    A function which removed the event controlled by the clock and prevents it from being run.

    clock_fdelay(MyObject *mo, float duration)
    Indicates to run the clock's action function after duration milliseconds.

    clock_delay(MyObject *mo, long duration)
    Indicates to run the clock's action function after duration milliseconds.

    clock_free(MyObject *mo);
    Used in the object destroying function as specified in the setup function.




Source Code

Source Code Example Usage
floatmetro.c
ichmetro.c