From dd5a86efe9a9f6ed8278a5a5a3927c6a80bbbf90 Mon Sep 17 00:00:00 2001 From: "B. Bogart" Date: Thu, 29 Aug 2002 17:06:09 +0000 Subject: Updated makefile and setup single library, win32, linux, OSX svn path=/trunk/externals/bbogart/chaos/; revision=96 --- chaos.c | 69 ++++++++++++++++++++++++++++++ chaos.ncb | Bin 0 -> 27648 bytes chaos.sln | 21 +++++++++ chaos.suo | Bin 0 -> 7168 bytes chaos.vcproj | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ henon.c | 87 ++++++++++++++++++-------------------- ikeda.c | 89 +++++++++++++++++++------------------- lorenz.c | 101 +++++++++++++++++++++----------------------- makefile | 92 +++++++++++++++++++++------------------- rossler.c | 70 +++++++++++++++--------------- 10 files changed, 441 insertions(+), 224 deletions(-) create mode 100644 chaos.c create mode 100644 chaos.ncb create mode 100644 chaos.sln create mode 100644 chaos.suo create mode 100644 chaos.vcproj diff --git a/chaos.c b/chaos.c new file mode 100644 index 0000000..89d6fab --- /dev/null +++ b/chaos.c @@ -0,0 +1,69 @@ +/////////////////////////////////////////////////////////////////////////////////// +/* Chaos Math PD Externals */ +/* Copyright Ben Bogart 2002 */ +/* This program is distributed under the terms of the GNU General Public License */ +/////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////// +/* This file is part of Chaos PD Externals. */ +/* */ +/* Chaos PD Externals are free software; you can redistribute them and/or modify */ +/* them under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* Chaos PD Externals are distributed in the hope that they will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with the Chaos PD Externals; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/////////////////////////////////////////////////////////////////////////////////// + + +#include "m_pd.h" + + +#ifndef __DATE__ +#define __DATE__ "without using a gnu compiler" +#endif + +typedef struct _chaos +{ + t_object x_obj; +} t_chaos; + +static t_class* chaos_class; + + /* objects */ +void henon_setup(); +void ikeda_setup(); +void lorenz_setup(); +void rossler_setup(); + +static void* chaos_new(t_symbol* s) +{ + t_chaos *x = (t_chaos *)pd_new(chaos_class); + return (x); +} + +void chaos_setup(void) +{ + chaos_class = class_new(gensym("chaos"), (t_newmethod)chaos_new, 0, + sizeof(t_chaos), 0,0); + + post("-------------------------"); /* Copyright info */ + post("Chaos PD Externals"); + post("Copyright Ben Bogart 2002"); + post("Win32 compilation by joge 2002"); + + henon_setup(); + ikeda_setup(); + lorenz_setup(); + rossler_setup(); + + post("-------------------------"); +} + diff --git a/chaos.ncb b/chaos.ncb new file mode 100644 index 0000000..1c9a033 Binary files /dev/null and b/chaos.ncb differ diff --git a/chaos.sln b/chaos.sln new file mode 100644 index 0000000..b558166 --- /dev/null +++ b/chaos.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chaos", "chaos.vcproj", "{079DD347-F5E0-4784-9BCE-AF551691BA41}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {079DD347-F5E0-4784-9BCE-AF551691BA41}.Debug.ActiveCfg = Debug|Win32 + {079DD347-F5E0-4784-9BCE-AF551691BA41}.Debug.Build.0 = Debug|Win32 + {079DD347-F5E0-4784-9BCE-AF551691BA41}.Release.ActiveCfg = Release|Win32 + {079DD347-F5E0-4784-9BCE-AF551691BA41}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/chaos.suo b/chaos.suo new file mode 100644 index 0000000..c9887ac Binary files /dev/null and b/chaos.suo differ diff --git a/chaos.vcproj b/chaos.vcproj new file mode 100644 index 0000000..9f968a0 --- /dev/null +++ b/chaos.vcproj @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/henon.c b/henon.c index 21dbad1..54cf4e2 100644 --- a/henon.c +++ b/henon.c @@ -25,20 +25,20 @@ #include "m_pd.h" #include -t_class *myclass; +t_class *henon_class; -typedef struct thisismystruct +typedef struct henon_struct { - t_object myobj; - double a,b,lx0,ly0; + t_object henon_obj; + double a, b, lx0, ly0; t_outlet *y_outlet; -} mystruct; +} henon_struct; -static void calculate(mystruct *x) +static void calculate(henon_struct *x) { - double lx0,ly0,lx1,ly1; - double a,b; - + double lx0, ly0, lx1, ly1; + double a, b; + a = x->a; b = x->b; lx0 = x->lx0; @@ -49,62 +49,59 @@ static void calculate(mystruct *x) x->lx0 = lx1; x->ly0 = ly1; - outlet_float(x->myobj.ob_outlet, (t_float)lx1); + outlet_float(x->henon_obj.ob_outlet, (t_float)lx1); outlet_float(x->y_outlet, (t_float)ly1); } -static void reset(mystruct *x) +static void reset(henon_struct *x) { x->lx0 = 1; - x->ly0 = 1; + x->ly0 = 1; } -static void param(mystruct *x, t_floatarg a, t_floatarg b) +static void param(henon_struct *x, t_floatarg a, t_floatarg b) { - x->a = (double)a; - x->b = (double)b; + x->a = (double)a; + x->b = (double)b; } void *henon_new(void) { - mystruct *x = (mystruct *)pd_new(myclass); + henon_struct *x = (henon_struct *)pd_new(henon_class); x->a = 1.4; x->b = 0.3; x->lx0 = 1; x->ly0 = 1; - outlet_new(&x->myobj, &s_float); /* Default float outlet */ - x->y_outlet = outlet_new(&x->myobj, &s_float); /* New Outlet */ - return (void *)x; + outlet_new(&x->henon_obj, &s_float); /* Default float outlet */ + x->y_outlet = outlet_new(&x->henon_obj, &s_float); /* New Outlet */ + + return (void *)x; } void henon_setup(void) { - post("-------------------------"); /* Copyright info */ - post("Chaos PD Externals"); - post("Copyright Ben Bogart 2002"); - post("-------------------------"); - - myclass = class_new(gensym("henon"), /* symname is the symbolic name */ - (t_newmethod)henon_new, /* Constructor Function */ - 0, /* Destructor Function */ - sizeof(mystruct), /* Size of the structure */ - CLASS_DEFAULT, /* Graphical Representation */ - 0); /* 0 Terminates Argument List */ - - class_addbang(myclass, (t_method)calculate); - class_addmethod(myclass, - (t_method)reset, - gensym("reset"), - 0); - - class_addmethod(myclass, - (t_method)param, - gensym("param"), - A_DEFFLOAT, - A_DEFFLOAT, - 0); + post("henon"); + + henon_class = class_new(gensym("henon"), /* symname is the symbolic name */ + (t_newmethod)henon_new, /* Constructor Function */ + 0, /* Destructor Function */ + sizeof(henon_struct), /* Size of the structure */ + CLASS_DEFAULT, /* Graphical Representation */ + 0); /* 0 Terminates Argument List */ + + class_addbang(henon_class, (t_method)calculate); + + class_addmethod(henon_class, + (t_method)reset, + gensym("reset"), + 0); + + class_addmethod(henon_class, + (t_method)param, + gensym("param"), + A_DEFFLOAT, + A_DEFFLOAT, + 0); } - - diff --git a/ikeda.c b/ikeda.c index 2510d3e..4734147 100644 --- a/ikeda.c +++ b/ikeda.c @@ -26,19 +26,19 @@ #include -t_class *myclass; +t_class *ikeda_class; -typedef struct thisismystruct +typedef struct ikeda_struct { - t_object myobj; - double a,b,c,rho,lx0,ly0; + t_object ikeda_obj; + double a, b, c, rho, lx0, ly0; t_outlet *y_outlet; -} mystruct; +} ikeda_struct; -static void calculate(mystruct *x) +static void calculate(ikeda_struct *x) { - double lx0,ly0,lx1,ly1; - double a,b,c,rho,tmp,cos_tmp,sin_tmp; + double lx0, ly0, lx1, ly1; + double a, b, c, rho, tmp, cos_tmp, sin_tmp; a = x->a; b = x->b; @@ -57,27 +57,27 @@ static void calculate(mystruct *x) x->lx0 = lx1; x->ly0 = ly1; - outlet_float(x->myobj.ob_outlet, (t_float)lx1); + outlet_float(x->ikeda_obj.ob_outlet, (t_float)lx1); outlet_float(x->y_outlet, (t_float)ly1); } -static void reset(mystruct *x) +static void reset(ikeda_struct *x) { x->lx0 = 0.1; - x->ly0 = 0.1; + x->ly0 = 0.1; } -static void param(mystruct *x, t_floatarg a, t_floatarg b, t_floatarg c, t_floatarg rho) +static void param(ikeda_struct *x, t_floatarg a, t_floatarg b, t_floatarg c, t_floatarg rho) { - x->a = (double)a; - x->b = (double)b; + x->a = (double)a; + x->b = (double)b; x->c = (double)c; x->rho = (double)rho; } void *ikeda_new(void) { - mystruct *x = (mystruct *)pd_new(myclass); + ikeda_struct *x = (ikeda_struct *)pd_new(ikeda_class); x->a = 0.4; x->b = 0.9; x->c = 6.0; @@ -85,40 +85,37 @@ void *ikeda_new(void) x->lx0 = 0.1; x->ly0 = 0.1; - outlet_new(&x->myobj, &s_float); /* Default float outlet */ - x->y_outlet = outlet_new(&x->myobj, &s_float); /* New Outlet */ - return (void *)x; + outlet_new(&x->ikeda_obj, &s_float); /* Default float outlet */ + x->y_outlet = outlet_new(&x->ikeda_obj, &s_float); /* New Outlet */ + + return (void *)x; } void ikeda_setup(void) { - post("-------------------------"); /* Copyright info */ - post("Chaos PD Externals"); - post("Copyright Ben Bogart 2002"); - post("-------------------------"); - - myclass = class_new(gensym("ikeda"), /* symname is the symbolic name */ - (t_newmethod)ikeda_new, /* Constructor Function */ - 0, /* Destructor Function */ - sizeof(mystruct), /* Size of the structure */ - CLASS_DEFAULT, /* Graphical Representation */ - 0); /* 0 Terminates Argument List */ - - class_addbang(myclass, (t_method)calculate); - class_addmethod(myclass, - (t_method)reset, - gensym("reset"), - 0); - - class_addmethod(myclass, - (t_method)param, - gensym("param"), - A_DEFFLOAT, - A_DEFFLOAT, - A_DEFFLOAT, - A_DEFFLOAT, - 0); + post("ikeda"); + + ikeda_class = class_new(gensym("ikeda"), /* symname is the symbolic name */ + (t_newmethod)ikeda_new, /* Constructor Function */ + 0, /* Destructor Function */ + sizeof(ikeda_struct), /* Size of the structure */ + CLASS_DEFAULT, /* Graphical Representation */ + 0); /* 0 Terminates Argument List */ + + class_addbang(ikeda_class, (t_method)calculate); + + class_addmethod(ikeda_class, + (t_method)reset, + gensym("reset"), + 0); + + class_addmethod(ikeda_class, + (t_method)param, + gensym("param"), + A_DEFFLOAT, + A_DEFFLOAT, + A_DEFFLOAT, + A_DEFFLOAT, + 0); } - - diff --git a/lorenz.c b/lorenz.c index ef61f5d..ecc206b 100644 --- a/lorenz.c +++ b/lorenz.c @@ -25,20 +25,20 @@ #include "m_pd.h" #include -t_class *myclass; +t_class *lorenz_class; -typedef struct thisismystruct +typedef struct lorenz_struct { - t_object myobj; - double h,a,b,c,lx0,ly0,lz0; + t_object lorenz_obj; + double h, a, b, c, lx0, ly0, lz0; t_outlet *y_outlet; t_outlet *z_outlet; -} mystruct; +} lorenz_struct; -static void calculate(mystruct *x) +static void calculate(lorenz_struct *x) { - double lx0,ly0,lz0,lx1,ly1,lz1; - double h,a,b,c; + double lx0, ly0, lz0, lx1, ly1, lz1; + double h, a, b, c; h = x->h; a = x->a; @@ -55,29 +55,29 @@ static void calculate(mystruct *x) x->ly0 = ly1; x->lz0 = lz1; - outlet_float(x->myobj.ob_outlet, (t_float)lx1); + outlet_float(x->lorenz_obj.ob_outlet, (t_float)lx1); outlet_float(x->y_outlet, (t_float)ly1); outlet_float(x->z_outlet, (t_float)lz1); } -static void reset(mystruct *x) +static void reset(lorenz_struct *x) { x->lx0 = 0.1; - x->ly0 = 0; - x->lz0 = 0; + x->ly0 = 0; + x->lz0 = 0; } -static void param(mystruct *x, t_floatarg h, t_floatarg a, t_floatarg b, t_floatarg c) +static void param(lorenz_struct *x, t_floatarg h, t_floatarg a, t_floatarg b, t_floatarg c) { - x->h = (double)h; - x->a = (double)a; - x->b = (double)b; - x->c = (double)c; + x->h = (double)h; + x->a = (double)a; + x->b = (double)b; + x->c = (double)c; } void *lorenz_new(void) { - mystruct *x = (mystruct *)pd_new(myclass); + lorenz_struct *x = (lorenz_struct *)pd_new(lorenz_class); x->h = 0.01; x->a = 10.0; x->b = 28.0; @@ -85,43 +85,40 @@ void *lorenz_new(void) x->lx0 = 0.1; x->ly0 = 0; x->lz0 = 0; - - outlet_new(&x->myobj, &s_float); /* Default float outlet */ - x->y_outlet = outlet_new(&x->myobj, &s_float); /* Two New Outlets */ - x->z_outlet = outlet_new(&x->myobj, &s_float); - return (void *)x; + + outlet_new(&x->lorenz_obj, &s_float); /* Default float outlet */ + x->y_outlet = outlet_new(&x->lorenz_obj, &s_float); /* Two New Outlets */ + x->z_outlet = outlet_new(&x->lorenz_obj, &s_float); + + return (void *)x; } void lorenz_setup(void) { - post("-------------------------"); /* Copyright info */ - post("Chaos PD Externals"); - post("Copyright Ben Bogart 2002"); - post("-------------------------"); - - myclass = class_new(gensym("lorenz"), /* symname is the symbolic name */ - (t_newmethod)lorenz_new, /* Constructor Function */ - 0, /* Destructor Function */ - sizeof(mystruct), /* Size of the structure */ - CLASS_DEFAULT, /* Graphical Representation */ - 0); /* 0 Terminates Argument List */ - - class_addbang(myclass, (t_method)calculate); - class_addmethod(myclass, - (t_method)reset, - gensym("reset"), - 0); - - class_addmethod(myclass, - (t_method)param, - gensym("param"), - A_DEFFLOAT, - A_DEFFLOAT, - A_DEFFLOAT, - A_DEFFLOAT, - 0); - + + post("lorenz"); + + lorenz_class = class_new(gensym("lorenz"), /* symname is the symbolic name */ + (t_newmethod)lorenz_new, /* Constructor Function */ + 0, /* Destructor Function */ + sizeof(lorenz_struct), /* Size of the structure */ + CLASS_DEFAULT, /* Graphical Representation */ + 0); /* 0 Terminates Argument List */ + + class_addbang(lorenz_class, (t_method)calculate); + + class_addmethod(lorenz_class, + (t_method)reset, + gensym("reset"), + 0); + + class_addmethod(lorenz_class, + (t_method)param, + gensym("param"), + A_DEFFLOAT, + A_DEFFLOAT, + A_DEFFLOAT, + A_DEFFLOAT, + 0); } - - diff --git a/makefile b/makefile index 4d3db92..4633d68 100644 --- a/makefile +++ b/makefile @@ -1,75 +1,79 @@ -current: - echo make pd_linux, pd_nt, pd_irix5, or pd_irix6 +NAME=chaos +CSYM=chaos -clean: ; rm -f *.pd_linux *.o +current: pd_nt pd_intel pd_linux pd_darwin # ----------------------- NT ----------------------- -pd_nt: lorenz.dll rossler.dll henon.dll ikeda.dll +pd_nt: $(NAME).dll .SUFFIXES: .dll -PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo -VC="C:\Program Files\Microsoft Visual Studio\Vc98" +PDNTCFLAGS = /W3 /WX /MD /O2 /G6 /DNT /DPD /DMAXLIB /nologo +VC="C:\Programme\Microsoft Visual Studio\VC98" -PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include +PDNTINCLUDE = /I. /Ic:\pd\tcl\include /Ic:\pd\src /I$(VC)\include /Iinclude -PDNTLDIR = $(VC)\lib -PDNTLIB = $(PDNTLDIR)\libc.lib \ +PDNTLDIR = $(VC)\Lib +PDNTLIB = $(PDNTLDIR)\msvcrt.lib \ $(PDNTLDIR)\oldnames.lib \ $(PDNTLDIR)\kernel32.lib \ - \ftp\pd\bin\pd.lib + $(PDNTLDIR)\user32.lib \ + $(PDNTLDIR)\uuid.lib \ + $(PDNTLDIR)\ws2_32.lib \ + $(PDNTLDIR)\pthreadVC.lib \ + c:\pd\bin\pd.lib + +PDNTEXTERNALS = lorenz.obj rossler.obj henon.obj ikeda.obj .c.dll: - cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c - link /dll /export:$*_setup $*.obj $(PDNTLIB) + cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c *.c + link /dll /export:$(CSYM)_setup $*.obj $(PDNTEXTERNALS) $(PDNTLIB) -# ----------------------- IRIX 5.x ----------------------- +# ----------------------- Mac OS X (Darwin) ----------------------- -pd_irix5: lorenz.pd_irix5 rossler.pd_irix5 henon.pd_irix5 ikeda.pd_irix5 +pd_darwin: $(NAME).pd_darwin -.SUFFIXES: .pd_irix5 +.SUFFIXES: .pd_darwin -SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2 - - -SGIINCLUDE = -I../../src/ - -.c.pd_irix5: - cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c - ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o - rm $*.o - -# ----------------------- IRIX 6.x ----------------------- - -pd_irix6: lorenz.pd_irix6 rossler.pd_irix6 henon.pd_irix6 ikeda.pd_irix6 +DARWINCFLAGS = -DPD -DMAXLIB -DUNIX -DMACOSX -O2 \ + -Wall -W -Wshadow -Wstrict-prototypes \ + -Wno-unused -Wno-parentheses -Wno-switch -.SUFFIXES: .pd_irix6 +# where is your m_pd.h ??? +DARWININCLUDE = -I../../src -I../../obj -SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \ - -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \ - -Ofast=ip32 +DARWINEXTERNALS = lorenz.o rossler.o henon.o ikeda.o -.c.pd_irix6: - cc $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c - ld -IPA -n32 -shared -rdata_shared -o $*.pd_irix6 $*.o - rm $*.o +.c.pd_darwin: + cc $(DARWINCFLAGS) $(DARWININCLUDE) -c *.c + cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o $(DARWINEXTERNALS) + rm -f $*.o ../$*.pd_darwin + ln -s $*/$*.pd_darwin .. # ----------------------- LINUX i386 ----------------------- -pd_linux: lorenz.pd_linux rossler.pd_linux henon.pd_linux ikeda.pd_linux +pd_linux: $(NAME).pd_linux .SUFFIXES: .pd_linux -LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \ - -Wall -W -Wshadow -Wstrict-prototypes -Werror \ +LINUXCFLAGS = -DPD -DUNIX -O2 -funroll-loops -fomit-frame-pointer \ + -Wall -W -Wshadow \ -Wno-unused -Wno-parentheses -Wno-switch -LINUXINCLUDE = -I../../src +# where is your m_pd.h ??? +LINUXINCLUDE = -I/usr/local/include + +LINUXEXTERNALS = lorenz.o rossler.o henon.o ikeda.o .c.pd_linux: - cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c - ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm - strip --strip-unneeded $*.pd_linux - rm $*.o + cc -O2 -Wall -DPD -fPIC $(LINUXCFLAGS) $(LINUXINCLUDE) -c *.c + ld -export_dynamic -shared -o $*.pd_linux $*.o $(LINUXEXTERNALS) -lc + strip --strip-unneeded $*.pd_linux + +# ---------------------------------------------------------- + +PDDIR=/usr/lib/pd +clean: + rm -f *.o *.pd_* so_locations diff --git a/rossler.c b/rossler.c index 7d81722..07f8285 100644 --- a/rossler.c +++ b/rossler.c @@ -25,17 +25,17 @@ #include "m_pd.h" #include -t_class *myclass; +t_class *rossler_class; -typedef struct thisismystruct +typedef struct rossler_struct { t_object myobj; double h,a,b,c,lx0,ly0,lz0; t_outlet *y_outlet; t_outlet *z_outlet; -} mystruct; +} rossler_struct; -static void calculate(mystruct *x) +static void calculate(rossler_struct *x) { double lx0,ly0,lz0,lx1,ly1,lz1; double h,a,b,c; @@ -60,14 +60,14 @@ static void calculate(mystruct *x) outlet_float(x->z_outlet, (t_float)lz1); } -static void reset(mystruct *x) +static void reset(rossler_struct *x) { - x->lx0 = 0.1; + x->lx0 = 0.1; x->ly0 = 0; x->lz0 = 0; } -static void param(mystruct *x, t_floatarg h, t_floatarg a, t_floatarg b, t_floatarg c) +static void param(rossler_struct *x, t_floatarg h, t_floatarg a, t_floatarg b, t_floatarg c) { x->h = (double)h; x->a = (double)a; @@ -77,7 +77,7 @@ static void param(mystruct *x, t_floatarg h, t_floatarg a, t_floatarg b, t_float void *rossler_new(void) { - mystruct *x = (mystruct *)pd_new(myclass); + rossler_struct *x = (rossler_struct *)pd_new(rossler_class); x->h = 0.01; x->a = 0.2; x->b = 0.2; @@ -86,7 +86,7 @@ void *rossler_new(void) x->ly0 = 0; x->lz0 = 0; - outlet_new(&x->myobj, &s_float); /* Default float outlet */ + outlet_new(&x->myobj, &s_float); /* Default float outlet */ x->y_outlet = outlet_new(&x->myobj, &s_float); /* Two new Outlets */ x->z_outlet = outlet_new(&x->myobj, &s_float); return (void *)x; @@ -95,32 +95,28 @@ void *rossler_new(void) void rossler_setup(void) { - post("-------------------------"); /* Copyright info */ - post("Chaos PD Externals"); - post("Copyright Ben Bogart 2002"); - post("-------------------------"); - - myclass = class_new(gensym("rossler"), /* symname is the symbolic name */ - (t_newmethod)rossler_new, /* Constructor Function */ - 0, /* Destructor Function */ - sizeof(mystruct), /* Size of the structure */ - CLASS_DEFAULT, /* Graphical Representation */ - 0); /* 0 Terminates Argument List */ - - class_addbang(myclass, (t_method)calculate); - class_addmethod(myclass, - (t_method)reset, - gensym("reset"), - 0); - - class_addmethod(myclass, - (t_method)param, - gensym("param"), - A_DEFFLOAT, - A_DEFFLOAT, - A_DEFFLOAT, - A_DEFFLOAT, - 0); + post("rossler"); + + rossler_class = class_new(gensym("rossler"), /* symname is the symbolic name */ + (t_newmethod)rossler_new, /* Constructor Function */ + 0, /* Destructor Function */ + sizeof(rossler_struct), /* Size of the structure */ + CLASS_DEFAULT, /* Graphical Representation */ + 0); /* 0 Terminates Argument List */ + + class_addbang(rossler_class, (t_method)calculate); + + class_addmethod(rossler_class, + (t_method)reset, + gensym("reset"), + 0); + + class_addmethod(rossler_class, + (t_method)param, + gensym("param"), + A_DEFFLOAT, + A_DEFFLOAT, + A_DEFFLOAT, + A_DEFFLOAT, + 0); } - - -- cgit v1.2.1