From b72b71973f3efa49a48e4cd458fd68978a6373f8 Mon Sep 17 00:00:00 2001 From: Davide Morelli Date: Wed, 28 Dec 2005 14:03:54 +0000 Subject: created the dummy variation function svn path=/trunk/externals/frankenstein/; revision=4307 --- common.c | 8 ++++++++ common.h | 11 +++++++++++ rhythms_memory.c | 26 +++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/common.c b/common.c index 7824633..c136fcf 100755 --- a/common.c +++ b/common.c @@ -1,4 +1,12 @@ +/* +implementation of common functions used by the externals of the frank framework + +Authors: +Davide Morelli http://www.davidemorelli.it +David Plans Casal http://www.studios.uea.ac.uk/people/staff/casal + +*/ #include "common.h" #include diff --git a/common.h b/common.h index fae18f4..ac74379 100755 --- a/common.h +++ b/common.h @@ -1,3 +1,14 @@ +/* + +header file for common functions used by the externals of the "frank framework". + +the frank framework is a set of pd externals implementing AI agents for improvisation. + +Authors: +Davide Morelli http://www.davidemorelli.it +David Plans Casal http://www.studios.uea.ac.uk/people/staff/casal + +*/ // here i put common data structures and functions diff --git a/rhythms_memory.c b/rhythms_memory.c index f750c19..3b295e8 100755 --- a/rhythms_memory.c +++ b/rhythms_memory.c @@ -1,6 +1,9 @@ /* rhythms_memory -by Davide Morelli www.davidemorelli.it 2005 + +Authors: +Davide Morelli http://www.davidemorelli.it +David Plans Casal http://www.studios.uea.ac.uk/people/staff/casal uses graphs to store rhythms @@ -322,6 +325,24 @@ static void add_rhythm(t_rhythms_memory *x, t_symbol *s, int argc, t_atom *argv) post("TODO"); } +// creates a variation of a given rhythm (in memory) +// with a given degree of closeness +static void variation(t_rhythms_memory *x, t_symbol *s, int argc, t_atom *argv) +{ + // TODO + post("TODO"); + + // get the rhythm + + // using the transitions table create a new one + + // add it to the memory? + + // output to the list outlet? + + // set it as the next played rhythm +} + static void rhythms_memory_bang(t_rhythms_memory *x) { // generate a random value @@ -400,6 +421,9 @@ void rhythms_memory_setup(void) // adds a rhythm passing it as a list of floats class_addmethod(rhythms_memory_class, (t_method)add_rhythm, gensym("rhythm_in"), A_GIMME, 0); + // builds a variation of a given rhythm + class_addmethod(rhythms_memory_class, (t_method)variation, gensym("variation"), + A_GIMME, 0); } -- cgit v1.2.1