Update of /cvsroot/pure-data/externals/frankenstein In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24611
Modified Files: chords_memory.c harmonizer.c Added Files: GArhythm.vcproj chords_memory.vcproj frankenstein.sln harmonizer.vcproj Log Message: improving harmonizer, adding MSVC project files
--- NEW FILE: GArhythm.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="GArhythm" ProjectGUID="{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/export:GArhythm_setup /dll" AdditionalDependencies="pd.lib" OutputFile="$(OutDir)/GArhythm.dll" LinkIncremental="2" AdditionalLibraryDirectories="../" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/frankenstein.pdb" SubSystem="0" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/frankenstein.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="GArhythm.c"> </File> <File RelativePath="common.c"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="common.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject>
Index: harmonizer.c =================================================================== RCS file: /cvsroot/pure-data/externals/frankenstein/harmonizer.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** harmonizer.c 10 Dec 2005 15:14:12 -0000 1.3 --- harmonizer.c 15 Jan 2006 01:38:32 -0000 1.4 *************** *** 46,49 **** --- 46,52 ---- #define POSSIBLE_NOTES (NOTES_RANGE/12*4) // 4 is the max number of notes in a chord
+ // default values + #define DEF_WIDENESS 3 // 3 octaves + #define DEF_CENTER_NOTE 72 // central C // testing i noticed that we don't need more than 1 generation.. // this is because we create an initial population that is really good *************** *** 103,106 **** --- 106,117 ---- int target_notes[POSSIBLE_NOTES]; t_outlet *l_out; + + float wideness; + int center_note; + float i_like_parallelism; + float small_intervals; + //TODO + // int lower_octave; + // int notes_range; } t_harmonizer; *************** *** 339,344 **** directions[2]==directions[3]) { ! // bad! ! res -= 10; if (DEBUG_VERBOSE) post("same direction!"); --- 350,354 ---- directions[2]==directions[3]) { ! res += 10 * x->i_like_parallelism; if (DEBUG_VERBOSE) post("same direction!"); *************** *** 358,362 **** if (directions[i]==directions[j]) { ! res -= 10; if (DEBUG_VERBOSE) post("hidden or parallel consonance!"); --- 368,372 ---- if (directions[i]==directions[j]) { ! res += 10 * x->i_like_parallelism; if (DEBUG_VERBOSE) post("hidden or parallel consonance!"); *************** *** 380,384 **** if (DEBUG_VERBOSE) post("average note is %i after division by (VOICES-1)", tmp); ! tmp = abs((LOWER_POSSIBLE_NOTE + NOTES_RANGE)*2/3 - tmp); // how much average is far from 72 res += 30; res -= tmp; --- 390,395 ---- if (DEBUG_VERBOSE) post("average note is %i after division by (VOICES-1)", tmp); ! // tmp = abs((LOWER_POSSIBLE_NOTE + NOTES_RANGE)*2/3 - tmp); // how much average is far from 72 ! tmp = abs(x->center_note - tmp); // how much average is far from desired center note res += 30; res -= tmp; *************** *** 414,432 **** res += 5; if (abs(transitions[i]==1)) ! res += 5; if (abs(transitions[i]==2)) ! res += 5; if (abs(transitions[i]==3)) ! res += 2; if (abs(transitions[i]==4)) ! res += 2; if (abs(transitions[i]==5)) ! res += 1; if (abs(transitions[i]==6)) ! res += 1; if (abs(transitions[i]>11)) ! res -= 2; if (abs(transitions[i]>15)) ! res -= 5;
} --- 425,443 ---- res += 5; if (abs(transitions[i]==1)) ! res += 5 * x->small_intervals; if (abs(transitions[i]==2)) ! res += 5 * x->small_intervals; if (abs(transitions[i]==3)) ! res += 2 * x->small_intervals; if (abs(transitions[i]==4)) ! res += 2 * x->small_intervals; if (abs(transitions[i]==5)) ! res += 1 * x->small_intervals; if (abs(transitions[i]==6)) ! res += 1 * x->small_intervals; if (abs(transitions[i]>11)) ! res -= 2 * x->small_intervals; if (abs(transitions[i]>15)) ! res -= 5 * x->small_intervals;
} *************** *** 436,440 **** // TODO: too many near limits? ! // TODO: is a complete chord? // does this voicing have all 5 notes? // first build a table for comparision --- 447,451 ---- // TODO: too many near limits? ! // is a complete chord? // does this voicing have all 5 notes? // first build a table for comparision *************** *** 457,461 **** { // no fundamental! this is bad!! ! res -= 5; } if ((chord_notes_ok[0] != 0) && --- 468,472 ---- { // no fundamental! this is bad!! ! res -= 10; } if ((chord_notes_ok[0] != 0) && *************** *** 465,469 **** { // complete chord! this is good ! res += 5; } for (j=0; j<4; j++) --- 476,480 ---- { // complete chord! this is good ! res += 10; } for (j=0; j<4; j++) *************** *** 636,639 **** --- 647,702 ---- }
+ //how any octaves should this chord be? + void set_wideness(t_harmonizer *x, t_floatarg f) + { + if (f>=0) + x->wideness = f; + } + + // which note should the center note have ? + void set_center_note(t_harmonizer *x, t_floatarg f) + { + if ((f>=LOWER_POSSIBLE_NOTE)&&(f<120)) + x->center_note = (int) f; + } + + // which note should the center note have ? + void set_i_like_parallelism(t_harmonizer *x, t_floatarg f) + { + float newval = f; + if (newval<-1) + newval = -1; + if (newval>1) + newval = 1; + x->i_like_parallelism = newval; + } + + // which note should the center note have ? + void set_small_intervals(t_harmonizer *x, t_floatarg f) + { + float newval = f; + if (newval<-1) + newval = -1; + if (newval>1) + newval = 1; + x->small_intervals = newval; + } + + void print_help(t_harmonizer *x) + { + post(""); + post("harmonizer is an external that builds voicing"); + post("takes chords name and outputs a list of %i midi notes", VOICES); + post("available commands:"); + post("current symbol: sets the current chord name (which chordwe are in)"); + post("target symbol: sets the target chord name (which chord we want to go to)"); + post("wideness float: now many octaves wide should the next chord be? must be > than 0"); + post("set_center_note int: sets the desired center chord note, min 24 max 100"); + post("i_like_parallelism float: do I want parallelism? from -1 (I don't want them) to 1 (I like them), 0 means I don't care, default = -1"); + post("small_intervals float: do I want small intervals? from -1 (I don't want them) to 1 (I like them), 0 means I don't care, default = 1"); + post("this externalis part of the frank framework"); + post("authors: davide morelli, david casals"); + + }
void *harmonizer_new(t_symbol *s, int argc, t_atom *argv) *************** *** 642,646 **** time_t a; t_harmonizer *x = (t_harmonizer *)pd_new(harmonizer_class); ! x->l_out = outlet_new(&x->x_obj, &s_list); /* for (i=0; i<BUFFER_LENGHT; i++) --- 705,709 ---- time_t a; t_harmonizer *x = (t_harmonizer *)pd_new(harmonizer_class); ! x->l_out = outlet_new(&x->x_obj, gensym("list")); /* for (i=0; i<BUFFER_LENGHT; i++) *************** *** 650,654 **** */ srand(time(&a)); ! return (x); } --- 713,720 ---- */ srand(time(&a)); ! x->center_note = DEF_CENTER_NOTE; ! x->wideness = DEF_WIDENESS; ! x->i_like_parallelism = -1; // by default we don't like them! ! x->small_intervals = 1; //by default we want small intervals return (x); } *************** *** 659,667 **** (t_method)harmonizer_free, sizeof(t_harmonizer), CLASS_DEFAULT, A_GIMME, 0); class_addbang(harmonizer_class, (t_method)harmonizer_bang); class_addmethod(harmonizer_class, (t_method)set_current, gensym("current"),A_SYMBOL, 0); class_addmethod(harmonizer_class, (t_method)set_target, gensym("target"),A_SYMBOL, 0); // class_addmethod(harmonizer_class, (t_method)harmonizer_fitness1_set, gensym("fitness1"), A_DEFFLOAT, 0); class_addlist(harmonizer_class, (t_method)set_current_voices); !
} --- 725,738 ---- (t_method)harmonizer_free, sizeof(t_harmonizer), CLASS_DEFAULT, A_GIMME, 0); class_addbang(harmonizer_class, (t_method)harmonizer_bang); + class_addmethod(harmonizer_class, (t_method)print_help, gensym("help"),0, 0); class_addmethod(harmonizer_class, (t_method)set_current, gensym("current"),A_SYMBOL, 0); class_addmethod(harmonizer_class, (t_method)set_target, gensym("target"),A_SYMBOL, 0); // class_addmethod(harmonizer_class, (t_method)harmonizer_fitness1_set, gensym("fitness1"), A_DEFFLOAT, 0); class_addlist(harmonizer_class, (t_method)set_current_voices); ! class_addmethod(harmonizer_class, (t_method)set_wideness, gensym("wideness"), A_DEFFLOAT, 0); ! class_addmethod(harmonizer_class, (t_method)set_center_note, gensym("center_note"), A_DEFFLOAT, 0); ! class_addmethod(harmonizer_class, (t_method)set_i_like_parallelism, gensym("i_like_parallelism"), A_DEFFLOAT, 0); ! class_addmethod(harmonizer_class, (t_method)set_small_intervals, gensym("small_intervals"), A_DEFFLOAT, 0); !
}
--- NEW FILE: chords_memory.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="chords_memory" ProjectGUID="{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/export:chords_memory_setup /dll" AdditionalDependencies="pd.lib" OutputFile="$(OutDir)/chords_memory.dll" LinkIncremental="2" AdditionalLibraryDirectories="../" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/frankenstein.pdb" SubSystem="0" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/frankenstein.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="chords_memory.c"> </File> <File RelativePath="common.c"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="common.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject>
--- NEW FILE: frankenstein.sln --- Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chords_memory", "chords_memory.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rhythms_memory", "rhythms_memory.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "themes_memory", "themes_memory.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "harmonizer", "harmonizer.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voicing_analyzer", "voicing_analyzer.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32 {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal
--- NEW FILE: harmonizer.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="harmonizer" ProjectGUID="{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/export:harmonizer_setup /dll" AdditionalDependencies="pd.lib" OutputFile="$(OutDir)/harmonizer.dll" LinkIncremental="2" AdditionalLibraryDirectories="../" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/frankenstein.pdb" SubSystem="0" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/frankenstein.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="common.c"> </File> <File RelativePath="harmonizer.c"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="common.h"> </File> <File RelativePath="sglib.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject>
Index: chords_memory.c =================================================================== RCS file: /cvsroot/pure-data/externals/frankenstein/chords_memory.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** chords_memory.c 8 Dec 2005 16:31:10 -0000 1.6 --- chords_memory.c 15 Jan 2006 01:38:32 -0000 1.7 *************** *** 1095,1099 **** x->x_outchordname = outlet_new(&x->x_obj, gensym("symbol")); x->x_outtonalityname = outlet_new(&x->x_obj, gensym("symbol")); ! x->x_outchordssequence = outlet_new(&x->x_obj, &s_list); srand(time(&a)); chords_memory_init_graph(x); --- 1095,1099 ---- x->x_outchordname = outlet_new(&x->x_obj, gensym("symbol")); x->x_outtonalityname = outlet_new(&x->x_obj, gensym("symbol")); ! x->x_outchordssequence = outlet_new(&x->x_obj, gensym("list")); srand(time(&a)); chords_memory_init_graph(x); *************** *** 1116,1153 **** }
- // TEST - typedef struct _bla - { - int value; - int index; - } bla_t; - typedef struct _bla2 - { - bla_t array[10]; - } bla2_t; - #define BLA_COMPARATOR(e1, e2) (e1.value - e2.value) - //TEST - void chords_memory_bang(t_chords_memory *x) - { - int i; - bla2_t test[2]; - for (i=0; i<10; i++) - { - test[1].array[i].index = i; - test[1].array[i].value = 10-i; - } - SGLIB_ARRAY_QUICK_SORT (bla_t, test[1].array, 10, BLA_COMPARATOR, SGLIB_ARRAY_ELEMENTS_EXCHANGER); - for (i=0; i<10; i++) - { - post("array[%i].value = %i, array[%i].index = %i",i, test[1].array[i].value,i, test[1].array[i].index ); - } - - } - void chords_memory_setup(void) { chords_memory_class = class_new(gensym("chords_memory"), (t_newmethod)chords_memory_new, (t_method)chords_memory_free, sizeof(t_chords_memory), CLASS_DEFAULT, A_GIMME, 0); - class_addbang(chords_memory_class, (t_method)chords_memory_bang); // file I/O class_addmethod(chords_memory_class, (t_method)chords_memory_write_to_file, gensym("write"),A_SYMBOL, 0); --- 1116,1123 ----