diff options
author | Davide Morelli <morellid@users.sourceforge.net> | 2005-12-06 18:09:59 +0000 |
---|---|---|
committer | Davide Morelli <morellid@users.sourceforge.net> | 2005-12-06 18:09:59 +0000 |
commit | 1164f265647eebba64937612049bfb472eddf1f0 (patch) | |
tree | 3d34b54e32c041945d2a1069ec01e3afb24fd336 | |
parent | b28ff6d2448ef06f12ddb29976b90189ed489937 (diff) |
added simpler functions to manage the rhythms memory
svn path=/trunk/externals/frankenstein/; revision=4154
-rwxr-xr-x | common.h | 2 | ||||
-rwxr-xr-x | test.c | 13 |
2 files changed, 10 insertions, 5 deletions
@@ -192,6 +192,8 @@ void find_rhythm_in_memory(t_rhythm_memory_representation *rep_list, // first of all declare a pointer for the memory
t_rhythm_memory_representation *rhythms_memory;
+ // initialize it
+ rhythm_memory_create(&this_rep);
// then each time you get a rhythm let the memory evaluate it and
// tell you if is a new rhythm or a old one
float root_closeness, sub_closeness;
@@ -18,14 +18,15 @@ typedef struct _test {
t_object x_obj; // myself
t_outlet *l_out;
- t_rhythm_event *seq;
+ t_rhythm_event *curr_seq;
int seq_initialized;
+ t_rhythm_memory_representation *rhythms_memory;
} t_test;
void test_free(t_test *x)
{
- freeBeats(x->seq);
+ freeBeats(x->curr_seq);
}
static void test_bang(t_test *x) {
@@ -42,15 +43,15 @@ static void test_bang(t_test *x) { if (x->seq_initialized)
{
- concatenateBeat(x->seq, 0, rnd, 1);
+ concatenateBeat(x->curr_seq, 0, rnd, 1);
} else
{
- setFirstBeat(&(x->seq), 0, rnd, 1);
+ setFirstBeat(&(x->curr_seq), 0, rnd, 1);
x->seq_initialized = 1;
}
// print the sequence
- events = x->seq;
+ events = x->curr_seq;
while(events)
{
post("event: numerator=%i, denominator=%i", events->duration.numerator, events->duration.denominator);
@@ -68,6 +69,8 @@ void *test_new(t_symbol *s, int argc, t_atom *argv) x->seq_initialized = 0;
+ rhythm_memory_create(&(x->rhythms_memory));
+
return (x);
}
|