From 328efc562d91016416674007ea42e9b8515f6efb Mon Sep 17 00:00:00 2001 From: Davide Morelli Date: Sun, 15 Jan 2006 02:14:01 +0000 Subject: adding init feature (memory reinitialization) svn path=/trunk/externals/frankenstein/; revision=4405 --- rhythms_memory.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rhythms_memory.c b/rhythms_memory.c index a9763ef..75ea5a4 100755 --- a/rhythms_memory.c +++ b/rhythms_memory.c @@ -399,6 +399,16 @@ void *rhythms_memory_new(t_symbol *s, int argc, t_atom *argv) return (x); } +// debugging function +void init(t_rhythms_memory *x) +{ + if (x->curr_seq) + freeBeats(x->curr_seq); + if (x->rhythms_memory) + rhythm_memory_free(x->rhythms_memory); + x->seq_initialized = 0; + rhythm_memory_create(&(x->rhythms_memory)); +} // debugging function void crash(t_rhythms_memory *x) @@ -426,6 +436,7 @@ void rhythms_memory_setup(void) // builds a variation of a given rhythm class_addmethod(rhythms_memory_class, (t_method)variation, gensym("variation"), A_GIMME, 0); + class_addmethod(rhythms_memory_class, (t_method)init, gensym("init"), 0); } -- cgit v1.2.1