From 4d5984b7a5eaad28251a1b801afb6c4291d69779 Mon Sep 17 00:00:00 2001 From: Davide Morelli Date: Tue, 6 Dec 2005 00:34:07 +0000 Subject: finding rhythm functions ready svn path=/trunk/externals/frankenstein/; revision=4149 --- common.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 75bd3fb..2e33d5f 100755 --- a/common.h +++ b/common.h @@ -80,6 +80,9 @@ struct t_rhythm_memory_arc #define num_possible_denominators 11 static unsigned short int possible_denominators[] = {1,2,3,4,6,8,12,16,18,24,32}; +// the minimum percentage for a beat to be considered part of the main rhythm +#define min_to_be_main_rhythm_beat 0.7 + // this defines a space for rhythms, variations, transitions and representations typedef struct t_rhythm_memory_representation t_rhythm_memory_representation; typedef struct t_rhythm_memory_element t_rhythm_memory_element; @@ -106,6 +109,9 @@ struct t_rhythm_memory_representation t_rhythm_memory_representation *next; } ; +// define a return value to express "rhythm not found in this representation" +#define INVALID_RHYTHM 65535 + // ------------------------------------------------ functions // ----------- rhythm manipolation functions @@ -140,6 +146,9 @@ void freeBeats(t_rhythm_event *currentEvent); // --- memory representation of rhythms +// create an array of nodes (without arcs?) to express the beats in this rhythm (the noteon moments) +void create_array_beats(unsigned short int **this_array, t_rhythm_event *currentEvent); + // add an arc to this node void add_t_rhythm_memory_arc(t_rhythm_memory_node *srcNode, unsigned short int dstNode); @@ -147,9 +156,6 @@ void add_t_rhythm_memory_arc(t_rhythm_memory_node *srcNode, unsigned short int d // I must pass its id also void create_rhythm_memory_representation(t_rhythm_memory_representation **this_rep, unsigned short int id); -// define a return value to express "rhythm not found in this representation" -#define INVALID_RHYTHM 65535 - // add a new rhythm in the list of similar rhythms related to one main rhythm // the sub id is auto-generated and returned unsigned short int add_similar_rhythm(t_rhythm_memory_representation *this_rep, t_rhythm_event *new_rhythm); -- cgit v1.2.1