diff options
author | N.N. <matju@users.sourceforge.net> | 2006-03-15 04:55:34 +0000 |
---|---|---|
committer | N.N. <matju@users.sourceforge.net> | 2006-03-15 04:55:34 +0000 |
commit | a89a3c9fecd05a623aef900114cf936ba9ecd9e7 (patch) | |
tree | ca324f1fce798773c13c065e25eb491451fbace1 | |
parent | fcc7e06dd433c53507f40eff12d3187a9ac13456 (diff) |
0.8.1
svn path=/trunk/; revision=4710
139 files changed, 9174 insertions, 3281 deletions
diff --git a/externals/gridflow/ChangeLog b/externals/gridflow/ChangeLog index 32329982..dcaf9bbc 100644 --- a/externals/gridflow/ChangeLog +++ b/externals/gridflow/ChangeLog @@ -1,4 +1,18 @@ -/* $Id: ChangeLog,v 1.1 2005-10-04 02:12:43 matju Exp $ */ +/* $Id: ChangeLog,v 1.2 2006-03-15 04:48:08 matju Exp $ */ + +version 0.8.1 (2006.02.20): + + * [ls] now supports wildcards: ? [] * ** + * [#color] has new method: delegate + * added [regsub], [memstat], [listfind], [sendgui] + * x11: removed methods: draw,autodraw; added: use_shm,title + * examples : added markov.pd, bounce.pd, doodle.pd, mechanics.pd + * [#pack],[#unpack] now default to 2 values + * new numops: clip+,clip- + * fix for shared memory bug in [#out x11] + * added [#out tk] + * added [#out opengl] (using GLUT, hackishly) + * [unix_time] behaviour changed. (see manual) version 0.8.0 (2005.06.06): @@ -12,7 +26,7 @@ version 0.8.0 (2005.06.06): * 13 object-classes rewritten from Ruby to Pd abstractions * merged [@],[@!] -> [#] and added message "op" * removed all one-input ops (see next...) - * new two-input ops: abs- sq- avg hypot sqrt rand (soon erf* clip+ clip-) + * new two-input ops: abs- sq- avg hypot sqrt rand * [#fold],[#scan]: removed seed arg and right outlet; added msgs "op" and "seed" * [#inner],[#convolve] : added msgs "op" and "seed" * [#inner],[#convolve] : removed three first args (usually * + 0) @@ -34,6 +48,7 @@ version 0.8.0 (2005.06.06): [exec], [plotter_control], [#text_to_image], [#hueshift], [rubyarray] * in pd_examples added Alx's epicycloid.pd, scratch_video.pd, threshold.pd and Matju's goop.pd + * some new/updated help files by Stéphanie Brodeur & Darsha Hewitt version 0.7.7 (2004.08.24): diff --git a/externals/gridflow/Makefile.gf b/externals/gridflow/Makefile.gf index a7c55274..3be2e3fa 100644 --- a/externals/gridflow/Makefile.gf +++ b/externals/gridflow/Makefile.gf @@ -1,4 +1,4 @@ -# $Id: Makefile.gf,v 1.1 2005-10-04 02:12:43 matju Exp $ +# $Id: Makefile.gf,v 1.2 2006-03-15 04:48:08 matju Exp $ # This is an annex that covers what is not covered by the generated Makefile SYSTEM = $(shell uname -s | sed -e 's/^MINGW.*/NT/') @@ -92,9 +92,6 @@ vvtest:: ($(VALG) --leak-check=yes $(RUBY_INSTALL_NAME) -w $(TEST) &> gf-valgrind) || $(BACKTRACE) less gf-valgrind -test16:: test - (ruby-1.6.7 -w $(TEST)) || $(BACKTRACE) - testpd:: rm -f gridflow.pd_linux && make && \ rm -f /opt/lib/ruby/site_ruby/1.7/i586-linux/gridflow.so && \ @@ -145,12 +142,12 @@ puredata-install:: cp doc/flow_classes/*.p* $(DOK)/flow_classes cp -r images/ $(PUREDATA_PATH)/extra/gridflow cp $(PD_LIB) pd_abstractions/*.pd $(PUREDATA_PATH)/extra - for z in camera_control motion_detection color mouse centroid centre_of_gravity fade \ + for z in camera_control motion_detection color mouse centre_of_gravity fade \ apply_colormap_channelwise checkers contrast posterize ravel remap_image solarize spread \ rgb_to_greyscale greyscale_to_rgb rgb_to_yuv yuv_to_rgb; do \ cp pd_abstractions/\#$$z.pd $(PUREDATA_PATH)/extra/\@$$z.pd; done mkdir -p $(PUREDATA_PATH)/extra/gridflow/icons - $(INSTALL_DATA) java/peephole.gif $(PUREDATA_PATH)/extra/gridflow/icons/peephole.gif + $(INSTALL_DATA) icons/peephole.gif $(PUREDATA_PATH)/extra/gridflow/icons/peephole.gif else diff --git a/externals/gridflow/README b/externals/gridflow/README index c334cecf..25de6ca9 100644 --- a/externals/gridflow/README +++ b/externals/gridflow/README @@ -43,4 +43,4 @@ Legalese CVS - $Id: README,v 1.1 2005-10-04 02:12:43 matju Exp $ + $Id: README,v 1.2 2006-03-15 04:48:05 matju Exp $ diff --git a/externals/gridflow/TODO b/externals/gridflow/TODO index 0a4c01d6..820511ae 100644 --- a/externals/gridflow/TODO +++ b/externals/gridflow/TODO @@ -1,46 +1,37 @@ -/* $Id: TODO,v 1.1 2005-10-04 02:12:43 matju Exp $ */ - -matju cvs update -dP : -P format/quicktimeapple.c -cvs update: warning: pd_examples/binary_operations.pd was lost -C pd_examples/color_correction.pd -C pd_examples/convolve.pd -C pd_examples/drag_rectangle.pd -C pd_examples/eclipse.pd -C pd_examples/linear_transform.pd -C pd_examples/waves.pd - -Checking in README; -/home/cvs/gridflow/README,v <-- README -new revision: 1.22; previous revision: 1.21 -done -$helo_domain: web.artengine.ca -$from_address: matju@web.artengine.ca (matju) -loginfo.rb is writing changelog...done -loginfo.rb is parsing log message...done -loginfo.rb is testing modules...log info for `/home/cvs/gridflow/README' is not ready -done -loginfo.rb is composing a mail...done -loginfo.rb is posting email to gridflow ...ERROR: cannot send email using MTA on ns -450 <gridflow>: Recipient address rejected: User unknown in local recipient table - -done -loginfo.rb is deleting tmp files...done - -AMD64 : - char 1 1 - short 2 2 - int 4 4 - long 4 8 - long long 8 8 - float 4 4 - double 8 8 - void * 4 8 +/* $Id: TODO,v 1.2 2006-03-15 04:48:05 matju Exp $ */ -<ClaudiusMaximus> hmm, sending a [reassign( message to the right inlet of a [#store] segfaults Pd +[ ] SWIG: try -fcompact -fvirtual -<ClaudiusMaximus> hmmm, i get a segfault with a simple patch sending "reassign, put_at ( 0 0 ), reassign" to the right inlet of [#store ( 3 3 # 0 )] +ClaudiusMaximus matju: [#draw_image] inlet 0 method "op <opname>" is undocumented, but very useful :) +ClaudiusMaximus matju: [unix_time] is maldocumented, outlet 0 is a grid Dim[28](uint8), not a symbol + + +[ ] pd_examples -> examples +[ ] update doc +[ ] 0.8.1 +[ ] make good use of the R type (automatic Ruby/C++ convs) +[ ] ditch xml, switch to docstrings or whatever +[ ] ... +claude wants http://en.wikipedia.org/wiki/Graham_scan + +X Error of failed request: BadValue (integer parameter out of range for operation) +error=0x2 +request=0x91 (MIT-SHM) +minor=0x3 (X_ShmPutImage) +value in failed request: 0x04b008 == 240*320*4+8 (matju) + +invalid read of size 1 (main.c.fcs:438) +malloc alignment = 4 mod 8 (en utilisant valgrind) +ClaudiusMaximus matju: feature request: [#store4], behaves like store but accepts grids +of floats as coordinates and interpolate using 4-point interpolation, eg, right inlet -> +(3 3 f # 0 0 0 1 1 1 2 4 8), left inlet -> (1 # 0.5) outputs (0.5 0.5 0.5) +(or whatever the interpolation would really be), left inlet (2 # 1.5 1.5) outputs (3) + +AMD64 diffs: long 4->8, void * 4->8 + +<ClaudiusMaximus> hmm, sending a [reassign( message to the right inlet of a [#store] segfaults Pd +<ClaudiusMaximus> hmmm, i get a segfault with a simple patch sending "reassign, put_at ( 0 0 ), reassign" to the right inlet of [#store ( 3 3 # 0 )] <alx1> matju: for the ./configure, I often get an error from aalib since common installs do not put the headers <alx1> matju: would it be possible to make it a user defined choice like --with-aalib and turn it off by default? <alx1> matju: not noticing that configure returns an error leads to an error when compiling @@ -48,6 +39,7 @@ AMD64 : <alx1> and returns a 'pd_activate' error after I move it <alx1> matju: once I delete it, unlike the other gui objects, it takes about one second before it dissapears, maybe a difference in tcl versions? +http://oprofile.sourceforge.net/about/ for 0.8.0: drag_rectangle.pd is fucked (x11 error) @@ -55,17 +47,7 @@ FObject#send_out2 : bself is NULL, rself=4097cbe8 [gf] ruby: ObjectSpace._id2ref(0x4097cbe8/2) [gf] returns: #<GridFlow::FormatX11 [FormatX11 out]> -test with waves.pd, 24 by 32. -==1673== 809108 bytes in 187 blocks are still reachable in loss record 64 of 64 -==1673== at 0x40026DAA: __builtin_vec_new (vg_replace_malloc.c:203) -==1673== by 0x40026E01: operator new[](unsigned) (vg_replace_malloc.c:216) -==1673== by 0x41FE269F: Grid::init(P<Dim>, NumberTypeE) (base/grid.h.fcs:910) -==1673== by 0x41FCBE27: Grid::init_from_ruby_list(int, unsigned long*, NumberTypeE) (base/grid.c.fcs:100) -==1673== by 0x41FCC679: Grid::init_from_ruby(unsigned long) (base/grid.c.fcs:117) -==1673== by 0x41FE223F: Grid::Grid(unsigned long) (base/grid.h.fcs:888) -==1673== by 0x42093152: convert(unsigned long, Grid**) (base/grid.h.fcs:921) -==1673== by 0x4208F72B: GridOuter::initialize_wrap(int, unsigned long*, unsigned long) (base/flow_objects.c.fcs:862) - +[ ] FIX LIBQUICKTIME CODE: #include <lqt/*> instead of <quicktime/*> [ ] try removing or modifying -falign on PPC/OSX [ ] c++ typecasting is nuts (see class Pt<T>) [ ] make c++ refcount and ruby gc to cooperate. @@ -96,8 +78,6 @@ test with waves.pd, 24 by 32. [ ] #: option swap [ ] consider including [mysql] [renamefile] [ls] [shell] [ ] re-enable int64,float64 -[ ] <alx_> #define RUBY_STACK_END "0xbfffd5c0" (!?!?!?) -[ ] remember who i am supposed to credit for making pd_help back in march 2003... alx knows [ ] added #matrix_solve, #slice [ ] Copy-on-Write (COW) [ ] < 10 bugs in buglist @@ -108,6 +88,7 @@ test with waves.pd, 24 by 32. [ ] unbork make test and plain ruby mode. [ ] add support for "anything" methods (def _0_(sel,*a)) [ ] look into -ftree-vectorize +[ ] should STACK_ARRAY remain at all? for 0.8.1: @@ -116,7 +97,7 @@ for 0.8.1: Bugs (High Priority) (!!! Fix all of these before 0.8.0 !!!) -pick a number: [147] +pick a number: [149] [147] [#store] blows up in nervous_video (reassign) [146] [#peephole] resize problem @@ -138,7 +119,6 @@ pick a number: [147] [133] numop ** can freeze GF [129] jmax2pd: [display] should not be translated [128] jmax2pd(?): loadbang-messages (comma) don't get translated to .pd ?? -[119] osx: SDL doesn't work here [118] error messages can be unclear (eg. file not open... is it #in's, or #out's?) [117] osx: [#store] crash instead of raising [112] Pt<T>: some casts aren't done properly @@ -177,7 +157,6 @@ Bugs (Low Priority) [046] write unit tests about error checking [047] make system to ensure everything is working before a release. [048] potential issues between fork() and X11 ? -[050] BitPacking has trouble with masks that extend beyond int25be [051] remove the crap given by -w of ruby [054] it's possible to crash by sending data in two inlets of a same object at once [059] mess with options in format grid diff --git a/externals/gridflow/base/bitpacking.c b/externals/gridflow/base/bitpacking.c index 143f6edb..cb09a812 100644 --- a/externals/gridflow/base/bitpacking.c +++ b/externals/gridflow/base/bitpacking.c @@ -1,5 +1,5 @@ /* - $Id: bitpacking.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: bitpacking.c,v 1.2 2006-03-15 04:37:06 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard @@ -26,18 +26,18 @@ #include <stdlib.h> #include <stdio.h> +//#define CONVERT0(z) (((in[z] << hb[z]) >> 7) & mask[z]) +#define CONVERT0(z) ((in[z] >> chop[z]) << slide[z]) + #define CONVERT1 t = \ - (((in[0] << hb[0]) >> 7) & mask[0]) | \ - (((in[1] << hb[1]) >> 7) & mask[1]) | \ - (((in[2] << hb[2]) >> 7) & mask[2]) + CONVERT0(0) | CONVERT0(1) | CONVERT0(2) #define CONVERT2 \ - for (t=0,i=0; i<self->size; i++) t |= (((in[i] << hb[i]) >> 7) & mask[i]); + for (t=0,i=0; i<self->size; i++) t |= CONVERT0(i); #define CONVERT3 \ - for (t=0,i=0; i<self->size; i++) { \ - t |= ((in[i]>>(7-hb[i]))|(in[i]<<(hb[i]-7))) & mask[i]; \ - } + for (t=0,i=0; i<self->size; i++) \ + t |= (((unsigned)in[i]>>(7-hb[i]))|(in[i]<<(hb[i]-7))) & mask[i]; #define WRITE_LE \ for (int bytes = self->bytes; bytes; bytes--, t>>=8) *out++ = t; @@ -74,29 +74,29 @@ template <class T> static void default_pack(BitPacking *self, int n, Pt<T> in, Pt<uint8> out) { uint32 t; int i; - int hb[4]; - uint32 mask[4]; int sameorder = self->endian==2 || self->endian==::is_le(); int size = self->size; - - for (i=0; i<self->size; i++) hb[i] = highest_bit(self->mask[i]); - memcpy(mask,self->mask,size*sizeof(uint32)); - + uint32 mask[4]; memcpy(mask,self->mask,size*sizeof(uint32)); + uint32 hb[4]; for (i=0; i<size; i++) hb[i] = highest_bit(mask[i]); + uint32 span[4]; for (i=0; i<size; i++) span[i] = hb[i] - lowest_bit(mask[i]); + uint32 chop[4]; for (i=0; i<size; i++) chop[i] = 7-span[i]; + uint32 slide[4]; for (i=0; i<size; i++) slide[i] = hb[i]-span[i]; + if (sameorder && size==3) { switch(self->bytes) { - case 2: NTIMES(t=CONVERT1; *((int16 *)out)=t; out+=2; in+=3;) return; - case 4: NTIMES(t=CONVERT1; *((int32 *)out)=t; out+=4; in+=3;) return; + case 2: NTIMES(CONVERT1; *((int16 *)out)=t; out+=2; in+=3;) return; + case 4: NTIMES(CONVERT1; *((int32 *)out)=t; out+=4; in+=3;) return; } } if (self->is_le()) { switch (size) { case 3: for (; n--; in+=3) {CONVERT1; WRITE_LE;} break; - case 4: for (; n--; in+=4) {CONVERT3; WRITE_LE;} break; + case 4: for (; n--; in+=4) {CONVERT1; WRITE_LE;} break; default:for (; n--; in+=size) {CONVERT2; WRITE_LE;}} } else { switch (size) { case 3: for (; n--; in+=3) {CONVERT1; WRITE_BE;} break; - case 4: for (; n--; in+=4) {CONVERT3; WRITE_BE;} break; + case 4: for (; n--; in+=4) {CONVERT1; WRITE_BE;} break; default:for (; n--; in+=size) {CONVERT2; WRITE_BE;}} } } @@ -132,8 +132,11 @@ template <class T> static void pack2_565(BitPacking *self, int n, Pt<T> in, Pt<uint8> out) { const int hb[3] = {15,10,4}; const uint32 mask[3] = {0x0000f800,0x000007e0,0x0000001f}; + uint32 span[3] = {4,5,4}; + uint32 chop[3] = {3,2,3}; + uint32 slide[3] = {11,5,0}; uint32 t; - NTIMES( t=CONVERT1; *((short *)out)=t; out+=2; in+=3; ) + NTIMES(CONVERT1; *((short *)out)=t; out+=2; in+=3;) } template <class T> @@ -187,7 +190,8 @@ static void pack3_888b(BitPacking *self, int n, Pt<T> in, Pt<uint8> out) { NTIMES( o32[0] = (in[0]<<16) | (in[1]<<8) | in[2]; o32++; in+=3; ) } -/* (R,G,B,?) -> B:8,G:8,R:8,0:8 */ +// (R,G,B,?) -> B:8,G:8,R:8,0:8 +// fishy template <class T> static void pack3_bgrn8888(BitPacking *self, int n, Pt<T> in, Pt<uint8> out) { /* NTIMES( out[2]=in[0]; out[1]=in[1]; out[0]=in[2]; out+=4; in+=4; ) */ diff --git a/externals/gridflow/base/flow_objects.c b/externals/gridflow/base/flow_objects.c index ac3305d6..f971553d 100644 --- a/externals/gridflow/base/flow_objects.c +++ b/externals/gridflow/base/flow_objects.c @@ -1,8 +1,8 @@ /* - $Id: flow_objects.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: flow_objects.c,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow - Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -158,6 +158,7 @@ static Ruby INTORFLOAT2NUM(T value) {return INT2NUM(value);} static Ruby INTORFLOAT2NUM(int64 value) {return gf_ll2num(value);} static Ruby INTORFLOAT2NUM(float32 value) {return rb_float_new(value);} static Ruby INTORFLOAT2NUM(float64 value) {return rb_float_new(value);} +static Ruby INTORFLOAT2NUM(ruby value) {return value.r;} GRID_INLET(GridExport,0) { } GRID_FLOW { @@ -213,9 +214,9 @@ struct GridStore : GridObject { PtrGrid r; // can't be \attr PtrGrid put_at; // can't be //\attr \attr Numop *op; - int32 wdex [Dim::MAX_DIMENSIONS]; // temporary buffer, copy of put_at - int32 fromb[Dim::MAX_DIMENSIONS]; - int32 to2 [Dim::MAX_DIMENSIONS]; + int32 wdex [Dim::MAX_DIM]; // temporary buffer, copy of put_at + int32 fromb[Dim::MAX_DIM]; + int32 to2 [Dim::MAX_DIM]; int lsd; // lsd = Last Same Dimension (for put_at) int d; // goes with wdex \decl void initialize (Grid *r=0); @@ -258,7 +259,7 @@ GRID_INLET(GridStore,0) { int na = in->dim->n; int nb = r->dim->n; int nc = in->dim->get(na-1); - STACK_ARRAY(int32,v,Dim::MAX_DIMENSIONS); + STACK_ARRAY(int32,v,Dim::MAX_DIM); if (na<1) RAISE("must have at least 1 dimension.",na,1,1+nb); int lastindexable = r->dim->prod()/r->dim->prod(nc) - 1; int ngreatest = nt_greatest((T *)0); @@ -413,6 +414,8 @@ GRID_INLET(GridOp,0) { SAME_TYPE(in,r); out=new GridOutlet(this,0,in->dim,in->nt); in->set_mode(6); +} GRID_ALLOC { + //out->ask(in->allocn,(Pt<T> &)in->alloc,in->allocfactor,in->allocmin,in->allocmax); } GRID_FLOW { Pt<T> rdata = (Pt<T>)*r; int loop = r->dim->prod(); @@ -787,7 +790,7 @@ void GridFor::trigger (T bogus) { if (!from->dim->equal(to->dim) || !to->dim->equal(step->dim)) RAISE("dimension mismatch"); #define FOO(T) trigger((T)0); - TYPESWITCH_NOFLOAT(from->nt,FOO,); + TYPESWITCH_JUSTINT(from->nt,FOO,); #undef FOO } @@ -1048,7 +1051,8 @@ GRID_INLET(GridTranspose,0) { } GRID_FLOW { STACK_ARRAY(T,res,na*nb*nc*nd); if (dim1==dim2) { out->send(n,data); return; } - for (; n; n-=na*nb*nc*nd, data+=na*nb*nc*nd) { + int prod = na*nb*nc*nd; + for (; n; n-=prod, data+=prod) { for (int a=0; a<na; a++) for (int b=0; b<nb; b++) for (int c=0; c<nc; c++) @@ -1107,14 +1111,14 @@ GRID_INLET(GridReverse,0) { \end class GridReverse //**************************************************************** -\class GridCentroid2 < GridObject -struct GridCentroid2 : GridObject { +\class GridCentroid < GridObject +struct GridCentroid : GridObject { \decl void initialize (); \grin 0 int int sumx,sumy,sum,y; // temporaries }; -GRID_INLET(GridCentroid2,0) { +GRID_INLET(GridCentroid,0) { if (in->dim->n != 3) RAISE("expecting 3 dims"); if (in->dim->v[2] != 1) RAISE("expecting 1 channel"); in->set_factor(in->dim->prod(1)); @@ -1137,14 +1141,16 @@ GRID_INLET(GridCentroid2,0) { blah[0] = sum ? sumy/sum : 0; blah[1] = sum ? sumx/sum : 0; out->send(2,blah); + rb_funcall(rself,SI(send_out),2,INT2NUM(1),INT2NUM(blah[0])); + rb_funcall(rself,SI(send_out),2,INT2NUM(2),INT2NUM(blah[1])); } GRID_END \def void initialize () { rb_call_super(argc,argv); } -\classinfo { IEVAL(rself,"install '#centroid2',1,1"); } -\end class GridCentroid2 +\classinfo { IEVAL(rself,"install '#centroid',1,3"); } +\end class GridCentroid //**************************************************************** \class GridPerspective < GridObject diff --git a/externals/gridflow/base/flow_objects.rb b/externals/gridflow/base/flow_objects.rb index 6ea06c56..8782ae21 100644 --- a/externals/gridflow/base/flow_objects.rb +++ b/externals/gridflow/base/flow_objects.rb @@ -1,8 +1,8 @@ =begin - $Id: flow_objects.rb,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: flow_objects.rb,v 1.2 2006-03-15 04:37:28 matju Exp $ GridFlow - Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -70,7 +70,7 @@ FObject.subclass("gridflow",1,1) { def _0_formats post "-"*32 GridFlow.fclasses.each {|k,v| - next if not /#in:/ =~ k + next if not /#io:/ =~ k modes = case v.flags when 2; "#out" when 4; "#in" @@ -265,7 +265,7 @@ GridPack = GridObject.subclass("#pack",1,1) { install_rgrid 0 class<<self;attr_reader :ninlets;end - def initialize(n=nil,cast=:int32) + def initialize(n=2,cast=:int32) n||=self.class.ninlets n>=16 and raise "too many inlets" super @@ -298,13 +298,13 @@ GridObject.subclass("#pack",1,1) { # the install_rgrids in the following are hacks so that # outlets can work. (install_rgrid is supposed to be for receiving) # maybe GF-0.8 doesn't need that. -GridPack.subclass("@two", 2,1) { install_rgrid 0 } -GridPack.subclass("@three",3,1) { install_rgrid 0 } -GridPack.subclass("@four", 4,1) { install_rgrid 0 } -GridPack.subclass("@eight",8,1) { install_rgrid 0 } +GridPack.subclass("@two", 2,1) { install_rgrid 0; def initialize() super 2 end } +GridPack.subclass("@three",3,1) { install_rgrid 0; def initialize() super 2 end } +GridPack.subclass("@four", 4,1) { install_rgrid 0; def initialize() super 2 end } +GridPack.subclass("@eight",8,1) { install_rgrid 0; def initialize() super 2 end } GridObject.subclass("#unpack",1,0) { install_rgrid 0, true - def initialize(n) + def initialize(n=2) @n=n n>=10 and raise "too many outlets" super @@ -338,8 +338,9 @@ GridObject.subclass("unix_time",1,3) { tt = t.to_s send_out_grid_begin 0, [tt.length], :uint8 send_out_grid_flow 0, tt, :uint8 - send_out 1, t.to_i - send_out 2, t.to_f-t.to_f.floor + send_out 1, t.to_i/86400, t.to_i%86400, + ((t.to_f-t.to_f.floor)*1000000).to_i + send_out 2, t.year, t.month, t.day, t.hour, t.min, t.day end } ### test with "shell xlogo &" -> [exec] @@ -352,6 +353,7 @@ FObject.subclass("renamefile",1,0) { } FObject.subclass("ls",1,1) { def _0_symbol(s) send_out 0, :list, *Dir.new(s.to_s).map {|x| x.intern } end + def _0_glob (s) send_out 0, :list, *Dir[ s.to_s].map {|x| x.intern } end } #-------- fClasses for: math @@ -420,36 +422,32 @@ FPatcher.subclass("@scale_to",2,1) { } #<vektor> told me to: -# RGBtoYUV : @fobjects = ["#inner ( 3 3 # 66 -38 112 128 -74 -94 25 112 -18 )", +# RGBtoYUV : @fobjects = ["#inner (3 3 # 66 -38 112 128 -74 -94 25 112 -18)", # "@ >> 8","@ + {16 128 128}"] -# YUVtoRGB : @fobjects = ["@ - ( 16 128 128 )", -# "#inner ( 3 3 # 298 298 298 0 -100 516 409 -208 0 )","@ >> 8"] +# YUVtoRGB : @fobjects = ["@ - (16 128 128)", +# "#inner (3 3 # 298 298 298 0 -100 516 409 -208 0)","@ >> 8"] FPatcher.subclass("#rotate",2,1) { - @fobjects = ["@inner * + 0","@ >> 8"] + @fobjects = ["#inner","# >> 8"] @wires = [-1,0,0,0, 0,0,1,0, 1,0,-1,0] def update_rotator - rotator = (0...@axis[2]).map {|i| - (0...@axis[2]).map {|j| - if i==j then 256 else 0 end - } - } + n = @axis[2] + rotator = (0...n).map {|i| (0...n).map {|j| if i==j then 256 else 0 end }} th = @angle * Math::PI / 18000 scale = 1<<8 - (0...2).each {|i| - (0...2).each {|j| - rotator[@axis[i]][@axis[j]] = - (scale*Math.cos(th+(j-i)*Math::PI/2)).to_i - } - } - @fobjects[0].send_in 2, - @axis[2], @axis[2], "#".intern, *rotator.flatten + (0...2).each {|i| (0...2).each {|j| + a = @axis[i].to_i + b = @axis[j].to_i + #GridFlow.post "(#{a},#{b}) #{rotator[a].inspect}" + rotator[a][b] = (scale*Math.cos(th+(j-i)*Math::PI/2)).to_i + }} + @fobjects[0].send_in 1,n,n,"#".intern,*rotator.flatten end def _0_axis(from,to,total) total>=0 or raise "total-axis number incorrect" from>=0 and from<total or raise "from-axis number incorrect" to >=0 and to <total or raise "to-axis number incorrect" - @axis = [from,to,total] + @axis = [from.to_i,to.to_i,total.to_i] update_rotator end def initialize(rot=0,axis=[0,1,2]) @@ -644,7 +642,7 @@ class PDNetSocket < FObject @socket.bind nil, port end when :tcp - if host=="-" then + if host=="-" then @server = TCPServer.new("localhost",port) else @socket = TCPSocket.new(host,port) @@ -722,7 +720,7 @@ PDNetSocket.subclass("pd_netreceive",0,2) { # bogus class for representing objects that have no recognized class. FObject.subclass("broken",0,0) { - def args; a=@args.dup; a[7,0] = " "+classname; a end + def args; a=@args.dup; a[7,0] = " "+classname; a end } FObject.subclass("fork",1,2) { @@ -892,6 +890,21 @@ FObject.subclass("range",1,1) { post "setting a[#{m[1].to_i-1}] = #{a[0]}" end } +FObject.subclass("listfind",2,1) { + def initialize(*a) _1_list(*a) end + def _1_list(*a) @a = a end + def _0_float(x) + i=0 + while i<@a.length + (send_out 0,i; return) if @a[i]==x + i+=1 + end + send_out 0,-1 + end + doc:_1_list,"list to search into" + doc:_0_float,"float to find in that list" + doc_out:_0_float,"position of the incoming float in the stored list" +} #-------- fClasses for: GUI @@ -1257,92 +1270,6 @@ end #-------- fClasses for: Hardware -if const_defined? :USB - -class<<USB - attr_reader :busses -end - -class DelcomUSB < GridFlow::FObject - Vendor,Product=0x0FC5,0x1222 - def self.find - r=[] - USB.busses.each {|dir,bus| - bus.each {|dev| - r<<dev if dev.idVendor==Vendor and dev.idProduct==Product - } - } - r - end - def initialize #(bus=nil,dev=nil) - r=DelcomUSB.find - raise "no such device" if r.length<1 - raise "#{r.length} such devices (which one???)" if r.length>1 - @usb=USB.new(r[0]) - if_num=nil - r[0].config.each {|config| - config.interface.each {|interface| - if_num = interface.bInterfaceNumber - } - } - # post "Interface # %i\n", if_num - @usb.set_configuration 1 - @usb.claim_interface if_num - @usb.set_altinterface 0 rescue ArgumentError - end - # libdelcom had this: - # uint8 recipient, deviceModel, major, minor, dataL, dataM; - # uint16 length; uint8[8] extension; - def _0_send_command(major,minor,dataL,dataM,extension="\0\0\0\0\0\0\0\0") - raise "closed" if not @usb - raise "extension.length!=8" if extension.length!=8 - @usb.control_msg( - 0x000000c8, 0x00000012, - minor*0x100+major, - dataM*0x100+dataL, - extension, 5000) - end - def delete; @usb.close; end - install "delcomusb", 1, 1 -end - -# Klippeltronics -FObject.subclass("multio",1,1) { - Vendor,Product=0xDEAD,0xBEEF - def self.find - r=[] - USB.busses.each {|dir,bus| - bus.each {|dev| - post "dir=%s, vendor=%x, product=%x", - dir, dev.idVendor, dev.idProduct - r<<dev if dev.idVendor==Vendor and dev.idProduct==Product - } - } - r - end - def initialize - r=self.class.find - raise "no such device" if r.length<1 - raise "#{r.length} such devices (which one???)" if r.length>1 - $iobox=@usb=USB.new(r[0]) - if_num=nil - r[0].config.each {|config| - config.interface.each {|interface| - #post "interface=%s", interface.to_s - if_num = interface.bInterfaceNumber - } - } - # post "Interface # %i\n", if_num - # @usb.set_configuration 0 - @usb.claim_interface if_num - @usb.set_altinterface 0 rescue ArgumentError - end - #@usb.control_msg(0b10100001,0x01,0,0,"",1000) - #@usb.control_msg(0b10100001,0x01,0,1," ",0) - def delete; @usb.close; end -} -end # if const_defined? :USB - # requires Ruby 1.8.0 because of bug in Ruby 1.6.x FObject.subclass("joystick_port",0,1) { def initialize(port) @@ -1388,6 +1315,21 @@ FObject.subclass("plotter_control",1,1) { end } +# ASCII, useful for controlling pics +FObject.subclass("ascii",1,1) { + def puts(x) + x.each_byte {|b| send_out 0, b } + end + def _0_float x; puts "#{x.to_i}" end +} + +# System, similar to shell +FObject.subclass("system",1,1) { + def _0_system(*a) + system(a.join(" ")) + end +} + (begin require "linux/ParallelPort"; true; rescue LoadError; false end) and FObject.subclass("parallel_port",1,3) { def initialize(port,manually=0) @@ -1419,7 +1361,8 @@ FObject.subclass("parallel_port",1,3) { } (begin require "linux/SoundMixer"; true; rescue LoadError; false end) and -FObject.subclass("SoundMixer",1,1) { +#FObject.subclass("SoundMixer",1,1) { +class GFSoundMixer < FObject; install "SoundMixer",1,1 # BUG? i may have the channels (left,right) backwards def initialize(filename) super @@ -1449,7 +1392,7 @@ FObject.subclass("SoundMixer",1,1) { @@vars.each {|var| _0_get var } end end -} +end#} # experimental FObject.subclass("rubyarray",2,1) { @@ -1473,4 +1416,42 @@ FObject.subclass("rubyarray",2,1) { end } +FObject.subclass("regsub",3,1) { + def initialize(from,to) _1_symbol(from); _2_symbol(to) end + def _0_symbol(s) send_out 0, :symbol, s.to_s.gsub(@from, @to).intern end + def _1_symbol(from) @from = Regexp.new(from.to_s.gsub(/`/,"\\")) end + def _2_symbol(to) @to = to.to_s.gsub(/`/,"\\") end + doc:_0_symbol,"a string to transform" + doc:_1_symbol,"a regexp pattern to be found inside of the string" + doc:_2_symbol,"a replacement for the found pattern" + doc_out:_0_symbol,"the transformed string" +} + +FObject.subclass("memstat",1,1) { + def _0_bang + f = File.open("/proc/#{$$}/stat") + send_out 0, Float(f.gets.split(" ")[22]) / 1024.0 + f.close + end + doc:_0_bang,"lookup process stats for the currently running pd+ruby "+ + "and figure out how much RAM it uses." + doc_out:_0_float,"virtual size of RAM in kilobytes (includes swapped out and shared memory)" +} + +FObject.subclass("sendgui",1,0) { + def _0_list(*x) + GridFlow.gui x.join(" ").gsub(/`/,";")+"\n" + end + install "sys_vgui", 1, 0 + doc:_0_list,"a Tcl/Tk command to send to the pd client." +} + end # module GridFlow + +begin + require "gridflow/rblti" + GridFlow.post "Ruby-LTI support loaded." +rescue Exception => e + #GridFlow.post "%s", e.inspect + #GridFlow.post "(rblti not found)" +end diff --git a/externals/gridflow/base/flow_objects_for_image.c b/externals/gridflow/base/flow_objects_for_image.c index 2041c3e1..f6d6398d 100644 --- a/externals/gridflow/base/flow_objects_for_image.c +++ b/externals/gridflow/base/flow_objects_for_image.c @@ -1,8 +1,8 @@ /* - $Id: flow_objects_for_image.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: flow_objects_for_image.c,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow - Copyright (c) 2001,2002,2003 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -207,7 +207,7 @@ GRID_INLET(GridScaleBy,0) { int p=0; #define LOOP(z) \ for (int i=0; i<rowsize; i+=z) \ - for (int k=0; k<scalex; k++, p+=3) + for (int k=0; k<scalex; k++, p+=z) switch (chans) { case 3: LOOP(3) {Z(0);Z(1);Z(2);} break; case 4: LOOP(4) {Z(0);Z(1);Z(2);Z(3);} break; @@ -477,6 +477,7 @@ GRID_INLET(DrawPolygon,0) { } } GRID_END + GRID_INPUT(DrawPolygon,1,color) {} GRID_END GRID_INPUT(DrawPolygon,2,polygon) {init_lines();} GRID_END diff --git a/externals/gridflow/base/flow_objects_for_matrix.c b/externals/gridflow/base/flow_objects_for_matrix.c index d245a10f..b88accba 100644 --- a/externals/gridflow/base/flow_objects_for_matrix.c +++ b/externals/gridflow/base/flow_objects_for_matrix.c @@ -1,5 +1,5 @@ /* - $Id: flow_objects_for_matrix.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: flow_objects_for_matrix.c,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard diff --git a/externals/gridflow/base/grid.c b/externals/gridflow/base/grid.c index 877a460f..c3ec5932 100644 --- a/externals/gridflow/base/grid.c +++ b/externals/gridflow/base/grid.c @@ -1,5 +1,5 @@ /* - $Id: grid.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: grid.c,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard @@ -32,10 +32,24 @@ #include <ctype.h> /* copied from bridge/puredata.c (sorry: linkage issue) */ -struct Pointer : CObject { void *p; Pointer(void *_p) : p(_p) {}}; -Ruby Pointer_s_noo (void *ptr) { - return Data_Wrap_Struct(EVAL("GridFlow::Pointer"), 0, 0, new Pointer(ptr));} -static void *Pointer_gut (Ruby rself) {DGS(Pointer); return self->p;} +struct Pointer : CObject { + void *p; + Pointer(void *_p) : p(_p) {} +}; + +#define Pointer_s_new Pointer_s_new_2 +#define Pointer_get Pointer_get_2 + +static Ruby Pointer_s_new (void *ptr) { + Pointer *self = new Pointer(ptr); + Ruby rself = Data_Wrap_Struct(EVAL("GridFlow::Pointer"), 0, CObject_free, self); + self->rself = rself; + return rself; +} +static void *Pointer_get (Ruby rself) { + DGS(Pointer); + return self->p; +} //#define TRACE fprintf(stderr,"%s %s [%s:%d]\n",INFO(parent),__PRETTY_FUNCTION__,__FILE__,__LINE__);assert(this); #define TRACE assert(this); @@ -43,8 +57,7 @@ static void *Pointer_gut (Ruby rself) {DGS(Pointer); return self->p;} #define CHECK_TYPE(d) \ if (NumberTypeE_type_of(d)!=this->nt) RAISE("%s(%s): " \ "type mismatch during transmission (got %s expecting %s)", \ - INFO(parent), \ - __PRETTY_FUNCTION__, \ + INFO(parent), __PRETTY_FUNCTION__, \ number_type_table[NumberTypeE_type_of(d)].name, \ number_type_table[this->nt].name); @@ -77,6 +90,8 @@ static inline void NUM(Ruby x, S &y) { \ EACH_FLOAT_TYPE(FOO) #undef FOO +static inline void NUM(Ruby x, ruby &y) { y.r=x; } + void Grid::init_from_ruby_list(int n, Ruby *a, NumberTypeE nt) { Ruby delim = SYM(#); for (int i=0; i<n; i++) { @@ -162,15 +177,12 @@ bool GridInlet::supports_type(NumberTypeE nt) { Ruby GridInlet::begin(int argc, Ruby *argv) {TRACE; if (!argc) return PTR2FIX(this); - GridOutlet *back_out = (GridOutlet *) Pointer_gut(argv[0]); + GridOutlet *back_out = (GridOutlet *) Pointer_get(argv[0]); nt = (NumberTypeE) INT(argv[1]); argc-=2, argv+=2; PROF(parent) { - if (dim) { - gfpost("%s: grid inlet conflict; aborting %s in favour of %s", + if (dim) RAISE("%s: grid inlet conflict; aborting %s in favour of %s", INFO(parent), INFO(sender), INFO(back_out->parent)); - abort(); - } sender = back_out->parent; if ((int)nt<0 || (int)nt>=(int)number_type_table_end) RAISE("%s: inlet: unknown number type",INFO(parent)); @@ -328,7 +340,7 @@ void GridOutlet::begin(int woutlet, P<Dim> dim, NumberTypeE nt) {TRACE; Ruby a[n+4]; a[0] = INT2NUM(woutlet); a[1] = bsym._grid; - a[2] = Pointer_s_noo(this); + a[2] = Pointer_s_new(this); a[3] = INT2NUM(nt); for(int i=0; i<n; i++) a[4+i] = INT2NUM(dim->get(i)); parent->send_out(COUNT(a),a); diff --git a/externals/gridflow/base/grid.h b/externals/gridflow/base/grid.h index 4aaf2aa3..9e971b99 100644 --- a/externals/gridflow/base/grid.h +++ b/externals/gridflow/base/grid.h @@ -1,8 +1,8 @@ /* - $Id: grid.h,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: grid.h,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow - Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,7 +25,7 @@ #define __GF_GRID_H // current version number as string literal -#define GF_VERSION "0.8.0" +#define GF_VERSION "0.8.1" #define GF_COMPILE_TIME __DATE__ ", " __TIME__ #include <new> @@ -36,6 +36,12 @@ #include <stdio.h> #include <math.h> +#ifdef __APPLE__ +static inline void *memalign (size_t a, size_t n) {return malloc(n);} +#else +#include <malloc.h> +#endif + extern "C" { #include <ruby.h> #include <rubyio.h> @@ -58,11 +64,7 @@ extern "C" { #endif #define BUG(s,args...) {fprintf(stderr,s "\nat: %s\n",args,__PRETTY_FUNCTION__); ::raise(11);} - -// !@#$ what am I going to do about this? should this be changed? -// should I wrap all of the Ruby API for C++-style convenience? -typedef VALUE Ruby; -// typedef struct Ruby { VALUE x }; +#define L gfpost("%s:%d in %s",__FILE__,__LINE__,__PRETTY_FUNCTION__); #ifdef IS_BRIDGE #define RAISE(args...) rb_raise(rb_eArgError,args) @@ -76,6 +78,8 @@ typedef VALUE Ruby; if (RUBY_RELEASE_CODE < 20030716) rb_enable_super(a,b) #endif +typedef VALUE Ruby; + /* undocumented function from Ruby that is one thing we need to fix a very elusive bug that manifests itself when embedding ruby inside a plugin of another app. This exists for all versions of Ruby up to now, and I don't know when it gets fixed. */ @@ -86,7 +90,6 @@ void rb_raise0( const char *file, int line, const char *func, VALUE exc, const char *fmt, ...) __attribute__ ((noreturn)); }; -#define L fprintf(stderr,"%s:%d in %s\n",__FILE__,__LINE__,__PRETTY_FUNCTION__); #define SI(_sym_) (rb_intern(#_sym_)) #define SYM(_sym_) (ID2SYM(SI(_sym_))) #define DGS(_class_) \ @@ -104,21 +107,16 @@ static inline long rb_ary_len(Ruby s) {return RARRAY(s)->len;} static inline Ruby *rb_ary_ptr(Ruby s) {return RARRAY(s)->ptr;} static inline const char *rb_sym_name(Ruby sym) {return rb_id2name(SYM2ID(sym));} #define rb_str_pt(s,t) Pt<t>((t*)rb_str_ptr(s),rb_str_len(s)) - -// shorthands #define IEVAL(_self_,s) rb_funcall(_self_,SI(instance_eval),1,rb_str_new2(s)) #define EVAL(s) rb_eval_string(s) #define rassert(_p_) if (!(_p_)) RAISE(#_p_); - // because of older versions of Ruby (1.6.?) #define rb_obj_class(o) rb_funcall((o),SI(class),0) #define WATCH(n,ar) { \ - char foo[16*1024], *p=foo; \ - p += sprintf(p,"%s: ",#ar); \ + char foo[16*1024], *p=foo; p += sprintf(p,"%s: ",#ar); \ for (int q=0; q<n; q++) p += sprintf(p,"%lld ",(long long)ar[q]); \ - gfpost("%s",foo); \ -} + gfpost("%s",foo);} // we're gonna override assert, so load it first, to avoid conflicts #include <assert.h> @@ -148,7 +146,7 @@ static inline const char *rb_sym_name(Ruby sym) {return rb_id2name(SYM2ID(sym)); static inline Ruby PTR2FIX (const void *ptr) { long p = (long)ptr; - if ((p&3)!=0) BUG("unaligned pointer: %08x\n",(long)(ptr)); + if ((p&3)!=0) BUG("unaligned pointer: %p\n",ptr); return LONG2NUM(p>>2); } #define FIX2PTR(type,ruby) ((type *)(TO(long,ruby)<<2)) @@ -184,7 +182,7 @@ static inline float64 gf_abs(float64 a) { return fabs(a); } // integer powers in log(b) time. T is assumed Integer template <class T> static inline T ipow(T a, T b) { for(T r=1;;) {if (b&1) r*=a; b>>=1; if (!b) return r; a*=a;} -} +} // kludge static inline float32 ipow(float32 a, float32 b) { return pow(a,b); } @@ -196,7 +194,6 @@ static inline float64 ipow(float64 a, float64 b) { return pow(a,b); } template <class T> static inline T min(T a, T b) { return a<b?a:b; } template <class T> static inline T max(T a, T b) { return a>b?a:b; } //template <class T> inline T min(T a, T b) { T c = (a-b)>>31; return (a&c)|(b&~c); } -//template <class T> inline T max(T a, T b) { T c = (a-b)>>31; return (a&c)|(b&~c); } // greatest common divisor, by euclid's algorithm // this runs in log(a+b) number operations @@ -221,12 +218,12 @@ template <class T> static T gcd2 (T a, T b) { template <class T> static inline T lcm (T a, T b) {return a*b/gcd(a,b);} // returns the position (0..31) of highest bit set in a word, or 0 if none. -#define FOO(N) if ((x>>N)&(((typeof(x))1<<N)-1)) { x>>=N; i+=N; } -static int highest_bit(uint8 x) {int i=0; FOO(4)FOO(2)FOO(1)return i;} -static int highest_bit(uint16 x) {int i=0; FOO(8)FOO(4)FOO(2)FOO(1)return i;} -static int highest_bit(uint32 x) {int i=0; FOO(16)FOO(8)FOO(4)FOO(2)FOO(1)return i;} -static int highest_bit(uint64 x) {int i=0;FOO(32)FOO(16)FOO(8)FOO(4)FOO(2)FOO(1)return i;} -#undef FOO +#define Z(N) if ((x>>N)&(((typeof(x))1<<N)-1)) { x>>=N; i+=N; } +static int highest_bit(uint8 x) {int i=0; Z(4)Z(2)Z(1)return i;} +static int highest_bit(uint16 x) {int i=0; Z(8)Z(4)Z(2)Z(1)return i;} +static int highest_bit(uint32 x) {int i=0; Z(16)Z(8)Z(4)Z(2)Z(1)return i;} +static int highest_bit(uint64 x) {int i=0;Z(32)Z(16)Z(8)Z(4)Z(2)Z(1)return i;} +#undef Z // returns the position (0..31) of lowest bit set in a word, or 0 if none. template <class T> static int lowest_bit(T n) { return highest_bit((~n+1)&n); } @@ -262,7 +259,7 @@ static inline uint64 rdtsc() {return 0;} #define EACH_INT_TYPE(MACRO) MACRO(uint8) MACRO(int16) MACRO(int32) MACRO(int64) #define EACH_FLOAT_TYPE(MACRO) MACRO(float32) MACRO(float64) #endif -#define EACH_NUMBER_TYPE(MACRO) EACH_INT_TYPE(MACRO) EACH_FLOAT_TYPE(MACRO) +#define EACH_NUMBER_TYPE(MACRO) EACH_INT_TYPE(MACRO) EACH_FLOAT_TYPE(MACRO) MACRO(ruby) // note: loop unrolling macros assume N!=0 // btw this may cause alignment problems when 8 does not divide N @@ -279,6 +276,132 @@ static inline uint64 rdtsc() {return 0;} PTR+=4; N-=4; ARGS; if (N) goto start; } //**************************************************************** +// my own little Ruby <-> C++ layer + +//struct Arg { Ruby a; }; +//struct ArgList { int n; Pt<Arg> v; }; +static inline bool INTEGER_P(Ruby x) {return FIXNUM_P(x)||TYPE(x)==T_BIGNUM;} +static inline bool FLOAT_P(Ruby x) {return TYPE(x)==T_FLOAT;} +#define INT(x) TO(int32,x) +#define TO(t,x) convert(x,(t*)0) + +// not using NUM2INT because Ruby can convert Symbol to int +// (by compatibility with Ruby 1.4) +static inline int32 convert(Ruby x, int32 *foo) { + if (INTEGER_P(x)) return NUM2INT(x); + if (FLOAT_P(x)) return NUM2INT(rb_funcall(x,SI(round),0)); + RAISE("expected Integer or Float (got %s)", + rb_str_ptr(rb_funcall(x,SI(inspect),0))); +} +static int16 convert(Ruby x, int16 *foo) { + int v = INT(x); + if (v<-0x8000 || v>=0x8000) RAISE("value %d is out of range",v); + return v;} +static uint16 convert(Ruby x, uint16 *foo) { + int v = INT(x); + if (v<0 || v>=0x10000) RAISE("value %d is out of range",v); + return v;} +static bool convert(Ruby x, bool *foo) { + if (x==Qtrue) return true; + if (x==Qfalse) return false; + switch (TYPE(x)) { + case T_FIXNUM: case T_BIGNUM: case T_FLOAT: return !!INT(x); + default: RAISE("can't convert to bool"); + } +} + +#ifdef HAVE_GCC64 +static uint64 convert(Ruby val, uint64 *foo) { return NUM2ULONG(val); } +static int64 convert(Ruby val, int64 *foo) { return NUM2ULONG(val); } +static Ruby gf_ull2num(uint64 val) { return ULONG2NUM(val); } +static Ruby gf_ll2num(uint64 val) { return LONG2NUM(val); } +#else +static uint64 convert(Ruby val, uint64 *foo) { + if (FIXNUM_P(val)) return (uint64)FIX2LONG(val); + if (TYPE(val)!=T_BIGNUM) RAISE("type error"); + uint64 v = (uint64)NUM2UINT(rb_funcall(val,SI(>>),1,INT2FIX(32))) << 32; + return v + NUM2UINT(rb_funcall(val,SI(&),1,UINT2NUM(0xffffffff)));} +static int64 convert(Ruby val, int64 *foo) { + if (FIXNUM_P(val)) return (int64)FIX2LONG(val); + if (TYPE(val)!=T_BIGNUM) RAISE("type error"); + int64 v = (int64)NUM2INT(rb_funcall(val,SI(>>),1,INT2FIX(32))) << 32; + return v + NUM2UINT(rb_funcall(val,SI(&),1,UINT2NUM(0xffffffff)));} +static Ruby gf_ull2num(uint64 val) { + Ruby x = rb_funcall(UINT2NUM((uint32)(val>>32)),SI(<<),1,INT2FIX(32)); + return rb_funcall(x,SI(+),1,UINT2NUM((uint32)val));} +static Ruby gf_ll2num(int64 val) { + Ruby x = rb_funcall( INT2NUM(( int32)(val>>32)),SI(<<),1,INT2FIX(32)); + return rb_funcall(x,SI(+),1,UINT2NUM((uint32)val));} +#endif + +static long convert(Ruby x, long *foo) { + return sizeof(long)==sizeof(int32) ? + convert(x,(int32 *)0) : + convert(x,(int64 *)0); +} + +static float64 convert(Ruby x, float64 *foo) { + if (INTEGER_P(x)) return INT(x); + if (TYPE(x)!=T_FLOAT) RAISE("not a Float"); + return ((RFloat*)x)->value;} +static float32 convert(Ruby x, float32 *foo) { + return (float32) convert(x,(float64 *)0);} +typedef Ruby Symbol, Array, String, Integer; +static Ruby convert(Ruby x, Ruby *bogus) { return x; } +typedef Ruby (*RMethod)(...); /* !@#$ fishy */ + +#define BUILTIN_SYMBOLS(MACRO) \ + MACRO(_grid,"grid") MACRO(_bang,"bang") MACRO(_float,"float") \ + MACRO(_list,"list") MACRO(_sharp,"#") \ + MACRO(iv_outlets,"@outlets") \ + MACRO(iv_ninlets,"@ninlets") \ + MACRO(iv_noutlets,"@noutlets") +extern struct BuiltinSymbols { +#define FOO(_sym_,_str_) Ruby _sym_; +BUILTIN_SYMBOLS(FOO) +#undef FOO +} bsym; + +typedef struct R { + VALUE r; + R() {r=Qnil;} + R(int x) {r=INT2NUM(x);} + R(unsigned x) {r=UINT2NUM(x);} + R(long x) {r=LONG2NUM(x);} + R(unsigned long x) {r=ULONG2NUM(x);} + R(double x) {r=rb_float_new(x);} + R( int64 x) {r= gf_ll2num(x);} + R(uint64 x) {r=gf_ull2num(x);} + operator bool() {return !!INT2NUM(r);} + operator uint8 () {return INT2NUM(r);} + operator int16 () {return INT2NUM(r);} + operator int32 () {return INT2NUM(r);} + operator int64 () {return convert(r,(int64*)0);} + operator float32 () {return convert(r,(float32*)0);} + operator float64 () {return convert(r,(float64*)0);} +#define FOO(As,Op) \ + R &operator As (int x) {r=rb_funcall(r, SI(Op),1,INT2NUM(x)); return *this;} + FOO(+=,+) FOO(-=,-) FOO(*=,*) FOO(/=,/) FOO(%=,%) + FOO(&=,&) FOO(|=,|) FOO(^=,^) FOO(<<=,<<) FOO(>>=,>>) +#undef FOO +// bool operator == (int x) {return rb_funcall(r,SI(==),1,INT2NUM(x));} +#define FOO(Op) \ + R operator Op (R x) {return rb_funcall(r,SI(Op),1,x.r);} \ + R operator Op (int x) {return rb_funcall(r,SI(Op),1,INT2NUM(x));} + FOO(+) FOO(-) FOO(*) FOO(/) FOO(%) + FOO(&) FOO(|) FOO(^) FOO(<<) FOO(>>) + FOO(<) FOO(>) FOO(<=) FOO(>=) FOO(==) FOO(!=) +#undef FOO + static R value(VALUE r) {R x; x.r=r; return x;} +} ruby; + +static R operator -(int a, R b) {return rb_funcall(a,SI(Op),1,INT2NUM(b.r));} + +static inline R ipow(R a, R b) {return R::value(rb_funcall(a.r,SI(**),1,b.r));} +static inline R gf_abs(R a) { return R::value(rb_funcall(a.r,SI(abs),0)); } +static inline R cmp(R a, R b) { return R::value(rb_funcall(a.r,SI(<=>),1,b.r));} + +//**************************************************************** // hook into pointer manipulation. will help find memory corruption bugs. template <class T> class Pt { @@ -377,10 +500,11 @@ public: #ifndef IS_BRIDGE extern "C" void *gfmalloc(size_t n); extern "C" void gffree(void *p); -inline void *::operator new (size_t n) { return gfmalloc(n); } -inline void *::operator new[] (size_t n) { return gfmalloc(n); } -inline void ::operator delete (void *p) { gffree(p); } -inline void ::operator delete[] (void *p) { gffree(p); } +// note that C++ (GCC 3.4) now refuses the :: prefix so i removed it in the 4 following lines: +inline void *operator new (size_t n) { return gfmalloc(n); } +inline void *operator new[] (size_t n) { return gfmalloc(n); } +inline void operator delete (void *p) { gffree(p); } +inline void operator delete[] (void *p) { gffree(p); } #endif #define STACK_ARRAY(T,V,N) T V##_foo[N]; Pt<T> V(V##_foo,N); @@ -400,88 +524,6 @@ template <class T> static void memswap (Pt<T> a, Pt<T> b, int n) { } //**************************************************************** -// my own little Ruby <-> C++ layer - -struct Arg { Ruby a; }; -struct ArgList { int n; Pt<Arg> v; }; -static inline bool INTEGER_P(Ruby x) {return FIXNUM_P(x)||TYPE(x)==T_BIGNUM;} -static inline bool FLOAT_P(Ruby x) {return TYPE(x)==T_FLOAT;} -#define INT(x) TO(int32,x) -#define TO(t,x) convert(x,(t*)0) - -// not using NUM2INT because Ruby can convert Symbol to int -// (by compatibility with Ruby 1.4) -static inline int32 convert(Ruby x, int32 *foo) { - if (INTEGER_P(x)) return NUM2INT(x); - if (FLOAT_P(x)) return NUM2INT(rb_funcall(x,SI(round),0)); - RAISE("expected Integer or Float (got %s)", - rb_str_ptr(rb_funcall(x,SI(inspect),0))); -} -static int16 convert(Ruby x, int16 *foo) { - int v = INT(x); - if (v<-0x8000 || v>=0x8000) RAISE("value %d is out of range",v); - return v;} -static uint16 convert(Ruby x, uint16 *foo) { - int v = INT(x); - if (v<0 || v>=0x10000) RAISE("value %d is out of range",v); - return v;} -static bool convert(Ruby x, bool *foo) { - if (x==Qtrue) return true; - if (x==Qfalse) return false; - switch (TYPE(x)) { - case T_FIXNUM: case T_BIGNUM: case T_FLOAT: return !!INT(x); - default: RAISE("can't convert to bool"); - } -} - -static uint64 convert(Ruby val, uint64 *foo) { - if (FIXNUM_P(val)) return (uint64)FIX2LONG(val); - if (TYPE(val)!=T_BIGNUM) RAISE("type error"); - uint64 v = (uint64)NUM2UINT(rb_funcall(val,SI(>>),1,INT2FIX(32))) << 32; - return v + NUM2UINT(rb_funcall(val,SI(&),1,UINT2NUM(0xffffffff)));} -static int64 convert(Ruby val, int64 *foo) { - if (FIXNUM_P(val)) return (int64)FIX2LONG(val); - if (TYPE(val)!=T_BIGNUM) RAISE("type error"); - int64 v = (int64)NUM2INT(rb_funcall(val,SI(>>),1,INT2FIX(32))) << 32; - return v + NUM2UINT(rb_funcall(val,SI(&),1,UINT2NUM(0xffffffff)));} - -static Ruby gf_ull2num(uint64 val) { - return rb_funcall( - rb_funcall(UINT2NUM((uint32)(val>>32)),SI(<<),1,INT2FIX(32)), - SI(+),1,UINT2NUM((uint32)val));} -static Ruby gf_ll2num(int64 val) { - return rb_funcall( - rb_funcall(INT2NUM((int32)(val>>32)),SI(<<),1,INT2FIX(32)), - SI(+),1,UINT2NUM((uint32)val));} - -static long convert(Ruby x, long *foo) { - return sizeof(long)==sizeof(int32) ? - convert(x,(int32 *)0) : - convert(x,(int64 *)0); -} -static float64 convert(Ruby x, float64 *foo) { - if (INTEGER_P(x)) return INT(x); - if (TYPE(x)!=T_FLOAT) RAISE("not a Float"); - return ((RFloat*)x)->value;} -static float32 convert(Ruby x, float32 *foo) { - return (float32) convert(x,(float64 *)0);} -typedef Ruby Symbol, Array, String, Integer; -static Ruby convert(Ruby x, Ruby *bogus) { return x; } -typedef Ruby (*RMethod)(...); /* !@#$ fishy */ - -#define BUILTIN_SYMBOLS(MACRO) \ - MACRO(_grid,"grid") MACRO(_bang,"bang") MACRO(_float,"float") \ - MACRO(_list,"list") MACRO(_sharp,"#") \ - MACRO(iv_outlets,"@outlets") \ - MACRO(iv_ninlets,"@ninlets") \ - MACRO(iv_noutlets,"@noutlets") -extern struct BuiltinSymbols { -#define FOO(_sym_,_str_) Ruby _sym_; -BUILTIN_SYMBOLS(FOO) -#undef FOO -} bsym; - -//**************************************************************** // CObject is the base class for C++ classes that get exported to Ruby. // BTW: It's quite convenient to have virtual-methods in the base class // because otherwise the vtable* isn't at the beginning of the object @@ -509,32 +551,23 @@ void CObject_free (void *); // you shouldn't use MethodDecl directly (used by source_filter.rb) struct MethodDecl { const char *selector; RMethod method; }; void define_many_methods(Ruby rself, int n, MethodDecl *methods); - extern Ruby mGridFlow, cFObject, cGridObject, cFormat; //**************************************************************** // a Dim is a list of dimensions that describe the shape of a grid \class Dim < CObject struct Dim : CObject { - static const int MAX_DIMENSIONS=16; // maximum number of dimensions in a grid + static const int MAX_DIM=16; // maximum number of dimensions in a grid int n; Pt<int32> v; // safe pointer - int32 v2[MAX_DIMENSIONS]; // real stuff + int32 v2[MAX_DIM]; // real stuff void check(); // test invariants - Dim(int n, Pt<int32> v) { - this->v = Pt<int32>(v2,MAX_DIMENSIONS); - this->n = n; - COPY(this->v,v,n); check(); - } - Dim(int n, int32* v) { - this->v = Pt<int32>(v2,MAX_DIMENSIONS); - this->n = n; - COPY(this->v,Pt<int32>(v,n),n); check(); - } - Dim() {v=Pt<int32>(v2,MAX_DIMENSIONS); n=0; check();} - Dim(int a) {v=Pt<int32>(v2,MAX_DIMENSIONS); n=1;v[0]=a; check();} - Dim(int a,int b) {v=Pt<int32>(v2,MAX_DIMENSIONS); n=2;v[0]=a;v[1]=b; check();} - Dim(int a,int b,int c){v=Pt<int32>(v2,MAX_DIMENSIONS); n=3;v[0]=a;v[1]=b;v[2]=c;check();} + Dim(int n, Pt<int32> v) { this->v = Pt<int32>(v2,MAX_DIM); this->n = n; COPY(this->v,v,n); check();} + Dim(int n, int32 *v) { this->v = Pt<int32>(v2,MAX_DIM); this->n = n; COPY(this->v,Pt<int32>(v,n),n); check();} + Dim() {v=Pt<int32>(v2,MAX_DIM); n=0; check();} + Dim(int a) {v=Pt<int32>(v2,MAX_DIM); n=1;v[0]=a; check();} + Dim(int a,int b) {v=Pt<int32>(v2,MAX_DIM); n=2;v[0]=a;v[1]=b; check();} + Dim(int a,int b,int c){v=Pt<int32>(v2,MAX_DIM); n=3;v[0]=a;v[1]=b;v[2]=c;check();} int count() {return n;} int get(int i) { return v[i]; } int32 prod(int start=0, int end=-1) { @@ -610,6 +643,7 @@ NUMBER_TYPE_LIMITS( int32,-0x80000000,0x7fffffff,-1) NUMBER_TYPE_LIMITS( int64,-0x8000000000000000LL,0x7fffffffffffffffLL,-1) NUMBER_TYPE_LIMITS(float32,-HUGE_VAL,+HUGE_VAL,(RAISE("all_ones"),0)) NUMBER_TYPE_LIMITS(float64,-HUGE_VAL,+HUGE_VAL,(RAISE("all_ones"),0)) +NUMBER_TYPE_LIMITS( ruby,ruby(-HUGE_VAL),ruby(+HUGE_VAL),(RAISE("all_ones"),0)) #ifdef HAVE_LITE #define NT_NOTLITE NT_UNIMPL @@ -624,7 +658,8 @@ NUMBER_TYPE_LIMITS(float64,-HUGE_VAL,+HUGE_VAL,(RAISE("all_ones"),0)) MACRO( uint32,32,NT_UNSIGNED|NT_UNIMPL, "u32") MACRO(int32,32,0, "i32,i") \ MACRO( uint64,64,NT_UNSIGNED|NT_UNIMPL, "u64") MACRO(int64,64,NT_NOTLITE, "i64,l") \ MACRO(float32,32,NT_NOTLITE|NT_FLOAT, "f32,f") \ - MACRO(float64,64,NT_NOTLITE|NT_FLOAT, "f64,d") + MACRO(float64,64,NT_NOTLITE|NT_FLOAT, "f64,d") \ + MACRO( ruby,sizeof(long),NT_NOTLITE,"r") enum NumberTypeE { #define FOO(_sym_,args...) _sym_##_e, @@ -661,11 +696,12 @@ NumberTypeE NumberTypeE_find (Ruby sym); #define TYPESWITCH(T,C,E) switch (T) { \ case uint8_e: C(uint8) break; case int16_e: C(int16) break; \ case int32_e: C(int32) break; NONLITE(case int64_e: C(int64) break; \ - case float32_e: C(float32) break; case float64_e: C(float64) break;) \ + case float32_e: C(float32) break; case float64_e: C(float64) break; \ + case ruby_e: C(ruby) break;) \ default: E; RAISE("type '%s' not available here",number_type_table[T].sym);} -#define TYPESWITCH_NOFLOAT(T,C,E) switch (T) { \ +#define TYPESWITCH_JUSTINT(T,C,E) switch (T) { \ case uint8_e: C(uint8) break; case int16_e: C(int16) break; \ - case int32_e: C(int32) break; NONLITE(case int64_e: C(int64) break;)\ + case int32_e: C(int32) break; NONLITE(case int64_e: C(int64) break;) \ default: E; RAISE("type '%s' not available here",number_type_table[T].sym);} // Numop objects encapsulate optimised loops of simple operations @@ -683,21 +719,22 @@ struct NumopOn : CObject { typedef bool (*AlgebraicCheck)(T x, LeftRight side); // neutral: right: forall y {f(x,y)=x}; left: forall x {f(x,y)=y}; // absorbent: right: exists a forall y {f(x,y)=a}; ... + T (*neutral)(LeftRight); // default neutral: e.g. 0 for addition, 1 for multiplication AlgebraicCheck is_neutral, is_absorbent; - NumopOn(Map m, Zip z, Fold f, Scan s, AlgebraicCheck n, AlgebraicCheck a) : - op_map(m), op_zip(z), op_fold(f), op_scan(s), - is_neutral(n), is_absorbent(a) {} + NumopOn(Map m, Zip z, Fold f, Scan s, T (*neu)(LeftRight), AlgebraicCheck n, AlgebraicCheck a) : + op_map(m), op_zip(z), op_fold(f), op_scan(s), neutral(neu), is_neutral(n), is_absorbent(a) {} NumopOn() {} NumopOn(const NumopOn &z) { op_map = z.op_map; op_zip = z.op_zip; op_fold = z.op_fold; op_scan = z.op_scan; - is_neutral = z.is_neutral; is_absorbent = z.is_absorbent; } + is_neutral = z.is_neutral; neutral = z.neutral; + is_absorbent = z.is_absorbent; } }; // semigroup property: associativity: f(a,f(b,c))=f(f(a,b),c) #define OP_ASSOC (1<<0) // abelian property: commutativity: f(a,b)=f(b,a) -#define OP_COMM (1<<1) +#define OP_COMM (1<<1) \class Numop < CObject struct Numop : CObject { @@ -773,7 +810,6 @@ struct Grid : CObject { P<Dim> dim; NumberTypeE nt; void *data; - void *rdata; Grid(P<Dim> dim, NumberTypeE nt, bool clear=false) : dim(0), nt(int32_e), data(0) { if (!dim) RAISE("hell"); init(dim,nt); @@ -795,14 +831,13 @@ EACH_NUMBER_TYPE(FOO) memcpy(foo->data,data,bytes()); return foo; } - ~Grid() {if (rdata) delete[] (uint8 *)rdata;} + ~Grid() {if (data) free(data);} private: void init(P<Dim> dim, NumberTypeE nt) { this->dim = dim; this->nt = nt; - rdata = dim ? new int64[1+(bytes()+7)/8] : 0; - int align = ((long)rdata) & 7; - data = (char *)rdata + ((8-align)&7); + data = 0; + if (dim) data = memalign(16,bytes()+16); //fprintf(stderr,"rdata=%p data=%p align=%d\n",rdata,data,align); } void init_from_ruby(Ruby x); @@ -937,18 +972,18 @@ private: // C is for class, I for inlet number // GRIN1 : int32 only // GRIN4 : all types -// GRIN2 : integers only; no floats +// GRIN2 : integers only; no floats (no R either actually) // GRINF : floats only; no integers #ifndef HAVE_LITE -#define GRIN(TB,TS,TI,TL,TF,TD) {TB,TS,TI,TL,TF,TD} +#define GRIN(TB,TS,TI,TL,TF,TD,TR) {TB,TS,TI,TL,TF,TD,TR} #else -#define GRIN(TB,TS,TI,TL,TF,TD) {TB,TS,TI} +#define GRIN(TB,TS,TI,TL,TF,TD,TR) {TB,TS,TI} #endif // HAVE_LITE -#define GRIN1(C,I) GRIN(0,0,C::grinw_##I,0,0,0) -#define GRIN4(C,I) GRIN(C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I) -#define GRIN2(C,I) GRIN(C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,0,0) -#define GRINF(C,I) GRIN(0,0,0,0,C::grinw_##I,C::grinw_##I) +#define GRIN1(C,I) GRIN(0,0,C::grinw_##I,0,0,0,0) +#define GRIN4(C,I) GRIN(C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I) +#define GRIN2(C,I) GRIN(C::grinw_##I,C::grinw_##I,C::grinw_##I,C::grinw_##I,0,0,0) +#define GRINF(C,I) GRIN(0,0,0,0,C::grinw_##I,C::grinw_##I,0) struct FClass { // 0.7.8: removed all GridObject-specific stuff. void *(*allocator)(); // returns a new C++ object @@ -1081,6 +1116,8 @@ static void SAME_DIM(int n, P<Dim> a, int ai, P<Dim> b, int bi) { // a stack for the profiler, etc. #define GF_STACK_MAX 256 +//#define NO_INLINE(decl) decl __attribute__((noinline)) +#define NO_INLINE(decl) decl struct GFStack { struct GFStackFrame { FObject *o; @@ -1090,8 +1127,8 @@ struct GFStack { GFStackFrame s[GF_STACK_MAX]; int n; GFStack() { n = 0; } - void push (FObject *o) __attribute__((noinline)); - void pop () __attribute__((noinline)); + NO_INLINE(void push (FObject *o)); + NO_INLINE(void pop ()); }; extern GFStack gf_stack; struct GFStackMarker { diff --git a/externals/gridflow/base/main.c b/externals/gridflow/base/main.c index 5cdd92f4..d65c81d0 100644 --- a/externals/gridflow/base/main.c +++ b/externals/gridflow/base/main.c @@ -1,5 +1,5 @@ /* - $Id: main.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: main.c,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard @@ -91,7 +91,7 @@ void CObject_free (void *foo) { // Dim void Dim::check() { - if (n>MAX_DIMENSIONS) RAISE("too many dimensions"); + if (n>MAX_DIM) RAISE("too many dimensions"); for (int i=0; i<n; i++) if (v[i]<0) RAISE("Dim: negative dimension"); } @@ -435,7 +435,7 @@ static Ruby GridFlow_handle_braces(Ruby rself, Ruby argv) { s++; } const char *se = s+strlen(s); - while (se[-1]==')' || se[-1]=='}') { se--; close++; } + while (se>s && (se[-1]==')' || se[-1]=='}')) { se--; close++; } if (s!=se) { Ruby u = rb_str_new(s,se-s); av[j++] = rb_funcall(rself,SI(FloatOrSymbol),1,u); @@ -495,7 +495,8 @@ void gfmemcopy(uint8 *out, const uint8 *in, int n) { extern "C" { void *gfmalloc(size_t n) { uint64 t = rdtsc(); - void *p = malloc(n); +// void *p = malloc(n); + void *p = memalign(16,n); long align = (long)p & 7; if (align) fprintf(stderr,"malloc alignment = %ld mod 8\n",align); t=rdtsc()-t; @@ -573,7 +574,7 @@ BUILTIN_SYMBOLS(FOO) rb_ivar_set(mGridFlow, SI(@bsym), PTR2FIX(&bsym)); rb_define_const(mGridFlow, "GF_VERSION", rb_str_new2(GF_VERSION)); rb_define_const(mGridFlow, "GF_COMPILE_TIME", rb_str_new2(GF_COMPILE_TIME)); - + rb_define_const(mGridFlow, "GCC_VERSION", rb_str_new2(GCC_VERSION)); cFObject = rb_define_class_under(mGridFlow, "FObject", rb_cObject); EVAL( \ruby diff --git a/externals/gridflow/base/main.rb b/externals/gridflow/base/main.rb index 82976fb6..5b33bfad 100644 --- a/externals/gridflow/base/main.rb +++ b/externals/gridflow/base/main.rb @@ -1,8 +1,8 @@ =begin - $Id: main.rb,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: main.rb,v 1.2 2006-03-15 04:37:28 matju Exp $ GridFlow - Copyright (c) 2001,2002 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -94,6 +94,7 @@ def self.packstring_for_nt(nt) when :u, :u8, :uint8; "C*" when :s, :i16, :int16; "s*" when :i, :i32, :int32; "l*" + when :l, :i64, :int64; raise "int64? lol" when :f, :f32, :float32; "f*" when :d, :f64, :float64; "d*" else raise "no decoder for #{nt.inspect}" @@ -156,12 +157,26 @@ class FObject attr_accessor :do_loadbangs attr_accessor :comment def foreign_name; @foreign_name if defined? @foreign_name end + def doc(selector=nil,text=nil) + return @doc if not selector + if not defined? @doc; @doc={}; end + return @doc[selector] if not text + @doc[selector] = text + end + def doc_out(selector=nil,text=nil) + return @doc_out if not selector + if not defined? @doc_out; @doc_out={}; end + return @doc_out[selector] if not text + @doc_out[selector] = text + end end def post(*a) GridFlow.post(*a) end def self.subclass(*args,&b) qlass = Class.new self qlass.install(*args) - qlass.module_eval(&b) + #qlass.module_eval{qlass.instance_eval(&b)} + qlass.instance_eval{qlass.module_eval(&b)} + #qlass.module_eval(&b) end alias :total_time :total_time_get alias :total_time= :total_time_set diff --git a/externals/gridflow/base/number.c b/externals/gridflow/base/number.c index c483cf0b..b362e2cb 100644 --- a/externals/gridflow/base/number.c +++ b/externals/gridflow/base/number.c @@ -1,5 +1,5 @@ /* - $Id: number.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: number.c,v 1.2 2006-03-15 04:37:08 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard @@ -44,8 +44,8 @@ template <class T> class Op { public: // I call abort() on those because I can't say they're purevirtual. static T f(T a, T b) {abort();} - static bool is_neutral(T x, LeftRight side) {assert(!"Op::is_neutral called?");} - static bool is_absorbent(T x, LeftRight side) {assert(!"Op::is_absorbent called?");} + static bool is_neutral(T x, LeftRight side) {assert(!"Op::is_neutral called?"); return false;} + static bool is_absorbent(T x, LeftRight side) {assert(!"Op::is_absorbent called?"); return false;} }; template <class O> class OpLoops { @@ -58,7 +58,7 @@ public: } template <class T> static void op_zip (int n, T *as, T *bs) { if (!n) return; - int ba=bs-as; // really! + ptrdiff_t ba=bs-as; // really! #define FOO(I) as[I]=O::f(as[I],as[ba+I]); UNROLL_8(FOO,n,as) #undef FOO @@ -66,7 +66,7 @@ public: // disabled template <class T> static void op_zip2 (int n, T *as, T *bs, T *cs) { if (!n) return; - int ba=bs-as, ca=cs-as; + ptrdiff_t ba=bs-as, ca=cs-as; #define FOO(I) as[ca+I]=O::f(as[I],as[ba+I]); UNROLL_8(FOO,n,as) #undef FOO @@ -136,119 +136,113 @@ template <class T> static void quick_put_zip (int n, T *as, T *bs) { } // classic two-input operator -#define DEF_OP(op,expr,neutral,absorbent) \ +#define DEF_OP(op,expr,neu,isneu,isorb) \ template <class T> class Y##op : Op<T> { public: \ inline static T f(T a, T b) { return expr; } \ - inline static bool is_neutral (T x, LeftRight side) { return neutral; } \ - inline static bool is_absorbent(T x, LeftRight side) { return absorbent; } }; -#define DEF_OPFT(op,expr,neutral,absorbent,T) \ + inline static T neutral (LeftRight side) {return neu;} \ + inline static bool is_neutral (T x, LeftRight side) {return isneu;} \ + inline static bool is_absorbent(T x, LeftRight side) {return isorb;}}; +#define DEF_OPFT(op,expr,neu,isneu,isorb,T) \ template <> class Y##op<T> : Op<T> { public: \ inline static T f(T a, T b) { return expr; } \ - inline static bool is_neutral (T x, LeftRight side) { return neutral; } \ - inline static bool is_absorbent(T x, LeftRight side) { return absorbent; } }; \ + inline static T neutral (LeftRight side) {return neu;} \ + inline static bool is_neutral (T x, LeftRight side) {return isneu;} \ + inline static bool is_absorbent(T x, LeftRight side) {return isorb;}}; // this macro is for operators that have different code for the float version -#define DEF_OPF(op,expr,expr2,neutral,absorbent) \ - DEF_OP( op,expr, neutral,absorbent) \ - DEF_OPFT(op,expr2,neutral,absorbent,float32) \ - DEF_OPFT(op,expr2,neutral,absorbent,float64) +#define DEF_OPF(op,expr,expr2,neu,isneu,isorb) \ + DEF_OP( op,expr, neu,isneu,isorb) \ + DEF_OPFT(op,expr2,neu,isneu,isorb,float32) \ + DEF_OPFT(op,expr2,neu,isneu,isorb,float64) #define DECL_OPON(base,op,T) NumopOn<T>( \ &base<Y##op<T> >::op_map, &base<Y##op<T> >::op_zip, \ &base<Y##op<T> >::op_fold, &base<Y##op<T> >::op_scan, \ - &Y##op<T>::is_neutral, &Y##op<T>::is_absorbent) + &Y##op<T>::neutral, &Y##op<T>::is_neutral, &Y##op<T>::is_absorbent) #define DECL_OPON_NOFOLD(base,op,T) NumopOn<T>( \ &base<Y##op<T> >::op_map, &base<Y##op<T> >::op_zip, 0,0, \ - &Y##op<T>::is_neutral, &Y##op<T>::is_absorbent) + &Y##op<T>::neutral, &Y##op<T>::is_neutral, &Y##op<T>::is_absorbent) #define DECL_OP(op,sym,flags) Numop(0, sym, \ DECL_OPON(OpLoops,op,uint8), DECL_OPON(OpLoops,op,int16), \ DECL_OPON(OpLoops,op,int32) NONLITE(, DECL_OPON(OpLoops,op,int64), \ - DECL_OPON(OpLoops,op,float32), DECL_OPON(OpLoops,op,float64)), flags) + DECL_OPON(OpLoops,op,float32), DECL_OPON(OpLoops,op,float64), \ + DECL_OPON(OpLoops,op,ruby)), flags) #define DECL_OP_NOFLOAT(op,sym,flags) Numop(0, sym, \ DECL_OPON(OpLoops,op,uint8), DECL_OPON(OpLoops,op,int16), \ DECL_OPON(OpLoops,op,int32) NONLITE(, DECL_OPON(OpLoops,op,int64), \ - NumopOn<float32>(0,0,0,0,0,0), NumopOn<float64>(0,0,0,0,0,0)), flags) + NumopOn<float32>(0,0,0,0,0,0,0), NumopOn<float64>(0,0,0,0,0,0,0), \ + DECL_OPON(OpLoops,op,ruby)), flags) #define DECL_OP_NOFOLD(op,sym,flags) Numop(0, sym, \ DECL_OPON_NOFOLD(OpLoops,op,uint8), DECL_OPON_NOFOLD(OpLoops,op,int16), \ DECL_OPON_NOFOLD(OpLoops,op,int32) NONLITE(, DECL_OPON_NOFOLD(OpLoops,op,int64), \ - DECL_OPON_NOFOLD(OpLoops,op,float32), DECL_OPON_NOFOLD(OpLoops,op,float64)), flags) + DECL_OPON_NOFOLD(OpLoops,op,float32), DECL_OPON_NOFOLD(OpLoops,op,float64), \ + DECL_OPON_NOFOLD(OpLoops,op,ruby)), flags) template <class T> static inline T gf_floor (T a) { return (T) floor((double)a); } template <class T> static inline T gf_trunc (T a) { return (T) floor(abs((double)a)) * (a<0?-1:1); } -/* -uint8 clipadd(uint8 a, uint8 b) { int32 c=a+b; return c<0?0:c>255?255:c; } -int16 clipadd(int16 a, int16 b) { int32 c=a+b; return c<-0x8000?-0x8000:c>0x7fff?0x7fff:c; } -int32 clipadd(int32 a, int32 b) { int64 c=a+b; return c<-0x80000000?-0x80000000:c>0x7fffffff?0x7fffffff:c; } -int64 clipadd(int64 a, int64 b) { int64 c=(a>>1)+(b>>1)+(a&b&1); - return c<(nt_smallest(0LL)/2?nt_smallest(0LL):c>nt_greatest(0LL)/2?nt_greatest(0LL):a+b; } -uint8 clipsub(uint8 a, uint8 b) { int32 c=a-b; return c<0?0:c>255?255:c; } -int16 clipsub(int16 a, int16 b) { int32 c=a-b; return c<-0x8000?-0x8000:c>0x7fff?0x7fff:c; } -int32 clipsub(int32 a, int32 b) { int64 c=a-b; return c<-0x80000000?-0x80000000:c>0x7fffffff?0x7fffffff:c; } -int64 clipsub(int64 a, int64 b) { int64 c=(a>>1)-(b>>1); //??? - return c<(nt_smallest(0LL)/2?nt_smallest(0LL):c>nt_greatest(0LL)/2?nt_greatest(0LL):a-b; } -*/ +// trying to avoid GCC warning about uint8 too small for ==256 +template <class T> static bool equal256 (T x) {return x==256;} +template <> static bool equal256 (uint8 x) {return false;} #ifdef PASS1 -DEF_OP(ignore, a, side==at_right, side==at_left) -DEF_OP(put, b, side==at_left, side==at_right) -DEF_OP(add, a+b, x==0, false) -DEF_OP(sub, a-b, side==at_right && x==0, false) -DEF_OP(bus, b-a, side==at_left && x==0, false) -DEF_OP(mul, a*b, x==1, x==0) -DEF_OP(mulshr8, ((int32)a*(int32)b)>>8, (int64)x==256, x==0) //!@#$ bug with int64 -DEF_OP(div, b==0 ? 0 : a/b, side==at_right && x==1, false) -DEF_OP(div2, b==0 ? 0 : div2(a,b), side==at_right && x==1, false) -DEF_OP(vid, a==0 ? 0 : b/a, side==at_left && x==1, false) -DEF_OP(vid2, a==0 ? 0 : div2(b,a), side==at_left && x==1, false) -DEF_OPF(mod, b==0 ? 0 : mod(a,b), b==0 ? 0 : a-b*gf_floor(a/b), - false, side==at_left && x==0 || side==at_right && x==1) -DEF_OPF(dom, a==0 ? 0 : mod(b,a), a==0 ? 0 : b-a*gf_floor(b/a), - false, side==at_left && x==0 || side==at_right && x==1) +DEF_OP(ignore, a, 0, side==at_right, side==at_left) +DEF_OP(put, b, 0, side==at_left, side==at_right) +DEF_OP(add, a+b, 0, x==0, false) +DEF_OP(sub, a-b, 0, side==at_right && x==0, false) +DEF_OP(bus, b-a, 0, side==at_left && x==0, false) +DEF_OP(mul, a*b, 1, x==1, x==0) +DEF_OP(mulshr8, (a*b)>>8, 256, equal256(x), x==0) +DEF_OP(div, b==0 ? (T)0 : a/b , 1, side==at_right && x==1, false) +DEF_OP(div2, b==0 ? 0 : div2(a,b), 1, side==at_right && x==1, false) +DEF_OP(vid, a==0 ? (T)0 : b/a , 1, side==at_left && x==1, false) +DEF_OP(vid2, a==0 ? 0 : div2(b,a), 1, side==at_left && x==1, false) +DEF_OPF(mod, b==0 ? 0 : mod(a,b), b==0 ? 0 : a-b*gf_floor(a/b), 0, false, side==at_left && x==0 || side==at_right && x==1) +DEF_OPF(dom, a==0 ? 0 : mod(b,a), a==0 ? 0 : b-a*gf_floor(b/a), 0, false, side==at_left && x==0 || side==at_right && x==1) //DEF_OPF(rem, b==0 ? 0 : a%b, b==0 ? 0 : a-b*gf_trunc(a/b)) //DEF_OPF(mer, a==0 ? 0 : b%a, a==0 ? 0 : b-a*gf_trunc(b/a)) -DEF_OP(rem, b==0?0:a%b, false, side==at_left&&x==0 || side==at_right&&x==1) -DEF_OP(mer, a==0?0:b%a, false, side==at_left&&x==0 || side==at_right&&x==1) +DEF_OP(rem, b==0?(T)0:a%b, 0, false, side==at_left&&x==0 || side==at_right&&x==1) +DEF_OP(mer, a==0?(T)0:b%a, 0, false, side==at_left&&x==0 || side==at_right&&x==1) #endif #ifdef PASS2 -DEF_OP(gcd, gcd(a,b), x==0, x==1) -DEF_OP(gcd2, gcd2(a,b), x==0, x==1) // should test those and pick one of the two -DEF_OP(lcm, a==0 || b==0 ? 0 : lcm(a,b), x==1, x==0) -DEF_OPF(or , a|b, (float32)((int32)a | (int32)b), x==0, x==nt_all_ones(&x)) -DEF_OPF(xor, a^b, (float32)((int32)a ^ (int32)b), x==0, false) -DEF_OPF(and, a&b, (float32)((int32)a & (int32)b), x==nt_all_ones(&x), x==0) -DEF_OPF(shl, a<<b, a*pow(2.0,+b), side==at_right && x==0, false) -DEF_OPF(shr, a>>b, a*pow(2.0,-b), side==at_right && x==0, false) -DEF_OP(sc_and, a ? b : a, side==at_left && x!=0, side==at_left && x==0) -DEF_OP(sc_or, a ? a : b, side==at_left && x==0, side==at_left && x!=0) -DEF_OP(min, min(a,b), x==nt_greatest(&x), x==nt_smallest(&x)) -DEF_OP(max, max(a,b), x==nt_smallest(&x), x==nt_greatest(&x)) +DEF_OP(gcd, gcd(a,b), 0, x==0, x==1) +DEF_OP(gcd2, gcd2(a,b), 0, x==0, x==1) // should test those and pick one of the two +DEF_OP(lcm, a==0 || b==0 ? (T)0 : lcm(a,b), 1, x==1, x==0) +DEF_OPF(or , a|b, (float32)((int32)a | (int32)b), 0, x==0, x==nt_all_ones(&x)) +DEF_OPF(xor, a^b, (float32)((int32)a ^ (int32)b), 0, x==0, false) +DEF_OPF(and, a&b, (float32)((int32)a & (int32)b), -1 /*nt_all_ones((T*)0)*/, x==nt_all_ones(&x), x==0) +DEF_OPF(shl, a<<b, a*pow(2.0,+b), 0, side==at_right && x==0, false) +DEF_OPF(shr, a>>b, a*pow(2.0,-b), 0, side==at_right && x==0, false) +DEF_OP(sc_and, a ? b : a, 1, side==at_left && x!=0, side==at_left && x==0) +DEF_OP(sc_or, a ? a : b, 0, side==at_left && x==0, side==at_left && x!=0) +DEF_OP(min, min(a,b), nt_greatest((T*)0), x==nt_greatest(&x), x==nt_smallest(&x)) +DEF_OP(max, max(a,b), nt_smallest((T*)0), x==nt_smallest(&x), x==nt_greatest(&x)) +DEF_OP(cmp, cmp(a,b), 0, false, false) +DEF_OP(eq, a == b, 0, false, false) +DEF_OP(ne, a != b, 0, false, false) +DEF_OP(gt, a > b, 0, false, side==at_left&&x==nt_smallest(&x)||side==at_right&&x==nt_greatest(&x)) +DEF_OP(le, a <= b, 0, false, side==at_left&&x==nt_smallest(&x)||side==at_right&&x==nt_greatest(&x)) +DEF_OP(lt, a < b, 0, false, side==at_left&&x==nt_greatest(&x)||side==at_right&&x==nt_smallest(&x)) +DEF_OP(ge, a >= b, 0, false, side==at_left&&x==nt_greatest(&x)||side==at_right&&x==nt_smallest(&x)) #endif #ifdef PASS3 -DEF_OP(cmp, cmp(a,b), false, false) -DEF_OP(eq, a == b, false, false) -DEF_OP(ne, a != b, false, false) -DEF_OP(gt, a > b, false, side==at_left&&x==nt_smallest(&x)||side==at_right&&x==nt_greatest(&x)) -DEF_OP(le, a <= b, false, side==at_left&&x==nt_smallest(&x)||side==at_right&&x==nt_greatest(&x)) -DEF_OP(lt, a < b, false, side==at_left&&x==nt_greatest(&x)||side==at_right&&x==nt_smallest(&x)) -DEF_OP(ge, a >= b, false, side==at_left&&x==nt_greatest(&x)||side==at_right&&x==nt_smallest(&x)) -DEF_OP(sin, (T)(b * sin(a * (M_PI / 18000))), false, false) // "LN=9000+36000n RA=0 LA=..." -DEF_OP(cos, (T)(b * cos(a * (M_PI / 18000))), false, false) // "LN=36000n RA=0 LA=..." -DEF_OP(atan, (T)(atan2(a,b) * (18000 / M_PI)), false, false) // "LA=0" -DEF_OP(tanh, (T)(b * tanh(a * (M_PI / 18000))), false, x==0) -DEF_OP(gamma, b<=0 ? 0 : (T)(0+floor(pow(a/256.0,256.0/b)*256.0)), false, false) // "RN=256" -DEF_OP(pow, ipow(a,b), false, false) // "RN=1" -DEF_OP(log, (T)(a==0 ? 0 : b * log(gf_abs(a))), false, false) // "RA=0" -// 0.7.8 -//DEF_OPF(clipadd, clipadd(a,b), a+b, x==0, false) -//DEF_OPF(clipsub, clipsub(a,b), a-b, side==at_right && x==0, false) -DEF_OP(abssub, gf_abs(a-b), false, false) -DEF_OP(sqsub, (a-b)*(a-b), false, false) -DEF_OP(avg, (a+b)/2, false, false) -DEF_OP(hypot, (T)(0+floor(sqrt(a*a+b*b))), false, false) -DEF_OP(sqrt, (T)(0+floor(sqrt(a))), false, false) -DEF_OP(rand, a==0 ? 0 : random()%(int32)a, false, false) +DEF_OP(sin, (T)((float64)b * sin((float64)a * (M_PI / 18000))), 0, false, false) // "LN=9000+36000n RA=0 LA=..." +DEF_OP(cos, (T)((float64)b * cos((float64)a * (M_PI / 18000))), 0, false, false) // "LN=36000n RA=0 LA=..." +DEF_OP(atan, (T)(atan2(a,b) * (18000 / M_PI)), 0, false, false) // "LA=0" +DEF_OP(tanh, (T)((float64)b * tanh((float64)a * (M_PI / 18000))), 0, false, x==0) +DEF_OP(gamma, b<=0 ? (T)0 : (T)(0+floor(pow((float64)a/256.0,256.0/(float64)b)*256.0)), 0, false, false) // "RN=256" +DEF_OP(pow, ipow(a,b), 0, false, false) // "RN=1" +DEF_OP(log, (T)(a==0 ? (T)0 : (T)((float64)b * log((float64)gf_abs(a)))), 0, false, false) // "RA=0" +// 0.8 +DEF_OPF(clipadd, clipadd(a,b), a+b, 0, x==0, false) +DEF_OPF(clipsub, clipsub(a,b), a-b, 0, side==at_right && x==0, false) +DEF_OP(abssub, gf_abs(a-b), 0, false, false) +DEF_OP(sqsub, (a-b)*(a-b), 0, false, false) +DEF_OP(avg, (a+b)/2, 0, false, false) +DEF_OP(hypot, (T)(0+floor(sqrt(a*a+b*b))), 0, false, false) +DEF_OP(sqrt, (T)(0+floor(sqrt(a))), 0, false, false) +DEF_OP(rand, a==0 ? (T)0 : (T)(random()%(int32)a), 0, false, false) //DEF_OP(erf,"erf*", 0) #endif @@ -289,28 +283,43 @@ Numop op_table2[] = { DECL_OP_NOFOLD(sc_or, "||", 0), DECL_OP(min, "min", OP_ASSOC|OP_COMM), DECL_OP(max, "max", OP_ASSOC|OP_COMM), + DECL_OP_NOFOLD(eq, "==", OP_COMM), + DECL_OP_NOFOLD(ne, "!=", OP_COMM), + DECL_OP_NOFOLD(gt, ">", 0), + DECL_OP_NOFOLD(le, "<=", 0), + DECL_OP_NOFOLD(lt, "<", 0), + DECL_OP_NOFOLD(ge, ">=", 0), + DECL_OP_NOFOLD(cmp, "cmp", 0), }; const long op_table2_n = COUNT(op_table2); #endif #ifdef PASS3 +uint8 clipadd(uint8 a, uint8 b) { int32 c=a+b; return c<0?0:c>255?255:c; } +int16 clipadd(int16 a, int16 b) { int32 c=a+b; return c<-0x8000?-0x8000:c>0x7fff?0x7fff:c; } +int32 clipadd(int32 a, int32 b) { int64 c=a+b; return c<-0x80000000?-0x80000000:c>0x7fffffff?0x7fffffff:c; } +int64 clipadd(int64 a, int64 b) { int64 c=(a>>1)+(b>>1)+(a&b&1), p=nt_smallest((int64 *)0), q=nt_greatest((int64 *)0); + return c<p/2?p:c>q/2?q:a+b; } +uint8 clipsub(uint8 a, uint8 b) { int32 c=a-b; return c<0?0:c>255?255:c; } +int16 clipsub(int16 a, int16 b) { int32 c=a-b; return c<-0x8000?-0x8000:c>0x7fff?0x7fff:c; } +int32 clipsub(int32 a, int32 b) { int64 c=a-b; return c<-0x80000000?-0x80000000:c>0x7fffffff?0x7fffffff:c; } +int64 clipsub(int64 a, int64 b) { int64 c=(a>>1)-(b>>1); //??? + int64 p=nt_smallest((int64 *)0), q=nt_greatest((int64 *)0); + return c<p/2?p:c>q/2?q:a-b; } + +ruby clipadd(ruby a, ruby b) { return a+b; } +ruby clipsub(ruby a, ruby b) { return a-b; } + Numop op_table3[] = { - DECL_OP_NOFOLD(eq, "==", OP_COMM), - DECL_OP_NOFOLD(ne, "!=", OP_COMM), - DECL_OP_NOFOLD(gt, ">", 0), - DECL_OP_NOFOLD(le, "<=", 0), - DECL_OP_NOFOLD(lt, "<", 0), - DECL_OP_NOFOLD(ge, ">=", 0), - DECL_OP_NOFOLD(cmp, "cmp", 0), - DECL_OP_NOFOLD(sin, "sin*", 0), - DECL_OP_NOFOLD(cos, "cos*", 0), + DECL_OP_NOFOLD(sin, "sin*", 0), + DECL_OP_NOFOLD(cos, "cos*", 0), DECL_OP_NOFOLD(atan, "atan", 0), DECL_OP_NOFOLD(tanh, "tanh*", 0), DECL_OP_NOFOLD(gamma, "gamma", 0), DECL_OP_NOFOLD(pow, "**", 0), DECL_OP_NOFOLD(log, "log*", 0), -// 0.7.8 -// DECL_OP(clipadd,"clip+", OP_ASSOC|OP_COMM), -// DECL_OP(clipsub,"clip-", 0), +// 0.8 + DECL_OP(clipadd,"clip+", OP_ASSOC|OP_COMM), + DECL_OP(clipsub,"clip-", 0), DECL_OP_NOFOLD(abssub,"abs-", OP_COMM), DECL_OP_NOFOLD(sqsub,"sq-", OP_COMM), DECL_OP_NOFOLD(avg,"avg", OP_COMM), diff --git a/externals/gridflow/base/source_filter.rb b/externals/gridflow/base/source_filter.rb index 59e24867..c55f4d95 100644 --- a/externals/gridflow/base/source_filter.rb +++ b/externals/gridflow/base/source_filter.rb @@ -1,14 +1,16 @@ +#!/usr/bin/env ruby + $keywords = %w(class decl def end grdecl) $stack = [] $classes = [] ClassDecl = Struct.new(:name,:supername,:methods,:grins,:attrs,:info) -MethodDecl = Struct.new(:rettype,:selector,:arglist,:minargs,:maxargs,:where) +MethodDecl = Struct.new(:rettype,:selector,:arglist,:minargs,:maxargs,:where,:static) Arg = Struct.new(:type,:name,:default) class MethodDecl def ==(o) - return false unless rettype==o.rettype && + return false unless rettype==o.rettype && static==o.static && maxargs==o.maxargs # && minargs==o.minargs arglist.each_index{|i| arglist[i] == o.arglist[i] or return false } return true @@ -35,11 +37,11 @@ def handle_class(line) end def parse_methoddecl(line,term) - /^(\w+)\s+(\w+)\s*\(([^\)]*)\)\s*#{term}/.match line or + /^(static\s)?\s*(\w+)\s+(\w+)\s*\(([^\)]*)\)\s*#{term}/.match line or raise "syntax error #{where} #{line}" - rettype,selector,arglist = $1,$2,$3 + static,rettype,selector,arglist = $1,$2,$3,$4 arglist,minargs,maxargs = parse_arglist arglist - MethodDecl.new(rettype,selector,arglist,minargs,maxargs,where) + MethodDecl.new(rettype,selector,arglist,minargs,maxargs,where,static) end def parse_arglist(arglist) @@ -75,10 +77,9 @@ def handle_attr(line) raise "missing \\class #{where}" if not $stack[-1] or not ClassDecl===$stack[-1] $stack[-1].attrs[name]=Arg.new(type,name,nil) - Out.print line - Out.puts "//FCS" + Out.print line.gsub(/\/\/.*$/,"") # hack! handle_decl "void _0_#{name}_m (#{type} #{name});" - Out.puts "# #{$linenumber}" +# Out.puts "# #{$linenumber}" end def handle_decl(line) @@ -88,16 +89,17 @@ def handle_decl(line) m = parse_methoddecl(line,";\s*$") $stack[-1].methods[m.selector] = m + Out.print "static " if m.static Out.print "#{m.rettype} #{m.selector}(int argc, Ruby *argv" Out.print "," if m.arglist.length>0 Out.print "#{unparse_arglist m.arglist});" Out.puts "static Ruby #{m.selector}_wrap"+ "(int argc, Ruby *argv, Ruby rself);//FCS" - Out.puts "# #{$linenumber+1}" +# Out.puts "# #{$linenumber}" end def handle_def(line) - m = parse_methoddecl(line,"\{?.*$") + m = parse_methoddecl(line,"\\{?.*$") term = line[/\{.*/] qlass = $stack[-1] raise "missing \\class #{where}" if not qlass or not ClassDecl===qlass @@ -176,7 +178,7 @@ def handle_classinfo(line) c,s = frame.name,method.selector "{ \"#{s}\",(RMethod)#{c}::#{s}_wrap }" }.join(",") - Out.puts "}; FClass ci#{cl} = { #{cl}_allocator, #{cl}_startup," + Out.puts "}; static FClass ci#{cl} = { #{cl}_allocator, #{cl}_startup," Out.puts "#{cl.inspect}, COUNT(#{cl}_methods), #{cl}_methods };" Out.puts "void #{frame.name}_startup (Ruby rself) "+line end diff --git a/externals/gridflow/base/test.rb b/externals/gridflow/base/test.rb index 1d44f918..86c17af3 100644 --- a/externals/gridflow/base/test.rb +++ b/externals/gridflow/base/test.rb @@ -1,4 +1,4 @@ -# $Id: test.rb,v 1.1 2005-10-04 02:02:13 matju Exp $ +# $Id: test.rb,v 1.2 2006-03-15 04:37:28 matju Exp $ $:.delete_if {|x| x=='.' } require "gridflow" @@ -7,13 +7,15 @@ include GridFlow GridFlow.verbose=true $imdir = "./images" -$animdir = "/opt/mex" +$animdir = "./images/movies" srand Time.new.to_i $port = 4200+rand(100) def pressakey; puts "press return to continue."; readline; end -class Expect < FObject +FO = FObject # shortcut + +class Expect < FO def praise(*a) #raise(*a) puts a @@ -38,64 +40,71 @@ class Expect < FObject install "expect", 1, 0 end +def cast value, type + case type + when :b, :u8,:uint8; value & 0xff + when :s,:i16,:int16; (value & 0x7fff) - (value & 0x8000) + when :i,:i32,:int32; value + when :l,:i64,:int64; value + when :f,:f32,:float32; value.to_f + when :d,:f64,:float64; value.to_f + when :r,:ruby; value + else raise "hell" + end +end + def test_bitpacking #!@#$ WRITE ME end -def test_operators +def test_numops #!@#$ WRITE ME end -def cast value, type - case type - when :uint8; value & 0xff - when :int16; (value & 0x7fff) - (value & 0x8000) - when :int32; value - when :int64; value - when :float32; value.to_f - when :float64; value.to_f - else raise "hell" - end +#def tnt() for nt in [:b,:s,:i,:l,:f,:d,:r] do yield end end +def _(o,s,i,d) o.connect(s,i,d) end +def chain(*a) + (a.length-1).times {|i| a[i].connect 0,a[i+1],a } + a[-1] end def test_math +for nt in [:b,:s,:i,:l,:f,:d,:r] do hm = "#".intern -#for nt in [:uint8, :int16, :int32, :int64, :float32, :float64] do -for nt in [:uint8, :int16, :int32, :float32] do - #GridFlow.verbose = false - GridFlow.gfpost "starting test for #{nt}" - e = FObject["@export_list"] - x = Expect.new - e.connect 0,x,0 + + (e=FO["#export_list"]) + (x=Expect.new) + _ e,0,x,0 x.expect([1,2,3,11,12,13,21,22,23]) { e.send_in 0, 3,3,nt,hm,1,2,3,11,12,13,21,22,23 } - a = FObject["fork"] - b = FObject["@ +"] - a.connect 0,b,0 - a.connect 1,b,1 - b.connect 0,e,0 + (a=FO["fork"]) + (b=FO["@ +"]) + _ a,0,b,0 + _ a,1,b,1 + _ b,0,e,0 x.expect([4]) { a.send_in 0, 2 } - x.expect([2,3,5,7]) { e.send_in 0,"list #{nt} 2 3 5 7" } - a = FObject["@fold + {#{nt} # 0}"] - a.connect 0,e,0 + x.expect([2,3,5,7]) { e.send_in 0,:list,nt,2,3,5,7 } + a = FO["#fold + , seed {#{nt} # 0}"] + _ a,0,e,0 x.expect([cast(420000,nt)]) { a.send_in 0,"10000 #{nt} # 42" } - (a = FObject["@ + {#{nt} 0 10}"]).connect 0,e,0 + a = FO["# + {#{nt} 0 10}"] + _ a,0,e,0 x.expect([1,12,4,18,16,42,64]) { a.send_in 0,:list,nt, 1,2,4,8,16,32,64 } - a = FObject["@ + {#{nt} 2 3 5}"] - b = FObject["@fold + {#{nt} # 0}"] - a.connect 0,b,0 - b.connect 0,e,0 + a = FO["# + {#{nt} 2 3 5}"] + b = FO["#fold + , seed {#{nt} # 0}"] + _ a,0,b,0 + _ b,0,e,0 x.expect([cast(45332,nt)]) { a.send_in 0, 1000,nt,hm,42 } - - (a = FObject["@ + {#{nt} # 42}"]).connect 0,e,0 + a = FO["@ + {#{nt} # 42}"] + _ a,0,e,0 x.expect((43..169).to_a) { a.send_in 0,:list,nt, *(1..127).to_a } @@ -106,52 +115,47 @@ for nt in [:uint8, :int16, :int32, :float32] do a.send_in 1, "list #{nt} # 10" a.send_in 0,:list,nt, 1,2,4,8 } -if nt!=:uint8 and nt!=:float32 and nt!=:float64 - (a = FObject["@ / {#{nt} # 3}"]).connect 0,e,0 - x.expect([-2,-1,-1,-1,0,0,0,0,0,1,1,1,2]) { - a.send_in(0,:list,nt, *(-6..6).to_a) } - - (a = FObject["@ div {#{nt} # 3}"]).connect 0,e,0 - x.expect([-2,-2,-2,-1,-1,-1,0,0,0,1,1,1,2]) { - a.send_in(0, :list, nt, *(-6..6).to_a) } +if nt!=:b and nt!=:f and nt!=:d + a=FO["# / {#{nt} # 3}" ]; _ a,0,e,0; x.expect([-2,-1,-1,-1,0,0,0,0,0,1,1,1,2]) { a.send_in(0,:list,nt, *(-6..6).to_a) } + a=FO["# div {#{nt} # 3}"]; _ a,0,e,0; x.expect([-2,-2,-2,-1,-1,-1,0,0,0,1,1,1,2]) { a.send_in(0, :list, nt, *(-6..6).to_a) } end - (a = FObject["@ ignore {#{nt} # 42}"]).connect 0,e,0 + (a = FO["# ignore {#{nt} # 42}"]).connect 0,e,0 x.expect((42..52).to_a) { a.send_in(0, :list, nt, *(42..52).to_a) } - (a = FObject["@ put {#{nt} # 42}"]).connect 0,e,0 + (a = FO["# put {#{nt} # 42}"]).connect 0,e,0 x.expect([42]*13) { a.send_in(0, :list, nt, *(-6..6).to_a) } -if nt!=:uint8 - (a = FObject["@! abs"]).connect 0,e,0 +if nt!=:b + (a = FO["# abs-"]).connect 0,e,0 x.expect([2,3,5,7]) { a.send_in 0,:list,nt, -2,3,-5,7 } end - (a = FObject["@fold * {#{nt} # 1}"]).connect 0,e,0 + (a = FO["#fold *, seed {#{nt} # 1}"]).connect 0,e,0 x.expect([210]) { a.send_in 0,:list,nt, 2,3,5,7 } x.expect([128]) { a.send_in 0,:list,nt, 1,1,2,1,2,2,2,1,1,2,1,2,2 } - (a = FObject["@fold + {#{nt} 0 0}"]).connect 0,e,0 + (a = FO["#fold +, seed {#{nt} 0 0}"]).connect 0,e,0 x.expect([18,23]) { a.send_in 0, 3,2,nt,hm,2,3,5,7,11,13 } - (a = FObject["@scan + {#{nt} 0 0}"]).connect 0,e,0 + (a = FO["#scan +, seed {#{nt} 0 0}"]).connect 0,e,0 x.expect([2,3,7,10,18,23]) { a.send_in 0, 3,2,nt,hm,2,3,5,7,11,13 } - (a = FObject["@scan * {#{nt} # 1}"]).connect 0,e,0 + (a = FO["#scan *, seed {#{nt} # 1}"]).connect 0,e,0 x.expect([2,6,30,210]) { a.send_in 0,:list,nt, 2,3,5,7 } x.expect([1,1,2,2,4,8,16,16,16,32,32,64,128]) { a.send_in 0,:list,nt, 1,1,2,1,2,2,2,1,1,2,1,2,2 } - (a = FObject["@scan + {#{nt} 0 0 0}"]).connect 0,e,0 + (a = FO["#scan +, seed {#{nt} 0 0 0}"]).connect 0,e,0 x.expect([1,2,3,5,7,9,12,15,18]) { a.send_in 0,:list,3,3,nt,hm,*(1..9).to_a } - (a = FObject["@scan + {#{nt} # 0}"]).connect 0,e,0 + (a = FO["#scan +, seed {#{nt} # 0}"]).connect 0,e,0 x.expect([1,3,6, 4,9,15, 7,15,24]) { a.send_in 0,:list,3,3,nt,hm,*(1..9).to_a } - (a = FObject["@outer +"]).connect 0,e,0 + (a = FO["#outer +"]).connect 0,e,0 x.expect([9,10,12,17,18,20,33,34,36]) { a.send_in 1,:list,nt, 1,2,4 a.send_in 0,:list,nt, 8,16,32 } @@ -160,47 +164,29 @@ end a.send_in 1,(0...10).to_a a.send_in 0,(0...10).map{|i| 10*i }} -if nt!=:uint8 and nt!=:float32 and nt!=:float64 - (a = FObject["@outer",:%,[nt,3,-3]]).connect 0,e,0 +if nt!=:b and nt!=:f and nt!=:d + (a = FO["#outer",:%,[nt,3,-3]]).connect 0,e,0 x.expect([0,0,1,-2,2,-1,0,0,1,-2,2,-1,0,0]) { a.send_in 0,:list,nt, -30,-20,-10,0,+10,+20,+30 } - (a = FObject["@outer","swap%".intern,[nt,3,-3]]).connect 0,e,0 + (a = FO["#outer","swap%".intern,[nt,3,-3]]).connect 0,e,0 x.expect([-27,-3,-17,-3,-7,-3,0,0,3,7,3,17,3,27]) { a.send_in 0,:list,nt, -30,-20,-10,0,+10,+20,+30 } end - (a = FObject["@import {3}"]).connect 0,e,0 - x.expect([2,3,5]) { [2,3,5].each {|v| a.send_in 0,:list,nt,hm,v }} - - (a = FObject["@import {3}"]).connect 0,e,0 - x.expect([2,3,5]) { [2,3,5].each {|v| a.send_in 0,:list,nt,v }} - - (a = FObject["@redim {5}"]).connect 0,e,0 - x.expect([2,3,5,2,3]) { a.send_in 0,:list,2,3,5 } - - (a = FObject["@redim {5}"]).connect 0,e,0 - x.expect([0,0,0,0,0]) { a.send_in 0,:list } + (a = FO["#import {3}"]).connect 0,e,0; x.expect([2,3,5]) { [2,3,5].each {|v| a.send_in 0,:list,nt,hm,v }} + (a = FO["#import {3}"]).connect 0,e,0; x.expect([2,3,5]) { [2,3,5].each {|v| a.send_in 0,:list,nt,v }} + (a = FO["#redim {5}"]).connect 0,e,0; x.expect([2,3,5,2,3]) { a.send_in 0,:list,2,3,5 } + (a = FO["#redim {5}"]).connect 0,e,0; x.expect([0,0,0,0,0]) { a.send_in 0,:list } + (a = FO["#redim {0}"]).connect 0,e,0; x.expect([]) { a.send_in 0,:list,42,37,69 } - (a = FObject["@redim {0}"]).connect 0,e,0 - x.expect([]) { a.send_in 0,:list,42,37,69 } - - (a = FObject["@inner * + {#{nt} # 0} {2 2 #{nt} # 2 3 5 7}"]).connect 0,e,0 - (i0 = FObject["@redim {2 2}"]).connect 0,a,0 + (a = FO["#inner {2 2 #{nt} # 2 3 5 7}, seed {#{nt} # 0}"]).connect 0,e,0 + (i0 = FO["@redim {2 2}"]).connect 0,a,0 x.expect([12,17,48,68]) { i0.send_in 0,:list,nt, 1,2,4,8 } -#if nt!=:int64 -if false - a = FObject["@print"] - a.send_in 0, "3 3 #{nt} # 1 0 0 0" - a.send_in 0, "3 3 3 #{nt} # 1 2 3 4" - a.send_in 0, "base 16" - a.send_in 0, "3 3 3 #{nt} # 255 0 0 0" -end - - (a = FObject["@outer * {3 2 #{nt} # 1 2 3}"]).connect 0,e,0 - b = FObject["@dim"] - c = FObject["@export_list"] + (a = FO["#outer * {3 2 #{nt} # 1 2 3}"]).connect 0,e,0 + b = FO["#dim"] + c = FO["#export_list"] a.connect 0,b,0 y = Expect.new b.connect 0,c,0 @@ -211,29 +197,29 @@ end a.send_in 0,:list,nt, 1, 10 }} #pr=GridPrint.new - (b = FObject["@redim {5 5}"]).connect 0,e,0 - (a = FObject["@convolve * + {#{nt} # 0}"]).connect 0,b,0 - (i0 = FObject["@redim {5 5 1}"]).connect 0,a,0 - (i1 = FObject["@redim {3 1}"]).connect 0,a,1 + (b = FO["#redim {5 5}"]).connect 0,e,0 + (a = FO["#convolve, seed {#{nt} # 0}"]).connect 0,b,0 + (i0 = FO["#redim {5 5 1}"]).connect 0,a,0 + (i1 = FO["#redim {3 1}"]).connect 0,a,1 i1.send_in 1, 3,3 x.expect([5,6,5,4,4,4,6,7,6,4,3,3,6,7,5,4,2,3,6,6,5,4,3,4,5]) { a.send_in 1,:list,3,3,nt,hm, 1,1,1,1,1,1,1,1,1 i0.send_in 0,:list,nt, 1,1,1,0,0,0 } - (a = FObject["@convolve * + {#{nt} # 0}"]).connect 0,e,0 + (a = FO["#convolve, seed {#{nt} # 0}"]).connect 0,e,0 x.expect([1,3,6,4,0]) { a.send_in 1, 1,2,nt,hm, 1,1 a.send_in 0, 1,5,nt,hm, 0,1,2,4,0 } - (a = FObject["@import {4}"]).connect 0,e,0 + (a = FO["#import {4}"]).connect 0,e,0 x.expect([2,3,5,7]) { [2,3,5,7].each {|v| a.send_in 0,v }} x.expect([1,2,3],[4,5,6],[7,8,9]) { a.send_in 1, :list, 3 a.send_in 0, :list, *(1..9).to_a} - for o in ["@store"] - (a = FObject[o]).connect 0,e,0 + for o in ["#store"] + (a = FO[o]).connect 0,e,0 a.send_in 1, 5, 4, nt, hm, 1,2,3,4,5 x.expect([1,2,3,4,4,5,1,2,2,3,4,5]) { a.send_in 0, 3,1, hm, 0,2,4 } @@ -251,109 +237,106 @@ end x.expect([6,7,3,4, 8,11,13,3, 4,17,19,2, 3,4,5,1, 2,3,4,5]) { a.send_in 0 } end - b = FObject["@dim"] - c = FObject["@export_list"] + b = FO["#dim"] + c = FO["#export_list"] a.connect 0,b,0 y = Expect.new b.connect 0,c,0 c.connect 0,y,0 -if nt!=:uint8 and nt!=:float32 and nt!=:float64 and nt!=:int64 - (a = FObject["@for {#{nt} # 0} {#{nt} # 10} {#{nt} # 1}"]).connect 0,e,0 +if nt!=:b and nt!=:f and nt!=:d and nt!=:l + (a = FO["#for {#{nt} # 0} {#{nt} # 10} {#{nt} # 1}"]).connect 0,e,0 a.connect 0,b,0 y.expect([10]) { x.expect((0...10).to_a) { a.send_in 0 } } - (a = FObject["@for {#{nt} # 0} {#{nt} # -10} {#{nt} # 1}"]).connect 0,e,0 + (a = FO["#for {#{nt} # 0} {#{nt} # -10} {#{nt} # 1}"]).connect 0,e,0 a.connect 0,b,0 y.expect([0]) { x.expect([]) { a.send_in 0 } } - (a = FObject["@for {#{nt} # 0} {#{nt} # -10} {#{nt} # -1}"]).connect 0,e,0 + (a = FO["#for {#{nt} # 0} {#{nt} # -10} {#{nt} # -1}"]).connect 0,e,0 a.connect 0,b,0 y.expect([10]) { x.expect([0,-1,-2,-3,-4,-5,-6,-7,-8,-9]) { a.send_in 0 } } - (a = FObject["@for {#{nt} 0} {#{nt} 10} {#{nt} 1}"]).connect 0,e,0 + (a = FO["#for {#{nt} 0} {#{nt} 10} {#{nt} 1}"]).connect 0,e,0 a.connect 0,b,0 y.expect([10,1]) { x.expect((0...10).to_a) { a.send_in 0 } } - (a = FObject["@for {#{nt} 2 3} {#{nt} 5 7} {#{nt} 1 1}"]).connect 0,e,0 + (a = FO["#for {#{nt} 2 3} {#{nt} 5 7} {#{nt} 1 1}"]).connect 0,e,0 a.connect 0,b,0 y.expect([3,4,2]) { x.expect([2,3,2,4,2,5,2,6,3,3,3,4,3,5,3,6,4,3,4,4,4,5,4,6]) { a.send_in 0 } } end - (a = FObject["@complex_sq"]).connect 0,e,0 + (a = FO["@complex_sq"]).connect 0,e,0 x.expect([8,0]) { a.send_in 0, 2, 2 } x.expect([0,9]) { a.send_in 0, 0, 3 } - (a = FObject["@rotate 3000 {1 2 5}"]).connect 0,e,0 -# pr = GridPrint.new -# a.connect 0,pr,0 -# x.expect([]) { + (a = FO["#rotate 3000 {1 2 5}"]).connect 0,e,0 a.send_in 0, "5 5 # 1000 0 0 0 0 0" -# } -#if nt==:float32 or nt==:float64 -# (a = FObject["@matrix_solve"]).connect 0,e,0 +#if nt==:f or nt==:d +# (a = FO["@matrix_solve"]).connect 0,e,0 # x.expect([1,0,0,0,1,0,0,0,1]) { a.send_in 0, 3, 3, nt, hm, 1,0,0,0,1,0,0,0,1 } #end GridFlow.gfpost "ending test for #{nt}" end # for nt - (a = FObject["@two"]).connect 0,e,0 + (a = FO["#pack 2"]).connect 0,e,0 x.expect([42,0]) { a.send_in 0,42 } x.expect([42,28]) { a.send_in 1,28 } x.expect([1313,28]) { a.send_in 0,1313 } - (a = FObject["@three"]).connect 0,e,0 + (a = FO["#pack 3"]).connect 0,e,0 x.expect([42,0,0]) { a.send_in 0,42 } x.expect([42,28,0]) { a.send_in 1,28 } x.expect([42,28,-1]) { a.send_in 2,-1 } - (a = FObject["@four"]).connect 0,e,0 + (a = FO["#pack 4"]).connect 0,e,0 x.expect([42,0,0,0]) { a.send_in 0,42 } x.expect([42,0,0,-42]) { a.send_in 3,-42 } -# glob = FObject["@global"] -# glob.send_in 0, "profiler_dump" + (a = FO["#pack 5"]).connect 0,e,0 + x.expect([3.5,0,0,0]) { a.send_in 0,3.5 } + x.expect([3.5,0,0,-3.5]) { a.send_in 3,-3.5 } - e = FObject["@export_list"] + e = FO["#export_list"] e.connect 0,x,0 - a = FObject["@import per_message"] + a = FO["#import per_message"] a.connect 0,e,0 x.expect([1,2,3]) { a.send_in 0,1,2,3 } x.expect([102,111,111]) { a.send_in 0,:symbol,:foo } x.expect([ 70, 79, 79]) { a.send_in 0,:symbol,:FOO } - a = FObject["@join 1"] + a = FO["@join 1"] a.connect 0,e,0 a.send_in 1,2,2,nt,hm,11,13,17,19 x.expect([2,3,11,13,5,7,17,19]) { a.send_in 0,2,2,nt,hm,2,3,5,7 } -if nt!=:float64; #!@#$ +if nt!=:d a.send_in 1, 5,1,nt,hm,42 y.expect([5,4]) { x.expect([2,3,5,42,7,11,13,42,17,19,23,42,29,31,37,42,41,43,47,42]) { a.send_in 0, 5,3,nt,hm,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47 }} end - a = FObject["@join 0"] + a = FO["@join 0"] a.connect 0,e,0 a.send_in 1,2,2,nt,hm,11,13,17,19 x.expect([2,3,5,7,11,13,17,19]) { a.send_in 0,2,2,nt,hm,2,3,5,7 } - a = FObject["@join 0 {2 2 2 #{nt} # 1 2 3}"] + a = FO["@join 0 {2 2 2 #{nt} # 1 2 3}"] a.connect 0,e,0 a.connect 0,b,0 y.expect([2,2,2]) { x.expect([1,2,3,1,2,3,1,2]) { a.send_in 0,0,2,2,nt,hm }} - a = FObject["@ravel"] - b = FObject["@dim"] - be = FObject["@export_list"] + a = FO["#ravel"] + b = FO["#dim"] + be = FO["#export_list"] bx = Expect.new a.connect 0,e,0 a.connect 0,b,0 @@ -361,28 +344,28 @@ end be.connect 0,bx,0 bx.expect([9]) { x.expect([1,2,3,2,4,6,3,6,9]) { - o = FObject["@outer *"] + o = FO["#outer *"] o.connect 0,a,0 o.send_in 1,1,2,3 o.send_in 0,1,2,3 } } - a = FObject["@grade"] + a = FO["#grade"] a.connect 0,e,0 x.expect([0,2,4,6,8,9,7,5,3,1]) { a.send_in 0, 0,9,1,8,2,7,3,6,4,5 } x.expect([0,9,1,8,2,7,3,6,4,5]) { a.send_in 0, 0,2,4,6,8,9,7,5,3,1 } x.expect([7,6,5,4,3,2,1,0]) { a.send_in 0, 7,6,5,4,3,2,1,0 } - a = FObject["@grade"] - b = FObject["@fold +"] + a = FO["#grade"] + b = FO["#fold +"] a.connect 0,b,0 b.connect 0,e,0 x.expect([100*99/2]) { a.send_in 0, (0...100).map { (rand*0x10000).to_i }} x.expect([100*99/2]) { a.send_in 0, (0...100).map { (rand*0x10).to_i }} x.expect([100*99/2]) { a.send_in 0, (0...100).map { 0 }} - a = FObject["@perspective"] + a = FO["#perspective"] a.connect 0,e,0 c = [] 8.times {|v| @@ -396,12 +379,12 @@ end a.send_in 0, 8,3,hm,*c } # regressiontests for past bugs - a = FObject["@inner"] # that's it. + a = FO["#inner"] # that's it. end def test_rtmetro - rt = FObject["rtmetro 1000"] - pr = FObject["rubyprint"] + rt = FO["rtmetro 1000"] + pr = FO["rubyprint"] rt.connect 0,pr,0 GridFlow.post "trying to start the rtmetro" rt.send_in 0,1 @@ -413,8 +396,8 @@ def test_rtmetro end def test_print - i = FObject["@redim {3}"] - pr = FObject["@print"] + i = FO["#redim {3}"] + pr = FO["#print"] # pr = GridFlow::RubyPrint.new i.connect 0,pr,0 i.send_in 0, 85, 170, 255 @@ -433,11 +416,11 @@ class Barf < GridObject end def test_nonsense -# (a = FObject["@! abs"]).connect 0,e,0 +# (a = FO["@! abs"]).connect 0,e,0 # x.expect_error { # a.send_in 1, 42,42 } - a = FObject["@import {3}"] + a = FO["#import {3}"] b = Barf.new a.connect 0,b,0 begin @@ -451,20 +434,20 @@ def test_nonsense end def test_store - a = FObject["@in file #{$imdir}/teapot.png"] - b = FObject["@store"] - c = FObject["@out x11"] + a = FO["#in file #{$imdir}/teapot.png"] + b = FO["#store"] + c = FO["#out x11"] a.connect 0,b,1 a.send_in 0,"cast uint8" a.send_in 0 b.connect 0,c,0 - d = FObject["@for {0 0} {256 256} {1 1}"] - e = FObject["@ ^ 85"] + d = FO["#for {0 0} {256 256} {1 1}"] + e = FO["# ^ 85"] d.connect 0,e,0 e.connect 0,b,0 - f = FObject["fps detailed"] + f = FO["fps detailed"] c.connect 0,f,0 - pr = FObject["rubyprint"] + pr = FO["rubyprint"] f.connect 0,pr,0 GridFlow.verbose = false 256.times {|t| @@ -475,8 +458,8 @@ end # generates recursive checkerboard pattern (munchies) in bluish colours. class Munchies < FPatcher - @fobjects = ["fork","fork","@for 0 64 1","@for 0 64 1","@for 2 5 1", - "@outer ^","@outer *"] + @FOs = ["fork","fork","#for 0 64 1","#for 0 64 1","#for 2 5 1", + "#outer ^","#outer *"] @wires = [-1,0,0,0, 0,0,1,0, 1,1,4,0, 4,0,6,1, 1,0,3,0, 3,0,5,1, 0,0,2,0, 2,0,5,0, 5,0,6,0, 6,0,-1,0 ] def initialize() super end @@ -485,15 +468,15 @@ end def test_munchies m=Munchies.new - gout = FObject["@out quartz"] + gout = FO["#out window"] m.connect 0,gout,0 m.send_in 0 $mainloop.loop end def test_image command - gin = FObject["@in"] - gout = FObject["@out x11"] + gin = FO["#in"] + gout = FO["#out window"] gin.connect 0,gout,0 # 31.times { 3.times { @@ -501,17 +484,17 @@ def test_image command gout.send_in 0,"timelog 1" gin.send_in 0 } - FObject["@global"].send_in 0, "profiler_dump" + FO["#global"].send_in 0, "profiler_dump" $mainloop.loop end def test_ppm2 - gin = FObject["@in"] - store = FObject["@store"] - pa = FObject["@convolve << + 0"] - pb = FObject["@ / 9"] - ra = FObject["@redim {3 3}"] - gout = FObject["@out x11"] + gin = FO["#in"] + store = FO["#store"] + pa = FO["#convolve << + 0"] + pb = FO["# / 9"] + ra = FO["#redim {3 3}"] + gout = FO["#out window"] gin.connect 0,store,1 store.connect 0,pa,0 pa.connect 0,pb,0 @@ -524,16 +507,16 @@ def test_ppm2 gin.send_in 0 # 40.times { store.send_in 0 } loop { store.send_in 0 } - v4j = FObject["@global"] + v4j = FO["#global"] v4j.send_in 0,"profiler_dump" # $mainloop.loop end def test_foo - foo = FObject["@for {0 0} {64 64} {1 1}"] - che = FObject["@checkers"] - sca = FObject["@scale_by {5 3}"] - out = FObject["@out x11"] + foo = FO["#for {0 0} {64 64} {1 1}"] + che = FO["#checkers"] + sca = FO["#scale_by {5 3}"] + out = FO["#out window"] foo.connect 0,che,0 che.connect 0,sca,0 sca.connect 0,out,0 @@ -543,43 +526,42 @@ end def test_anim(*msgs) GridFlow.verbose = false - gin = FObject["@in"] - #gout1 = FObject["@out x11"] - gout1 = FObject["@out sdl"] - #gout1 = FObject["@out quicktime file test.mov"] + gin = FO["#in"] + gout1 = FO["#out window"] + #gout1 = FO["@out quicktime file test.mov"] #gout1.send_in 0, :codec, :jpeg - fps = FObject["fps detailed"] - rpr = FObject["rubyprint"] + fps = FO["fps detailed"] + rpr = FO["rubyprint"] gout1.connect 0,fps,0 #fps.connect 0,rpr,0 =begin - gout1 = FObject["@downscale_by {3 2}"] - gout2 = FObject["@rgb_to_greyscale"] - gout3 = FObject["@out aalib X11 -height 60 -width 132"] + gout1 = FO["#downscale_by {3 2}"] + gout2 = FO["#rgb_to_greyscale"] + gout3 = FO["#out aalib X11 -height 60 -width 132"] gout1.connect 0,gout2,0 gout2.connect 0,gout3,0 =end - rpr = FObject["rubyprint"] + rpr = FO["rubyprint"] # gin.connect 1,rpr,0 gin.connect 0,gout1,0 =begin - layer=FObject["@layer"] + layer=FO["@layer"] gin.connect 0,layer,0 layer.connect 0,gout1,0 - check=FObject["@checkers"] - phor=FObject["@for {0 0} {256 256} {1 1}"] + check=FO["@checkers"] + phor=FO["@for {0 0} {256 256} {1 1}"] phor.connect 0,check,0 check.connect 0,layer,1 phor.send_in 0 =end -# scale = FObject["@scale_by 3"] +# scale = FO["@scale_by 3"] # gin.connect 0,scale,0 # scale.connect 0,gout1,0 -# pr = FObject["rubyprint time"]; gout.connect 0,pr,0 +# pr = FO["rubyprint time"]; gout.connect 0,pr,0 msgs.each {|m| gin.send_in 0,m } gin.send_in 0, "cast uint8" # gout.send_in 0,"timelog 1" @@ -591,7 +573,7 @@ def test_anim(*msgs) #gin.send_in 0, rand(1000) } # loop { gin.send_in 0 } -# metro = FObject["rtmetro 80"] +# metro = FO["rtmetro 80"] # metro.connect 0,gin,0 # metro.send_in 0,1 # $mainloop.loop @@ -601,11 +583,11 @@ def test_anim(*msgs) frames, d, 1000*d/frames, frames/d # global.send_in 0,"dfgdfgdkfjgl" gout1.send_in 0, :close - global = FObject["@global"] + global = FO["@global"] global.send_in 0,"profiler_dump" end -class TestTCP < FObject +class TestTCP < FO attr_accessor :idle def initialize @idle = true @@ -624,8 +606,8 @@ def test_tcp if fork # client (is receiving) GridFlow.post_header = "[client] " - $in_client = in1 = FObject["@in"] - out = FObject["@out x11"] + $in_client = in1 = FO["@in"] + out = FO["@out x11"] in1.connect 0,out,0 out.send_in 0,"timelog 1" out.send_in 0,"autodraw 2" @@ -646,9 +628,9 @@ def test_tcp else # server (is sending) GridFlow.post_header = "[server] " - $in1_server = in1 = FObject["@in"] - $in2_server = in2 = FObject["@in"] - $out = out = FObject["@out"] + $in1_server = in1 = FO["@in"] + $in2_server = in2 = FO["@in"] + $out = out = FO["@out"] toggle = 0 in1.connect 0,out,0 in2.connect 0,out,0 @@ -656,7 +638,7 @@ def test_tcp in2.send_in 0,"open #{$imdir}/b001.jpg" out.send_in 0,"open grid tcpserver #{$port}" out.send_in 0,"type uint8" - test_tcp = GridFlow::FObject.new + test_tcp = GridFlow::FO.new def test_tcp._0_bang # GridFlow.post "tick" @toggle ||= 0 @@ -678,22 +660,22 @@ end def test_layer - gin = FObject["@in png file ShaunaKennedy/atmosphere-bleu.png"] -# gin1 = FObject["@in file #{$imdir}/r001.jpg"] -# gin = FObject["@join 2 {240 320 1 # 128}"] + gin = FO["@in png file ShaunaKennedy/atmosphere-bleu.png"] +# gin1 = FO["@in file #{$imdir}/r001.jpg"] +# gin = FO["@join 2 {240 320 1 # 128}"] # gin1.connect 0,gin,0 -# gfor = FObject["@for {0 0} {120 160} {1 1}"] -# gfor = FObject["@for {0 0} {240 320} {1 1}"] - gfor = FObject["@for {0 0} {480 640} {1 1}"] - gche = FObject["@checkers"] +# gfor = FO["@for {0 0} {120 160} {1 1}"] +# gfor = FO["@for {0 0} {240 320} {1 1}"] + gfor = FO["@for {0 0} {480 640} {1 1}"] + gche = FO["@checkers"] - gove = FObject["@layer"] -# gove = FObject["@fold + {0 0 0 0}"] -# gout = FObject["@print"] -# gove = FObject["@inner2 * + 0 {3 4 # 1 0 0 0 0}"] -# gout = FObject["@out sdl"] - gout = FObject["@out x11"] + gove = FO["@layer"] +# gove = FO["@fold + {0 0 0 0}"] +# gout = FO["@print"] +# gove = FO["@inner2 * + 0 {3 4 # 1 0 0 0 0}"] +# gout = FO["@out sdl"] + gout = FO["@out x11"] gin.connect 0,gove,0 gfor.connect 0,gche,0 @@ -702,8 +684,8 @@ def test_layer gfor.send_in 0 - fps = FObject["fps detailed"] - pr = FObject["rubyprint"] + fps = FO["fps detailed"] + pr = FO["rubyprint"] gout.connect 0,fps,0 fps.connect 0,pr,0 @@ -715,20 +697,17 @@ end Images = [ "png file opensource.png", -# "png file ShaunaKennedy/atmosphere.png", -# "targa file #{$imdir}/tux.tga", -# "png file #{$imdir}/lena.png", - "file #{$imdir}/ruby0216.jpg", - "file #{$imdir}/g001.jpg", - "file #{$imdir}/teapot.tga", + "#{$imdir}/ruby0216.jpg", + "#{$imdir}/g001.jpg", +# "#{$imdir}/teapot.tga", "grid gzfile #{$imdir}/foo.grid.gz", "grid gzfile #{$imdir}/foo2.grid.gz", # "videodev /dev/video0", ] def test_formats_speed - gin = FObject["@in"] - gout = FObject["@out x11"] + gin = FO["@in"] + gout = FO["@out x11"] gin.connect 0,gout,0 GridFlow.verbose=false t1=[] @@ -743,14 +722,15 @@ def test_formats_speed end def test_formats - gin = FObject["@in"] - gout = FObject["@out window"] - gs = FObject["@ + {int16 # 0}"] + gin = FO["@in"] + gout = FO["@out window"] + gs = FO["@ + {int16 # 0}"] gin.connect 0,gs,0 gs.connect 0,gout,0 # GridFlow.verbose=false t1=[] Images.each {|command| + GridFlow.post "SENDING open %s", command gin.send_in 0,"open #{command}" gin.send_in 0,"cast int16" # test for load, rewind, load @@ -763,10 +743,10 @@ def test_formats end def test_rewind - gin = FObject["@in videodev /dev/video1 noinit"] + gin = FO["@in videodev /dev/video1 noinit"] gin.send_in 0, "transfer read" - gout = FObject["@out ppm file /tmp/foo.ppm"] -# gout = FObject["@out x11"] + gout = FO["@out ppm file /tmp/foo.ppm"] +# gout = FO["@out x11"] gin.connect 0,gout,0 loop { gin.send_in 0 @@ -776,15 +756,15 @@ end def test_formats_write # read files, store and save them, reload, compare, expect identical - a = FObject["@in"] - b = FObject["@out"]; a.connect 0,b,0 - c = FObject["@ -"]; a.connect 0,c,1 - d = FObject["@in"]; d.connect 0,c,0 - e = FObject["@fold +"]; c.connect 0,e,0 - f = FObject["@fold +"]; e.connect 0,f,0 - g = FObject["@fold +"]; f.connect 0,g,0 - h = FObject["@ / 15000"]; g.connect 0,h,0 - i = FObject["@export_list"]; h.connect 0,i,0 + a = FO["@in"] + b = FO["@out"]; a.connect 0,b,0 + c = FO["@ -"]; a.connect 0,c,1 + d = FO["@in"]; d.connect 0,c,0 + e = FO["@fold +"]; c.connect 0,e,0 + f = FO["@fold +"]; e.connect 0,f,0 + g = FO["@fold +"]; f.connect 0,g,0 + h = FO["@ / 15000"]; g.connect 0,h,0 + i = FO["@export_list"]; h.connect 0,i,0 x = Expect.new; i.connect 0,x,0 [ ["ppm file", "#{$imdir}/g001.jpg"], @@ -807,21 +787,21 @@ def test_formats_write end def test_mpeg_write - a = FObject["@in ppm file /opt/mex/r.ppm.cat"] - b = FObject["@out x11"] + a = FO["@in ppm file /opt/mex/r.ppm.cat"] + b = FO["@out x11"] a.connect 0,b,0 loop{a.send_in 0} end def test_headerless - gout = FObject["@out"] + gout = FO["@out"] gout.send_in 0, "open grid file #{$imdir}/hello.txt" gout.send_in 0, "headerless" gout.send_in 0, "type uint8" gout.send_in 0, "104 101 108 108 111 32 119 111 114 108 100 33 10" gout.send_in 0, "close" - gin = FObject["@in"] - pr = FObject["@print"] + gin = FO["@in"] + pr = FO["@print"] gin.connect 0,pr,0 gin.send_in 0, "open grid file #{$imdir}/hello.txt" gin.send_in 0, "headerless 13" @@ -831,14 +811,14 @@ end def test_sound -# o2 = FObject["@ * 359"] # @ 439.775 Hz -# o1 = FObject["@for 0 44100 1"] # 1 sec @ 1.225 Hz ? - o1 = FObject["@for 0 4500 1"] - o2 = FObject["@ * 1600"] # @ 439.775 Hz - o3 = FObject["@ sin* 255"] - o4 = FObject["@ gamma 400"] - o5 = FObject["@ << 7"] - out = FObject["@out"] +# o2 = FO["@ * 359"] # @ 439.775 Hz +# o1 = FO["@for 0 44100 1"] # 1 sec @ 1.225 Hz ? + o1 = FO["@for 0 4500 1"] + o2 = FO["@ * 1600"] # @ 439.775 Hz + o3 = FO["@ sin* 255"] + o4 = FO["@ gamma 400"] + o5 = FO["@ << 7"] + out = FO["@out"] o1.connect 0,o2,0 o2.connect 0,o3,0 o3.connect 0,o4,0 @@ -857,29 +837,29 @@ end include Math def test_polygon - o1 = FObject["@for 0 5 1"] - o2 = FObject["@ * 14400"] - o3 = FObject["@outer + {0 9000}"] - o4 = FObject["@ +"] - o5 = FObject["@ cos* 112"] - o6 = FObject["@ + {120 160}"] - poly = FObject["@draw_polygon + {3 uint8 # 255}"] + o1 = FO["@for 0 5 1"] + o2 = FO["@ * 14400"] + o3 = FO["@outer + {0 9000}"] + o4 = FO["@ +"] + o5 = FO["@ cos* 112"] + o6 = FO["@ + {120 160}"] + poly = FO["@draw_polygon + {3 uint8 # 255}"] if false - out1 = FObject["@cast int32"] - out2 = FObject["@solarize"] -# out1 = FObject["@downscale_by 2 smoothly"] - out3 = FObject["@out x11"] + out1 = FO["@cast int32"] + out2 = FO["@solarize"] +# out1 = FO["@downscale_by 2 smoothly"] + out3 = FO["@out x11"] out1.connect 0,out2,0 out2.connect 0,out3,0 else - out1 = FObject["@out x11"] - fps = FObject["fps detailed cpu"] + out1 = FO["@out x11"] + fps = FO["fps detailed cpu"] out1.connect 0,fps,0 - pr = FObject["rubyprint"] + pr = FO["rubyprint"] fps.connect 0,pr,0 end - store = FObject["@store"]; store.send_in 1, "240 320 3 uint8 # 0" -# store2 = FObject["@store"] + store = FO["@store"]; store.send_in 1, "240 320 3 uint8 # 0" +# store2 = FO["@store"] store.connect 0,poly,0 poly.connect 0,store,1 # store2.connect 0,store,1 @@ -889,7 +869,7 @@ end o4.connect 0,o5,0 o5.connect 0,o6,0 o6.connect 0,poly,2 -# cast = FObject["@cast int32"] +# cast = FO["@cast int32"] # poly.connect 0,cast,0 # cast.connect 0,out1,0 poly.connect 0,out1,0 @@ -910,7 +890,7 @@ end $mainloop.loop end -class FRoute2 < FObject +class FRoute2 < FO def initialize(selector) @selector = selector.to_s end @@ -924,15 +904,15 @@ class FRoute2 < FObject end def test_aalib -# gin = FObject["@in ppm file #{$imdir}/r001.jpg"] - gin = FObject["@in ppm file #{$animdir}/b.jpg.cat"] - grey = FObject["@rgb_to_greyscale"] - cont = FObject["@ << 1"] - clip = FObject["@ min 255"] - gout = FObject["@out aalib X11"] - sto = FObject["@store"] - op = FObject["aa_fill_with_text {localhost 4242}"] - filt = FObject["route2 grid"] +# gin = FO["@in ppm file #{$imdir}/r001.jpg"] + gin = FO["@in ppm file #{$animdir}/b.jpg.cat"] + grey = FO["@rgb_to_greyscale"] + cont = FO["@ << 1"] + clip = FO["@ min 255"] + gout = FO["@out aalib X11"] + sto = FO["@store"] + op = FO["aa_fill_with_text {localhost 4242}"] + filt = FO["route2 grid"] gin.connect 0,grey,0 grey.connect 0,cont,0 cont.connect 0,clip,0 @@ -956,14 +936,14 @@ end def test_store2 o = [ - FObject["@for {0 0} {240 320} {1 1}"], - FObject["@ / 2"], - FObject["@ + 0"], - FObject["@ + 0"], - FObject["@store"], - FObject["@out x11"]] + FO["@for {0 0} {240 320} {1 1}"], + FO["@ / 2"], + FO["@ + 0"], + FO["@ + 0"], + FO["@store"], + FO["@out x11"]] (0..4).each {|x| o[x].connect 0,o[x+1],0 } - q = FObject["@in ppm file images/r001.jpg"] + q = FO["@in ppm file images/r001.jpg"] q.connect 0,o[4],1 q.send_in 0 o[0].send_in 0 @@ -971,12 +951,12 @@ def test_store2 end def test_remap - rem = FObject["@remap_image"] - rot = FObject["@rotate 4000"] + rem = FO["@remap_image"] + rot = FO["@rotate 4000"] rem.connect 1,rot,0 rot.connect 0,rem,1 - gin = FObject["@in ppm file #{$imdir}/teapot.png"] - gout = FObject["@out x11"] + gin = FO["@in ppm file #{$imdir}/teapot.png"] + gout = FO["@out x11"] gin.connect 0,rem,0 rem.connect 0,gout,0 gin.send_in 0 @@ -985,15 +965,15 @@ end def test_asm GridFlow.verbose=false - a = FObject["@in ppm file images/r001.jpg"] - aa = FObject["@cast uint8"] - b = FObject["@store"] - d = FObject["@store"] + a = FO["@in ppm file images/r001.jpg"] + aa = FO["@cast uint8"] + b = FO["@store"] + d = FO["@store"] a.connect 0,aa,0 aa.connect 0,b,1 aa.connect 0,d,1 a.send_in 0 - c = FObject["@ + {uint8 # 0}"] + c = FO["@ + {uint8 # 0}"] t0 = Time.new; 1000.times {b.send_in 0}; t1 = Time.new-t0 t1 *= 1 b.connect 0,c,0 @@ -1021,17 +1001,17 @@ def test_metro end def test_outer - o = FObject["@outer + {0}"] + o = FO["@outer + {0}"] o.send_in 0, 25, 240, 320, 3, "#".intern, 42 - g = FObject["@global"] + g = FO["@global"] g.send_in 0, :profiler_dump end def test_jmax_to_pd filename require "gridflow/extra/jmax_format.rb" require "gridflow/extra/puredata_format.rb" - jfr = JMaxFileReader.new(File.open(filename),FObject) - FObject.broken_ok = true + jfr = JMaxFileReader.new(File.open(filename),FO) + FO.broken_ok = true my_patcher = jfr.parse # my_patcher.subobjects.each {|x,| x.trigger if LoadBang===x } # $mainloop.loop @@ -1045,7 +1025,7 @@ def test_jmax_to_pd filename end def test_error - x = FObject["@store"] + x = FO["@store"] x.send_in 0 end @@ -1084,3 +1064,11 @@ end #test_sound #test_metro #$mainloop.loop + +=begin +a = FO["@print"] +a.send_in 0, "3 3 #{nt} # 1 0 0 0" +a.send_in 0, "3 3 3 #{nt} # 1 2 3 4" +a.send_in 0, "base 16" +a.send_in 0, "3 3 3 #{nt} # 255 0 0 0" +=end diff --git a/externals/gridflow/bridge/placebo.rb b/externals/gridflow/bridge/placebo.rb index 3d712d1d..b52e196e 100644 --- a/externals/gridflow/bridge/placebo.rb +++ b/externals/gridflow/bridge/placebo.rb @@ -1,5 +1,5 @@ =begin - $Id: placebo.rb,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: placebo.rb,v 1.2 2006-03-15 04:38:20 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard @@ -23,7 +23,9 @@ class Object def self.dummy(sel) - self.module_eval "def #{sel}(*args) GridFlow.post \"dummy #{sel}: %s\", args.inspect end" + self.module_eval "def #{sel}(*args) + #GridFlow.post \"dummy #{sel}: %s\", args.inspect + end" end end @@ -36,6 +38,7 @@ module GridFlow class Clock def initialize(victim) @victim=victim end dummy :delay + dummy :unset end class Pointer dummy :initialize diff --git a/externals/gridflow/bridge/puredata.c b/externals/gridflow/bridge/puredata.c index dd6fd88f..1109b59c 100644 --- a/externals/gridflow/bridge/puredata.c +++ b/externals/gridflow/bridge/puredata.c @@ -1,5 +1,5 @@ /* - $Id: puredata.c,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: puredata.c,v 1.2 2006-03-15 04:38:20 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard @@ -43,6 +43,9 @@ tries to call a Ruby method of the proper name. #include <unistd.h> #include "g_canvas.h" +#define CObject_free CObject_freeee +#define gfpost post + /* **************************************************************** */ struct BFObject; struct FMessage { @@ -61,11 +64,11 @@ static const char *rb_sym_name(Ruby sym) {return rb_id2name(SYM2ID(sym));} static BuiltinSymbols *syms; -void CObject_freeee (void *victim) { +void CObject_free (void *victim) { CObject *self = (CObject *)victim; self->check_magic(); if (!self->rself) { - fprintf(stderr,"attempt to free object that has no rself\n"); + L fprintf(stderr,"attempt to free object that has no rself\n"); abort(); } self->rself = 0; /* paranoia */ @@ -81,7 +84,7 @@ static Ruby mPointer=0; \class Pointer < CObject struct Pointer : CObject { void *p; - Pointer() { assert(!"DYING HORRIBLY"); } + Pointer() { assert(!"DYING HORRIBLY (GASP)"); } Pointer(void *_p) : p(_p) {} \decl Ruby ptr (); }; @@ -94,7 +97,10 @@ struct Pointer : CObject { );} \end class Pointer Ruby Pointer_s_new (void *ptr) { - return Data_Wrap_Struct(EVAL("GridFlow::Pointer"), 0, 0, new Pointer(ptr)); + Pointer *self = new Pointer(ptr); + Ruby rself = Data_Wrap_Struct(EVAL("GridFlow::Pointer"), 0, CObject_free, self); + self->rself = rself; + return rself; } void *Pointer_get (Ruby rself) { DGS(Pointer); @@ -129,18 +135,13 @@ static int noutlets_of (Ruby qlass) { #endif extern "C" void Init_stack(VALUE *addr); static VALUE *localize_sysstack () { - long bp; - sscanf(RUBY_STACK_END,"0x%08lx",&bp); - //fprintf(stderr,"old RUBY_STACK_END = %08lx\n",bp); + long bp0,bp1; + sscanf(STACK_END,"0x%08lx",&bp0); // HACK (2004.08.29: alx has a problem; i hope it doesn't get worse) - // this rounds to the last word of a 4k block - // cross fingers that no other OS does it too different - // !@#$ doesn't use STACK_GROW_DIRECTION - // bp=((bp+0xfff)&~0xfff)-sizeof(void*); - // GAAAH - bp=((bp+0xffff)&~0xffff)-sizeof(void*); - //fprintf(stderr,"new RUBY_STACK_END = %08lx\n",bp); - return (VALUE *)bp; + // this rounds to the last word of a 64k block (bug: doesn't use STACK_GROW_DIRECTION) + bp1=((bp0+0xffff)&~0xffff)-sizeof(void*); + fprintf(stderr,"STACK_END old=0x%08lx; new=0x%08lx\n",bp0,bp1); + return (VALUE *)bp1; } //**************************************************************** @@ -312,7 +313,7 @@ static void BFObject_delete_1 (FMessage *fm) { if (fm->self->rself) { rb_funcall(fm->self->rself,SI(delete),0); } else { - post("BFObject_delete is NOT handling BROKEN object at %08x",(int)fm); + post("BFObject_delete is NOT handling BROKEN object at %*lx",2*sizeof(long),(long)fm); } } @@ -652,7 +653,7 @@ struct Clock : CObject { void Clock_fn (Ruby rself) { rb_funcall_myrescue(rself,SI(call),0); } void Clock_mark (Clock *self) { rb_gc_mark(self->owner); } -void Clock_free (Clock *self) { clock_free(self->serf); CObject_freeee(self); } +void Clock_free (Clock *self) { clock_free(self->serf); CObject_free(self); } Ruby Clock_s_new (Ruby qlass, Ruby owner) { Clock *self = new Clock(); diff --git a/externals/gridflow/bridge/puredata.rb b/externals/gridflow/bridge/puredata.rb index fffda1c2..184bb2a7 100644 --- a/externals/gridflow/bridge/puredata.rb +++ b/externals/gridflow/bridge/puredata.rb @@ -1,5 +1,5 @@ =begin - $Id: puredata.rb,v 1.1 2005-10-04 02:02:13 matju Exp $ + $Id: puredata.rb,v 1.2 2006-03-15 04:38:20 matju Exp $ GridFlow Copyright (c) 2001,2002 by Mathieu Bouchard diff --git a/externals/gridflow/bundled/pd/g_canvas.h b/externals/gridflow/bundled/pd/g_canvas.h index 45bcd4a9..07fa75b5 100644 --- a/externals/gridflow/bundled/pd/g_canvas.h +++ b/externals/gridflow/bundled/pd/g_canvas.h @@ -1,3 +1,4 @@ + /* Copyright (c) 1997-1999 Miller Puckette. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ @@ -36,12 +37,17 @@ glist has its own window, even if miniaturized. /* NOTE: this file describes Pd implementation details which may change in future releases. The public (stable) API is in m_pd.h. */ +#ifndef __G_CANVAS_H +#define __G_CANVAS_H +#ifndef DESIRE + #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) extern "C" { #endif + /* --------------------- geometry ---------------------------- */ -#define IOWIDTH 7 /* width of an inlet/outlet in pixels */ +#define IOWIDTH 7 /* width of an inlet/outlet in pixels */ #define IOMIDDLE ((IOWIDTH-1)/2) #define GLIST_DEFGRAPHWIDTH 200 #define GLIST_DEFGRAPHHEIGHT 140 @@ -50,17 +56,21 @@ extern "C" { typedef struct _updateheader { struct _updateheader *upd_next; - unsigned int upd_array:1; /* true if array, false if glist */ - unsigned int upd_queued:1; /* true if we're queued */ + unsigned int upd_array:1; /* true if array, false if glist */ + unsigned int upd_queued:1; /* true if we're queued */ } t_updateheader; /* types to support glists grabbing mouse motion or keys from parent */ typedef void (*t_glistmotionfn)(void *z, t_floatarg dx, t_floatarg dy); typedef void (*t_glistkeyfn)(void *z, t_floatarg key); +#endif /*DESIRE*/ + EXTERN_STRUCT _rtext; #define t_rtext struct _rtext +#ifndef DESIRE + EXTERN_STRUCT _gtemplate; #define t_gtemplate struct _gtemplate @@ -73,6 +83,9 @@ EXTERN_STRUCT _tscalar; EXTERN_STRUCT _canvasenvironment; #define t_canvasenvironment struct _canvasenvironment +EXTERN_STRUCT _fielddesc; +#define t_fielddesc struct _fielddesc + typedef struct _selection { t_gobj *sel_what; @@ -82,22 +95,22 @@ typedef struct _selection /* this structure is instantiated whenever a glist becomes visible. */ typedef struct _editor { - t_updateheader e_upd; /* update header structure */ - t_selection *e_updlist; /* list of objects to update */ - t_rtext *e_rtext; /* text responder linked list */ - t_selection *e_selection; /* head of the selection list */ - t_rtext *e_textedfor; /* the rtext if any that we are editing */ - t_gobj *e_grab; /* object being "dragged" */ + t_updateheader e_upd; /* update header structure */ + t_selection *e_updlist; /* list of objects to update */ + t_rtext *e_rtext; /* text responder linked list */ + t_selection *e_selection; /* head of the selection list */ + t_rtext *e_textedfor; /* the rtext if any that we are editing */ + t_gobj *e_grab; /* object being "dragged" */ t_glistmotionfn e_motionfn; /* ... motion callback */ - t_glistkeyfn e_keyfn; /* ... keypress callback */ - t_binbuf *e_connectbuf; /* connections to deleted objects */ - t_binbuf *e_deleted; /* last stuff we deleted */ + t_glistkeyfn e_keyfn; /* ... keypress callback */ + t_binbuf *e_connectbuf; /* connections to deleted objects */ + t_binbuf *e_deleted; /* last stuff we deleted */ t_guiconnect *e_guiconnect; /* GUI connection for filtering messages */ - struct _glist *e_glist; /* glist which owns this */ - int e_xwas; /* xpos on last mousedown or motion event */ - int e_ywas; /* ypos, similarly */ - int e_selectline_index1; /* indices for the selected line if any */ - int e_selectline_outno; /* (only valid if e_selectedline is set) */ + struct _glist *e_glist; /* glist which owns this */ + int e_xwas; /* xpos on last mousedown or motion event */ + int e_ywas; /* ypos, similarly */ + int e_selectline_index1; /* indices for the selected line if any */ + int e_selectline_outno; /* (only valid if e_selectedline is set) */ int e_selectline_index2; int e_selectline_inno; t_outconnect *e_selectline_tag; @@ -107,12 +120,12 @@ typedef struct _editor unsigned int e_selectedline: 1; /* one if a line is selected */ } t_editor; -#define MA_NONE 0 /* e_onmotion: do nothing on mouse motion */ -#define MA_MOVE 1 /* drag the selection around */ -#define MA_CONNECT 2 /* make a connection */ -#define MA_REGION 3 /* selection region */ -#define MA_PASSOUT 4 /* send on to e_grab */ -#define MA_DRAGTEXT 5 /* drag in text editor to alter selection */ +#define MA_NONE 0 /* e_onmotion: do nothing on mouse motion */ +#define MA_MOVE 1 /* drag the selection around */ +#define MA_CONNECT 2 /* make a connection */ +#define MA_REGION 3 /* selection region */ +#define MA_PASSOUT 4 /* send on to e_grab */ +#define MA_DRAGTEXT 5 /* drag in text editor to alter selection */ /* editor structure for "garrays". We don't bother to delete and regenerate this structure when the "garray" becomes invisible or visible, although we @@ -120,17 +133,17 @@ could do so if the structure gets big (like the "editor" above.) */ typedef struct _arrayvis { - t_updateheader av_upd; /* update header structure */ - t_garray *av_garray; /* owning structure */ + t_updateheader av_upd; /* update header structure */ + t_garray *av_garray; /* owning structure */ } t_arrayvis; /* the t_tick structure describes where to draw x and y "ticks" for a glist */ -typedef struct _tick /* where to put ticks on x or y axes */ +typedef struct _tick /* where to put ticks on x or y axes */ { - float k_point; /* one point to draw a big tick at */ - float k_inc; /* x or y increment per little tick */ - int k_lperb; /* little ticks per big; 0 if no ticks to draw */ + float k_point; /* one point to draw a big tick at */ + float k_inc; /* x or y increment per little tick */ + int k_lperb; /* little ticks per big; 0 if no ticks to draw */ } t_tick; /* the t_glist structure, which describes a list of elements that live on an @@ -140,43 +153,45 @@ area of a window. struct _glist { - t_object gl_obj; /* header in case we're a glist */ - t_gobj *gl_list; /* the actual data */ - struct _gstub *gl_stub; /* safe pointer handler */ - int gl_valid; /* incremented when pointers might be stale */ - struct _glist *gl_owner; /* parent glist, supercanvas, or 0 if none */ - int gl_pixwidth; /* width in pixels (on parent, if a graph) */ + t_object gl_obj; /* header in case we're a glist */ + t_gobj *gl_list; /* the actual data */ + struct _gstub *gl_stub; /* safe pointer handler */ + int gl_valid; /* incremented when pointers might be stale */ + struct _glist *gl_owner; /* parent glist, supercanvas, or 0 if none */ + int gl_pixwidth; /* width in pixels (on parent, if a graph) */ int gl_pixheight; - float gl_x1; /* bounding rectangle in our own coordinates */ + float gl_x1; /* bounding rectangle in our own coordinates */ float gl_y1; float gl_x2; float gl_y2; - int gl_screenx1; /* screen coordinates when toplevel */ + int gl_screenx1; /* screen coordinates when toplevel */ int gl_screeny1; int gl_screenx2; int gl_screeny2; - t_tick gl_xtick; /* ticks marking X values */ - int gl_nxlabels; /* number of X coordinate labels */ - t_symbol **gl_xlabel; /* ... an array to hold them */ - float gl_xlabely; /* ... and their Y coordinates */ - t_tick gl_ytick; /* same as above for Y ticks and labels */ + int gl_xmargin; /* origin for GOP rectangle */ + int gl_ymargin; + t_tick gl_xtick; /* ticks marking X values */ + int gl_nxlabels; /* number of X coordinate labels */ + t_symbol **gl_xlabel; /* ... an array to hold them */ + float gl_xlabely; /* ... and their Y coordinates */ + t_tick gl_ytick; /* same as above for Y ticks and labels */ int gl_nylabels; t_symbol **gl_ylabel; float gl_ylabelx; - t_editor *gl_editor; /* editor structure when visible */ - t_symbol *gl_name; /* symbol bound here */ - int gl_font; /* nominal font size in points, e.g., 10 */ - struct _glist *gl_next; /* link in list of toplevels */ + t_editor *gl_editor; /* editor structure when visible */ + t_symbol *gl_name; /* symbol bound here */ + int gl_font; /* nominal font size in points, e.g., 10 */ + struct _glist *gl_next; /* link in list of toplevels */ t_canvasenvironment *gl_env; /* root canvases and abstractions only */ unsigned int gl_havewindow:1; /* true if we own a window */ unsigned int gl_mapped:1; /* true if, moreover, it's "mapped" */ - unsigned int gl_dirty:1; /* (root canvas only:) patch has changed */ - unsigned int gl_loading:1; /* am now loading from file */ - unsigned int gl_willvis:1; /* make me visible after loading */ - unsigned int gl_edit:1; /* edit mode */ + unsigned int gl_dirty:1; /* (root canvas only:) patch has changed */ + unsigned int gl_loading:1; /* am now loading from file */ + unsigned int gl_willvis:1; /* make me visible after loading */ + unsigned int gl_edit:1; /* edit mode */ unsigned int gl_isdeleting:1; /* we're inside glist_delete -- hack! */ - unsigned int gl_stretch:1; /* stretch contents on resize */ - unsigned int gl_isgraph:1; /* show as graph on parent */ + unsigned int gl_goprect:1; /* draw rectangle for graph-on-parent */ + unsigned int gl_isgraph:1; /* show as graph on parent */ }; #define gl_gobj gl_obj.te_g @@ -193,29 +208,40 @@ typedef struct _dataslot { int ds_type; t_symbol *ds_name; - t_symbol *ds_arraytemplate; /* filled in for arrays only */ + t_symbol *ds_arraytemplate; /* filled in for arrays only */ } t_dataslot; - -/* T.Grill - changed t_pd member to t_pdobj to avoid name clashed */ typedef struct _template { - t_pd t_pdobj; /* header */ - struct _gtemplate *t_list; /* list of "struct"/gtemplate objects */ - t_symbol *t_sym; /* name */ - int t_n; /* number of dataslots (fields) */ - t_dataslot *t_vec; /* array of dataslots */ + t_pd t_pdobj; /* header */ + struct _gtemplate *t_list; /* list of "struct"/gtemplate objects */ + t_symbol *t_sym; /* name */ + int t_n; /* number of dataslots (fields) */ + t_dataslot *t_vec; /* array of dataslots */ } t_template; struct _array { - int a_n; /* number of elements */ - int a_elemsize; /* size in bytes; LATER get this from template */ - char *a_vec; /* array of elements */ - t_symbol *a_templatesym; /* template for elements */ - int a_valid; /* protection against stale pointers into array */ - t_gpointer a_gp; /* pointer to scalar or array element we're in */ - t_gstub *a_stub; + int a_n; /* number of elements */ + int a_elemsize; /* size in bytes; LATER get this from template */ + char *a_vec; /* array of elements */ + t_symbol *a_templatesym; /* template for elements */ + int a_valid; /* protection against stale pointers into array */ + t_gpointer a_gp; /* pointer to scalar or array element we're in */ + t_gstub *a_stub; /* stub for pointing into this array */ +}; + +struct _garray +{ + t_gobj x_gobj; + t_scalar *x_scalar; /* scalar "containing" the array */ + t_glist *x_glist; /* containing glist */ + t_symbol *x_name; /* unexpanded name (possibly with leading '$') */ + t_symbol *x_realname; /* expanded name (symbol we're bound to) */ + char x_usedindsp; /* true if some DSP routine is using this */ + char x_saveit; /* true if we should save this with parent */ + char x_listviewing; /* true if list view window is open */ + double x_lastupdate; /* T.Grill - clock_getlogicaltime() of last array update */ }; /* structure for traversing all the connections in a glist */ @@ -242,23 +268,23 @@ widgets. We don't use Pd methods because Pd's typechecking can't specify the types of pointer arguments. Also it's more convenient this way, since every "patchable" object can just get the "text" behaviors. */ - /* Call this to get a gobj's bounding rectangle in pixels */ + /* Call this to get a gobj's bounding rectangle in pixels */ typedef void (*t_getrectfn)(t_gobj *x, struct _glist *glist, int *x1, int *y1, int *x2, int *y2); - /* and this to displace a gobj: */ + /* and this to displace a gobj: */ typedef void (*t_displacefn)(t_gobj *x, struct _glist *glist, int dx, int dy); - /* change color to show selection: */ + /* change color to show selection: */ typedef void (*t_selectfn)(t_gobj *x, struct _glist *glist, int state); - /* change appearance to show activation/deactivation: */ + /* change appearance to show activation/deactivation: */ typedef void (*t_activatefn)(t_gobj *x, struct _glist *glist, int state); - /* warn a gobj it's about to be deleted */ + /* warn a gobj it's about to be deleted */ typedef void (*t_deletefn)(t_gobj *x, struct _glist *glist); - /* making visible or invisible */ + /* making visible or invisible */ typedef void (*t_visfn)(t_gobj *x, struct _glist *glist, int flag); - /* field a mouse click (when not in "edit" mode) */ + /* field a mouse click (when not in "edit" mode) */ typedef int (*t_clickfn)(t_gobj *x, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit); - /* ... and later, resizing; getting/setting font or color... */ + /* ... and later, resizing; getting/setting font or color... */ struct _widgetbehavior { @@ -280,29 +306,30 @@ which really does draw the scalar on the parent window; see g_scalar.c. */ /* note how the click function wants the whole scalar, not the "data", so doesn't work on array elements... LATER reconsider this */ - /* bounding rectangle: */ + /* bounding rectangle: */ typedef void (*t_parentgetrectfn)(t_gobj *x, struct _glist *glist, t_word *data, t_template *tmpl, float basex, float basey, int *x1, int *y1, int *x2, int *y2); - /* displace it */ + /* displace it */ typedef void (*t_parentdisplacefn)(t_gobj *x, struct _glist *glist, t_word *data, t_template *tmpl, float basex, float basey, int dx, int dy); - /* change color to show selection */ + /* change color to show selection */ typedef void (*t_parentselectfn)(t_gobj *x, struct _glist *glist, t_word *data, t_template *tmpl, float basex, float basey, int state); - /* change appearance to show activation/deactivation: */ + /* change appearance to show activation/deactivation: */ typedef void (*t_parentactivatefn)(t_gobj *x, struct _glist *glist, t_word *data, t_template *tmpl, float basex, float basey, int state); - /* making visible or invisible */ + /* making visible or invisible */ typedef void (*t_parentvisfn)(t_gobj *x, struct _glist *glist, t_word *data, t_template *tmpl, float basex, float basey, int flag); - /* field a mouse click */ + /* field a mouse click */ typedef int (*t_parentclickfn)(t_gobj *x, struct _glist *glist, - t_scalar *sc, t_template *tmpl, float basex, float basey, + t_word *data, t_template *tmpl, t_scalar *sc, t_array *ap, + float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit); struct _parentwidgetbehavior @@ -327,9 +354,13 @@ EXTERN void canvas_setcursor(t_glist *x, unsigned int cursornum); extern t_canvas *canvas_editing; /* last canvas to start text edting */ extern t_canvas *canvas_whichfind; /* last canvas we did a find in */ -extern t_canvas *canvas_list; /* list of all root canvases */ +extern t_canvas *canvas_list; /* list of all root canvases */ extern t_class *vinlet_class, *voutlet_class; -extern int glist_valid; /* incremented when pointers might be stale */ +extern int glist_valid; /* incremented when pointers might be stale */ + +#define PLOTSTYLE_POINTS 0 /* plotting styles for arrays */ +#define PLOTSTYLE_POLY 1 +#define PLOTSTYLE_BEZ 2 /* ------------------- functions on any gobj ----------------------------- */ EXTERN void gobj_getrect(t_gobj *x, t_glist *owner, int *x1, int *y1, @@ -378,7 +409,6 @@ EXTERN float glist_ytopixels(t_glist *x, float yval); EXTERN float glist_dpixtodx(t_glist *x, float dxpix); EXTERN float glist_dpixtody(t_glist *x, float dypix); -EXTERN void glist_redrawitem(t_glist *owner, t_gobj *gobj); EXTERN void glist_getnextxy(t_glist *gl, int *xval, int *yval); EXTERN void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv); EXTERN t_glist *glist_addglist(t_glist *g, t_symbol *sym, @@ -407,8 +437,10 @@ EXTERN int text_ycoord(t_text *x, t_glist *glist); EXTERN int text_xpix(t_text *x, t_glist *glist); EXTERN int text_ypix(t_text *x, t_glist *glist); EXTERN int text_shouldvis(t_text *x, t_glist *glist); +#endif /*DESIRE */ /* -------------------- functions on rtexts ------------------------- */ + #define RTEXT_DOWN 1 #define RTEXT_DRAG 2 #define RTEXT_DBL 3 @@ -431,8 +463,10 @@ EXTERN int rtext_width(t_rtext *x); EXTERN int rtext_height(t_rtext *x); EXTERN char *rtext_gettag(t_rtext *x); EXTERN void rtext_gettext(t_rtext *x, char **buf, int *bufsize); +EXTERN void rtext_getseltext(t_rtext *x, char **buf, int *bufsize); /* -------------------- functions on canvases ------------------------ */ +#ifndef DESIRE EXTERN t_class *canvas_class; EXTERN t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv); @@ -444,11 +478,12 @@ EXTERN void canvas_stowconnections(t_canvas *x); EXTERN void canvas_restoreconnections(t_canvas *x); EXTERN void canvas_redraw(t_canvas *x); -EXTERN t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *sym,t_symbol* s); +EXTERN t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *sym, t_symbol* h); EXTERN void canvas_rminlet(t_canvas *x, t_inlet *ip); EXTERN t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *sym); EXTERN void canvas_rmoutlet(t_canvas *x, t_outlet *op); -EXTERN void canvas_redrawallfortemplate(t_canvas *tmpl); +EXTERN void canvas_redrawallfortemplate(t_template *tmpl, int action); +EXTERN void canvas_redrawallfortemplatecanvas(t_canvas *x, int action); EXTERN void canvas_zapallfortemplate(t_canvas *tmpl); EXTERN void canvas_setusedastemplate(t_canvas *x); EXTERN t_canvas *canvas_getcurrent(void); @@ -480,17 +515,15 @@ EXTERN int canvas_hitbox(t_canvas *x, t_gobj *y, int xpos, int ypos, EXTERN int canvas_setdeleting(t_canvas *x, int flag); typedef void (*t_undofn)(t_canvas *canvas, void *buf, - int action); /* a function that does UNDO/REDO */ -#define UNDO_FREE 0 /* free current undo/redo buffer */ -#define UNDO_UNDO 1 /* undo */ -#define UNDO_REDO 2 /* redo */ + int action); /* a function that does UNDO/REDO */ +#define UNDO_FREE 0 /* free current undo/redo buffer */ +#define UNDO_UNDO 1 /* undo */ +#define UNDO_REDO 2 /* redo */ EXTERN void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf, const char *name); EXTERN void canvas_noundo(t_canvas *x); EXTERN int canvas_getindex(t_canvas *x, t_gobj *y); -/* T.Grill - made public for dynamic object creation */ -/* in g_editor.c */ EXTERN void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno,t_floatarg fwhoin, t_floatarg finno); EXTERN void canvas_disconnect(t_canvas *x, @@ -513,14 +546,6 @@ EXTERN void linetraverser_start(t_linetraverser *t, t_canvas *x); EXTERN t_outconnect *linetraverser_next(t_linetraverser *t); EXTERN void linetraverser_skipobject(t_linetraverser *t); -/* --------------------- functions on tscalars --------------------- */ - -EXTERN void tscalar_getrect(t_tscalar *x, t_glist *owner, - int *xp1, int *yp1, int *xp2, int *yp2); -EXTERN void tscalar_vis(t_tscalar *x, t_glist *owner, int flag); -EXTERN int tscalar_click(t_tscalar *x, int xpix, int ypix, int shift, - int alt, int dbl, int doit); - /* --------- functions on garrays (graphical arrays) -------------------- */ EXTERN t_template *garray_template(t_garray *x); @@ -529,7 +554,7 @@ EXTERN t_template *garray_template(t_garray *x); EXTERN t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *tmpl, t_floatarg f, t_floatarg saveit); EXTERN t_array *array_new(t_symbol *templatesym, t_gpointer *parent); -EXTERN void array_resize(t_array *x, t_template *tmpl, int n); +EXTERN void array_resize(t_array *x, int n); EXTERN void array_free(t_array *x); /* --------------------- gpointers and stubs ---------------- */ @@ -543,22 +568,27 @@ EXTERN void word_restore(t_word *wp, t_template *tmpl, int argc, t_atom *argv); EXTERN t_scalar *scalar_new(t_glist *owner, t_symbol *templatesym); +EXTERN void word_free(t_word *wp, t_template *tmpl); EXTERN void scalar_getbasexy(t_scalar *x, float *basex, float *basey); +EXTERN void scalar_redraw(t_scalar *x, t_glist *glist); /* ------helper routines for "garrays" and "plots" -------------- */ -EXTERN int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, +EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, t_symbol *elemtemplatesym, - float linewidth, float xloc, float xinc, float yloc, + float linewidth, float xloc, float xinc, float yloc, float scalarvis, + t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield, int xpix, int ypix, int shift, int alt, int dbl, int doit); EXTERN void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx, float basex, float basey, float xinc, + t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, float *xp, float *yp, float *wp); EXTERN int array_getfields(t_symbol *elemtemplatesym, t_canvas **elemtemplatecanvasp, t_template **elemtemplatep, int *elemsizep, + t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, int *xonsetp, int *yonsetp, int *wonsetp); /* --------------------- templates ------------------------- */ @@ -579,6 +609,8 @@ EXTERN void template_setsymbol(t_template *x, t_symbol *fieldname, EXTERN t_template *gtemplate_get(t_gtemplate *x); EXTERN t_template *template_findbyname(t_symbol *s); EXTERN t_canvas *template_findcanvas(t_template *tmpl); +EXTERN void template_notify(t_template *tmpl, + t_symbol *s, int argc, t_atom *argv); EXTERN t_float template_getfloat(t_template *x, t_symbol *fieldname, t_word *wp, int loud); @@ -588,6 +620,13 @@ EXTERN t_symbol *template_getsymbol(t_template *x, t_symbol *fieldname, t_word *wp, int loud); EXTERN void template_setsymbol(t_template *x, t_symbol *fieldname, t_word *wp, t_symbol *s, int loud); +EXTERN t_float fielddesc_getcoord(t_fielddesc *f, t_template *tmpl, + t_word *wp, int loud); +EXTERN void fielddesc_setcoord(t_fielddesc *f, t_template *tmpl, + t_word *wp, float pix, int loud); +EXTERN t_float fielddesc_cvttocoord(t_fielddesc *f, float val); +EXTERN float fielddesc_cvtfromcoord(t_fielddesc *f, float coord); + /* ----------------------- guiconnects, g_guiconnect.c --------- */ EXTERN t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym); @@ -600,3 +639,7 @@ EXTERN t_symbol *iemgui_dollar2raute(t_symbol *s); #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) } #endif + +#endif /* DESIRE */ +#endif /* __G_CANVAS_H */ + diff --git a/externals/gridflow/configure b/externals/gridflow/configure index d9b19139..1cfed471 100755 --- a/externals/gridflow/configure +++ b/externals/gridflow/configure @@ -1,8 +1,8 @@ #!/usr/bin/env ruby -# $Id: configure,v 1.1 2005-10-04 02:12:43 matju Exp $ +# $Id: configure,v 1.2 2006-03-15 04:48:05 matju Exp $ =begin GridFlow - Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,9 +25,17 @@ require "rbconfig" require "mkmf" require "ftools" include Config +OSX = !!( CONFIG["arch"] =~ /darwin/ ) + require "win32/process" if CONFIG["arch"] =~ /mingw/ LOG = File.open "./config.log", "w" +Red = "\e[0;1;31m" +Green = "\e[0;1;32m" +Light = "\e[0m" +Dark = "\e[0;1;30m" +Yellow = "\e[0;1;33;44m" + $verbose=false LOG.puts "-"*64 LOG.puts "Environment Variables: " @@ -72,10 +80,12 @@ $conf={ :FEATURES => {}, :OPTIONS => [], :DEFINES => { - :RUBY_PREFIX => CONFIG['prefix'], +# :RUBY_PREFIX => CONFIG['prefix'], + :RUBY_PREFIX => nil, :PREFIX => "/usr/local", :CPU => nil, :RUBY_ARCH => CONFIG['arch'], + :GEM_SOURCE => "../Gem/src", }, :CC => "g++", :OBJS => [], @@ -198,34 +208,45 @@ def read_ld_so_conf x end +def epath x; (ENV[x]||"").split(":") end + $C_INCLUDE_PATH = ( - (ENV["CPLUS_INCLUDE_PATH"]||"").split(":") + - (ENV["C_INCLUDE_PATH"]||"").split(":") + + epath("CPLUS_INCLUDE_PATH") + + epath("C_INCLUDE_PATH") + ["/usr/include"]).uniq $LIBRARY_PATH = ( - (ENV["LIBRARY_PATH"]||"").split(":") + + epath("LIBRARY_PATH") + ["/usr/lib","/lib"]).uniq $LD_LIBRARY_PATH = ( - (ENV["LD_LIBRARY_PATH"]||"").split(":") + - read_ld_so_conf + - ["/usr/lib","/lib"]).uniq + epath("LD_LIBRARY_PATH") + + read_ld_so_conf + + ["/usr/lib","/lib"]).uniq +$LIBX11DIR = ["-L/usr/X11R6/lib"] +$LIBX11 = ["-L/usr/X11R6/lib","-lX11"] # making it easier for everybody I hope: -["/Applications/Pd.app/Contents/Resources","/sw","/usr/local",ENV["home"]].each do|base| - if not $LD_LIBRARY_PATH.include? "#{base}/lib" and - not $LIBRARY_PATH.include? "#{base}/lib" then - $conf[:LDSOFLAGS].unshift "-L#{base}/lib" - $LD_LIBRARY_PATH.unshift "#{base}/lib" - $LIBRARY_PATH.unshift "#{base}/lib" +def prepend_path base + bl = base+"/lib" + bi = base+"/include" + if not $LD_LIBRARY_PATH.include? bl and + not $LIBRARY_PATH.include? bl then + $conf[:LDSOFLAGS].unshift "-L"+bl + $LD_LIBRARY_PATH.unshift bl + $LIBRARY_PATH.unshift bl end - #and not $CPLUS_INCLUDE_PATH.include? "#{base}/include" - if not $C_INCLUDE_PATH.include? "#{base}/include" then - $CFLAGS += " -I#{base}/include" - $C_INCLUDE_PATH.unshift "#{base}/include" + #and not $CPLUS_INCLUDE_PATH.include? bi + if not $C_INCLUDE_PATH.include? bi then + $CFLAGS += " -I"+bi + $C_INCLUDE_PATH.unshift bi end end +prepend_path "/Applications/Pd.app/Contents/Resources" if OSX +prepend_path "/sw" if OSX +prepend_path "/usr/local" +prepend_path ENV["HOME"] +# prepend_path "." for var in [:$C_INCLUDE_PATH, :$LIBRARY_PATH, :$LD_LIBRARY_PATH] do LOG.puts "#{var}: #{eval(var.to_s).inspect}" @@ -261,6 +282,10 @@ FILES = [ [:directory, "format/", [:ruby, "main.rb"], ], + [:directory, "optional/", + [:ruby, "usb.rb"], + [:ruby, "lti.rb"], + ], [:directory, "extra/", [:ruby, "smpte.rb"], [:ruby, "server_2.rb"], @@ -273,13 +298,10 @@ FILES = [ #----------------------------------------------------------------# Feature.add { - tag :fast - name "Compile for speed (and not debuggability)" -} -Feature.add { tag :gcc3 name "GNU C++ Compiler 3" options ["HAVE_GCC3"] +=begin test proc { pi=File.popen "#{$conf[:CC]} -v 2>&1", "r" vline = pi.readlines.find {|l| /gcc version ([\d\.]+)/.match l } @@ -288,6 +310,20 @@ Feature.add { if version < "3" then raise "version #{version} < 3" end true } +=end + test proc { + c_test %{ + #include <stdio.h> + int main () { + printf("GCC_VERSION %d.%d.%d\\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); + return !(__GNUC__>=3); + }} + } + defines :GCC_VERSION => proc { + m = /GCC_VERSION\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + m[1] + } + } Feature.add { tag :stl @@ -309,7 +345,7 @@ Feature.add { #include <stdio.h> #include <stdlib.h> #include <cstddef> - #define T(a) printf("%s:%d; ",#a,sizeof(a)); + #define T(a) printf("%s:%ld; ",#a,(long)sizeof(a)); int main () { T(void *)T(ptrdiff_t)T(off_t)T(size_t)puts(""); T(char)T(short)T(int)T(long)T(long long)puts(""); @@ -321,13 +357,69 @@ Feature.add { #----------------------------------------------------------------# -$stack_end_test = %{ +Feature.add { + tag :libc_stack_end + name "Stack end defined by LibC" + status :disabled + test proc { c_test ' + #include <stdio.h> + extern void *__libc_stack_end; + int main () { + printf("#define STACK_END 0x%0*lx",sizeof(long)*2,__libc_stack_end); + return 0; + } + ', uses_bridge_so } + defines :HAVE_LIBC_STACK_END + defines :STACK_END => proc { + m = /STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + m[1] + } +} +Feature.add { + tag :segv_stack_end + name "Stack end probed" + test proc { c_test %` + /* the segfault trick (by Mathieu Bouchard) */ + #ifndef STACK_GROW_DIRECTION + #define STACK_GROW_DIRECTION -1 + #endif + #include <stdio.h> + #include <signal.h> + #include <setjmp.h> + static volatile long bogus = 0; // to force *bp to be read in memory + static sigjmp_buf rescue_segfault; + static void trap_segfault (int patate) { siglongjmp(rescue_segfault,11); } + int main () { + // get any stack address + volatile long * volatile bp = (volatile long *)&bp; + void (*oldsegv)(int) = signal(SIGSEGV,trap_segfault); + void (*oldbus)(int) = signal(SIGBUS, trap_segfault); + if (!sigsetjmp(rescue_segfault,0)) for (;;bp-=STACK_GROW_DIRECTION) bogus += *bp; + printf("#define STACK_END 0x%0*lx\\n",sizeof(long)*2,(long)(bp+STACK_GROW_DIRECTION)); + return 0; + } + `, uses_bridge_so } + defines :HAVE_LIBC_STACK_END + defines :STACK_END => proc { + m = /STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + m[1] + } +} +Feature.add { + tag :wild_stack_end + name "Stack end wild guess" + unless_feature [:libc_stack_end,:segv_stack_end] + test proc { c_test ' #include <stdio.h> - #include <ruby.h> int main () { void *bp; - printf("#define RUBY_STACK_END 0x%08lx",(long)&bp); - return rb_rescue==0; + printf("#define STACK_END 0x%0*lx",sizeof(long)*2,(long)&bp); + return 0; + } + ', uses_bridge_so } + defines :STACK_END => proc { + m = /STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + m[1] } } Feature.add { @@ -335,11 +427,8 @@ Feature.add { name "Ruby as a dynamic library" uses_bridge_so ["-lruby"] #uses_h ["ruby.h"] # is in special directory - defines :RUBY_STACK_END => proc { - m = /RUBY_STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) - m[1] - } - test proc { c_test $stack_end_test, uses_bridge_so } + test proc { c_test "#include <ruby.h> + int main () { return rb_rescue==0; }", uses_bridge_so } } Feature.add { tag :librubystatic @@ -348,16 +437,12 @@ Feature.add { #uses_h ["ruby.h"] # is in special directory uses_bridge_so { lib = " #{$LIBRUBY_A} #{CONFIG['LIBS']} " - unless CONFIG["arch"] =~ /darwin/ - lib = "-Wl,--whole-archive"+lib+"-Wl,--no-whole-archive" - end + lib = "-Wl,--whole-archive"+lib+"-Wl,--no-whole-archive" unless OSX [lib] } - defines :RUBY_STACK_END => proc { - m = /RUBY_STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) - m[1] - } - test proc { c_test $stack_end_test, ["-xnone", $LIBRUBY_A, *(CONFIG['LIBS'].split)] } + test proc { c_test "#include <ruby.h> + int main () { return rb_rescue==0; }", + ["-xnone", $LIBRUBY_A, *(CONFIG['LIBS'].split)] } options ["HAVE_STATIC_RUBY"] #!@#$ useless? } #----------------------------------------------------------------# @@ -366,7 +451,7 @@ Feature.add { name "Pentium-compatible CPU" action proc { $conf[:DEFINES][:CPU] ||= "pentium" } test proc { - (CONFIG["arch"] =~ /i\d86/) or raise "#{CONFIG["arch"]} instead" + (CONFIG["arch"] =~ /(i\d86|x86_64)/) or raise "#{CONFIG["arch"]} instead" c_test ' #include <stdio.h> char get_cpuid[]={ @@ -468,7 +553,7 @@ Feature.add { Feature.add { tag :x11 name "X11 Display Protocol" - uses_so ["-L/usr/X11R6/lib","-lX11","-lXext"] + uses_so $LIBX11 uses_h ["X11/Xlib.h"] test proc { c_test " @@ -480,9 +565,9 @@ Feature.add { } Feature.add { tag :x11_shm - name "X11 acceleration through shared memory" + name "X11 acceleration by shared memory (XSHM plugin)" uses_feature [:x11] - uses_so ["-L/usr/X11R6/lib","-lX11","-lXext"] + uses_so $LIBX11+["-lXext"] uses_h ["X11/Xlib.h","sys/shm.h","X11/extensions/XShm.h"] test proc { c_test " @@ -495,13 +580,26 @@ Feature.add { } options ["HAVE_X11_SHARED_MEMORY"] } -=begin +Feature.add { + tag :x11_xv + status :disabled + name "X11 acceleration (XVIDEO plugin)" + uses_feature [:x11] + uses_so $LIBX11+["-lXext","-lXv"] + uses_h ["X11/Xlib.h","X11/extensions/Xv.h"] + test proc { + c_test " + #include# + int main () {return 0;} + " + } + options ["HAVE_X11_XVIDEO"] +} Feature.add { tag :opengl name "OpenGL (only as framebuffer)" - status :disabled - uses_so ["-L/usr/X11R6/lib","-lglut","-lGL","-lGLU"] - uses_h ["GL/glut.h"] + uses_so $LIBX11DIR+["-lglut","-lGL","-lGLU"] + uses_h ["GL/gl.h","GL/glu.h","GL/glut.h"] test proc { c_test " #include# @@ -510,13 +608,12 @@ Feature.add { } uses_o ["format/opengl.o"] } -=end Feature.add { tag :sdl name "Simple Directmedia Layer (experimental support)" uses_so { a=["-lSDL","-lpthread"] - a<<"-lobjc" if CONFIG["arch"] =~ /darwin/ + a<<"-lobjc" if OSX a } uses_h ["SDL/SDL.h"] @@ -607,6 +704,7 @@ Feature.add { } uses_o ["format/png.o"] } +#------------------------------------------------# Feature.add { tag :videodev name "Video4linux Digitizer Driver Interface" @@ -622,8 +720,7 @@ Feature.add { Feature.add { tag :mpeg3 name "HeroineWarrior LibMPEG3" - uses_so ["-lmpeg3","-lpthread","-lm", - "-L/usr/X11R6/lib"] + uses_so $LIBX11DIR+["-lmpeg3","-lpthread","-lm"] uses_h Or["libmpeg3/libmpeg3.h","libmpeg3.h"] test proc {|f| f.c_test " @@ -649,11 +746,14 @@ Feature.add { Feature.add { tag :quicktimehw unless_feature :quicktimeapple - name "HeroineWarrior QuickTime4Linux (or LibQuickTime)" + name "Plaum's LibQuickTime" uses_so Or[ ["-lquicktime","-lpthread","-lpng","-ldl","-lglib","-lz"], ["-lquicktime","-lpthread","-lpng","-ldl","-lglib-1.2","-lz"]] - uses_h ["quicktime/quicktime.h","quicktime/lqt_version.h"] + f = ["quicktime.h","colormodels.h","lqt.h","lqt_version.h","lqt_codecinfo.h"] + uses_h Or[ + f.map{|x| "quicktime/"+x }, + f.map{|x| "lqt/"+x }] test proc {|f| f.c_test %` #include <stdio.h> @@ -727,18 +827,38 @@ Feature.add { ` } } +#--------------------------------# +Feature.add { + tag :gem + name "PureData GEM (source code)" +# uses_h [$conf[:DEFINES][:GEM_SOURCE]+"/src/Base/GemBase.h"] + uses_feature [:puredata] + uses_o ["optional/gem.o"] + test proc { + # hack + $C_INCLUDE_PATH.unshift $conf[:DEFINES][ :GEM_SOURCE] + $CFLAGS += " -I"+$conf[:DEFINES][ :GEM_SOURCE] + c_test %` + #include "Base/GemBase.h" + int main () { + return 0; + } + ` + } +} +#--------------------------------# $features_h = {} $features.each {|f| $features_h[f.tag]=f } -#--------------------------------# def usage log = "" log << "usage: ./configure " log << "[--use-compiler compiler] [--use-compiler-option option]* " log << "[--use-cpu cpu] [--lite] [--debug] [--debug-harder]" - log << "[--ruby-prefix directory] " + log << "[--ruby-prefix directory] [--gem-source directory]" + # [--puredata-prefix directory] " $features_h.keys.map {|k| k.to_s }.sort.each {|k| log << "[--no-#{k}] " } $features_h.keys.map {|k| k.to_s }.sort.each {|k| log << "[--force-#{k}] " } puts @@ -778,8 +898,11 @@ while ARGV.length>0 do puts "Lite Mode (no float, no int64)" $conf[:OPTIONS].push :HAVE_LITE when "--help"; usage; exit 0 - when "--prefix", "--ruby-prefix" - $conf[:DEFINES][:RUBY_PREFIX]=ARGV.shift + + when "--prefix", "--ruby-prefix" : $conf[:DEFINES][:RUBY_PREFIX]=ARGV.shift + when "--pd-prefix", "--puredata-prefix": $conf[:DEFINES][ :PD_PREFIX]=ARGV.shift + when "--gem-source" : $conf[:DEFINES][ :GEM_SOURCE]=ARGV.shift + when "--use-compiler" $conf[:CC] = ARGV.shift when "--use-compiler-option" @@ -789,7 +912,7 @@ while ARGV.length>0 do when "--verbose" $verbose=true when "--bindir" - $conv[:BINDIR] = ARGV.shift + $conf[:BINDIR] = ARGV.shift else puts "unknown option \"#{arg}\""; usage; exit 1 end end @@ -798,8 +921,7 @@ end CONFIG["ruby_version"] ||= "$(MAJOR).$(MINOR)" CONFIG["rubylibdir"] ||= "$(libdir)/ruby/$(ruby_version)" CONFIG["archdir"] ||= CONFIG["rubylibdir"] + "/" + CONFIG["arch"] - -$CFLAGS += " -I " + (make_expand CONFIG["archdir"]) +$CFLAGS += " -I" + (make_expand CONFIG["archdir"]) #--------------------------------# @@ -815,6 +937,7 @@ DUAL.instance_eval { } def try feature + if Or===feature.uses_so k=1 feature.uses_so.a.each {|i| @@ -826,28 +949,31 @@ def try feature end if Or===feature.uses_h feature.uses_h.a.each {|i| - e=feature.dup; e.uses_h i; e.name(e.name+" <#{e.uses_h}>") + e=feature.dup; e.uses_h i; e.name(e.name+" <#{i.to_a[0]}>") r=try e; return r if r } return false end LOG.puts "", "-"*64 - DUAL.print "[#{feature.tag}] #{feature.name}: " + line = "[#{feature.tag}] #{feature.name}: " + DUAL.print Light + "[#{Yellow}#{feature.tag}#{Light}] #{feature.name}: " + arrow = "-"*([78-line.length,0].max)+ "> " + #DUAL.print Dark + arrow +Red (feature.uses_feature||[]).find {|f| if not ( if Or===f then f.a.find {|x| $conf[:FEATURES][x] } else $conf[:FEATURES][f] end ) then - DUAL.puts "disabled (would need #{f})" + DUAL.puts Red+arrow+"disabled (would need #{f})" return end } - if feature.status==:disabled then DUAL.puts "disabled (by author)"; return end - if not $features_h[feature.tag] then DUAL.puts "disabled (by user)"; return end + if feature.status==:disabled then DUAL.puts Dark+arrow+"disabled (by author)"; return end + if not $features_h[feature.tag] then DUAL.puts Dark+arrow+"disabled (by user)"; return end fu = feature.unless_feature || [] fu = [fu] if not Array===fu for f in fu || [] do if $conf[:FEATURES][f] then - DUAL.puts "disabled (using #{f} instead)" + DUAL.puts Dark+arrow+"disabled (using #{f} instead)" return end end @@ -858,7 +984,7 @@ def try feature rescue StandardError => e end if tresult - DUAL.puts "found "+(if tresult!=true + DUAL.puts Green+arrow+"found "+(if tresult!=true then " (#{tresult})" else "" end) if tresult == "static" @@ -870,7 +996,7 @@ def try feature } if feature.uses_bridge_so end else - DUAL.puts "missing "+(if e + DUAL.puts Red+arrow+"missing "+(if e then (if $verbose then "(#{e} @ #{e.backtrace.join', '})" else "(#{e})" end) @@ -882,7 +1008,7 @@ def try feature return false end else - puts "enabled" + puts Green+arrow+"enabled" $conf[:FEATURES][feature.tag] = feature feature.action.call if feature.action end @@ -898,7 +1024,7 @@ def try feature true end -DUAL.puts "This is the GridFlow 0.8.0 configurator within Ruby version #{RUBY_VERSION}" +DUAL.puts "This is the GridFlow 0.8.1 configurator within Ruby version #{RUBY_VERSION}" begin $features.each {|feature| try feature } @@ -907,10 +1033,12 @@ ensure system "/bin/rm -f tmp/#{$$} tmp/#{$$}.c tmp/#{$$}.o tmp/#{$$}.asm" end +puts Light + $conf[:LDSOFLAGS].uniq! $conf[:BRIDGE_LDFLAGS].uniq! -$CFLAGS += " -falign-functions=4" if $conf[:FEATURES][:gcc3] +$CFLAGS += " -falign-functions=16" if $conf[:FEATURES][:gcc3] #if not $conf[:FEATURES][:gcc3] # puts "You should install gcc 3.x; gcc 2.9.x is no longer supported" @@ -975,17 +1103,18 @@ RUBYARCH=#{CONFIG['arch']} f.puts "BRIDGE_LDFLAGS = " + $conf[:BRIDGE_LDFLAGS].flatten.join(" ") + " " + $LDFLAGS -if CONFIG["arch"] =~ /darwin/ then +if OSX then f.puts "BRIDGE_LDFLAGS += -bundle -flat_namespace" else f.puts "BRIDGE_LDFLAGS += -rdynamic -shared" end -$CFLAGS += " -mcpu=$(CPU)" if $conf[:DEFINES][:CPU] +$CFLAGS += " -mtune=$(CPU)" if $conf[:DEFINES][:CPU] $CFLAGS += " -march=$(CPU)" if $conf[:DEFINES][:CPU] #$CFLAGS += " -fforce-addr" #$CFLAGS += " -fprefetch-loop-arrays" #$CFLAGS += " -falign-jumps=4" #$CFLAGS += " -falign-loops=4" +$CFLAGS += " -DMACOSX" if OSX f.puts "CFLAGS += " + $CFLAGS for k in $conf[:OPTIONS] do f.puts "#{k}=yes" end @@ -1023,13 +1152,19 @@ f.puts "#define STARTUP_LIST(PRE) \\" f.puts $conf[:OBJS].map {|o| "PRE startup_#{File.basename(o,'.o')}();" }.join("\\\n") for k in $conf[:OPTIONS] do f.puts "\#define #{k}" end for k,v in $conf[:DEFINES] do f.puts "\#define #{k} "+v.inspect end -if $conf[:FEATURES][:mpeg3] -f.puts " -\#ifdef LIBMPEG_INCLUDE_HERE -\#include <#{$conf[:FEATURES][:mpeg3].uses_h}> -\#endif -" + +def include_here(f,a,b) + return unless $conf[:FEATURES][b] + f.puts "\#ifdef #{a}_INCLUDE_HERE" + for inc in $conf[:FEATURES][b].uses_h.to_a do + f.puts "\#include <#{inc}>" + end + f.puts "\#endif" end + +include_here f,"LIBMPEG", :mpeg3 +include_here f,"QUICKTIMEHW",:quicktimehw + f.puts " \#define RUBY_BINDIR #{make_expand(CONFIG['bindir']).inspect} \#endif /* __CONFIG_H */" @@ -1089,7 +1224,13 @@ mf.sub! /^(OBJS = .*)$/, "\\1 #{$conf[:OBJS].join' '}" mf[0,0] = "COMMON_DEPS = config.make Makefile Makefile.gf base/source_filter.rb\n"+ "gfbindir = #{$conf[:BINDIR]}\n" mf.sub!(/^site-install:\s*install/,"site-install: ") -mf.sub! /^prefix = .*$/, "prefix = " + make_expand($conf[:DEFINES][:RUBY_PREFIX]) + +rp=$conf[:DEFINES][:RUBY_PREFIX] +if rp + mf.sub! /^prefix\s*=.*$/, "prefix = " + make_expand(rp) + mf.sub! /^sitedir\s*=.*$/, "sitedir = " + make_expand(rp) +end + mf.sub! /^LDSHARED = g?cc/, "LDSHARED = $(CXX)" # Adam Lindsay's Mac attempts. mf.sub! /-no-precomp/, "-no-cpp-precomp" diff --git a/externals/gridflow/doc/architecture.html b/externals/gridflow/doc/architecture.html index 3009be34..009464a1 100644 --- a/externals/gridflow/doc/architecture.html +++ b/externals/gridflow/doc/architecture.html @@ -1,6 +1,6 @@ <html><head> -<!-- $Id: architecture.html,v 1.1 2005-10-04 02:09:42 matju Exp $ --> -<title>GridFlow 0.8.0 - Reference Manual: Architecture</title> +<!-- $Id: architecture.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> +<title>GridFlow 0.8.1 - Reference Manual: Architecture</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="gridflow.css" type="text/css"> </head> @@ -14,7 +14,7 @@ <tr><td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4" height="16"> - <h4>GridFlow 0.8.0 - Reference Manual: Architecture</h4> + <h4>GridFlow 0.8.1 - Reference Manual: Architecture</h4> </td></tr> <tr> <td width="5%" rowspan="2"> </td> @@ -208,9 +208,9 @@ with the main part. </p></td></tr> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4"> <p><font size="-1"> -GridFlow 0.8.0 Documentation<br> -Copyright © 2001,2002,2003,2004,2005 by Mathieu Bouchard -<a href="mailto:matju@sympatico.ca">matju@artengine.ca</a> +GridFlow 0.8.1 Documentation<br> +Copyright © 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard +<a href="mailto:matju@artengine.ca">matju@artengine.ca</a> </font></p> </td></tr></table></body></html> diff --git a/externals/gridflow/doc/architecture.xml b/externals/gridflow/doc/architecture.xml index ec0c5a14..bf87474e 100644 --- a/externals/gridflow/doc/architecture.xml +++ b/externals/gridflow/doc/architecture.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no" ?> <!DOCTYPE documentation SYSTEM 'jmax.dtd'> <documentation title="Reference Manual: Architecture"> -<!-- $Id: architecture.xml,v 1.1 2005-10-04 02:09:42 matju Exp $ --> +<!-- $Id: architecture.xml,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Reference Manual: Architecture Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/doc/flow_classes/@complex_sq-icon.png b/externals/gridflow/doc/flow_classes/@complex_sq-icon.png Binary files differnew file mode 100644 index 00000000..7c9dd8d5 --- /dev/null +++ b/externals/gridflow/doc/flow_classes/@complex_sq-icon.png diff --git a/externals/gridflow/doc/flow_classes/@join-icon.png b/externals/gridflow/doc/flow_classes/@join-icon.png Binary files differnew file mode 100644 index 00000000..461f626e --- /dev/null +++ b/externals/gridflow/doc/flow_classes/@join-icon.png diff --git a/externals/gridflow/doc/flow_classes/demux-icon.png b/externals/gridflow/doc/flow_classes/demux-icon.png Binary files differnew file mode 100644 index 00000000..d3937142 --- /dev/null +++ b/externals/gridflow/doc/flow_classes/demux-icon.png diff --git a/externals/gridflow/doc/flow_classes/inv*-icon.png b/externals/gridflow/doc/flow_classes/inv*-icon.png Binary files differnew file mode 100644 index 00000000..d887f1ba --- /dev/null +++ b/externals/gridflow/doc/flow_classes/inv*-icon.png diff --git a/externals/gridflow/doc/flow_classes/rubyarray.png b/externals/gridflow/doc/flow_classes/rubyarray.png Binary files differnew file mode 100644 index 00000000..2d3ad9e5 --- /dev/null +++ b/externals/gridflow/doc/flow_classes/rubyarray.png diff --git a/externals/gridflow/doc/flow_classes/unix_time-help.pd b/externals/gridflow/doc/flow_classes/unix_time-help.pd index b0105ab5..d80b4c19 100644 --- a/externals/gridflow/doc/flow_classes/unix_time-help.pd +++ b/externals/gridflow/doc/flow_classes/unix_time-help.pd @@ -1,25 +1,29 @@ -#N canvas 696 154 450 446 10; -#X obj 137 107 unix_time; -#X obj 136 68 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#N canvas 134 38 639 312 10; +#X obj 91 113 unix_time; +#X obj 91 82 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 78 146 #export_list; -#X obj 167 171 display; -#X obj 43 18 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X obj 8 172 #export_list; +#X obj 91 40 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; -#X obj 283 243 nbx 9 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 0 256; -#X obj 11 290 display; -#X text 381 243 <-- 1/100000 th of a second \, useful for generating -filenames; -#X text 213 170 <-- Unix timestamp; -#X obj 86 30 metro 500; -#X text 274 19 GridFlow 0.8.0; -#X text 225 88 Outputs; -#X text 62 287 <-- Ascii format for the date; +#X obj 9 246 display; +#X obj 91 58 metro 500; +#X text 60 243 <-- Ascii format for the date; +#X obj 308 221 display; +#X obj 123 171 display; +#X obj 307 195 display; +#X obj 306 170 rubysprintf %04d%02d%02d-%02d%02d%02d; +#X obj 8 282 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 16 289 GridFlow 0.8.0; +#X obj 8 5 cnv 15 720 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 9 5 SUMMARY : the unixtime command; #X connect 0 0 2 0; -#X connect 0 1 3 0; -#X connect 0 2 5 0; +#X connect 0 1 8 0; +#X connect 0 2 7 0; +#X connect 0 2 10 0; #X connect 1 0 0 0; -#X connect 2 0 6 0; -#X connect 4 0 9 0; -#X connect 9 0 1 0; +#X connect 2 0 4 0; +#X connect 3 0 5 0; +#X connect 5 0 1 0; +#X connect 10 0 9 0; diff --git a/externals/gridflow/doc/format.html b/externals/gridflow/doc/format.html index 325a6409..243e508e 100644 --- a/externals/gridflow/doc/format.html +++ b/externals/gridflow/doc/format.html @@ -1,6 +1,6 @@ <html><head> -<!-- $Id: format.html,v 1.1 2005-10-04 02:09:42 matju Exp $ --> -<title>GridFlow 0.8.0 - Reference Manual: Format Classes</title> +<!-- $Id: format.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> +<title>GridFlow 0.8.1 - Reference Manual: Format Classes</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="gridflow.css" type="text/css"> </head> @@ -14,7 +14,7 @@ <tr><td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4" height="16"> - <h4>GridFlow 0.8.0 - Reference Manual: Format Classes</h4> + <h4>GridFlow 0.8.1 - Reference Manual: Format Classes</h4> </td></tr> <tr> <td width="5%" rowspan="2"> </td> @@ -476,9 +476,9 @@ <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4"> <p><font size="-1"> -GridFlow 0.8.0 Documentation<br> -Copyright © 2001,2002,2003,2004,2005 by Mathieu Bouchard -<a href="mailto:matju@sympatico.ca">matju@artengine.ca</a> +GridFlow 0.8.1 Documentation<br> +Copyright © 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard +<a href="mailto:matju@artengine.ca">matju@artengine.ca</a> </font></p> </td></tr></table></body></html> diff --git a/externals/gridflow/doc/format.xml b/externals/gridflow/doc/format.xml index 39f17cf3..030a777d 100644 --- a/externals/gridflow/doc/format.xml +++ b/externals/gridflow/doc/format.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no" ?> <!DOCTYPE documentation SYSTEM 'jmax.dtd'> <documentation title="Reference Manual: Format Classes"> -<!-- $Id: format.xml,v 1.1 2005-10-04 02:09:42 matju Exp $ --> +<!-- $Id: format.xml,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Reference Manual: Format Handler Reference Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard diff --git a/externals/gridflow/doc/install.html b/externals/gridflow/doc/install.html index e65652e3..6127c79c 100644 --- a/externals/gridflow/doc/install.html +++ b/externals/gridflow/doc/install.html @@ -1,6 +1,6 @@ <html><head> -<!-- $Id: install.html,v 1.1 2005-10-04 02:09:42 matju Exp $ --> -<title>GridFlow 0.8.0 - Installation</title> +<!-- $Id: install.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> +<title>GridFlow 0.8.1 - Installation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="gridflow.css" type="text/css"> </head> @@ -14,7 +14,7 @@ <tr><td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4" height="16"> - <h4>GridFlow 0.8.0 - Installation</h4> + <h4>GridFlow 0.8.1 - Installation</h4> </td></tr> <tr> <td width="5%" rowspan="2"> </td> @@ -113,9 +113,9 @@ crashes, or changes didn't go through. <ul> <li><b>1</b> : Did you forget the "m <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4"> <p><font size="-1"> -GridFlow 0.8.0 Documentation<br> -Copyright © 2001,2002,2003,2004,2005 by Mathieu Bouchard -<a href="mailto:matju@sympatico.ca">matju@artengine.ca</a> +GridFlow 0.8.1 Documentation<br> +Copyright © 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard +<a href="mailto:matju@artengine.ca">matju@artengine.ca</a> </font></p> </td></tr></table></body></html> diff --git a/externals/gridflow/doc/install.xml b/externals/gridflow/doc/install.xml index 6a45e224..e1f1c434 100644 --- a/externals/gridflow/doc/install.xml +++ b/externals/gridflow/doc/install.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no" ?> <!DOCTYPE documentation SYSTEM 'jmax.dtd'> <documentation title="Installation"> -<!-- $Id: install.xml,v 1.1 2005-10-04 02:09:42 matju Exp $ --> +<!-- $Id: install.xml,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Installation Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard diff --git a/externals/gridflow/doc/internals.html b/externals/gridflow/doc/internals.html index dfc51b73..4a2e7978 100644 --- a/externals/gridflow/doc/internals.html +++ b/externals/gridflow/doc/internals.html @@ -1,6 +1,6 @@ <html><head> -<!-- $Id: internals.html,v 1.1 2005-10-04 02:09:42 matju Exp $ --> -<title>GridFlow 0.8.0 - C++/Ruby Internals</title> +<!-- $Id: internals.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> +<title>GridFlow 0.8.1 - C++/Ruby Internals</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="gridflow.css" type="text/css"> </head> @@ -14,7 +14,7 @@ <tr><td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4" height="16"> - <h4>GridFlow 0.8.0 - C++/Ruby Internals</h4> + <h4>GridFlow 0.8.1 - C++/Ruby Internals</h4> </td></tr> <tr> <td width="5%" rowspan="2"> </td> @@ -197,9 +197,9 @@ and they point to each other using "peer pointers". <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4"> <p><font size="-1"> -GridFlow 0.8.0 Documentation<br> -Copyright © 2001,2002,2003,2004,2005 by Mathieu Bouchard -<a href="mailto:matju@sympatico.ca">matju@artengine.ca</a> +GridFlow 0.8.1 Documentation<br> +Copyright © 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard +<a href="mailto:matju@artengine.ca">matju@artengine.ca</a> </font></p> </td></tr></table></body></html> diff --git a/externals/gridflow/doc/internals.xml b/externals/gridflow/doc/internals.xml index 19173719..952d0507 100644 --- a/externals/gridflow/doc/internals.xml +++ b/externals/gridflow/doc/internals.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no" ?> <!DOCTYPE documentation SYSTEM 'jmax.dtd'> <documentation title="C++/Ruby Internals"> -<!-- $Id: internals.xml,v 1.1 2005-10-04 02:09:42 matju Exp $ --> +<!-- $Id: internals.xml,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Reference Manual: Internals Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard diff --git a/externals/gridflow/doc/license.html b/externals/gridflow/doc/license.html index 5b5d39b7..0414218f 100644 --- a/externals/gridflow/doc/license.html +++ b/externals/gridflow/doc/license.html @@ -1,6 +1,6 @@ <html> <head> -<!-- $Id: license.html,v 1.1 2005-10-04 02:09:43 matju Exp $ --> +<!-- $Id: license.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Reference Manual: Architecture Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/doc/moulinette.rb b/externals/gridflow/doc/moulinette.rb index 03dbfa86..c74933d6 100644 --- a/externals/gridflow/doc/moulinette.rb +++ b/externals/gridflow/doc/moulinette.rb @@ -1,5 +1,5 @@ =begin - $Id: moulinette.rb,v 1.1 2005-10-04 02:02:14 matju Exp $ + $Id: moulinette.rb,v 1.2 2006-03-15 04:44:50 matju Exp $ convert GridFlow Documentation XML to HTML with special formatting. GridFlow @@ -22,12 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end -GF_VERSION = "0.8.0" +GF_VERSION = "0.8.1" #$use_rexml = true $use_rexml = false -#require "gridflow" +require "gridflow" if $use_rexml # this is a pure ruby xml-parser @@ -138,6 +138,9 @@ class XNode # public :show_index #} end + def [](tag,att,*contents) + self.valid_tags[tag].new(tag,att,*contents) + end end def initialize tag, att, *contents @@ -166,6 +169,7 @@ class XNode end def inspect; "#<XNode #{tag}>"; end def to_s; inspect; end + def << x; contents << x; x.parent=self end end XNode.register("documentation") {} @@ -549,8 +553,8 @@ puts <<EOF <tr><td colspan="4"> <p><font size="-1"> GridFlow #{GF_VERSION} Documentation<br> -Copyright © 2001,2002,2003,2004,2005 by Mathieu Bouchard -<a href="mailto:matju@sympatico.ca">matju@artengine.ca</a> +Copyright © 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard +<a href="mailto:matju@artengine.ca">matju@artengine.ca</a> </font></p> </td></tr></table></body></html> EOF @@ -561,12 +565,53 @@ end $nodes = {} XMLParserError = Exception if $use_rexml +def harvest_doc_of_class xclass, v, way + doc = case way; when:in:v.doc; when:out:v.doc_out end + tag = case way; when:in:"inlet"; when:out:"outlet" end + doc.keys.each {|sel| + text = v.doc[sel] + m=/^_(\d+)_(\w+)/.match sel.to_s + if m then + xclass << XNode[tag,{"id"=>Integer(m[1])}, + XNode["method",{"name"=>m[2]},XString.new(text)]] + else + xclass << XNode["method",{"name"=>sel.to_s},XString.new(text)] + end + } +end + +def harvest_doc tree + kla = {} + tree.contents.find_all {|x| XNode===x and x.tag=="section" }.each {|sex| + sex.contents.each {|y| + next unless XNode===y and y.tag=="class" + kla[y.att["name"]] = y + } + } + #STDERR.puts kla.inspect + tree << (nu=XNode["section",{"name"=>"(new documentation)"}]) + tree << (un=XNode["section",{"name"=>"(undocumented)"}]) + alph = GridFlow.fclasses.keys.sort + alph.each {|k| + next if /^@/=~k and GridFlow.fclasses[k.gsub(/^@/,"#")] + v = GridFlow.fclasses[k] + if v.doc then + nu << (xclass=XNode["class",{"name"=>k}]) + harvest_doc_of_class xclass, v, :in + harvest_doc_of_class xclass, v, :out + elsif not kla[k] then + un << XNode["p",{},XString.new("[#{k}]")] + end + } +end + def read_one_page file begin STDERR.puts "reading #{file}" parser = GFDocParser.new(file) parser.do_it $nodes[file] = parser.stack[0][0] + if file=="reference.xml" then harvest_doc $nodes[file] end rescue Exception => e puts "" puts "" @@ -587,8 +632,10 @@ def write_one_page file $file = file output_name = file.sub(/\.xml/,".html") STDERR.puts "writing #{output_name}" + STDOUT.flush # bug in 1.9 ? STDOUT.reopen output_name, "w" tree = $nodes[file] +# tree.contents.each {|x| STDERR.puts x.inspect } write_header(tree) mk(:tr) { mk(:td,:colspan,2) { mk(:div,:cols,tree.att["indexcols"]||1) { tree.show_index @@ -605,8 +652,9 @@ def write_one_page file end $files = %w( - install.xml project_policy.xml + install.xml reference.xml format.xml internals.xml architecture.xml) +# project_policy.xml $files.each {|input_name| read_one_page input_name } $files.each {|input_name| write_one_page input_name } diff --git a/externals/gridflow/doc/profiling.html b/externals/gridflow/doc/profiling.html index aac2ea1f..f804e87d 100644 --- a/externals/gridflow/doc/profiling.html +++ b/externals/gridflow/doc/profiling.html @@ -1,6 +1,6 @@ <html> <head> -<!-- $Id: profiling.html,v 1.1 2005-10-04 02:09:43 matju Exp $ --> +<!-- $Id: profiling.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Reference Manual: Architecture Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/doc/reference.html b/externals/gridflow/doc/reference.html index ac1f4373..8dce72ec 100644 --- a/externals/gridflow/doc/reference.html +++ b/externals/gridflow/doc/reference.html @@ -1,6 +1,6 @@ <html><head> -<!-- $Id: reference.html,v 1.1 2005-10-04 02:09:43 matju Exp $ --> -<title>GridFlow 0.8.0 - Reference Manual: Flow Classes</title> +<!-- $Id: reference.html,v 1.2 2006-03-15 04:44:50 matju Exp $ --> +<title>GridFlow 0.8.1 - Reference Manual: Flow Classes</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="gridflow.css" type="text/css"> </head> @@ -14,7 +14,7 @@ <tr><td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4" height="16"> - <h4>GridFlow 0.8.0 - Reference Manual: Flow Classes</h4> + <h4>GridFlow 0.8.1 - Reference Manual: Flow Classes</h4> </td></tr> <tr> <td width="5%" rowspan="2"> </td> @@ -129,6 +129,15 @@ <li><a href="#pd_netsend"><img src="flow_classes/pd_netsend-icon.png" alt="[pd_netsend]" border="0"></a></li> <li><a href="#pd_netreceive"><img src="flow_classes/pd_netreceive-icon.png" alt="[pd_netreceive]" border="0"></a></li> </ul> +<h4><a href="#(new_documentation)">(new documentation)</a></h4><ul> +<li><a href="#listfind"><img src="flow_classes/listfind-icon.png" alt="[listfind]" border="0"></a></li> +<li><a href="#memstat"><img src="flow_classes/memstat-icon.png" alt="[memstat]" border="0"></a></li> +<li><a href="#regsub"><img src="flow_classes/regsub-icon.png" alt="[regsub]" border="0"></a></li> +<li><a href="#sendgui"><img src="flow_classes/sendgui-icon.png" alt="[sendgui]" border="0"></a></li> +<li><a href="#sys_vgui"><img src="flow_classes/sys_vgui-icon.png" alt="[sys_vgui]" border="0"></a></li> +</ul> +<h4><a href="#(undocumented)">(undocumented)</a></h4><ul> +</ul> <br><br> </div></td></tr> <tr><td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> @@ -208,6 +217,13 @@ <img src="flow_classes/%23color-icon.png" alt="[#color]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> <p>Triple slider for the selection of RGB values.</p> <br><b>method</b> init <b>(</b><i>float</i> min<b>, </b><i>float</i> max<b>, </b><i>0,1</i> hidepreview<b>)</b> <br> <br><b>inlet 0 </b><b>method</b> grid <b>(</b><b>)</b> + changes all three values (R,G,B). The grid must + be a Dim(3). <br> + <br><b>inlet 0 </b><b>method</b> delegate <b>(</b><b>)</b> + sends the rest of the message to each of the three sliders. + this relies on the fact that [#color] is implemented using + three [hsl] and this might not still work in the far future. <br> + <br><b>outlet 0 </b><b>method</b> grid <b>(</b><b>)</b> Produces a Dim(3) grid of RGB values. <br> <br></td></tr><tr><td></td><td></td><td> </td></tr> <tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="#unpack">#unpack</a></td></tr><tr><td></td><td valign="top"><br> @@ -874,7 +890,11 @@ Outputs the fractions of a second up to 10 microseconds (?) (actual precision is This object is similar to the Unix list command 'ls'. It returns the names of files in a given directory. May be used with [listlength] to retrieve the number of files. - Hidden files are displayed. </p> <br><b>inlet 0 </b><b>method</b> symbol <b>(</b><b>)</b> <br> + Hidden files are displayed. </p> <br><b>inlet 0 </b><b>method</b> symbol <b>(</b><b>)</b> + lists all files in a given directory <br> + <br><b>inlet 0 </b><b>method</b> glob <b>(</b><b>)</b> + lists all files matching a given pattern. + "symbol hello" is like "glob hello/*" <br> <br></td></tr><tr><td></td><td></td><td> </td></tr> <tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="exec">exec</a></td></tr><tr><td></td><td valign="top"><br> <img src="flow_classes/exec-icon.png" alt="[exec]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> @@ -1057,13 +1077,88 @@ Outputs the HPGL commands in ASCII format <br></td></tr><tr><td></td><td></td><t same as jmax_udpreceive but for PureData UDP connections. <br></td></tr><tr><td></td><td></td><td> </td></tr> <tr><td> </td></tr> - <td colspan="4" bgcolor="black"> + <tr><td colspan="4" bgcolor="black"> +<img src="images/black.png" width="1" height="2"></td></tr> +<tr><td colspan="4"><a name="(new_documentation)"></a><h4>(new documentation)</h4></td></tr><tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="listfind">listfind</a></td></tr><tr><td></td><td valign="top"><br> +<img src="flow_classes/listfind-icon.png" alt="[listfind]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> +<br><b>method</b> _1_list <b>(</b><b>)</b> list to search into<br> +<br><b>method</b> _0_float <b>(</b><b>)</b> float to find in that list<br> +<br><b>method</b> _1_float <b>(</b><b>)</b> position of the incoming float in the stored list<br> +<br></td></tr><tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="memstat">memstat</a></td></tr><tr><td></td><td valign="top"><br> +<img src="flow_classes/memstat-icon.png" alt="[memstat]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> +<br><b>method</b> _0_bang <b>(</b><b>)</b> lookup process stats for the currently running pd+ruby and figure out how much RAM it uses.<br> +<br><b>method</b> _0_float <b>(</b><b>)</b> virtual size of RAM in kilobytes (includes swapped out and shared memory)<br> +<br></td></tr><tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="regsub">regsub</a></td></tr><tr><td></td><td valign="top"><br> +<img src="flow_classes/regsub-icon.png" alt="[regsub]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> +<br><b>method</b> _1_symbol <b>(</b><b>)</b> a regexp pattern to be found inside of the string<br> +<br><b>method</b> _0_symbol <b>(</b><b>)</b> a string to transform<br> +<br><b>method</b> _2_symbol <b>(</b><b>)</b> a replacement for the found pattern<br> +<br><b>method</b> _0_symbol <b>(</b><b>)</b> the transformed string<br> +<br></td></tr><tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="sendgui">sendgui</a></td></tr><tr><td></td><td valign="top"><br> +<img src="flow_classes/sendgui-icon.png" alt="[sendgui]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> +<br><b>method</b> _0_list <b>(</b><b>)</b> a Tcl/Tk command to send to the pd client.<br> +<br></td></tr><tr><td colspan="4" bgcolor="#ffb080"><b> class </b><a name="sys_vgui">sys_vgui</a></td></tr><tr><td></td><td valign="top"><br> +<img src="flow_classes/sys_vgui-icon.png" alt="[sys_vgui]" border="0"><br clear="left"><br><br><br clear="left"><br></td><td><br> +<br><b>method</b> _0_list <b>(</b><b>)</b> a Tcl/Tk command to send to the pd client.<br> +<br></td></tr><tr><td> </td></tr> +<tr><td colspan="4" bgcolor="black"> +<img src="images/black.png" width="1" height="2"></td></tr> +<tr><td colspan="4"><a name="(undocumented)"></a><h4>(undocumented)</h4></td></tr><tr><td></td><td></td><td><p>[#edit]</p></td></tr> +<tr><td></td><td></td><td><p>[#in]</p></td></tr> +<tr><td></td><td></td><td><p>[#in:aalib]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:file]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:grid]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:jpeg]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:mpeg]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:opengl]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:png]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:ppm]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:quicktime]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:sdl]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:targa]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:tk]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:videodev]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:window]</p></td></tr> +<tr><td></td><td></td><td><p>[#io:x11]</p></td></tr> +<tr><td></td><td></td><td><p>[#matrix_solve]</p></td></tr> +<tr><td></td><td></td><td><p>[#out]</p></td></tr> +<tr><td></td><td></td><td><p>[#peephole]</p></td></tr> +<tr><td></td><td></td><td><p>[@!]</p></td></tr> +<tr><td></td><td></td><td><p>[@eight]</p></td></tr> +<tr><td></td><td></td><td><p>[@four]</p></td></tr> +<tr><td></td><td></td><td><p>[@global]</p></td></tr> +<tr><td></td><td></td><td><p>[@scale_to]</p></td></tr> +<tr><td></td><td></td><td><p>[@three]</p></td></tr> +<tr><td></td><td></td><td><p>[@two]</p></td></tr> +<tr><td></td><td></td><td><p>[GridObject]</p></td></tr> +<tr><td></td><td></td><td><p>[SoundMixer]</p></td></tr> +<tr><td></td><td></td><td><p>[ascii]</p></td></tr> +<tr><td></td><td></td><td><p>[broken]</p></td></tr> +<tr><td></td><td></td><td><p>[button]</p></td></tr> +<tr><td></td><td></td><td><p>[delcomusb]</p></td></tr> +<tr><td></td><td></td><td><p>[for]</p></td></tr> +<tr><td></td><td></td><td><p>[gfmessagebox]</p></td></tr> +<tr><td></td><td></td><td><p>[gridflow]</p></td></tr> +<tr><td></td><td></td><td><p>[jcomment]</p></td></tr> +<tr><td></td><td></td><td><p>[jmax4_udpreceive]</p></td></tr> +<tr><td></td><td></td><td><p>[jmax4_udpsend]</p></td></tr> +<tr><td></td><td></td><td><p>[joystick_port]</p></td></tr> +<tr><td></td><td></td><td><p>[jpatcher]</p></td></tr> +<tr><td></td><td></td><td><p>[klippeltronics]</p></td></tr> +<tr><td></td><td></td><td><p>[loadbang]</p></td></tr> +<tr><td></td><td></td><td><p>[messbox]</p></td></tr> +<tr><td></td><td></td><td><p>[parallel_port]</p></td></tr> +<tr><td></td><td></td><td><p>[pd_netsocket]</p></td></tr> +<tr><td></td><td></td><td><p>[system]</p></td></tr> +<tr><td></td><td></td><td><p>[toggle]</p></td></tr> +<tr><td> </td></tr> +<td colspan="4" bgcolor="black"> <img src="images/black.png" width="1" height="2"></td></tr> <tr><td colspan="4"> <p><font size="-1"> -GridFlow 0.8.0 Documentation<br> -Copyright © 2001,2002,2003,2004,2005 by Mathieu Bouchard -<a href="mailto:matju@sympatico.ca">matju@artengine.ca</a> +GridFlow 0.8.1 Documentation<br> +Copyright © 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard +<a href="mailto:matju@artengine.ca">matju@artengine.ca</a> </font></p> </td></tr></table></body></html> diff --git a/externals/gridflow/doc/reference.xml b/externals/gridflow/doc/reference.xml index 8a5f8f7e..e7bf94a1 100644 --- a/externals/gridflow/doc/reference.xml +++ b/externals/gridflow/doc/reference.xml @@ -1,10 +1,11 @@ <?xml version="1.0" standalone="no" ?> <!DOCTYPE documentation SYSTEM 'gridflow.dtd'> <documentation title="Reference Manual: Flow Classes" indexcols="3"> -<!-- $Id: reference.xml,v 1.1 2005-10-04 02:09:43 matju Exp $ --> +<!-- $Id: reference.xml,v 1.2 2006-03-15 04:44:50 matju Exp $ --> <!-- GridFlow Reference Manual: Class Reference - Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard and Alexandre Castonguay + Copyright (c) 2001,2002,2003,2004,2005,2006 + by Mathieu Bouchard and Alexandre Castonguay --> <section name="Objects for making grids and breaking them down"> @@ -148,8 +149,17 @@ <arg name="hidepreview" type="0,1"></arg> </method> <inlet id="0"><method name="grid"> - Produces a Dim(3) grid of RGB values. + changes all three values (R,G,B). The grid must + be a Dim(3). + </method> + <method name="delegate"> + sends the rest of the message to each of the three sliders. + this relies on the fact that [#color] is implemented using + three [hsl] and this might not still work in the far future. </method></inlet> + <outlet id="0"><method name="grid"> + Produces a Dim(3) grid of RGB values. + </method></outlet> </class> <class name="#unpack"> @@ -1342,7 +1352,13 @@ directory. May be used with [listlength] to retrieve the number of files. Hidden files are displayed. </p> - <inlet id="0"><method name="symbol"/></inlet> + <inlet id="0"><method name="symbol"> + lists all files in a given directory + </method> + <method name="glob"> + lists all files matching a given pattern. + "symbol hello" is like "glob hello/*" + </method></inlet> </class> <class name="exec"> diff --git a/externals/gridflow/doc/tutorials/0-0-intro_page.pd b/externals/gridflow/doc/tutorials/0-0-intro_page.pd new file mode 100755 index 00000000..3ac9fb86 --- /dev/null +++ b/externals/gridflow/doc/tutorials/0-0-intro_page.pd @@ -0,0 +1,89 @@ +#N canvas 226 0 429 638 10; +#X obj -22 -68 cnv 1 430 80 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj -24 49 cnv 1 430 520 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj -24 82 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 57 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -17 49 cnv 1 2 480 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 390 50 cnv 1 2 480 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 144 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 168 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 26 98 1.1 What is a grid?; +#X obj 41 534 cnv 15 300 30 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 53 539 Stephanie Brodeur & Darsha Hewitt 2005; +#X obj -22 7 cnv 15 430 30 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 88 -3 cnv 15 100 17 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 88 -5 GridFlow 0.8.0; +#X obj -22 -68 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj -23 37 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 189 11 cnv 15 63 17 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 188 8 Tutorials; +#X obj -24 48 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj -24 528 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X text 14 63 1; +#X obj 32 62 Introduction to Grids; +#X text 26 178 2.1 How does GridFlow understand images?; +#X text 15 150 2; +#X obj 36 147 Introduction to Images; +#X text 419 224 2.3 Different options on how to open an image.; +#X text 445 241 2.3.1 Opening different images in one window.; +#X text 445 258 2.3.2 Opening images using send and receive.; +#X obj -24 310 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 334 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 18 317 3; +#X obj 39 315 Introduction to Video; +#X text 482 201 REMOVE 2.3 -- see pd tuts; +#X text 17 405 4; +#X obj 38 405 Introduction to Live Feed; +#X obj 37 481 Putting it all Together; +#X text 20 482 5; +#X text 30 430 4.1 Opening a live video feed; +#X text 30 446 4.2 Motion Detection; +#X text 29 372 3.3 Recording video; +#X obj -24 310 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 334 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 400 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 424 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 400 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 424 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 476 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 500 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 476 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj -24 500 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 26 114 1.2 How to create a grid; +#X text 26 197 2.2 Opening an image; +#X text 26 214 2.3 Image manipulation; +#X text 55 244 2.3.2 Resizing an image; +#X text 55 228 2.3.1 Numop; +#X text 55 273 2.3.4 Remap image; +#X text 55 259 2.3.3 Greyscale; +#X text 55 286 2.3.5 Convolve; +#X text 29 342 3.1 Opening a video; +#X text 29 358 3.2 Video manipulation; diff --git a/externals/gridflow/doc/tutorials/2-3-4-image-modification-2-remap-image.pd b/externals/gridflow/doc/tutorials/2-3-4-image-modification-2-remap-image.pd new file mode 100755 index 00000000..b6e4755d --- /dev/null +++ b/externals/gridflow/doc/tutorials/2-3-4-image-modification-2-remap-image.pd @@ -0,0 +1,55 @@ +#N canvas 41 17 876 618 10; +#X obj 10 519 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X msg 53 173 open b001.jpg; +#X obj 23 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 23 204 #in; +#X obj 23 142 t b b; +#X obj 23 351 #out window; +#X obj 102 323 #print; +#X obj 184 160 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X floatatom 203 225 5 0 0 0 - - -; +#X obj 173 184 #for (0 0) (240 320) (1 1); +#X obj 173 134 metro 100; +#X obj 173 109 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 23 292 #remap_image; +#X text 18 526 GridFlow 0.8.0; +#X text 243 224 <-- Modify the value to see transformations.; +#X obj 173 257 # / 1; +#X text 227 261 The remap object works with numops.; +#X obj 9 -17 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 9 -52 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 15 -17 2.4 Image Manipulation; +#X text 16 -46 2 Introduction to Images; +#X text 15 2 2.4.4 Remap Image; +#X text 26 408 Remap image permits you to modify an image using numeric +operators. Different numeric Operators have different effects ton the +image and can be changed to give the desired effect. The multiplication +operator multiplies the values and distorts the image. The division +operator does the same but shrinks the operator...; +#X text 467 24 Have the list of operators and what they do in order +to know the various effects.; +#X text 468 77 example:; +#X obj 474 121 # / 2; +#X text 523 114 multiplication multiplies the numbers in the grid and +distorts the image.; +#N canvas 0 0 450 300 META 0; +#X restore 130 527 pd META; +#X connect 1 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 12 0; +#X connect 4 0 3 0; +#X connect 4 1 1 0; +#X connect 7 0 9 0; +#X connect 8 0 15 1; +#X connect 9 0 15 0; +#X connect 10 0 9 0; +#X connect 11 0 10 0; +#X connect 12 0 5 0; +#X connect 12 1 6 0; +#X connect 15 0 12 1; diff --git a/externals/gridflow/doc/tutorials/2-3-5-image-modification-2-convolve.pd b/externals/gridflow/doc/tutorials/2-3-5-image-modification-2-convolve.pd new file mode 100755 index 00000000..4a099537 --- /dev/null +++ b/externals/gridflow/doc/tutorials/2-3-5-image-modification-2-convolve.pd @@ -0,0 +1,120 @@ +#N canvas 47 0 787 658 10; +#X msg 468 148 3 3 # 0 4 0 4 9 -4 0 -4 0; +#X msg 467 100 3 3 # 4 0 0 0 1 0 0 0 4; +#X obj 80 219 #store; +#X obj 80 270 # / 9; +#X msg 467 75 3 3 # 1 1 1 1 1 1 1 1 1; +#X obj -13 201 #out window; +#X msg 470 263 1 3 # 0 9 -9; +#X obj -21 117 #in; +#X msg 468 124 3 3 # 2 2 2 2 -7 2 2 2 2; +#X obj 80 145 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +; +#X obj 70 325 @! abs; +#X obj -21 77 loadbang; +#X obj 80 182 metro 33.3667; +#X obj -21 139 t a; +#X obj 80 244 #convolve \, seed 4; +#X obj 401 78 loadbang; +#X obj 80 299 shunt 2; +#X obj 124 270 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +1; +#X msg 170 280 0; +#X obj 124 351 # + 128; +#X msg 170 304 1; +#X obj 469 174 display; +#X obj -13 225 fps; +#X obj -13 250 print; +#X obj -50 466 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text -42 473 GridFlow 0.8.0; +#X text -42 473 GridFlow 0.8.0; +#X msg 470 242 1 3 # 0 2 -2; +#X msg 470 325 3 3 # 0 -1 0 -1 4 -1 0 -1 0; +#X msg 470 348 3 3 # -1 -1 -1 -1 8 -1 -1 -1 -1; +#X msg 470 416 3 3 # 0 -1 0 -1 13 -1 0 -1 0; +#X obj 124 325 # << 4; +#X msg -21 97 open babbage.jpg \, bang; +#X obj -49 -111 cnv 15 780 15 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj -49 -146 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 +-66577 0; +#X obj 470 218 cnv 15 100 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X obj 468 52 cnv 15 37 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 470 218 Edge detection; +#X obj 470 303 cnv 15 110 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 472 303 Laplacian masks; +#X obj 470 393 cnv 15 50 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 470 393 Sharpen; +#X obj -21 383 #clip; +#X obj 190 118 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X obj 210 97 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X text 146 97 <-- step #1: load image; +#X obj 173 141 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X text 109 141 <-- step #3: start metro; +#X text 154 118 step #2: select transformation -->; +#X text 468 52 Blurs; +#N canvas 0 0 450 300 META 0; +#X restore 69 473 pd META; +#X text -44 -140 2 Introduction to Images; +#X text -44 -112 2.4 Image Manipulation; +#X obj -49 24 cnv 15 780 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text -49 23 (Source convolve.pd : Copyright Mathieu Bouchard 2002) +; +#X text -16 -67 Convolve is an abstraction used for modifying an image. +In this patch you can choose to create a "blur" \, to view "edge detection" +\, to add a "laplacian mask" or to "sharpen" an image. The image must +be loaded \, the transformation selected and the metro started before +seeing the transformation applied to the image.; +#X obj -17 -89 cnv 15 100 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text -17 -90 2.4.4 Convolve; +#X connect 0 0 18 0; +#X connect 0 0 14 1; +#X connect 0 0 21 0; +#X connect 1 0 18 0; +#X connect 1 0 14 1; +#X connect 2 0 14 0; +#X connect 3 0 16 0; +#X connect 4 0 18 0; +#X connect 4 0 14 1; +#X connect 5 0 22 0; +#X connect 6 0 14 1; +#X connect 6 0 20 0; +#X connect 7 0 13 0; +#X connect 8 0 18 0; +#X connect 8 0 14 1; +#X connect 9 0 12 0; +#X connect 10 0 42 0; +#X connect 11 0 32 0; +#X connect 12 0 2 0; +#X connect 13 0 2 1; +#X connect 13 0 5 0; +#X connect 14 0 3 0; +#X connect 15 0 4 0; +#X connect 16 0 10 0; +#X connect 16 1 31 0; +#X connect 17 0 16 1; +#X connect 18 0 17 0; +#X connect 19 0 42 0; +#X connect 20 0 17 0; +#X connect 22 0 23 0; +#X connect 27 0 18 0; +#X connect 27 0 14 1; +#X connect 28 0 14 1; +#X connect 28 0 20 0; +#X connect 29 0 20 0; +#X connect 29 0 14 1; +#X connect 30 0 18 0; +#X connect 30 0 14 1; +#X connect 31 0 19 0; +#X connect 32 0 7 0; +#X connect 42 0 13 0; diff --git a/externals/gridflow/doc/tutorials/2-3-6-image-modification-2-cross-fade.pd b/externals/gridflow/doc/tutorials/2-3-6-image-modification-2-cross-fade.pd new file mode 100755 index 00000000..6b8fe50a --- /dev/null +++ b/externals/gridflow/doc/tutorials/2-3-6-image-modification-2-cross-fade.pd @@ -0,0 +1,93 @@ +#N canvas 92 129 774 521 10; +#X text 24 355 note: the #layer/#join objects can make the crossfade +process simpler but it's still not faster.; +#X obj 14 95 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 14 120 metro 33.3667; +#X obj 14 140 float; +#X obj 26 169 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +-262144 -1 -1 0 256; +#X obj 58 139 + 4; +#X obj 14 190 pingpong 256; +#X obj 25 212 hsl 129 15 0 256 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X text 25 393 also #draw_image/#join is a possibility; +#X obj 13 40 cnv 15 680 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 27 53 Copyright 2002 Mathieu Bouchard; +#X text 27 37 cross_fade.pd; +#X obj 6 324 cnv 15 680 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 18 326 GridFlow 0.8.0; +#N canvas 515 126 450 300 cross_fade 0; +#X obj 40 198 # *>>8; +#X text 67 242 first picture plus a fraction of the difference; +#X obj 40 240 # +; +#X obj 40 177 #store; +#X obj 264 137 # inv+; +#X obj 95 261 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +; +#X msg 422 195 open r001.jpg \, cast int16 \, bang; +#X obj 321 156 #in; +#X obj 40 156 #finished; +#X text 116 264 click to clip out-of-range colours; +#X text 89 197 multiply by a N/256 fraction; +#X obj 88 302 # max 0; +#X obj 254 89 #in; +#X obj 88 281 # min 255; +#X obj 44 337 #out window; +#X obj 40 116 #cast int16; +#X text 88 177 keep the difference between both pictures; +#X obj 447 99 t b b; +#X obj 445 74 loadbang; +#X obj 40 260 shunt 2; +#X obj 40 135 t a a; +#X msg 459 137 open g001.jpg \, cast int16 \, bang; +#X obj 30 75 inlet; +#X connect 0 0 2 0; +#X connect 2 0 19 0; +#X connect 3 0 0 0; +#X connect 4 0 3 1; +#X connect 5 0 19 1; +#X connect 6 0 7 0; +#X connect 7 0 4 1; +#X connect 8 0 3 0; +#X connect 11 0 14 0; +#X connect 12 0 4 0; +#X connect 12 0 2 1; +#X connect 13 0 11 0; +#X connect 15 0 20 0; +#X connect 17 0 21 0; +#X connect 17 1 6 0; +#X connect 18 0 17 0; +#X connect 19 0 14 0; +#X connect 19 1 13 0; +#X connect 20 0 8 0; +#X connect 20 1 0 1; +#X connect 21 0 12 0; +#X connect 22 0 15 0; +#X restore 13 261 pd cross_fade; +#X obj 15 11 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 18 11 What is a grid?; +#X obj 15 -24 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 20 -25 2 Images; +#X text 22 -11 Description: opening multiple images from one window. +; +#X obj 11 416 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 19 423 GridFlow 0.8.0; +#X text 219 118 some objects have been created to perform specoific +tasks. One of these is the crossfade patch it permits you to fade from +one image to another. you can chose the images you want to ping pong +between \, to get a nice steady fade between two images.; +#N canvas 0 0 450 300 META 0; +#X restore 146 428 pd META; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 3 0 5 0; +#X connect 3 0 6 0; +#X connect 5 0 3 1; +#X connect 6 0 7 0; +#X connect 6 0 14 0; diff --git a/externals/gridflow/doc/tutorials/2nd-part-numop.pd b/externals/gridflow/doc/tutorials/2nd-part-numop.pd new file mode 100755 index 00000000..a6f96f9c --- /dev/null +++ b/externals/gridflow/doc/tutorials/2nd-part-numop.pd @@ -0,0 +1,80 @@ +#N canvas 66 33 927 601 10; +#X obj 16 -206 cnv 15 200 170 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 38 -178 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 24 -127 #in; +#X obj 82 -114 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -241291 +-1 -1 0 1; +#X obj 24 -88 # + \$1; +#X obj 125 -157 metro 33.3; +#X obj 125 -177 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 +1; +#X obj 462 -153 cnv 15 400 350 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 482 -109 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 468 -30 #in; +#X msg 468 -132 open b001.jpg; +#X obj 508 -49 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -241291 +-1 -1 0 1; +#X obj 468 84 # + \$1; +#X obj 514 -109 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 +1; +#X obj 468 128 #clip; +#X obj 24 -60 s slider_metro; +#X obj 468 154 s slider_metro_clip; +#X floatatom 79 -86 5 0 0 0 - - -; +#X text 10 210 In all these examples the [# +] numop is used. All the +numeric operators can be found in the numeric operator help patch (right +click on the [# +] and select help to view them). If you want to see +what effects other numops can do \, try replacing the [# +] numop with +another one (either cut and past a different numop from the help file +or create the object in the current canvas.; +#X obj 514 -89 metro 33.3; +#X obj 552 -21 #color; +#X msg 552 44 255 0 0; +#X text 614 44 donner une liste changer couleurs; +#X obj 552 88 #scale_by (8 8); +#X msg 552 66 2 2 3 # 255 0 0 0 255 0 0 0 255 191 191 191; +#X obj 834 211 r slider_metro; +#X obj 843 238 r slider_metro_clip; +#X obj 834 265 #out window; +#X obj 16 -284 cnv 15 70 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 15 -284 Example #4; +#X text 15 -261 Will demonstrate how to use the metro (see pd_intro +#4) and the slider which allows you to scroll through values and modify +a grid in real-time.; +#X msg 24 -202 open b001.jpg; +#X obj 456 -281 cnv 15 70 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 455 -281 Example #5; +#X text 457 -260 We introduce the [#clip] object. It is used with numops +in order to set constraints on the pixel to eliminate color wrapping. +Colour wrapping occurs when the individual pixel values in a grid exceed +255 which results in over-saturation of colour. GridFlow reads colours +as values from 0 (black) to 255 (white). Refer to glossary for more +information on colour.; +#X connect 1 0 2 0; +#X connect 2 0 4 0; +#X connect 3 0 4 1; +#X connect 3 0 17 0; +#X connect 4 0 15 0; +#X connect 5 0 2 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 12 0; +#X connect 10 0 9 0; +#X connect 11 0 12 1; +#X connect 12 0 14 0; +#X connect 13 0 19 0; +#X connect 14 0 16 0; +#X connect 19 0 9 0; +#X connect 20 0 12 1; +#X connect 21 0 12 1; +#X connect 23 0 12 1; +#X connect 24 0 23 0; +#X connect 25 0 27 0; +#X connect 26 0 27 0; +#X connect 31 0 2 0; diff --git a/externals/gridflow/doc/tutorials/3-1-0-open-video.pd b/externals/gridflow/doc/tutorials/3-1-0-open-video.pd new file mode 100755 index 00000000..2abf0e74 --- /dev/null +++ b/externals/gridflow/doc/tutorials/3-1-0-open-video.pd @@ -0,0 +1,38 @@ +#N canvas 48 56 545 431 10; +#X obj 100 156 #in; +#X obj 100 222 #out window; +#X obj 124 33 openpanel; +#X obj 124 9 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 124 58 open \$1; +#X obj 17 11 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 17 45 metro 33.33; +#X floatatom 317 190 5 0 0 0 - - -; +#X obj 401 166 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 401 193 print go; +#X msg 201 124 loop 0; +#X msg 201 97 loop 1; +#X msg 283 13 open home/steph/Desktop/PDDP_summer; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 10 -37 What is a grid?; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -73 2 Images; +#X text 14 -59 Description: opening multiple images from one window. +; +#X obj 8 320 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 16 327 GridFlow 0.8.0; +#X connect 0 0 1 0; +#X connect 0 1 7 0; +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 0 0; +#X connect 5 0 6 0; +#X connect 6 0 0 0; +#X connect 8 0 9 0; +#X connect 10 0 0 0; +#X connect 11 0 0 0; +#X connect 12 0 0 0; diff --git a/externals/gridflow/doc/tutorials/3-2-video-manipulation.pd b/externals/gridflow/doc/tutorials/3-2-video-manipulation.pd new file mode 100755 index 00000000..78a7b427 --- /dev/null +++ b/externals/gridflow/doc/tutorials/3-2-video-manipulation.pd @@ -0,0 +1 @@ +#N canvas 0 0 450 300 10; diff --git a/externals/gridflow/doc/tutorials/3-3-record-video.pd b/externals/gridflow/doc/tutorials/3-3-record-video.pd new file mode 100755 index 00000000..ff158554 --- /dev/null +++ b/externals/gridflow/doc/tutorials/3-3-record-video.pd @@ -0,0 +1,51 @@ +#N canvas 151 21 517 609 10; +#X obj 15 320 #camera; +#X obj 15 260 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +; +#X obj 142 370 #out window; +#X obj 90 260 hsl 128 15 20 300 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 142 395 fps detailed; +#X obj 142 419 print; +#X obj 15 294 metro 100; +#X obj 53 473 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 129 506 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 149 505 stop recording; +#X text 73 471 select filename; +#X text 111 488 start recording; +#X obj 91 489 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 15 528 #record_quicktime; +#X text 21 54 To record a video from a live stream or a video... you +can use this patch.; +#X text 224 315 xinitrc ssh pdrc bach rc export bookmarks; +#X text 11 110 The outside of the patch uses objects seen in previous +patches. The [#record_quicktime] object is an abstraction in which +the settings and the optins are situated. to contruct the patch ... +Do we explain how to do it if it is in an abstraction???; +#X text 86 198 we don't nec have to explain how to build it since its +available to them through the pd_examples and they have been through +enough patvhes to easily understand what's going on.; +#X obj 11 29 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 14 29 What is a grid?; +#X obj 11 -6 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 21 -7 2 Images; +#X text 18 7 Description: opening multiple images from one window. +; +#X obj 13 561 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 21 568 GridFlow 0.8.0; +#X connect 0 0 2 0; +#X connect 0 0 13 0; +#X connect 1 0 6 0; +#X connect 2 0 4 0; +#X connect 3 0 6 1; +#X connect 4 0 5 0; +#X connect 6 0 0 0; +#X connect 7 0 13 1; +#X connect 8 0 13 3; +#X connect 12 0 13 2; diff --git a/externals/gridflow/doc/tutorials/4-0-open-live-stream.pd b/externals/gridflow/doc/tutorials/4-0-open-live-stream.pd new file mode 100755 index 00000000..7ce60b4d --- /dev/null +++ b/externals/gridflow/doc/tutorials/4-0-open-live-stream.pd @@ -0,0 +1,24 @@ +#N canvas 286 99 571 305 10; +#X obj 91 104 #camera; +#X obj 40 40 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 91 12 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 91 59 metro 50; +#X obj 91 151 #out window; +#X text 162 103 In this case there is no need for the [#in] objec. +Thereis one in the [#camera] object already.; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 10 -37 What is a grid?; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -73 2 Images; +#X text 14 -59 Description: opening multiple images from one window. +; +#X obj 10 197 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 18 204 GridFlow 0.8.0; +#X connect 0 0 4 0; +#X connect 1 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 0 0; diff --git a/externals/gridflow/doc/tutorials/4-1-2-simple-motion-detection-absolute-value.pd b/externals/gridflow/doc/tutorials/4-1-2-simple-motion-detection-absolute-value.pd new file mode 100755 index 00000000..a4021d41 --- /dev/null +++ b/externals/gridflow/doc/tutorials/4-1-2-simple-motion-detection-absolute-value.pd @@ -0,0 +1,31 @@ +#N canvas 452 202 450 438 10; +#X obj 91 104 #camera; +#X obj 40 40 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 91 12 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 91 59 metro 50; +#X obj 100 253 #out window; +#X obj 88 134 trigger anything anything; +#X obj 133 162 # -; +#X obj 133 201 #clip; +#X obj 343 223 @! abs; +#X obj 343 254 # + 50; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 10 -37 What is a grid?; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -73 2 Images; +#X text 14 -59 Description: opening multiple images from one window. +; +#X obj 8 320 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 16 327 GridFlow 0.8.0; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 0 0; +#X connect 5 0 6 1; +#X connect 5 1 6 0; +#X connect 6 0 7 0; +#X connect 7 0 4 0; diff --git a/externals/gridflow/doc/tutorials/4-1-3-motion-detection-more-advanced-and-more-options.pd b/externals/gridflow/doc/tutorials/4-1-3-motion-detection-more-advanced-and-more-options.pd new file mode 100755 index 00000000..112d2f8c --- /dev/null +++ b/externals/gridflow/doc/tutorials/4-1-3-motion-detection-more-advanced-and-more-options.pd @@ -0,0 +1,49 @@ +#N canvas 476 26 450 542 10; +#X obj 91 104 #camera; +#X obj 248 302 #out window; +#X obj 40 40 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X text 167 102 there is an [#in] within [#camera]; +#X obj 80 12 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 248 325 fps detailed; +#X obj 248 351 print; +#X obj 108 20 metro 50; +#X obj 248 198 # -; +#X obj 248 269 #clip; +#X obj 248 220 @! abs; +#X obj 248 244 # + 50; +#X obj 164 141 trigger anything anything; +#X text 281 197 230400 (240x320x3); +#X obj 101 303 #rgb_to_greyscale; +#X obj 101 326 #centroid; +#X floatatom 154 404 5 0 0 0 - - -; +#X floatatom 200 403 5 0 0 0 - - -; +#X obj 85 375 display; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 10 -37 What is a grid?; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -73 2 Images; +#X text 14 -59 Description: opening multiple images from one window. +; +#X obj 6 432 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 14 439 GridFlow 0.8.0; +#X connect 0 0 12 0; +#X connect 1 0 5 0; +#X connect 2 0 0 0; +#X connect 4 0 7 0; +#X connect 5 0 6 0; +#X connect 7 0 0 0; +#X connect 8 0 10 0; +#X connect 9 0 1 0; +#X connect 9 0 14 0; +#X connect 10 0 11 0; +#X connect 11 0 9 0; +#X connect 12 0 8 1; +#X connect 12 1 8 0; +#X connect 14 0 15 0; +#X connect 15 0 18 0; +#X connect 15 1 16 0; +#X connect 15 2 17 0; diff --git a/externals/gridflow/doc/tutorials/4-1-simple-motion-detection.pd b/externals/gridflow/doc/tutorials/4-1-simple-motion-detection.pd new file mode 100755 index 00000000..bb3962a1 --- /dev/null +++ b/externals/gridflow/doc/tutorials/4-1-simple-motion-detection.pd @@ -0,0 +1,37 @@ +#N canvas 83 181 707 437 10; +#X obj 91 104 #camera; +#X obj 40 40 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 91 12 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 91 59 metro 50; +#X obj 100 253 #out window; +#X obj 40 136 trigger anything anything; +#X obj 89 187 # -; +#X obj 89 226 #clip; +#X text 245 235 as a short cut you can use [t a a]. The values of one +frame are substracted from the previous frame only keeps the difference +and gives allows you to see the movement that occured between the first +seconde frame in relation to the first one.; +#X text 242 38 Motion detection is a way to view only the movement +in a space. Movement can be detected in darkness and seen as a video +image. the detection occurs when one frame it substractes the current +frame froom the last frame.; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 10 -37 What is a grid?; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -73 2 Images; +#X text 14 -59 Description: opening multiple images from one window. +; +#X obj 8 320 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 16 327 GridFlow 0.8.0; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 0 0; +#X connect 5 0 6 1; +#X connect 5 1 6 0; +#X connect 6 0 7 0; +#X connect 7 0 4 0; diff --git a/externals/gridflow/doc/tutorials/PD-GF-Lecture.pd b/externals/gridflow/doc/tutorials/PD-GF-Lecture.pd new file mode 100755 index 00000000..1f7b6d52 --- /dev/null +++ b/externals/gridflow/doc/tutorials/PD-GF-Lecture.pd @@ -0,0 +1,80 @@ +#N canvas 23 16 880 578 10; +#X obj 5 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 550 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 666 549 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#X text 9 13 Welcome to Pure-Data...; +#X obj 6 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 11 46 What is Pure-Data (aka PD)?; +#X obj 4 233 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 25 271 pddp_open pure-data-1; +#X obj 25 294 pddp_open pure-data-2; +#X obj 25 317 pddp_open pure-data-3; +#X obj 25 340 pddp_open pure-data-4; +#X text 200 271 Pure-Data Introduction; +#X text 200 294 GUI Objects for Interaction; +#X text 200 317 Creating your first patch; +#X text 200 340 Control: metro \, random & counter; +#X obj 444 233 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X obj 5 391 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 25 416 pddp_open pure-data-5; +#X obj 25 439 pddp_open pure-data-6; +#X text 200 439 The powerful message object; +#X obj 25 462 pddp_open pure-data-7; +#X text 200 462 More about lists; +#X text 200 485 Nesting collections of objects; +#X text 200 416 Connectionless communications; +#X obj 25 485 pddp_open pure-data-8; +#X text 200 509 Using GUI's in abstractions; +#X obj 25 509 pddp_open pure-data-9; +#X obj 445 391 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X text 642 296 Introduction to Images; +#X obj 468 271 pddp_open GridFlow-1; +#X obj 468 294 pddp_open GridFlow-2; +#X obj 468 317 pddp_open GridFlow-3; +#X obj 468 340 pddp_open GridFlow-4; +#X text 642 319 Introduction to video; +#X text 642 342 Introduction to Live Feeds; +#X obj 446 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 451 46 What is GridFLow?; +#X text 642 457 Putting it all together; +#X text 641 428 Interfacing with sensors; +#X text 642 273 Introduction to Grids; +#X obj 467 429 pddp_open GridFlow-6; +#X obj 467 452 pddp_open GridFlow-7; +#X text 451 236 2 Introduction to GridFlow; +#X text 454 144 This section deals with the particular objects related +to GridFlow. GridFlow uses the usual PD "control" objects \, as well +as a set of GridFlow specific objects. Before we get into the tutorials +we will explain the grid "#" \, the most important concept in GridFlow. +; +#X text 453 84 GridFlow is a plug-in for PureData that introduces the +frid (#) data type into the PD environment. GridFlow allows you to +work with live video \, still images and video files in a real-time +environment.; +#X text 14 85 Pure-Data is an open-source patching environment for +multi-media (audio+image). Pure-Data is a programming language where +you create relationships by connecting visual boxes (rather than typing +complex commands). This lecture is separated into three sections: An +Introduction to Pure-Data \, An introduction to GridFlow and intermediate +PD and GridFlow.; +#X obj 448 236 cnv 15 15 15 empty empty empty 20 12 0 14 -262144 -66577 +0; +#X text 451 236 2 Introduction to GridFlow; +#X obj 8 395 cnv 15 15 15 empty empty empty 20 12 0 14 -262144 -66577 +0; +#X obj 449 395 cnv 15 15 15 empty empty empty 20 12 0 14 -262144 -66577 +0; +#X obj 7 236 cnv 15 15 15 empty empty empty 20 12 0 14 -262144 -66577 +0; +#X text 452 395 4 Intermediate GridFlow; +#X text 10 236 1 Introduction to Pure-Data; +#X text 11 395 3 Intermediate Pure-Data; diff --git a/externals/gridflow/doc/tutorials/PD-Lecture.pd b/externals/gridflow/doc/tutorials/PD-Lecture.pd new file mode 100755 index 00000000..e2f269c5 --- /dev/null +++ b/externals/gridflow/doc/tutorials/PD-Lecture.pd @@ -0,0 +1,64 @@ +#N canvas 116 102 890 501 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 457 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 459 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#X text 12 13 Welcome to Pure-Data...; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 46 What is Pure-Data (aka PD)?; +#X text 28 74 Pure-Data is an open-source patching environment for +multi-media (audio+image). Pure-Data is a programming language where +you create relationships by connecting visual boxes (rather than typing +complex commands). This lecture is separated into three sections: An +Introduction to Pure-Data \, An introduction to Gem and intermediate +PD and Gem.; +#X obj 8 176 cnv 15 430 120 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 22 198 pddp_open pure-data-1; +#X obj 22 221 pddp_open pure-data-2; +#X obj 22 244 pddp_open pure-data-3; +#X obj 22 267 pddp_open pure-data-4; +#X text 197 198 Pure-Data Introduction; +#X text 197 221 GUI Objects for Interaction; +#X text 197 244 Creating your first patch; +#X text 197 267 Control: metro \, random & counter; +#X obj 8 306 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 176 Introduction to Pure-Data; +#X text 13 306 Introduction to Gem (Graphics Environment for Multimedia) +; +#X obj 22 328 pddp_open gem-1; +#X obj 22 351 pddp_open gem-2; +#X obj 22 374 pddp_open gem-3; +#X obj 22 397 pddp_open gem-4; +#X obj 22 421 pddp_open gem-5; +#X text 197 328 Gem Introduction; +#X text 197 351 What are gemchains?; +#X text 197 374 translate \, rotate and scale; +#X text 197 397 Texturing using pix objects; +#X text 197 421 Video & Free Exploration; +#X obj 448 46 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 46 Intermediate Pure-Data; +#X obj 462 68 pddp_open pure-data-5; +#X obj 462 91 pddp_open pure-data-6; +#X text 637 91 The powerful message object; +#X obj 462 114 pddp_open pure-data-7; +#X text 637 114 More about lists; +#X text 637 137 Nesting collections of objects; +#X text 637 68 Connectionless communications; +#X obj 462 137 pddp_open pure-data-8; +#X text 637 161 Using GUI's in abstractions; +#X obj 462 161 pddp_open pure-data-9; +#X obj 448 200 cnv 15 430 95 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 637 222 Grouping Gem entities; +#X text 637 245 Gem render order; +#X text 453 200 Intermediate Gem; +#X obj 462 222 pddp_open gem-6; +#X obj 462 245 pddp_open gem-7; +#X obj 462 268 pddp_open gem-8; +#X text 637 268 Video Tracking & Pixel Operations; diff --git a/externals/gridflow/doc/tutorials/colors.pd b/externals/gridflow/doc/tutorials/colors.pd new file mode 100755 index 00000000..39582d52 --- /dev/null +++ b/externals/gridflow/doc/tutorials/colors.pd @@ -0,0 +1,12 @@ +#N canvas 50 148 450 206 10; +#X obj -10 -171 #pack 3; +#X obj 46 -203 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -241291 +-1 -1 0 1; +#X obj 46 -223 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -241291 +-1 -1 0 1; +#X obj 46 -243 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -241291 +-1 -1 0 1; +#X obj -6 -132 #color; +#X connect 1 0 0 2; +#X connect 2 0 0 1; +#X connect 3 0 0 0; diff --git a/externals/gridflow/doc/tutorials/d_gf_2_0-Intro_to_images_open_image.pd b/externals/gridflow/doc/tutorials/d_gf_2_0-Intro_to_images_open_image.pd new file mode 100644 index 00000000..a95ac185 --- /dev/null +++ b/externals/gridflow/doc/tutorials/d_gf_2_0-Intro_to_images_open_image.pd @@ -0,0 +1,62 @@ +#N canvas 0 0 887 417 10; +#X obj 4 278 cnv 15 868 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 12 285 GridFlow 0.8.0; +#X obj 5 -67 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 5 -106 cnv 15 868 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 -106 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -99 2 Introduction to Images; +#X text 556 86 <--- click here; +#N canvas 0 0 450 300 META 0; +#X restore 126 285 pd META; +#X obj 452 191 #out window; +#X msg 452 84 open b001.jpg; +#X obj 473 107 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X text 13 84 step 3: Add a [bang<.; +#X text 13 105 step 4: Create a [#out window].; +#X text 13 63 step 2: Create [#in] object.; +#X text 14 27 step 1: create message box [open< with the file name +and extension you want to open.; +#X text 506 110 <--- then click here; +#X obj 447 -67 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 450 -67 1.2 How to create a grid.; +#X obj 447 -67 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 8 -68 2.1 Opening an image.; +#X text 456 -66 2.1 Patch example.; +#X obj 452 130 cnv 15 22 15 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 452 129 #in; +#X text 12 150 Tip: In order for GridFlow to be able to find your images +you have to specify the correct path.; +#X obj 14 151 cnv 15 25 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 12 -33 One of the first things you need to know when working +with GridFlow is how to open an image. GridFlow accepts several image +formats (.jpg \, .png \, .tiff etc.).; +#X text 12 150 Tip: In order for GridFlow to be able to find your images +you have to specify the correct path. Gridflow has an "images" folder +\, put them there to access them by filename only.; +#X obj 451 38 cnv 15 25 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 450 38 Tip: Sometimes the display window opens behind the patch +\, try moving the patch if the display seems to be missing.; +#X text 447 -45 To view the image you must initialize the patch. This +is done in "run mode" by clicking on the message box \, and then on +the bang. The image will be displayed in a display window \, off to +the side of the patch.; +#X text 476 216 In order to close the parent window displaying your +image \, the [#out window] object must be deleted.; +#X obj 512 133 cnv 15 25 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 489 132 <--Tip: remember \, as with the rest of PD \, you can +obtain information regarding specific objects by right-clicking on +it. Try this for [#in].; +#X connect 9 0 22 0; +#X connect 10 0 22 0; +#X connect 22 0 8 0; diff --git a/externals/gridflow/doc/tutorials/d_gf_2_2_1-image-modification-1-numop-all-in-one2.pd b/externals/gridflow/doc/tutorials/d_gf_2_2_1-image-modification-1-numop-all-in-one2.pd new file mode 100644 index 00000000..ddf83eb1 --- /dev/null +++ b/externals/gridflow/doc/tutorials/d_gf_2_2_1-image-modification-1-numop-all-in-one2.pd @@ -0,0 +1,127 @@ +#N canvas 53 0 670 470 10; +#X obj 20 -34 cnv 15 130 150 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 70 2 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 35 41 #in; +#X msg 35 -28 open b001.jpg; +#X obj 35 91 # +; +#X obj 21 231 cnv 15 185 150 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 29 313 #in; +#X msg 29 239 open b001.jpg; +#X obj 96 323 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 4300 1; +#X obj 29 349 # + \$1; +#X obj 54 287 metro 33.3; +#X obj 54 265 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +; +#X obj 82 64 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 82 42 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 83 86 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X msg 82 64 67; +#X msg 82 42 2; +#X msg 83 86 199; +#X floatatom 93 349 5 0 0 0 - - -; +#X text 21 -501 Numeric Operators (numop): transform an image or video +by applying a mathematical operation to each pixel value in the grid. +; +#X obj 21 -522 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 23 -678 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 18 606 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 27 614 GridFlow 0.8.0; +#X obj 339 -267 cnv 15 130 150 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 404 -228 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 358 -199 #in; +#X msg 358 -260 open b001.jpg; +#X obj 378 -171 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 20 -352 cnv 15 50 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 23 -86 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 26 -87 Example #2 demonstrates how to send the numop an argument +using a message box. This method allows you to send the numop several +different arguments.; +#X text 35 -671 2.4 Image manipulation; +#X text 57 -523 2.4.1 Numop; +#X text 25 -445 To transform a grid (in this case an image) using numop +\, it must first be given an argument (a number value). That value +will be applied by numop to every value in the grid. The following +examples show you the three methods that can be used to give the numop +an argument.; +#X obj 35 121 s to_out_window; +#X obj 358 -142 s to_out_window; +#X obj 29 382 s to_out_window; +#X obj 246 546 r to_out_window; +#X msg 498 547 close; +#X msg 393 544 open window; +#X obj 30 -294 cnv 15 200 180 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 161 -215 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 199 -318 display; +#X msg 79 -282 1 2 3 4 5 6 7 8 9; +#X obj 79 -253 #import (3 3); +#X obj 179 -479 display; +#X obj 140 -215 # + 42; +#X obj 358 -171 # + 42; +#X text 337 -288 Here is an example with an image.; +#X text 19 -352 Example 1: shows how values in a grid are altered when +an argument is placed directly into the numeric operator object.; +#X text 157 63 1 click on the argument; +#X text 124 6 2 click on the bang to see the updated image; +#X text 94 8 <--; +#X text 116 42 <--; +#X text 116 65 <--; +#X text 116 87 <--; +#X text 194 -221 <-- argument in this case is 42; +#X obj 353 581 #out window; +#X text 22 433 In all these examples the [# +] numop is used. All the +numeric operators can be found in the numeric operator help patch (right +click on the [# +] and select help to view them). If you want to see +what effects other numops can do \, try replacing the [# +] numop with +another one (either cut and paste a different numop from the help file +or create the object in the current canvas.; +#X obj 20 181 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 26 179 Example #3 using the slider and metro.; +#X text 467 -617 split into 3 patches using ben's switch arrange canvases +and colors; +#X text 24 -635 GridFlow performs high level grid processing \; in +other words its main function is the manipulation of images and video. +The numeric operators is one of the most common ways to modify an image. +; +#X connect 1 0 2 0; +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 35 0; +#X connect 6 0 9 0; +#X connect 7 0 6 0; +#X connect 8 0 9 1; +#X connect 8 0 18 0; +#X connect 9 0 37 0; +#X connect 10 0 6 0; +#X connect 11 0 10 0; +#X connect 15 0 4 1; +#X connect 16 0 4 1; +#X connect 17 0 4 1; +#X connect 25 0 26 0; +#X connect 26 0 48 0; +#X connect 27 0 26 0; +#X connect 38 0 58 0; +#X connect 39 0 58 0; +#X connect 40 0 58 0; +#X connect 44 0 45 0; +#X connect 45 0 46 0; +#X connect 45 0 47 0; +#X connect 47 0 43 0; +#X connect 48 0 36 0; diff --git a/externals/gridflow/doc/tutorials/d_gf_2_2_2.pd b/externals/gridflow/doc/tutorials/d_gf_2_2_2.pd new file mode 100644 index 00000000..a918d620 --- /dev/null +++ b/externals/gridflow/doc/tutorials/d_gf_2_2_2.pd @@ -0,0 +1,68 @@ +#N canvas 38 0 687 415 10; +#X obj 31 -223 cnv 15 243 358 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 39 -141 #in; +#X msg 39 -215 open b001.jpg; +#X obj 79 -132 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 39 -18 # + \$1; +#X obj 62 -189 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +; +#X obj 69 76 #clip; +#X obj 28 -322 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 62 -167 metro 33.3; +#X obj 94 -99 #color; +#X obj 23 -678 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 36 168 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 44 175 GridFlow 0.8.0; +#X obj 39 108 #out window; +#X text 35 -671 2.2 Image manipulation \, colour wrapping; +#X obj 12 -518 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 18 -519 Example #1 colour wrapping; +#X msg 74 -491 240 0 0; +#X obj 179 -368 display; +#X obj 74 -457 # + 20; +#X obj 178 -423 #cast uint8; +#X obj 23 -368 display; +#X text 274 -429 <-- This transforms the grid into 8 bit values \, +that corresponds to the way that images are usually shown in images +and video; +#X text 42 -323 Example #2 clipping the values; +#X text 10 -545 Tip: Refer to glossary for more information on colour. +; +#X text 215 -132 <-- add value to all channels at once; +#X obj 39 37 shunt; +#X obj 69 11 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X text 93 12 <-- switch to see clip's effect; +#X text 96 38 <-- directs the flow of data; +#X text 7 -643 When an image is represented as a grid every pixel value +will vary between 0 and 255 Color wrapping occurs when the result of +the operation on the pixel value would be higher than 255 Values above +255 are counted from 0 For example: if a pixel has a red value of 240 +and 20 is added to it \, you get 5 instead of displaying 260 (240 + +20 - 255 = 5); +#X text 450 -583 aks matju to fix bug in [display]'s display; +#X text 32 -301 The [#clip] object is used with numops in order to +set an lower and upper range to pixel values in order to eliminate +color wrapping (those nifty 60s effects).; +#X text 288 -70 <-- drag to add value to specific channel; +#X text 163 -206 remember to load the image and strat the metro; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 3 0 4 1; +#X connect 4 0 26 0; +#X connect 5 0 8 0; +#X connect 6 0 13 0; +#X connect 8 0 1 0; +#X connect 9 0 4 1; +#X connect 17 0 19 0; +#X connect 19 0 20 0; +#X connect 19 0 21 0; +#X connect 20 0 18 0; +#X connect 26 0 13 0; +#X connect 26 1 6 0; +#X connect 27 0 26 1; diff --git a/externals/gridflow/doc/tutorials/gf_1_0-Introduction_to_grids.pd b/externals/gridflow/doc/tutorials/gf_1_0-Introduction_to_grids.pd new file mode 100755 index 00000000..fb78a496 --- /dev/null +++ b/externals/gridflow/doc/tutorials/gf_1_0-Introduction_to_grids.pd @@ -0,0 +1,98 @@ +#N canvas 0 207 762 514 10; +#X obj 470 287 display; +#X obj 7 6 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 7 -29 cnv 15 970 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 7 -29 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 12 661 cnv 15 970 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 20 668 GridFlow 0.8.0; +#X text 10 6 1.1 What is a grid?; +#X text 12 -22 1 Introduction to Grids; +#X text 10 333 GridFlow can create a grid from a list of numbers. The +[#import] object permits you to set the desired amount of rows and +columns. A message box permits you to tell the grid which numbers to +display.; +#X msg 473 429 3 3 # 6 1 3 6 3 324 6 3 4; +#X msg 550 169 reset; +#X msg 494 475 3 3 # 1 0 0 0; +#X obj 474 572 display; +#X obj 9 307 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 12 307 1.2 How to create a grid.; +#X obj 9 307 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 13 307 1.2 How to create a grid using the [#import] object. +; +#X text 10 427 1 - Create a list of numbers using a message box. The +numbers must be seperated by a space. The list can have as many numbers +as you want but only the amount defined by [#import] will be displayed. +As you click on the message box the numbers will appear in the grid. +The numbers are positioned in the grid from left to right and from +the top to the bottom.; +#X text 12 605 3 - Connect the objects to a [display] object or a [print] +object to see the resulting grid. You don't have to "see" the grid +in order to manipulate it.; +#X text 558 306 display object; +#N canvas 0 0 450 300 META 0; +#X restore 921 616 pd META; +#X obj 457 6 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 460 6 1.2 How to create a grid.; +#X obj 457 6 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 663 43 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X obj 469 238 cnv 15 92 15 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 469 237 #import (3 3); +#X obj 473 520 cnv 15 37 15 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 473 519 # + 0; +#X text 8 267 The following examples illustrate how grids are interpreted +and represented in GridFlow.; +#X text 3 402 Steps for creating a grid:; +#X text 11 537 2 - Create the [#import] object and indicate the parameters +you want as grid dimensions. By indicating 3 3 in brackets following +[#import] \, you are creating a grid that has 3 rows and 3 columns. +This 3 by 3 grid will display 9 numbers.; +#X text 518 516 works like the [#import] object but allows you to put +your grid parameters and values into one message box; +#X text 10 29 A grid is composed of rows and columns that contain numeric +data. For instance \, a checkerboard is a grid that consists in a series +of rows and columns containing information: a dark square or a light +square.; +#X text 10 91 Computers interpret images as three-dimentional grids: +the rows (height) and columns (width) contain pixel positions. There +are usually three channels (depth) of rows and columns. Channels are +the colours that make up an image. Each channel is a single colour +\, usually red \, green and blue (RGB). Videos are also interpreted +as grids since they are a series of still images.; +#X text 9 194 Because GridFlow uses grids \, images and videos are +represented as such. GridFlow objects that accept or produce grids +are identified by the number sign "#" (think of that symbol as a mini +grid). From now on we will refer to images and videos as grids.; +#X msg 469 44 1 2 3 4 5 6 7 8 9; +#X msg 537 107 1 2 3 4; +#X text 466 6 1.2 Patch example.; +#X text 471 405 Other objects can create grids...; +#X text 601 42 <-- step 1: click here to view the numbers from the +list in a grid.; +#X text 601 104 <-- click here three times to see how import only outputs +a grid once it recieves the number of values iassociated with its dimensions +; +#X text 602 169 <-- resets the grid to only display the numbers from +the list; +#X obj 634 236 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X text 572 236 <-- step 2: This object creates a grid that is 3 rows +by 3 columns; +#X connect 9 0 28 0; +#X connect 10 0 26 0; +#X connect 11 0 28 0; +#X connect 26 0 0 0; +#X connect 28 0 12 0; +#X connect 36 0 26 0; +#X connect 37 0 26 0; diff --git a/externals/gridflow/doc/tutorials/gf_2-2-3-resize-image_dec_2005.pd b/externals/gridflow/doc/tutorials/gf_2-2-3-resize-image_dec_2005.pd new file mode 100644 index 00000000..02cf9166 --- /dev/null +++ b/externals/gridflow/doc/tutorials/gf_2-2-3-resize-image_dec_2005.pd @@ -0,0 +1,60 @@ +#N canvas 127 0 672 603 10; +#X obj 22 160 metro 10; +#X obj 22 118 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +; +#X floatatom 80 298 5 1 4 0 - - -; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 26 478 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 34 485 GridFlow 0.8.0; +#X obj 22 438 #out window; +#X obj 59 248 #in; +#X msg 59 225 load bluemarble.jpg; +#X obj 80 387 #pack 2; +#X floatatom 124 369 5 1 4 0 - - -; +#X obj 22 272 #store; +#X text 21 -67 2.4 Image manipulation; +#X text 46 -37 2.4.1 Resizing an image; +#X obj 22 272 #store; +#X obj 59 202 loadbang; +#N canvas 0 0 450 300 META 0; +#X restore 154 484 pd META; +#X obj 274 226 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X obj 23 414 cnv 15 63 15 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 113 118 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X text 49 117 <-- step #2 : start the metro; +#X obj 22 413 #scale_by; +#X obj 468 344 cnv 15 15 15 empty empty empty 20 12 0 14 -259603 -66577 +0; +#X obj 165 379 cnv 15 152 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 167 365 changing this number permits you to change the image's +horizontal parameters.; +#X text 404 344 <-- step #3 : change the parameters; +#X text 11 -10 [#scale_by] resizes grids by multiplying its parameters +(width and height). To resize an image proportionatily a specific scaleing +size must appylied \, ex: [#scale_by 4].; +#X text 11 31 [# pack] lets you resize grids by altering the vertical +and horizontal parameters.; +#X text 88 157 the metro refreshes the display window so you don't +have to reload the grid every time it's altered.; +#X text 210 225 <-- step #1 : load the image; +#X text 132 295 changing this number changes the grid's vertical parameters. +(a slider can be connected to [#pack] instead of a number box.; +#X connect 0 0 12 0; +#X connect 0 0 15 0; +#X connect 1 0 0 0; +#X connect 2 0 10 0; +#X connect 8 0 12 1; +#X connect 8 0 15 1; +#X connect 9 0 8 0; +#X connect 10 0 22 1; +#X connect 11 0 10 1; +#X connect 15 0 22 0; +#X connect 16 0 9 0; diff --git a/externals/gridflow/doc/tutorials/gf_2-2-4-greyscale_dec_2005.pd b/externals/gridflow/doc/tutorials/gf_2-2-4-greyscale_dec_2005.pd new file mode 100644 index 00000000..cbb11af1 --- /dev/null +++ b/externals/gridflow/doc/tutorials/gf_2-2-4-greyscale_dec_2005.pd @@ -0,0 +1,27 @@ +#N canvas 183 58 542 460 10; +#X obj 21 207 #rgb_to_greyscale; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 320 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 16 327 GridFlow 0.8.0; +#X obj 21 178 #in; +#X text 21 -67 2.4 Image manipulation; +#X text 48 -37 2.4.2 Greyscale; +#N canvas 0 0 450 300 META 0; +#X restore 147 327 pd META; +#X text 149 242 This patch and other image modifications can be can +be found in the gridflow help files.; +#X text 159 102 insert your own images to convert it to greyscale. +click on the message to load image.; +#X text 19 4 To convert an image to greyscale use [#rgb_to_greyscale]. +It transforms colour information into a black to white gradient.; +#X obj 33 157 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 21 135 open bluemarble.jpg; +#X obj 21 282 #out window; +#X connect 5 0 0 0; +#X connect 12 0 5 0; +#X connect 13 0 5 0; diff --git a/externals/gridflow/doc/tutorials/gf_2_0-Intro_to_images_open_image.pd b/externals/gridflow/doc/tutorials/gf_2_0-Intro_to_images_open_image.pd new file mode 100755 index 00000000..ea6aa98d --- /dev/null +++ b/externals/gridflow/doc/tutorials/gf_2_0-Intro_to_images_open_image.pd @@ -0,0 +1,62 @@ +#N canvas 0 0 894 417 10; +#X obj 4 278 cnv 15 868 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 12 285 GridFlow 0.8.0; +#X obj 5 -67 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 5 -106 cnv 15 868 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 -106 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -99 2 Introduction to Images; +#X text 556 86 <--- click here; +#N canvas 0 0 450 300 META 0; +#X restore 126 285 pd META; +#X obj 452 191 #out window; +#X msg 452 84 open b001.jpg; +#X obj 473 107 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X text 13 84 step 3: Add a [bang<.; +#X text 13 105 step 4: Create a [#out window].; +#X text 13 63 step 2: Create [#in] object.; +#X text 14 27 step 1: create message box [open< with the file name +and extension you want to open.; +#X text 506 110 <--- then click here; +#X obj 447 -67 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 450 -67 1.2 How to create a grid.; +#X obj 447 -67 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 8 -68 2.1 Opening an image.; +#X text 456 -66 2.1 Patch example.; +#X obj 452 130 cnv 15 22 15 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 452 129 #in; +#X text 12 150 Tip: In order for GridFlow to be able to find your images +you have to specify the correct path.; +#X obj 14 151 cnv 15 25 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 12 -33 One of the first things you need to know when working +with GridFlow is how to open an image. GridFlow accepts several image +formats (.jpg \, .png \, .tiff etc.).; +#X text 12 150 Tip: In order for GridFlow to be able to find your images +you have to specify the correct path. Gridflow has an "images" folder +\, put them there to access them by filename only.; +#X obj 451 38 cnv 15 25 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 450 38 Tip: Sometimes the display window opens behind the patch +\, try moving the patch if the display seems to be missing.; +#X text 447 -45 To view the image you must initialize the patch. This +is done in "run mode" by clicking on the message box \, and then on +the bang. The image will be displayed in a display window \, off to +the side of the patch.; +#X text 476 216 In order to close the parent window displaying your +image \, the [#out window] object must be deleted.; +#X obj 512 133 cnv 15 25 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 489 132 <--Tip: remember \, as with the rest of PD \, you can +obtain information regarding specific objects by right-clicking on +it. Try this for [#in].; +#X connect 9 0 22 0; +#X connect 10 0 22 0; +#X connect 22 0 8 0; diff --git a/externals/gridflow/doc/tutorials/gf_2_2_1-image-modification-1-numop-all-in-one2.pd b/externals/gridflow/doc/tutorials/gf_2_2_1-image-modification-1-numop-all-in-one2.pd new file mode 100755 index 00000000..cc1d1902 --- /dev/null +++ b/externals/gridflow/doc/tutorials/gf_2_2_1-image-modification-1-numop-all-in-one2.pd @@ -0,0 +1,127 @@ +#N canvas 53 0 670 470 10; +#X obj 20 -34 cnv 15 130 150 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 70 2 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 35 41 #in; +#X msg 35 -28 open b001.jpg; +#X obj 35 91 # +; +#X obj 21 231 cnv 15 185 150 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 29 313 #in; +#X msg 29 239 open b001.jpg; +#X obj 96 323 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 4300 1; +#X obj 29 349 # + \$1; +#X obj 54 287 metro 33.3; +#X obj 54 265 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +; +#X obj 82 64 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 82 42 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 83 86 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X msg 82 64 67; +#X msg 82 42 2; +#X msg 83 86 199; +#X floatatom 93 349 5 0 0 0 - - -; +#X text 21 -501 Numeric Operators (numop): transform an image or video +by applying a mathematical operation to each pixel value in the grid. +; +#X obj 21 -522 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 23 -678 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 18 606 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 27 614 GridFlow 0.8.0; +#X obj 339 -267 cnv 15 130 150 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 404 -228 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 358 -199 #in; +#X msg 358 -260 open b001.jpg; +#X obj 378 -171 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 20 -352 cnv 15 50 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 23 -86 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 26 -87 Example #2 demonstrates how to send the numop an argument +using a message box. This method allows you to send the numop several +different arguments.; +#X text 35 -671 2.4 Image manipulation; +#X text 57 -523 2.4.1 Numop; +#X text 25 -445 To transform a grid (in this case an image) using numop +\, it must first be given an argument (a number value). That value +will be applied by numop to every value in the grid. The following +examples show you the three methods that can be used to give the numop +an argument.; +#X obj 35 121 s to_out_window; +#X obj 358 -142 s to_out_window; +#X obj 29 382 s to_out_window; +#X obj 246 546 r to_out_window; +#X msg 498 547 close; +#X msg 393 544 open window; +#X obj 30 -294 cnv 15 200 180 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 161 -215 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 199 -318 display; +#X msg 79 -282 1 2 3 4 5 6 7 8 9; +#X obj 79 -253 #import (3 3); +#X obj 179 -479 display; +#X obj 140 -215 # + 42; +#X obj 358 -171 # + 42; +#X text 337 -288 Here is an example with an image.; +#X text 19 -352 Example 1: shows how values in a grid are altered when +an argument is placed directly into the numeric operator object.; +#X text 157 63 1 click on the argument; +#X text 124 6 2 click on the bang to see the updated image; +#X text 94 8 <--; +#X text 116 42 <--; +#X text 116 65 <--; +#X text 116 87 <--; +#X text 194 -221 <-- argument in this case is 42; +#X obj 353 581 #out window; +#X text 22 433 In all these examples the [# +] numop is used. All the +numeric operators can be found in the numeric operator help patch (right +click on the [# +] and select help to view them). If you want to see +what effects other numops can do \, try replacing the [# +] numop with +another one (either cut and paste a different numop from the help file +or create the object in the current canvas.; +#X obj 20 181 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 26 179 Example #3 using the slider and metro.; +#X text 467 -617 split into 3 patches using ben's switch arrange canvases +and colors; +#X text 24 -635 GridFlow performs high level grid processing \; in +other words its main function is the manipulation of images and video. +There are several ways to modify images \, one of the most common is +the numeric operators.; +#X connect 1 0 2 0; +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 35 0; +#X connect 6 0 9 0; +#X connect 7 0 6 0; +#X connect 8 0 9 1; +#X connect 8 0 18 0; +#X connect 9 0 37 0; +#X connect 10 0 6 0; +#X connect 11 0 10 0; +#X connect 15 0 4 1; +#X connect 16 0 4 1; +#X connect 17 0 4 1; +#X connect 25 0 26 0; +#X connect 26 0 48 0; +#X connect 27 0 26 0; +#X connect 38 0 58 0; +#X connect 39 0 58 0; +#X connect 40 0 58 0; +#X connect 44 0 45 0; +#X connect 45 0 46 0; +#X connect 45 0 47 0; +#X connect 47 0 43 0; +#X connect 48 0 36 0; diff --git a/externals/gridflow/doc/tutorials/gf_2_2_2.pd b/externals/gridflow/doc/tutorials/gf_2_2_2.pd new file mode 100644 index 00000000..2728c61c --- /dev/null +++ b/externals/gridflow/doc/tutorials/gf_2_2_2.pd @@ -0,0 +1,68 @@ +#N canvas 38 0 687 415 10; +#X obj 31 -223 cnv 15 243 358 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 39 -141 #in; +#X msg 39 -215 open b001.jpg; +#X obj 79 -132 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 39 -18 # + \$1; +#X obj 62 -189 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +; +#X obj 69 76 #clip; +#X obj 28 -322 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 62 -167 metro 33.3; +#X obj 94 -99 #color; +#X obj 23 -678 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 36 168 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 44 175 GridFlow 0.8.0; +#X obj 39 108 #out window; +#X text 35 -671 2.2 Image manipulation \, colour wrapping; +#X obj 12 -518 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 18 -519 Example #1 colour wrapping; +#X msg 74 -491 240 0 0; +#X obj 179 -368 display; +#X obj 74 -457 # + 20; +#X obj 178 -423 #cast uint8; +#X obj 23 -368 display; +#X text 274 -429 <-- This transforms the grid into 8 bit values \, +that corresponds to the way that images are usually shown in images +and video; +#X text 42 -323 Example #2 clipping the values; +#X text 10 -545 Tip: Refer to glossary for more information on colour. +; +#X text 215 -132 <-- add value to all channels at once; +#X obj 39 37 shunt; +#X obj 69 11 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X text 93 12 <-- switch to see clip's effect; +#X text 96 38 <-- directs the flow of data; +#X text 7 -643 When an image is represented as a grid every pixel value +will vary between 0 and 255 Color wrapping occurs when the result of +the operation on the pixel value would be higher than 255 Values above +255 are counted from 0 For example: if a pixel has a red value of 240 +and 20 is added to it \, you get 5 instead of displaying 260 (240 + +20 - 255 = 5); +#X text 451 -583 aks matju to fix bug in [display]'s display; +#X text 32 -301 The [#clip] object is used with numops in order to +set an lower and upper range to pixel values in order to eliminate +color wrapping (those nifty 60s effects).; +#X text 288 -70 <-- drag to add value to specific channel; +#X text 163 -206 remember to load the image and strat the metro; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 3 0 4 1; +#X connect 4 0 26 0; +#X connect 5 0 8 0; +#X connect 6 0 13 0; +#X connect 8 0 1 0; +#X connect 9 0 4 1; +#X connect 17 0 19 0; +#X connect 19 0 20 0; +#X connect 19 0 21 0; +#X connect 20 0 18 0; +#X connect 26 0 13 0; +#X connect 26 1 6 0; +#X connect 27 0 26 1; diff --git a/externals/gridflow/doc/tutorials/grid-intro.pd b/externals/gridflow/doc/tutorials/grid-intro.pd new file mode 100755 index 00000000..e3aa53b8 --- /dev/null +++ b/externals/gridflow/doc/tutorials/grid-intro.pd @@ -0,0 +1,10 @@ +#N canvas 0 0 476 213 10; +#X text 29 30 GridFlow is a plug-in for PureData that introduces the +frid (#) data type into the PD environment. GridFlow allows you to +work with live video \, still images and video files in a rel-time +environment.; +#X text 32 97 This section deals with the particular objects related +to GridFlow. GridFlow uses the usual PD "control" objects \, as well +as a set of GridFlow specific objects. Before we get into the tutorials +we will explain the grid "#" \, the most important concept in GridFlow. +; diff --git a/externals/gridflow/doc/tutorials/probably_not_good_2-3-0-1-image-modification-1-numop-all-in-one.pd b/externals/gridflow/doc/tutorials/probably_not_good_2-3-0-1-image-modification-1-numop-all-in-one.pd new file mode 100755 index 00000000..a743e82d --- /dev/null +++ b/externals/gridflow/doc/tutorials/probably_not_good_2-3-0-1-image-modification-1-numop-all-in-one.pd @@ -0,0 +1,123 @@ +#N canvas 0 0 977 630 10; +#X obj 17 -114 #out window; +#X obj 43 -174 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 17 -143 #in; +#X msg 17 -205 open b001.jpg; +#X obj 507 -245 cnv 15 185 150 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 529 -205 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 515 -166 #in; +#X msg 515 -238 open b001.jpg; +#X obj 555 -167 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 515 -110 s slider; +#X obj 515 -138 # + 1; +#X text 11 -499 Numeric Operators (numop): transform an image or video +by applying a mathematical operation to each pixel value in the grid. +; +#X text 12 -445 To transform a grid (in this case an image) using numop +\, it must first be given an argument (a number value) in order to +affect a pixel value. The examples here show you the three methods +that can be used to give the numop an argument.; +#X obj 3 -643 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 3 -678 cnv 15 970 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 10 -618 GridFlow performs high level grid processing \; in +other words its main function is the manipulation of images and video. +There are several ways to madify images in GridFlow \, some are very +basic while others are more advanced (and are saved for the intermediate +tutorials.) In this section we will introduce some very basic functions +of the numeric operator \, one of the most common methods used for +image transformation.; +#X obj 155 -220 cnv 15 130 150 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 220 -181 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 174 -152 #in; +#X msg 174 -213 open b001.jpg; +#X obj 199 -124 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 174 -124 # + 109; +#X obj 174 -95 s argument; +#X text 235 -125 <--- argument in this case is 109; +#X obj 13 -273 + 1; +#X floatatom 13 -297 5 0 0 0 - - -; +#X floatatom 13 -249 5 0 0 0 - - -; +#X text 54 -282 this is a basic numop. GridFlow has its own set of +numops that are applied to grids \, 3 dimensions \, on each channel. +; +#X obj 14 -357 cnv 15 70 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 11 -672 2.4 Image manipulation; +#X text 11 -644 2.4.3 Numop; +#X obj 500 -559 cnv 15 130 150 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 550 -523 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +-1; +#X obj 515 -484 #in; +#X msg 515 -553 open b001.jpg; +#X obj 515 -434 # +; +#X obj 515 -404 s message; +#X obj 562 -461 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 562 -483 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X obj 563 -439 cnv 15 25 17 empty empty empty 20 12 0 14 -241291 -66577 +0; +#X msg 562 -461 67; +#X msg 562 -483 2; +#X msg 563 -439 199; +#X text 596 -461 <--- messages used as arguments; +#X text 596 -486 <---; +#X text 596 -438 <---; +#X obj 764 -116 r argument; +#X obj 891 -91 #out window; +#X obj 842 -115 r message; +#X obj 911 -115 r slider; +#X obj 3 -67 cnv 15 970 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 14 -57 GridFlow 0.8.0; +#N canvas 0 0 450 300 META 0; +#X restore 919 -60 pd META; +#X text 13 -357 Example #1; +#X text 12 -338 Shows you how to put an argument directly into the +numeric operator object.; +#X obj 507 -320 cnv 15 70 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X obj 497 -629 cnv 15 70 15 empty empty empty 20 12 0 14 -260818 -66577 +0; +#X text 496 -628 Example #2; +#X text 506 -320 Example #3; +#X text 497 -608 Demonstrates how to send the numop an argument using +a message box. This method allows you to send the numop several different +arguments.; +#X text 507 -299 Introduces the use of the slider as a method to give +the numop an argument. The slider allows you to easily scroll through +a series of values.; +#X connect 1 0 2 0; +#X connect 2 0 0 0; +#X connect 3 0 2 0; +#X connect 5 0 6 0; +#X connect 6 0 10 0; +#X connect 7 0 6 0; +#X connect 8 0 10 1; +#X connect 10 0 9 0; +#X connect 17 0 18 0; +#X connect 18 0 21 0; +#X connect 19 0 18 0; +#X connect 21 0 22 0; +#X connect 24 0 26 0; +#X connect 25 0 24 0; +#X connect 32 0 33 0; +#X connect 33 0 35 0; +#X connect 34 0 33 0; +#X connect 35 0 36 0; +#X connect 40 0 35 1; +#X connect 41 0 35 1; +#X connect 42 0 35 1; +#X connect 46 0 47 0; +#X connect 48 0 47 0; +#X connect 49 0 47 0; diff --git a/externals/gridflow/doc/tutorials/probably_not_good_2-3-0-2.pd b/externals/gridflow/doc/tutorials/probably_not_good_2-3-0-2.pd new file mode 100644 index 00000000..18625731 --- /dev/null +++ b/externals/gridflow/doc/tutorials/probably_not_good_2-3-0-2.pd @@ -0,0 +1,61 @@ +#N canvas 58 0 665 421 10; +#X obj 29 -473 cnv 15 185 190 empty empty empty 20 12 0 14 -228992 +-66577 0; +#X obj 37 -391 #in; +#X msg 37 -465 open b001.jpg; +#X obj 77 -382 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 37 -359 # + \$1; +#X obj 60 -439 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +; +#X obj 37 -315 #clip; +#X obj 27 -634 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 60 -417 metro 33.3; +#X obj 278 -430 #pack 3; +#X obj 326 -455 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 326 -475 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 326 -495 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 286 -391 #color; +#X msg 269 -301 255 0 0; +#X text 336 -304 donner une liste changer couleurs; +#X obj 234 -245 #scale_by (8 8); +#X msg 235 -265 2 2 3 # 255 0 0 0 255 0 0 0 255 191 191 191; +#X obj 37 -273 s to_out_window; +#X text 29 -633 Example #4 the [#clip] object is used with numops in +order to set constraints on pixels to eliminate color wrapping. Colour +wrapping occurs when the individual pixel values in a grid exceed 255 +which results in of colour. GridFlow reads colours as values from 0 +(black) to 255 (white). Refer to glossary for more information on colour. +; +#X obj 23 -678 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 35 -671 2.4 Image manipulation; +#X obj 25 -102 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 34 -94 GridFlow 0.8.0; +#X obj 253 -162 r to_out_window; +#X msg 505 -161 close; +#X msg 400 -164 open window; +#X obj 360 -127 #out window; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 3 0 4 1; +#X connect 4 0 6 0; +#X connect 5 0 8 0; +#X connect 6 0 18 0; +#X connect 8 0 1 0; +#X connect 9 0 4 1; +#X connect 10 0 9 2; +#X connect 11 0 9 1; +#X connect 12 0 9 0; +#X connect 13 0 4 1; +#X connect 14 0 4 1; +#X connect 16 0 4 1; +#X connect 17 0 16 0; +#X connect 24 0 27 0; +#X connect 25 0 27 0; +#X connect 26 0 27 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-1.pd b/externals/gridflow/doc/tutorials/pure-data-1.pd new file mode 100755 index 00000000..7be2a91a --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-1.pd @@ -0,0 +1,71 @@ +#N canvas 221 110 894 498 10; +#N canvas 0 22 450 300 this 0; +#X obj 192 128 inlet; +#X obj 192 171 outlet; +#X text 8 7 If you're looking at this you're just going to confuse +yourself!; +#X connect 0 0 1 0; +#X restore 499 380 pd this is an object; +#X text 509 358 <- This is a connection; +#X msg 499 319 10; +#X text 13 348 Objects are like filters \, they change the way messages +flow through them.; +#X text 13 153 You can think of a patch as plumbing. The way water +flows through the plumbing of your house \, messages flow through the +connections in your patch. Objects change the flow of the messages +to allow different things to happen. Messages always go into objects +at the top \, called the inlet \, and always come out at the bottom +\, called the outlet. In PD messages flow from top to bottom.; +#X text 458 236 This is a very simple example of a patch \, the message +"10" can be sent through the "pd this is an object" and can be seen +being passed out the outlet.; +#X floatatom 499 416 5 0 0 0 - - -; +#X text 539 415 <- This number box shows the float message; +#X text 553 334 and watch the output!; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 252 You can work with PD in two ways \, the first is in +"edit mode". Edit-mode is where you create your patch by adding objects +and the connections between them. "Run mode" is when you're done with +the construction of your patch \, and you wish to send messages through +it. In run-mode your cursor is an arrow (as it is right now since we +are in run-mode) \, in edit-mode your cursor is a pointing hand.; +#X text 458 136 Messages are what allow objects to communicate with +one and other. Messages can change the way an object acts \, and/or +express the work the object is doing. Messages come in different types. +They can contain words \, numbers and groups of these. The main types +of messages we will be dealing with are floats (numbers). You can click +on a message \, when in run-mode \, to send it through your patch. +; +#X obj 448 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 448 290 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 8 447 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 449 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#X text 12 20 DESCRIPTION: What is a patch? An object? A message?; +#N canvas 0 22 466 316 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: metaphor object message GUI introduction; +#X restore 16 453 pd META; +#X text 457 67 GUI objects allow you to interact with your PD patch +as it is running. They allow you to change what your patch is doing +without reconnecting the objects. The simplest GUI object is the "Message" +that simply contains a message you want to send in your patch.; +#X text 453 290 A patch that connects a GUI to an object to a second +GUI.; +#X text 531 320 <- This GUI sends a float message (click on it); +#X text 13 66 When working with PD you are dealing primarily with objects +\, GUI (Graphical User Interface) objects \, connections and messages. +These are the building blocks of PD programming. When you connect objects +\, GUI objects \, and messages you are creating a "patch". Patching +is making something complex out of smaller building blocks.; +#X text 13 46 The "patch" \, "objects" and "connections"; +#X text 453 46 "GUI objects" and "messages"; +#X text 12 8 1 Introduction to Pure-Data & its Metaphors; +#X connect 0 0 6 0; +#X connect 2 0 0 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-2.pd b/externals/gridflow/doc/tutorials/pure-data-2.pd new file mode 100755 index 00000000..151af26f --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-2.pd @@ -0,0 +1,73 @@ +#N canvas 197 100 899 548 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 448 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 8 497 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 499 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 470 320 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: GUI slider toggle number message introduction +; +#X restore 16 503 pd META; +#X text 12 20 DESCRIPTION: Message \, slider \, toggle \, bang and +number; +#X msg 93 145 hello world; +#X obj 93 168 print; +#X text 181 146 <- Click on this message; +#X text 18 74 Messages control the behavior of objects and it is the +objects that change what a patch does. The first object we're going +to learn is "print". All "print" does is print out the messages you +send it to the terminal:; +#X text 19 197 TIP: If you forget what an object does you can always +double-click (on a mac) or right-click (on a PC) and then choose "help". +; +#X text 19 250 In this tutorial we will use two different types of +objects: "objects" (of which "print" is an example) and GUI objects +\, (of which "message" is an example). GUI objects allow you to interact +with your patch \, control PD and change parameters of objects. We +are going to learn four types of GUI objects (but there are many more): +Slider \, Toggle \, Bang \, and Number.; +#X obj 76 355 hsl 300 30 0 127 0 0 empty empty This_is_a_HSlider_(Horizontal) +10 15 1 10 -262144 -1 -1 0 1; +#X obj 73 393 print; +#X text 21 421 This "hslider" is connected to the print object. This +way we can see what messages the "hslider" sends. Try clicking and +dragging in the Slider. You can change the scale (and other properties) +of some GUI Objects by double-clicking (mac) or right-clicking (pc) +and choosing "properties".; +#X text 13 46 The "message" and "hslider" GUI Objects:; +#X text 453 46 "toggle" \, "bang" \, "number"; +#X obj 519 176 tgl 30 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 629 176 bng 30 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 629 210 print Bang; +#X obj 519 210 print Toggle; +#X obj 739 210 print Number; +#X floatatom 739 192 5 0 0 0 - - -; +#X text 466 76 "slider" \, "toggle" and "number" all send messages +made up of floats (numbers). "bang" is a special case and it only sends +the message "bang". Below we're using an argument to the print object +that tags each message sent to the terminal. This way when we have +multiple "print" objects in one patch we can differenciate thier output. +; +#X text 465 268 "toggle" sends the message "1" or "0" \, "bang" always +sends "bang" and if you click and drag on the "number" you can see +it acts a lot like a Slider. With "number" you can also click once +\, and then type a number to send.; +#X text 467 335 TIP: You can send floating point numbers by holding +down the SHIFT key as you click and drag on the "number".; +#X text 467 375 There are other types of GUI objects not covered here. +See the guis-about.pd PDDP patch:; +#X text 12 8 2 PD Introduction - Some Useful GUI Objects in Pure-Data +; +#X connect 7 0 8 0; +#X connect 13 0 14 0; +#X connect 18 0 21 0; +#X connect 19 0 20 0; +#X connect 23 0 22 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-3.pd b/externals/gridflow/doc/tutorials/pure-data-3.pd new file mode 100755 index 00000000..729b2dc7 --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-3.pd @@ -0,0 +1,70 @@ +#N canvas 261 121 900 544 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 448 366 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 8 497 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 499 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 474 324 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: patch first connecting placing place connect +; +#X restore 16 503 pd META; +#X text 12 20 DESCRIPTION: Using PD to create your first patch; +#X text 13 46 Adding Objects:; +#X text 19 75 In order to create a patch you need to first place objects +and GUI objects \, and second make connections between these objects. +To place an object you need to be in "edit-mode". You should now be +in run mode \, so please go to the "Edit" pull-down menu and choose +"Edit mode" at the bottom. You should see your cursor change from an +arrow to a pointing hand.; +#X text 19 175 SHORTCUT: You can press "Control" and "e" simultaneously +in order to toggle (switch) between edit and Run modes.; +#X obj 448 386 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 +-66577 0; +#X floatatom 506 406 5 0 0 0 - - -; +#X text 19 355 SHORTCUT: You can press "Control" and "3" simultaneously +in order to place a number. All shortcuts are listed next to the items +in the "Put" menu.; +#X text 453 366 Patch work area:; +#X text 19 215 Once you are in "edit-mode" you are now free to place +objects. To place an object go to the "Put" pull-down menu and choose +"Number". Once you have chosen this menu item you will see that a "number" +gui is attached to your mouse pointer. In order to place the number +into the patch move your pointer to the grey area to the right (in +the "Patch work area" -> Click once to release it from your mouse. +Note that the number is coloured blue. The blue colour shows that an +item in your patch is selected. To unselect any item simply click once +on the blank (white) space between items.; +#X obj 520 440 print; +#X obj 448 156 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 156 Connecting Objects:; +#X text 19 411 Next we're going to place the familar "print" object +beneath the "number" GUI. Press "Control" and "1" to place an object +box. Again the object gets attached to your mouse and again click once +to place it in the patch area somewhere under the "number".; +#X text 459 41 While the number box is still selected (coloured blue) +you can see a flashing cursor. Type the word "print" into the object +box. The object will retain a dashed line while you type. In order +to create the object you simply need to unselect \, by clicking somewhere +outside the object. Note that once you have clicked to create the object +the dashed line turns solid and an inlet (small rectangle) gets drawn +around the word "print". The objects have now been created!; +#X text 459 185 All connections between objects in PD are created from +outlet to inlet (top to bottom). To start making a connection move +your hand-pointer over the outlet of the "number" gui. When over the +outlet your pointer will change to a circle. When you see the circle +press and hold the mouse button. As you drag (holding the mouse button +down) the pointer you see a line being drawn from the outlet to your +pointer. To attach this connection to another object drag your mouse +to an inlet of another object. The pointer will again change to a circle +and at this point you can release the mouse button. Once released the +objects are now connected! To play with your patch go back into run-mode +and click and drag on the number-box while watching the terminal.; +#X text 12 8 3 PD Introduction - Creating your first patch; +#X connect 11 0 15 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-4.pd b/externals/gridflow/doc/tutorials/pure-data-4.pd new file mode 100755 index 00000000..4d38f41d --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-4.pd @@ -0,0 +1,87 @@ +#N canvas 183 61 890 531 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 96 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 8 487 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 489 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 478 328 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: metro counter random; +#X restore 16 493 pd META; +#X text 12 20 DESCRIPTION: Learning "metro" \, "counter" & "random" +; +#X text 13 96 Using the "metro" object:; +#X text 21 47 In this section we will learn three new objects \, "metro" +\, "counter" \, and "random". Metro sends a bang at regular intervals +\, just like a metronome.; +#X obj 164 142 metro 250; +#X obj 164 123 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 164 163 bng 15 100 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X floatatom 222 123 5 0 0 0 - - -; +#X text 21 187 You can turn a Metro on and off by sending it a "1" +or "0" message. Because a toggle sends 0/1 messages \, we can simply +connect it directly. Metro also accepts an argument (words or numbers +wirtten after the object name). This argument is how fast the metro +should send out bangs (in milliseconds). You can always change the +speed of the metro by sending it number messages through the rightmost +inlet.; +#X obj 8 306 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 306 Using the "random" object:; +#X text 21 277 For more info see the metro-help.pd patch.; +#X obj 168 385 bng 15 100 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 168 425 print; +#X obj 168 404 random 100; +#X floatatom 233 385 5 0 0 0 - - -; +#X text 20 327 The Random object returns a number between 0 and the +(number) argument when it receives a bang message in the leftmost inlet. +You can also change the upper limit by sending a message to the rightmost +inlet.; +#X obj 448 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 46 Using the "random" object:; +#X obj 559 154 bng 15 100 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X floatatom 590 154 3 1 3 0 - - -; +#X floatatom 621 174 3 0 0 0 - - -; +#X floatatom 652 194 3 0 0 0 - - -; +#X obj 652 234 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X floatatom 559 234 8 0 0 0 - - -; +#X obj 559 213 counter 0 10 1; +#X text 21 447 For more info see the random-help.pd patch.; +#X text 461 77 "counter" is simply an object that counts. It can count +up \, count down and count up and then down. Where it starts and where +it stops are all definable. This is the counter that in included with +Gem \, it is not compatible with other counter objects.; +#X text 461 274 The first argument for counter is the lower limit (number +to start counting at). The second is the upper limit to count to. The +third argument is the direction in which to count. "1" means forward +\, "2" means backward and "3" means forward and then backward. You +can also use the three rightmost inlets to change the behaviour of +counter. The rightmost inlet is the upper limit \, the second right-most +the lower limit \, and the third right-most as the direction. The rightmost +outlet sends out a bang message when the counter loops.; +#X text 681 193 Rightmost inlet; +#X text 651 173 Second Rightmost inlet; +#X text 621 153 Third Rightmost inlet; +#X text 461 407 For more info see the counter-help.pd patch.; +#X text 12 8 4 Introduction to PD - More objects; +#X connect 8 0 10 0; +#X connect 9 0 8 0; +#X connect 11 0 8 1; +#X connect 16 0 18 0; +#X connect 18 0 17 0; +#X connect 19 0 18 1; +#X connect 23 0 29 0; +#X connect 24 0 29 1; +#X connect 25 0 29 2; +#X connect 26 0 29 3; +#X connect 29 0 28 0; +#X connect 29 1 27 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-5.pd b/externals/gridflow/doc/tutorials/pure-data-5.pd new file mode 100755 index 00000000..dc357bb1 --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-5.pd @@ -0,0 +1,108 @@ +#N canvas -235 0 891 673 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 8 627 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 629 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 482 332 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: send receive netsend netreceive cordless communication +network TCP/IP UDP internet; +#X restore 16 633 pd META; +#X obj 448 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 12 20 DESCRIPTION: Communicating between objects w/out connections +; +#X text 13 46 "send" & "receive"; +#X obj 86 223 send invisible-link; +#X obj 86 248 receive invisible-link; +#X floatatom 86 273 5 0 0 0 - - -; +#X msg 86 198 10; +#X floatatom 266 273 5 0 0 0 - - -; +#X floatatom 266 203 5 0 0 0 - - -; +#X obj 266 223 s invisible-link2; +#X obj 266 248 r invisible-link2; +#X obj 102 483 r send-from-number; +#X floatatom 102 508 5 0 0 0 - - -; +#X floatatom 102 462 5 0 0 0 - - send-from-number; +#X floatatom 242 462 5 0 0 0 - - -; +#X obj 242 483 s send-to-number2; +#X floatatom 242 508 5 0 0 0 - send-to-number2 -; +#X text 19 385 Note: Many GUI objects have built-in send and receive +objects. The tag names are specified in the GUI properties. Remeber +to get the GUI properties Right-Click or Control-Click on the GUI object +and select "Properties".; +#X text 453 46 "netsend" & "netreceive"; +#X text 19 575 For more info see: send-help.pd \, receive-help.pd \, +netsend-help.pd and netreceive-help.pd; +#X text 459 75 While "send" and "receive" allow you to send messages +without connecting objects with patch-cords "netsend" and "netreceive" +do the same but communicate between objects using TCP/IP the internet +protocol. This means that you can send messages from a patch running +on one machine to a second patch running on a second machine on the +same network \, or even over the internet.; +#X text 19 545 You can also send messages using UDP rather than TCP/IP. +See "more info" below for details.; +#X obj 589 292 netreceive 8001; +#X text 459 185 The first argument of "netreceive" is the port the +netrecive should listen on. "netsend" can connect to this port from +other machines. "netreceive" has two outlets. The first outlet sends +out the messages it receives over network \, and the second argument +send a "1" when netsend is connected and "0" when netsend disconnects. +; +#X obj 589 318 print; +#X obj 689 318 tgl 16 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 +1; +#X obj 503 563 netsend; +#X text 459 355 "netsend" is controlled using three messages: "connect" +\, "disconnect" and "send". "connect" has two arguments \, the host +or IP and the port number you wish to connect to. There needs to be +a "netreceive" listening on the port you connect to. "disconnect" drops +the current connection. "send" sends any arguments to the "netreceive" +over the network. The single outlet of "netsend" prints "1" when a +connection is made and "0" when the connection is lost.; +#X obj 503 586 tgl 16 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 +1; +#X msg 503 486 connect localhost 8001; +#X msg 516 511 disconnect; +#X msg 525 537 send hello from the internet; +#X text 602 510 Close connection; +#X text 673 486 Connect to this machine; +#X text 733 536 Send message; +#X text 19 75 In some cases you will want to send messages without +connecting objects. You may be sending one message to many different +places that would make connections too laborious. "send" and "receive" +both have a single argument. This argument is the tag name for the +communication. "send" will always send any messages it gets in it inlet +to any number of "receive" objects in a patch with the same tag name. +"s" and "r" can be used in the place of "send" and "receive".; +#X obj 86 336 s broadcast; +#X floatatom 86 317 5 0 0 0 - - -; +#X obj 176 316 r broadcast; +#X floatatom 176 339 5 0 0 0 - - -; +#X obj 266 316 r broadcast; +#X floatatom 266 339 5 0 0 0 - - -; +#X text 12 8 5 Intermediate Pure-Data - send and receive; +#X msg 585 598 send \$1; +#X floatatom 584 567 5 0 0 0 - - -; +#X text 651 596 send variables to another computer; +#X connect 9 0 10 0; +#X connect 11 0 8 0; +#X connect 13 0 14 0; +#X connect 15 0 12 0; +#X connect 16 0 17 0; +#X connect 19 0 20 0; +#X connect 27 0 29 0; +#X connect 27 1 30 0; +#X connect 31 0 33 0; +#X connect 34 0 31 0; +#X connect 35 0 31 0; +#X connect 36 0 31 0; +#X connect 42 0 41 0; +#X connect 43 0 44 0; +#X connect 45 0 46 0; +#X connect 48 0 31 0; +#X connect 49 0 48 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-6.pd b/externals/gridflow/doc/tutorials/pure-data-6.pd new file mode 100755 index 00000000..01e6dcd7 --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-6.pd @@ -0,0 +1,92 @@ +#N canvas 304 98 891 675 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 627 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 629 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 486 336 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: message comma semicolon dollersign receive +list; +#X restore 16 633 pd META; +#X text 12 20 DESCRIPTION: Advanced uses for the message object; +#X text 19 45 In Pure-Data there are two distinct concepts with the +name "message". Messages are the data that gets send in PD from object +to object. There is also the Messsage object that contains a message +you want to send. The message object is the first GUI object we covered +in this tutorial. The message is not the only way to send messages +in a patch \, since all GUI objects also send messages. So what makes +the message object different? The message object can sent messages +of any type \, where a number for example can only send float (number) +messages. There are a number of powerful features in the message object. +We are familar with the "usual" way of using the message object:; +#X msg 163 208 hello; +#X msg 212 208 bye; +#X obj 196 238 print messages; +#X text 459 556 Note: It is a very common mistake to confuse the message +object with an object box. The object box is framed in a rectangle. +The message object has a notch removed from the right edge.; +#X obj 106 385 print messages; +#X msg 106 358 hello \, bye; +#X text 19 305 You can send multiple messages in succession from a +single message box by using a comma " \, " between the messages. The +messages get send from left to right.; +#X obj 8 276 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X obj 8 416 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 416 Semicolon in message boxes; +#X text 13 276 Comma in message boxes; +#X text 19 445 Just like you can specify receive tags directly in GUI +objects you can also use a message box to send a message directly to +a particular "receive".; +#X obj 34 536 r myreceive; +#X floatatom 34 560 5 0 0 0 - - -; +#X text 189 360 Click to send both messages; +#X text 136 502 send "10" to receive tag "myreceive"; +#X text 19 585 For more info see: message-help.pd 04.messages.pd 10.more.messages.pd +; +#X msg 34 498 \; myreceive 10; +#X obj 448 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 46 Dollarsign in message boxes; +#X msg 534 175 \$1 \$1 \$1; +#X msg 534 154 10; +#X text 459 75 In messages there are placeholders that start with "$". +These placeholders are variables that get replaced with messages you +send to the message box. In the example below we have a single message +"10". Each "$1" in the message box gets replaced with the message "10". +; +#X text 601 175 \$1 placeholder gets replaced; +#X text 570 154 message sent to message box; +#X msg 534 304 list 1 2; +#X text 600 304 a list with items "1" and "2"; +#X msg 534 325 \$2 \$1; +#X text 584 325 \$1 becomes "1" and \$2 becomes "2"; +#X obj 534 347 print reverse-list; +#X text 459 235 The "$1" placeholder refers to the first element of +the list the message box gets from its inlet. We can use this to use +a message box to reverse the order of elements (called atoms) in a +list.; +#X text 459 385 In this case the list "1 2" has two elements (called +atoms) when this list gets sent to the inlet of a message box its atoms +are available to the message box through the $ variables. \$1 gets +replaced with the first element \, \$2 the second and so on.; +#X obj 534 197 print repeated-message; +#X obj 480 511 print complex-message; +#X msg 480 468 list Fred Marcus; +#X text 607 468 a list with two symbol atoms; +#X msg 480 489 Hi \$1. \, Ya know \$2?; +#X text 623 489 Becomes: "Hi Fred \, Ya know Marcus?"; +#X text 12 8 6 Intermediate Pure-Data - Using the message object; +#X connect 6 0 8 0; +#X connect 7 0 8 0; +#X connect 11 0 10 0; +#X connect 18 0 19 0; +#X connect 26 0 38 0; +#X connect 27 0 26 0; +#X connect 31 0 33 0; +#X connect 33 0 35 0; +#X connect 40 0 42 0; +#X connect 42 0 39 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-7.pd b/externals/gridflow/doc/tutorials/pure-data-7.pd new file mode 100755 index 00000000..0d8360ec --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-7.pd @@ -0,0 +1,106 @@ +#N canvas 280 89 936 678 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 627 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 629 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 482 332 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: send receive netsend netreceive cordless communication +network TCP/IP UDP internet; +#X restore 16 633 pd META; +#X obj 8 266 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 266 "pack" object; +#X msg 96 543 2; +#X msg 45 521 1; +#X obj 45 588 print mylist; +#X text 12 20 DESCRIPTION: Using pack \, unpack and route with lists +; +#X text 19 75 In the Pure-Data introduction we discussed the three +different types of data in PD. These are floats (numbers) \, symbols +(words) and lists (groups of floats and words). Floats and symbols +are known as atoms. Atoms are single elements \, they do not contain +spaces or other special characters. Atoms can be grouped into lists. +; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 46 What is a list?; +#X msg 145 216 list one two three; +#X obj 145 239 print this is a list; +#X text 19 155 Lists can be created in a number of ways \, but we are +going to cover the two most common ways of creating lists. The most +simple way to create a list is to type the list into a message box +starting with the word (symbol) "list":; +#X text 19 295 The "pack" object is the second most common way to create +a list. "pack" allows you to take individual atoms and combine them +into a single list. "pack" accepts a number of arguments. Each argument +defines the type of atom in the resulting list. The "f" argument creates +an inlet that accepts float atoms. The "s" argument creates an inlet +accepts symbol atoms. The number of arguments is the same as the number +of elements in the resultant list.; +#X text 19 405 "pack" is the first object we are going to learn that +has a "cold" inlet. Some control objects in PD have "hot" and "cold" +inlets. When you send a message to a "cold" inlet the object does not +generate any output (it does not send any messages). When "hot" inlets +get messages then the object does generate output. The leftmost inlet +is always the "hot" inlet and all other inlets are "cold" or in some +cases all inlets are "hot"; +#X text 75 521 sets the first atom "1" and then sends the list; +#X text 132 543 sets the second atom "2"; +#X obj 45 566 pack f f; +#X text 459 45 Note that if you do not set the second and onwards atoms +via thier "cold" inlets and you generate the list by setting the first +atom via the "hot" inlet then all float atoms will be set to "0" and +all symbol atoms will be set to "symbol" in the resultant list.; +#X obj 448 126 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 126 "unpack" object; +#X obj 596 241 unpack f f f; +#X msg 596 219 list 1 2 3; +#X floatatom 596 294 5 0 0 0 - - -; +#X floatatom 635 277 5 0 0 0 - - -; +#X floatatom 675 262 5 0 0 0 - - -; +#X text 639 293 First Atom; +#X text 678 277 Second Atom; +#X text 718 261 Third Atom; +#X text 459 156 The "unpack" object is very similar to the "pack" object +except it works in reverse. "unpack" takes a list and splits it up +into a number of atoms. It uses the same arguments as "pack" but generates +outlets rather than inlets.; +#X obj 448 319 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 319 "route" object; +#X text 459 349 The "route" object sorts lists based on the first atom +of the list. It as a number of float or symbol arguments. For each +argument "route" creates one outlet. "route" also creates one additional +rightmost outlet for rejections. For each list route gets it compares +the first atom to all its arguments. If the first atom matches one +of the arguments it the rest of the list \, without the first atom +\, gets send through the outlet corresponding to that argument. If +the first atom of the list does not match any arguments the entire +list \, including the first atom \, gets sent out the rejection outlet. +; +#X msg 688 493 rejection 1; +#X obj 685 553 print rejection; +#X msg 538 493 o1 2; +#X msg 613 493 o2 3; +#X obj 613 531 route o1 o2; +#X obj 613 593 print o1; +#X obj 649 573 print o2; +#X text 12 8 7 Intermediate Pure-Data - Working with lists; +#X connect 6 0 20 1; +#X connect 7 0 20 0; +#X connect 13 0 14 0; +#X connect 20 0 8 0; +#X connect 24 0 26 0; +#X connect 24 1 27 0; +#X connect 24 2 28 0; +#X connect 25 0 24 0; +#X connect 36 0 40 0; +#X connect 38 0 40 0; +#X connect 39 0 40 0; +#X connect 40 0 41 0; +#X connect 40 1 42 0; +#X connect 40 2 37 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-8.pd b/externals/gridflow/doc/tutorials/pure-data-8.pd new file mode 100755 index 00000000..aa95c087 --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-8.pd @@ -0,0 +1,89 @@ +#N canvas 238 94 891 621 10; +#X obj 8 6 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 577 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 668 579 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 482 332 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: send receive netsend netreceive cordless communication +network TCP/IP UDP internet; +#X restore 16 583 pd META; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 12 20 DESCRIPTION: nested patches using abstractions & subpatches +; +#X text 13 46 What is an abstraction?; +#X text 23 76 Since objects are very simple in Pure-Data doing complex +tasks often leads to very complex patches. Often it is useful to use +the same bit of patching you do for one project for another. Pure-Data +has a facility to "nest" \, that is to take a number of objects in +a collection and place them into a group that looks like a single object. +This is also handy to make a complex patch look simple and clear by +hiding the nitty-gritty details. There are two types of these collections +\, the subpatch and the abstraction.; +#X obj 8 216 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 13 216 The subpatch; +#X text 23 246 Subpatches are collections of objects that get "hidden" +inside a container that looks like a normal PD object. Subpatches are +created by creating an object box \, and typing the word "pd" followed +by whatever you want to describe the contents of the subpatch. Subpatches +are saved at the same time as the "parent" patch. Here is a subpatch: +; +#N canvas 0 22 460 310 subpatch 0; +#X obj 30 34 inlet; +#X obj 30 77 outlet; +#X text 99 35 This is inside the subpatch.; +#X connect 0 0 1 0; +#X restore 178 359 pd subpatch; +#X floatatom 178 336 5 0 0 0 - - -; +#X floatatom 178 387 5 0 0 0 - - -; +#X text 23 416 To open a subpatch simply click once on the subpatch +in run-mode or control-click (or right-click) and select open in edit-mode. +Both subpatches and abstractions communicate with the parent patch +through special objects called "inlet" and "outlet" for each "inlet" +in a subpatch or abstraction an inlet is created on the subpatch. This +example has one inlet and one outlet.; +#X obj 448 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 46 The abstraction; +#X text 463 76 Abstractions are very similar to subpatches. They are +collections of objects that are "hidden" inside PD objects \, and they +both use "inlet" and "outlet" objects to communicate with the parent +patch. The difference between subpatches and abstractions is that abstractions +are saved in a separate file from the parent. This means when you save +the parent patch containing abstractions the abstractions are not saved. +The abstractions are saved as separate files so that they can be used +in multiple patches. A second feature that exists in abstractions and +not in subpatches is the ability to use arguments. "send" and "receive" +can be used inside abstractions to send data without connections (patch-cords). +; +#X obj 682 253 r output; +#X obj 682 277 print; +#X obj 564 253 abstraction 1 2; +#X text 463 316 To create an abstraction all you need to do is create +a new PD patch ("File" -> "New"). Create the contents of the abstraction +and then save it in the same directory as the patch you want to use +it in. In this case the abstraction is saved as "abstraction.pd". Once +saved you can easily embed the abstraction simply by typing its name +\, without the .pd extension \, into an object box.; +#X obj 448 416 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 453 416 Dollarsign in object boxes; +#X text 463 446 If you open the above example you will see that the +familiar "pack" object has a number of "$" arguments. The "$" arguments +in a object box differ entirely from the "$" used in message objects. +When you use a "$" in an object box inside an abstraction the values +get replaced with the arguments to that abstraction. In the case above +the "pack" object's first argument "$1" gets replaced with the first +argument of the abstraction "1" "$2" gets replaced with the second +argument "2".; +#X text 23 536 For more info see: 12.PART2.subpatch.pd 14.dollersign.pd +; +#X text 12 8 8 Intermediate Pure-Data - Using abstractions and subpacthes +; +#X connect 11 0 13 0; +#X connect 12 0 11 0; +#X connect 18 0 19 0; diff --git a/externals/gridflow/doc/tutorials/pure-data-9.pd b/externals/gridflow/doc/tutorials/pure-data-9.pd new file mode 100755 index 00000000..e5188ee0 --- /dev/null +++ b/externals/gridflow/doc/tutorials/pure-data-9.pd @@ -0,0 +1,43 @@ +#N canvas 291 108 450 562 10; +#X obj 8 6 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 8 517 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 228 519 Copyright Ben Bogart 2005 \; (See COPYING.TXT for details) +; +#N canvas 0 22 486 336 META 0; +#X text 12 5 CATEGORY: tutorial; +#X text 12 15 KEYWORDS: GOP graph parent abstraction nesting ui interface +; +#X restore 16 523 pd META; +#X obj 8 46 cnv 15 430 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text 12 20 DESCRIPTION: Using Graph on Parent abstractions; +#X text 13 46 What is Graph on Parent?; +#X text 13 76 Graph on Parent is a feature of PD that allows you to +show the GUI objects contained in an abstraction on the parent patch. +This means that you can create abstractions that not only include a +collection of objects but can also include a user interface. To use +graph on parent you simply need to create an abstraction the usual +way but before saving it you need should Control-Click (Right-Click) +on the background (white area) in the abstraction and choose "properties". +From the properties menu check the "graph on parent" option. Now when +you save the patch and embed it in a second patch all GUI objects will +be visible.; +#X obj 154 250 gop_abstraction; +#X text 13 331 In this simple example there is only one GUI object +\, a slider. Inside the abstraction the slider is connected to an inlet +and an outlet. If you move the slider you can see the result in the +outlet. If you set a value in the inlet with the number GUI you can +see the position of the slider change.; +#X floatatom 154 231 5 0 0 0 - - -; +#X floatatom 154 297 5 0 0 0 - - -; +#X text 13 421 Note you can change the size of the abstractions bounding +box by Control-Click (Right-Click) on the abstraction and choose "properties". +The size of the bounding-box is specified by the "screen width" and +"screen height".; +#X text 13 487 For more info see:; +#X text 12 8 9 Intermediate Pure-Data - Using GUI's in abstractions +; +#X connect 8 0 11 0; +#X connect 10 0 8 0; diff --git a/externals/gridflow/doc/tutorials/randomly-select-an-image.pd b/externals/gridflow/doc/tutorials/randomly-select-an-image.pd new file mode 100755 index 00000000..5817aa32 --- /dev/null +++ b/externals/gridflow/doc/tutorials/randomly-select-an-image.pd @@ -0,0 +1,53 @@ +#N canvas 417 0 446 428 10; +#X text 6 15 You can open multiple images in the same window. To do +so you connect the outputs from the images to the inlet of the out +window.; +#X obj 136 295 #out window; +#X obj 65 198 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 28 232 #in; +#X msg 28 160 open b001.jpg; +#X obj 188 197 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 151 231 #in; +#X msg 151 159 open r001.jpg; +#X obj 301 196 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 264 230 #in; +#X msg 264 158 open g001.jpg; +#X obj 7 -37 cnv 15 430 15 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 10 -37 What is a grid?; +#X obj 8 320 cnv 15 430 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text 16 327 GridFlow 0.8.0; +#X obj 7 -72 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 12 -73 2 Images; +#X text 14 -59 Description: opening multiple images from one window. +; +#X obj 56 115 random 3; +#X floatatom 195 81 5 0 0 0 - - -; +#X obj 3 55 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; +#X obj 163 112 sel 0; +#X obj 226 127 sel 1; +#X obj 304 115 sel 2; +#X obj 55 92 metro 1000; +#X connect 2 0 3 0; +#X connect 3 0 1 0; +#X connect 4 0 3 0; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X connect 7 0 6 0; +#X connect 8 0 9 0; +#X connect 9 0 1 0; +#X connect 10 0 9 0; +#X connect 18 0 19 0; +#X connect 19 0 21 0; +#X connect 19 0 22 0; +#X connect 19 0 23 0; +#X connect 20 0 24 0; +#X connect 21 0 2 0; +#X connect 22 0 5 0; +#X connect 23 0 8 0; +#X connect 24 0 18 0; diff --git a/externals/gridflow/doc/tutorials/title-page-pd-gf-in-one.pd b/externals/gridflow/doc/tutorials/title-page-pd-gf-in-one.pd new file mode 100755 index 00000000..18798314 --- /dev/null +++ b/externals/gridflow/doc/tutorials/title-page-pd-gf-in-one.pd @@ -0,0 +1,129 @@ +#N canvas 18 0 762 514 10; +#X obj 102 -15 cnv 15 430 50 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 102 66 cnv 1 430 430 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 102 98 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 102 73 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 108 66 cnv 1 2 430 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 516 67 cnv 1 2 430 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 102 158 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 102 182 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 152 114 1.1 What is a grid?; +#X obj 142 456 cnv 15 300 30 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 154 461 Stephanie Brodeur & Darsha Hewitt 2005; +#X obj 102 36 cnv 15 430 30 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 214 -6 cnv 15 100 17 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 214 -6 GridFlow 0.8.0; +#X obj 102 -15 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 102 34 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 315 8 cnv 15 63 17 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 314 8 Tutorials; +#X obj 102 65 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 102 495 cnv 1 430 1 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X text 140 79 1; +#X obj 158 78 Introduction to Grids; +#X text 152 130 1.2 How to create grid.; +#X text 152 192 2.1 How does GridFlow understand images?; +#X text 141 164 2; +#X obj 162 161 Introduction to Images; +#X text 152 211 2.2 Opening an image.; +#X text 152 230 2.3 Different options on how to open an image.; +#X text 178 247 2.3.1 Opening different images in one window.; +#X text 178 264 2.3.2 Opening images using send and receive.; +#X obj 102 356 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X obj 102 380 cnv 1 430 2 empty empty empty 20 12 0 14 -228992 -66577 +0; +#X text 141 362 3; +#X obj 162 359 Introduction to Video; +#X text 178 300 2.4.1 Resizing an image.; +#X text 151 284 2.4 Image manipulation.; +#X text 178 315 2.4.2 Greyscale.; +#X text 178 330 2.4.3 numop.; +#X text 149 394 4 Introduction to live feed; +#X text 150 422 5 Putting it all together; +#X obj -401 -18 cnv 15 455 30 empty empty empty 20 12 0 14 -233017 +-66577 0; +#X obj -398 898 cnv 15 870 30 empty empty empty 20 12 0 14 -233017 +-66577 0; +#X text -393 898 Copyright Ben Bogart 2005 \; (See COPYING.TXT for +details); +#X text -397 -11 Welcome to Pure-Data...; +#X obj -401 22 cnv 15 455 15 empty empty empty 20 12 0 14 -179884 -66577 +0; +#X text -396 22 What is Pure-Data (aka PD)?; +#X text -381 50 Pure-Data is an open-source patching environment for +multi-media (audio+image). Pure-Data is a programming language where +you create relationships by connecting visual boxes (rather than typing +complex commands). This lecture is separated into three sections: An +Introduction to Pure-Data \, An introduction to Gem and intermediate +PD and Gem.; +#X obj -381 152 cnv 15 430 120 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X obj -367 174 pddp_open pure-data-1; +#X obj -367 197 pddp_open pure-data-2; +#X obj -367 220 pddp_open pure-data-3; +#X obj -367 243 pddp_open pure-data-4; +#X text -192 174 Pure-Data Introduction; +#X text -192 197 GUI Objects for Interaction; +#X text -192 220 Creating your first patch; +#X text -192 243 Control: metro \, random & counter; +#X obj -382 376 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X obj -378 580 cnv 15 430 145 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X obj -364 602 pddp_open pure-data-5; +#X obj -364 625 pddp_open pure-data-6; +#X text -189 625 The powerful message object; +#X obj -364 648 pddp_open pure-data-7; +#X text -189 648 More about lists; +#X text -189 671 Nesting collections of objects; +#X text -189 602 Connectionless communications; +#X obj -364 671 pddp_open pure-data-8; +#X text -189 695 Using GUI's in abstractions; +#X obj -364 695 pddp_open pure-data-9; +#X obj -378 787 cnv 15 430 95 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X text -194 422 Introduction to Images; +#X text -194 468 Introduction to Live Feeds; +#X obj -401 308 cnv 15 455 15 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X text -189 837 Putting it all together; +#X text -190 808 Interfacing with sensors; +#X text -194 399 Introduction to Grids; +#X text -384 331 GridFlow is a multidimentional dataflow processing +library for PureData and Ruby \, designed for interactive multimedia. +; +#X text -377 376 2 Introduction to GridFlow; +#X text -376 152 1 Introduction to Pure-Data; +#X text -373 580 3 Intermediate Pure-Data; +#X text -373 787 4 Intermediate GridFlow; +#X obj -401 542 cnv 15 455 15 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X text -396 542 What is GridFLow?; +#X obj -400 751 cnv 15 455 15 empty empty empty 20 12 0 14 -179884 +-66577 0; +#X text -395 751 What is GridFLow?; +#X obj -283 400 GridFlow-1; +#X obj -283 423 GridFlow-2; +#X obj -283 446 GridFlow-3; +#X obj -283 469 GridFlow-4; +#X obj -281 809 GridFlow-6; +#X obj -281 832 GridFlow-7; +#X text -395 308 What is GridFlow?; +#X text -194 445 Introduction to Video; diff --git a/externals/gridflow/doc/tutorials/txt-for-resize-image.pd b/externals/gridflow/doc/tutorials/txt-for-resize-image.pd new file mode 100755 index 00000000..f991ba07 --- /dev/null +++ b/externals/gridflow/doc/tutorials/txt-for-resize-image.pd @@ -0,0 +1,3 @@ +#N canvas 0 0 450 300 10; +#X text 48 29 How to resize an image:; +#X text 39 70 # scale 640 480 pour les images; diff --git a/externals/gridflow/examples/bounce.pd b/externals/gridflow/examples/bounce.pd new file mode 100644 index 00000000..46421cad --- /dev/null +++ b/externals/gridflow/examples/bounce.pd @@ -0,0 +1,32 @@ +#N canvas 0 0 450 300 10; +#X obj 34 284 #out window; +#X floatatom 48 71 5 0 0 0 - - -; +#X obj 34 16 metro 30; +#X obj 6 19 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; +#X obj 34 42 f; +#X obj 95 34 + 1; +#X msg 34 265 set_geometry \$1 \$2 200 200; +#X obj 34 93 t f f; +#X obj 34 246 pack 0 0; +#X obj 64 136 expr $f1-int($f1); +#X obj 64 156 expr 2*if($f1>=.5 \, $f1 \, (1-$f1)); +#X obj 64 176 expr $f1*400; +#X obj 64 115 / 200; +#X obj 95 53 % 1000; +#X obj 34 206 expr 400-200*abs(sin($f1/3.1416/5)); +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 5 0; +#X connect 4 0 1 0; +#X connect 4 0 7 0; +#X connect 5 0 13 0; +#X connect 6 0 0 0; +#X connect 7 0 14 0; +#X connect 7 1 12 0; +#X connect 8 0 6 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 8 1; +#X connect 12 0 9 0; +#X connect 13 0 4 1; +#X connect 14 0 8 0; diff --git a/externals/gridflow/examples/doodle.pd b/externals/gridflow/examples/doodle.pd new file mode 100644 index 00000000..8ec75c39 --- /dev/null +++ b/externals/gridflow/examples/doodle.pd @@ -0,0 +1,31 @@ +#N canvas 0 0 450 427 10; +#X obj 22 22 metro 33.3667; +#X obj 1 22 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; +#X obj 143 74 t b l; +#X obj 282 93 loadbang; +#X msg 182 74 put_at ( \$1 \$2 0 ); +#X msg 284 120 0 192 255; +#X obj 22 114 #store (64 64 3 #); +#X obj 22 133 #scale_by 8; +#X obj 22 152 #out window; +#X obj 22 171 #mouse; +#X obj 22 190 # / 8; +#X obj 22 209 #export_list; +#X obj 143 93 #store; +#X obj 232 154 #color; +#X connect 0 0 6 0; +#X connect 1 0 0 0; +#X connect 2 0 12 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 6 1; +#X connect 5 0 13 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 9 1 10 0; +#X connect 10 0 11 0; +#X connect 11 0 2 0; +#X connect 12 0 6 1; +#X connect 13 0 12 1; diff --git a/externals/gridflow/examples/heat.pd b/externals/gridflow/examples/heat.pd new file mode 100644 index 00000000..743fc4e6 --- /dev/null +++ b/externals/gridflow/examples/heat.pd @@ -0,0 +1,173 @@ +#N canvas 59 155 741 486 10; +#X obj 228 23 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#N canvas 199 246 450 453 heat 1; +#X obj 129 23 inlet mask; +#X obj 22 42 t a a; +#X obj 22 224 # +; +#X obj 22 23 inlet heatmap; +#X obj 24 394 outlet heatmap; +#X obj 241 154 #greyscale_to_rgb; +#X obj 241 175 #out window; +#X obj 22 80 #store; +#X obj 22 61 #finished; +#X obj 52 167 # + 128; +#X obj 52 186 # >> 8; +#X obj 52 134 # *; +#X obj 52 103 #convolve (3 3 # 0 1 0 1 -4 1); +#X obj 52 205 # + 2; +#X obj 52 225 # >> 4; +#X connect 0 0 11 1; +#X connect 1 0 8 0; +#X connect 1 1 7 1; +#X connect 1 1 12 0; +#X connect 2 0 4 0; +#X connect 3 0 1 0; +#X connect 5 0 6 0; +#X connect 7 0 2 0; +#X connect 8 0 7 0; +#X connect 9 0 10 0; +#X connect 10 0 13 0; +#X connect 11 0 9 0; +#X connect 12 0 11 0; +#X connect 13 0 14 0; +#X connect 14 0 2 1; +#X restore 27 81 pd heat; +#X obj 27 61 #store; +#X obj 94 42 loadbang; +#X obj 27 16 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 +; +#X obj 27 363 #out window; +#X obj 227 157 #greyscale_to_rgb; +#X obj 227 138 # >> 2; +#X obj 48 23 s metro; +#X obj 27 382 #mouse \, ...; +#X obj 120 382 # >> 1; +#X obj 27 344 #scale_by 2; +#X msg 94 61 240 320 1 # 0; +#N canvas 205 52 520 286 finger 0; +#X obj 28 62 shunt 2; +#X msg 289 71 4 2 # 0 0 0 1 1 1 1 0; +#X obj 289 90 # * 8; +#X obj 289 109 # - 4; +#X obj 289 128 # +; +#X obj 28 23 inlet; +#X obj 28 142 outlet; +#X obj 289 14 inlet position; +#X obj 72 23 inlet button; +#X obj 289 33 #export_list; +#X obj 289 52 t b a; +#X obj 72 81 #draw_polygon + (4000); +#X connect 0 0 6 0; +#X connect 0 1 11 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 11 2; +#X connect 5 0 0 0; +#X connect 7 0 9 0; +#X connect 8 0 0 1; +#X connect 9 0 10 0; +#X connect 10 0 1 0; +#X connect 10 1 4 1; +#X connect 11 0 6 0; +#X restore 27 163 pd finger; +#X obj 15 436 fps detailed; +#X obj 16 456 display; +#X obj 27 119 shunt 2; +#X obj 90 104 f; +#X obj 115 104 + 1; +#X obj 27 100 t a b; +#X obj 140 123 ==; +#X obj 140 104 % 4; +#N canvas 340 133 341 379 render 0; +#X obj 12 285 # +; +#X obj 26 23 inlet heatmap; +#X obj 12 323 outlet rgb; +#X obj 123 23 inlet mask; +#X obj 26 53 t a a; +#X obj 26 80 #inner (1 3 # 2 4 6) \, op >>; +#X obj 82 161 t a a; +#X obj 88 189 # -; +#X obj 88 227 # + 128; +#X obj 12 304 #clip; +#X obj 88 208 # << 6; +#X obj 26 108 shunt 2; +#X obj 79 109 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X connect 0 0 9 0; +#X connect 1 0 4 0; +#X connect 3 0 0 1; +#X connect 4 0 5 0; +#X connect 5 0 11 0; +#X connect 6 0 7 1; +#X connect 6 1 7 0; +#X connect 7 0 10 0; +#X connect 8 0 0 0; +#X connect 9 0 2 0; +#X connect 10 0 8 0; +#X connect 11 0 0 0; +#X connect 11 1 6 0; +#X connect 12 0 11 1; +#X restore 28 271 pd render; +#X obj 295 232 #fold +; +#X obj 295 251 #fold +; +#X obj 295 289 #fold +; +#X obj 245 23 loadbang; +#X obj 227 100 # max; +#X obj 227 81 # << 1; +#X obj 227 119 # min 256; +#X obj 227 62 # - 40; +#X obj 295 270 # / 320; +#X obj 295 308 # / 240; +#X obj 295 327 #export; +#X floatatom 294 356 5 0 0 0 - - -; +#X obj 27 42 metro 12; +#X text 542 3 heat propagation simulation; +#X text 396 43 use a greyscale image here; +#X text 493 17 Copyright 2005 by Mathieu Bouchard; +#X obj 227 43 #in ../images/pmask.png; +#X text 396 57 as a heat conduction map; +#X connect 0 0 39 0; +#X connect 1 0 19 0; +#X connect 2 0 1 0; +#X connect 3 0 12 0; +#X connect 4 0 35 0; +#X connect 5 0 9 0; +#X connect 5 0 14 0; +#X connect 6 0 22 1; +#X connect 7 0 6 0; +#X connect 9 0 10 0; +#X connect 9 1 10 0; +#X connect 9 4 13 1; +#X connect 10 0 13 2; +#X connect 11 0 5 0; +#X connect 12 0 2 1; +#X connect 13 0 2 1; +#X connect 13 0 22 0; +#X connect 14 0 15 0; +#X connect 16 0 2 1; +#X connect 16 1 13 0; +#X connect 17 0 18 0; +#X connect 18 0 21 0; +#X connect 19 0 16 0; +#X connect 19 1 17 0; +#X connect 20 0 16 1; +#X connect 21 0 17 1; +#X connect 21 0 20 0; +#X connect 22 0 11 0; +#X connect 23 0 24 0; +#X connect 24 0 31 0; +#X connect 25 0 32 0; +#X connect 26 0 39 0; +#X connect 27 0 29 0; +#X connect 28 0 27 0; +#X connect 29 0 1 1; +#X connect 29 0 7 0; +#X connect 30 0 28 0; +#X connect 31 0 25 0; +#X connect 32 0 33 0; +#X connect 33 0 34 0; +#X connect 35 0 2 0; +#X connect 35 0 8 0; +#X connect 39 0 30 0; diff --git a/externals/gridflow/examples/markov.pd b/externals/gridflow/examples/markov.pd new file mode 100644 index 00000000..d6bbe262 --- /dev/null +++ b/externals/gridflow/examples/markov.pd @@ -0,0 +1,133 @@ +#N canvas 238 57 825 641 10; +#X obj 70 203 dac~; +#X obj 71 141 osc~; +#X obj 71 103 mtof; +#X obj 71 122 t f b; +#X obj 105 142 line~; +#X obj 70 160 *~; +#X obj 74 86 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 6700 1; +#X obj 70 179 *~ 0.1; +#X obj 33 6 key; +#X obj 409 139 messageprepend set; +#X obj 497 110 t l; +#X msg 409 89 list \$1; +#X obj 409 109 listprepend; +#X msg 481 84 list; +#X obj 97 7 loadbang; +#X obj 34 29 listfind; +#X obj 34 48 sel -1; +#X obj 71 67 + 60; +#X msg 114 28 list 113 50 119 51 101 114 53 116 54 121 55 117 105 57 +111 48 112 91 61 93 127; +#X obj 409 69 key; +#X msg 111 123 0.7 \, 0 400; +#X floatatom 105 68 5 0 0 0 - - -; +#X msg 200 180 list \$1; +#X obj 275 199 listsublist 0 2; +#X obj 200 199 listappend; +#X obj 483 388 display; +#X msg 270 264 1; +#X msg 305 240 put_at ( \$2 \$1 ); +#X obj 166 319 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 75 309 f; +#X obj 39 410 #store; +#X obj 97 393 #fold +; +#X obj 96 417 display; +#X obj 275 219 t l l l; +#X msg 184 279 bang; +#X obj 8 387 #finished; +#X floatatom 99 311 5 0 0 0 - - -; +#X obj 90 288 t f; +#X obj 17 262 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X msg 192 299 list \$1; +#X obj 46 366 t a a; +#X obj 39 502 #scan +; +#X obj 200 157 spigot; +#X obj 82 440 # rand; +#X obj 80 472 display; +#X obj 38 546 # <; +#X obj 50 595 #fold +; +#X obj 280 512 display; +#X obj 132 596 #export; +#X obj 248 157 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 104 329 + 60; +#X obj 148 368 spigot; +#X obj 199 367 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 17 286 metro 100; +#X obj 50 617 display; +#X obj 67 568 display; +#X obj 90 537 display; +#X obj 191 322 #store (17 17 #) \, op +; +#X text 536 12 This will be an example of Markov Chains; +#X text 536 27 But it's not too clean yet; +#X connect 1 0 5 0; +#X connect 2 0 3 0; +#X connect 3 0 1 0; +#X connect 3 1 20 0; +#X connect 4 0 5 1; +#X connect 5 0 7 0; +#X connect 6 0 2 0; +#X connect 7 0 0 0; +#X connect 7 0 0 1; +#X connect 8 0 15 0; +#X connect 10 0 12 1; +#X connect 11 0 12 0; +#X connect 12 0 10 0; +#X connect 12 0 9 0; +#X connect 13 0 12 1; +#X connect 14 0 18 0; +#X connect 15 0 16 0; +#X connect 16 1 17 0; +#X connect 16 1 42 0; +#X connect 17 0 6 0; +#X connect 17 0 21 0; +#X connect 18 0 15 1; +#X connect 19 0 11 0; +#X connect 20 0 4 0; +#X connect 22 0 24 0; +#X connect 23 0 24 1; +#X connect 23 0 33 0; +#X connect 24 0 23 0; +#X connect 26 0 57 1; +#X connect 27 0 57 1; +#X connect 28 0 57 0; +#X connect 29 0 39 0; +#X connect 30 0 41 0; +#X connect 30 0 47 0; +#X connect 31 0 32 0; +#X connect 31 0 43 0; +#X connect 33 0 34 0; +#X connect 33 1 26 0; +#X connect 33 2 27 0; +#X connect 34 0 57 0; +#X connect 35 0 30 0; +#X connect 36 0 50 0; +#X connect 37 0 29 1; +#X connect 37 0 36 0; +#X connect 38 0 53 0; +#X connect 39 0 57 0; +#X connect 40 0 35 0; +#X connect 40 1 30 1; +#X connect 40 1 31 0; +#X connect 41 0 45 0; +#X connect 41 0 56 0; +#X connect 42 0 22 0; +#X connect 43 0 44 0; +#X connect 43 0 45 1; +#X connect 45 0 46 0; +#X connect 45 0 55 0; +#X connect 46 0 48 0; +#X connect 46 0 54 0; +#X connect 48 0 37 0; +#X connect 49 0 42 1; +#X connect 50 0 6 0; +#X connect 51 0 40 0; +#X connect 52 0 51 1; +#X connect 53 0 29 0; +#X connect 57 0 25 0; +#X connect 57 0 51 0; diff --git a/externals/gridflow/examples/mechanics.pd b/externals/gridflow/examples/mechanics.pd new file mode 100644 index 00000000..944dcb7c --- /dev/null +++ b/externals/gridflow/examples/mechanics.pd @@ -0,0 +1,121 @@ +#N canvas 491 20 624 716 10; +#X obj 188 65 # rand; +#X obj 81 97 #store; +#X obj 188 8 loadbang; +#X obj 134 120 #transpose; +#X obj 64 8 tgl 17 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 81 171 #inner \, op sq- \, fold +; +#X msg 139 56 1; +#X msg 100 56 0; +#X obj 81 120 shunt 2; +#X obj 81 29 t b b b b; +#X obj 27 244 #transpose 1 3; +#X obj 27 282 #fold +; +#X obj 27 357 # inv*; +#X obj 159 424 # +; +#X msg 188 27 bang; +#X obj 12 648 #out window; +#X obj 12 29 t b b; +#X obj 12 667 fps detailed; +#X obj 190 471 # inv+; +#X obj 279 235 # + 1; +#X obj 279 216 # * -2; +#X obj 185 424 # *; +#X msg 261 76 7 2 # 0; +#X obj 12 574 # min 255; +#X obj 81 8 metro 40; +#X obj 350 598 #dim; +#X msg 350 636 \$1; +#X msg 349 674 \$1 2; +#X obj 350 617 #export_list; +#X obj 287 500 t a a; +#X obj 350 655 * 6; +#X obj 27 225 #outer sq-; +#X msg 188 46 7 2 # 5760 7680; +#X obj 240 521 # / 16; +#X obj 27 322 # >> 8; +#X obj 46 496 display; +#X obj 190 452 # >> 8; +#X obj 74 357 # << 8; +#X obj 27 263 # * (2 2 # 1 0 0 1); +#X obj 81 190 #outer ignore (2 #); +#X obj 279 178 # abs- (2880 3840); +#X obj 279 197 # >= (2880 3840); +#X obj 290 460 # min (36000 48000); +#X obj 290 479 # max (0 0); +#X obj 240 541 #inner (2 6 2 # 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 +0 1 0 1 0 0); +#X obj 240 573 # + (6 2 # -8 -8 -8 8 8 8 8 -8 -8 -8 180 240); +#X obj 12 555 # *>>8 (232 242 252); +#X obj 12 536 #draw_polygon + \, color (3 # 130); +#X obj 12 517 #store (360 480 3 # 0); +#X obj 28 376 #fold + \, seed (2 #); +#X obj 231 613 #redim (42 2); +#X text 310 8 This was supposed to be some kind of; +#X text 310 24 Newtonian physics simulation; +#X text 310 42 But it doesn't quite work; +#X connect 0 0 1 1; +#X connect 1 0 8 0; +#X connect 2 0 14 0; +#X connect 3 0 5 1; +#X connect 3 0 31 1; +#X connect 4 0 24 0; +#X connect 5 0 39 0; +#X connect 6 0 8 1; +#X connect 7 0 8 1; +#X connect 8 0 5 0; +#X connect 8 0 31 0; +#X connect 8 1 3 0; +#X connect 8 1 18 1; +#X connect 8 1 40 0; +#X connect 9 0 16 0; +#X connect 9 1 7 0; +#X connect 9 2 1 0; +#X connect 9 3 6 0; +#X connect 10 0 38 0; +#X connect 11 0 34 0; +#X connect 12 0 49 0; +#X connect 13 0 21 1; +#X connect 13 0 36 0; +#X connect 14 0 32 0; +#X connect 14 0 22 0; +#X connect 15 0 17 0; +#X connect 16 0 48 0; +#X connect 16 1 1 0; +#X connect 18 0 29 0; +#X connect 19 0 21 0; +#X connect 20 0 19 0; +#X connect 21 0 13 1; +#X connect 22 0 13 1; +#X connect 22 0 21 1; +#X connect 23 0 15 0; +#X connect 23 0 48 1; +#X connect 24 0 9 0; +#X connect 25 0 28 0; +#X connect 26 0 30 0; +#X connect 27 0 50 1; +#X connect 28 0 26 0; +#X connect 29 0 1 1; +#X connect 29 0 33 0; +#X connect 29 1 25 0; +#X connect 30 0 27 0; +#X connect 31 0 10 0; +#X connect 32 0 0 0; +#X connect 33 0 44 0; +#X connect 34 0 12 0; +#X connect 36 0 18 0; +#X connect 36 0 35 0; +#X connect 37 0 12 1; +#X connect 38 0 11 0; +#X connect 39 0 37 0; +#X connect 40 0 41 0; +#X connect 41 0 20 0; +#X connect 42 0 43 0; +#X connect 43 0 29 0; +#X connect 44 0 45 0; +#X connect 45 0 50 0; +#X connect 46 0 23 0; +#X connect 47 0 46 0; +#X connect 48 0 47 0; +#X connect 49 0 13 0; +#X connect 50 0 47 2; diff --git a/externals/gridflow/extra/jmax_format.rb b/externals/gridflow/extra/jmax_format.rb index c1b93ce5..8fba0a73 100644 --- a/externals/gridflow/extra/jmax_format.rb +++ b/externals/gridflow/extra/jmax_format.rb @@ -1,5 +1,5 @@ =begin - $Id: jmax_format.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: jmax_format.rb,v 1.2 2006-03-15 04:40:47 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard diff --git a/externals/gridflow/extra/puredata_format.rb b/externals/gridflow/extra/puredata_format.rb index 508f545e..eaf32962 100644 --- a/externals/gridflow/extra/puredata_format.rb +++ b/externals/gridflow/extra/puredata_format.rb @@ -1,5 +1,5 @@ =begin - $Id: puredata_format.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: puredata_format.rb,v 1.2 2006-03-15 04:40:47 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard diff --git a/externals/gridflow/extra/server_1_grid.rb b/externals/gridflow/extra/server_1_grid.rb index f1f4a9fc..fcc847f2 100644 --- a/externals/gridflow/extra/server_1_grid.rb +++ b/externals/gridflow/extra/server_1_grid.rb @@ -1,4 +1,4 @@ -# $Id: server_1_grid.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ +# $Id: server_1_grid.rb,v 1.2 2006-03-15 04:40:47 matju Exp $ require "socket" require "smpte" # in this folder diff --git a/externals/gridflow/extra/server_1_ppm.rb b/externals/gridflow/extra/server_1_ppm.rb index dad6d3f7..5f2ec52e 100644 --- a/externals/gridflow/extra/server_1_ppm.rb +++ b/externals/gridflow/extra/server_1_ppm.rb @@ -1,4 +1,4 @@ -# $Id: server_1_ppm.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ +# $Id: server_1_ppm.rb,v 1.2 2006-03-15 04:40:47 matju Exp $ require "socket" diff --git a/externals/gridflow/extra/smpte.rb b/externals/gridflow/extra/smpte.rb index c14c936e..6b568de2 100644 --- a/externals/gridflow/extra/smpte.rb +++ b/externals/gridflow/extra/smpte.rb @@ -1,5 +1,5 @@ # Copyright 2001 by Mathieu Bouchard -# $Id: smpte.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ +# $Id: smpte.rb,v 1.2 2006-03-15 04:40:47 matju Exp $ # The standard SMPTE color test pattern. # AS SEEN ON TV !!! (but this is a cheap plastic imitation) diff --git a/externals/gridflow/format/aalib.c b/externals/gridflow/format/aalib.c index f014a632..cf029dfe 100644 --- a/externals/gridflow/format/aalib.c +++ b/externals/gridflow/format/aalib.c @@ -1,5 +1,5 @@ /* - $Id: aalib.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: aalib.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard diff --git a/externals/gridflow/format/dc1394.c b/externals/gridflow/format/dc1394.c index 1632bef7..5349c231 100644 --- a/externals/gridflow/format/dc1394.c +++ b/externals/gridflow/format/dc1394.c @@ -1,5 +1,5 @@ /* - $Id: dc1394.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: dc1394.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/format/jpeg.c b/externals/gridflow/format/jpeg.c index e59d8e06..4363be52 100644 --- a/externals/gridflow/format/jpeg.c +++ b/externals/gridflow/format/jpeg.c @@ -1,5 +1,5 @@ /* - $Id: jpeg.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: jpeg.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard @@ -42,6 +42,7 @@ struct FormatJPEG : Format { int fd; FILE *f; \decl Ruby frame (); + \decl void quality (short quality); \decl void initialize (Symbol mode, Symbol source, String filename); \grin 0 int }; @@ -108,6 +109,13 @@ static bool gfeof(FILE *f) { return Qnil; } +\def void quality (short quality) { + quality = min(max((int)quality,0),100); + // should the last arg ("baseline") be set to true ? + // and what is it for? is it for accuracy of the DC component? + jpeg_set_quality(&cjpeg,quality,false); +} + \def void initialize (Symbol mode, Symbol source, String filename) { rb_call_super(argc,argv); if (source!=SYM(file)) RAISE("usage: jpeg file <filename>"); @@ -121,7 +129,7 @@ static bool gfeof(FILE *f) { \classinfo { IEVAL(rself, - "install '#in:jpeg',1,1;@mode=6;" + "install '#io:jpeg',1,1;@mode=6;" "include GridFlow::EventIO; suffixes_are'jpeg','jpg'"); } \end class FormatJPEG diff --git a/externals/gridflow/format/main.rb b/externals/gridflow/format/main.rb index 6e31be75..1cac124f 100644 --- a/externals/gridflow/format/main.rb +++ b/externals/gridflow/format/main.rb @@ -1,5 +1,5 @@ =begin - $Id: main.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: main.rb,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard @@ -237,7 +237,7 @@ GridObject.subclass("#in",1,2) { def _0_set frame; check_file_open; @format.seek frame end def _0_reset; check_file_open; @format.seek 0; end def _1_grid(*a) send_out 0,:grid,*a end - def _0_load name; _0_open name; _0_bang; _0_close end + def _0_load(*a); _0_open(*a); _0_bang; _0_close end } GridObject.subclass("#out",1,1) { @@ -350,8 +350,7 @@ module EventIO else r.close STDOUT.reopen w - STDIN.reopen @stream - @stream = File.open filename, "r" + STDIN.reopen filename, "r" exec "gzip", "-dc" end end @@ -364,8 +363,7 @@ module EventIO else w.close STDIN.reopen r - STDOUT.reopen @stream - @stream = File.open filename, "w" + STDOUT.reopen filename, "w" exec "gzip", "-c" end end @@ -375,7 +373,7 @@ module EventIO when :in; "r" when :out; "w" else raise "bad mode" end - close + @stream.close if @stream case source when :file filename = args[0].to_s @@ -721,6 +719,27 @@ Format.subclass("#io:ppm",1,1) { end def _0_rgrid_flow(data) @stream.write @bp.pack(data) end def _0_rgrid_end; @stream.flush end + self +}.subclass("#io:tk",1,1) { + install_rgrid 0 + def initialize(mode) + if mode!=:out then raise "only #out" end + super(mode,:file,"/tmp/tk-#{$$}-#{object_id}.ppm") + GridFlow.gui "toplevel .#{object_id}\n" + GridFlow.gui "wm title . GridFlow/Tk\n" + GridFlow.gui "image create photo #{object_id} -width 320 -height 240\n" + GridFlow.gui "pack [label .#{object_id}.im -image #{object_id}]\n" + end + def _0_rgrid_end + super + @stream.seek 0,IO::SEEK_SET + GridFlow.gui "image create photo #{object_id} -file /tmp/tk-#{$$}-#{object_id}.ppm\n" + end + def delete + GridFlow.gui "destroy .#{object_id}\n" + GridFlow.gui "image delete #{object_id}\n" + end + alias close delete } Format.subclass("#io:targa",1,1) { diff --git a/externals/gridflow/format/mpeg3.c b/externals/gridflow/format/mpeg3.c index d6820ccd..c2b85192 100644 --- a/externals/gridflow/format/mpeg3.c +++ b/externals/gridflow/format/mpeg3.c @@ -1,5 +1,5 @@ /* - $Id: mpeg3.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: mpeg3.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard @@ -88,7 +88,7 @@ struct FormatMPEG3 : Format { } \classinfo { - IEVAL(rself,"install '#in:mpeg',1,1;@flags=4;" + IEVAL(rself,"install '#io:mpeg',1,1;@flags=4;" "@comment='Motion Picture Expert Group Format" " (using HeroineWarrior\\'s)';suffixes_are'mpg,mpeg'"); } diff --git a/externals/gridflow/format/opengl.c b/externals/gridflow/format/opengl.c new file mode 100644 index 00000000..39979f68 --- /dev/null +++ b/externals/gridflow/format/opengl.c @@ -0,0 +1,181 @@ +/* + $Id: opengl.c,v 1.1 2006-03-15 04:54:54 matju Exp $ + + GridFlow + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard + + This program is free software; you can redistribute it and/or + modify it 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. + + See file ../COPYING for further informations on licensing terms. + + This program is distributed in the hope that it 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../base/grid.h.fcs" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <sys/time.h> +#include <signal.h> +#ifdef MACOSX +#include <OpenGL/gl.h> +#include <OpenGL/glu.h> +#else +#include <GL/gl.h> +#include <GL/glu.h> +#include <GL/glut.h> +#endif +#include <setjmp.h> + +static bool in_use = false; + +\class FormatOpenGL < Format +struct FormatOpenGL : Format { + int window; + GLuint gltex; + P<BitPacking> bit_packing; + P<Dim> dim; + Pt<uint8> buf; + \decl void call (); + \decl void initialize (Symbol mode); + \decl void close (); + \decl void resize_window (int sx, int sy); + \grin 0 +}; + +static jmp_buf hack; +static void my_idle () { longjmp(hack,1); } + +\def void call () { + int32 sy = dim->get(0); + int32 sx = dim->get(1); + glEnable(GL_TEXTURE_2D); + if (!gltex) { + } + glTexSubImage2D(GL_TEXTURE_2D,0,0,0,sx,sy,GL_RGBA,GL_UNSIGNED_BYTE,buf); + glBindTexture(GL_TEXTURE_2D, gltex); + glBegin(GL_QUADS); + glColor3f(1.f,1.f,1.f); + glTexCoord2f(0.f,0.f); glVertex2f(0.f,0.f); + glTexCoord2f(1.f,0.f); glVertex2f( sx,0.f); + glTexCoord2f(1.f,1.f); glVertex2f( sx, sy); + glTexCoord2f(0.f,1.f); glVertex2f(0.f, sy); + glEnd(); + + //Here comes some (un)fair amount of arm-twisting + //This is for processing queued events and then "returning". + glutIdleFunc(my_idle); + if(!setjmp(hack)) glutMainLoop(); + //done + + IEVAL(rself,"@clock.delay 100"); +} + +\def void resize_window (int sx, int sy) {L + dim = new Dim(sy,sx,3); + char foo[666]; + sprintf(foo,"GridFlow/GL (%d,%d,3)",sy,sx); + if ((unsigned)window==0xDeadBeef) { + glutInitWindowSize(sx,sy); + window = glutCreateWindow(foo); + } else { + glutReshapeWindow(sx,sy); + } + if (buf) delete buf.p; + buf = ARRAY_NEW(uint8,sy*sx*4); + glViewport(0,0,sx,sy); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0,sx,sy,0,-99999,99999); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + if (gltex) glDeleteTextures(1, (GLuint*)&gltex); + glGenTextures(1, (GLuint*)&gltex); + glBindTexture(GL_TEXTURE_2D,gltex); + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); + glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE); + glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,sx,sy,0,GL_RGBA,GL_UNSIGNED_BYTE,NULL); + +} + +GRID_INLET(FormatOpenGL,0) { + if (in->dim->n != 3) + RAISE("expecting 3 dimensions: rows,columns,channels"); + if (in->dim->get(2) != 3) + RAISE("expecting 3 channels: red,green,blue (got %d)",in->dim->get(2)); + int sxc = in->dim->prod(1); + int sx = in->dim->get(1), osx = dim->get(1); + int sy = in->dim->get(0), osy = dim->get(0); + in->set_factor(sxc); + if (sx!=osx || sy!=osy) resize_window(0,0,sx,sy); +} GRID_FLOW { + int sxc = in->dim->prod(1); + int sx = in->dim->get(1); + int bypl = 4*sx; + int y = in->dex / sxc; + assert((in->dex % sxc) == 0); + assert((n % sxc) == 0); + for (; n>0; y++, data+=sxc, n-=sxc) bit_packing->pack(sx, data, buf+y*bypl); + } GRID_FINISH { +} GRID_END + +\def void close () { + IEVAL(rself,"@clock.unset"); + if (gltex) glDeleteTextures(1, (GLuint*)&gltex); + if (buf) delete buf.p; + in_use=false; + if ((unsigned)window!=0xDeadBeef) { + glutDestroyWindow(window); + window=0xDeadBeef; + } +} + +\def void initialize (Symbol mode) { + rb_call_super(argc,argv); + if (in_use) RAISE("only one #io:opengl object at a time; sorry"); + in_use=true; + if (mode!=SYM(out)) RAISE("write-only, sorry"); + gltex = 0; + glEnable(GL_TEXTURE_2D); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + glDisable(GL_ALPHA_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_DITHER); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + window = 0xDeadBeef; + int dummy = 0; + glutInit(&dummy,0); + glutInitDisplayMode(GLUT_RGBA); + resize_window(0,0,320,240); + uint32 mask[3] = {0xff000000,0x00ff0000,0x0000ff00}; + bit_packing = new BitPacking(4,4,3,mask); + IEVAL(rself,"@clock = Clock.new self; @clock.delay 0"); + gfpost("@clock = Clock.new self"); +} + +\classinfo { + IEVAL(rself,"install '#io:opengl',1,1;@comment='Silicon Graphics OpenGL'"); +} +\end class FormatOpenGL +void startup_opengl () { + \startall +}
\ No newline at end of file diff --git a/externals/gridflow/format/png.c b/externals/gridflow/format/png.c index 69a0254e..5db0c254 100644 --- a/externals/gridflow/format/png.c +++ b/externals/gridflow/format/png.c @@ -1,5 +1,5 @@ /* - $Id: png.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: png.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/format/quartz.m b/externals/gridflow/format/quartz.m index d7f2863a..9cb00078 100644 --- a/externals/gridflow/format/quartz.m +++ b/externals/gridflow/format/quartz.m @@ -1,5 +1,5 @@ /* - $Id: quartz.m,v 1.1 2005-10-04 02:15:31 matju Exp $ + $Id: quartz.m,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard diff --git a/externals/gridflow/format/quicktimeapple.c b/externals/gridflow/format/quicktimeapple.c index 0664322e..2a485424 100644 --- a/externals/gridflow/format/quicktimeapple.c +++ b/externals/gridflow/format/quicktimeapple.c @@ -1,5 +1,5 @@ /* - $Id: quicktimeapple.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: quicktimeapple.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/format/quicktimehw.c b/externals/gridflow/format/quicktimehw.c index 4ae77209..58f415a0 100644 --- a/externals/gridflow/format/quicktimehw.c +++ b/externals/gridflow/format/quicktimehw.c @@ -1,8 +1,8 @@ /* - $Id: quicktimehw.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: quicktimehw.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow - Copyright (c) 2001,2002,2003 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005,2006 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,18 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define QUICKTIMEHW_INCLUDE_HERE #include "../base/grid.h.fcs" #include <stdlib.h> #include <string.h> #include <errno.h> -#include <quicktime/quicktime.h> -#include <quicktime/colormodels.h> - -#include <quicktime/lqt_version.h> -#ifdef LQT_VERSION -#include <quicktime/lqt.h> -#include <quicktime/lqt_codecinfo.h> -#endif \class FormatQuickTimeHW < Format struct FormatQuickTimeHW : Format { @@ -218,6 +211,8 @@ GRID_INLET(FormatQuickTimeHW,0) { \end ruby ); +//#define L fprintf(stderr,"%s:%d in %s\n",__FILE__,__LINE__,__PRETTY_FUNCTION__); + #ifdef LQT_VERSION lqt_registry_init(); int n = lqt_get_num_video_codecs(); @@ -225,6 +220,10 @@ GRID_INLET(FormatQuickTimeHW,0) { Ruby fourccs = rb_hash_new(); for (int i=0; i<n; i++) { const lqt_codec_info_t *s = lqt_get_video_codec_info(i); + if (!s->name) { + fprintf(stderr,"[#in quicktime]: skipping codec with null name!\n"); + continue; + } Ruby name = rb_str_new2(s->name); Ruby f = rb_ary_new2(s->num_fourccs); for (int j=0; j<s->num_fourccs; j++) { diff --git a/externals/gridflow/format/sdl.c b/externals/gridflow/format/sdl.c index 628f71ee..32ba64a5 100644 --- a/externals/gridflow/format/sdl.c +++ b/externals/gridflow/format/sdl.c @@ -1,5 +1,5 @@ /* - $Id: sdl.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: sdl.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/format/videodev.c b/externals/gridflow/format/videodev.c index e907eaa9..0f458408 100644 --- a/externals/gridflow/format/videodev.c +++ b/externals/gridflow/format/videodev.c @@ -1,5 +1,5 @@ /* - $Id: videodev.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: videodev.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard diff --git a/externals/gridflow/format/x11.c b/externals/gridflow/format/x11.c index 62041f06..9237a6b6 100644 --- a/externals/gridflow/format/x11.c +++ b/externals/gridflow/format/x11.c @@ -1,8 +1,8 @@ /* - $Id: x11.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: x11.c,v 1.2 2006-03-15 04:37:46 matju Exp $ GridFlow - Copyright (c) 2001,2002,2003 by Mathieu Bouchard + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -19,8 +19,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ + Note: some of the code was adapted from PDP's (the XVideo stuff). +*/ #include "../base/grid.h.fcs" #include <ctype.h> #include <stdio.h> @@ -28,66 +29,67 @@ #include <string.h> #include <errno.h> #include <sys/time.h> - #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/StringDefs.h> - -/* X11 Error Handler type */ -typedef int (*XEH)(Display *, XErrorEvent *); - #ifdef HAVE_X11_SHARED_MEMORY #include <sys/ipc.h> #include <sys/shm.h> #include <X11/extensions/XShm.h> #endif +#ifdef HAVE_X11_XVIDEO +#include <X11/extensions/Xv.h> +#include <X11/extensions/Xvlib.h> +#endif + +#undef L +#define L gfpost("%s:%d in %s",__FILE__,__LINE__,__PRETTY_FUNCTION__); + +/* X11 Error Handler type */ +typedef int (*XEH)(Display *, XErrorEvent *); \class FormatX11 < Format struct FormatX11 : Format { - template <class T> void frame_by_type (T bogus); /* at the Display/Screen level */ Display *display; /* connection to xserver */ Visual *visual; /* screen properties */ Window root_window; Colormap colormap; /* for 256-color mode */ - long black,white; /* color numbers in default colormap */ short depth; - bool use_shm; /* should use shared memory? */ + int transfer; /* 0=plain 1=xshm 2=xvideo */ bool use_stripes; /* use alternate conversion in 256-color mode */ - /* at the Window level */ - int autodraw; /* how much to send to the display at once */ Window window; /* X11 window number */ Window parent; /* X11 window number of the parent */ GC imagegc; /* X11 graphics context (like java.awt.Graphics) */ XImage *ximage; /* X11 image descriptor */ - char *name; /* window name (for use by window manager) */ Pt<uint8> image; /* the real data (that XImage binds to) */ bool is_owner; - int pos_x, pos_y; - + int32 pos[2]; P<BitPacking> bit_packing; P<Dim> dim; bool lock_size; bool override_redirect; - #ifdef HAVE_X11_SHARED_MEMORY XShmSegmentInfo *shm_info; /* to share memory with X11/Unix */ #endif - - Atom wmProtocolsAtom; - Atom wmDeleteAtom; - - FormatX11 () : use_stripes(false), - autodraw(1), window(0), ximage(0), name(0), image(Pt<uint8>()), is_owner(true), +#ifdef HAVE_X11_XVIDEO + int xv_format; + int xv_port; + XvImage *xvi; + unsigned char *data; + int last_encoding; +#endif + FormatX11 () : transfer(0), use_stripes(false), + window(0), ximage(0), image(Pt<uint8>()), is_owner(true), dim(0), lock_size(false), override_redirect(false) #ifdef HAVE_X11_SHARED_MEMORY , shm_info(0) #endif {} - + template <class T> void frame_by_type (T bogus); void show_section(int x, int y, int sx, int sy); - void set_wm_hints (int sx, int sy); + void set_wm_hints (); void dealloc_image (); bool alloc_image (int sx, int sy); void resize_window (int sx, int sy); @@ -95,56 +97,68 @@ struct FormatX11 : Format { void report_pointer(int y, int x, int state); void prepare_colormap(); Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, int level=0); - \decl void initialize (...); \decl void frame (); \decl void close (); \decl void call (); \decl void _0_out_size (int sy, int sx); - \decl void _0_draw (); - \decl void _0_autodraw (int autodraw); \decl void _0_setcursor (int shape); \decl void _0_hidecursor (); \decl void _0_set_geometry (int y, int x, int sy, int sx); \decl void _0_fall_thru (int flag); + \decl void _0_transfer (Symbol s); + \decl void _0_title (String s=Qnil); \grin 0 int }; /* ---------------------------------------------------------------- */ +static const char *xfers[3] = {"plain","xshm","xvideo"}; + void FormatX11::show_section(int x, int y, int sx, int sy) { - if (y>dim->get(0)||x>dim->get(1)) return; - if (y+sy>dim->get(0)) sy=dim->get(0)-y; - if (x+sx>dim->get(1)) sx=dim->get(1)-x; + int zy=dim->get(0), zx=dim->get(1); + if (y>zy||x>zx) return; + if (y+sy>zy) sy=zy-y; + if (x+sx>zx) sx=zx-x; + switch (transfer) { + case 0: XPutImage(display,window,imagegc,ximage,x,y,x,y,sx,sy); + XFlush(display); + break; #ifdef HAVE_X11_SHARED_MEMORY - if (use_shm) { - XSync(display,False); + case 1: XSync(display,False); XShmPutImage(display,window,imagegc,ximage,x,y,x,y,sx,sy,False); - /* should completion events be waited for? looks like a bug */ - } else + XFlush(display); + //XPutImage( display,window,imagegc,ximage,x,y,x,y,sx,sy); + // should completion events be waited for? looks like a bug + break; #endif - XPutImage(display,window,imagegc,ximage,x,y,x,y,sx,sy); - XFlush(display); +#ifdef HAVE_X11_XVIDEO + case 2: + break; +#endif + default: RAISE("transfer mode '%s' not available", xfers[transfer]); + } } /* window manager hints, defines the window as non-resizable */ -void FormatX11::set_wm_hints (int sx, int sy) { +void FormatX11::set_wm_hints () { + Ruby title = rb_ivar_get(rself,SI(@title)); if (!is_owner) return; - XWMHints wmhints; - XTextProperty window_name, icon_name; - XSizeHints hints; - // enable recommended, maximum and minimum size - hints.flags=PSize|PMaxSize|PMinSize; - // set those - hints.min_width = hints.max_width = hints.width = sx; - hints.min_height = hints.max_height = hints.height = sy; - - wmhints.input = True; - wmhints.flags = InputHint; - XStringListToTextProperty((char **)&name, 1, &window_name); - XStringListToTextProperty((char **)&name, 1, &icon_name); - XSetWMProperties(display, window, - &window_name, &icon_name, NULL, 0, &hints, &wmhints, NULL); + XWMHints wmh; + char buf[256],*bufp=buf; + if (title==Qnil) { + sprintf(buf,"GridFlow (%d,%d,%d)",dim->get(0),dim->get(1),dim->get(2)); + } else { + sprintf(buf,"%.255s",rb_str_ptr(title)); + } + XTextProperty wtitle; XStringListToTextProperty((char **)&bufp, 1, &wtitle); + XSizeHints sh; + sh.flags=PSize|PMaxSize|PMinSize; + sh.min_width = sh.max_width = sh.width = dim->get(1); + sh.min_height = sh.max_height = sh.height = dim->get(0); + wmh.input = True; + wmh.flags = InputHint; + XSetWMProperties(display,window,&wtitle,&wtitle,0,0,&sh,&wmh,0); } void FormatX11::report_pointer(int y, int x, int state) { @@ -202,30 +216,16 @@ void FormatX11::report_pointer(int y, int x, int state) { return; }break; case ConfigureNotify:break; // as if we cared - case ClientMessage:{ - // tnx to vektor&walken - /* - if (e.xclient.message_type==wmProtocolsAtom - && e.xclient.format==32 - && (Atom)(e.xclient.data.l[0])==wmDeleteAtom) { - gfpost("This window is being closed, so this handler will close too!"); - rb_funcall(rself,SI(close),0); - return; - } - */ - }break; } } IEVAL(rself,"@clock.delay 20"); } \def void frame () { - XGetSubImage(display, window, - 0, 0, dim->get(1), dim->get(0), + XGetSubImage(display, window, 0, 0, dim->get(1), dim->get(0), (unsigned)-1, ZPixmap, ximage, 0, 0); GridOutlet out(this,0,dim,NumberTypeE_find(rb_ivar_get(rself,SI(@cast)))); - int sy=dim->get(0), sx=dim->get(1); - int bs=dim->prod(1); + int sy=dim->get(0), sx=dim->get(1), bs=dim->prod(1); STACK_ARRAY(uint8,b2,bs); for(int y=0; y<sy; y++) { Pt<uint8> b1 = Pt<uint8>(image,ximage->bytes_per_line*dim->get(0)) @@ -238,86 +238,129 @@ void FormatX11::report_pointer(int y, int x, int state) { /* loathe Xlib's error handlers */ static FormatX11 *current_x11; static int FormatX11_error_handler (Display *d, XErrorEvent *xee) { - gfpost("X11 reports Error: display=0x%08x",(int)d); - gfpost("serial=0x%08x error=0x%08x request=0x%08lx minor=0x%08x", + gfpost("XErrorEvent: type=0x%08x display=0x%08x xid=0x%08x", + xee->type, xee->display, xee->resourceid); + gfpost("... serial=0x%08x error=0x%08x request=0x%08lx minor=0x%08x", xee->serial, xee->error_code, xee->request_code, xee->minor_code); - current_x11->use_shm = false; - return 42; /* it seems that the return value is ignored. */ -} - -void FormatX11::dealloc_image () { - if (!ximage) return; - if (use_shm) { - #ifdef HAVE_X11_SHARED_MEMORY - shmdt(ximage->data); - XShmDetach(display,shm_info); - if (shm_info) {delete shm_info; shm_info=0;} - //ximage->data = new char[1]; // bogus - //ximage->data = 0; - //XDestroyImage(ximage); - XFree(ximage); - ximage = 0; - image = Pt<uint8>(); - #endif - } else { - //XDestroyImage(ximage); - XFree(ximage); - ximage = 0; - image = Pt<uint8>(); + if (current_x11->transfer==1) { + gfpost("(note: turning shm off)"); + current_x11->transfer = 0; } + return 42; /* it seems that the return value is ignored. */ } bool FormatX11::alloc_image (int sx, int sy) { - dim = new Dim(sy, sx, 3); + dim = new Dim(sy,sx,3); dealloc_image(); if (sx==0 || sy==0) return false; + current_x11 = this; + switch (transfer) { + case 0: { + ximage = XCreateImage(display,visual,depth,ZPixmap,0,0,sx,sy,8,0); + int size = ximage->bytes_per_line*ximage->height; + if (!ximage) RAISE("can't create image"); + image = ARRAY_NEW(uint8,size); + ximage->data = (int8 *)image; + } break; #ifdef HAVE_X11_SHARED_MEMORY - if (use_shm) { + case 1: { shm_info = new XShmSegmentInfo; ximage = XShmCreateImage(display,visual,depth,ZPixmap,0,shm_info,sx,sy); - if (!ximage) { - gfpost("shm got disabled (1), retrying..."); - return alloc_image(sx,sy);} - shm_info->shmid = shmget(IPC_PRIVATE, - ximage->bytes_per_line*ximage->height, IPC_CREAT|0777); - if(shm_info->shmid < 0) - RAISE("ERROR: shmget failed: %s",strerror(errno)); - ximage->data = shm_info->shmaddr = - (char *)shmat(shm_info->shmid,0,0); - image = Pt<uint8>((uint8 *)ximage->data, - ximage->bytes_per_line*sy); + if (!ximage) {gfpost("shm got disabled, retrying..."); transfer=0;} + XSync(display,0); + if (transfer==0) return alloc_image(sx,sy); + int size = ximage->bytes_per_line*ximage->height; + gfpost("size = %d",size); + shm_info->shmid = shmget(IPC_PRIVATE,size,IPC_CREAT|0777); + if(shm_info->shmid < 0) RAISE("shmget() failed: %s",strerror(errno)); + ximage->data = shm_info->shmaddr = (char *)shmat(shm_info->shmid,0,0); + if ((long)(shm_info->shmaddr) == -1) RAISE("shmat() failed: %s",strerror(errno)); + gfpost("shmaddr=%p",shm_info->shmaddr); + image = Pt<uint8>((uint8 *)ximage->data,size); shm_info->readOnly = False; - current_x11 = this; - //XSetErrorHandler(FormatX11_error_handler); if (!XShmAttach(display, shm_info)) RAISE("ERROR: XShmAttach: big problem"); XSync(display,0); // make sure the server picks it up - //XSetErrorHandler(0); - /* yes, this can be done now. should cause auto-cleanup. */ + // yes, this can be done now. should cause auto-cleanup. shmctl(shm_info->shmid,IPC_RMID,0); - if (!use_shm) { - gfpost("shm got disabled (2), retrying..."); - return alloc_image(sx,sy);} - } else + if (transfer==0) return alloc_image(sx,sy); + } break; +#endif +#ifdef HAVE_X11_XVIDEO + case 2: { + unsigned int ver, rel, req, ev, err, i, j, adaptors, formats; + XvAdaptorInfo *ai; + if (Success != XvQueryExtension(display,&ver,&rel,&req,&ev,&err)) RAISE("XvQueryExtension problem"); + /* find + lock port */ + if (Success != XvQueryAdaptors(display,DefaultRootWindow(display),&adaptors,&ai)) RAISE("XvQueryAdaptors problem"); + for (i = 0; i < adaptors; i++) { + if (ai[i].type&XvInputMask && ai[i].type&XvImageMask) { + for (j=0; j<ai[i].num_ports; j++) { + if (Success != XvGrabPort(display,ai[i].base_id+j,CurrentTime)) RAISE("XvGrabPort problem"); + xv_port = ai[i].base_id + j; + goto breakout; + } + } + } + breakout: + XFree(ai); + if (!xv_port) RAISE("no xv_port"); +/* unsigned int encn; + XvEncodingInfo *enc; + XvQueryEncodings(display,xv_port,&encn,&enc); + for (i=0; i<encn; i++) gfpost("XvEncodingInfo: name='%s' encoding_id=0x%08x",enc[i].name,enc[i].encoding_id);*/ + gfpost("pdp_xvideo: grabbed port %d on adaptor %d",xv_port,i); + size_t size = sx*sy*4; + data = new uint8[size]; + for (i=0; i<size; i++) data[i]=0; + xvi = XvCreateImage(display,xv_port,0x51525762,(char *)data,sx,sy); + last_encoding=-1; + if (!xvi) RAISE("XvCreateImage problem"); + } break; #endif - ximage = XCreateImage(display,visual,depth,ZPixmap,0,0,sx,sy,8,0); - if (!ximage) RAISE("can't create image"); - image = ARRAY_NEW(uint8,ximage->bytes_per_line*sy); - ximage->data = (int8 *)image; + default: RAISE("transfer mode '%s' not available", xfers[transfer]); + } int status = XInitImage(ximage); if (status!=1) gfpost("XInitImage returned: %d", status); return true; +retry: + gfpost("shm got disabled, retrying..."); + return alloc_image(sx,sy); +} + +void FormatX11::dealloc_image () { + if (!ximage) return; + switch (transfer) { + case 0: XFree(ximage); ximage=0; image=Pt<uint8>(); break; +#ifdef HAVE_X11_SHARED_MEMORY + case 1: + shmdt(ximage->data); + XShmDetach(display,shm_info); + if (shm_info) {delete shm_info; shm_info=0;} + XFree(ximage); + ximage = 0; + image = Pt<uint8>(); + break; +#endif +#ifdef HAVE_X11_XVIDEO + case 2: { + if (data) delete[] data; + if (xvi) XFree(xvi); + xvi=0; + data=0; + } + break; +#endif + default: RAISE("transfer mode '%s' not available",xfers[transfer]); + } } void FormatX11::resize_window (int sx, int sy) { if (sy<16) sy=16; if (sy>4096) RAISE("height too big"); if (sx<16) sx=16; if (sx>4096) RAISE("width too big"); alloc_image(sx,sy); - if (name) delete name; - name = new char[64]; - sprintf(name,"GridFlow (%d,%d,3)",sy,sx); if (window) { if (is_owner && !lock_size) { - set_wm_hints(sx,sy); + set_wm_hints(); XResizeWindow(display,window,sx,sy); } } else { @@ -325,23 +368,13 @@ void FormatX11::resize_window (int sx, int sy) { xswa.do_not_propagate_mask = 0; //? xswa.override_redirect = override_redirect; //#!@#$ window = XCreateWindow(display, - parent, pos_x, pos_y, sx, sy, 0, + parent, pos[1], pos[0], sx, sy, 0, CopyFromParent, InputOutput, CopyFromParent, CWOverrideRedirect|CWDontPropagate, &xswa); if(!window) RAISE("can't create window"); - set_wm_hints(sx,sy); - if (is_owner) { - // fall_thru 0 - XSelectInput(display, window, - ExposureMask | StructureNotifyMask | PointerMotionMask | - ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | - KeyPressMask | KeyReleaseMask); - XMapRaised(display, window); - } else { - // fall_thru 1 - XSelectInput(display, window, - ExposureMask | StructureNotifyMask); - } + set_wm_hints(); + _0_fall_thru(0,0,is_owner); + if (is_owner) XMapRaised(display, window); imagegc = XCreateGC(display, window, 0, NULL); if (visual->c_class == PseudoColor) prepare_colormap(); } @@ -380,9 +413,8 @@ GRID_INLET(FormatX11,0) { bit_packing->pack(sx, data, image+y*bypl); } } - if (autodraw==2) show_section(0,oy,sx,y-oy); } GRID_FINISH { - if (autodraw==1) show_section(0,0,in->dim->get(1),in->dim->get(0)); + show_section(0,0,in->dim->get(1),in->dim->get(0)); } GRID_END \def void close () { @@ -398,13 +430,6 @@ GRID_INLET(FormatX11,0) { } \def void _0_out_size (int sy, int sx) { resize_window(sx,sy); } -\def void _0_draw () { show_section(0,0,dim->get(1),dim->get(0)); } - -\def void _0_autodraw (int autodraw) { - if (autodraw<0 || autodraw>2) - RAISE("autodraw=%d is out of range",autodraw); - this->autodraw = autodraw; -} \def void _0_setcursor (int shape) { shape = 2*(shape&63); @@ -448,42 +473,32 @@ void FormatX11::prepare_colormap() { } void FormatX11::open_display(const char *disp_string) { - int screen_num; - Screen *screen; - - // Open an X11 connection display = XOpenDisplay(disp_string); if(!display) RAISE("ERROR: opening X11 display: %s",strerror(errno)); - // btw don't expect too much from Xlib error handling. // Xlib, you are so free of the ravages of intelligence... XSetErrorHandler(FormatX11_error_handler); - - screen = DefaultScreenOfDisplay(display); - screen_num = DefaultScreen(display); + Screen *screen = DefaultScreenOfDisplay(display); + int screen_num = DefaultScreen(display); visual = DefaultVisual(display, screen_num); - white = XWhitePixel(display,screen_num); - black = XBlackPixel(display,screen_num); root_window = DefaultRootWindow(display); depth = DefaultDepthOfScreen(screen); colormap = 0; switch(visual->c_class) { - case TrueColor: case DirectColor: /* without colormap */ - break; - case PseudoColor: /* with colormap */ - if (depth!=8) - RAISE("ERROR: with colormap, only supported depth is 8 (got %d)", - depth); - break; - default: RAISE("ERROR: visual type not supported (got %d)", - visual->c_class); + // without colormap + case TrueColor: case DirectColor: break; + // with colormap + case PseudoColor: if (depth!=8) RAISE("ERROR: with colormap, only supported depth is 8 (got %d)", depth); break; + default: RAISE("ERROR: visual type not supported (got %d)", visual->c_class); } -#ifdef HAVE_X11_SHARED_MEMORY - use_shm = !! XShmQueryExtension(display); +#if defined(HAVE_X11_XVIDEO) + transfer = 2; +#elif defined(HAVE_X11_SHARED_MEMORY) + transfer = !! XShmQueryExtension(display); #else - use_shm = false; + transfer = 0; #endif } @@ -514,55 +529,56 @@ Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, i } \def void _0_set_geometry (int y, int x, int sy, int sx) { - pos_x = x; - pos_y = y; + pos[0]=y; pos[1]=x; XMoveWindow(display,window,x,y); resize_window(sx,sy); XFlush(display); } \def void _0_fall_thru (int flag) { - if (flag) { - gfpost("falling through!"); - XSelectInput(display, window, - ExposureMask | StructureNotifyMask); - } else { - gfpost("NOT falling through!"); - XSelectInput(display, window, - ExposureMask | StructureNotifyMask | - PointerMotionMask | - ButtonPressMask | ButtonReleaseMask | ButtonMotionMask); - } + int mask = ExposureMask | StructureNotifyMask; + if (flag) mask |= ExposureMask|StructureNotifyMask|PointerMotionMask| + ButtonPressMask|ButtonReleaseMask|ButtonMotionMask| + KeyPressMask|KeyReleaseMask; + XSelectInput(display, window, mask); XFlush(display); } +\def void _0_transfer (Symbol s) { + if (s==SYM(plain)) transfer=0; + else if (s==SYM(xshm)) transfer=1; + else if (s==SYM(xvideo)) transfer=2; + else RAISE("unknown transfer mode (possible: plain xshm xvideo)"); +} + +\def void _0_title (String s=Qnil) { + rb_ivar_set(rself,SI(@title),s); + set_wm_hints(); +} + \def void initialize (...) { int sy=240, sx=320; // defaults rb_call_super(argc,argv); + rb_ivar_set(rself,SI(@title),Qnil); argv++, argc--; VALUE domain = argc<1 ? SYM(here) : argv[0]; int i; + char host[256]; if (domain==SYM(here)) { open_display(0); i=1; } else if (domain==SYM(local)) { if (argc<2) RAISE("open x11 local: not enough args"); - char host[256]; - int dispnum = NUM2INT(argv[1]); - sprintf(host,":%d",dispnum); + sprintf(host,":%ld",NUM2LONG(argv[1])); open_display(host); i=2; } else if (domain==SYM(remote)) { if (argc<3) RAISE("open x11 remote: not enough args"); - char host[256]; - strcpy(host,rb_sym_name(argv[1])); - int dispnum = NUM2INT(argv[2]); - sprintf(host+strlen(host),":%d",dispnum); + sprintf(host,"%s:%ld",rb_sym_name(argv[1]),NUM2LONG(argv[2])); open_display(host); i=3; } else if (domain==SYM(display)) { if (argc<2) RAISE("open x11 display: not enough args"); - char host[256]; strcpy(host,rb_sym_name(argv[1])); for (int k=0; host[k]; k++) if (host[k]=='%') host[k]==':'; gfpost("mode `display', DISPLAY=`%s'",host); @@ -574,16 +590,12 @@ Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, i for(;i<argc;i++) { Ruby a=argv[i]; - if (a==SYM(override_redirect)) { - override_redirect = true; - } else if (a==SYM(use_stripes)){ - use_stripes = true; - } else { - break; - } + if (a==SYM(override_redirect)) override_redirect = true; + else if (a==SYM(use_stripes)) use_stripes = true; + else RAISE("argument '%s' not recognized",rb_sym_name(argv[i])); } - pos_x=pos_y=0; + pos[1]=pos[0]=0; parent = root_window; if (i>=argc) { } else { @@ -594,7 +606,7 @@ Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, i } else if (winspec==SYM(embed)) { Ruby title_s = rb_funcall(argv[i+1],SI(to_s),0); char *title = strdup(rb_str_ptr(title_s)); - sy = sx = pos_y = pos_x = 0; + sy = sx = pos[0] = pos[1] = 0; parent = search_window_tree(root_window,XInternAtom(display,"WM_NAME",0),title); free(title); if (parent == 0xDeadBeef) RAISE("Window not found."); @@ -617,7 +629,7 @@ Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, i window = INT(winspec); } is_owner = false; - sy = sx = pos_y = pos_x = 0; + sy = sx = pos[0] = pos[1] = 0; } } @@ -625,8 +637,7 @@ Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, i resize_window(sx,sy); if (is_owner) { - wmProtocolsAtom = XInternAtom(display, "WM_PROTOCOLS", False); - wmDeleteAtom = XInternAtom(display, "WM_DELETE_WINDOW", False); + Atom wmDeleteAtom = XInternAtom(display, "WM_DELETE_WINDOW", False); XSetWMProtocols(display,window,&wmDeleteAtom,1); } @@ -642,14 +653,17 @@ Window FormatX11::search_window_tree (Window xid, Atom key, const char *value, i uint32 masks[3] = { 0x07, 0x38, 0xC0 }; bit_packing = new BitPacking(disp_is_le, bpp/8, 3, masks); } break; + default: { RAISE("huh?"); } } IEVAL(rself,"@clock = Clock.new self; @clock.delay 0"); + show_section(0,0,sx,sy); } \classinfo { - IEVAL(rself,"install '#io:x11',1,1;@mode=6;@comment='X Window System Version 11.5'"); + IEVAL(rself,"install '#io:x11',1,1;@mode=6;@comment='X Window System Version 11.x'"); } \end class FormatX11 void startup_x11 () { \startall } + diff --git a/externals/gridflow/optional/lti.rb b/externals/gridflow/optional/lti.rb new file mode 100644 index 00000000..f46c4141 --- /dev/null +++ b/externals/gridflow/optional/lti.rb @@ -0,0 +1,5 @@ +include GridFlow + +FObject.subclass("lti",1,1) { + # huh +} diff --git a/externals/gridflow/optional/rblti/LICENSE b/externals/gridflow/optional/rblti/LICENSE new file mode 100644 index 00000000..34bac119 --- /dev/null +++ b/externals/gridflow/optional/rblti/LICENSE @@ -0,0 +1,462 @@ +The GNU Lesser General Public License (LGPL)
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to
+copy and distribute verbatim copies of this license document, but
+changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+as the successor of the GNU Library Public License, version 2, hence
+the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom
+to share and change it. By contrast, the GNU General Public Licenses
+are intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there
+is no warranty for the free library. Also, if the library is modified
+by someone else and passed on, the recipients should know that what
+they have is not the original version, so that the original author's
+reputation will not be affected by problems that might be introduced
+by others.
+
+Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a
+shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard. To achieve this, non-free programs must
+be allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other
+ program which contains a notice placed by the copyright holder or
+ other authorized party saying it may be distributed under the terms
+ of this Lesser General Public License (also called "this
+ License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does and
+what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's
+ complete source code as you receive it, in any medium, provided
+ that you conspicuously and appropriately publish on each copy an
+ appropriate copyright notice and disclaimer of warranty; keep
+ intact all the notices that refer to this License and to the
+ absence of any warranty; and distribute a copy of this License
+ along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a
+fee.
+
+2. You may modify your copy or copies of the Library or any portion of
+ it, thus forming a work based on the Library, and copy and
+ distribute such modifications or work under the terms of Section 1
+ above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+ c) You must cause the whole of the work to be licensed at no charge
+ to all third parties under the terms of this License.
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a
+purpose that is entirely well-defined independent of the
+application. Therefore, Subsection 2d requires that any
+application-supplied function or table used by this function must be
+optional: if the application does not supply it, the square root
+function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public
+ License instead of this License to a given copy of the Library. To
+ do this, you must alter all the notices that refer to this License,
+ so that they refer to the ordinary GNU General Public License,
+ version 2, instead of to this License. (If a newer version than
+ version 2 of the ordinary GNU General Public License has appeared,
+ then you can specify that version instead if you wish.) Do not make
+ any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that
+copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the
+Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative
+ of it, under Section 2) in object code or executable form under the
+ terms of Sections 1 and 2 above provided that you accompany it with
+ the complete corresponding machine-readable source code, which must
+ be distributed under the terms of Sections 1 and 2 above on a
+ medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from
+a designated place, then offering equivalent access to copy the source
+code from the same place satisfies the requirement to distribute the
+source code, even though third parties are not compelled to copy the
+source along with the object code.
+
+5. A program that contains no derivative of any portion of the
+ Library, but is designed to work with the Library by being compiled
+ or linked with it, is called a "work that uses the Library". Such a
+ work, in isolation, is not a derivative work of the Library, and
+ therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License. Section
+6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is
+not. Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure
+layouts and accessors, and small macros and small inline functions
+(ten lines or less in length), then the use of the object file is
+unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section
+6. Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link
+ a "work that uses the Library" with the Library to produce a work
+ containing portions of the Library, and distribute that work under
+ terms of your choice, provided that the terms permit modification
+ of the work for the customer's own use and reverse engineering for
+ debugging such modifications.
+
+You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+a) Accompany the work with the complete corresponding machine-readable
+ source code for the Library including whatever changes were used in
+ the work (which must be distributed under Sections 1 and 2 above);
+ and, if the work is an executable linked with the Library, with the
+ complete machine-readable "work that uses the Library", as object
+ code and/or source code, so that the user can modify the Library
+ and then relink to produce a modified executable containing the
+ modified Library. (It is understood that the user who changes the
+ contents of definitions files in the Library will not necessarily
+ be able to recompile the application to use the modified
+ definitions.)
+
+b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+c) Accompany the work with a written offer, valid for at least three
+ years, to give the same user the materials specified in Subsection
+ 6a, above, for a charge no more than the cost of performing this
+ distribution.
+
+d) If distribution of the work is made by offering access to copy from
+ a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+e) Verify that the user has already received a copy of these materials
+ or that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+7. You may place library facilities that are a work based on the
+ Library side-by-side in a single library together with other
+ library facilities not covered by this License, and distribute such
+ a combined library, provided that the separate distribution of the
+ work based on the Library and of the other library facilities is
+ otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities. This
+ must be distributed under the terms of the Sections above.
+
+b) Give prominent notice with the combined library of the fact that
+ part of it is a work based on the Library, and explaining where to
+ find the accompanying uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the
+ Library except as expressly provided under this License. Any
+ attempt otherwise to copy, modify, sublicense, link with, or
+ distribute the Library is void, and will automatically terminate
+ your rights under this License. However, parties who have received
+ copies, or rights, from you under this License will not have their
+ licenses terminated so long as such parties remain in full
+ compliance.
+
+9. You are not required to accept this License, since you have not
+ signed it. However, nothing else grants you permission to modify or
+ distribute the Library or its derivative works. These actions are
+ prohibited by law if you do not accept this License. Therefore, by
+ modifying or distributing the Library (or any work based on the
+ Library), you indicate your acceptance of this License to do so,
+ and all its terms and conditions for copying, distributing or
+ modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the
+ Library), the recipient automatically receives a license from the
+ original licensor to copy, distribute, link with or modify the
+ Library subject to these terms and conditions. You may not impose
+ any further restrictions on the recipients' exercise of the rights
+ granted herein. You are not responsible for enforcing compliance
+ by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent
+ infringement or for any other reason (not limited to patent
+ issues), conditions are imposed on you (whether by court order,
+ agreement or otherwise) that contradict the conditions of this
+ License, they do not excuse you from the conditions of this
+ License. If you cannot distribute so as to satisfy simultaneously
+ your obligations under this License and any other pertinent
+ obligations, then as a consequence you may not distribute the
+ Library at all. For example, if a patent license would not permit
+ royalty-free redistribution of the Library by all those who
+ receive copies directly or indirectly through you, then the only
+ way you could satisfy both it and this License would be to refrain
+ entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in
+ certain countries either by patents or by copyrighted interfaces,
+ the original copyright holder who places the Library under this
+ License may add an explicit geographical distribution limitation
+ excluding those countries, so that distribution is permitted only
+ in or among countries not thus excluded. In such case, this
+ License incorporates the limitation as if written in the body of
+ this License.
+
+13. The Free Software Foundation may publish revised and/or new
+ versions of the Lesser General Public License from time to
+ time. Such new versions will be similar in spirit to the present
+ version, but may differ in detail to address new problems or
+ concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free
+ programs whose distribution conditions are incompatible with
+ these, write to the author to ask for permission. For software
+ which is copyrighted by the Free Software Foundation, write to the
+ Free Software Foundation; we sometimes make exceptions for
+ this. Our decision will be guided by the two goals of preserving
+ the free status of all derivatives of our free software and of
+ promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+ WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
+ LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
+ AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+ PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE
+ DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR
+ OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
+ MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
+ LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
+ INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+ INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
+ OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY
+ OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+
+
diff --git a/externals/gridflow/optional/rblti/Makefile b/externals/gridflow/optional/rblti/Makefile new file mode 100644 index 00000000..d50b1aa7 --- /dev/null +++ b/externals/gridflow/optional/rblti/Makefile @@ -0,0 +1,47 @@ +LTIPREFIX = /usr/local +#LTIPREFIX = /home/matju +LIBS = $(LTIPREFIX)/lib/ltilib/libltir.a -lpng -ljpeg +INCS = -I$(LTIPREFIX)/include/ltilib -I/usr/share/swig1.3/std +PINC = -I/usr/include/python +RINC = -I`ruby -rrbconfig -e'h=Config::CONFIG;puts h["rubylibdir"]+"/"+h["arch"]'` + +default:: python + +python:: _pylti.so + python -c 'import pylti' + python testpylti.py fan.jpg + +_pylti.so: pylti_wrap.o Makefile + g++ -shared -o _pylti.so pylti_wrap.o $(LIBS) + +pylti_wrap.o: pylti_wrap.cxx + g++ $(PINC) -Ipatched $(INCS) -c pylti_wrap.cxx + +pylti_wrap.cxx: ./swig/pylti.i + swig -v -c++ -python -DHAVE_LIBJPEG -DHAVE_LIBPNG -I./generated -I./patched \ + $(INCS) -w509,-312,-362,-389 -o ./pylti_wrap.cxx ./swig/pylti.i + #swig -c++ -python -DHAVE_LIBJPEG -DHAVE_LIBPNG -I./generated_python -I./patched \ + # $(INCS) -w509,-312,-362,-389 pylti.i + +ruby:: rblti.so + ruby -e 'require "rblti"' + +rblti.so: rblti_wrap.o Makefile + g++ -shared -o rblti.so rblti_wrap.o $(LIBS) + +rblti_wrap.o: rblti_wrap.cxx + g++ $(RINC) -Ipatched $(INCS) -c rblti_wrap.cxx + +rblti_wrap.s: rblti_wrap.cxx + g++ $(RINC) -Ipatched $(INCS) -S rblti_wrap.cxx + +rblti_wrap.cxx: rblti.i + swig -c++ -ruby -DHAVE_LIBJPEG -DHAVE_LIBPNG -I./generated -I./patched \ + -fcompact -fvirtual $(INCS) -w509,-312,-362,-389,-801,-314 rblti.i + +clean:: + rm -f \ + pylti.so pylti_wrap.o pylti_wrap.cxx \ + rblti.so rblti_wrap.o rblti_wrap.cxx + + diff --git a/externals/gridflow/optional/rblti/gen_ltilib_classes.py b/externals/gridflow/optional/rblti/gen_ltilib_classes.py new file mode 100644 index 00000000..09c2aee9 --- /dev/null +++ b/externals/gridflow/optional/rblti/gen_ltilib_classes.py @@ -0,0 +1,354 @@ +#!/usr/bin/env python
+#******************************************************************************
+# rblti, Copyright 2005 by Mathieu Bouchard and Heri Andria
+# pylti, Copyright 2005 by Michael Neuroth
+# a wrapper for ltilib using SWIG
+#******************************************************************************
+#
+# Tool to generate header files for SWIG to process the nested classes "parameters"
+#
+# 1) generate XML files for the ltilib with doxygen (tested with version 1.4.3) (use this switch in doc.cfg file: GENERATE_XML = YES)
+# 2) generate the new header files for SWIG with this python script
+
+from xml.dom import minidom
+import os
+import sys
+from distutils.text_file import TextFile
+str_version = '0.32'
+
+basedir=None
+# handle the settings: WORKAREA has to be defined !
+if len(sys.argv)>1:
+ basedir = sys.argv[1]
+else:
+ workarea = os.getenv('WORKAREA')
+ # is pylti not part of the ltilib ? Yes --> than we need a directory structure of WORKAREA_PATH/import/ltilib/xml
+ if workarea<>None:
+ basedir = workarea+os.sep+'import'+os.sep+'ltilib'+os.sep+'xml'+os.sep
+ # check if we are in misc directory of the ltilib distribution (ltilib/misc/pylti)
+ # very simple way: navigate up and navigate down again
+ else:
+ strCheckPath = '..'+os.sep+'..'+os.sep+'misc'+os.sep+'pylti'+'-'+str_version
+ try:
+ # try to read lti.i, this is a good indication of a pylti directory
+ aTestFile = TextFile(filename=strCheckPath+os.sep+'lti.i')
+ basedir = '..'+os.sep+'..'+os.sep+'xml'+os.sep # move up ltipy and misc directory
+ except IOError: pass
+
+output_dir = 'generated'
+#output_dir = 'generated_ruby'
+
+def f(x): return 'classlti_1_1'+x+'.xml'
+#def g(x): return 'lti::_'+x+'::_'+x+'_parameters'
+def g(x): return 'lti::_'+x+'::'+x+'_parameters'
+
+# list of tuples with ( xml-file-name, full-qualified-name of the base class )
+lst = [ (f('functor_1_1parameters'), 'lti::ioObject')
+ , (f('ioFunctor_1_1parameters'), g('functor'))
+ , (f('ioImage_1_1parameters'), g('ioFunctor'))
+ , (f('usePalette_1_1parameters'), g('functor'))
+ , (f('segmentation_1_1parameters'), g('functor'))
+ , (f('regionGrowing_1_1parameters'), g('segmentation'))
+ , (f('meanShiftSegmentation_1_1parameters'), g('segmentation'))
+ , (f('kMeansSegmentation_1_1parameters'), g('segmentation'))
+ , (f('whiteningSegmentation_1_1parameters'), g('segmentation'))
+ , (f('csPresegmentation_1_1parameters'), g('segmentation'))
+ , (f('colorQuantization_1_1parameters'), g('functor'))
+ , (f('kMColorQuantization_1_1parameters'), g('colorQuantization'))
+ , (f('viewerBase_1_1parameters'), g('functor'))
+ , (f('externViewer_1_1parameters'), g('viewerBase'))
+ , (f('objectsFromMask_1_1parameters'), g('segmentation'))
+ , (f('objectsFromMask_1_1objectStruct'), 'lti::ioObject')
+ , (f('tree_1_1node'), 'lti::ioObject')
+ , (f('featureExtractor_1_1parameters'), g('functor'))
+ , (f('globalFeatureExtractor_1_1parameters'),g('featureExtractor'))
+ , (f('localFeatureExtractor_1_1parameters'), g('featureExtractor'))
+ , (f('geometricFeatures_1_1parameters'), g('globalFeatureExtractor'))
+ , (f('localMoments_1_1parameters'), g('localFeatureExtractor'))
+ , (f('chromaticityHistogram_1_1parameters'), g('globalFeatureExtractor'))
+ , (f('modifier_1_1parameters'), g('functor'))
+ , (f('polygonApproximation_1_1parameters'), g('modifier'))
+ , (f('transform_1_1parameters'), g('functor'))
+ , (f('gradientFunctor_1_1parameters'), g('transform'))
+ , (f('skeleton_1_1parameters'), g('transform'))
+ , (f('colorContrastGradient_1_1parameters'), g('gradientFunctor'))
+ , (f('edgeDetector_1_1parameters'), g('modifier'))
+ , (f('classicEdgeDetector_1_1parameters'), g('edgeDetector'))
+ , (f('cannyEdges_1_1parameters'), g('edgeDetector'))
+ , (f('filter_1_1parameters'), g('modifier'))
+ , (f('convolution_1_1parameters'), g('filter'))
+ , (f('morphology_1_1parameters'), g('modifier'))
+ , (f('dilation_1_1parameters'), g('morphology'))
+ , (f('erosion_1_1parameters'), g('morphology'))
+ , (f('distanceTransform_1_1parameters'), g('morphology'))
+ , (f('classifier_1_1parameters'), 'lti::ioObject')
+ , (f('classifier_1_1outputTemplate'), 'lti::ioObject')
+ , (f('classifier_1_1outputVector'), 'lti::ioObject')
+ , (f('decisionTree_1_1parameters'), g('classifier'))
+ , (f('ioBMP_1_1parameters'), g('ioFunctor'))
+ , (f('ioPNG_1_1parameters'), g('ioFunctor'))
+ , (f('ioJPEG_1_1parameters'), g('ioFunctor'))
+ , (f('distanceTransform_1_1sedMask'), None)
+ ]
+
+# some constants
+nl = '\n'
+
+# Doku:
+#-------
+# 'memberdef' ==> 'kind'=function
+# --> 'name'
+# --> 'type' # Return Type
+# --> 'param' # Argumente
+# --> 'type'
+
+def WriteFile(name,txt):
+ f = open(name,'w')
+ f.write(txt)
+
+def GetAttribute(attribs,key):
+ for k,v in attribs:
+ if k==key:
+ return v
+
+def GetValue(elem):
+ #print elem,elem.firstChild,elem.nodeType
+ if elem.nodeType == elem.TEXT_NODE:
+ return elem.data
+ elif elem.nodeType == elem.ELEMENT_NODE:
+ if elem.firstChild <> None:
+ s = ''
+ for e in elem.childNodes:
+ s += GetValue(e) #+' '
+ return s
+ return ''
+ elif elem.nodeType == elem.ATTRIBUTE_NODE:
+ return 'xxxx'
+ elif elem.firstChild.nodeType == elem.TEXT_NODE:
+ return elem.firstChild.data
+ return '???'
+
+def GetValueForItem(node,itemname,bOnlyFirst=False):
+ s = ''
+ nodes = node.getElementsByTagName(itemname)
+ #print '>>>>>>>',nodes,itemname,len(nodes)
+ if bOnlyFirst:
+ s += GetValue( nodes[0] )
+ else:
+ for node in nodes:
+ s += GetValue( node )
+ s += ' '
+ return s
+
+def ProcessFunction(member,classname,newclassname,bIsConst=False,bIsPureVirtual=False,bIsHeader=True):
+ s = ''
+ arg = 'arg'
+ names = member.getElementsByTagName('name')
+ # es sollte immer nur einen Namen geben !
+ nameNode = names[0]
+ name = GetValue(nameNode)
+
+ s += GetValueForItem(member,'type',bOnlyFirst=True)
+ s += ' '
+ if not bIsHeader:
+ s += classname+'::'
+ s += GetValueForItem(member,'name')
+ s += '( '
+
+ # Behandlung des Constructors
+ bIsConstructor = (name == classname)
+
+ params = member.getElementsByTagName('param')
+ for i in range(len(params)):
+ if i>0:
+ s += ', '
+ s += GetValueForItem(params[i],'type')
+ s += ' '+arg+str(i)
+
+ s += ' )'
+ if bIsConst:
+ s += ' const'
+ if bIsPureVirtual:
+ s += ' = 0'
+
+ if not bIsHeader:
+ s += nl
+ s += '{'+nl
+ s += ' '+'pObj->'+name+'('
+ for i in range(len(params)):
+ if i>0:
+ s += ', '
+ s += arg+str(i)
+ s += ');'+nl
+ s += '}'
+
+ s += ';'+nl
+
+ # dies ist fuer das manuelle name mangling notwendig !
+ s = s.replace(classname,newclassname)
+
+ return s
+
+def VerifyParameterType(sType):
+ """
+ Sonderbehandlung fuer den Typ, falls es ein parameters Typ ist,
+ notwendig, da der parameters Typ mit einem define umbenannt wird...
+
+ Beispiel: gradientFunctor::parameters --> gradientFunctor_parameters
+ """
+ s = sType
+ elem = sType.split('::')
+ if len(elem)>1 and elem[-1]=='parameters':
+ s = 'lti_'+sType.replace('::','_')
+ print "FOUND:",s
+ return s
+
+def ProcessAttribute(member):
+ s = ''
+ sType = GetValueForItem(member,'type',bOnlyFirst=True)
+ sType = VerifyParameterType(sType)
+ s += sType
+ s += ' '
+ s += GetValueForItem(member,'name')
+ s += GetValueForItem(member,'argsstring')
+ s += ';'
+ return s
+
+def ProcessEnum(member):
+ s = ''
+ s += 'enum '
+ name = GetValueForItem(member,'name',bOnlyFirst=True)
+ # Behandlung der unbenannten enums
+ if name[0]=='@':
+ name = ''
+ s += name
+ s += ' {'+nl
+ items = member.getElementsByTagName('enumvalue')
+ for i in range(len(items)):
+ e = items[i]
+ if i>0:
+ s += ','
+ s += GetValueForItem(e,'name')
+ val = GetValueForItem(e,'initializer')
+ if val<>None and len(val)>0:
+ s += ' = ' + val
+ s += nl
+ s += '};'+nl
+ return s
+
+def ProcessMember(member,classname,newclassname,bIsHeader):
+ s = ''
+ attribs = member.attributes.items()
+ if GetAttribute(attribs,'prot')=='public':
+ if GetAttribute(attribs,'kind')=='function':
+ s = ProcessFunction(member, classname, newclassname, GetAttribute(attribs,'const')=='yes', GetAttribute(attribs,'virt')=='pure-virtual', bIsHeader ) #, GetAttribute(attribs,'virtual')=='virtual'
+ elif GetAttribute(attribs,'kind')=='variable':
+ s = ProcessAttribute(member)
+ elif GetAttribute(attribs,'kind')=='enum':
+ s = ProcessEnum(member)
+ else:
+ s = '/* not a function or attribute */'
+ return s+'\n'
+
+def ProcessAllMembers(theclassname,thenewclassname,members,bIsHeader=True,indent=' '*4):
+ s = ''
+ for member in members:
+ s += indent+ProcessMember(member,theclassname,thenewclassname,bIsHeader)
+ return s
+
+def ProcessHeaderFile(classname,theclassname,thenewclassname,members,baseclassname=None):
+ s = ''
+ s += '#ifndef _'+thenewclassname+'_h'+nl
+ s += '#define _'+thenewclassname+'_h'+nl
+ s += nl
+ sClose = ''
+ names = classname.split('::')
+ sTypedef = 'typedef '
+ for n in range(len(names)):
+ if n<len(names)-1:
+ s += 'namespace '
+ sPre = ''
+ if n>0:
+ sPre += '_'
+ s += sPre+names[n]+' {'+nl
+ if n<len(names)-2:
+ sClose += '}'+nl
+ sTypedef += sPre+names[n]+'::'
+ s += 'class '+thenewclassname
+ if baseclassname<>None:
+ s += ' : public '+baseclassname
+ s += nl
+ s += '{'+nl
+ s += 'public:'+nl
+ s += ProcessAllMembers(theclassname,thenewclassname,members)
+ #s += 'private:'+nl
+ #s += ' /*pObj*/'+nl
+ s += '};'+nl
+ s += sClose
+# s += sTypedef+thenewclassname+' '+thenewclassname[1:]+';'+nl # erstes _ vom Klassennamen entfernen
+ s += sTypedef+thenewclassname+' '+thenewclassname+';'+nl
+ s += '}'
+ s += nl
+ s += '#endif'+nl
+ return s
+
+def ProcessCppFile(classname,theclassname,thenewclassname,members):
+ s = ''
+ s += nl
+ s += '#include "'+thenewclassname+'.h"'+nl
+ s += nl
+ s += ProcessAllMembers(theclassname,thenewclassname,members,bIsHeader=False,indent='')
+ s += nl
+ return s
+
+def ProcessClass(classname,theclassname,thenewclassname,members,baseclassname=None):
+ s = ''
+ s += ProcessHeaderFile(classname,theclassname,thenewclassname,members,baseclassname)
+ s += nl
+ #s += ProcessCppFile(classname,theclassname,thenewclassname,members)
+ return s
+
+def ProcessFile(filename,baseclassname,add_to_output=None):
+ dom = minidom.parse(filename)
+
+ #elem = dom.getElementsByTagName('compoundname')
+ members = dom.getElementsByTagName('memberdef')
+
+ classitem = dom.getElementsByTagName('compoundname')
+ classname = GetValue(classitem[0]) # lti::object
+ print "processing",classname,"...",
+
+ nameitems = classname.split('::')
+
+ theclassname = nameitems[-1] # object
+ s = ''
+ for i in range(len(nameitems)):
+ # ignoriere das erste lti::
+ if i>0:
+# s += '_'
+ if i>1: s += '_' #to prevent class names starting with '_', Ruby hates that
+ s += nameitems[i]
+
+ thenewclassname = s #classname.replace('::','_') # lti_object
+ print thenewclassname
+
+# outputfilename = thenewclassname
+ outputfilename = '_'+thenewclassname
+ if add_to_output<>None:
+ outputfilename += add_to_output
+ outputfilename += '.h'
+
+ s = ProcessClass(classname,theclassname,thenewclassname,members,baseclassname)
+
+ WriteFile(output_dir+os.sep+outputfilename,s)
+
+def ProcessAllFiles(lst):
+ for e in lst:
+ filename = basedir+e[0]
+ ProcessFile(filename,e[1])
+
+#-------------------------------------------------
+
+ProcessAllFiles(lst)
+
+
diff --git a/externals/gridflow/optional/rblti/lti_manual.h b/externals/gridflow/optional/rblti/lti_manual.h new file mode 100644 index 00000000..1228f3a8 --- /dev/null +++ b/externals/gridflow/optional/rblti/lti_manual.h @@ -0,0 +1,7 @@ + +/* + Do not delete, + + here you can add manual wraped functions and classes... + +*/ diff --git a/externals/gridflow/optional/rblti/rblti.i b/externals/gridflow/optional/rblti/rblti.i new file mode 100644 index 00000000..0cb9686f --- /dev/null +++ b/externals/gridflow/optional/rblti/rblti.i @@ -0,0 +1,775 @@ +//****************************************************************************** +// rblti, Copyright 2005 by Mathieu Bouchard and Heri Andria +// pylti, Copyright 2005 by Michael Neuroth +// a wrapper for ltilib using SWIG + +%module rblti +%rename(inplace_add) operator +=; +%rename(inplace_sub) operator -=; +%rename(inplace_mul) operator *=; +%rename(inplace_div) operator /=; +%rename(not_equal) operator !=; +%include "std_list_ruby.i" +%include "std_string.i" +//%include "std_list.i" +//%include "std_vector.i" +//%include "std_map.i" + +using namespace std; + +// sollte nach dem include der std_*.i Dateien stehen, ansonsten gibt swig einen Fehlercode zurueck ! +//%feature("autodoc","1") + +std::string _getStdString(std::string * pStr); +bool _setStdString(std::string * pStr, const std::string & strValue); + +// for the access to c arrays +%include "carrays.i" +%array_functions(float,floatArray) +%array_functions(double,doubleArray) +%array_functions(int,intArray) +%array_class(float,floatArr) +%array_class(double,doubleArr) +%array_class(int,intArr) + +//test: +//namespace std { +// %template(sdmap) map<string,double>; // TODO: does not work yet ... +//} +//namespace std { +// %template(vectordouble) vector<double>; +//} + +// ************************************************************************** +// ************************************************************************** +// This part is for the c++ wrapper compile phase ! +// This code will be copied into the wrapper-code (generated from swig) +%{ +#include <string> + +// TODO: to be removed, only for tests +std::string _getStdString(std::string * pStr) {return *pStr;} +bool _setStdString(std::string * pStr, const std::string & strValue) { + if(pStr) *pStr = strValue; + return !!pStr; +} +// </to-be-removed> + +#undef PACKAGE_NAME +#undef PACKAGE_TARNAME +#undef PACKAGE_STRING +#undef PACKAGE_VERSION + +#include "ltiObject.h" +//#include "ltiTypes.h" +#include "ltiIoHandler.h" +#include "ltiIoObject.h" +#include "ltiMathObject.h" +#include "ltiRGBPixel.h" +#include "ltiPoint.h" +#include "ltiPointList.h" +#include "ltiPolygonPoints.h" +#include "ltiGeometry.h" +#include "ltiGenericVector.h" // MODIFIED for SWIG ! +#include "ltiVector.h" +#include "ltiArray.h" +#include "ltiGenericMatrix.h" // MODIFIED for SWIG ! +#include "ltiMatrix.h" // MODIFIED for SWIG ! +#include "ltiTree.h" +#include "ltiHistogram.h" +#include "ltiImage.h" +#include "ltiContour.h" +#include "ltiLinearKernels.h" +#include "ltiGradientKernels.h" +#include "ltiHessianKernels.h" +#include "ltiLaplacianKernel.h" +#include "ltiSecondDerivativeKernels.h" + +#include "ltiFunctor.h" +// durch SWIG manipulierte typ parameters in functor wieder zurueck benennen +#define _functor functor // wegen Namenskonflikt mit schon deklarierter Klasse und dem Trick ueber den namespace um die Parameter-Klassen zu generieren (gen_ltilib_class.py) +#define _functor_parameters parameters // sezte den aus dem XML generierten Parameter-Klassen-Namen wieder zurueck auf den urspruenglichen Namen +// notwendig fuer die plain Methoden lti::write(...) und lti::read(...) +namespace lti {typedef lti::functor::parameters functor_parameters;} +#include "ltiModifier.h" +#define _modifier modifier +#define _modifier_parameters parameters +namespace lti {typedef lti::modifier::parameters modifier_parameters;} +#include "ltiFilter.h" +#define _filter filter +#define _filter_parameters parameters +namespace lti {typedef lti::filter::parameters filter_parameters;} +#include "ltiIOFunctor.h" +#define _ioFunctor ioFunctor +#define _ioFunctor_parameters parameters +namespace lti {typedef lti::ioFunctor::parameters ioFunctor_parameters;} +#include "ltiBMPFunctor.h" +#define _ioBMP ioBMP +#define _ioBMP_parameters parameters +#define lti_ioBMP_parameters ioBMP_parameters // TODO: PATCH ! +namespace lti {typedef lti::ioBMP::parameters ioBMP_parameters;} +#include "ltiJPEGFunctor.h" +#define _ioJPEG ioJPEG +#define _ioJPEG_parameters parameters +#define lti_ioJPEG_parameters ioJPEG_parameters // TODO: PATCH ! +namespace lti {typedef lti::ioJPEG::parameters ioJPEG_parameters;} +#include "ltiPNGFunctor.h" +#define _ioPNG ioPNG +#define _ioPNG_parameters parameters +#define lti_ioPNG_parameters ioPNG_parameters +namespace lti {typedef lti::ioPNG::parameters ioPNG_parameters;} +#include "ltiALLFunctor.h" +#define _ioImage ioImage +#define _ioImage_parameters parameters +#define ioImage_parameters parameters // TODO: PATCH ! +namespace lti {typedef lti::ioImage::parameters ioImage_parameters;} +#include "ltiViewerBase.h" +#define _viewerBase viewerBase +#define _viewerBase_parameters parameters +namespace lti {typedef lti::viewerBase::parameters viewerBase_parameters;} +#include "ltiExternViewer.h" +#define _externViewer externViewer +#define _externViewer_parameters parameters +namespace lti {typedef lti::externViewer::parameters externViewer_parameters;} +#include "ltiSplitImage.h" +#include "ltiSplitImageTorgI.h" + +#include "ltiUsePalette.h" +#define _usePalette usePalette +#define _usePalette_parameters parameters +namespace lti {typedef lti::usePalette::parameters usePalette_parameters;} +#include "ltiTransform.h" +#define _transform transform +#define _transform_parameters parameters +namespace lti {typedef lti::transform::parameters transform_parameters;} +#include "ltiGradientFunctor.h" +#define _gradientFunctor gradientFunctor +#define _gradientFunctor_parameters parameters +#define lti_gradientFunctor_parameters gradientFunctor_parameters // TODO: PATCH ! +namespace lti {typedef lti::gradientFunctor::parameters gradientFunctor_parameters;} +#include "ltiColorContrastGradient.h" +#define _colorContrastGradient colorContrastGradient +#define _colorContrastGradient_parameters parameters +#define lti_colorContrastGradient_parameters colorContrastGradient_parameters // TODO: PATCH ! +namespace lti {typedef lti::colorContrastGradient::parameters colorContrastGradient_parameters;} +#include "ltiEdgeDetector.h" +#define _edgeDetector edgeDetector +#define _edgeDetector_parameters parameters +namespace lti {typedef lti::edgeDetector::parameters edgeDetector_parameters;} +#include "ltiClassicEdgeDetector.h" +#define _classicEdgeDetector classicEdgeDetector +#define _classicEdgeDetector_parameters parameters +namespace lti {typedef lti::classicEdgeDetector::parameters classicEdgeDetector_parameters;} +#include "ltiCannyEdges.h" +#define _cannyEdges cannyEdges +#define _cannyEdges_parameters parameters +namespace lti {typedef lti::cannyEdges::parameters cannyEdges_parameters;} +#include "ltiConvolution.h" +#define _convolution convolution +#define _convolution_parameters parameters +namespace lti {typedef lti::convolution::parameters convolution_parameters;} +#include "ltiSegmentation.h" +#define _segmentation segmentation +#define _segmentation_parameters parameters +namespace lti {typedef lti::segmentation::parameters segmentation_parameters;} +#include "ltiRegionGrowing.h" +#define _regionGrowing regionGrowing +#define _regionGrowing_parameters parameters +namespace lti {typedef lti::regionGrowing::parameters regionGrowing_parameters;} +#include "ltiObjectsFromMask.h" +#define _objectsFromMask objectsFromMask +#define _objectsFromMask_parameters parameters +#define _objectsFromMask_objectStruct objectStruct +namespace lti { +typedef lti::objectsFromMask::objectStruct objectStruct; +typedef lti::objectsFromMask::objectStruct objectsFromMask_objectStruct; +typedef lti::objectsFromMask::parameters objectsFromMask_parameters; +} +////TODO: add better tree support !!! +////#define _tree tree +//#define _tree_objectStruct_node node +//#define _tree tree<objectStruct> +//namespace lti { +//typedef lti::tree<objectStruct>::node tree_objectStruct_node; +//} +#include "ltiPolygonApproximation.h" +#define _polygonApproximation polygonApproximation +#define _polygonApproximation_parameters parameters +namespace lti {typedef lti::polygonApproximation::parameters polygonApproximation_parameters;} +#include "ltiColorQuantization.h" +#define _colorQuantization colorQuantization +#define _colorQuantization_parameters parameters +namespace lti {typedef lti::colorQuantization::parameters colorQuantization_parameters;} +#include "ltiKMColorQuantization.h" +#define _kMColorQuantization kMColorQuantization +#define _kMColorQuantization_parameters parameters +namespace lti { +typedef lti::kMColorQuantization::parameters kMColorQuantization_parameters; +//typedef lti::kMColorQuantization::parameters lti_kMColorQuantization_parameters; +} +typedef lti::kMColorQuantization::parameters lti_kMColorQuantization_parameters; +#include "ltiMeanShiftSegmentation.h" +#define _meanShiftSegmentation meanShiftSegmentation +#define _meanShiftSegmentation_parameters parameters +namespace lti {typedef lti::meanShiftSegmentation::parameters meanShiftSegmentation_parameters;} +#include "ltiKMeansSegmentation.h" +#define _kMeansSegmentation kMeansSegmentation +#define _kMeansSegmentation_parameters parameters +namespace lti { +typedef lti::kMeansSegmentation::parameters kMeansSegmentation_parameters; +//typedef lti::kMeansSegmentation::parameters lti_kMeansSegmentation_parameters; +} +typedef lti::kMeansSegmentation::parameters lti_kMeansSegmentation_parameters; + +#include "ltiWhiteningSegmentation.h" +#define _whiteningSegmentation whiteningSegmentation +#define _whiteningSegmentation_parameters parameters +namespace lti {typedef lti::whiteningSegmentation::parameters whiteningSegmentation_parameters;} +#include "ltiCsPresegmentation.h" +#define _csPresegmentation csPresegmentation +#define _csPresegmentation_parameters parameters +namespace lti {typedef lti::csPresegmentation::parameters csPresegmentation_parameters;} +#include "ltiFeatureExtractor.h" +#define _featureExtractor featureExtractor +#define _featureExtractor_parameters parameters +namespace lti {typedef lti::featureExtractor::parameters featureExtractor_parameters;} +#include "ltiGlobalFeatureExtractor.h" +#define _globalFeatureExtractor globalFeatureExtractor +#define _globalFeatureExtractor_parameters parameters +namespace lti {typedef lti::globalFeatureExtractor::parameters globalFeatureExtractor_parameters;} +#include "ltiGeometricFeatures.h" +#define _geometricFeatures geometricFeatures +#define _geometricFeatures_parameters parameters +namespace lti {typedef lti::geometricFeatures::parameters geometricFeatures_parameters;} +#include "ltiChromaticityHistogram.h" +#define _chromaticityHistogram chromaticityHistogram +#define _chromaticityHistogram_parameters parameters +namespace lti {typedef lti::chromaticityHistogram::parameters chromaticityHistogram_parameters;} +#include "ltiLocalFeatureExtractor.h" +#define _localFeatureExtractor localFeatureExtractor +#define _localFeatureExtractor_parameters parameters +namespace lti {typedef lti::localFeatureExtractor::parameters localFeatureExtractor_parameters;} +#include "ltiLocalMoments.h" +#define _localMoments localMoments +#define _localMoments_parameters parameters +namespace lti {typedef lti::localMoments::parameters localMoments_parameters;} +#include "ltiMorphology.h" +#define _morphology morphology +#define _morphology_parameters parameters +namespace lti {typedef lti::morphology::parameters morphology_parameters;} +#include "ltiDilation.h" +#define _dilation dilation +#define _dilation_parameters parameters +namespace lti {typedef lti::dilation::parameters dilation_parameters;} +#include "ltiErosion.h" +#define _erosion erosion +#define _erosion_parameters parameters +namespace lti {typedef lti::erosion::parameters erosion_parameters;} +#include "ltiDistanceTransform.h" +#define _distanceTransform distanceTransform +#define _distanceTransform_parameters parameters +namespace lti {typedef lti::distanceTransform::parameters distanceTransform_parameters;} +#include "ltiSkeleton.h" +#define _skeleton skeleton +#define _skeleton_parameters parameters +namespace lti {typedef lti::skeleton::parameters skeleton_parameters;} +#include "ltiClassifier.h" +#define _classifier classifier +#define _classifier_parameters parameters +#define _classifier_outputTemplate outputTemplate +#define _classifier_outputVector outputVector +namespace lti { +typedef lti::classifier::parameters classifier_parameters; +typedef lti::classifier::outputTemplate classifier_outputTemplate; +typedef lti::classifier::outputVector classifier_outputVector; +} +#include "ltiSupervisedInstanceClassifier.h" +#define _supervisedInstanceClassifier supervisedInstanceClassifier +#define _supervisedInstanceClassifier_parameters parameters +namespace lti {typedef lti::supervisedInstanceClassifier::parameters supervisedInstanceClassifier_parameters;} +/* TODO +#include "ltiDecisionTree.h" +#define _decisionTree decisionTree +#define _decisionTree_parameters parameters +namespace lti { +typedef lti::decisionTree::parameters decisionTree_parameters; +} +*/ + +#include "ltiSplitImageToHSI.h" +#include "ltiSplitImageToHSV.h" +#include "ltiSplitImageToHLS.h" +#include "ltiSplitImageToRGB.h" +#include "ltiSplitImageToYUV.h" + +typedef std::ostream ostream; +typedef std::istream istream; + +using namespace lti; + +#include "lti_manual.h" + +%} +// ************************************************************************** +// This part is for the swig parser phase ! +// This code will be used by swig to build up the type hierarchy. +// for successful mapping of const ubyte & to simple data types !!! +typedef unsigned char ubyte; +typedef signed char byte; +typedef unsigned short int uint16; +typedef signed short int int16; +typedef unsigned int uint32; +typedef signed int int32; +/* #ifdef LOSEDOWS +typedef unsigned __int64 uint64; +typedef signed __int64 int64; +#else +typedef unsigned long long uint64; +typedef signed long long int64; +#endif */ +typedef point<int> ipoint; + +%include "ltiObject.h" +%include "ltiIoHandler.h" +%include "ltiIoObject.h" +%include "ltiMathObject.h" +%include "ltiRGBPixel.h" +%include "ltiPoint.h" +namespace lti { + %template(ipoint) tpoint<int>; + %template(fpoint) tpoint<float>; + %template(dpoint) tpoint<double>; +} +%template(list_ipoint) std::list<lti::ipoint>; +%include "ltiPointList.h" +%extend lti::tpointList { +// TODO: add a better (pythonic) support for iterators +void * createIterator() +{ + lti::tpointList<T>::iterator * pIter = new lti::tpointList<T>::iterator; + (*pIter) = self->begin(); + return (void *) (pIter); +} +void deleteIterator(void *p) +{ + lti::tpointList<T>::iterator * pIter = (lti::tpointList<T>::iterator *)p; + delete pIter; +} +bool isEnd(void *p) +{ + lti::tpointList<T>::iterator * pIter = (lti::tpointList<T>::iterator *)p; + return *pIter == self->end(); +} +tpoint<T> nextElement(void * p) +{ + lti::tpointList<T>::iterator * pIter = (lti::tpointList<T>::iterator *)p; + tpoint<T> aPointOut = *(*pIter); + ++(*pIter); + return aPointOut; +} +} +namespace lti { + %template(pointList) tpointList<int>; +} +%include "ltiPolygonPoints.h" +namespace lti { +// %template(ipolygonPoints) tpolygonPoints<int>; // PATCH in ltiPolygonPoints.h +} +%include "ltiGeometry.h" +namespace lti { +//TODO: %template(iintersection) intersection<ipoint>; +} +%include "ltiGenericVector.h" +%extend lti::genericVector { + // add index support for python (Warning: this is Python-specific!) + const T & __getitem__( int index ) + { + return self->at(index); + } + void __setitem__( int index, const T & value ) + { + (*self)[index] = value; + } +} +namespace lti { + %template(dgenericVector) genericVector<double>; + %template(fgenericVector) genericVector<float>; + %template(igenericVector) genericVector<int>; + %template(bgenericVector) genericVector<ubyte>; + %template(rgbgenericVector) genericVector<rgbPixel>; +} +%include "ltiVector.h" +namespace lti { + %template(dvector) vector<double>; + %template(fvector) vector<float>; + %template(ivector) vector<int>; + %template(uvector) vector<ubyte>; + %template(palette) vector<rgbPixel>; +} +%include "ltiArray.h" +namespace lti { + %template(iarray) array<int>; + %template(farray) array<float>; + %template(darray) array<double>; + %template(barray) array<ubyte>; +} +%include "ltiGenericMatrix.h" +%extend lti::genericMatrix { + // add index support for python (Warning: this is Python-specific!) + const T & __getitem__( int index ) + { + return self->at(index); + } + void __setitem__( int index, const genericVector<T> & value ) + { + (*self)[index] = value; + } + // TODO: check + // The original at()-method makes some problems! is it because of 'inline' ? + const T & at( int row, int col ) + { + return self->at(row,col); + } + void setAt( int row, int col, const T & value ) + { + (*self)[row][col] = value; + } +} +namespace lti { + %template(bgenericMatrix) genericMatrix<ubyte>; + %template(igenericMatrix) genericMatrix<int>; + %template(fgenericMatrix) genericMatrix<float>; + %template(dgenericMatrix) genericMatrix<double>; + %template(rgbPixelgenericMatrix) genericMatrix<rgbPixel>; +} +%include "ltiMatrix.h" +namespace lti { + %template(imatrix) matrix<int>; + %template(fmatrix) matrix<float>; + %template(dmatrix) matrix<double>; + %template(bmatrix) matrix<ubyte>; + %template(rgbPixelmatrix) matrix<rgbPixel>; +} +%include "ltiHistogram.h" +//namespace lti { +// %template(histogram) thistogram<double>; +//} + +%include "ltiImage.h" +%include "ltiContour.h" + +// has to be included AFTER the definition of borderPoints !!! +%include "_objectsFromMask_objectStruct.h" +#include "_objectsFromMask_objectStruct.h" + +// TODO: add better tree support ! +//%include "ltiTree.h" +//namespace lti { +// //%template(tree_objectStruct) tree<objectsFromMask_objectStruct>; // does not work because of a syntactical difference to tree<objectStruct>, unforunately is swig not so clever to handel that :-( +// %template(tree_objectStruct) tree<objectStruct>; +//} +////#define node tree_objectStruct_node +//%include "_tree_node.h" + +%include "ltiLinearKernels.h" +namespace lti { + %template(ikernel1D) kernel1D<int>; + %template(fkernel1D) kernel1D<float>; + %template(dkernel1D) kernel1D<double>; + %template(bkernel1D) kernel1D<ubyte>; + %template(ikernel2D) kernel2D<int>; + %template(fkernel2D) kernel2D<float>; + %template(dkernel2D) kernel2D<double>; + %template(bkernel2D) kernel2D<ubyte>; + %template(isepKernel) sepKernel<int>; + %template(fsepKernel) sepKernel<float>; + %template(dsepKernel) sepKernel<double>; + %template(usepKernel) sepKernel<ubyte>; +} +%include "ltiGradientKernels.h" +namespace lti { + // TODO %template(igradientKernelX) gradientKernelX<int>; +} +%include "ltiHessianKernels.h" +%include "ltiLaplacianKernel.h" +%include "ltiSecondDerivativeKernels.h" +namespace lti { + %template(iandoKernelXX) andoKernelXX<int>; + %template(iandoKernelXY) andoKernelXY<int>; + %template(iandoKernelYY) andoKernelYY<int>; + %template(fandoKernelXX) andoKernelXX<float>; + %template(fandoKernelXY) andoKernelXY<float>; + %template(fandoKernelYY) andoKernelYY<float>; +} + +// TODO: ok: mit SWIG 1.3.21 !!! und SWIG 1.3.24 + VC7 +%template(list_ioPoints) std::list<lti::ioPoints>; +%template(list_borderPoints) std::list<lti::borderPoints>; +%template(list_areaPoints) std::list<lti::areaPoints>; + +// parameters in functor (eindeutig) umbenennen +#define parameters functor_parameters +%include "_functor_parameters.h" +%include "ltiFunctor.h" +#undef parameters + +#define parameters modifier_parameters +%include "_modifier_parameters.h" +%include "ltiModifier.h" +#undef parameters + +#define parameters filter_parameters +%include "_filter_parameters.h" +%include "ltiFilter.h" +#undef parameters + +#define parameters ioFunctor_parameters +%include "_ioFunctor_parameters.h" +%include "ltiIOFunctor.h" +#undef parameters + +#define parameters ioBMP_parameters +%include "_ioBMP_parameters.h" +%include "ltiBMPFunctor.h" +#undef parameters + +#define parameters ioJPEG_parameters +%include "_ioJPEG_parameters.h" +%include "ltiJPEGFunctor.h" +#undef parameters + +#define parameters ioPNG_parameters +%include "_ioPNG_parameters.h" +%include "ltiPNGFunctor.h" +#undef parameters + +#define parameters ioImage_parameters +%include "_ioImage_parameters.h" +%include "ltiALLFunctor.h" +#undef parameters + +#define parameters viewerBase_parameters +%include "_viewerBase_parameters.h" +%include "ltiViewerBase.h" +#undef parameters + +#define parameters externViewer_parameters +%include "_externViewer_parameters.h" +%include "ltiExternViewer.h" +#undef parameters + +%include "ltiSplitImage.h" +%include "ltiSplitImageTorgI.h" + +#define parameters usePalette_parameters +%include "_usePalette_parameters.h" +%include "ltiUsePalette.h" +#undef parameters + +#define parameters transform_parameters +%include "_transform_parameters.h" +%include "ltiTransform.h" +#undef parameters + +#define parameters gradientFunctor_parameters +%include "_gradientFunctor_parameters.h" +%include "ltiGradientFunctor.h" +#undef parameters + +#define parameters colorContrastGradient_parameters +%include "_colorContrastGradient_parameters.h" +%include "ltiColorContrastGradient.h" +#undef parameters + +#define parameters edgeDetector_parameters +%include "_edgeDetector_parameters.h" +%include "ltiEdgeDetector.h" +#undef parameters + +#define parameters classicEdgeDetector_parameters +%include "_classicEdgeDetector_parameters.h" +%include "ltiClassicEdgeDetector.h" +#undef parameters + +#define parameters cannyEdges_parameters +%include "_cannyEdges_parameters.h" +%include "ltiCannyEdges.h" +#undef parameters + +// TODO: problems with private class accumulator !!! --> can we solve this with generated header file out of the XML-output ? +#define parameters convolution_parameters +%include "_convolution_parameters.h" +%include "ltiConvolution.h" +#undef parameters + +#define parameters segmentation_parameters +%include "_segmentation_parameters.h" +%include "ltiSegmentation.h" +#undef parameters + +#define parameters regionGrowing_parameters +%include "_regionGrowing_parameters.h" +%include "ltiRegionGrowing.h" +#undef parameters + +////#define objectStruct objectsFromMask_objectStruct +//%include "_objectsFromMask_objectStruct.h" +////%include "ltiObjectsFromMask.h" +////#undef objectStruct + +#define parameters objectsFromMask_parameters +%include "_objectsFromMask_parameters.h" +%include "ltiObjectsFromMask.h" +#undef parameters + +#define parameters polygonApproximation_parameters +%include "_polygonApproximation_parameters.h" +%include "ltiPolygonApproximation.h" +#undef parameters + +#define parameters colorQuantization_parameters +%include "_colorQuantization_parameters.h" +%include "ltiColorQuantization.h" +#undef parameters + +#define parameters kMColorQuantization_parameters +%include "_kMColorQuantization_parameters.h" +%include "ltiKMColorQuantization.h" +#undef parameters + +#define parameters meanShiftSegmentation_parameters +%include "_meanShiftSegmentation_parameters.h" +%include "ltiMeanShiftSegmentation.h" +#undef parameters + +#define parameters kMeansSegmentation_parameters +%include "_kMeansSegmentation_parameters.h" +%include "ltiKMeansSegmentation.h" +#undef parameters + +%extend lti::_kMeansSegmentation::_kMeansSegmentation_parameters { +// TODO: is there a better way to support complex attributes ? +// a helper method to set complex attributes of a parameters-class +void setQuantParameters(const lti::_kMColorQuantization::kMColorQuantization_parameters & value) +{ + self->quantParameters = value; +} +}; + +#define parameters whiteningSegmentation_parameters +%include "_whiteningSegmentation_parameters.h" +%include "ltiWhiteningSegmentation.h" +#undef parameters + +#define parameters csPresegmentation_parameters +%include "_csPresegmentation_parameters.h" +%include "ltiCsPresegmentation.h" +#undef parameters + +#define parameters featureExtractor_parameters +%include "_featureExtractor_parameters.h" +%include "ltiFeatureExtractor.h" +#undef parameters + +#define parameters globalFeatureExtractor_parameters +%include "_globalFeatureExtractor_parameters.h" +%include "ltiGlobalFeatureExtractor.h" +#undef parameters + +#define parameters localFeatureExtractor_parameters +%include "_localFeatureExtractor_parameters.h" +%include "ltiLocalFeatureExtractor.h" +#undef parameters + +#define parameters localMoments_parameters +%include "_localMoments_parameters.h" +%include "ltiLocalMoments.h" +#undef parameters + +#define parameters geometricFeatures_parameters +%include "_geometricFeatures_parameters.h" +%include "ltiGeometricFeatures.h" +#undef parameters + +#define parameters chromaticityHistogram_parameters +%include "_chromaticityHistogram_parameters.h" +%include "ltiChromaticityHistogram.h" +#undef parameters + +#define parameters morphology_parameters +%include "_morphology_parameters.h" +%include "ltiMorphology.h" +#undef parameters + +#define parameters dilation_parameters +%include "_dilation_parameters.h" +%include "ltiDilation.h" +#undef parameters + +#define parameters erosion_parameters +%include "_erosion_parameters.h" +%include "ltiErosion.h" +#undef parameters + +#define parameters distanceTransform_parameters +%rename (distanceTransform_sedMask) lti::distanceTransform::sedMask; +%include "_distanceTransform_parameters.h" +%include "ltiDistanceTransform.h" +#undef parameters + +#define parameters skeleton_parameters +%include "_skeleton_parameters.h" +%include "ltiSkeleton.h" +#undef parameters + +#define parameters classifier_parameters +#define outputTemplate classifier_outputTemplate +#define outputVector classifier_outputVector +%include "_classifier_outputVector.h" +%include "_classifier_outputTemplate.h" +%include "_classifier_parameters.h" +%include "ltiClassifier.h" +#undef parameters + +#define parameters supervisedInstanceClassifier_parameters +//%include "_supervisedInstanceClassifier_parameters.h" +%include "ltiSupervisedInstanceClassifier.h" +#undef parameters + +//#define parameters decisionTree_parameters +//%include "_decisionTree_parameters.h" +//%include "ltiDecisionTree.h" +//#undef parameters + +%include "ltiSplitImageToHSI.h" +%extend lti::splitImageToHSI { + // transfer the HSI value as a rgbPixel (TODO: maybe better as a Python tuple? How?) + lti::rgbPixel apply( const rgbPixel &pixel ) + { + ubyte H, S, I; + self->apply( pixel, H, S, I ); + return lti::rgbPixel( H, S, I ); + } +/* TODO --> does not work ! + int[3] apply( const rgbPixel &pixel ) + { + int ret[3]; + ubyte H, S, I; + self->apply( pixel, H, S, I ); + ret[0] = H; + ret[1] = S; + ret[2] = I; + return ret; + } +*/ +} +%include "ltiSplitImageToHSV.h" +%include "ltiSplitImageToHLS.h" +%include "ltiSplitImageToRGB.h" +%include "ltiSplitImageToYUV.h" + +// ************************************************************************** + +%include "lti_manual.h" + + diff --git a/externals/gridflow/optional/rblti/std_list_ruby.i b/externals/gridflow/optional/rblti/std_list_ruby.i new file mode 100644 index 00000000..baf66d91 --- /dev/null +++ b/externals/gridflow/optional/rblti/std_list_ruby.i @@ -0,0 +1,28 @@ +/* + Lists +*/ + +%fragment("StdListTraits","header",fragment="StdSequenceTraits") +%{ + namespace swig { + template <class T > + struct traits_asptr<std::list<T> > { + static int asptr(PyObject *obj, std::list<T> **lis) { + return traits_asptr_stdseq<std::list<T> >::asptr(obj, lis); + } + }; + + template <class T> + struct traits_from<std::list<T> > { + static PyObject *from(const std::list<T> & vec) { + return traits_from_stdseq<std::list<T> >::from(vec); + } + }; + } +%} + +#define %swig_list_methods(Type...) %swig_sequence_methods(Type) +#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); + +%include <std/std_list.i> + diff --git a/externals/gridflow/optional/usb.c b/externals/gridflow/optional/usb.c index 1721d4c4..b12b5a10 100644 --- a/externals/gridflow/optional/usb.c +++ b/externals/gridflow/optional/usb.c @@ -1,5 +1,5 @@ /* - $Id: usb.c,v 1.1 2005-10-04 02:02:15 matju Exp $ + $Id: usb.c,v 1.2 2006-03-15 04:45:31 matju Exp $ GridFlow Copyright (c) 2001,2002,2003 by Mathieu Bouchard @@ -354,5 +354,6 @@ void startup_usb () { rb_hash_aset(busses,rb_str_new2(bus->dirname),usb_scan_bus(bus)); } //IEVAL(cUSB,"STDERR.print '@busses = '; STDERR.puts @busses.inspect"); + rb_require("gridflow/optional/usb.rb"); } diff --git a/externals/gridflow/optional/usb.rb b/externals/gridflow/optional/usb.rb new file mode 100644 index 00000000..98191329 --- /dev/null +++ b/externals/gridflow/optional/usb.rb @@ -0,0 +1,107 @@ +=begin + $Id: usb.rb,v 1.1 2006-03-15 04:46:22 matju Exp $ + + GridFlow + Copyright (c) 2001,2002,2003,2004,2005 by Mathieu Bouchard + + This program is free software; you can redistribute it and/or + modify it 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. + + See file ../COPYING for further informations on licensing terms. + + This program is distributed in the hope that it 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +=end + +module GridFlow + +class<<USB + attr_reader :busses +end + +FObject.subclass("delcomusb",1,1) { + Vendor,Product=0x0FC5,0x1222 + def self.find + r=[] + USB.busses.each {|dir,bus| + bus.each {|dev| + r<<dev if dev.idVendor==Vendor and dev.idProduct==Product + } + } + r + end + def initialize #(bus=nil,dev=nil) + r=DelcomUSB.find + raise "no such device" if r.length<1 + raise "#{r.length} such devices (which one???)" if r.length>1 + @usb=USB.new(r[0]) + if_num=nil + r[0].config.each {|config| + config.interface.each {|interface| + if_num = interface.bInterfaceNumber + } + } + # post "Interface # %i\n", if_num + @usb.set_configuration 1 + @usb.claim_interface if_num + @usb.set_altinterface 0 rescue ArgumentError + end + # libdelcom had this: + # uint8 recipient, deviceModel, major, minor, dataL, dataM; + # uint16 length; uint8[8] extension; + def _0_send_command(major,minor,dataL,dataM,extension="\0\0\0\0\0\0\0\0") + raise "closed" if not @usb + raise "extension.length!=8" if extension.length!=8 + @usb.control_msg( + 0x000000c8, 0x00000012, + minor*0x100+major, + dataM*0x100+dataL, + extension, 5000) + end + def delete; @usb.close; end +} + +FObject.subclass("klippeltronics",1,1) { + def self.find + r=[] + USB.busses.each {|dir,bus| + bus.each {|dev| + GridFlow.post "dir=%s, vendor=%x, product=%x", + dir, dev.idVendor, dev.idProduct + r<<dev if dev.idVendor==0xDead and dev.idProduct==0xBEEF + } + } + r + end + def initialize + r=self.class.find + post "%s", r.inspect + raise "no such device" if r.length<1 + raise "#{r.length} such devices (which one???)" if r.length>1 + $iobox=@usb=USB.new(r[0]) + if_num=nil + r[0].config.each {|config| + config.interface.each {|interface| + #post "interface=%s", interface.to_s + if_num = interface.bInterfaceNumber + } + } + # post "Interface # %i\n", if_num + # @usb.set_configuration 0 + @usb.claim_interface if_num + @usb.set_altinterface 0 rescue ArgumentError + end + #@usb.control_msg(0b10100001,0x01,0,0,"",1000) + #@usb.control_msg(0b10100001,0x01,0,1," ",0) + def delete; @usb.close; end +} + +end # module GridFlow diff --git a/externals/gridflow/pd_abstractions/#color.pd b/externals/gridflow/pd_abstractions/#color.pd index bd97d09b..b7a38d9f 100644 --- a/externals/gridflow/pd_abstractions/#color.pd +++ b/externals/gridflow/pd_abstractions/#color.pd @@ -1,21 +1,16 @@ -#N canvas 648 305 209 58 10; -#X floatatom 3 29 5 0 0 0 - - -; +#N canvas 0 17 209 58 10; #X obj 75 28 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -225271 -24198 -1 0 1; #X obj 75 43 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -228992 -62784 -1 0 1; -#X floatatom 3 44 5 0 0 0 - - -; #X obj 75 13 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -261689 -258699 -1 0 1; -#X floatatom 3 14 5 0 0 0 - - -; #X obj 3 76 #pack 3; -#X obj 209 36 #export_list; -#X obj 210 55 unpack 0 0 0; -#X obj 208 17 inlet rgb_color; +#X obj 209 13 inlet rgb_color; #X obj 56 75 outlet rgb_color; -#X obj 43 12 int; -#X obj 43 27 int; -#X obj 43 42 int; +#X obj 48 12 int; +#X obj 48 27 int; +#X obj 48 42 int; #X obj 196 2 cnv 10 60 10 empty \$0-cnv empty 20 12 0 14 -262144 -262144 0; #X obj 125 192 s \$0-cnv; @@ -23,46 +18,58 @@ #X obj 4 154 #export; #X obj 3 133 # ^ -1; #X obj 3 114 #fold |; -#X obj 3 95 # << ( 16 8 0 ); -#X obj 194 75 loadbang; -#X msg 194 151 range \$1 \$2; -#X obj 194 132 #export_list; -#X obj 194 94 listmake \$1 \$2; -#X obj 194 113 # || ( 0 255 ); +#X obj 194 85 loadbang; +#X msg 194 161 range \$1 \$2; +#X obj 194 142 #export_list; +#X obj 194 104 listmake \$1 \$2; #X obj 59 134 loadbang; #X obj 88 154 - \$3; #X msg 59 154 1; #X obj 3 180 spigot; -#X connect 0 0 6 1; -#X connect 1 0 12 0; -#X connect 2 0 13 0; -#X connect 3 0 6 2; -#X connect 4 0 11 0; -#X connect 5 0 6 0; -#X connect 6 0 10 0; -#X connect 6 0 20 0; -#X connect 7 0 8 0; -#X connect 8 0 4 0; -#X connect 8 1 1 0; -#X connect 8 2 2 0; -#X connect 9 0 7 0; -#X connect 11 0 5 0; -#X connect 12 0 0 0; -#X connect 13 0 3 0; -#X connect 16 0 15 0; -#X connect 17 0 29 0; -#X connect 18 0 17 0; -#X connect 19 0 18 0; -#X connect 20 0 19 0; -#X connect 21 0 24 0; -#X connect 22 0 2 0; -#X connect 22 0 1 0; -#X connect 22 0 4 0; -#X connect 23 0 22 0; -#X connect 24 0 25 0; -#X connect 25 0 23 0; -#X connect 26 0 28 0; -#X connect 27 0 29 1; -#X connect 28 0 27 0; -#X connect 29 0 16 0; +#X obj 209 33 route delegate; +#X obj 244 53 #unpack 3; +#X obj 1 14 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 8 -262144 +-1 -1 0 256; +#X obj 1 30 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 8 -262144 +-1 -1 0 256; +#X obj 1 46 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 8 -262144 +-1 -1 0 256; +#X obj 194 123 # || (0 255); +#X obj 3 95 # << (16 8 0); +#X text 64 218 should be sized 209 by 58 or something; +#X connect 0 0 7 0; +#X connect 1 0 8 0; +#X connect 2 0 6 0; +#X connect 3 0 5 0; +#X connect 3 0 29 0; +#X connect 4 0 23 0; +#X connect 6 0 25 0; +#X connect 7 0 26 0; +#X connect 8 0 27 0; +#X connect 11 0 10 0; +#X connect 12 0 22 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 15 0 18 0; +#X connect 16 0 1 0; +#X connect 16 0 0 0; +#X connect 16 0 2 0; +#X connect 17 0 16 0; +#X connect 18 0 28 0; +#X connect 19 0 21 0; +#X connect 20 0 22 1; +#X connect 21 0 20 0; +#X connect 22 0 11 0; +#X connect 23 0 2 0; +#X connect 23 0 0 0; +#X connect 23 0 1 0; +#X connect 23 1 24 0; +#X connect 24 0 2 0; +#X connect 24 1 0 0; +#X connect 24 2 1 0; +#X connect 25 0 3 0; +#X connect 26 0 3 1; +#X connect 27 0 3 2; +#X connect 28 0 17 0; +#X connect 29 0 14 0; #X coords 0 0 1 1 120 56 1; diff --git a/externals/gridflow/pd_abstractions/#spread.pd b/externals/gridflow/pd_abstractions/#spread.pd index b86ed96e..41a6a8da 100644 --- a/externals/gridflow/pd_abstractions/#spread.pd +++ b/externals/gridflow/pd_abstractions/#spread.pd @@ -2,7 +2,7 @@ #X obj 17 12 inlet; #X obj 17 52 # & 0; #X obj 17 72 # + 5; -#X obj 17 92 #! rand; +#X obj 17 92 # rand; #X obj 17 112 # - 2; #X obj 137 162 # +; #X obj 124 68 # >> 1; diff --git a/externals/gridflow/pd_examples/blob.pd b/externals/gridflow/pd_examples/blob.pd index 48f5251a..12ea5ee6 100644 --- a/externals/gridflow/pd_examples/blob.pd +++ b/externals/gridflow/pd_examples/blob.pd @@ -1,106 +1,106 @@ -#N canvas 19 81 792 565 10; -#X floatatom 405 212 5 0 0 0 - - -; -#X obj 347 172 r move; -#X obj 56 95 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#N canvas 19 81 792 575 10; +#X floatatom 398 265 5 0 0 0 - - -; +#X obj 368 225 r move; +#X obj 56 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X msg 56 128 240 320 3 # 0; -#X msg 461 357 300; -#X obj 398 342 # * 300; -#X obj 311 436 # cos*; -#X msg 460 319 1600; -#X msg 513 249 25; -#X obj 373 212 +; -#X msg 513 268 100; -#X obj 504 192 hsl 128 15 100 2600 0 1 empty empty empty -2 -6 0 8 +#X msg 56 162 240 320 3 # 0; +#X msg 461 407 300; +#X obj 398 392 # * 300; +#X obj 261 475 # cos*; +#X msg 461 369 1600; +#X msg 513 299 25; +#X obj 368 263 +; +#X msg 513 318 100; +#X obj 505 244 hsl 128 15 100 2600 0 1 empty empty empty -2 -6 0 8 -260818 -1 -1 2297 1; -#X text 364 435 make circular orbit of variable radius; -#X floatatom 502 211 5 0 0 0 - - -; -#X msg 461 338 800; -#X text 294 325 frequency of the orbit; -#X text 500 177 increment; -#X msg 373 192 1; -#X obj 64 58 s move; -#X obj 311 394 #outer + ( 0 9000 ); -#X obj 73 94 loadbang; -#X obj 19 0 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; -#X obj 78 351 #out window; -#X obj 246 126 # +; -#X obj 438 299 # + 50; -#X text 401 197 counter; -#X obj 19 41 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X text 314 474 make circular orbit of variable radius; +#X floatatom 502 261 5 0 0 0 - - -; +#X msg 461 388 800; +#X text 294 375 frequency of the orbit; +#X text 501 229 increment; +#X msg 368 244 1; +#X obj 58 108 s move; +#X obj 73 128 loadbang; +#X obj 19 50 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 75 392 #out window; +#X obj 186 236 # +; +#X obj 437 345 # + 50; +#X text 394 250 counter; +#X obj 19 91 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 311 458 # + ( 120 160 ); -#X obj 19 309 #store; -#X text 65 113 blank image to start with; -#X text 272 127 translate the square; -#X text 546 247 make a wavy radius (50-100) \; the 1100 is its frequency +#X obj 261 494 # + ( 120 160 ); +#X obj 19 354 #store; +#X text 65 147 blank image to start with; +#X text 212 237 translate the square; +#X text 546 297 make a wavy radius (50-100) \; the 1100 is its frequency \; tune it for fun and profit.; -#X obj 19 58 t b b; -#X obj 368 232 t a a a; -#X msg 246 74 4 2 # -1 -1 -1 1 1 1 1 -1; -#X obj 19 22 metro 1.367; -#X obj 8 491 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj 19 108 t b b; +#X obj 368 282 t a a a; +#X msg 186 198 4 2 # -1 -1 -1 1 1 1 1 -1; +#X obj 19 72 metro 1.367; +#X obj 8 541 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text 16 498 GridFlow 0.8.0; -#X obj 8 -38 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 16 548 GridFlow 0.8.0; +#X obj 8 12 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 21 -38 Blob.pd; -#X msg 514 287 10; -#X obj 437 257 # * 1000; -#X obj 101 215 #color; -#X obj 101 171 loadbang; -#X text 452 383 duplicate the angle \; make the 2nd 90 degrees apart +#X text 21 12 Blob.pd; +#X msg 514 337 10; +#X obj 437 307 # * 1000; +#X obj 101 265 #color; +#X obj 101 221 loadbang; +#X text 385 432 duplicate the angle \; make the 2nd 90 degrees apart (required for a circle \; else it'll be an oval or a line); -#X obj 78 309 #draw_polygon + (3 # ); -#X text 21 -25 Copyright 2002 Mathieu Bouchard and Alexandre Castonguay +#X obj 75 354 #draw_polygon + (3 # ); +#X text 21 25 Copyright 2002 Mathieu Bouchard and Alexandre Castonguay ; -#X text 245 58 a 2x2 square's coordinates; -#X text 288 103 scale factor; -#X obj 246 102 # * 8; -#X obj 78 330 #solarize; -#X text 400 -1 This is the classic "Shadebob" effect of the demoscene +#X text 185 182 a 2x2 square's coordinates; +#X text 228 218 scale factor; +#X obj 186 217 # * 8; +#X obj 75 373 #solarize; +#X text 400 49 This is the classic "Shadebob" effect of the demoscene ; -#X msg 101 193 12 24 36; -#X text 6 284 superimpose the light of many squares; -#X obj 438 278 # cos* 100; +#X msg 101 243 12 24 36; +#X text 6 331 superimpose the light of many squares; +#X obj 437 326 # cos* 100; +#X obj 261 444 #outer + (0 9000); #X connect 0 0 9 1; #X connect 1 0 17 0; #X connect 2 0 3 0; -#X connect 3 0 28 1; +#X connect 3 0 27 1; #X connect 4 0 5 1; -#X connect 5 0 19 0; -#X connect 6 0 27 0; +#X connect 5 0 54 0; +#X connect 6 0 26 0; #X connect 7 0 5 1; -#X connect 8 0 54 1; +#X connect 8 0 53 1; #X connect 9 0 0 0; -#X connect 9 0 33 0; -#X connect 10 0 54 1; +#X connect 9 0 32 0; +#X connect 10 0 53 1; #X connect 11 0 13 0; -#X connect 13 0 41 1; +#X connect 13 0 40 1; #X connect 14 0 5 1; #X connect 17 0 9 0; -#X connect 19 0 6 0; -#X connect 20 0 2 0; -#X connect 21 0 35 0; -#X connect 23 0 45 2; -#X connect 24 0 6 1; -#X connect 26 0 32 0; -#X connect 27 0 23 1; -#X connect 28 0 45 0; -#X connect 32 0 28 0; -#X connect 32 1 18 0; -#X connect 33 0 34 0; -#X connect 33 1 5 0; -#X connect 33 2 41 0; -#X connect 34 0 49 0; -#X connect 35 0 26 0; -#X connect 40 0 54 1; -#X connect 41 0 54 0; -#X connect 42 0 45 1; -#X connect 43 0 52 0; -#X connect 45 0 28 1; -#X connect 45 0 50 0; -#X connect 49 0 23 0; -#X connect 50 0 22 0; -#X connect 52 0 42 0; -#X connect 54 0 24 0; +#X connect 19 0 2 0; +#X connect 20 0 34 0; +#X connect 22 0 44 2; +#X connect 23 0 6 1; +#X connect 25 0 31 0; +#X connect 26 0 22 1; +#X connect 27 0 44 0; +#X connect 31 0 27 0; +#X connect 31 1 18 0; +#X connect 32 0 33 0; +#X connect 32 1 5 0; +#X connect 32 2 40 0; +#X connect 33 0 48 0; +#X connect 34 0 25 0; +#X connect 39 0 53 1; +#X connect 40 0 53 0; +#X connect 41 0 44 1; +#X connect 42 0 51 0; +#X connect 44 0 27 1; +#X connect 44 0 49 0; +#X connect 48 0 22 0; +#X connect 49 0 21 0; +#X connect 51 0 41 0; +#X connect 53 0 23 0; +#X connect 54 0 6 0; diff --git a/externals/gridflow/pd_examples/cellular_1d.pd b/externals/gridflow/pd_examples/cellular_1d.pd index eb1c6c30..138b20a1 100644 --- a/externals/gridflow/pd_examples/cellular_1d.pd +++ b/externals/gridflow/pd_examples/cellular_1d.pd @@ -1,164 +1,160 @@ -#N canvas 337 53 804 634 10; -#X obj 43 68 loadbang; -#X obj 93 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1 +#N canvas 355 53 786 544 10; +#X obj 33 103 loadbang; +#X obj 93 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1 ; -#X obj 108 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 +#X obj 108 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 1; -#X obj 123 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 +#X obj 123 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 1; -#X obj 138 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 +#X obj 138 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1; -#X obj 153 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 +#X obj 153 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 1; -#X obj 168 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 +#X obj 168 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1; -#X obj 183 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 +#X obj 183 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 1; -#X obj 198 382 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 +#X obj 198 352 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1; -#X obj 124 498 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +#X obj 124 468 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 86 256; -#X obj -5 188 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj -1 215 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X msg 17 332 1 256 # 1; -#X msg 43 102 1 256 # 2; -#X obj 17 -2 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; -#X obj 418 199 loadbang; -#X msg 418 219 1 256 # 0; -#X text 131 482 characteristic number; -#X obj 428 11 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 4 256; -#X msg 467 69 \$1 256; -#X msg 352 82 set \$1; -#X text 104 124 randomizer; -#X text 91 361 specify behaviour here; -#X text 24 254 compute new state; -#X text 315 237 make scrollie; -#X text 367 270 convert bit matrix to rgb image; -#X text 313 250 (window height = 128); -#X obj 202 38 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X msg 17 312 1 256 # 1; +#X msg 33 122 1 256 # 2; +#X obj -1 77 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 415 245 loadbang; +#X msg 415 264 1 256 # 0; +#X text 131 452 characteristic number; +#X obj 352 86 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +-241291 -1 -1 0 256; +#X msg 466 127 \$1 256; +#X msg 352 122 set \$1; +#X text 79 141 randomizer; +#X text 91 331 specify behaviour here; +#X text 24 234 compute new state; +#X text 315 283 make scrollie; +#X text 367 313 convert bit matrix to rgb image; +#X text 313 296 (window height = 128); +#X obj 159 74 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 151 337 loadbang; -#X text 47 84 click here to restart; -#X obj 99 200 t a a; -#X obj 17 26 metro 33.3667; -#X obj 416 115 t a a; -#X obj 472 359 loadbang; -#X obj 389 495 unpack 0 0 0; -#X obj 564 494 unpack 0 0 0; -#X msg 389 394 3 # 0; -#X msg 565 395 3 # 255; -#X text 442 392 background; -#X text 629 395 foreground; -#X obj 17 292 t a a; -#X obj 43 124 # rand; -#X obj 17 234 #store; -#X obj 17 312 #finished; -#X obj 17 352 # <<; -#X obj 17 372 # &; -#X obj 17 392 # != 0; -#X obj 123 406 #pack 8; -#X obj 124 445 #fold +; -#X obj 124 466 #export; -#X obj 202 56 #for 0 256 1; -#X obj 202 76 # == 128; -#X obj 202 96 #redim ( 1 256 ); -#X obj 416 96 #import ( 1 256 ); -#X obj 416 135 #finished; -#X obj 352 157 #for 1 128 1; -#X obj 352 177 #outer ignore ( 0 ); -#X obj 352 197 #store; -#X obj 352 218 @join 0; -#X obj 351 287 #outer ignore ( 0 ); -#X obj 351 308 #store; -#X obj 398 308 #redim ( 2 3 ); -#X obj 389 414 #color; -#X obj 565 414 #color; -#X obj 389 475 #export_list; -#X obj 565 475 #export_list; -#X obj 492 526 #pack 6; -#X obj 17 272 #convolve (1 3 # 1 2 4); -#X obj 124 426 # << (0 1 2 3 4 5 6 7); -#X obj -4 550 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj 151 307 loadbang; +#X obj 95 182 t a a; +#X obj 17 76 metro 33.3667; +#X obj 366 165 t a a; +#X obj 534 403 loadbang; +#X msg 419 404 3 # 0; +#X msg 595 405 3 # 255; +#X text 460 405 background; +#X text 648 407 foreground; +#X obj 17 272 t a a; +#X obj 33 141 # rand; +#X obj 17 214 #store; +#X obj 17 292 #finished; +#X obj 17 332 # <<; +#X obj 17 352 # &; +#X obj 17 372 # != 0; +#X obj 123 376 #pack 8; +#X obj 124 415 #fold +; +#X obj 124 436 #export; +#X obj 159 91 #for 0 256 1; +#X obj 159 110 # == 128; +#X obj 159 129 #redim ( 1 256 ); +#X obj 366 184 #finished; +#X obj 352 207 #for 1 128 1; +#X obj 352 245 #store; +#X obj 352 264 @join 0; +#X obj 351 349 #store; +#X obj 419 424 #color; +#X obj 595 424 #color; +#X obj 513 485 #pack 6; +#X obj 17 252 #convolve (1 3 # 1 2 4); +#X obj 124 396 # << (0 1 2 3 4 5 6 7); +#X obj -4 510 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text 4 557 GridFlow 0.8.0; -#X obj -7 -50 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 4 517 GridFlow 0.8.0; +#X obj -7 0 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X obj 351 330 #out window; -#X text -3 -35 Copyright 2002 Mathieu Bouchard; -#X text -3 -49 Cellular_1d; -#X obj 428 34 max 1; -#X text 495 9 <-- number of new lines per frame; -#X text 221 37 <-- make single dot; +#X obj 351 368 #out window; +#X text -3 15 Copyright 2002 Mathieu Bouchard; +#X text -3 1 Cellular_1d; +#X obj 352 102 max 1; +#X text 419 84 <-- number of new lines per frame; +#X text 178 73 <-- make single dot; +#X text 100 123 restart; +#X obj 352 226 #outer ignore (0); +#X obj 351 330 #outer ignore (0); +#X obj 398 349 #redim (2 3); +#X obj 366 146 #import (1 256); +#X obj 419 484 #unpack 3; +#X obj 595 484 #unpack 3; #X connect 0 0 12 0; -#X connect 1 0 46 0; -#X connect 2 0 46 1; -#X connect 3 0 46 2; -#X connect 4 0 46 3; -#X connect 5 0 46 4; -#X connect 6 0 46 5; -#X connect 7 0 46 6; -#X connect 8 0 46 7; -#X connect 9 0 44 1; -#X connect 10 0 41 0; -#X connect 11 0 43 0; -#X connect 12 0 40 0; -#X connect 13 0 30 0; +#X connect 1 0 43 0; +#X connect 2 0 43 1; +#X connect 3 0 43 2; +#X connect 4 0 43 3; +#X connect 5 0 43 4; +#X connect 6 0 43 5; +#X connect 7 0 43 6; +#X connect 8 0 43 7; +#X connect 9 0 41 1; +#X connect 10 0 38 0; +#X connect 11 0 40 0; +#X connect 12 0 37 0; +#X connect 13 0 29 0; #X connect 14 0 15 0; -#X connect 15 0 56 1; -#X connect 17 0 74 0; -#X connect 18 0 52 1; -#X connect 19 0 54 0; -#X connect 26 0 49 0; +#X connect 15 0 51 1; +#X connect 17 0 65 0; +#X connect 18 0 72 1; +#X connect 19 0 50 0; +#X connect 26 0 46 0; #X connect 27 0 2 0; #X connect 27 0 3 0; #X connect 27 0 7 0; #X connect 27 0 5 0; -#X connect 29 0 41 1; -#X connect 29 1 52 0; -#X connect 30 0 41 0; -#X connect 31 0 53 0; -#X connect 31 1 57 1; -#X connect 32 0 35 0; -#X connect 32 0 36 0; -#X connect 33 0 65 0; -#X connect 33 1 65 1; -#X connect 33 2 65 2; -#X connect 34 0 65 3; -#X connect 34 1 65 4; -#X connect 34 2 65 5; -#X connect 35 0 61 0; -#X connect 36 0 62 0; -#X connect 39 0 42 0; -#X connect 39 1 43 1; -#X connect 40 0 29 0; -#X connect 41 0 66 0; -#X connect 42 0 11 0; -#X connect 43 0 44 0; +#X connect 28 0 38 1; +#X connect 28 1 72 0; +#X connect 29 0 38 0; +#X connect 30 0 49 0; +#X connect 30 1 52 1; +#X connect 31 0 32 0; +#X connect 31 0 33 0; +#X connect 32 0 54 0; +#X connect 33 0 55 0; +#X connect 36 0 39 0; +#X connect 36 1 40 1; +#X connect 37 0 28 0; +#X connect 38 0 57 0; +#X connect 39 0 11 0; +#X connect 40 0 41 0; +#X connect 41 0 42 0; +#X connect 42 0 28 0; +#X connect 43 0 58 0; #X connect 44 0 45 0; -#X connect 45 0 29 0; -#X connect 46 0 67 0; +#X connect 45 0 9 0; +#X connect 46 0 47 0; #X connect 47 0 48 0; -#X connect 48 0 9 0; +#X connect 48 0 28 0; #X connect 49 0 50 0; -#X connect 50 0 51 0; -#X connect 51 0 29 0; -#X connect 52 0 31 0; -#X connect 53 0 54 0; -#X connect 54 0 55 0; -#X connect 55 0 56 0; -#X connect 56 0 57 0; -#X connect 57 0 56 1; -#X connect 57 0 58 0; -#X connect 58 0 59 0; -#X connect 59 0 71 0; -#X connect 60 0 59 1; -#X connect 61 0 63 0; -#X connect 62 0 64 0; -#X connect 63 0 33 0; -#X connect 64 0 34 0; -#X connect 65 0 60 0; -#X connect 66 0 39 0; -#X connect 67 0 47 0; -#X connect 74 0 19 0; -#X connect 74 0 18 0; +#X connect 50 0 69 0; +#X connect 51 0 52 0; +#X connect 52 0 51 1; +#X connect 52 0 70 0; +#X connect 53 0 62 0; +#X connect 54 0 73 0; +#X connect 55 0 74 0; +#X connect 56 0 71 0; +#X connect 57 0 36 0; +#X connect 58 0 44 0; +#X connect 65 0 19 0; +#X connect 65 0 18 0; +#X connect 69 0 51 0; +#X connect 70 0 53 0; +#X connect 71 0 53 1; +#X connect 72 0 30 0; +#X connect 73 0 56 0; +#X connect 73 1 56 1; +#X connect 73 2 56 2; +#X connect 74 0 56 3; +#X connect 74 1 56 4; +#X connect 74 2 56 5; diff --git a/externals/gridflow/pd_examples/color_correction.pd b/externals/gridflow/pd_examples/color_correction.pd index 2a153d20..8c276f11 100644 --- a/externals/gridflow/pd_examples/color_correction.pd +++ b/externals/gridflow/pd_examples/color_correction.pd @@ -1,8 +1,8 @@ -#N canvas 455 129 676 546 10; -#X text 360 96 sigma (extremes); -#X obj 134 433 #out window; -#X text 361 171 linear (contrast); -#X obj 134 364 shunt 2; +#N canvas 459 129 672 521 10; +#X text 360 136 sigma (extremes); +#X obj 134 465 #out window; +#X text 361 211 linear (contrast); +#X obj 134 404 shunt 2; #N canvas 1 96 188 188 color 0; #X obj 55 134 # inv+; #X obj 55 90 # inv+ 255; @@ -22,9 +22,9 @@ #X connect 6 0 0 0; #X connect 7 0 3 0; #X connect 8 0 1 0; -#X restore 184 386 pd color correction graph generator; -#X obj 19 295 #in; -#X text 360 244 constant (brightness); +#X restore 184 425 pd color correction graph generator; +#X obj 59 285 #in; +#X text 360 284 constant (brightness); #N canvas 604 262 237 400 color-correction 0; #X obj 23 214 # + 128; #X obj 23 194 # /; @@ -67,88 +67,88 @@ #X connect 17 0 4 0; #X connect 18 0 8 1; #X connect 19 0 8 0; -#X restore 176 274 pd color-correction; -#X obj 134 386 #store; -#X obj 29 5 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; -#X obj 29 50 #for 0 256 1; -#X msg 19 274 open teapot.png \, bang; -#X obj 164 298 #finished; -#X obj 29 27 metro 33.3667; -#X obj 19 254 loadbang; -#X obj 256 52 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -241291 -1 +#X restore 176 314 pd color-correction; +#X obj 134 425 #store; +#X obj 29 45 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 29 81 #for 0 256 1; +#X obj 164 338 #finished; +#X obj 29 62 metro 33.3667; +#X obj 59 247 loadbang; +#X obj 256 92 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -241291 -1 -1 0; -#X text 277 53 regular; -#X text 276 68 solarize; -#X text 277 82 solarize 2; -#X obj 29 91 shunt 3; -#X obj 29 163 t a; -#X obj 122 146 # sin* 255; -#X obj 123 127 # / 255; -#X obj 123 108 # * 18000; -#X obj 190 351 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 +#X text 277 93 regular; +#X text 276 108 solarize; +#X text 277 122 solarize 2; +#X obj 29 119 shunt 3; +#X obj 29 173 t a; +#X obj 119 174 # sin* 255; +#X obj 120 155 # / 255; +#X obj 120 136 # * 18000; +#X obj 190 391 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 -1 0; -#X text 209 351 see picture; -#X text 209 366 see graph; -#X obj 8 231 spigot; -#X obj 57 232 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +#X text 209 391 see picture; +#X text 209 406 see graph; +#X obj 8 221 spigot; +#X obj 57 222 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X text 13 214 enable stream; -#X text 361 20 gamma (midtones); -#X msg 254 143 3 # 256; -#X obj 253 123 loadbang; -#X msg 237 171 3 # 0; -#X obj 8 320 #camera; -#X obj 362 37 #color 0 1024 1; -#X obj 362 112 #color 0 1024 1; -#X obj 362 186 #color 0 1024 1; -#X obj 362 258 #color -256 256 1; -#X obj 51 114 #solarize; -#X obj 134 411 #apply_colormap_channelwise; -#X obj 2 -38 cnv 15 720 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 13 204 enable stream; +#X text 361 60 gamma (midtones); +#X msg 254 183 3 # 256; +#X obj 253 163 loadbang; +#X msg 238 212 3 # 0; +#X obj 8 310 #camera; +#X obj 362 77 #color 0 1024 1; +#X obj 362 152 #color 0 1024 1; +#X obj 362 226 #color 0 1024 1; +#X obj 362 298 #color -256 256 1; +#X obj 51 140 #solarize; +#X obj 134 445 #apply_colormap_channelwise; +#X obj 2 2 cnv 15 720 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 15 -25 Copyright 2002 Mathieu Bouchard; -#X obj 2 477 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 15 15 Copyright 2002 Mathieu Bouchard; +#X obj 2 487 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text 10 484 GridFlow 0.8.0; -#X text 15 -38 color_correction.pd; -#X obj 29 71 #outer + (0 0 0); +#X text 10 494 GridFlow 0.8.0; +#X text 15 2 color_correction.pd; +#X obj 29 100 #outer + (0 0 0); +#X msg 59 266 load teapot.png; #X connect 3 0 8 0; #X connect 3 1 4 0; #X connect 4 0 1 0; #X connect 5 0 8 1; -#X connect 7 0 12 0; +#X connect 7 0 11 0; #X connect 7 0 4 1; -#X connect 7 0 40 1; -#X connect 8 0 40 0; -#X connect 9 0 13 0; -#X connect 10 0 46 0; -#X connect 11 0 5 0; -#X connect 12 0 3 0; -#X connect 13 0 10 0; -#X connect 13 0 27 0; -#X connect 14 0 11 0; -#X connect 15 0 19 1; -#X connect 19 0 20 0; -#X connect 19 1 39 0; -#X connect 19 2 23 0; -#X connect 20 0 7 0; +#X connect 7 0 39 1; +#X connect 8 0 39 0; +#X connect 9 0 12 0; +#X connect 10 0 45 0; +#X connect 11 0 3 0; +#X connect 12 0 10 0; +#X connect 12 0 26 0; +#X connect 13 0 46 0; +#X connect 14 0 18 1; +#X connect 18 0 19 0; +#X connect 18 1 38 0; +#X connect 18 2 22 0; +#X connect 19 0 7 0; +#X connect 20 0 19 0; #X connect 21 0 20 0; #X connect 22 0 21 0; -#X connect 23 0 22 0; -#X connect 24 0 3 1; -#X connect 27 0 34 0; -#X connect 28 0 27 1; -#X connect 31 0 35 0; -#X connect 31 0 36 0; -#X connect 31 0 37 0; -#X connect 32 0 31 0; -#X connect 32 0 33 0; -#X connect 33 0 38 0; -#X connect 34 0 8 1; -#X connect 35 0 7 1; -#X connect 36 0 7 2; -#X connect 37 0 7 3; -#X connect 38 0 7 4; -#X connect 39 0 20 0; -#X connect 40 0 1 0; -#X connect 46 0 19 0; +#X connect 23 0 3 1; +#X connect 26 0 33 0; +#X connect 27 0 26 1; +#X connect 30 0 34 0; +#X connect 30 0 35 0; +#X connect 30 0 36 0; +#X connect 31 0 30 0; +#X connect 31 0 32 0; +#X connect 32 0 37 0; +#X connect 33 0 8 1; +#X connect 34 0 7 1; +#X connect 35 0 7 2; +#X connect 36 0 7 3; +#X connect 37 0 7 4; +#X connect 38 0 19 0; +#X connect 39 0 1 0; +#X connect 45 0 18 0; +#X connect 46 0 5 0; diff --git a/externals/gridflow/pd_examples/cross_fade.pd b/externals/gridflow/pd_examples/cross_fade.pd index f7af6195..1656b935 100644 --- a/externals/gridflow/pd_examples/cross_fade.pd +++ b/externals/gridflow/pd_examples/cross_fade.pd @@ -1,73 +1,74 @@ -#N canvas 401 101 681 500 10; -#X obj 33 191 # *>>8; -#X text 60 235 first picture plus a fraction of the difference; -#X obj 33 233 # +; -#X obj 33 170 #store; -#X obj 264 103 # inv+; -#X obj 88 254 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +#N canvas 397 101 680 501 10; +#X obj 13 229 # *>>8; +#X text 40 293 first picture plus a fraction of the difference; +#X obj 13 291 # +; +#X obj 13 210 #store; +#X obj 211 157 # inv+; +#X obj 68 311 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X text 152 324 note: the #layer/#join objects can make the crossfade +#X text 12 372 note: the #layer/#join objects can make the crossfade process simpler but it's still not faster.; -#X obj 50 -30 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 -; -#X msg 309 72 open r001.jpg \, cast int16 \, bang; -#X obj 283 72 #in; -#X obj 33 149 #finished; -#X text 109 257 click to clip out-of-range colours; -#X text 82 190 multiply by a N/256 fraction; -#X obj 81 295 # max 0; -#X obj 264 51 #in; -#X obj 81 274 # min 255; -#X obj 33 326 #out window; -#X obj 33 109 #cast int16; -#X text 81 170 keep the difference between both pictures; -#X msg 290 51 open b001.jpg \, cast int16 \, bang; -#X obj 290 31 t b b; -#X obj 330 31 loadbang; -#X obj 33 253 shunt 2; -#X obj 50 -5 metro 33.3667; -#X obj 50 15 float; -#X obj 62 44 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +#X obj 13 46 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 264 130 #in; +#X obj 13 191 #finished; +#X text 85 311 click to clip out-of-range colours; +#X text 60 229 multiply by a N/256 fraction; +#X obj 211 111 #in; +#X obj 13 353 #out window; +#X obj 13 153 #cast int16; +#X text 61 213 keep the difference between both pictures; +#X obj 249 91 t b b; +#X obj 249 72 loadbang; +#X obj 13 310 shunt 2; +#X obj 13 63 metro 33.3667; +#X obj 13 82 float; +#X obj 25 101 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; -#X obj 94 14 + 4; -#X obj 50 65 pingpong 256; -#X obj 61 87 hsl 129 15 0 256 0 0 empty empty empty -2 -6 0 8 -260818 +#X obj 52 82 + 4; +#X obj 13 117 pingpong 256; +#X obj 21 136 hsl 129 15 0 256 0 0 empty empty empty -2 -6 0 8 -260818 -1 -1 0 1; -#X obj 33 128 t a a; -#X text 153 362 also #draw_image/#join is a possibility; -#X obj 0 -77 cnv 15 680 30 empty empty empty 20 12 0 14 -233017 -66577 +#X obj 13 172 t a a; +#X text 11 406 also #draw_image/#join is a possibility; +#X obj 0 1 cnv 15 680 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 14 -64 Copyright 2002 Mathieu Bouchard; -#X text 14 -80 cross_fade.pd; -#X obj 0 391 cnv 15 680 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 14 14 Copyright 2002 Mathieu Bouchard; +#X text 14 -2 cross_fade.pd; +#X obj 0 469 cnv 15 680 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text 8 399 GridFlow 0.8.0; +#X text 8 477 GridFlow 0.8.0; +#X obj 57 329 #clip; +#X msg 237 111 load b001.jpg; +#X msg 289 130 load r001.jpg; +#X obj 264 149 #cast s; +#X obj 211 130 #cast s; #X connect 0 0 2 0; -#X connect 2 0 22 0; +#X connect 2 0 18 0; #X connect 3 0 0 0; #X connect 4 0 3 1; -#X connect 5 0 22 1; -#X connect 7 0 23 0; -#X connect 8 0 9 0; -#X connect 9 0 4 1; -#X connect 10 0 3 0; -#X connect 13 0 16 0; -#X connect 14 0 4 0; -#X connect 14 0 2 1; -#X connect 15 0 13 0; -#X connect 17 0 29 0; -#X connect 19 0 14 0; -#X connect 20 0 19 0; -#X connect 20 1 8 0; -#X connect 21 0 20 0; -#X connect 22 0 16 0; -#X connect 22 1 15 0; +#X connect 5 0 18 1; +#X connect 7 0 19 0; +#X connect 8 0 35 0; +#X connect 9 0 3 0; +#X connect 12 0 36 0; +#X connect 14 0 25 0; +#X connect 16 0 33 0; +#X connect 16 1 34 0; +#X connect 17 0 16 0; +#X connect 18 0 13 0; +#X connect 18 1 32 0; +#X connect 19 0 20 0; +#X connect 20 0 21 0; +#X connect 20 0 22 0; +#X connect 20 0 23 0; +#X connect 22 0 20 1; #X connect 23 0 24 0; -#X connect 24 0 25 0; -#X connect 24 0 26 0; -#X connect 24 0 27 0; -#X connect 26 0 24 1; -#X connect 27 0 28 0; -#X connect 27 0 17 0; -#X connect 29 0 10 0; -#X connect 29 1 0 1; +#X connect 23 0 14 0; +#X connect 25 0 9 0; +#X connect 25 1 0 1; +#X connect 32 0 13 0; +#X connect 33 0 12 0; +#X connect 34 0 8 0; +#X connect 35 0 4 1; +#X connect 36 0 4 0; +#X connect 36 0 2 1; diff --git a/externals/gridflow/pd_examples/drag_rectangle.pd b/externals/gridflow/pd_examples/drag_rectangle.pd index 3453c9a8..ab0d8ea8 100644 --- a/externals/gridflow/pd_examples/drag_rectangle.pd +++ b/externals/gridflow/pd_examples/drag_rectangle.pd @@ -1,15 +1,15 @@ #N canvas 702 123 647 484 10; -#X obj 231 -7 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +#X obj 231 -7 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 ; #X obj 231 117 #out window; #X obj 21 144 hsl 128 15 0 319 0 0 h_end_o h_end_i empty -2 -8 1 10 --262144 -1 -1 12700 1; +-262144 -1 -1 0 1; #X obj 21 -4 hsl 128 15 0 319 0 0 h_start_o h_start_i empty 0 8 1 10 -262144 -66577 -258699 0 0; #X obj 3 13 vsl 15 128 239 0 0 0 v_start_o v_start_i empty 0 -8 1 10 --262144 -1 -1 12647 1; +-262144 -1 -1 0 1; #X obj 151 13 vsl 15 128 239 0 0 0 v_end_o v_end_i empty 0 -8 1 10 --262144 -1 -1 425 1; +-262144 -1 -1 0 1; #N canvas 504 374 452 302 make_rectangle 0; #X obj 27 16 inlet; #X text 25 -3 image; @@ -45,21 +45,20 @@ #X obj 393 25 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 315 117 #mouse \, ...; -#X obj 260 266 listelement 0; +#X obj 260 268 listelement 0; #X obj 367 190 listelement 1; #X obj 260 225 listelement 0; #X obj 368 149 listelement 1; -#X obj 368 170 s h_start_i; -#X obj 367 211 s h_end_i; +#X obj 368 168 s h_start_i; +#X obj 367 209 s h_end_i; #X obj 260 287 s v_end_i; -#X obj 260 246 s v_start_i; +#X obj 260 244 s v_start_i; #X obj 378 65 loadbang; -#X msg 378 85 0 0; +#X msg 378 84 0 0; #X obj 328 161 t a; -#X obj 64 330 #out window; -#X obj 47 267 #for ( 0 0 ) ( 0 0 ) ( 1 1 ); -#X obj 112 221 t b a; -#X obj 64 294 #store; +#X obj 47 322 #out window; +#X obj 86 221 t b a; +#X obj 47 286 #store; #X msg 48 243 set ( \$1 \$2 ); #X obj 327 43 #in b001.jpg; #X text 30 35 drag the mouse; @@ -67,7 +66,7 @@ #X text 39 51 inside the; #X text 37 66 first window; #X text 218 -25 step 1: turn on; -#X text 69 312 cropping (to 2nd window); +#X text 52 304 cropping (to 2nd window); #X obj -41 373 cnv 15 640 30 empty empty empty 20 12 0 14 -200249 -66577 0; #X text -33 380 GridFlow 0.8.0; @@ -76,21 +75,22 @@ 0; #X text -27 -64 Copyright 2002 Mathieu Bouchard; #X text -27 -77 drag_rectangle.pd; +#X obj 47 267 #for (0 0) (0 0) (1 1); #X connect 0 0 7 0; #X connect 1 0 13 0; #X connect 6 0 1 0; #X connect 7 0 11 0; -#X connect 10 0 30 0; +#X connect 10 0 29 0; #X connect 11 0 6 0; -#X connect 12 0 30 0; +#X connect 12 0 29 0; #X connect 13 0 6 1; #X connect 13 0 16 0; #X connect 13 0 17 0; -#X connect 13 0 29 0; +#X connect 13 0 28 0; #X connect 13 0 24 0; #X connect 13 1 24 0; #X connect 13 2 24 0; -#X connect 13 2 27 0; +#X connect 13 2 26 0; #X connect 14 0 20 0; #X connect 15 0 19 0; #X connect 16 0 21 0; @@ -101,10 +101,10 @@ #X connect 24 0 14 0; #X connect 24 0 15 0; #X connect 24 0 6 2; -#X connect 26 0 28 0; -#X connect 27 0 26 0; -#X connect 27 1 26 1; -#X connect 28 0 25 0; -#X connect 29 0 26 0; -#X connect 30 0 11 1; -#X connect 30 0 28 1; +#X connect 26 0 42 0; +#X connect 26 1 42 1; +#X connect 27 0 25 0; +#X connect 28 0 42 0; +#X connect 29 0 11 1; +#X connect 29 0 27 1; +#X connect 42 0 27 0; diff --git a/externals/gridflow/pd_examples/eclipse.pd b/externals/gridflow/pd_examples/eclipse.pd index 65ef9ef3..0c94440b 100644 --- a/externals/gridflow/pd_examples/eclipse.pd +++ b/externals/gridflow/pd_examples/eclipse.pd @@ -1,37 +1,36 @@ #N canvas 623 182 635 533 10; -#X floatatom 292 323 5 0 0 0 - - -; -#X msg 244 303 24; +#X floatatom 242 293 5 0 0 0 - - -; +#X msg 194 273 24; #X obj 61 -35 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 ; -#X obj 244 281 loadbang; -#X msg 292 303 32; -#X floatatom 244 323 5 0 0 0 - - -; +#X obj 194 251 loadbang; +#X msg 242 273 32; +#X floatatom 194 293 5 0 0 0 - - -; #X obj 38 17 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 -6 metro 33.3667; -#X text 239 258 size of subimages; -#X obj 61 111 t a a a; -#X obj 61 166 t a a; -#X text 224 54 gain on colour blue; +#X text 189 228 size of subimages; +#X obj 61 144 t a a; +#X text 204 44 gain on colour blue; #X obj 61 17 #camera; -#X obj 61 73 #scale_by 2; -#X obj 141 97 #dim; -#X obj 141 117 #inner (3 2 # 1 0 0 1 0 0); -#X obj 61 147 #finished; -#X obj 61 211 # /; -#X obj 61 234 # *; -#X obj 58 265 #store; -#X obj 70 311 # *; -#X obj 70 334 # >> 7; -#X obj 70 356 # min 255; -#X obj 70 378 #out window; -#X obj 244 343 #pack 2; -#X obj 141 242 # /; -#X obj 107 265 #store; -#X obj 107 242 # *; -#X obj 61 186 #for (0 0) (240 320) (1 1); -#X obj 107 208 #for (0 0) (240 320) (1 1); -#X obj 61 54 # *>>8 (256 256 384); +#X obj 61 63 #scale_by 2; +#X obj 141 119 #dim; +#X obj 141 139 #inner (3 2 # 1 0 0 1 0 0); +#X obj 61 125 #finished; +#X obj 61 183 # /; +#X obj 61 202 # *; +#X obj 61 229 #store; +#X obj 61 256 # *; +#X obj 61 275 # >> 7; +#X obj 61 294 # min 255; +#X obj 61 313 #out window; +#X obj 194 313 #pack 2; +#X obj 141 206 # /; +#X obj 107 229 #store; +#X obj 107 206 # *; +#X obj 61 164 #for (0 0) (240 320) (1 1); +#X obj 107 186 #for (0 0) (240 320) (1 1); +#X obj 61 44 # *>>8 (256 256 384); #X obj 1 418 cnv 15 640 30 empty empty empty 20 12 0 14 -200249 -66577 0; #X text 9 425 GridFlow 0.8.0; @@ -41,40 +40,41 @@ #X text 16 -72 Copyright 2002 Mathieu Bouchard; #X text 121 17 <-- open this; #X text 16 -85 eclipse.pd; -#X connect 0 0 24 1; +#X obj 61 102 t a a; +#X connect 0 0 23 1; #X connect 1 0 5 0; #X connect 2 0 7 0; #X connect 3 0 4 0; #X connect 3 0 1 0; #X connect 4 0 0 0; -#X connect 5 0 24 0; -#X connect 6 0 12 0; -#X connect 7 0 12 0; -#X connect 9 0 16 0; -#X connect 9 1 14 0; -#X connect 9 1 19 1; -#X connect 9 1 26 1; -#X connect 10 0 28 0; -#X connect 10 1 29 0; -#X connect 12 0 30 0; -#X connect 13 0 9 0; -#X connect 14 0 15 0; -#X connect 15 0 25 0; -#X connect 15 0 28 1; -#X connect 15 0 29 1; -#X connect 16 0 10 0; +#X connect 5 0 23 0; +#X connect 6 0 11 0; +#X connect 7 0 11 0; +#X connect 9 0 27 0; +#X connect 9 1 28 0; +#X connect 11 0 29 0; +#X connect 12 0 37 0; +#X connect 13 0 14 0; +#X connect 14 0 24 0; +#X connect 14 0 27 1; +#X connect 14 0 28 1; +#X connect 15 0 9 0; +#X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 19 0 20 0; #X connect 20 0 21 0; #X connect 21 0 22 0; -#X connect 22 0 23 0; -#X connect 24 0 17 1; -#X connect 24 0 18 1; -#X connect 24 0 25 1; -#X connect 25 0 27 1; -#X connect 26 0 20 1; -#X connect 27 0 26 0; -#X connect 28 0 17 0; -#X connect 29 0 27 0; -#X connect 30 0 13 0; +#X connect 23 0 16 1; +#X connect 23 0 17 1; +#X connect 23 0 24 1; +#X connect 24 0 26 1; +#X connect 25 0 19 1; +#X connect 26 0 25 0; +#X connect 27 0 16 0; +#X connect 28 0 26 0; +#X connect 29 0 12 0; +#X connect 37 0 15 0; +#X connect 37 1 13 0; +#X connect 37 1 18 1; +#X connect 37 1 25 1; diff --git a/externals/gridflow/pd_examples/epicycloid.pd b/externals/gridflow/pd_examples/epicycloid.pd index c1589de9..000bc8c0 100644 --- a/externals/gridflow/pd_examples/epicycloid.pd +++ b/externals/gridflow/pd_examples/epicycloid.pd @@ -1,125 +1,125 @@ -#N canvas 443 76 1178 736 10; -#X text 18 93 epicycloid; -#X text 18 116 x(t) = (R+r) cos(t) - p*cos((R+r)t/r); -#X text 18 140 y(t) = (R+r) sin(t) - p*sin((R+r)t/r); -#X obj 38 383 #draw_polygon put 1; -#X obj 287 438 #import ( 4 2 ); -#X obj 38 406 #out window; -#X obj -22 -22 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +#N canvas 301 73 904 550 10; +#X text 158 43 epicycloid; +#X text 168 56 x(t) = (R+r) cos(t) - p*cos((R+r)t/r); +#X text 168 69 y(t) = (R+r) sin(t) - p*sin((R+r)t/r); +#X obj 24 273 #draw_polygon put 1; +#X obj 24 292 #out window; +#X obj -22 68 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 ; -#X obj 327 375 pack f f f f; -#X msg 327 404 \$2 \$1 \$4 \$1 \$4 \$3 \$2 \$3; -#X text 334 350 x; -#X text 394 352 y; -#X text 421 354 y+1; -#X text 357 352 x+1; -#X floatatom 327 327 5 0 0 0 - - -; -#X obj 369 325 + 1; -#X floatatom 405 327 5 0 0 0 - - -; -#X obj 447 324 + 1; -#X obj 332 297 t f f; -#X obj 417 297 t f f; -#X obj 0 50 s met; -#X obj 286 350 r met; -#X obj 468 97 hsl 128 15 5 100 0 1 empty empty empty -2 -6 0 8 -24198 +#X obj 297 428 pack f f f f; +#X msg 297 447 \$2 \$1 \$4 \$1 \$4 \$3 \$2 \$3; +#X text 304 403 x; +#X text 364 405 y; +#X text 391 407 y+1; +#X text 327 405 x+1; +#X floatatom 303 381 5 0 0 0 - - -; +#X obj 345 379 + 1; +#X floatatom 390 382 5 0 0 0 - - -; +#X obj 432 379 + 1; +#X obj 303 358 t f f; +#X obj 390 361 t f f; +#X obj -16 108 s met; +#X obj 258 428 r met; +#X obj 388 197 hsl 128 15 5 100 0 1 empty empty empty -2 -6 0 8 -24198 -1 -1 5500 1; -#X obj 585 148 hsl 128 15 -100 100 0 1 empty empty empty -2 -6 0 8 +#X obj 515 238 hsl 128 15 -100 100 0 1 empty empty empty -2 -6 0 8 -44926 -1 -1 4000 1; -#X obj 732 173 hsl 128 15 -150 150 0 1 empty empty empty -2 -6 0 8 +#X obj 665 263 hsl 128 15 -150 150 0 1 empty empty empty -2 -6 0 8 -258699 -1 -1 3200 1; -#X text 439 52 t = valeur en angles de 0 a 360; -#X obj 465 153 t f f; -#X obj 582 180 t f f; -#X obj 729 193 t f f; -#X obj 333 127 * 6.28319; -#X obj 333 106 / 360; -#X floatatom 333 88 5 0 0 0 - - -; -#X obj 333 152 t f f; -#X obj -22 355 #store; -#X obj 15 205 loadbang; -#X obj 420 250 expr ($f2+$f3)*sin($f1) - $f4*sin(($f2+$f3)*$f1/$f3) +#X text 313 155 t = valeur en angles de 0 a 360; +#X obj 385 241 t f f; +#X obj 512 270 t f f; +#X obj 662 283 t f f; +#X obj 303 217 * 6.28319; +#X obj 303 196 / 360; +#X floatatom 303 178 5 0 0 0 - - -; +#X obj 303 236 t f f; +#X obj -22 273 #store; +#X obj -14 129 loadbang; +#X obj 390 323 expr ($f2+$f3)*sin($f1) - $f4*sin(($f2+$f3)*$f1/$f3) ; -#X obj 333 212 expr ($f2+$f3)*cos($f1) - $f4*cos(($f2+$f3)*$f1/$f3) +#X obj 303 302 expr ($f2+$f3)*cos($f1) - $f4*cos(($f2+$f3)*$f1/$f3) ; -#X obj 333 65 + 1; -#X msg 333 41 1; -#X floatatom 375 65 5 0 0 0 - - -; -#X msg 375 16 0; -#X text 406 19 reset count; -#X text 129 231 reset image; -#X text 540 126 r = Rayon du deuxieme cercle -100 a 100; -#X obj 420 275 + 150; -#X obj 333 272 + 150; -#X floatatom 477 123 5 0 0 0 - - -; -#X floatatom 633 173 5 0 0 0 - - -; -#X floatatom 779 196 5 0 0 0 - - -; -#X obj -22 7 metro 1; -#X obj 33 -21 hsl 128 15 0 15 0 0 empty empty empty -2 -6 0 8 -260818 +#X obj 303 135 + 1; +#X msg 303 111 1; +#X floatatom 335 138 5 0 0 0 - - -; +#X msg 335 119 0; +#X text 366 122 reset count; +#X text 100 147 reset image; +#X text 470 216 r = Rayon du deuxieme cercle -100 a 100; +#X obj 390 342 + 150; +#X obj 303 339 + 150; +#X floatatom 397 223 5 0 0 0 - - -; +#X floatatom 563 263 5 0 0 0 - - -; +#X floatatom 712 286 5 0 0 0 - - -; +#X obj -22 85 metro 1; +#X obj 25 68 hsl 128 15 0 15 0 0 empty empty empty -2 -6 0 8 -260818 -1 -1 0 1; -#X text 440 78 R = Rayon du premier cercle 5 a 100; -#X obj -38 525 cnv 15 900 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 360 178 R = Rayon du premier cercle 5 a 100; +#X obj -38 515 cnv 15 900 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -29 532 GridFlow 0.8.0; -#X text -29 532 GridFlow 0.8.0; -#X obj -35 -85 cnv 15 940 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text -29 522 GridFlow 0.8.0; +#X text -29 522 GridFlow 0.8.0; +#X obj -35 5 cnv 15 800 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X obj 102 317 #color; -#X obj 102 268 loadbang; -#X msg 102 292 230 224 0; -#X msg 15 232 300 300 3 # 0; -#X text -22 -72 Copyright 2004 Alexandre Castonguay; -#X text -22 -85 epicycloid.pd; -#X text 80 204 start with a blank \, black image; -#X text 727 158 deuxieme cercle - 150 a 150; -#X text 727 143 p = distance du centre du; -#X connect 3 0 5 0; -#X connect 3 0 32 1; -#X connect 4 0 3 2; -#X connect 6 0 48 0; -#X connect 7 0 8 0; -#X connect 8 0 4 0; -#X connect 13 0 7 0; -#X connect 14 0 7 2; -#X connect 15 0 7 1; -#X connect 16 0 7 3; -#X connect 17 0 13 0; -#X connect 17 1 14 0; -#X connect 18 0 15 0; -#X connect 18 1 16 0; -#X connect 20 0 7 0; +#X obj 88 213 #color; +#X obj 88 175 loadbang; +#X msg 88 194 230 224 0; +#X msg -14 148 300 300 3 # 0; +#X text -22 18 Copyright 2004 Alexandre Castonguay; +#X text -22 5 epicycloid.pd; +#X text 51 128 start with a blank \, black image; +#X text 660 248 deuxieme cercle - 150 a 150; +#X text 660 233 p = distance du centre du; +#X obj 297 466 #import (4 2); +#X connect 3 0 4 0; +#X connect 3 0 31 1; +#X connect 5 0 47 0; +#X connect 6 0 7 0; +#X connect 7 0 63 0; +#X connect 12 0 6 0; +#X connect 13 0 6 2; +#X connect 14 0 6 1; +#X connect 15 0 6 3; +#X connect 16 0 12 0; +#X connect 16 1 13 0; +#X connect 17 0 14 0; +#X connect 17 1 15 0; +#X connect 19 0 6 0; +#X connect 20 0 24 0; +#X connect 20 0 44 0; #X connect 21 0 25 0; #X connect 21 0 45 0; #X connect 22 0 26 0; #X connect 22 0 46 0; -#X connect 23 0 27 0; -#X connect 23 0 47 0; -#X connect 25 0 35 1; -#X connect 25 1 34 1; -#X connect 26 0 35 2; -#X connect 26 1 34 2; -#X connect 27 0 35 3; -#X connect 27 1 34 3; -#X connect 28 0 31 0; +#X connect 24 0 34 1; +#X connect 24 1 33 1; +#X connect 25 0 34 2; +#X connect 25 1 33 2; +#X connect 26 0 34 3; +#X connect 26 1 33 3; +#X connect 27 0 30 0; +#X connect 28 0 27 0; #X connect 29 0 28 0; -#X connect 30 0 29 0; -#X connect 31 0 35 0; -#X connect 31 1 34 0; -#X connect 32 0 3 0; -#X connect 33 0 58 0; +#X connect 30 0 34 0; +#X connect 30 1 33 0; +#X connect 31 0 3 0; +#X connect 32 0 57 0; +#X connect 33 0 42 0; #X connect 34 0 43 0; -#X connect 35 0 44 0; -#X connect 36 0 38 0; -#X connect 36 0 30 0; -#X connect 37 0 36 0; -#X connect 38 0 36 1; -#X connect 39 0 38 0; -#X connect 43 0 18 0; -#X connect 44 0 17 0; -#X connect 48 0 19 0; -#X connect 48 0 32 0; -#X connect 48 0 37 0; -#X connect 49 0 48 1; -#X connect 55 0 3 1; -#X connect 56 0 57 0; -#X connect 57 0 55 0; -#X connect 58 0 32 1; +#X connect 35 0 37 0; +#X connect 35 0 29 0; +#X connect 36 0 35 0; +#X connect 37 0 35 1; +#X connect 38 0 37 0; +#X connect 42 0 17 0; +#X connect 43 0 16 0; +#X connect 47 0 18 0; +#X connect 47 0 31 0; +#X connect 47 0 36 0; +#X connect 48 0 47 1; +#X connect 54 0 3 1; +#X connect 55 0 56 0; +#X connect 56 0 54 0; +#X connect 57 0 31 1; +#X connect 63 0 3 2; diff --git a/externals/gridflow/pd_examples/feedback_fractal.pd b/externals/gridflow/pd_examples/feedback_fractal.pd index 2d012a78..abb70e80 100644 --- a/externals/gridflow/pd_examples/feedback_fractal.pd +++ b/externals/gridflow/pd_examples/feedback_fractal.pd @@ -20,128 +20,128 @@ #X connect 6 0 8 0; #X connect 8 0 0 0; #X connect 9 0 2 0; -#X restore 462 229 pd experimental features; -#X text 527 134 Choose Julia Mapping or Rotation; -#X obj 31 -34 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 -; -#X obj 414 67 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X restore 545 260 pd experimental features; +#X text 515 193 Choose Julia Mapping or Rotation; +#X obj 31 53 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X obj 414 145 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X text 190 59 apply transform (with feedback); -#X floatatom 454 281 5 0 0 0 - - -; -#X floatatom 451 323 5 0 0 0 - - -; -#X msg 84 319 cast uint8 \, bang; -#X text 530 281 zoom; -#X text 531 324 move x; -#X msg 501 324 -45; -#X msg 501 281 128; -#X obj 170 60 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X text 135 196 apply transform (with feedback); +#X floatatom 430 363 5 0 0 0 - - -; +#X floatatom 518 387 5 0 0 0 - - -; +#X text 434 375 zoom; +#X text 518 397 move x; +#X msg 518 368 -45; +#X msg 430 344 128; +#X obj 119 197 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X obj 450 92 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 444 119 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X obj 505 133 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +#X obj 497 193 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; -#X floatatom 451 303 5 0 0 0 - - -; -#X text 531 303 move y; -#X msg 501 303 193; -#X obj 31 -7 metro 33.3667; -#X obj 450 131 shunt 2; -#X obj 84 297 loadbang; -#X obj 414 45 t b b; -#X obj 414 21 loadbang; -#X obj 31 276 t a; -#X obj 202 99 loadbang; -#X obj 212 119 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X floatatom 472 387 5 0 0 0 - - -; +#X text 471 398 move y; +#X msg 472 368 193; +#X obj 31 80 metro 33.3667; +#X obj 442 191 shunt 2; +#X obj 77 365 loadbang; +#X obj 414 91 t b b; +#X obj 414 67 loadbang; +#X obj 31 338 t a; +#X obj 131 220 loadbang; +#X obj 131 239 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X obj 200 266 t a; -#X obj 31 21 t b b; -#X obj 73 22 float; -#X obj 73 41 + 1; -#X obj 84 61 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 24 256; -#X obj 508 257 t b; -#X text 230 120 reset transform; -#X obj 99 41 mod 60; -#X obj 73 81 sel 59; -#X obj 31 113 #store; -#X obj 31 189 # << 7; -#X obj 31 223 #fade 10; -#X obj 31 252 # >> 7; -#X obj 31 335 #store; -#X obj 84 340 #in teapot.png; -#X obj 31 364 #out window; -#X obj 414 391 # -; -#X obj 438 367 # - 128; -#X obj 438 345 #two; -#X obj 414 303 # /; -#X obj 414 229 #store; -#X obj 450 110 #for ( -128 -128 ) ( 128 128 ) ( 1 1 ); -#X obj 446 154 @complex_sq; -#X obj 461 175 #inner (2 2 # 120 30 -30 120); -#X obj -13 -87 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +#X obj 119 317 t a; +#X obj 31 108 t b b; +#X obj 73 109 float; +#X obj 73 128 + 1; +#X obj 84 148 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +-262144 -1 -1 57 256; +#X obj 486 323 t b; +#X text 149 240 reset transform; +#X obj 99 128 mod 60; +#X obj 73 168 sel 59; +#X obj 31 200 #store; +#X obj 31 276 # << 7; +#X obj 31 295 #fade 10; +#X obj 31 314 # >> 7; +#X obj 31 422 #store; +#X obj 31 451 #out window; +#X obj 414 478 # -; +#X obj 438 454 # - 128; +#X obj 414 390 # /; +#X obj 414 296 #store; +#X obj 442 172 #for ( -128 -128 ) ( 128 128 ) ( 1 1 ); +#X obj 442 210 @complex_sq; +#X obj 485 229 #inner (2 2 # 120 30 -30 120); +#X obj -13 0 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X obj -15 431 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj -15 518 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 438 GridFlow 0.8.0; -#X text -7 438 GridFlow 0.8.0; -#X text 0 -87 feedback_fractal.pd; -#X text 0 -74 Copyright 2001 Mathieu Bouchard; -#X obj 212 138 #for (0 0) (256 256) (1 1); -#X obj 210 210 #convolve (2 2 # 1); -#X obj 209 232 # >> 2; -#X obj 200 181 #store; -#X obj 200 159 #store; -#X connect 0 0 46 1; -#X connect 2 0 18 0; -#X connect 3 0 46 0; -#X connect 5 0 45 1; -#X connect 7 0 40 0; -#X connect 10 0 6 0; -#X connect 11 0 17 0; -#X connect 11 0 5 0; -#X connect 12 0 60 0; -#X connect 13 0 47 0; -#X connect 14 0 19 1; -#X connect 17 0 15 0; -#X connect 18 0 27 0; -#X connect 19 0 48 0; -#X connect 19 1 49 0; -#X connect 20 0 7 0; -#X connect 21 0 3 0; -#X connect 21 1 13 0; -#X connect 21 1 31 0; -#X connect 22 0 21 0; -#X connect 23 0 39 0; -#X connect 24 0 56 0; -#X connect 25 0 56 0; -#X connect 26 0 35 1; -#X connect 26 0 59 1; -#X connect 27 0 35 0; -#X connect 27 1 28 0; +#X text -7 525 GridFlow 0.8.0; +#X text -7 525 GridFlow 0.8.0; +#X text 0 0 feedback_fractal.pd; +#X text 0 13 Copyright 2001 Mathieu Bouchard; +#X obj 131 258 #for (0 0) (256 256) (1 1); +#X obj 119 298 #store; +#X obj 119 279 #store; +#X obj 77 422 #cast b; +#X obj 77 403 #in; +#X msg 77 384 load teapot.png; +#X obj 438 432 #pack; +#X text 431 145 apply coords; +#X text 462 118 apply type of transform; +#X connect 0 0 43 1; +#X connect 2 0 17 0; +#X connect 3 0 43 0; +#X connect 5 0 42 1; +#X connect 6 0 59 1; +#X connect 9 0 6 0; +#X connect 10 0 5 0; +#X connect 11 0 55 0; +#X connect 12 0 44 0; +#X connect 13 0 18 1; +#X connect 14 0 59 0; +#X connect 16 0 14 0; +#X connect 17 0 26 0; +#X connect 18 0 45 0; +#X connect 18 1 46 0; +#X connect 19 0 58 0; +#X connect 20 0 3 0; +#X connect 20 1 12 0; +#X connect 20 1 30 0; +#X connect 21 0 20 0; +#X connect 22 0 38 0; +#X connect 23 0 24 0; +#X connect 24 0 53 0; +#X connect 25 0 34 1; +#X connect 25 0 54 1; +#X connect 26 0 34 0; +#X connect 26 1 27 0; +#X connect 27 0 28 0; #X connect 28 0 29 0; -#X connect 29 0 30 0; -#X connect 29 0 33 0; -#X connect 29 0 34 0; -#X connect 31 0 11 0; -#X connect 31 0 17 0; -#X connect 31 0 10 0; -#X connect 33 0 28 1; -#X connect 34 0 12 0; +#X connect 28 0 32 0; +#X connect 28 0 33 0; +#X connect 30 0 10 0; +#X connect 30 0 16 0; +#X connect 30 0 9 0; +#X connect 32 0 27 1; +#X connect 33 0 11 0; +#X connect 34 0 35 0; #X connect 35 0 36 0; #X connect 36 0 37 0; -#X connect 37 0 38 0; -#X connect 38 0 23 0; -#X connect 39 0 41 0; -#X connect 40 0 39 1; -#X connect 42 0 60 1; -#X connect 43 0 42 1; -#X connect 45 0 42 0; -#X connect 46 0 45 0; -#X connect 47 0 19 0; -#X connect 48 0 46 1; -#X connect 49 0 46 1; -#X connect 56 0 35 1; -#X connect 56 0 59 1; -#X connect 57 0 58 0; -#X connect 58 0 26 0; -#X connect 59 0 26 0; -#X connect 60 0 59 0; +#X connect 37 0 22 0; +#X connect 38 0 39 0; +#X connect 40 0 55 1; +#X connect 41 0 40 1; +#X connect 42 0 40 0; +#X connect 43 0 42 0; +#X connect 44 0 18 0; +#X connect 45 0 43 1; +#X connect 46 0 43 1; +#X connect 53 0 34 1; +#X connect 53 0 54 1; +#X connect 54 0 25 0; +#X connect 55 0 54 0; +#X connect 56 0 38 1; +#X connect 57 0 56 0; +#X connect 58 0 57 0; diff --git a/externals/gridflow/pd_examples/fire.pd b/externals/gridflow/pd_examples/fire.pd index 2a88a3a0..2e9f8606 100644 --- a/externals/gridflow/pd_examples/fire.pd +++ b/externals/gridflow/pd_examples/fire.pd @@ -1,51 +1,45 @@ -#N canvas 399 42 621 522 10; -#X obj 347 171 loadbang; -#X text 229 287 palette generator; -#X obj 103 329 fps detailed; -#X obj 250 325 #for 0 256 1; -#X obj 23 180 #store; -#X obj 250 347 #outer gamma; -#X obj 103 351 print; -#X msg 60 130 \$1 \$2 # 0; -#X obj 71 217 #outer ignore ( 0 ); -#X obj 250 304 #finished; -#X obj 23 -25 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 -; -#X obj 204 -21 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 40 71 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#N canvas 55 53 634 527 10; +#X obj 377 355 loadbang; +#X text 243 362 palette generator; +#X obj 100 383 fps detailed; +#X obj 264 400 #for 0 256 1; +#X obj 19 240 #store; +#X obj 264 422 #outer gamma; +#X obj 100 402 print; +#X msg 56 200 \$1 \$2 # 0; +#X obj 264 379 #finished; +#X obj 19 35 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X obj 200 39 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 318 304 fork; -#X text 262 2 height width; -#X obj 103 307 #out window; -#X text 101 269 applying palette; -#X obj 103 287 #store; -#N canvas 268 454 450 300 circle 0; -#X obj 47 177 #fold +; -#X obj 47 244 # << 7; -#X obj 47 199 # >> 6; -#X obj 47 157 @! sq; -#X obj 47 222 # == 10; +#X obj 332 379 fork; +#X text 258 62 height width; +#X obj 100 364 #out window; +#X text 97 308 applying palette; +#X obj 99 326 #store; +#N canvas 127 200 450 300 circle 0; +#X obj 47 146 #fold +; +#X obj 47 203 # << 7; +#X obj 47 165 # >> 6; +#X obj 47 184 # == 10; #X obj 47 15 inlet size; -#X obj 47 267 outlet matrix; -#X obj 47 126 #for ( 0 0 ) ( 0 0 ) ( 1 1 ); -#X obj 47 34 # / 2; -#X obj 47 77 t a a; -#X obj 47 54 #export_list; -#X obj 47 101 # inv+; +#X obj 47 222 outlet matrix; +#X obj 77 108 inlet pos; +#X obj 47 53 t b a; +#X obj 47 127 # sq-; +#X obj 47 79 #for (0 0) (0 0) (1 1); +#X obj 90 53 #export_list; #X connect 0 0 2 0; -#X connect 1 0 6 0; -#X connect 2 0 4 0; -#X connect 3 0 0 0; -#X connect 4 0 1 0; -#X connect 5 0 8 0; -#X connect 7 0 3 0; -#X connect 8 0 10 0; -#X connect 9 0 11 0; -#X connect 9 1 7 1; -#X connect 10 0 9 0; -#X connect 11 0 7 0; -#X restore 247 84 pd circle generator; +#X connect 1 0 5 0; +#X connect 2 0 3 0; +#X connect 3 0 1 0; +#X connect 4 0 7 0; +#X connect 6 0 8 1; +#X connect 7 0 9 0; +#X connect 7 1 10 0; +#X connect 8 0 0 0; +#X connect 9 0 8 0; +#X connect 10 0 9 1; +#X restore 222 200 pd circle generator; #N canvas 498 387 361 260 baseline 0; #X obj 18 123 #fold +; #X obj 127 149 - 4; @@ -75,23 +69,17 @@ #X connect 12 0 2 0; #X connect 12 1 9 0; #X connect 12 1 8 1; -#X restore 204 117 pd baseline generator; -#X text 78 236 (height \, width \, 1) grid = grey image; -#X text 49 113 make blank image; -#X text 30 163 feedback loop; -#X text 78 200 (height \, width) grid = matrix; -#X obj 204 63 shunt 2; -#X obj 258 64 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 -; -#X obj 347 213 #color 0 800 1; -#X msg 347 191 600 200 75; -#X obj 224 -22 loadbang; -#N canvas 645 360 400 289 fire 1; +#X restore 200 220 pd baseline generator; +#X text 45 183 make blank image; +#X text 26 223 feedback loop; +#X obj 377 393 #color 0 800 1; +#X msg 377 374 600 200 75; +#X obj 220 38 loadbang; +#N canvas 645 360 400 289 fire 0; #X obj 174 180 #store; #X obj 61 196 #export_list; #X obj 6 65 # >> 2; #X obj 6 26 fork; -#X obj 6 45 #convolve ( 3 3 # 1 0 0 0 1 0 1 1 1 ); #X obj 6 235 # & 255; #X obj 174 115 listmake; #X obj 6 103 # / 80; @@ -114,67 +102,188 @@ #X text 264 180 random numbers; #X obj 174 159 # rand; #X obj 274 123 # rand; -#X connect 0 0 17 1; -#X connect 1 0 6 1; -#X connect 2 0 17 0; -#X connect 3 0 4 0; -#X connect 3 1 10 0; -#X connect 4 0 2 0; -#X connect 5 0 15 0; -#X connect 6 0 8 0; -#X connect 7 0 14 0; -#X connect 8 0 24 0; -#X connect 9 0 6 0; -#X connect 10 0 9 0; -#X connect 11 0 14 1; -#X connect 11 0 13 0; -#X connect 12 0 0 1; -#X connect 13 0 1 0; -#X connect 14 0 5 0; -#X connect 16 0 25 0; -#X connect 17 0 7 0; -#X connect 18 0 3 0; -#X connect 19 0 16 0; -#X connect 24 0 0 0; -#X connect 25 0 12 0; -#X restore 71 180 pd fire generator; -#X text 183 46 note: reset the size if you change the generator; -#X msg 204 2 80 256; -#X obj 23 -2 metro 33.3667; -#X obj -15 -84 cnv 15 620 30 empty empty empty 20 12 0 14 -233017 -66577 +#X obj 6 46 #convolve (3 3 # 1 0 0 0 1 0 1 1 1); +#X connect 0 0 16 1; +#X connect 1 0 5 1; +#X connect 2 0 16 0; +#X connect 3 0 25 0; +#X connect 3 1 9 0; +#X connect 4 0 14 0; +#X connect 5 0 7 0; +#X connect 6 0 13 0; +#X connect 7 0 23 0; +#X connect 8 0 5 0; +#X connect 9 0 8 0; +#X connect 10 0 13 1; +#X connect 10 0 12 0; +#X connect 11 0 0 1; +#X connect 12 0 1 0; +#X connect 13 0 4 0; +#X connect 15 0 24 0; +#X connect 16 0 6 0; +#X connect 17 0 3 0; +#X connect 18 0 15 0; +#X connect 23 0 0 0; +#X connect 24 0 11 0; +#X connect 25 0 2 0; +#X restore 65 240 pd fire generator; +#X text 166 108 note: reset the size if you change the generator; +#X obj 19 58 metro 33.3667; +#X obj 5 -4 cnv 15 620 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text -5 -84 fire.pd; -#X text -5 -71 Copyright 2001 Mathieu Bouchard; -#X obj -15 403 cnv 15 620 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 15 -4 fire.pd; +#X obj 5 483 cnv 15 620 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 411 GridFlow 0.8.0; -#X text -7 411 GridFlow 0.8.0; -#X connect 0 0 27 0; +#X text 13 491 GridFlow 0.8.0; +#X obj 139 402 route position; +#N canvas 268 301 442 406 cursor 0; +#X obj 30 29 listmake; +#X obj 107 48 listsublist 0 2; +#X obj 107 10 inlet; +#X obj 132 151 listsublist 0 48; +#X obj 30 49 fork; +#X obj 30 285 outlet; +#X obj 30 131 @export_list; +#X obj 30 151 listappend 0 0; +#X obj 107 29 #export_list; +#X obj 30 79 # -; +#X obj 115 86 #finished; +#X obj 115 105 #store (0 0); +#X obj 30 170 #redim (25 2); +#X obj 30 189 # sq-; +#X obj 30 208 #fold +; +#X obj 30 227 # sqrt; +#X obj 30 246 #fold +; +#X obj 30 266 # / 5; +#X obj 30 9 r metro; +#X connect 0 0 4 0; +#X connect 1 0 0 1; +#X connect 2 0 8 0; +#X connect 3 0 7 1; +#X connect 4 0 9 0; +#X connect 4 1 11 1; +#X connect 6 0 7 0; +#X connect 7 0 3 0; +#X connect 7 0 12 0; +#X connect 8 0 1 0; +#X connect 9 0 6 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 9 1; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 17 0; +#X connect 17 0 5 0; +#X connect 18 0 0 0; +#X restore 371 162 pd cursor motion detector; +#X obj 139 460 s cursor; +#X msg 20 341 hidecursor; +#N canvas 238 140 484 503 fuzzy 0; +#X obj 47 281 outlet; +#X obj 229 74 listsublist 0 2; +#X obj 47 110 @fold +; +#X obj 47 68 #for (0 0) (0 0) (1 1); +#X obj 47 13 inlet size; +#X obj 47 32 t b a; +#X obj 86 32 #export_list; +#X obj 47 91 # sq-; +#X obj 47 263 # - 10; +#X obj 47 243 # max 10; +#X obj 47 224 # min 255; +#X obj 47 205 # + 64; +#X obj 47 186 # tanh* 64; +#X obj 47 167 # << 8; +#X obj 47 148 # inv+ 2; +#X obj 47 129 # >> 2; +#X obj 104 125 inlet radius; +#X obj 229 55 #export_list; +#X obj 229 36 inlet pos; +#X connect 1 0 7 1; +#X connect 2 0 15 0; +#X connect 3 0 7 0; +#X connect 4 0 5 0; +#X connect 5 0 3 0; +#X connect 5 1 6 0; +#X connect 6 0 3 1; +#X connect 7 0 2 0; +#X connect 8 0 0 0; +#X connect 9 0 8 0; +#X connect 10 0 9 0; +#X connect 11 0 10 0; +#X connect 12 0 11 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 15 0 14 0; +#X connect 16 0 14 1; +#X connect 17 0 1 0; +#X connect 18 0 17 0; +#X restore 276 181 pd fuzzy disk seed generator; +#X text 177 440 #scale_by compensation; +#X msg 139 421 \$1 \$2; +#X obj 99 345 #scale_by 2; +#X obj 139 440 # / 2; +#X text 15 294 (height \, width \, 1) grid = grey image; +#X text 16 260 (height \, width) grid = matrix; +#X obj 200 123 shunt 3; +#X obj 253 125 hradio 15 1 0 3 empty empty empty 0 -6 0 8 -241291 -1 +-1 1; +#X obj 500 203 r cursor; +#X obj 501 222 t a; +#X obj 204 90 listmake; +#X obj 58 86 spigot; +#X obj 19 86 t b b; +#X obj 104 87 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1 +; +#X msg 200 62 120 160; +#X obj 49 109 s metro; +#X obj 67 277 #outer ignore (0); +#X text 15 9 Copyright 2001 \, 2005 Mathieu Bouchard; +#X connect 0 0 21 0; #X connect 2 0 6 0; #X connect 3 0 5 0; -#X connect 4 0 29 0; -#X connect 5 0 17 1; +#X connect 4 0 23 0; +#X connect 5 0 15 1; #X connect 7 0 4 1; -#X connect 8 0 17 0; -#X connect 9 0 3 0; -#X connect 10 0 32 0; -#X connect 11 0 31 0; -#X connect 12 0 4 0; -#X connect 13 0 9 0; -#X connect 13 1 5 1; -#X connect 15 0 2 0; -#X connect 17 0 15 0; -#X connect 18 0 29 1; -#X connect 19 0 29 1; -#X connect 24 0 19 0; -#X connect 24 1 18 0; -#X connect 25 0 24 1; -#X connect 26 0 13 0; -#X connect 27 0 26 0; -#X connect 28 0 31 0; -#X connect 29 0 8 0; -#X connect 29 0 4 1; -#X connect 31 0 7 0; -#X connect 31 0 29 2; -#X connect 31 0 24 0; -#X connect 32 0 4 0; +#X connect 8 0 3 0; +#X connect 9 0 25 0; +#X connect 10 0 49 0; +#X connect 11 0 8 0; +#X connect 11 1 5 1; +#X connect 13 0 2 0; +#X connect 13 0 30 0; +#X connect 15 0 37 0; +#X connect 16 0 23 1; +#X connect 17 0 23 1; +#X connect 20 0 11 0; +#X connect 21 0 20 0; +#X connect 22 0 49 0; +#X connect 23 0 4 1; +#X connect 23 0 51 0; +#X connect 25 0 47 0; +#X connect 30 0 36 0; +#X connect 31 0 34 1; +#X connect 33 0 13 0; +#X connect 34 0 23 1; +#X connect 36 0 38 0; +#X connect 37 0 13 0; +#X connect 38 0 32 0; +#X connect 41 0 17 0; +#X connect 41 1 16 0; +#X connect 41 2 34 0; +#X connect 42 0 41 1; +#X connect 43 0 44 0; +#X connect 44 0 31 0; +#X connect 44 0 16 1; +#X connect 44 0 34 2; +#X connect 45 0 41 0; +#X connect 46 0 45 0; +#X connect 47 0 4 0; +#X connect 47 1 46 0; +#X connect 47 1 50 0; +#X connect 48 0 46 1; +#X connect 49 0 7 0; +#X connect 49 0 23 2; +#X connect 49 0 45 0; +#X connect 51 0 15 0; diff --git a/externals/gridflow/pd_examples/game_of_life.pd b/externals/gridflow/pd_examples/game_of_life.pd index c35187a9..d8820876 100644 --- a/externals/gridflow/pd_examples/game_of_life.pd +++ b/externals/gridflow/pd_examples/game_of_life.pd @@ -1,20 +1,18 @@ -#N canvas 400 83 719 454 10; -#X text 41 -19 click here; -#X obj 23 -17 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 -; -#X obj 31 251 #out window; -#X text 48 92 this is the feedback loop; -#X obj 123 0 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#N canvas 400 83 791 374 10; +#X obj 36 46 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 31 237 #out window; +#X text 48 122 this is the feedback loop; +#X obj 143 50 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 141 -1 for 0 10 1; -#X obj 263 53 loadbang; -#X obj 141 73 #store; -#X obj 141 19 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 161 49 for 0 10 1; +#X obj 262 87 loadbang; +#X obj 141 103 #store; +#X obj 161 68 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 31 291 print; -#X obj 31 271 fps detailed; -#X obj 31 113 fork; -#X text 159 19 next; +#X obj 31 275 print; +#X obj 31 256 fps detailed; +#X obj 31 143 fork; +#X text 179 68 next; #N canvas 0 0 450 210 game 0; #X obj 28 64 inlet matrix; #X obj 28 141 outlet matrix; @@ -29,39 +27,39 @@ but faster to compute.); #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 1 0; -#X restore 31 72 pd game of life; -#X text 260 20 init with a random map; -#X text 262 35 10% white dots; -#X text 33 179 convert this 1-bit matrix to standard RGB \; 1 becomes +#X restore 31 102 pd game of life; +#X text 260 60 init with a random map; +#X text 261 72 10% white dots; +#X text 33 169 convert this 1-bit matrix to standard RGB \; 1 becomes -1 becomes 255 \, but 0 stays 0; -#X obj 23 15 metro 5; -#X obj -15 339 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj 53 45 metro 5; +#X obj 5 329 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 346 GridFlow 0.8.0; -#X text -7 346 GridFlow 0.8.0; -#X obj -13 -85 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 13 336 GridFlow 0.8.0; +#X text 13 336 GridFlow 0.8.0; +#X obj 7 5 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 0 -85 game_of_life.pd; -#X text 0 -72 Copyright 2001 Mathieu Bouchard; -#X obj 263 97 # rand (b #); -#X obj 263 119 # == (b # 0); -#X msg 263 75 240 320 b # 10; -#X obj 31 209 # inv+ (b # 0); -#X obj 31 230 #outer ignore (3 b #); -#X connect 1 0 17 0; -#X connect 2 0 10 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 26 0; -#X connect 7 0 13 0; -#X connect 8 0 7 0; -#X connect 10 0 9 0; -#X connect 11 0 27 0; -#X connect 11 1 7 1; -#X connect 13 0 11 0; -#X connect 17 0 7 0; -#X connect 24 0 25 0; -#X connect 25 0 11 0; -#X connect 26 0 24 0; -#X connect 27 0 28 0; -#X connect 28 0 2 0; +#X text 20 5 game_of_life.pd; +#X text 20 18 Copyright 2001 Mathieu Bouchard; +#X obj 262 125 # rand (b #); +#X obj 262 144 # == (b # 0); +#X msg 262 106 240 320 b # 10; +#X obj 31 199 # inv+ (b # 0); +#X obj 31 218 #outer ignore (3 b #); +#X connect 0 0 16 0; +#X connect 1 0 9 0; +#X connect 3 0 4 0; +#X connect 4 0 7 0; +#X connect 5 0 25 0; +#X connect 6 0 12 0; +#X connect 7 0 6 0; +#X connect 9 0 8 0; +#X connect 10 0 26 0; +#X connect 10 1 6 1; +#X connect 12 0 10 0; +#X connect 16 0 6 0; +#X connect 23 0 24 0; +#X connect 24 0 10 0; +#X connect 25 0 23 0; +#X connect 26 0 27 0; +#X connect 27 0 1 0; diff --git a/externals/gridflow/pd_examples/hello-world.pd b/externals/gridflow/pd_examples/hello-world.pd index fb101d24..e43e1a71 100644 --- a/externals/gridflow/pd_examples/hello-world.pd +++ b/externals/gridflow/pd_examples/hello-world.pd @@ -1,38 +1,50 @@ -#N canvas 604 118 501 445 10; -#X obj 46 67 # / 320; -#X obj 46 187 # * 255; -#X obj 46 153 # != 0; -#X obj 46 -12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 --1; -#X obj 46 280 #out window; -#X obj 46 99 # inv+ 7; -#X obj 46 15 #for 0 320 1; -#X obj 46 48 # * 7; -#X obj 46 -34 loadbang; -#X text 66 -12 make one line:; -#X text 54 31 numbers 0 to 319; -#X text 55 84 numbers 0 to 6 repeated 45 or 46 times; -#X text 56 116 numbers 7 down to 1 ...; -#X text 53 172 3*1-bit rgb image line; -#X text 83 206 3*8-bit rgb image line; -#X text 53 234 repeat line 240 times; +#N canvas 165 50 640 466 10; +#X obj 6 67 # / 320; +#X obj 6 187 # * 255; +#X obj 6 153 # != 0; +#X obj 6 -12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 6 99 # inv+ 7; +#X obj 6 15 #for 0 320 1; +#X obj 6 48 # * 7; +#X obj 6 -34 loadbang; +#X text 26 -12 make one line:; +#X text 14 31 numbers 0 to 319; +#X text 15 84 numbers 0 to 6 repeated 45 or 46 times; +#X text 16 116 numbers 7 down to 1 ...; +#X text 13 172 3*1-bit rgb image line; +#X text 13 205 3*8-bit rgb image line; +#X text 135 223 repeat line 240 times; #X obj -13 -85 cnv 15 500 30 empty empty empty 20 12 0 14 -233017 -66577 0; #X text 0 -86 hello-world.pd; -#X obj 46 134 #outer & (2 4 1); -#X obj 46 252 #redim (240 320 3); -#X obj -14 319 cnv 15 500 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj 6 134 #outer & (2 4 1); +#X obj 6 222 #redim (240 320 3); +#X obj -14 349 cnv 15 500 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 325 GridFlow 0.8.0; -#X text -7 325 GridFlow 0.8.0; +#X text -7 355 GridFlow 0.8.0; +#X text -7 355 GridFlow 0.8.0; #X text 0 -72 Copyright 2001 Mathieu Bouchard; -#X connect 0 0 5 0; -#X connect 1 0 19 0; +#X obj 289 297 #text_to_image; +#X obj 289 278 #import per_message; +#X msg 289 259 symbol Hello_World!; +#X obj 290 319 #draw_image put (3 # 0) (0 0); +#X obj 6 290 #out window; +#X msg 288 240 load grid gzfile lucida-typewriter-12.grid.gz; +#X obj 391 297 #in; +#X text 328 216 FOR FUTURE USE:; +#X connect 0 0 4 0; +#X connect 1 0 18 0; #X connect 2 0 1 0; -#X connect 3 0 6 0; -#X connect 5 0 18 0; -#X connect 6 0 7 0; -#X connect 7 0 0 0; -#X connect 8 0 3 0; -#X connect 18 0 2 0; -#X connect 19 0 4 0; +#X connect 3 0 5 0; +#X connect 4 0 17 0; +#X connect 5 0 6 0; +#X connect 6 0 0 0; +#X connect 7 0 3 0; +#X connect 17 0 2 0; +#X connect 18 0 27 0; +#X connect 23 0 26 1; +#X connect 24 0 23 0; +#X connect 25 0 24 0; +#X connect 28 0 29 0; +#X connect 29 0 23 2; diff --git a/externals/gridflow/pd_examples/image_stats.pd b/externals/gridflow/pd_examples/image_stats.pd index 9f9c753a..ecb60e01 100644 --- a/externals/gridflow/pd_examples/image_stats.pd +++ b/externals/gridflow/pd_examples/image_stats.pd @@ -1,39 +1,39 @@ -#N canvas 391 151 716 416 10; -#X obj 257 173 print total_value; -#X obj 523 151 #dim; -#X obj 22 187 #export_list; -#X obj 328 150 print number_of_values; -#X obj 523 200 print number_of_dimensions; -#X obj 523 173 #export; -#X obj 185 91 #fold +; -#X obj 281 201 /; -#X obj 185 135 #fold +; -#X obj 22 215 print total_pixel; -#X obj 185 57 fork; -#X obj 245 28 #in; -#X obj 328 106 #fold * \, seed 1; -#X obj 480 112 print dimensions; -#X obj 281 228 print average_value; -#X obj 186 157 #export; -#X obj 185 113 #fold +; -#X obj 480 90 #export_list; -#X obj 480 68 #dim; -#X obj 328 84 #dim; -#X obj 328 128 #export; -#X msg 271 -35 open bluemarble.jpg \, bang; -#X msg 271 -15 open teapot.png \, bang; -#X msg 271 5 open r001.jpg \, bang; -#X obj -15 304 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 +#N canvas 391 151 716 426 10; +#X obj 214 261 print total_value; +#X obj 473 191 #dim; +#X obj 42 220 #export_list; +#X obj 278 231 print number_of_values; +#X obj 473 229 print number_of_dimensions; +#X obj 473 210 #export; +#X obj 205 181 #fold +; +#X obj 205 301 /; +#X obj 205 219 #fold +; +#X obj 42 239 print total_pixel; +#X obj 205 147 fork; +#X obj 265 118 #in; +#X obj 278 193 #fold * \, seed 1; +#X obj 420 166 print dimensions; +#X obj 205 320 print average_value; +#X obj 205 238 #export; +#X obj 205 200 #fold +; +#X obj 420 147 #export_list; +#X obj 420 128 #dim; +#X obj 278 174 #dim; +#X obj 278 212 #export; +#X msg 291 55 open bluemarble.jpg \, bang; +#X msg 291 75 open teapot.png \, bang; +#X msg 291 95 open r001.jpg \, bang; +#X obj 5 394 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 311 GridFlow 0.8.0; -#X text -7 311 GridFlow 0.8.0; -#X obj -13 -85 cnv 15 720 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 13 401 GridFlow 0.8.0; +#X text 13 401 GridFlow 0.8.0; +#X obj 7 5 cnv 15 720 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text -5 -72 Copyright 2001 Mathieu Bouchard; -#X text -5 -86 image_stats.pd; -#X obj 22 131 #fold + \, seed (3 #); -#X obj 22 92 #fold + \, seed (3 #); -#X text 460 -36 <-- click on one of these; +#X text 15 18 Copyright 2001 Mathieu Bouchard; +#X text 15 4 image_stats.pd; +#X obj 42 201 #fold + \, seed (3 #); +#X obj 42 182 #fold + \, seed (3 #); +#X text 480 54 <-- click on one of these; #X connect 1 0 5 0; #X connect 2 0 9 0; #X connect 5 0 4 0; diff --git a/externals/gridflow/pd_examples/linear_transform.pd b/externals/gridflow/pd_examples/linear_transform.pd index b5e87d8d..1c2d4749 100644 --- a/externals/gridflow/pd_examples/linear_transform.pd +++ b/externals/gridflow/pd_examples/linear_transform.pd @@ -1,123 +1,215 @@ -#N canvas 454 137 685 580 10; -#X text 455 -6 click here to go in manual mode; -#X floatatom 138 224 5 0 0 0 - - -; -#X obj 7 289 # >> 11; -#X obj 7 62 #store; -#X obj 194 204 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 +#N canvas 76 11 784 587 10; +#X text 359 43 click here to go in manual mode; +#X floatatom 141 311 5 0 0 0 - - -; +#X obj 27 374 # >> 11; +#X obj 27 139 #store; +#X obj 183 291 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 8 -260818 -1 -1 0 1; -#X obj 545 123 * 3; -#X obj 418 376 # sin*; -#X obj 194 223 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 +#X obj 505 208 * 3; +#X obj 428 435 # sin*; +#X obj 183 310 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 8 -260818 -1 -1 0 1; -#X floatatom 138 170 5 0 0 0 - - -; -#X msg 448 137 10000; -#X obj 7 -26 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; -#X obj 194 166 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 +#X floatatom 141 257 5 0 0 0 - - -; +#X msg 444 238 10000; +#X obj 27 59 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X obj 183 253 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 8 -260818 -1 -1 0 1; -#X obj 94 40 loadbang; -#X obj 82 266 #redim ( 2 2 ); -#X text 191 147 linear transform; -#X obj 7 310 # + 128; -#X floatatom 138 188 5 0 0 0 - - -; -#X floatatom 138 206 5 0 0 0 - - -; -#X obj 194 185 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 +#X obj 77 138 loadbang; +#X text 180 234 linear transform; +#X obj 27 395 # + 128; +#X floatatom 141 275 5 0 0 0 - - -; +#X floatatom 141 293 5 0 0 0 - - -; +#X obj 183 272 hsl 128 15 -4096 4096 0 0 empty empty empty -2 -6 0 8 -260818 -1 -1 0 1; -#X obj 418 175 vsl 15 128 0 35999 0 0 empty empty empty 0 -8 0 8 -260818 --1 -1 12700 1; -#X obj 453 174 vsl 15 128 -10000 10000 0 0 empty empty empty 0 -8 0 -8 -260818 -1 -1 7400 1; -#X obj 427 34 % 36000; -#X obj 448 116 loadbang; -#X text 360 146 rotozoomer; -#X obj 545 143 # sin* 100; -#X obj 384 -6 shunt 2; -#X msg 132 342 open teapot.png \, bang; -#X msg 545 215 set \$1; -#X obj 132 321 loadbang; -#X obj 7 363 #store; -#X obj 7 384 #out window; -#X obj 453 312 t b f; -#X obj 439 -5 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1 +#X obj 428 260 vsl 15 128 0 35999 0 0 empty empty empty 0 -8 0 8 -260818 +-1 -1 0 1; +#X obj 444 259 vsl 15 128 -32768 32768 0 0 empty empty empty 0 -8 0 +8 -260818 -1 -1 12700 1; +#X obj 327 82 % 36000; +#X obj 444 219 loadbang; +#X text 432 185 rotozoomer; +#X obj 505 227 # sin* 100; +#X obj 288 43 shunt 2; +#X msg 505 284 set \$1; +#X obj 152 416 loadbang; +#X obj 27 448 #store; +#X obj 27 469 #out window; +#X obj 343 44 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1 ; -#X obj 81 247 #pack 4; -#X obj 7 35 t b b; -#X obj 384 33 float; -#X obj 427 14 + 100; -#X obj 545 164 # inv* 100000; -#X obj 545 185 #export; -#X obj 63 341 #camera; -#X obj 132 363 #in; -#X obj 63 321 spigot; -#X obj 111 322 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +#X obj 88 334 #pack 4; +#X obj 27 95 t b b; +#X obj 288 82 float; +#X obj 327 63 + 100; +#X obj 505 246 # inv* 100000; +#X obj 505 265 #export; +#X obj 83 426 #camera; +#X obj 152 454 #in; +#X obj 83 406 spigot; +#X obj 131 407 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; -#X obj 7 268 #inner; -#X obj 81 144 loadbang; -#X obj 23 412 fps detailed; -#X obj 23 435 print; -#X obj 7 8 metro 5; -#X obj -18 -85 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +#X obj 27 353 #inner; +#X obj 88 237 loadbang; +#X obj 27 488 fps detailed; +#X obj 27 507 print; +#X obj 2 0 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 1 -72 Copyright 2002 Mathieu Bouchard; -#X text 1 -85 convolve.pd; -#X obj -18 -85 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 21 13 Copyright 2002 Mathieu Bouchard; +#X text 21 0 convolve.pd; +#X obj 2 0 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 1 -85 linear_transform.pd; -#X obj 94 61 #for (-128 -128) (128 128) (1 1); -#X obj 418 355 #outer + (9000 18000 0 9000); -#X text 1 -72 Copyright 2001 Mathieu Bouchard; -#X obj -18 464 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 21 0 linear_transform.pd; +#X obj 77 157 #for (-128 -128) (128 128) (1 1); +#X obj 428 416 #outer + (9000 18000 0 9000); +#X text 21 13 Copyright 2001 Mathieu Bouchard; +#X obj 2 549 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -10 471 GridFlow 0.8.0; -#X text -10 471 GridFlow 0.8.0; -#X connect 1 0 33 3; -#X connect 2 0 15 0; -#X connect 3 0 43 0; -#X connect 4 0 17 0; -#X connect 5 0 24 0; -#X connect 6 0 13 0; +#X text 10 556 GridFlow 0.8.0; +#X text 10 556 GridFlow 0.8.0; +#X msg 152 435 load teapot.png; +#X obj 27 76 metro 33.3667; +#X obj 89 353 #redim (2 2); +#X obj 333 335 #export; +#X obj 333 316 # % 36000; +#N canvas 0 0 450 300 scratch 0; +#X obj 40 38 inlet; +#X obj 40 245 outlet; +#X obj 40 57 route keypress; +#X msg 40 76 \$4; +#X msg 40 115 -1; +#X msg 79 115 1; +#X obj 40 182 +; +#X obj 40 207 int; +#X obj 72 185 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +-262144 -1 -1 0 256; +#X obj 40 226 #fade 2; +#X obj 65 207 inlet; +#X obj 40 139 * 1500; +#X obj 40 95 route Left Right; +#X connect 0 0 2 0; +#X connect 2 0 3 0; +#X connect 3 0 12 0; +#X connect 4 0 11 0; +#X connect 5 0 11 0; +#X connect 6 0 7 1; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 6 1; +#X connect 9 0 1 0; +#X connect 10 0 7 0; +#X connect 11 0 6 0; +#X connect 12 0 4 0; +#X connect 12 1 5 0; +#X restore 333 297 pd scratch; +#N canvas 0 0 304 312 scratch2 0; +#X obj 30 23 inlet; +#X obj 46 263 outlet; +#X obj 30 42 route keypress; +#X msg 30 90 \$4; +#X msg 69 130 1; +#X obj 45 197 +; +#X obj 46 218 int; +#X obj 71 199 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +-262144 -1 -1 131526 256; +#X obj 46 243 #fade 2; +#X obj 71 218 inlet; +#X obj 30 109 route Up Down; +#X msg 30 130 -1; +#X obj 30 70 t l l; +#X msg 129 62 \$3; +#X obj 129 81 & 1; +#X obj 129 100 sel 0 1; +#X obj 49 161 *; +#X msg 130 120 1000; +#X msg 168 120 5; +#X connect 0 0 2 0; +#X connect 2 0 12 0; +#X connect 3 0 10 0; +#X connect 4 0 16 0; +#X connect 5 0 6 1; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 7 0 5 1; +#X connect 8 0 1 0; +#X connect 9 0 6 0; +#X connect 10 0 11 0; +#X connect 10 1 4 0; +#X connect 11 0 16 0; +#X connect 12 0 3 0; +#X connect 12 1 13 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 17 0; +#X connect 15 1 18 0; +#X connect 16 0 5 0; +#X connect 17 0 16 1; +#X connect 18 0 16 1; +#X restore 336 367 pd scratch2; +#X obj 336 386 #export; +#X floatatom 336 443 8 0 0 0 - - -; +#X obj 336 405 / 10000; +#X obj 336 424 exp; +#X obj 505 373 t b; +#X connect 1 0 30 3; +#X connect 2 0 14 0; +#X connect 3 0 40 0; +#X connect 4 0 16 0; +#X connect 5 0 23 0; +#X connect 6 0 57 0; #X connect 7 0 1 0; -#X connect 8 0 33 0; -#X connect 9 0 20 0; -#X connect 10 0 47 0; +#X connect 8 0 30 0; +#X connect 9 0 19 0; +#X connect 10 0 56 0; #X connect 11 0 8 0; -#X connect 12 0 53 0; -#X connect 13 0 43 1; -#X connect 15 0 29 0; -#X connect 16 0 33 1; -#X connect 17 0 33 2; -#X connect 18 0 16 0; -#X connect 19 0 54 0; -#X connect 20 0 31 0; -#X connect 21 0 35 1; -#X connect 22 0 9 0; -#X connect 24 0 37 0; -#X connect 25 0 35 0; -#X connect 26 0 40 0; -#X connect 27 0 20 0; -#X connect 28 0 26 0; -#X connect 29 0 30 0; -#X connect 30 0 45 0; -#X connect 31 0 19 0; -#X connect 31 1 6 1; -#X connect 32 0 25 1; -#X connect 33 0 13 0; -#X connect 34 0 3 0; -#X connect 34 1 25 0; -#X connect 34 1 41 0; -#X connect 35 0 36 0; -#X connect 35 0 19 0; -#X connect 35 0 5 0; -#X connect 36 0 21 0; -#X connect 37 0 38 0; -#X connect 38 0 27 0; -#X connect 38 0 31 0; -#X connect 39 0 29 1; -#X connect 40 0 29 1; -#X connect 41 0 39 0; -#X connect 42 0 41 1; -#X connect 43 0 2 0; -#X connect 44 0 33 0; -#X connect 45 0 46 0; -#X connect 47 0 34 0; -#X connect 53 0 3 1; -#X connect 54 0 6 0; +#X connect 12 0 49 0; +#X connect 14 0 27 0; +#X connect 15 0 30 1; +#X connect 16 0 30 2; +#X connect 17 0 15 0; +#X connect 18 0 50 0; +#X connect 19 0 66 0; +#X connect 20 0 32 1; +#X connect 21 0 9 0; +#X connect 23 0 34 0; +#X connect 24 0 32 0; +#X connect 25 0 19 0; +#X connect 26 0 55 0; +#X connect 27 0 28 0; +#X connect 28 0 42 0; +#X connect 28 0 60 0; +#X connect 28 0 61 0; +#X connect 29 0 24 1; +#X connect 30 0 57 0; +#X connect 31 0 3 0; +#X connect 31 1 24 0; +#X connect 31 1 38 0; +#X connect 31 1 60 1; +#X connect 31 1 61 1; +#X connect 32 0 33 0; +#X connect 32 0 18 0; +#X connect 32 0 5 0; +#X connect 33 0 20 0; +#X connect 34 0 35 0; +#X connect 35 0 25 0; +#X connect 35 0 66 0; +#X connect 36 0 27 1; +#X connect 37 0 27 1; +#X connect 38 0 36 0; +#X connect 39 0 38 1; +#X connect 40 0 2 0; +#X connect 41 0 30 0; +#X connect 42 0 43 0; +#X connect 49 0 3 1; +#X connect 50 0 6 0; +#X connect 55 0 37 0; +#X connect 56 0 31 0; +#X connect 57 0 40 1; +#X connect 58 0 18 0; +#X connect 59 0 58 0; +#X connect 60 0 59 0; +#X connect 61 0 62 0; +#X connect 62 0 64 0; +#X connect 64 0 65 0; +#X connect 65 0 63 0; +#X connect 65 0 19 0; +#X connect 65 0 6 1; +#X connect 66 0 18 0; diff --git a/externals/gridflow/pd_examples/photo_pianoroll.pd b/externals/gridflow/pd_examples/photo_pianoroll.pd index b97e2008..9ad80e38 100644 --- a/externals/gridflow/pd_examples/photo_pianoroll.pd +++ b/externals/gridflow/pd_examples/photo_pianoroll.pd @@ -1,16 +1,15 @@ -#N canvas 476 141 695 640 10; -#X obj 146 24 #in lada.jpg; -#X obj 58 479 #out window; -#X obj 28 -9 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; -#X obj 58 93 #store; -#X obj 164 3 loadbang; -#X text 268 -34 How to play a car; -#X obj 146 4 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#N canvas 329 40 705 535 10; +#X obj 146 62 #in lada.jpg; +#X obj 38 290 #out window; +#X obj 38 48 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X obj 38 114 #store; +#X obj 164 41 loadbang; +#X obj 146 42 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 406 488 dac~; -#X obj 333 54 +; -#X msg 333 33 1; -#X obj 361 54 % 365; +#X obj 255 466 dac~; +#X obj 329 58 +; +#X msg 329 39 1; +#X obj 361 39 % 365; #N canvas 0 0 450 300 fft 0; #X obj 23 68 rifft~; #X obj 23 88 outlet~; @@ -18,142 +17,142 @@ #X obj 23 48 tabreceive~ array2; #X connect 0 0 1 0; #X connect 3 0 0 0; -#X restore 405 448 pd fft; -#X obj 7 41 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1 -; -#X obj 28 40 t b b; -#X msg 284 418 4 2 # 0 0 0 502 1 502 1 0; -#X obj 284 437 # +; -#X obj 58 418 t a b; -#X msg 311 437 \$1 0; -#X obj 58 439 #greyscale_to_rgb; -#X obj 477 135 #store; -#X obj 476 214 #export_list; -#X obj 517 234 s array1; -#X obj 477 174 #cast float32; -#X obj 186 126 # inv+ 255; -#X obj 146 64 # min 255; -#X obj 146 45 # * 3; -#X msg 477 113 1 1 # \$1; -#X obj 444 14 table array1 502; -#X obj 477 234 t b a; -#X obj 350 437 r row; -#X obj 361 76 s row; -#X obj 478 285 t f f; -#X obj 480 392 tabwrite array2; -#X obj 479 326 exp; -#X obj 137 221 #mouse \, ...; -#X obj 272 242 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 224 243 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 165 374 #draw_polygon put; -#X msg 272 259 1 # 255; -#X msg 223 261 1 # 0; -#X obj 169 350 spigot; -#X obj 280 292 t a a; -#X obj 294 374 # +; -#X obj 146 139 t a; -#X msg 280 314 4 2 # 0 0 0 1 1 1 1 0; -#X obj 280 336 # *; -#X obj 357 333 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 +#X restore 255 423 pd fft; +#X obj 17 85 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 38 84 t b b; +#X msg 260 252 4 2 # 0 0 0 502 1 502 1 0; +#X obj 260 271 # +; +#X obj 38 233 t a b; +#X msg 287 271 \$1 0; +#X obj 38 252 #greyscale_to_rgb; +#X obj 462 77 #store; +#X obj 462 153 #export_list; +#X obj 501 172 s array1; +#X obj 171 177 # inv+ 255; +#X obj 146 100 # min 255; +#X obj 146 81 # * 3; +#X msg 474 58 1 1 # \$1; +#X obj 255 339 table array1 502; +#X obj 462 172 t b a; +#X obj 326 271 r row; +#X obj 361 58 s row; +#X obj 462 210 t f f; +#X obj 462 305 tabwrite array2; +#X obj 462 248 exp; +#X obj 38 309 #mouse \, ...; +#X obj 79 383 #draw_polygon put; +#X obj 79 364 spigot; +#X obj 29 413 t a a; +#X obj 29 470 # +; +#X obj 146 177 t a; +#X msg 29 432 4 2 # 0 0 0 1 1 1 1 0; +#X obj 29 451 # *; +#X obj 105 459 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 +-262131 -1 -1 20 256; +#X msg 185 217 365 502 1 # 255; +#X text 296 217 clear; +#X obj 462 286 tabread4 array1; +#X obj 462 191 for 0 64 1; +#X obj 462 96 #fade 5; +#X obj 255 358 table array2 1024; +#X obj 255 442 lop~ 1000; +#X obj 462 229 / 20; +#X obj 462 267 * 22; +#X obj 105 473 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262131 -1 -1 20 256; -#X msg 185 182 365 502 1 # 255; -#X text 296 182 clear; -#X obj 480 373 tabread4 array1; -#X obj 477 265 for 0 64 1; -#X obj 477 154 #fade 5; -#X obj 444 35 table array2 1024; -#X obj 406 468 lop~ 1000; -#X obj 479 305 / 20; -#X obj 480 346 * 22; -#X obj 28 19 metro 46.44; -#X obj 357 350 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 --262131 -1 -1 1 256; -#X obj 325 373 #pack 2; -#X obj 475 194 # / ( float32 # 4000 ); -#X obj 186 155 #convolve ( 1 7 # 1 1 2 8 2 1 1 ); -#X obj 514 90 # >> 4; -#X obj 146 84 #convolve ( 2 2 # 1 ); -#X obj 146 103 # >> 2; -#X obj 58 459 #draw_polygon put (3 # 255 0 0); -#X obj -18 524 cnv 15 700 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj 54 470 #pack 2; +#X obj 499 39 # >> 4; +#X obj 146 138 # >> 2; +#X obj 38 271 #draw_polygon put (3 # 255 0 0); +#X obj 2 499 cnv 15 700 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -10 531 GridFlow 0.8.0; -#X text -10 531 GridFlow 0.8.0; -#X obj -18 -85 cnv 15 700 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 10 506 GridFlow 0.8.0; +#X text 10 506 GridFlow 0.8.0; +#X obj 2 0 cnv 15 700 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text -3 -86 photo_pianoroll.pd; -#X text -5 -72 Copyright 2004 Mathieu Bouchard; -#X connect 0 0 25 0; -#X connect 1 0 34 0; -#X connect 2 0 56 0; -#X connect 3 0 16 0; -#X connect 3 0 40 0; +#X text 17 -1 photo_pianoroll.pd; +#X text 15 13 Copyright 2004 Mathieu Bouchard; +#X obj 462 134 # / (f # 4000); +#X obj 462 115 #cast f; +#X obj 171 196 #convolve (1 7 # 1 1 2 8 2 1 1); +#X obj 146 119 #convolve (2 2 # 1); +#X msg 132 344 0; +#X msg 136 364 1 # \$1; +#X msg 162 344 255; +#X obj 79 402 s feedback; +#X obj 152 158 r feedback; +#X obj 38 65 metro 46.44; +#X text 575 7 How to play a car; +#X connect 0 0 23 0; +#X connect 1 0 32 0; +#X connect 2 0 70 0; +#X connect 3 0 15 0; +#X connect 3 0 34 0; #X connect 4 0 0 0; -#X connect 6 0 0 0; -#X connect 8 0 10 0; -#X connect 9 0 8 0; -#X connect 10 0 8 1; -#X connect 10 0 30 0; -#X connect 10 0 26 0; -#X connect 11 0 53 0; -#X connect 12 0 13 0; -#X connect 13 0 9 0; -#X connect 13 1 3 0; -#X connect 14 0 15 0; -#X connect 15 0 64 2; -#X connect 16 0 18 0; -#X connect 16 1 14 0; -#X connect 17 0 15 1; -#X connect 18 0 64 0; -#X connect 19 0 51 0; -#X connect 20 0 28 0; -#X connect 22 0 59 0; -#X connect 23 0 60 0; -#X connect 24 0 62 0; -#X connect 25 0 24 0; -#X connect 26 0 19 0; -#X connect 28 0 50 0; -#X connect 28 1 21 0; -#X connect 29 0 17 0; -#X connect 31 0 54 0; -#X connect 31 1 32 1; -#X connect 33 0 55 0; -#X connect 34 0 41 0; -#X connect 34 1 41 0; -#X connect 34 4 36 0; -#X connect 34 4 40 1; -#X connect 34 6 35 0; -#X connect 34 6 40 1; +#X connect 5 0 0 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 9 0 7 1; +#X connect 9 0 28 0; +#X connect 9 0 24 0; +#X connect 10 0 47 0; +#X connect 11 0 12 0; +#X connect 12 0 8 0; +#X connect 12 1 3 0; +#X connect 13 0 14 0; +#X connect 14 0 54 2; +#X connect 15 0 17 0; +#X connect 15 1 13 0; +#X connect 16 0 14 1; +#X connect 17 0 54 0; +#X connect 18 0 45 0; +#X connect 19 0 26 0; +#X connect 21 0 63 0; +#X connect 22 0 64 0; +#X connect 23 0 22 0; +#X connect 24 0 18 0; +#X connect 26 0 44 0; +#X connect 26 1 20 0; +#X connect 27 0 16 0; +#X connect 29 0 48 0; +#X connect 29 1 30 1; +#X connect 31 0 49 0; +#X connect 32 0 35 0; +#X connect 32 1 35 0; +#X connect 32 4 34 1; +#X connect 32 4 65 0; +#X connect 32 6 34 1; +#X connect 32 6 67 0; +#X connect 33 0 68 0; +#X connect 34 0 33 0; #X connect 35 0 38 0; -#X connect 36 0 39 0; -#X connect 37 0 43 0; -#X connect 38 0 37 1; -#X connect 39 0 37 1; -#X connect 40 0 37 0; -#X connect 41 0 44 0; -#X connect 41 1 42 1; -#X connect 42 0 37 2; -#X connect 43 0 3 1; -#X connect 43 0 23 0; -#X connect 44 0 45 0; -#X connect 45 0 42 0; -#X connect 46 0 58 0; -#X connect 47 0 43 0; -#X connect 49 0 32 0; -#X connect 50 0 31 0; -#X connect 51 0 22 0; -#X connect 53 0 7 0; -#X connect 53 0 7 1; -#X connect 54 0 33 0; -#X connect 55 0 49 0; -#X connect 56 0 13 0; -#X connect 57 0 58 1; -#X connect 58 0 45 1; -#X connect 59 0 20 0; -#X connect 60 0 61 0; -#X connect 61 0 19 1; -#X connect 62 0 63 0; -#X connect 63 0 43 0; -#X connect 64 0 1 0; +#X connect 35 1 36 1; +#X connect 36 0 33 2; +#X connect 37 0 3 1; +#X connect 37 0 21 0; +#X connect 38 0 39 0; +#X connect 39 0 36 0; +#X connect 40 0 51 0; +#X connect 41 0 37 0; +#X connect 43 0 30 0; +#X connect 44 0 29 0; +#X connect 45 0 62 0; +#X connect 47 0 6 0; +#X connect 47 0 6 1; +#X connect 48 0 31 0; +#X connect 49 0 43 0; +#X connect 50 0 51 1; +#X connect 51 0 39 1; +#X connect 52 0 18 1; +#X connect 53 0 37 0; +#X connect 54 0 1 0; +#X connect 61 0 19 0; +#X connect 62 0 61 0; +#X connect 63 0 52 0; +#X connect 64 0 53 0; +#X connect 65 0 66 0; +#X connect 66 0 33 1; +#X connect 67 0 33 1; +#X connect 69 0 37 0; +#X connect 70 0 12 0; diff --git a/externals/gridflow/pd_examples/polygon.pd b/externals/gridflow/pd_examples/polygon.pd index d43a14f8..a18980ea 100644 --- a/externals/gridflow/pd_examples/polygon.pd +++ b/externals/gridflow/pd_examples/polygon.pd @@ -1,15 +1,12 @@ -#N canvas 242 170 497 560 10; -#X obj 30 250 #draw_polygon +; -#X obj 127 3 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +#N canvas 130 96 584 565 10; +#X obj 35 250 #draw_polygon +; +#X obj 18 1 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 ; -#X obj 187 80 +; -#X obj 30 214 #store; -#X obj 220 102 * 5000; -#X obj 165 -27 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +#X obj 35 214 #store; +#X obj 35 -36 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 ; -#X msg 187 61 1; -#X obj 30 394 #out window; -#X obj 391 7 vsl 15 137 0 36000 0 1 empty empty empty -2 -6 0 8 -260818 +#X obj 35 378 #out window; +#X obj 306 7 vsl 15 137 0 36000 0 1 empty empty empty -2 -6 0 8 -260818 -1 -1 3400 1; #N canvas 0 0 415 291 create 0; #X msg 82 66 0 \$1; @@ -34,7 +31,7 @@ #X connect 7 0 2 1; #X connect 8 0 6 0; #X connect 10 0 0 0; -#X restore 289 149 pd create star; +#X restore 204 149 pd create star; #N canvas 0 0 450 300 color 0; #X obj 18 141 outlet 0; #X obj 18 95 # sin* 128; @@ -50,26 +47,24 @@ color wheel except we don't support the HSV color model for now.; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 5 0 1 0; -#X restore 80 129 pd color generator; -#X obj 165 1 metro 33.3667; -#X obj 165 34 t b b b; -#X obj 30 71 t b; -#X floatatom 392 151 6 0 0 0 - - -; -#X obj 89 194 loadbang; -#X obj 215 81 % 36000; -#X obj 46 272 shunt 2; -#X obj 115 274 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +#X restore 62 102 pd color generator; +#X obj 35 -19 metro 33.3667; +#X obj 35 0 t b b b; +#X obj 35 71 t b; +#X floatatom 307 151 6 0 0 0 - - -; +#X obj 88 194 loadbang; +#X obj 51 272 shunt 2; +#X obj 104 274 tgl 15 1 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1; -#X text 133 273 blur; -#X msg 89 214 240 320 3 b # 0; -#X obj 80 167 #cast b; -#X obj 80 148 # >> 7; -#X obj 74 357 #solarize; -#X obj 30 317 shunt 2; -#X obj 93 318 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +#X text 122 273 blur; +#X msg 88 214 240 320 3 b # 0; +#X obj 62 140 #cast b; +#X obj 79 355 #solarize; +#X obj 35 317 shunt 2; +#X obj 88 319 tgl 15 1 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1 ; -#X obj 131 301 # >> (b # 2); -#X obj 131 321 #convolve (1 3 b # 1 2 1) \, seed (b # 0); +#X obj 155 303 # >> (b # 2); +#X obj 155 322 #convolve (1 3 b # 1 2 1) \, seed (b # 0); #X obj -15 442 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 0; #X text -7 450 GridFlow 0.8.0; @@ -78,36 +73,51 @@ color wheel except we don't support the HSV color model for now.; 0; #X text 0 -72 Copyright 2002 Mathieu Bouchard; #X text 0 -86 polygon.pd; -#X connect 0 0 17 0; -#X connect 0 0 24 0; -#X connect 1 0 12 0; -#X connect 2 0 16 0; -#X connect 3 0 0 0; -#X connect 4 0 9 1; +#X obj 79 336 #cast i; +#X obj 82 30 + 1; +#X obj 57 30 i; +#X msg 22 26 0; +#X obj 182 75 expr ($f1*$f1/2); +#X obj 155 341 # >> (b # 2); +#X obj 155 360 #convolve (3 1 b # 1 2 1) \, seed (b # 0); +#X obj 5 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 -258699 -1 -1 +; +#X obj 62 121 # >> 3; +#X connect 0 0 13 0; +#X connect 0 0 19 0; +#X connect 1 0 9 0; +#X connect 2 0 0 0; +#X connect 3 0 8 0; #X connect 5 0 11 0; -#X connect 6 0 2 0; -#X connect 8 0 14 0; -#X connect 9 0 0 2; -#X connect 10 0 22 0; -#X connect 11 0 12 0; -#X connect 12 0 13 0; -#X connect 12 1 6 0; -#X connect 12 2 9 0; -#X connect 13 0 3 0; -#X connect 14 0 9 2; -#X connect 15 0 20 0; +#X connect 6 0 0 2; +#X connect 7 0 37 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 9 1 31 0; +#X connect 9 2 6 0; +#X connect 10 0 2 0; +#X connect 11 0 6 2; +#X connect 12 0 16 0; +#X connect 13 0 2 1; +#X connect 13 1 21 0; +#X connect 14 0 13 1; #X connect 16 0 2 1; -#X connect 16 0 10 0; -#X connect 16 0 4 0; -#X connect 17 0 3 1; -#X connect 17 1 26 0; -#X connect 18 0 17 1; -#X connect 20 0 3 1; -#X connect 21 0 0 1; -#X connect 22 0 21 0; -#X connect 23 0 7 0; -#X connect 24 0 7 0; -#X connect 24 1 23 0; -#X connect 25 0 24 1; -#X connect 26 0 27 0; -#X connect 27 0 3 1; +#X connect 17 0 0 1; +#X connect 18 0 4 0; +#X connect 19 0 4 0; +#X connect 19 1 29 0; +#X connect 20 0 19 1; +#X connect 21 0 22 0; +#X connect 22 0 34 0; +#X connect 29 0 18 0; +#X connect 30 0 31 1; +#X connect 31 0 30 0; +#X connect 31 0 7 0; +#X connect 31 0 33 0; +#X connect 32 0 31 0; +#X connect 33 0 6 1; +#X connect 34 0 35 0; +#X connect 35 0 2 1; +#X connect 36 0 32 0; +#X connect 36 0 16 0; +#X connect 37 0 17 0; diff --git a/externals/gridflow/pd_examples/sand.pd b/externals/gridflow/pd_examples/sand.pd index 42a0ed93..1ba43753 100644 --- a/externals/gridflow/pd_examples/sand.pd +++ b/externals/gridflow/pd_examples/sand.pd @@ -1,15 +1,14 @@ -#N canvas 524 30 680 685 10; -#X text 317 199 disable falling; -#X obj 6 392 # min 255; -#X obj 3 167 fork; -#X obj 295 402 # != 0; -#X obj 356 446 #fold +; -#X obj 99 518 s position; -#X obj 192 -31 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +#N canvas 524 30 680 557 10; +#X text 287 159 disable falling; +#X obj 2 96 fork; +#X obj 273 294 # != 0; +#X obj 334 332 #fold +; +#X obj 8 414 s position; +#X obj 192 29 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 ; -#X obj 295 465 #export; -#X obj 192 68 #store; -#X obj 247 133 shunt 2; +#X obj 273 351 #export; +#X obj 192 82 #store; +#X obj 217 113 shunt 2; #N canvas 25 226 369 359 mouse 0; #X text 143 214 is there a click?; #X obj 44 114 != 0; @@ -34,26 +33,25 @@ #X connect 11 0 5 0; #X connect 12 0 10 0; #X connect 12 1 11 0; -#X restore 398 151 pd mouse click/drag; -#X obj 358 152 # / 2; -#X obj 295 423 #ravel; -#X msg 11 142 100 100; -#X obj 6 415 # max; -#X obj 247 198 shunt 2; -#X obj 26 187 s size; -#X obj 295 444 #fold +; -#X obj 454 112 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 -1; -#X obj 356 404 @! abs; -#X obj 432 412 #export; -#X obj 432 370 #ravel; -#X obj 288 260 shunt 2; -#X obj 301 199 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +#X restore 366 132 pd mouse click/drag; +#X obj 327 132 # / 2; +#X obj 273 313 #ravel; +#X msg 8 76 100 100; +#X obj 217 158 shunt 2; +#X obj 34 96 s size; +#X obj 273 332 #fold +; +#X obj 420 95 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +; +#X obj 334 294 @! abs; +#X obj 402 338 #export; +#X obj 402 300 #ravel; +#X obj 256 220 shunt 2; +#X obj 271 159 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; -#X obj 356 467 #export; -#X obj 398 111 shunt 2; -#X obj 6 348 #greyscale_to_rgb; -#X obj 399 132 r position; +#X obj 334 351 #export; +#X obj 367 94 shunt 2; +#X obj 2 230 #greyscale_to_rgb; +#X obj 367 113 r position; #N canvas 504 75 496 430 falling 0; #X obj 42 147 # +; #X text 228 286 vertical falling; @@ -104,13 +102,13 @@ #X connect 21 0 7 0; #X connect 22 0 8 0; #X connect 23 0 2 0; -#X restore 247 218 pd falling sand; -#X obj 6 465 #scale_by 2; -#X obj 8 287 shunt 3; -#X obj 6 540 print; -#X obj 136 26 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 +#X restore 217 178 pd falling sand; +#X obj 2 373 #scale_by 2; +#X obj 2 170 shunt 3; +#X obj 2 452 print; +#X obj 197 65 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X text 253 -8 auto; +#X text 253 46 auto; #N canvas 292 75 480 513 falling 0; #X obj 105 177 # div 5; #X text 292 85 horizontal falling; @@ -161,7 +159,7 @@ #X connect 21 0 0 0; #X connect 22 0 17 0; #X connect 23 0 14 0; -#X restore 292 238 pd falling sand ( 2 ); +#X restore 262 198 pd falling sand ( 2 ); #N canvas 525 58 536 584 finger 0; #X obj 192 7 inlet; #X obj 36 78 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 @@ -270,19 +268,18 @@ #X connect 23 0 21 0; #X connect 24 0 15 0; #X connect 25 0 3 1; -#X restore 290 152 pd finger; -#X obj 342 376 # -; -#X obj 356 425 #ravel; -#X msg 3 118 240 320; -#X obj 432 391 #fold +; -#X obj 6 328 # + 128; -#X obj 148 476 #greyscale_to_rgb; -#X obj 303 134 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +#X restore 260 132 pd finger; +#X obj 310 266 # -; +#X obj 334 313 #ravel; +#X msg 2 56 240 320; +#X obj 402 319 #fold +; +#X obj 2 211 # + 128; +#X obj 55 344 #greyscale_to_rgb; +#X obj 270 115 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; -#X text 362 263 enable stats; -#X text 292 529 checking for conservation of amounts of sand; -#X msg 3 212 \$1 \$2 1 # 0; -#X text 33 159 set size / reset; +#X text 325 220 enable stats; +#X text 239 391 checking for conservation of amounts of sand; +#X msg 2 115 \$1 \$2 1 # 0; #N canvas 56 229 441 265 lighting 0; #X obj 27 209 outlet; #X obj 27 180 # +; @@ -313,105 +310,106 @@ #X connect 10 1 3 0; #X connect 13 0 8 1; #X connect 14 0 1 1; -#X restore 151 355 pd lighting; -#X obj 6 518 fps detailed; -#X obj 344 262 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 +#X restore 26 268 pd lighting; +#X obj 2 433 fps detailed; +#X obj 309 221 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; -#X text 152 26 step; -#X obj 71 253 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -241291 -1 --1 0; -#X obj 6 486 #out window; -#X obj 295 508 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +#X text 213 65 step; +#X obj 55 144 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -241291 -1 +-1 2; +#X obj 2 394 #out window; +#X obj 273 372 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; -#X obj 356 508 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +#X obj 334 372 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; -#X obj 432 508 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +#X obj 402 357 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; -#X text 90 268 differential; -#X text 89 253 heightmap; -#X text 89 284 topographic; -#X obj 152 68 t a a; -#X obj 247 260 t a a; -#X obj 149 457 # * 255; -#X obj 150 437 # >= 6; -#X obj 150 416 # & 7; -#X obj 2 97 loadbang; -#X text 470 112 disable finger; -#X obj 332 354 t a a; -#X obj 6 309 # << 2; -#X obj 151 334 # << 4; -#X obj 192 -8 metro 20; -#X obj -15 569 cnv 15 680 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 74 158 differential; +#X text 73 143 heightmap; +#X text 73 174 topographic; +#X obj 152 82 t a a; +#X obj 217 220 t a a; +#X obj 56 325 # * 255; +#X obj 56 306 # >= 6; +#X obj 56 287 # & 7; +#X obj 2 37 loadbang; +#X text 436 95 disable finger; +#X obj 300 244 t a a; +#X obj 2 192 # << 2; +#X obj 192 46 metro 20; +#X obj -15 499 cnv 15 680 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 576 GridFlow 0.8.0; -#X text -7 576 GridFlow 0.8.0; -#X obj -13 -85 cnv 15 680 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text -7 506 GridFlow 0.8.0; +#X text -7 506 GridFlow 0.8.0; +#X obj -13 -25 cnv 15 680 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 0 -72 Copyright 2002 Mathieu Bouchard; -#X text 0 -85 sand.pd; -#X connect 1 0 14 0; -#X connect 2 0 45 0; -#X connect 2 1 16 0; -#X connect 3 0 12 0; -#X connect 4 0 24 0; -#X connect 6 0 69 0; -#X connect 7 0 53 0; -#X connect 8 0 9 0; -#X connect 9 0 15 0; -#X connect 9 1 35 0; -#X connect 10 0 11 0; -#X connect 10 1 25 0; -#X connect 11 0 35 1; -#X connect 12 0 17 0; -#X connect 13 0 2 0; -#X connect 14 0 29 0; -#X connect 15 0 28 0; -#X connect 15 1 60 0; -#X connect 17 0 7 0; -#X connect 18 0 25 1; +#X text 0 -12 Copyright 2002 Mathieu Bouchard; +#X text 0 -25 sand.pd; +#X text -1 21 set size & reset; +#X obj 2 295 #clip; +#X obj 26 249 # << 0; +#X connect 1 0 43 0; +#X connect 1 1 14 0; +#X connect 2 0 11 0; +#X connect 3 0 22 0; +#X connect 5 0 65 0; +#X connect 6 0 50 0; +#X connect 7 0 8 0; +#X connect 8 0 13 0; +#X connect 8 1 33 0; +#X connect 9 0 10 0; +#X connect 9 1 23 0; +#X connect 10 0 33 1; +#X connect 11 0 15 0; +#X connect 12 0 1 0; +#X connect 13 0 26 0; +#X connect 13 1 57 0; +#X connect 15 0 6 0; +#X connect 16 0 23 1; +#X connect 17 0 35 0; +#X connect 18 0 52 0; #X connect 19 0 37 0; -#X connect 20 0 55 0; -#X connect 21 0 39 0; -#X connect 22 1 21 0; -#X connect 22 1 66 0; -#X connect 23 0 15 1; -#X connect 24 0 54 0; -#X connect 25 0 9 1; -#X connect 26 0 1 0; -#X connect 27 0 10 0; -#X connect 28 0 60 0; -#X connect 29 0 52 0; -#X connect 30 0 67 0; -#X connect 30 1 68 0; -#X connect 30 2 63 0; -#X connect 32 0 8 0; -#X connect 34 0 60 0; -#X connect 35 0 15 0; -#X connect 36 0 19 0; -#X connect 36 0 3 0; -#X connect 37 0 4 0; -#X connect 38 0 2 0; -#X connect 39 0 20 0; -#X connect 40 0 26 0; -#X connect 41 0 29 0; -#X connect 42 0 9 1; -#X connect 45 0 59 0; -#X connect 47 0 1 0; -#X connect 48 0 31 0; -#X connect 49 0 22 1; -#X connect 51 0 30 1; -#X connect 52 0 48 0; -#X connect 52 0 5 0; -#X connect 59 0 30 0; -#X connect 59 1 8 1; +#X connect 20 1 19 0; +#X connect 20 1 63 0; +#X connect 21 0 13 1; +#X connect 22 0 51 0; +#X connect 23 0 8 1; +#X connect 24 0 73 0; +#X connect 25 0 9 0; +#X connect 26 0 57 0; +#X connect 27 0 49 0; +#X connect 28 0 64 0; +#X connect 28 1 74 0; +#X connect 28 2 60 0; +#X connect 30 0 7 0; +#X connect 32 0 57 0; +#X connect 33 0 13 0; +#X connect 34 0 17 0; +#X connect 34 0 2 0; +#X connect 35 0 3 0; +#X connect 36 0 1 0; +#X connect 37 0 18 0; +#X connect 38 0 24 0; +#X connect 39 0 27 0; +#X connect 40 0 8 1; +#X connect 43 0 56 0; +#X connect 44 0 73 0; +#X connect 45 0 29 0; +#X connect 46 0 20 1; +#X connect 48 0 28 1; +#X connect 49 0 45 0; +#X connect 49 0 4 0; +#X connect 56 0 28 0; +#X connect 56 1 7 1; +#X connect 57 0 56 0; +#X connect 57 1 20 0; +#X connect 58 0 39 0; +#X connect 59 0 58 0; #X connect 60 0 59 0; -#X connect 60 1 22 0; -#X connect 61 0 41 0; -#X connect 62 0 61 0; -#X connect 63 0 62 0; +#X connect 61 0 36 0; +#X connect 63 0 34 1; +#X connect 63 1 34 0; #X connect 64 0 38 0; -#X connect 66 0 36 1; -#X connect 66 1 36 0; -#X connect 67 0 40 0; -#X connect 68 0 47 0; -#X connect 69 0 8 0; +#X connect 65 0 7 0; +#X connect 73 0 27 0; +#X connect 74 0 44 0; diff --git a/externals/gridflow/pd_examples/scratch_video.pd b/externals/gridflow/pd_examples/scratch_video.pd index c322b745..d7a38e7e 100644 --- a/externals/gridflow/pd_examples/scratch_video.pd +++ b/externals/gridflow/pd_examples/scratch_video.pd @@ -1,29 +1,28 @@ -#N canvas 622 70 580 592 10; -#X obj 109 21 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +#N canvas 503 45 580 510 10; +#X obj 109 94 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 ; -#X obj 109 329 listelement 1; -#X floatatom 109 352 5 0 0 0 - - -; -#X floatatom 132 244 5 0 0 0 - - -; -#X obj 109 305 route position; -#X obj 109 221 #in; -#X msg 142 167 open /home/alx/Documents/images/videos/bus_1.mov; -#X obj 112 391 hsl 128 15 1 320 0 0 empty empty empty -2 -6 0 8 -260818 --1 -1 3145 1; -#X obj -13 -85 cnv 15 580 30 empty empty empty 20 12 0 14 -233017 -66577 +#X obj 109 352 listelement 1; +#X floatatom 109 371 5 0 0 0 - - -; +#X floatatom 132 279 5 0 0 0 - - -; +#X obj 109 333 route position; +#X obj 109 256 #in; +#X msg 142 202 open /home/alx/Documents/images/videos/bus_1.mov; +#X obj 112 410 hsl 128 15 1 320 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj -13 0 cnv 15 580 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X obj -16 472 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 +#X obj -16 477 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text 16 476 GridFlow 0.8.0; -#X text 16 476 GridFlow 0.8.0; -#X text 0 -85 traveling.pd; -#X text 0 -72 Copyright 2003 Alexandre Castonguay; -#X text -1 -34 Use the mouse position to scratch the video \, a touchscreen +#X text 16 484 GridFlow 0.8.0; +#X text 16 484 GridFlow 0.8.0; +#X text 0 13 Copyright 2003 Alexandre Castonguay; +#X text 2 52 Use the mouse position to scratch the video \, a touchscreen works well.; #N canvas 0 0 450 300 decide_framerate 0; #X obj 6 56 - 160; #X floatatom 6 80 5 0 0 0 - - -; #X obj 55 122 hsl 128 15 20 150 0 0 empty empty empty -2 -6 0 8 -24198 --1 -1 5862 1; +-1 -1 0 1; #X obj 6 99 abs; #X floatatom 6 142 5 0 0 0 - - -; #X obj 6 121 / 3; @@ -44,81 +43,79 @@ works well.; #X connect 8 0 7 0; #X connect 9 0 6 0; #X connect 10 0 0 0; -#X restore 257 390 pd decide_framerate; -#X obj 257 414 s framerate; -#X obj 181 31 r framerate; -#X obj 109 279 #out window; -#X text 176 242 <-- frame number; -#X text 213 328 <-- get x values; -#X text 142 184 load your own until we get a bundled video for the +#X restore 257 409 pd decide_framerate; +#X obj 257 433 s framerate; +#X obj 188 92 r framerate; +#X obj 109 314 #out window; +#X text 176 277 <-- frame number; +#X text 213 351 <-- get x values; +#X text 142 219 load your own until we get a bundled video for the docs; -#X text 142 197 this one is 320 x 240; -#N canvas 0 0 450 300 frame_count 1; -#X msg 103 112 1; -#X floatatom 103 168 5 0 0 0 - - -; -#X obj 153 153 float \$1; -#X obj 103 86 shunt 2; -#X msg 173 69 1; -#X msg 173 46 0; -#X obj 103 140 + 1; -#X msg 147 112 -1; -#X msg 208 109 0; -#X obj 46 -34 inlet; -#X obj 231 68 inlet; -#X obj 113 212 outlet; -#X floatatom 147 -41 5 0 0 0 - - -; -#X obj 147 -19 > 160; -#X floatatom 147 8 5 0 0 0 - - -; -#X text 192 -20 <-- is the direction left or right on a width of 320 +#X text 142 232 this one is 320 x 240; +#N canvas 94 214 571 216 frame_count 0; +#X msg 16 -5 1; +#X floatatom 16 50 5 0 0 0 - - -; +#X obj 48 30 float \$1; +#X obj 16 -24 shunt 2; +#X obj 16 30 + 1; +#X msg 60 -5 -1; +#X msg 111 49 0; +#X obj 16 -54 inlet; +#X obj 111 30 inlet; +#X obj 16 102 outlet; +#X floatatom 100 -38 5 0 0 0 - - -; +#X obj 100 -22 > 160; +#X text 145 -23 <-- is the direction left or right on a width of 320 pixels; -#X text 242 109 <-- reset; -#X obj 147 -64 r position; -#X connect 0 0 6 0; +#X text 145 49 <-- reset; +#X obj 100 -57 r position; +#X obj 100 -3 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X connect 0 0 4 0; #X connect 1 0 2 0; -#X connect 1 0 11 0; -#X connect 2 0 6 1; +#X connect 1 0 9 0; +#X connect 2 0 4 1; #X connect 3 0 0 0; -#X connect 3 1 7 0; -#X connect 4 0 3 1; -#X connect 5 0 3 1; +#X connect 3 1 5 0; +#X connect 4 0 1 0; +#X connect 5 0 4 0; #X connect 6 0 1 0; -#X connect 7 0 6 0; -#X connect 8 0 1 0; -#X connect 9 0 3 0; -#X connect 10 0 8 0; -#X connect 12 0 13 0; -#X connect 13 0 14 0; -#X connect 14 0 3 1; -#X connect 17 0 12 0; -#X restore 109 113 pd frame_count; -#X obj 202 86 bng 15 250 50 0 empty empty empty 0 -6 0 8 -241291 -1 +#X connect 7 0 3 0; +#X connect 8 0 6 0; +#X connect 10 0 11 0; +#X connect 11 0 15 0; +#X connect 14 0 10 0; +#X connect 15 0 3 1; +#X restore 109 168 pd frame_count; +#X obj 202 141 bng 15 250 50 0 empty empty empty 0 -6 0 8 -241291 -1 -1; -#X text 226 85 <-- reset; -#X obj 13 391 s position; -#X msg 314 230 loop 1; -#X obj 206 266 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X text 226 140 <-- reset; +#X obj 93 433 s position; +#X msg 314 265 loop 1; +#X obj 206 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 224 62 r loopit; -#X obj 236 264 print loopit; -#X obj 109 56 metro 100.33; -#X obj 71 175 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 330 146 r loopit; +#X obj 236 299 print loopit; +#X obj 109 111 metro 100.33; +#X obj 91 257 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X connect 0 0 31 0; +#X text 0 0 scratch_video.pd; +#X connect 0 0 30 0; #X connect 1 0 2 0; #X connect 2 0 7 0; -#X connect 2 0 15 0; -#X connect 2 0 26 0; +#X connect 2 0 14 0; +#X connect 2 0 25 0; #X connect 4 0 1 0; -#X connect 5 0 18 0; +#X connect 5 0 17 0; #X connect 5 1 3 0; -#X connect 5 1 28 0; +#X connect 5 1 27 0; #X connect 6 0 5 0; -#X connect 15 0 16 0; -#X connect 17 0 31 1; -#X connect 18 0 4 0; -#X connect 23 0 5 0; -#X connect 24 0 23 1; -#X connect 27 0 5 0; -#X connect 28 0 30 0; -#X connect 31 0 23 0; -#X connect 32 0 5 0; +#X connect 14 0 15 0; +#X connect 16 0 30 1; +#X connect 17 0 4 0; +#X connect 22 0 5 0; +#X connect 23 0 22 1; +#X connect 26 0 5 0; +#X connect 27 0 29 0; +#X connect 30 0 22 0; +#X connect 31 0 5 0; diff --git a/externals/gridflow/pd_examples/spectrogram.pd b/externals/gridflow/pd_examples/spectrogram.pd index ff9f55e7..fb6730d2 100644 --- a/externals/gridflow/pd_examples/spectrogram.pd +++ b/externals/gridflow/pd_examples/spectrogram.pd @@ -1,14 +1,13 @@ -#N canvas 695 85 580 565 10; -#X msg 143 149 reset; -#X obj 27 -34 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 +#N canvas 370 65 588 508 10; +#X msg 147 208 reset; +#X obj 21 50 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 297 54 adc~; +#X obj 38 170 tabread4 array1; +#X obj 21 69 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 ; -#X obj 316 -15 adc~; -#X obj 28 110 tabread4 array1; -#X obj 7 10 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 -; -#X obj 351 -14 table array1 1024; -#X obj 290 138 loadbang; -#X obj 270 140 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 332 55 table array1 1024; +#X obj 208 212 loadbang; +#X obj 191 214 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 0 306 167 analysis 0; #X obj 24 -205 inlet~; @@ -20,90 +19,90 @@ #X connect 2 0 3 0; #X connect 2 1 3 1; #X connect 3 0 1 0; -#X restore 317 8 pd analysis; -#X obj 30 210 demux 2; -#X obj 373 186 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 --1 1; -#X obj 242 226 loadbang; -#X obj 219 225 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X restore 298 77 pd analysis; +#X obj 284 256 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 +-1 0; +#X obj 190 291 loadbang; +#X obj 173 293 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 27 34 for 0 320 1; -#X obj 29 129 * 2000; -#X text 392 187 black stripes; -#X text 391 200 graph; -#X obj 28 77 / 2; -#X text 77 129 <-- adding some extra gain; -#X obj 88 88 exp; -#X obj 28 55 demux 2; -#X obj 173 46 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 +#X obj 38 68 for 0 320 1; +#X obj 38 189 * 2000; +#X text 303 257 black stripes; +#X text 302 270 graph; +#X obj 38 117 / 2; +#X text 83 189 <-- adding some extra gain; +#X obj 81 138 exp; +#X obj 194 136 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 -1 0; -#X text 195 46 linear; -#X text 193 60 logarithmic; -#X obj 89 67 / 51; -#X obj 31 331 #fade; -#X obj 123 332 loadbang; -#X msg 72 331 16 4 1; -#X obj 27 -9 metro 23.22; -#X text 115 26 = 1000*1024/44100; -#X obj 29 149 #import ( 320 ); -#X obj 29 169 # *>>8; -#X obj 30 190 #fade 2; -#X obj 30 249 # inv+ 255; -#X obj 105 222 #outer <; -#X obj 105 241 # * 255; -#X obj 105 261 #transpose; -#X obj 30 287 #redim (120 320 1); -#X obj 31 309 #greyscale_to_rgb; -#X obj 31 353 #clip; -#X obj 31 375 #scale_by 2; -#X obj 31 404 #out window; -#X obj -15 449 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 216 136 linear; +#X text 214 150 logarithmic; +#X obj 82 117 / 51; +#X obj 38 395 #fade; +#X obj 130 396 loadbang; +#X msg 79 395 16 4 1; +#X obj 38 49 metro 23.22; +#X text 115 117 = 1000*1024/44100; +#X obj 38 208 #import ( 320 ); +#X obj 38 227 # *>>8; +#X obj 38 246 #fade 2; +#X obj 38 309 # inv+ 255; +#X obj 113 292 #outer <; +#X obj 113 311 # * 255; +#X obj 113 330 #transpose; +#X obj 38 357 #redim (120 320 1); +#X obj 38 376 #greyscale_to_rgb; +#X obj 38 414 #clip; +#X obj 38 433 #scale_by 2; +#X obj 38 452 #out window; +#X obj 6 476 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 456 GridFlow 0.8.0; -#X text -7 456 GridFlow 0.8.0; -#X obj -15 -85 cnv 15 580 30 empty empty empty 20 12 0 14 -233017 -66577 +#X text 14 483 GridFlow 0.8.0; +#X text 14 483 GridFlow 0.8.0; +#X obj 6 5 cnv 15 580 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text -2 -72 Copyright 2002 Mathieu Bouchard; -#X text -2 -85 spectrogram.pd; -#X obj 219 245 #for 120 0 -1; -#X obj 270 161 #for 0 320 1; -#X obj 270 184 # + 10; -#X connect 0 0 30 0; -#X connect 1 0 28 0; +#X text 19 5 spectrogram.pd; +#X obj 173 310 #for 120 0 -1; +#X obj 191 231 #for 0 320 1; +#X obj 191 250 # + 10; +#X text 19 18 Copyright 2004 Mathieu Bouchard; +#X obj 38 91 shunt 2; +#X obj 38 265 shunt 2; +#X connect 0 0 28 0; +#X connect 1 0 26 0; #X connect 2 0 8 0; #X connect 2 1 8 0; -#X connect 3 0 14 0; -#X connect 4 0 13 0; +#X connect 3 0 13 0; +#X connect 4 0 12 0; #X connect 6 0 7 0; -#X connect 7 0 49 0; -#X connect 9 0 33 0; -#X connect 9 1 34 0; -#X connect 10 0 9 1; -#X connect 11 0 12 0; -#X connect 12 0 48 0; -#X connect 13 0 20 0; -#X connect 14 0 30 0; -#X connect 17 0 3 0; -#X connect 19 0 3 0; -#X connect 20 0 17 0; -#X connect 20 1 24 0; -#X connect 21 0 20 1; -#X connect 24 0 19 0; -#X connect 25 0 39 0; -#X connect 26 0 27 0; -#X connect 27 0 25 1; -#X connect 28 0 13 0; -#X connect 30 0 31 0; -#X connect 31 0 32 0; -#X connect 32 0 9 0; -#X connect 33 0 37 0; +#X connect 7 0 46 0; +#X connect 9 0 50 1; +#X connect 10 0 11 0; +#X connect 11 0 45 0; +#X connect 12 0 49 0; +#X connect 13 0 28 0; +#X connect 16 0 3 0; +#X connect 18 0 3 0; +#X connect 19 0 49 1; +#X connect 22 0 18 0; +#X connect 23 0 37 0; +#X connect 24 0 25 0; +#X connect 25 0 23 1; +#X connect 26 0 12 0; +#X connect 28 0 29 0; +#X connect 29 0 30 0; +#X connect 30 0 50 0; +#X connect 31 0 35 0; +#X connect 32 0 33 0; +#X connect 33 0 34 0; #X connect 34 0 35 0; #X connect 35 0 36 0; -#X connect 36 0 37 0; +#X connect 36 0 23 0; #X connect 37 0 38 0; -#X connect 38 0 25 0; -#X connect 39 0 40 0; -#X connect 40 0 41 0; -#X connect 48 0 34 1; -#X connect 49 0 50 0; -#X connect 50 0 31 1; +#X connect 38 0 39 0; +#X connect 45 0 32 1; +#X connect 46 0 47 0; +#X connect 47 0 29 1; +#X connect 49 0 16 0; +#X connect 49 1 22 0; +#X connect 50 0 31 0; +#X connect 50 1 32 0; diff --git a/externals/gridflow/pd_examples/threshold.pd b/externals/gridflow/pd_examples/threshold.pd index 4a609930..0b90b07f 100644 --- a/externals/gridflow/pd_examples/threshold.pd +++ b/externals/gridflow/pd_examples/threshold.pd @@ -1,81 +1,78 @@ -#N canvas 720 79 579 617 10; -#X obj 40 121 @ -; -#X obj 40 144 @ max 0; -#X obj 40 167 @ ||; -#X obj 40 190 @ +; -#X obj 99 143 inv+ 0; -#X obj 40 -33 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +#N canvas 660 79 581 531 10; +#X obj 72 208 inv+ 0; +#X obj 40 8 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 99 57 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X obj 95 56 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 -; -#X floatatom 251 270 5 0 0 0 - - -; -#X obj 251 137 vsl 15 128 0 256 0 0 empty empty empty 0 -8 0 8 -260818 +#X floatatom 124 224 5 0 0 0 - - -; +#X obj 124 91 vsl 15 128 0 256 0 0 empty empty empty 0 -8 0 8 -260818 -1 -1 0 1; -#X obj 40 55 shunt 2; -#X obj 40 448 @out window; -#X text 6 100 simple per-channel threshold; -#X text 316 102 bluescreen luma threshold; -#X text 381 255 here we have a mask; -#X text 361 267 (alpha as separate image); -#X obj 327 356 @join 2; -#X text 386 295 make a RGBA image; -#X obj 310 137 t b a a; -#X text 218 398 = medium blue; -#X obj 297 290 t a a; -#X obj 131 449 fps; -#X floatatom 161 451 5 0 0 0 - - -; -#X obj 40 9 metro 100; -#X msg 70 397 240 320 3 # 0 0 170; -#X text 386 333 won't be necessary; -#X text 319 117 with alpha channel; -#X text 13 368 you could also load a picture; -#X text 13 380 instead of using uniform blue; -#X text 58 -31 1000/100 = 10 fps (max) (adjustable); -#X text 281 22 see also color_detect.pd; -#X obj 40 33 #camera; -#X obj -13 -86 cnv 15 580 30 empty empty empty 20 12 0 14 -233017 -66577 +#X obj 40 67 shunt 2; +#X text 7 104 simple per-channel threshold; +#X text 276 53 bluescreen luma threshold; +#X text 340 195 here we have a mask; +#X text 320 207 (alpha as separate image); +#X obj 257 278 @join 2; +#X text 346 226 make a RGBA image; +#X obj 270 88 t b a a; +#X text 210 379 = medium blue; +#X obj 257 221 t a a; +#X obj 121 416 fps; +#X floatatom 146 418 5 0 0 0 - - -; +#X obj 40 29 metro 100; +#X msg 70 378 240 320 3 # 0 0 170; +#X text 279 68 with alpha channel; +#X text 13 349 you could also load a picture; +#X text 13 361 instead of using uniform blue; +#X text 58 10 1000/100 = 10 fps (max) (adjustable); +#X obj 40 48 #camera; +#X obj -13 -45 cnv 15 580 30 empty empty empty 20 12 0 14 -233017 -66577 0; -#X text 0 -73 Copyright 2002 Mathieu Bouchard; -#X obj -15 499 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 +#X text 0 -32 Copyright 2002 Mathieu Bouchard; +#X obj -15 450 cnv 15 580 30 empty empty empty 20 12 0 14 -200249 -66577 0; -#X text -7 506 GridFlow 0.8.0; -#X text -7 506 GridFlow 0.8.0; -#X text 0 -86 threshold.pd; -#X obj 290 335 #store; -#X obj 290 314 #finished; -#X obj 354 204 # * 255; -#X obj 354 181 # >=; -#X obj 354 162 #rgb_to_greyscale; -#X text 384 320 this silly #finished; -#X text 388 347 in GridFlow 1; -#X obj 70 425 #draw_image put \, alpha 1; -#X connect 0 0 1 0; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 10 0; -#X connect 4 0 2 1; -#X connect 5 0 22 0; -#X connect 6 0 9 1; -#X connect 7 0 0 1; -#X connect 7 0 4 0; -#X connect 7 0 3 1; -#X connect 7 0 40 1; -#X connect 8 0 7 0; -#X connect 9 0 0 0; -#X connect 9 1 17 0; -#X connect 10 0 20 0; +#X text -7 457 GridFlow 0.8.0; +#X text -7 457 GridFlow 0.8.0; +#X text 0 -45 threshold.pd; +#X obj 257 259 #store; +#X obj 257 240 #finished; +#X obj 314 145 # * 255; +#X obj 314 126 # >=; +#X obj 314 107 #rgb_to_greyscale; +#X obj 70 397 #draw_image put \, alpha 1; +#X obj 40 166 # -; +#X obj 40 185 # max 0; +#X obj 40 208 # ||; +#X obj 40 227 # +; +#X obj 40 416 #out window; +#X text 387 -38 see also color_detect.pd; +#X connect 0 0 38 1; +#X connect 1 0 17 0; +#X connect 2 0 5 1; +#X connect 3 0 0 0; +#X connect 3 0 33 1; +#X connect 3 0 36 1; +#X connect 3 0 39 1; +#X connect 4 0 3 0; +#X connect 5 0 36 0; +#X connect 5 1 12 0; +#X connect 10 0 35 1; +#X connect 12 0 18 0; +#X connect 12 1 14 0; +#X connect 12 2 34 0; +#X connect 14 0 31 0; +#X connect 14 1 30 1; +#X connect 15 0 16 0; #X connect 17 0 23 0; -#X connect 17 1 19 0; -#X connect 17 2 41 0; -#X connect 19 0 38 0; -#X connect 19 1 37 1; -#X connect 20 0 21 0; -#X connect 22 0 30 0; -#X connect 23 0 44 0; -#X connect 30 0 9 0; -#X connect 37 0 15 0; -#X connect 38 0 37 0; -#X connect 39 0 15 1; -#X connect 40 0 39 0; -#X connect 41 0 40 0; -#X connect 44 0 10 0; +#X connect 18 0 35 0; +#X connect 23 0 5 0; +#X connect 30 0 10 0; +#X connect 31 0 30 0; +#X connect 32 0 10 1; +#X connect 33 0 32 0; +#X connect 34 0 33 0; +#X connect 35 0 40 0; +#X connect 36 0 37 0; +#X connect 37 0 38 0; +#X connect 38 0 39 0; +#X connect 39 0 40 0; +#X connect 40 0 15 0; diff --git a/externals/gridflow/pd_examples/transform.pd b/externals/gridflow/pd_examples/transform.pd index a4d5b653..d8785933 100644 --- a/externals/gridflow/pd_examples/transform.pd +++ b/externals/gridflow/pd_examples/transform.pd @@ -1,21 +1,21 @@ #N canvas 726 225 674 481 10; -#X obj 146 296 #remap_image; -#X obj 146 381 #out window; -#X obj 125 94 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 +#X obj 136 286 #remap_image; +#X obj 136 324 #out window; +#X obj 125 103 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 ; #X obj 294 376 # -; #X obj 294 202 t a a a; -#X obj 380 273 # % 2; -#X obj 380 297 # * -2; -#X obj 380 318 # + 1; -#X obj 316 342 # *; -#X obj 425 245 # / 2; -#X obj 428 184 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -261681 --1 -1 12700 1; -#X obj 316 301 # -; -#X obj 425 207 t f; +#X obj 356 261 # % 2; +#X obj 356 280 # * -2; +#X obj 356 299 # + 1; +#X obj 316 300 # *; +#X obj 403 230 # / 2; +#X obj 377 167 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -261681 +-1 -1 0 1; +#X obj 316 281 # -; +#X obj 374 190 t f; #X obj 316 262 # %; -#X obj 380 248 # /; +#X obj 356 242 # /; #X obj 186 214 #camera; #X obj 125 120 metro 10; #X obj 8 442 cnv 15 720 30 empty empty empty 20 12 0 14 -200249 -66577 @@ -27,13 +27,13 @@ 0; #X text 4 -2 Transform.pd; #X obj 95 215 #in r001.jpg; -#X obj 125 155 shunt; -#X obj 176 155 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +#X obj 125 139 shunt; +#X obj 164 140 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; #X text 68 32 By Mathieu Bouchard \, based on Clifford Smith's 'Transform' effect that is part of Fukuchi Kentaro's EffecTV : http://effectv.sourceforge.net ; -#X text 199 153 <-- choose from a still image or camera input; +#X text 187 138 <-- choose from a still image or camera input; #X connect 0 0 1 0; #X connect 0 1 4 0; #X connect 2 0 16 0; diff --git a/externals/gridflow/pd_examples/videodev_effects.pd b/externals/gridflow/pd_examples/videodev_effects.pd index b11f026f..36782931 100644 --- a/externals/gridflow/pd_examples/videodev_effects.pd +++ b/externals/gridflow/pd_examples/videodev_effects.pd @@ -1,7 +1,7 @@ -#N canvas 106 79 569 546 10; -#X obj 86 397 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 +#N canvas 522 50 597 660 10; +#X obj 85 386 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X obj 72 149 # max 0; +#X obj 71 138 # max 0; #N canvas 52 305 399 248 motion 0; #X obj 60 49 inlet; #X obj 60 72 # +; @@ -21,24 +21,25 @@ #X connect 4 1 9 0; #X connect 8 0 4 0; #X connect 9 0 1 1; -#X restore 130 218 pd motion fade; -#X obj 28 263 shunt 2; -#X obj 72 69 #downscale_by 2 smoothly; -#X obj 28 398 shunt 2; -#X obj 82 265 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X restore 129 207 pd motion fade; +#X obj 27 252 shunt 2; +#X obj 71 58 #downscale_by 2 smoothly; +#X obj 27 387 shunt 2; +#X obj 81 254 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X obj 87 88 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X obj 86 77 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X obj 8 7 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; -#X obj 316 261 fork; -#X obj 28 48 shunt 2; -#X msg 286 243 256; -#X obj 28 474 #out window; -#X obj 84 49 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X obj 26 -36 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1 ; -#X obj 28 515 print; -#X obj 285 284 #for 0 256 1; -#X floatatom 316 242 5 0 0 0 - - -; +#X obj 315 250 fork; +#X obj 27 37 shunt 2; +#X msg 285 232 256; +#X obj 27 463 #out window; +#X obj 83 38 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +; +#X obj 27 504 print; +#X obj 284 273 #for 0 256 1; +#X floatatom 315 231 5 0 0 0 - - -; #N canvas 67 462 236 230 detect 0; #X obj 66 59 # * ( -1 -1 2 ); #X obj 66 171 # max 0; @@ -53,19 +54,19 @@ #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 6 0 1 0; -#X restore 437 236 pd detect blue; -#X obj 72 285 #outer ignore ( 0 ); -#X obj 103 131 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 5700 1; -#X obj 28 189 shunt 2; -#X obj 170 335 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +#X restore 436 225 pd detect blue; +#X obj 71 274 #outer ignore ( 0 ); +#X obj 102 120 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 27 178 shunt 2; +#X obj 169 324 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1; -#X obj 28 335 shunt 2; -#X obj 28 495 fps detailed; -#X obj 286 223 loadbang; -#X obj 87 335 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X obj 27 324 shunt 2; +#X obj 27 484 fps detailed; +#X obj 285 212 loadbang; +#X obj 86 324 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X obj 72 307 #store; +#X obj 71 296 #store; #N canvas 81 205 480 500 sort 0; #X obj 10 305 # * ( 1 0 ); #X obj 180 260 # * 255; @@ -142,13 +143,13 @@ #X connect 30 0 7 1; #X connect 31 0 27 0; #X connect 31 0 30 0; -#X restore 87 355 pd sort me out; -#X obj 285 304 # gamma; -#X obj 72 129 # -; -#X obj 82 191 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X restore 86 344 pd sort me out; +#X obj 284 293 # gamma; +#X obj 71 118 # -; +#X obj 81 180 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 ; -#X text 74 238 enable gamma correction; -#X obj 285 266 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X text 73 227 enable gamma correction; +#X obj 284 255 bng 15 250 50 0 empty empty empty 0 -6 0 8 -241291 -1 -1; #N canvas 372 198 399 273 motion 0; #X obj 15 113 # << 2; @@ -180,10 +181,10 @@ #X connect 11 0 10 1; #X connect 12 0 13 1; #X connect 13 0 3 1; -#X restore 72 109 pd motion detection; -#X obj 105 335 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -262144 -1 +#X restore 71 98 pd motion detection; +#X obj 104 324 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -241291 -1 -1 0; -#X text 126 149 noise reduction (on find-edges only); +#X text 125 138 noise reduction (on find-edges only); #N canvas 67 462 236 230 detect 0; #X obj 66 171 # max 0; #X obj 66 31 inlet; @@ -198,18 +199,18 @@ #X connect 3 0 2 0; #X connect 5 0 0 0; #X connect 6 0 5 0; -#X restore 437 217 pd detect red; -#X obj 27 8 metro 33.3667; -#X obj 28 69 t a a; -#X text 101 49 Smaller Picture; -#X obj 28 89 shunt 2; -#X obj 211 96 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -1 +#X restore 436 206 pd detect red; +#X obj 26 -8 metro 33.3667; +#X obj 27 58 t a a; +#X text 100 38 Smaller Picture; +#X obj 27 78 shunt 2; +#X obj 210 85 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 -1 0; -#X obj 163 427 #centroid; -#X obj 163 448 #export_list; -#X floatatom 165 487 5 0 0 0 - - -; -#X obj 164 467 unpack 0 0; -#X floatatom 229 487 5 0 0 0 - - -; +#X obj 162 416 #centroid; +#X obj 162 437 #export_list; +#X floatatom 164 476 5 0 0 0 - - -; +#X obj 163 456 unpack 0 0; +#X floatatom 228 476 5 0 0 0 - - -; #N canvas 639 147 477 267 crosshair 0; #X obj 12 224 outlet; #X obj 12 9 inlet; @@ -230,22 +231,31 @@ #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 8 0 4 0; -#X restore 72 428 pd crosshair; -#X msg 128 8 open dc1394; -#X msg 217 9 open mpeg file images/movies/washington_zoom_in.mpeg; -#X msg 217 29 open xine images/movies/washington_zoom_in.mpeg; -#X obj 28 27 #camera; -#X obj 186 30 #in; -#X obj 104 192 #fade; -#X msg 145 194 32 16 4; -#X obj 28 450 t a; -#X text 231 110 emboss; -#X text 230 96 hilite; -#X text 110 397 designed to work with "hilite" above; -#X obj 281 96 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -1 +#X restore 71 417 pd crosshair; +#X msg 127 -9 open dc1394; +#X msg 216 -8 open mpeg file images/movies/washington_zoom_in.mpeg +; +#X msg 216 12 open xine images/movies/washington_zoom_in.mpeg; +#X obj 27 16 #camera; +#X obj 185 13 #in; +#X obj 103 181 #fade; +#X msg 144 181 32 16 4; +#X obj 27 439 t a; +#X text 230 99 emboss; +#X text 229 85 hilite; +#X text 109 386 designed to work with "hilite" above; +#X obj 280 85 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -241291 -1 -1 0; -#X text 300 96 motion; -#X text 301 110 presence; +#X text 299 85 motion; +#X text 300 99 presence; +#X obj -15 542 cnv 15 620 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text -7 550 GridFlow 0.8.0; +#X text -7 550 GridFlow 0.8.0; +#X obj -13 -85 cnv 15 620 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 0 -72 Copyright 2002 Mathieu Bouchard; +#X text 0 -86 videodev_effects.pd; #X connect 0 0 5 1; #X connect 1 0 20 0; #X connect 2 0 3 0; diff --git a/externals/gridflow/pd_examples/waves.pd b/externals/gridflow/pd_examples/waves.pd index c9706ca4..14dd10e5 100644 --- a/externals/gridflow/pd_examples/waves.pd +++ b/externals/gridflow/pd_examples/waves.pd @@ -1,10 +1,8 @@ -#N canvas 366 97 753 590 10; -#X obj 265 207 #greyscale_to_rgb; -#X obj 251 350 # min 255; -#X obj 271 5 loadbang; -#X obj 211 25 fork; -#X obj 251 389 #out x11; -#X obj 313 409 print; +#N canvas 461 0 783 699 10; +#X obj 245 341 #greyscale_to_rgb; +#X obj 167 66 loadbang; +#X obj 107 85 fork; +#X obj 241 497 print; #N canvas 23 304 369 368 mouse 0; #X text 109 189 coordinates; #X obj 56 189 outlet; @@ -29,42 +27,41 @@ #X connect 11 0 3 0; #X connect 11 1 12 0; #X connect 12 0 6 0; -#X restore 251 428 pd mouse click/drag; -#X obj 12 39 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1 -; -#N canvas 637 335 419 287 lighting 0; -#X obj 56 243 outlet; +#X restore 235 516 pd mouse click/drag; +#X obj 10 49 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#N canvas 637 335 413 236 lighting 0; +#X obj 56 203 outlet; #X obj 17 9 inlet; -#X obj 86 138 #outer & ( -1 0 0 ); -#X text 91 100 produce red/cyan from horiz differences; -#X text 64 160 produce white/black from vertical differences; -#X obj 56 199 #outer & ( -1 -1 0 ); -#X obj 56 222 # +; +#X text 91 65 produce red/cyan from horiz differences; +#X text 64 123 produce white/black from vertical differences; +#X obj 56 177 # +; #X obj 108 10 #dim; #X obj 140 10 #export_list; -#X obj 56 29 #redim ( ); #X obj 56 9 t a a; #X obj 56 49 t a a; #X msg 141 30 \$1 \$2; -#X obj 86 117 #convolve ( 1 2 # ) \, op ignore \, fold inv+; -#X obj 56 177 #convolve ( 2 1 # ) \, op ignore \, fold inv+; -#X connect 1 0 10 0; -#X connect 2 0 6 1; +#X obj 56 29 #redim (); +#X obj 86 82 #convolve (1 2 #) \, op ignore \, fold inv+; +#X obj 86 101 #outer & (-1 0 0); +#X obj 56 139 #convolve (2 1 #) \, op ignore \, fold inv+; +#X obj 56 158 #outer & (-1 -1 0); +#X connect 1 0 7 0; +#X connect 4 0 0 0; #X connect 5 0 6 0; -#X connect 6 0 0 0; -#X connect 7 0 8 0; -#X connect 8 0 12 0; -#X connect 9 0 11 0; -#X connect 10 0 9 0; -#X connect 10 1 7 0; -#X connect 11 0 14 0; -#X connect 11 1 13 0; -#X connect 12 0 9 1; -#X connect 13 0 2 0; -#X connect 14 0 5 0; -#X restore 216 242 pd lighting; -#X obj 251 447 # / 2; -#X msg 138 46 \$1 \$2 1 # 0; +#X connect 6 0 9 0; +#X connect 7 0 10 0; +#X connect 7 1 5 0; +#X connect 8 0 13 0; +#X connect 8 1 11 0; +#X connect 9 0 10 1; +#X connect 10 0 8 0; +#X connect 11 0 12 0; +#X connect 12 0 4 1; +#X connect 13 0 14 0; +#X connect 14 0 4 0; +#X restore 235 362 pd lighting; +#X obj 235 535 # / 2; +#X msg 107 104 \$1 \$2 1 # 0; #N canvas 137 251 392 303 finger 0; #X obj 149 39 #redim ( 4 2 ); #X obj 71 16 inlet; @@ -87,11 +84,10 @@ #X connect 7 0 5 1; #X connect 9 0 6 0; #X connect 10 0 3 0; -#X restore 292 519 pd finger; -#X obj 245 25 s size; -#X obj 251 370 #scale_by 2; -#X obj 80 142 #store; -#X obj 312 389 fps detailed; +#X restore 206 634 pd finger; +#X obj 141 85 s size; +#X obj 235 438 #scale_by 2; +#X obj 10 168 #store; #N canvas 53 323 453 223 wave 0; #X obj 26 20 inlet; #X obj 28 182 outlet; @@ -103,7 +99,7 @@ #X obj 28 158 # *>>8 242; #X text 105 159 amortizing by ~5.5%; #X obj 24 46 t a a; -#X obj 54 81 #convolve ( 3 3 # 1 4 1 4 0 4 ) \, seed 8; +#X obj 54 81 #convolve (3 3 # 1 4 1 4 0 4) \, seed 8; #X connect 0 0 9 0; #X connect 5 0 7 0; #X connect 6 0 5 0; @@ -111,38 +107,33 @@ #X connect 9 0 5 1; #X connect 9 1 10 0; #X connect 10 0 6 0; -#X restore 80 203 pd wave equation; -#X obj 249 515 t a; -#X obj 117 122 t a; -#X obj 251 330 # max 0; -#X obj 265 188 # >> 1; -#X obj 31 63 s metro; -#X msg 211 5 240 320; -#X text 441 19 Copyright (c) 2003 \, 2004 by Mathieu Bouchard; -#X text 481 72 (Best complemented with a touchscreen); -#X text 441 2 waves.pd; -#X obj 376 141 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -262144 -258699 --1 2; -#X text 395 155 height greys; -#X obj 298 103 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -258699 +#X restore 10 206 pd wave equation; +#X obj 162 634 t a; +#X obj 107 123 t a; +#X obj 245 317 # >> 1; +#X obj 36 85 s metro; +#X msg 107 66 240 320; +#X text 491 65 (Best complemented with a touchscreen); +#X obj 341 244 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -262144 -258699 +-1 0; +#X text 359 259 height greys; +#X obj 294 205 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -258699 -1 0; -#X text 317 102 plain; -#X text 318 118 line-art; -#X text 315 46 smooth; -#X obj 296 46 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -258699 +#X text 312 204 plain; +#X text 312 220 line-art; +#X text 309 153 smooth; +#X obj 292 153 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -258699 -1 0; -#X text 316 60 raw; -#X obj 443 379 hradio 18 1 1 4 empty empty _1__2__3__4_ 0 -4 0 8 -262144 --258699 -1 1; -#X text 441 354 scale by...; -#X obj 443 400 + 1; -#X obj 664 129 loadbang; -#X obj 557 331 #in; -#X obj 584 305 #camera_control; -#X obj 558 284 spigot; -#X obj 605 285 tgl 15 0 empty empty empty 18 8 0 8 -241291 -1 -62784 -1 1; -#X obj 558 264 r metro; +#X text 310 167 raw; +#X obj 417 503 hradio 18 1 1 4 empty empty _1__2__3__4_ 0 -4 0 8 -262144 +-258699 -1 0; +#X text 415 482 scale by...; +#X obj 417 523 + 1; +#X obj 573 105 loadbang; +#X obj 573 276 spigot; +#X obj 620 277 tgl 15 0 empty empty empty 18 8 0 8 -241291 -1 -62784 +0 1; +#X obj 573 256 r metro; #N canvas 242 284 365 231 line-art 0; #X obj 32 123 # << 8; #X obj 32 37 inlet; @@ -159,181 +150,211 @@ #X connect 5 0 6 0; #X connect 6 0 0 0; #X connect 7 0 5 0; -#X restore 283 142 pd line-art; -#X text 560 214 Background colour; -#X text 625 285 enable video; -#X msg 584 325 open r001.jpg \, bang; -#X text 394 141 four-colour emboss; -#X obj 142 402 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 1 +#X restore 260 243 pd line-art; +#X text 628 129 Background colour; +#X text 637 277 enable video; +#X text 357 244 four-colour emboss; +#X obj 325 562 tgl 15 1 empty empty empty 0 -6 0 8 -241291 -1 -1 1 1; -#X obj 88 377 r metro; -#X obj 88 441 @! rand; -#X msg 87 421 240 320; -#X text 160 399 rain; -#X text 558 3 bundled with GridFlow 0.7.7; -#X obj 240 100 # >> 2; -#X text 378 36 Originally made for Alexandre Castonguay's "DIGITALE" +#X obj 278 542 r metro; +#X text 342 561 rain; +#X obj 235 204 # >> 2; +#X text 388 36 Originally made for Alexandre Castonguay's "DIGITALE" ; -#X text 495 53 But suitable for a lot more uses :-); -#X msg 599 129 3 # 128; -#X obj 557 154 #color; -#X obj 239 121 shunt 2; -#X obj 239 59 shunt 2; -#X obj 403 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 +#X text 505 50 But suitable for a lot more uses :-); +#X msg 573 124 3 # 128; +#X obj 573 143 #color; +#X obj 235 223 shunt 2; +#X obj 235 166 shunt 2; +#X obj 349 618 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262131 -1 -1 2 256; -#X obj 403 503 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 +#X obj 349 632 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262131 -1 -1 2 256; -#X obj 359 519 #pack 2; -#X obj 216 291 # +; -#X obj 332 302 #store; -#X obj 421 236 shunt 2; -#X obj 477 232 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -258699 +#X obj 235 400 # +; +#X obj 372 449 #store; +#X obj 396 381 shunt 2; +#X obj 452 376 vradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -258699 -1 0; -#X text 495 230 plain; -#X text 495 248 refraction; -#X obj 216 263 t a; +#X text 470 375 plain; +#X text 470 392 refraction; +#X obj 235 381 t a; #N canvas 203 363 443 300 heightmap2indexmap 0; -#X obj 48 279 outlet; +#X obj 48 220 outlet; #X obj 9 8 inlet; -#X obj 48 159 # +; +#X obj 48 143 # +; #X obj 100 9 #dim; #X obj 132 9 #export_list; -#X obj 48 28 #redim ( ); #X obj 48 8 t a a; #X obj 48 48 t a a; -#X msg 133 29 \$1 \$2; -#X obj 78 92 #outer & ( -1 0 ); -#X obj 48 137 #outer & ( 0 -1 ); -#X obj 48 251 # +; -#X obj 73 251 #for ( 0 0 ) ( 240 320 ) ( 1 1 ); -#X obj 116 229 loadbang; -#X obj 84 229 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X msg 132 28 \$1 \$2; +#X obj 48 201 # +; +#X obj 90 181 loadbang; +#X obj 73 181 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 48 182 # >> 1; -#X obj 48 115 #convolve ( 2 1 # ) \, op ignore \, fold inv+; -#X obj 78 71 #convolve ( 1 2 # ) \, op ignore \, fold inv+; -#X connect 1 0 6 0; -#X connect 2 0 15 0; +#X obj 48 162 # >> 1; +#X obj 78 67 #convolve (1 2 #) \, op ignore \, fold inv+; +#X obj 78 86 #outer & (-1 0); +#X obj 48 105 #convolve (2 1 #) \, op ignore \, fold inv+; +#X obj 48 124 #outer & (0 -1); +#X obj 73 201 #for (0 0) (240 320) (1 1); +#X obj 48 28 #redim (); +#X connect 1 0 5 0; +#X connect 2 0 11 0; #X connect 3 0 4 0; -#X connect 4 0 8 0; -#X connect 5 0 7 0; -#X connect 6 0 5 0; -#X connect 6 1 3 0; -#X connect 7 0 16 0; -#X connect 7 1 17 0; -#X connect 8 0 5 1; -#X connect 9 0 2 1; -#X connect 10 0 2 0; -#X connect 11 0 0 0; -#X connect 12 0 11 1; -#X connect 13 0 12 0; -#X connect 14 0 12 0; -#X connect 15 0 11 0; -#X connect 16 0 10 0; -#X connect 17 0 9 0; -#X restore 332 281 pd heightmap2indexmap; -#X obj 11 63 bng 15 250 50 0 empty empty empty 0 -6 0 8 -241291 -1 +#X connect 4 0 7 0; +#X connect 5 0 17 0; +#X connect 5 1 3 0; +#X connect 6 0 14 0; +#X connect 6 1 12 0; +#X connect 7 0 17 1; +#X connect 8 0 0 0; +#X connect 9 0 16 0; +#X connect 10 0 16 0; +#X connect 11 0 8 0; +#X connect 12 0 13 0; +#X connect 13 0 2 1; +#X connect 14 0 15 0; +#X connect 15 0 2 0; +#X connect 16 0 8 1; +#X connect 17 0 6 0; +#X restore 372 430 pd heightmap2indexmap; +#X obj -8 82 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 372 411 spigot; +#X text 359 274 no reflection; +#X obj 235 286 shunt 3; +#X obj 235 243 t a; +#X obj 293 317 # put 0; +#X obj 162 615 shunt 2; +#X obj 206 596 shunt 2; +#X obj 10 66 metro 33.3667; +#X obj 10 187 shunt 2; +#X text 80 188 freeze time; +#X obj 63 188 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 1 +; +#X obj 132 123 r feedback; +#X obj 162 653 s feedback; +#X obj 10 226 t a; +#X obj -13 5 cnv 15 780 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj -15 671 cnv 15 780 30 empty empty empty 20 12 0 14 -200249 -66577 +0; +#X text -7 679 GridFlow 0.8.0; +#X text -7 679 GridFlow 0.8.0; +#X text 0 4 waves.pd; +#X obj 573 296 #camera; +#X obj 555 276 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; -#X obj 332 228 spigot; -#X text 397 170 no reflection; -#X obj 239 167 shunt 3; -#X obj 239 145 t a; -#X obj 313 188 # put 0; -#X obj 255 491 shunt 2; -#X obj 325 493 shunt 2; -#X obj 87 401 shunt 2; -#X obj 31 39 metro 33.3667; -#X obj 80 171 shunt 2; -#X text 154 173 freeze time; -#X obj 137 173 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -1 -1 0 -1; -#X obj 131 100 r feedback; -#X obj 229 543 s feedback; -#X obj 124 264 t a; -#X obj 239 80 #convolve ( 2 2 # ) \, op ignore; -#X obj 571 403 #yuv_to_rgb; -#X text 500 501 pas de reflection \, + yuv; -#X connect 0 0 70 0; -#X connect 1 0 13 0; -#X connect 2 0 22 0; -#X connect 3 0 10 0; -#X connect 3 1 12 0; -#X connect 4 0 15 0; -#X connect 4 0 6 0; -#X connect 6 0 9 0; -#X connect 6 1 79 0; -#X connect 7 0 81 0; -#X connect 8 0 70 0; -#X connect 9 0 11 1; -#X connect 10 0 18 0; -#X connect 11 0 17 0; -#X connect 13 0 4 0; -#X connect 14 0 82 0; -#X connect 15 0 5 0; -#X connect 16 0 87 0; -#X connect 17 0 86 0; -#X connect 18 0 14 1; -#X connect 18 0 60 0; -#X connect 19 0 1 0; -#X connect 20 0 0 0; -#X connect 22 0 3 0; -#X connect 26 0 75 1; -#X connect 28 0 59 1; -#X connect 32 0 60 1; -#X connect 34 0 36 0; -#X connect 36 0 9 1; -#X connect 36 0 13 1; -#X connect 37 0 57 0; -#X connect 38 0 89 0; -#X connect 39 0 38 0; -#X connect 40 0 38 0; -#X connect 41 0 40 1; -#X connect 42 0 40 0; -#X connect 43 0 76 0; -#X connect 46 0 38 0; -#X connect 48 0 78 1; -#X connect 48 0 79 1; -#X connect 48 0 80 1; -#X connect 49 0 80 0; -#X connect 50 0 11 1; -#X connect 51 0 50 0; -#X connect 54 0 59 0; -#X connect 57 0 58 0; -#X connect 58 0 66 0; -#X connect 59 0 76 0; -#X connect 59 1 43 0; -#X connect 60 0 88 0; -#X connect 60 1 59 0; -#X connect 61 0 63 0; -#X connect 62 0 63 1; -#X connect 63 0 11 2; -#X connect 64 0 19 0; -#X connect 65 0 64 1; -#X connect 66 0 64 1; -#X connect 66 1 65 1; -#X connect 67 0 66 1; -#X connect 67 0 73 1; -#X connect 70 0 64 0; -#X connect 71 0 65 0; -#X connect 72 0 21 0; -#X connect 72 0 14 0; -#X connect 73 0 71 0; -#X connect 75 0 8 0; -#X connect 75 1 20 0; -#X connect 75 2 77 0; -#X connect 76 0 75 0; -#X connect 76 0 73 0; -#X connect 77 0 0 0; -#X connect 78 0 17 0; -#X connect 78 1 11 0; -#X connect 79 0 78 1; -#X connect 80 1 51 0; -#X connect 81 0 14 0; -#X connect 81 0 21 0; -#X connect 82 0 16 0; -#X connect 82 1 87 0; -#X connect 84 0 82 1; -#X connect 85 0 18 0; -#X connect 87 0 78 0; -#X connect 88 0 54 0; -#X connect 89 0 77 1; +#X obj 573 315 spigot; +#X obj 620 316 tgl 15 0 empty empty empty 18 8 0 8 -241291 -1 -62784 +0 1; +#X text 637 315 test camera output; +#X obj 10 85 t b; +#X obj 278 561 spigot; +#X obj 620 334 sel 0 1; +#X msg 642 353 open window; +#X obj 573 334 #out; +#X msg 620 372 close; +#X obj 241 478 fps detailed \, period 2; +#X obj 574 226 #in; +#X msg 574 207 load r001.jpg; +#X obj 324 580 r size; +#X obj 278 580 #store; +#X obj 278 599 # rand; +#X obj 235 457 #out window; +#X obj 235 419 #clip; +#X obj 235 185 #convolve (2 2 #) \, op ignore; +#X obj 349 651 #pack 2; +#X text 0 18 Copyright 2003 \, 2004 \, 2005 Mathieu Bouchard; +#X connect 0 0 57 0; +#X connect 1 0 18 0; +#X connect 2 0 8 0; +#X connect 2 1 10 0; +#X connect 4 0 7 0; +#X connect 4 1 66 0; +#X connect 5 0 67 0; +#X connect 6 0 57 0; +#X connect 7 0 9 1; +#X connect 8 0 15 0; +#X connect 9 0 14 0; +#X connect 11 0 96 0; +#X connect 12 0 68 0; +#X connect 13 0 73 0; +#X connect 14 0 72 0; +#X connect 15 0 12 1; +#X connect 15 0 48 0; +#X connect 16 0 0 0; +#X connect 18 0 2 0; +#X connect 20 0 62 1; +#X connect 22 0 47 1; +#X connect 26 0 48 1; +#X connect 28 0 30 0; +#X connect 30 0 7 1; +#X connect 30 0 11 1; +#X connect 31 0 45 0; +#X connect 32 0 79 0; +#X connect 33 0 32 1; +#X connect 34 0 32 0; +#X connect 35 0 63 0; +#X connect 39 0 65 1; +#X connect 39 0 66 1; +#X connect 39 0 85 1; +#X connect 40 0 85 0; +#X connect 42 0 47 0; +#X connect 45 0 46 0; +#X connect 46 0 53 0; +#X connect 47 0 63 0; +#X connect 47 1 35 0; +#X connect 48 0 98 0; +#X connect 48 1 47 0; +#X connect 49 0 99 0; +#X connect 50 0 99 1; +#X connect 51 0 97 0; +#X connect 52 0 51 1; +#X connect 53 0 51 1; +#X connect 53 1 52 1; +#X connect 54 0 53 1; +#X connect 54 0 60 1; +#X connect 57 0 51 0; +#X connect 58 0 52 0; +#X connect 59 0 84 0; +#X connect 60 0 58 0; +#X connect 62 0 6 0; +#X connect 62 1 16 0; +#X connect 62 2 64 0; +#X connect 63 0 62 0; +#X connect 63 0 60 0; +#X connect 64 0 0 0; +#X connect 65 0 14 0; +#X connect 65 1 9 0; +#X connect 66 0 65 1; +#X connect 67 0 84 0; +#X connect 68 0 13 0; +#X connect 68 1 73 0; +#X connect 70 0 68 1; +#X connect 71 0 15 0; +#X connect 73 0 65 0; +#X connect 79 0 53 0; +#X connect 79 0 81 0; +#X connect 80 0 79 0; +#X connect 81 0 88 0; +#X connect 82 0 81 1; +#X connect 82 0 86 0; +#X connect 84 0 17 0; +#X connect 84 0 12 0; +#X connect 85 0 94 0; +#X connect 86 0 89 0; +#X connect 86 1 87 0; +#X connect 87 0 88 0; +#X connect 89 0 88 0; +#X connect 90 0 3 0; +#X connect 91 0 53 1; +#X connect 92 0 91 0; +#X connect 93 0 94 1; +#X connect 94 0 95 0; +#X connect 95 0 9 1; +#X connect 96 0 4 0; +#X connect 96 0 90 0; +#X connect 97 0 11 0; +#X connect 98 0 42 0; +#X connect 99 0 9 2; diff --git a/externals/gridflow/pd_help/@cast.pd b/externals/gridflow/pd_help/@cast.pd index 92543dee..e8f18fa8 100644 --- a/externals/gridflow/pd_help/@cast.pd +++ b/externals/gridflow/pd_help/@cast.pd @@ -4,17 +4,17 @@ the same values after type conversion. note that while casting to a smaller type \, overflowing values will be truncated.; #X text 626 13 gridflow; -#X text 142 58 numbertypes are: uint8 \, int16 \, int32 \, int64 \, +#X text 144 53 numbertypes are: uint8 \, int16 \, int32 \, int64 \, float32 \, float64. see doc/architecture.html for more info.; #X obj 126 90 nbx 8 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 --262144 -1 -1 3.1416 256; +-262144 -1 -1 57.1416 256; #X obj 115 136 @pack 4 float32; #X obj 78 185 @store; #X obj 78 136 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 14 136 print it:; #X obj 136 234 @print; -#X obj 78 205 t a a a a; +#X obj 44 210 t a a a a; #X obj 78 354 @print; #X obj 97 314 @print; #X obj 116 254 @cast uint8; @@ -22,21 +22,30 @@ float32 \, float64. see doc/architecture.html for more info.; #X obj 97 294 @cast int32; #X obj 78 334 @cast float64; #X obj 216 90 nbx 8 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 --262144 -1 -1 42 256; +-262144 -1 -1 145 256; #X obj 126 110 nbx 8 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 --262144 -1 -1 2004 256; +-262144 -1 -1 2027 256; #X obj 216 110 nbx 8 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 1e+10 256; #X obj 118 158 @redim ( 2 2 ); #X text 182 295 normally the default; +#X floatatom 70 87 5 0 0 0 - - -; +#X obj 60 60 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 +-262144 -1 -1 0 256; +#X obj 255 176 display; +#X obj 266 217 display; +#X obj 332 217 display; #X connect 4 0 5 0; #X connect 5 0 20 0; #X connect 6 0 10 0; #X connect 7 0 6 0; #X connect 10 0 16 0; +#X connect 10 0 26 0; #X connect 10 1 15 0; #X connect 10 2 13 0; +#X connect 10 2 25 0; #X connect 10 3 9 0; +#X connect 10 3 24 0; #X connect 13 0 14 0; #X connect 15 0 12 0; #X connect 16 0 11 0; @@ -44,3 +53,5 @@ float32 \, float64. see doc/architecture.html for more info.; #X connect 18 0 5 2; #X connect 19 0 5 3; #X connect 20 0 6 1; +#X connect 22 0 5 0; +#X connect 23 0 5 1; diff --git a/externals/gridflow/pd_help/help_record.pd b/externals/gridflow/pd_help/help_record.pd new file mode 100644 index 00000000..9d963b3d --- /dev/null +++ b/externals/gridflow/pd_help/help_record.pd @@ -0,0 +1,29 @@ +#N canvas 716 268 675 409 10; +#X obj 79 104 #camera; +#X obj 79 44 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 137 143 #out window; +#X obj 154 44 hsl 128 15 20 300 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 0 1; +#X obj 137 168 fps detailed; +#X obj 137 192 print; +#X obj 79 78 metro 100; +#X obj 93 245 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 123 303 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 143 302 stop recording; +#X text 113 243 select filename; +#X text 128 273 start recording; +#X obj 108 274 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 79 328 #record; +#X connect 0 0 2 0; +#X connect 0 0 13 0; +#X connect 1 0 6 0; +#X connect 2 0 4 0; +#X connect 3 0 6 1; +#X connect 4 0 5 0; +#X connect 6 0 0 0; +#X connect 7 0 13 1; +#X connect 8 0 13 3; +#X connect 12 0 13 2; diff --git a/externals/gridflow/pd_help/live_video_feed.pd b/externals/gridflow/pd_help/live_video_feed.pd new file mode 100644 index 00000000..04aff104 --- /dev/null +++ b/externals/gridflow/pd_help/live_video_feed.pd @@ -0,0 +1,38 @@ +#N canvas 526 77 450 614 10; +#X obj 91 104 #camera; +#X obj 248 302 #out window; +#X obj 40 40 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X text 167 102 there is an [#in] within [#camera]; +#X obj 80 12 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 1; +#X obj 248 325 fps detailed; +#X obj 248 351 print; +#X obj 108 20 metro 50; +#X obj 248 198 # -; +#X obj 248 269 #clip; +#X obj 248 220 @! abs; +#X obj 248 244 # + 50; +#X obj 164 141 trigger anything anything; +#X text 281 197 230400 (240x320x3); +#X obj 101 303 #rgb_to_greyscale; +#X obj 101 326 #centroid; +#X floatatom 122 377 5 0 0 0 - - -; +#X floatatom 168 376 5 0 0 0 - - -; +#X obj 85 375 display; +#X connect 0 0 12 0; +#X connect 1 0 5 0; +#X connect 2 0 0 0; +#X connect 4 0 7 0; +#X connect 5 0 6 0; +#X connect 7 0 0 0; +#X connect 8 0 10 0; +#X connect 9 0 1 0; +#X connect 9 0 14 0; +#X connect 10 0 11 0; +#X connect 11 0 9 0; +#X connect 12 0 8 1; +#X connect 12 1 8 0; +#X connect 14 0 15 0; +#X connect 15 0 18 0; +#X connect 15 1 16 0; +#X connect 15 2 17 0; diff --git a/externals/gridflow/pd_help/modify_an_image.pd b/externals/gridflow/pd_help/modify_an_image.pd new file mode 100644 index 00000000..619e561a --- /dev/null +++ b/externals/gridflow/pd_help/modify_an_image.pd @@ -0,0 +1,33 @@ +#N canvas 270 176 450 432 10; +#X obj 106 140 #in; +#X msg 147 94 open babbage.jpg; +#X obj 89 96 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 +; +#X obj 106 311 #out window; +#X text 34 368 What about getting rid of this cool acid stuff?; +#N canvas 0 0 450 300 next_patch 0; +#X restore 36 396 pd next_patch; +#X obj 169 153 hsl 128 15 0 1000 0 0 empty empty empty -2 -6 0 8 -260818 +-1 -1 7200 1; +#X obj 38 52 metro 33.33; +#X obj 38 24 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; +#X obj 106 288 #clip; +#X obj 226 241 # - 42; +#X obj 143 189 # - 42; +#X text 293 386 do [#clip]; +#X text 293 402 clip is an abstraction; +#X obj 129 257 #scale_by; +#X obj 233 286 #color; +#X obj 101 215 # * 0.2; +#X obj 209 185 / 1000; +#X floatatom 220 213 5 0 0 0 - - -; +#X connect 0 0 16 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 6 0 17 0; +#X connect 7 0 0 0; +#X connect 8 0 7 0; +#X connect 9 0 3 0; +#X connect 16 0 9 0; +#X connect 17 0 16 1; +#X connect 17 0 18 0; |