Had a look on the forum and I've searched through the manual but cant really find an answer to this.
I've been trying to get my head around building externals by just looking at small aspects of it at a time-so basically I started off with bangs in and out, ints in and out etc etc.
Got to looking at clocks and I was wondering if its a bad idea to create them as needed(ie create a clock when a bang is received) rather than in the object creation method? Does this result in loads of clocks running even after they've been called?
I've tried implementing a couple of different ways of calling "freeobject" after the clocks have been used but this just gives me the "freeobject: 18452218: bad object" error followed most likely by a crash, so I'm just calling it as the cleanup method now.
So what i have is:
void timing4_tick(t_timing4 *x)
setclock_fdelay(0, x->m_clock, x->intervalForDelay);
This is called every time the object gets a bang in.
void makenewclock(t_timing4 *x)
x->m_clock = clock_new(x, (method)outputAfterDelay);
This is how I'm calling clock_new.
And my cleanup method is:
void timing4_free_clocks (t_timing4 *x)
Basically I want to be able to create the clocks dynamically so I dont have to have loads defined at the start, and I'm wondering whether this is the way to go about it or whether I'm missing something simple(like does the fact that they're all being called as "m_clock" mean I'm actually just using the same clock multiple times?). I tried using "schedule_delay" but it gives me the same error message as above if its deleted and it doesnt seem to have the same accuracy in timing anyway.
Hopefully this makes sense....