aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-03-22 20:58:25 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-03-22 20:58:25 +0000
commit2b60d55c919e7588f5aff15936e83c300b3660bb (patch)
tree14d860de7f28083d3756ad91b627de70f26788f6
parentc500bc542cb7cc78d6dac3f7da3bff626056b1aa (diff)
zexy-2.0:
- use of abstractions for objects that allow it - some objects are build both as externals and abstractions (as slower fallbacks) - code-layout is now 1:1 c-file<->object (this should allow for building of zexy as a collection of externals instead as a big library) - matrix-objects have moved to iemmatrix !! svn path=/trunk/externals/zexy/; revision=2641
-rw-r--r--README.txt6
-rw-r--r--abs/&&~-help.pd31
-rw-r--r--abs/&&~.pd13
-rw-r--r--abs/<~-help.pd31
-rw-r--r--abs/<~.pd13
-rw-r--r--abs/==~-help.pd31
-rw-r--r--abs/==~.pd13
-rw-r--r--abs/>~-help.pd31
-rw-r--r--abs/>~.pd13
-rw-r--r--abs/abs~-help.pd25
-rw-r--r--abs/abs~.pd11
-rw-r--r--abs/cart2pol-help.pd25
-rw-r--r--abs/cart2pol.pd50
-rw-r--r--abs/cart2sph-help.pd25
-rw-r--r--abs/cart2sph.pd62
-rw-r--r--abs/deg2rad-help.pd (renamed from examples/deg2rad.pd)2
-rw-r--r--abs/deg2rad.pd19
-rw-r--r--abs/mean-help.pd11
-rw-r--r--abs/mean.pd16
-rw-r--r--abs/nop-help.pd (renamed from examples/nop.pd)36
-rw-r--r--abs/nop.pd6
-rw-r--r--abs/nop~-help.pd15
-rw-r--r--abs/nop~.pd15
-rw-r--r--abs/pol2cart-help.pd25
-rw-r--r--abs/pol2cart.pd35
-rw-r--r--abs/pol2sph-help.pd25
-rw-r--r--abs/pol2sph.pd49
-rw-r--r--abs/rad2deg-help.pd (renamed from examples/rad2deg.pd)2
-rw-r--r--abs/rad2deg.pd21
-rw-r--r--abs/segregate-help.pd (renamed from examples/segregate.pd)68
-rw-r--r--abs/segregate.pd22
-rw-r--r--abs/sgn~-help.pd25
-rw-r--r--abs/sgn~.pd11
-rw-r--r--abs/sph2cart-help.pd25
-rw-r--r--abs/sph2cart.pd52
-rw-r--r--abs/sph2pol-help.pd25
-rw-r--r--abs/sph2pol.pd41
-rw-r--r--abs/||~-help.pd31
-rw-r--r--abs/||~.pd13
-rw-r--r--examples/any2list.pd9
-rw-r--r--examples/atoi.pd28
-rw-r--r--examples/avg~.pd46
-rw-r--r--examples/blockmirror~.pd89
-rw-r--r--examples/blockswap~.pd85
-rw-r--r--examples/coordinates.pd3
-rw-r--r--examples/date.pd5
-rw-r--r--examples/demultiplex.pd77
-rw-r--r--examples/demultiplex~.pd67
-rw-r--r--examples/dfreq~.pd35
-rw-r--r--examples/digidistort.pd239
-rw-r--r--examples/dirac~.pd90
-rw-r--r--examples/drip.pd147
-rw-r--r--examples/envrms~.pd53
-rw-r--r--examples/glue.pd3
-rw-r--r--examples/index.pd179
-rw-r--r--examples/length.pd7
-rw-r--r--examples/limiter~.pd276
-rw-r--r--examples/list2int.pd35
-rw-r--r--examples/list2symbol.pd30
-rw-r--r--examples/lister.pd3
-rw-r--r--examples/lpt.pd52
-rw-r--r--examples/makesymbol.pd27
-rw-r--r--examples/matrix.pd133
-rw-r--r--examples/matrix~.pd58
-rw-r--r--examples/mavg.pd33
-rw-r--r--examples/mean.pd9
-rw-r--r--examples/minmax.pd7
-rw-r--r--examples/msgfile.pd226
-rw-r--r--examples/mtx_binops.pd142
-rw-r--r--examples/mtx_element.pd64
-rw-r--r--examples/mtx_inverse.pd18
-rw-r--r--examples/mtx_mean.pd13
-rw-r--r--examples/mtx_rand.pd20
-rw-r--r--examples/mtx_size.pd44
-rw-r--r--examples/mtx_special.pd60
-rw-r--r--examples/mtx_trace.pd24
-rw-r--r--examples/mtx_transpose.pd66
-rw-r--r--examples/multiline~.pd22
-rw-r--r--examples/multiplex.pd38
-rw-r--r--examples/multiplex~.pd47
-rw-r--r--examples/niagara.pd47
-rw-r--r--examples/noish~.pd102
-rw-r--r--examples/noisi~.pd102
-rw-r--r--examples/nop~.pd17
-rw-r--r--examples/operating_system.pd3
-rw-r--r--examples/packel.pd41
-rw-r--r--examples/pack~.pd67
-rw-r--r--examples/pdf~.pd52
-rw-r--r--examples/prime.pd3
-rw-r--r--examples/quantize~.pd124
-rw-r--r--examples/repack.pd48
-rw-r--r--examples/repeat.pd3
-rw-r--r--examples/scalarmult.pd11
-rw-r--r--examples/sf-play_record.pd179
-rw-r--r--examples/sigbinops+.pd214
-rw-r--r--examples/sigzero~.pd160
-rw-r--r--examples/sort.pd156
-rw-r--r--examples/step~.pd202
-rw-r--r--examples/strcmp.pd56
-rw-r--r--examples/swap~.pd129
-rw-r--r--examples/symbol2list.pd1
-rw-r--r--examples/tabdump.pd16
-rw-r--r--examples/tabset.pd18
-rw-r--r--examples/tavg~.pd58
-rw-r--r--examples/time.pd63
-rw-r--r--examples/unpack~.pd176
-rw-r--r--examples/urn.pd3
-rw-r--r--examples/wrap.pd3
-rw-r--r--examples/z~.pd61
-rw-r--r--src/Makefile.in (renamed from src/makefile.in)22
-rw-r--r--src/a2l.c90
-rw-r--r--src/atoi.c98
-rw-r--r--src/avg_tilde.c85
-rw-r--r--src/blockmirror_tilde.c104
-rw-r--r--src/blockswap_tilde.c99
-rwxr-xr-xsrc/configure4724
-rw-r--r--src/configure.in13
-rw-r--r--src/date.c (renamed from src/z_datetime.c)113
-rw-r--r--src/demultiplex.c (renamed from src/z_multiplex.c)96
-rw-r--r--src/demultiplex_tilde.c119
-rw-r--r--src/dfreq_tilde.c (renamed from src/z_dfreq.c)25
-rw-r--r--src/dirac_tilde.c113
-rw-r--r--src/dot.c162
-rw-r--r--src/drip.c (renamed from src/z_drip.c)19
-rw-r--r--src/envrms_tilde.c (renamed from src/z_sigaverage.c)181
-rw-r--r--src/glue.c114
-rw-r--r--src/index.c (renamed from src/z_index.c)19
-rw-r--r--src/length.c61
-rw-r--r--src/limiter_tilde.c (renamed from src/z_limiter.c)30
-rw-r--r--src/list2int.c81
-rw-r--r--src/list2symbol.c141
-rw-r--r--src/lister.c84
-rw-r--r--src/lpt.c (renamed from src/z_lp.c)128
-rw-r--r--src/makefile2
-rw-r--r--src/makefile.darwin167
-rw-r--r--src/makefile.irix29
-rw-r--r--src/makefile.linux94
-rwxr-xr-xsrc/makefile.nt30
-rwxr-xr-xsrc/makefile.win58
-rwxr-xr-xsrc/makesource.sh68
-rw-r--r--src/makesymbol.c (renamed from src/z_makesymbol.c)22
-rw-r--r--src/mavg.c (renamed from src/z_average.c)33
-rw-r--r--src/minmax.c84
-rw-r--r--src/msgfile.c (renamed from src/z_msgfile.c)37
-rw-r--r--src/multiline_tilde.c (renamed from src/z_multiline.c)25
-rw-r--r--src/multiplex.c106
-rw-r--r--src/multiplex_tilde.c112
-rw-r--r--src/niagara.c110
-rw-r--r--src/noish_tilde.c184
-rw-r--r--src/noisi_tilde.c (renamed from src/z_noise.c)162
-rw-r--r--src/operating_system.c (renamed from src/z_operating_system.c)20
-rw-r--r--src/pack_tilde.c86
-rw-r--r--src/packel.c107
-rw-r--r--src/pdf_tilde.c (renamed from src/z_pdf.c)24
-rw-r--r--src/prime.c (renamed from src/z_prime.c)21
-rw-r--r--src/quantize_tilde.c (renamed from src/z_quantize.c)54
-rw-r--r--src/repack.c182
-rw-r--r--src/repeat.c60
-rw-r--r--src/sfplay.c (renamed from src/z_sfplay.c)19
-rw-r--r--src/sfrecord.c (renamed from src/z_sfrecord.c)21
-rw-r--r--src/sigzero_tilde.c (renamed from src/z_sigzero.c)23
-rw-r--r--src/sort.c (renamed from src/z_sort.c)18
-rw-r--r--src/step_tilde.c (renamed from src/z_testfun.c)115
-rw-r--r--src/strcmp.c103
-rw-r--r--src/sum.c61
-rw-r--r--src/swap_tilde.c101
-rw-r--r--src/symbol2list.c163
-rw-r--r--src/tabdump.c117
-rw-r--r--src/tabminmax.c140
-rw-r--r--src/tabset.c102
-rw-r--r--src/tavg_tilde.c99
-rw-r--r--src/time.c122
-rw-r--r--src/unpack_tilde.c (renamed from src/z_sigpack.c)108
-rw-r--r--src/urn.c (renamed from src/z_random.c)23
-rw-r--r--src/winNT_portio.c107
-rw-r--r--src/wrap.c (renamed from src/z_wrap.c)19
-rw-r--r--src/z_connective.c621
-rw-r--r--src/z_coordinates.c440
-rw-r--r--src/z_matrix.c2706
-rw-r--r--src/z_nop.c78
-rw-r--r--src/z_pack.c350
-rw-r--r--src/z_sigbin.c19
-rw-r--r--src/z_sigmatrix.c506
-rw-r--r--src/z_skeleton.c57
-rw-r--r--src/z_skeleton_tilde.c61
-rw-r--r--src/z_stat.c168
-rw-r--r--src/z_strings.c433
-rw-r--r--src/z_swap.c262
-rw-r--r--src/z_tabread4.c312
-rw-r--r--src/z_tilde.c (renamed from src/z_zdelay.c)24
-rw-r--r--src/zexy.c154
-rw-r--r--src/zexy.dsp175
-rw-r--r--src/zexy.h40
-rw-r--r--z_install.bat11
194 files changed, 7793 insertions, 14377 deletions
diff --git a/README.txt b/README.txt
index db488fe..a2d5978 100644
--- a/README.txt
+++ b/README.txt
@@ -10,16 +10,16 @@ note: the zexy external is published under the Gnu General Public License that i
installation::
linux :
-change to directory source
+change to directory src
run:
+ "autoconf"
"./configure"
- "make clean"
"make"
"make install"
this will install the zexy external into /usr/local/lib/pd/externs
(the path can be changed either via the "--prefix"-flag to "configure"
or by editing the makefile
-alternatively you can try "make everything"
+alternatively you can try "make everything" (after ./configure)
note: if you don't want the parallel-port object [lpt]
(e.g.: because you don't have a parallel-port) you can disable it with "--disable-lpt"
diff --git a/abs/&&~-help.pd b/abs/&&~-help.pd
new file mode 100644
index 0000000..041d9c7
--- /dev/null
+++ b/abs/&&~-help.pd
@@ -0,0 +1,31 @@
+#N canvas 274 174 575 388 10;
+#X text 67 46 comparing 2 signals;
+#X obj 72 103 sig~;
+#X obj 120 102 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 120 82 5 0 0 0 - - -;
+#X floatatom 72 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X text 45 302 performance is worse than with the external version
+;
+#X text 45 325 if you want to use the external version of this object
+\, you have to load zexy;
+#X text 43 255 this is the abstraction version of this object \, which
+is using [expr~];
+#X obj 92 152 &&~;
+#X text 46 287 you *cannot* use arguments with this version \, like
+[&&~ 2.7];
+#X connect 1 0 15 0;
+#X connect 2 0 15 1;
+#X connect 5 0 6 0;
+#X connect 7 0 5 0;
+#X connect 8 0 7 0;
+#X connect 9 0 2 0;
+#X connect 10 0 1 0;
+#X connect 15 0 5 0;
diff --git a/abs/&&~.pd b/abs/&&~.pd
new file mode 100644
index 0000000..031ce72
--- /dev/null
+++ b/abs/&&~.pd
@@ -0,0 +1,13 @@
+#N canvas 655 230 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X obj 124 90 inlet~;
+#X text 36 44 [&&~];
+#X obj 31 113 expr~ $v1&&$v2;
+#X text 33 187 therefore we _also_ provide [&&~] as external.;
+#X connect 0 0 7 0;
+#X connect 5 0 7 1;
+#X connect 7 0 1 0;
diff --git a/abs/<~-help.pd b/abs/<~-help.pd
new file mode 100644
index 0000000..abf7a8e
--- /dev/null
+++ b/abs/<~-help.pd
@@ -0,0 +1,31 @@
+#N canvas 274 174 575 388 10;
+#X text 67 46 comparing 2 signals;
+#X obj 72 103 sig~;
+#X obj 120 102 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 120 82 5 0 0 0 - - -;
+#X floatatom 72 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X obj 92 152 <~;
+#X text 45 287 you *cannot* use arguments with this version \, like
+[<~ 2.7];
+#X text 45 302 performance is worse than with the external version
+;
+#X text 43 256 this is the abstraction version of [<~] \, which is
+using [expr~];
+#X text 45 325 if you want to use the external version of this object
+\, you have to load zexy;
+#X connect 1 0 12 0;
+#X connect 2 0 12 1;
+#X connect 5 0 6 0;
+#X connect 7 0 5 0;
+#X connect 8 0 7 0;
+#X connect 9 0 2 0;
+#X connect 10 0 1 0;
+#X connect 12 0 5 0;
diff --git a/abs/<~.pd b/abs/<~.pd
new file mode 100644
index 0000000..f167c97
--- /dev/null
+++ b/abs/<~.pd
@@ -0,0 +1,13 @@
+#N canvas 655 230 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X obj 31 113 expr~ $v1 < $v2;
+#X obj 131 90 inlet~;
+#X text 36 44 [<~];
+#X text 33 187 therefore we _also_ provide [<~] as external.;
+#X connect 0 0 5 0;
+#X connect 5 0 1 0;
+#X connect 6 0 5 1;
diff --git a/abs/==~-help.pd b/abs/==~-help.pd
new file mode 100644
index 0000000..48e06aa
--- /dev/null
+++ b/abs/==~-help.pd
@@ -0,0 +1,31 @@
+#N canvas 274 174 575 388 10;
+#X text 67 46 comparing 2 signals;
+#X obj 72 103 sig~;
+#X obj 120 102 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 120 82 5 0 0 0 - - -;
+#X floatatom 72 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X text 45 302 performance is worse than with the external version
+;
+#X text 45 325 if you want to use the external version of this object
+\, you have to load zexy;
+#X text 43 255 this is the abstraction version of this object \, which
+is using [expr~];
+#X obj 92 152 ==~;
+#X text 46 287 you *cannot* use arguments with this version \, like
+[==~ 2.7];
+#X connect 1 0 15 0;
+#X connect 2 0 15 1;
+#X connect 5 0 6 0;
+#X connect 7 0 5 0;
+#X connect 8 0 7 0;
+#X connect 9 0 2 0;
+#X connect 10 0 1 0;
+#X connect 15 0 5 0;
diff --git a/abs/==~.pd b/abs/==~.pd
new file mode 100644
index 0000000..f9a383b
--- /dev/null
+++ b/abs/==~.pd
@@ -0,0 +1,13 @@
+#N canvas 655 230 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X obj 124 90 inlet~;
+#X obj 31 113 expr~ $v1==$v2;
+#X text 36 44 [==~];
+#X text 33 187 therefore we _also_ provide [==~] as external.;
+#X connect 0 0 6 0;
+#X connect 5 0 6 1;
+#X connect 6 0 1 0;
diff --git a/abs/>~-help.pd b/abs/>~-help.pd
new file mode 100644
index 0000000..b6b5a1e
--- /dev/null
+++ b/abs/>~-help.pd
@@ -0,0 +1,31 @@
+#N canvas 274 174 575 388 10;
+#X text 67 46 comparing 2 signals;
+#X obj 72 103 sig~;
+#X obj 120 102 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 120 82 5 0 0 0 - - -;
+#X floatatom 72 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X text 45 302 performance is worse than with the external version
+;
+#X text 45 325 if you want to use the external version of this object
+\, you have to load zexy;
+#X obj 92 152 >~;
+#X text 43 255 this is the abstraction version of this object \, which
+is using [expr~];
+#X text 46 287 you *cannot* use arguments with this version \, like
+[>~ 2.7];
+#X connect 1 0 14 0;
+#X connect 2 0 14 1;
+#X connect 5 0 6 0;
+#X connect 7 0 5 0;
+#X connect 8 0 7 0;
+#X connect 9 0 2 0;
+#X connect 10 0 1 0;
+#X connect 14 0 5 0;
diff --git a/abs/>~.pd b/abs/>~.pd
new file mode 100644
index 0000000..64b5192
--- /dev/null
+++ b/abs/>~.pd
@@ -0,0 +1,13 @@
+#N canvas 655 230 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X obj 131 90 inlet~;
+#X obj 31 113 expr~ $v1 > $v2;
+#X text 36 44 [>~];
+#X text 33 187 therefore we _also_ provide [>~] as external.;
+#X connect 0 0 6 0;
+#X connect 5 0 6 1;
+#X connect 6 0 1 0;
diff --git a/abs/abs~-help.pd b/abs/abs~-help.pd
new file mode 100644
index 0000000..df18187
--- /dev/null
+++ b/abs/abs~-help.pd
@@ -0,0 +1,25 @@
+#N canvas 201 257 575 388 10;
+#X obj 92 103 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 92 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X text 45 283 performance is worse than with the external version
+;
+#X text 45 315 if you want to use the external version of this object
+\, you have to load zexy;
+#X text 43 255 this is the abstraction version of this object \, which
+is using [expr~];
+#X obj 92 152 abs~;
+#X text 67 46 absolute value of a signal;
+#X connect 0 0 12 0;
+#X connect 3 0 4 0;
+#X connect 5 0 3 0;
+#X connect 6 0 5 0;
+#X connect 7 0 0 0;
+#X connect 12 0 3 0;
diff --git a/abs/abs~.pd b/abs/abs~.pd
new file mode 100644
index 0000000..f4ce848
--- /dev/null
+++ b/abs/abs~.pd
@@ -0,0 +1,11 @@
+#N canvas 0 0 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X obj 31 113 expr~ abs($v1);
+#X text 36 44 [abs~];
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X text 33 187 therefore we _also_ provide [abs~] as external.;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
diff --git a/abs/cart2pol-help.pd b/abs/cart2pol-help.pd
new file mode 100644
index 0000000..6c7cc52
--- /dev/null
+++ b/abs/cart2pol-help.pd
@@ -0,0 +1,25 @@
+#N canvas 410 364 513 356 10;
+#X obj 124 246 cart2pol;
+#X text 24 31 [cart2pol]: convert cartesian coordinates to polar coordinates
+;
+#X text 360 325 updated for zexy-2.0;
+#X floatatom 175 198 5 0 0 1 z - -;
+#X floatatom 134 156 5 0 0 1 y - -;
+#X obj 134 174 t b f;
+#X floatatom 124 138 5 0 0 1 x - -;
+#X floatatom 175 268 5 0 0 1 z - -;
+#X floatatom 149 288 5 0 0 1 phi - -;
+#X floatatom 124 308 5 0 0 1 r - -;
+#X msg 32 204 1 2 3;
+#X text 77 204 x y z;
+#X text 21 76 all angles are in rad.;
+#X text 399 6 part of zexy;
+#X connect 0 0 9 0;
+#X connect 0 1 8 0;
+#X connect 0 2 7 0;
+#X connect 3 0 0 2;
+#X connect 4 0 5 0;
+#X connect 5 0 0 0;
+#X connect 5 1 0 1;
+#X connect 6 0 0 0;
+#X connect 10 0 0 0;
diff --git a/abs/cart2pol.pd b/abs/cart2pol.pd
new file mode 100644
index 0000000..b3c88a7
--- /dev/null
+++ b/abs/cart2pol.pd
@@ -0,0 +1,50 @@
+#N canvas 437 75 457 368 10;
+#X text 63 26 convert cartesian to polar coordinates;
+#X obj 99 82 inlet x;
+#X obj 82 331 outlet r;
+#X obj 179 82 inlet y;
+#X obj 259 82 inlet z;
+#X obj 179 331 outlet phi;
+#X text 294 141 r=sqrt(x^2+y^2);
+#X text 296 161 phi=atan2(y \, x);
+#X text 295 179 z=z;
+#X obj 259 331 outlet z;
+#X obj 99 125 unpack 0 0 0;
+#X obj 138 170 t f f f;
+#X obj 138 193 *;
+#X obj 82 233 +;
+#X obj 82 170 t f f f;
+#X obj 82 193 *;
+#X obj 82 265 sqrt;
+#X obj 140 285 pack 0 0 0;
+#X obj 140 305 unpack 0 0 0;
+#X obj 172 221 pack;
+#X obj 172 260 atan2;
+#X msg 172 241 \$2 \$1;
+#X text 219 241 pd>=0.38 has changed behaviour!;
+#X obj 99 105 pack \$1 \$2 \$3;
+#X text 333 8 part of zexy;
+#X connect 1 0 23 0;
+#X connect 3 0 23 1;
+#X connect 4 0 23 2;
+#X connect 10 0 14 0;
+#X connect 10 1 11 0;
+#X connect 10 2 17 2;
+#X connect 11 0 12 0;
+#X connect 11 1 12 1;
+#X connect 11 2 19 1;
+#X connect 12 0 13 1;
+#X connect 13 0 16 0;
+#X connect 14 0 15 0;
+#X connect 14 1 15 1;
+#X connect 14 2 19 0;
+#X connect 15 0 13 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 18 0 2 0;
+#X connect 18 1 5 0;
+#X connect 18 2 9 0;
+#X connect 19 0 21 0;
+#X connect 20 0 17 1;
+#X connect 21 0 20 0;
+#X connect 23 0 10 0;
diff --git a/abs/cart2sph-help.pd b/abs/cart2sph-help.pd
new file mode 100644
index 0000000..04d0321
--- /dev/null
+++ b/abs/cart2sph-help.pd
@@ -0,0 +1,25 @@
+#N canvas 231 219 466 341 10;
+#X text 322 322 updated for zexy-2.0;
+#X floatatom 175 198 5 0 0 1 z - -;
+#X floatatom 134 156 5 0 0 1 y - -;
+#X obj 134 174 t b f;
+#X floatatom 124 138 5 0 0 1 x - -;
+#X floatatom 175 268 0 0 0 0 theta - -;
+#X floatatom 149 288 0 0 0 0 phi - -;
+#X floatatom 124 308 0 0 0 0 R - -;
+#X msg 32 204 1 2 3;
+#X text 77 204 x y z;
+#X text 24 31 [cart2sph]: convert cartesian coordinates to spheric
+coordinates;
+#X obj 124 246 cart2sph;
+#X text 21 76 all angles are in rad.;
+#X text 357 6 part of zexy;
+#X connect 1 0 11 2;
+#X connect 2 0 3 0;
+#X connect 3 0 11 0;
+#X connect 3 1 11 1;
+#X connect 4 0 11 0;
+#X connect 8 0 11 0;
+#X connect 11 0 7 0;
+#X connect 11 1 6 0;
+#X connect 11 2 5 0;
diff --git a/abs/cart2sph.pd b/abs/cart2sph.pd
new file mode 100644
index 0000000..b2f084a
--- /dev/null
+++ b/abs/cart2sph.pd
@@ -0,0 +1,62 @@
+#N canvas 437 75 639 390 10;
+#X obj 259 82 inlet z;
+#X text 63 26 convert cartesian to spherical coordinates;
+#X obj 99 82 inlet x;
+#X obj 179 82 inlet y;
+#X obj 99 351 outlet r;
+#X obj 199 351 outlet phi;
+#X obj 279 351 outlet theta;
+#X obj 99 125 unpack 0 0 0;
+#X text 263 136 r=sqrt(x^2+y^2+z^2);
+#X text 263 158 phi=atan2(y \, x);
+#X text 262 179 theta=atan2(z \, sqrt(x^2+y^2));
+#X obj 99 170 *;
+#X obj 199 325 atan2;
+#X obj 279 331 atan2;
+#X obj 99 325 sqrt;
+#X obj 279 270 sqrt;
+#X obj 99 299 +;
+#X obj 99 150 t f f f;
+#X obj 138 191 *;
+#X obj 138 171 t f f f;
+#X obj 99 220 +;
+#X obj 99 245 t f f;
+#X obj 192 169 *;
+#X obj 192 149 t f f f;
+#X obj 279 292 pack;
+#X obj 199 271 pack;
+#X msg 199 298 \$2 \$1;
+#X msg 279 312 \$2 \$1;
+#X obj 99 105 pack \$1 \$2 \$3;
+#X text 464 24 part of zexy;
+#X connect 0 0 28 2;
+#X connect 2 0 28 0;
+#X connect 3 0 28 1;
+#X connect 7 0 17 0;
+#X connect 7 1 19 0;
+#X connect 7 2 23 0;
+#X connect 11 0 20 0;
+#X connect 12 0 5 0;
+#X connect 13 0 6 0;
+#X connect 14 0 4 0;
+#X connect 15 0 24 0;
+#X connect 16 0 14 0;
+#X connect 17 0 11 0;
+#X connect 17 1 11 1;
+#X connect 17 2 25 0;
+#X connect 18 0 20 1;
+#X connect 19 0 18 0;
+#X connect 19 1 18 1;
+#X connect 19 2 25 1;
+#X connect 20 0 21 0;
+#X connect 21 0 16 0;
+#X connect 21 1 15 0;
+#X connect 22 0 16 1;
+#X connect 23 0 22 0;
+#X connect 23 1 22 1;
+#X connect 23 2 24 1;
+#X connect 24 0 27 0;
+#X connect 25 0 26 0;
+#X connect 26 0 12 0;
+#X connect 27 0 13 0;
+#X connect 28 0 7 0;
diff --git a/examples/deg2rad.pd b/abs/deg2rad-help.pd
index 076bdf1..c0be4a8 100644
--- a/examples/deg2rad.pd
+++ b/abs/deg2rad-help.pd
@@ -15,6 +15,8 @@
#X obj 317 195 cos;
#X floatatom 317 217 5 0 0 0 - - -;
#X text 317 129 example:;
+#X text 338 10 part of zexy;
+#X text 289 279 updated for zexy-2.0;
#X connect 2 0 3 0;
#X connect 3 0 7 0;
#X connect 4 0 9 0;
diff --git a/abs/deg2rad.pd b/abs/deg2rad.pd
new file mode 100644
index 0000000..868b737
--- /dev/null
+++ b/abs/deg2rad.pd
@@ -0,0 +1,19 @@
+#N canvas 437 75 329 363 10;
+#X obj 109 112 inlet deg;
+#X obj 109 231 outlet rad;
+#X obj 181 179 / 45;
+#X obj 181 113 loadbang;
+#X obj 109 202 * 0.0174533;
+#X obj 109 178 f;
+#X text 93 282 rad=deg*pi/180;
+#X obj 181 156 atan;
+#X msg 181 135 1;
+#X text 225 36 part of zexy;
+#X text 63 66 convert DEGree to RADiant;
+#X connect 0 0 5 0;
+#X connect 2 0 4 1;
+#X connect 3 0 8 0;
+#X connect 4 0 1 0;
+#X connect 5 0 4 0;
+#X connect 7 0 2 0;
+#X connect 8 0 7 0;
diff --git a/abs/mean-help.pd b/abs/mean-help.pd
new file mode 100644
index 0000000..1981f1d
--- /dev/null
+++ b/abs/mean-help.pd
@@ -0,0 +1,11 @@
+#N canvas 186 94 463 310 10;
+#X obj 83 154 mean;
+#X floatatom 83 202 4 0 0 0 - - -;
+#X msg 96 96 2 4;
+#X text 57 39 get the mean value of a list of floats;
+#X msg 83 69 1 2 3 -4 5 6;
+#X text 338 7 part of zexy;
+#X text 268 275 updated for zexy-2.0;
+#X connect 0 0 1 0;
+#X connect 2 0 0 0;
+#X connect 4 0 0 0;
diff --git a/abs/mean.pd b/abs/mean.pd
new file mode 100644
index 0000000..29fc68e
--- /dev/null
+++ b/abs/mean.pd
@@ -0,0 +1,16 @@
+#N canvas 462 214 450 382 10;
+#X obj 253 162 length;
+#X obj 223 181 /;
+#X obj 223 116 t l l;
+#X obj 223 140 sum;
+#X text 272 20 part of zexy;
+#X text 58 60 the mean of a list of floats is the sum of its elements
+divided by its length;
+#X obj 223 87 inlet list;
+#X obj 223 203 outlet mean;
+#X connect 0 0 1 1;
+#X connect 1 0 7 0;
+#X connect 2 0 3 0;
+#X connect 2 1 0 0;
+#X connect 3 0 1 0;
+#X connect 6 0 2 0;
diff --git a/examples/nop.pd b/abs/nop-help.pd
index aed3b61..ef2a464 100644
--- a/examples/nop.pd
+++ b/abs/nop-help.pd
@@ -1,17 +1,19 @@
-#N canvas 456 395 450 428 10;
-#X obj 121 331 nop;
-#X msg 155 157 bang;
-#X floatatom 155 175;
-#X symbolatom 156 196;
-#X obj 121 350 print;
-#X msg 156 240 set mummy;
-#X obj 132 26 nop;
-#X text 95 71 maybe this is not very intelligent;
-#X text 97 89 it just passes through what it gets;
-#X msg 157 218 1 to 3 for 5;
-#X connect 0 0 4 0;
-#X connect 1 0 0 0;
-#X connect 2 0 0 0;
-#X connect 3 0 0 0;
-#X connect 5 0 0 0;
-#X connect 9 0 0 0;
+#N canvas 456 395 450 428 10;
+#X obj 121 331 nop;
+#X msg 155 157 bang;
+#X floatatom 155 175 0 0 0 0 - - -;
+#X symbolatom 156 196 0 0 0 0 - - -;
+#X obj 121 350 print;
+#X msg 156 240 set mummy;
+#X obj 132 26 nop;
+#X text 95 71 maybe this is not very intelligent;
+#X text 97 89 it just passes through what it gets;
+#X msg 157 218 1 to 3 for 5;
+#X text 328 11 part of zexy;
+#X text 265 389 updated for zexy-2.0;
+#X connect 0 0 4 0;
+#X connect 1 0 0 0;
+#X connect 2 0 0 0;
+#X connect 3 0 0 0;
+#X connect 5 0 0 0;
+#X connect 9 0 0 0;
diff --git a/abs/nop.pd b/abs/nop.pd
new file mode 100644
index 0000000..859f3d9
--- /dev/null
+++ b/abs/nop.pd
@@ -0,0 +1,6 @@
+#N canvas 343 308 450 300 10;
+#X obj 142 91 inlet;
+#X obj 142 179 outlet;
+#X text 113 53 do nothing...;
+#X text 170 134 part of zexy;
+#X connect 0 0 1 0;
diff --git a/abs/nop~-help.pd b/abs/nop~-help.pd
new file mode 100644
index 0000000..6d3907e
--- /dev/null
+++ b/abs/nop~-help.pd
@@ -0,0 +1,15 @@
+#N canvas 190 161 423 354 10;
+#X obj 89 71 nop~;
+#X obj 105 156 osc~ 440;
+#X obj 105 252 -~;
+#X obj 105 279 env~;
+#X floatatom 104 304 0 0 0 0 - - -;
+#X obj 133 187 nop~;
+#X text 301 30 part of zexy;
+#X text 255 308 updated for zexy-2.0;
+#X text 158 77 will do nothing !!!;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 5 0 2 1;
diff --git a/abs/nop~.pd b/abs/nop~.pd
new file mode 100644
index 0000000..2852b20
--- /dev/null
+++ b/abs/nop~.pd
@@ -0,0 +1,15 @@
+#N canvas 0 0 450 300 10;
+#X obj 68 60 inlet~;
+#X obj 68 133 outlet~;
+#X text 67 27 nop~ no-operation;
+#X text 125 56 this is how a nop really should behave.;
+#X text 128 81 prior versions delayed the signal by 1 block.;
+#X text 127 102 use something like;
+#X obj 265 102 z~ 64;
+#X obj 178 225 print warning;
+#X msg 178 204 nop~ does not delay any more!;
+#X obj 178 183 loadbang;
+#X text 272 20 part of zexy;
+#X connect 0 0 1 0;
+#X connect 8 0 7 0;
+#X connect 9 0 8 0;
diff --git a/abs/pol2cart-help.pd b/abs/pol2cart-help.pd
new file mode 100644
index 0000000..4d71a41
--- /dev/null
+++ b/abs/pol2cart-help.pd
@@ -0,0 +1,25 @@
+#N canvas 215 219 473 351 10;
+#X text 317 323 updated for zexy-2.0;
+#X floatatom 175 198 5 0 0 1 z - -;
+#X floatatom 134 156 5 0 0 1 phi - -;
+#X obj 134 174 t b f;
+#X floatatom 124 138 5 0 0 1 r - -;
+#X floatatom 175 268 0 0 0 0 z - -;
+#X floatatom 149 288 0 0 0 0 y - -;
+#X floatatom 124 308 0 0 0 0 x - -;
+#X msg 22 210 1 2 3;
+#X obj 124 246 pol2cart;
+#X text 19 192 r phi theta;
+#X text 24 31 [pol2cart]: convert polar coordinates to cartesian coordinates
+;
+#X text 21 76 all angles are in rad.;
+#X text 358 7 part of zexy;
+#X connect 1 0 9 2;
+#X connect 2 0 3 0;
+#X connect 3 0 9 0;
+#X connect 3 1 9 1;
+#X connect 4 0 9 0;
+#X connect 8 0 9 0;
+#X connect 9 0 7 0;
+#X connect 9 1 6 0;
+#X connect 9 2 5 0;
diff --git a/abs/pol2cart.pd b/abs/pol2cart.pd
new file mode 100644
index 0000000..0a29882
--- /dev/null
+++ b/abs/pol2cart.pd
@@ -0,0 +1,35 @@
+#N canvas 437 75 457 368 10;
+#X obj 259 82 inlet z;
+#X text 295 169 z=z;
+#X obj 259 331 outlet z;
+#X obj 99 125 unpack 0 0 0;
+#X text 294 141 x=r*cos(phi);
+#X text 295 156 y=r*sin(phi);
+#X obj 99 82 inlet r;
+#X obj 179 82 inlet phi;
+#X obj 82 331 outlet x;
+#X obj 179 331 outlet y;
+#X obj 138 160 t f f;
+#X obj 138 184 cos;
+#X obj 168 184 sin;
+#X obj 82 201 t f f;
+#X obj 82 237 * 1;
+#X obj 112 236 * 0;
+#X text 63 26 convert polar to cartesian coordinates;
+#X obj 99 105 pack \$1 \$2 \$3;
+#X text 341 8 part of zexy;
+#X connect 0 0 17 2;
+#X connect 3 0 13 0;
+#X connect 3 1 10 0;
+#X connect 3 2 2 0;
+#X connect 6 0 17 0;
+#X connect 7 0 17 1;
+#X connect 10 0 11 0;
+#X connect 10 1 12 0;
+#X connect 11 0 14 1;
+#X connect 12 0 15 1;
+#X connect 13 0 14 0;
+#X connect 13 1 15 0;
+#X connect 14 0 8 0;
+#X connect 15 0 9 0;
+#X connect 17 0 3 0;
diff --git a/abs/pol2sph-help.pd b/abs/pol2sph-help.pd
new file mode 100644
index 0000000..41449c5
--- /dev/null
+++ b/abs/pol2sph-help.pd
@@ -0,0 +1,25 @@
+#N canvas 218 265 454 349 10;
+#X text 301 325 updated for zexy-2.0;
+#X floatatom 168 198 5 0 0 1 z - -;
+#X floatatom 134 156 5 0 0 1 phi - -;
+#X obj 134 174 t b f;
+#X floatatom 124 138 5 0 0 1 r - -;
+#X floatatom 168 268 0 0 0 0 theta - -;
+#X floatatom 146 288 0 0 0 0 phi - -;
+#X floatatom 124 308 0 0 0 0 R - -;
+#X msg 22 210 1 2 3;
+#X obj 124 246 pol2sph;
+#X text 24 31 [pol2sph]: convert polar coordinates to spherical coordinates
+;
+#X text 21 76 all angles are in rad.;
+#X text 19 192 r phi z;
+#X text 330 12 part of zexy;
+#X connect 1 0 9 2;
+#X connect 2 0 3 0;
+#X connect 3 0 9 0;
+#X connect 3 1 9 1;
+#X connect 4 0 9 0;
+#X connect 8 0 9 0;
+#X connect 9 0 7 0;
+#X connect 9 1 6 0;
+#X connect 9 2 5 0;
diff --git a/abs/pol2sph.pd b/abs/pol2sph.pd
new file mode 100644
index 0000000..046d19e
--- /dev/null
+++ b/abs/pol2sph.pd
@@ -0,0 +1,49 @@
+#N canvas 437 75 457 368 10;
+#X obj 259 82 inlet z;
+#X obj 99 82 inlet r;
+#X obj 179 82 inlet phi;
+#X text 63 26 convert polar to spherical coordinates;
+#X obj 99 125 unpack 0 0 0;
+#X obj 83 331 outlet R;
+#X text 280 151 R=sqrt(r^2+z^2);
+#X obj 179 331 outlet Phi;
+#X obj 259 331 outlet Theta;
+#X text 279 170 Phi=phi;
+#X text 278 187 Theta=atan2(z \, r);
+#X obj 99 275 pack 0 0 0;
+#X obj 99 295 unpack 0 0 0;
+#X obj 178 148 t f f f;
+#X obj 178 169 *;
+#X obj 99 148 t f f f;
+#X obj 99 169 *;
+#X obj 99 212 +;
+#X obj 99 237 sqrt;
+#X obj 164 255 atan2;
+#X obj 164 213 pack;
+#X msg 164 234 \$2 \$1;
+#X obj 99 105 pack \$1 \$2 \$3;
+#X text 335 8 part of zexy;
+#X connect 0 0 22 2;
+#X connect 1 0 22 0;
+#X connect 2 0 22 1;
+#X connect 4 0 15 0;
+#X connect 4 1 11 1;
+#X connect 4 2 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 5 0;
+#X connect 12 1 7 0;
+#X connect 12 2 8 0;
+#X connect 13 0 14 0;
+#X connect 13 1 14 1;
+#X connect 13 2 20 1;
+#X connect 14 0 17 1;
+#X connect 15 0 16 0;
+#X connect 15 1 16 1;
+#X connect 15 2 20 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 18 0 11 0;
+#X connect 19 0 11 2;
+#X connect 20 0 21 0;
+#X connect 21 0 19 0;
+#X connect 22 0 4 0;
diff --git a/examples/rad2deg.pd b/abs/rad2deg-help.pd
index 709d878..23f5844 100644
--- a/examples/rad2deg.pd
+++ b/abs/rad2deg-help.pd
@@ -15,6 +15,8 @@
#X text 122 40 convert RADian and DEGree;
#X obj 317 172 atan;
#X obj 317 195 rad2deg;
+#X text 317 12 part of zexy;
+#X text 272 274 updated for zexy-2.0;
#X connect 0 0 2 0;
#X connect 1 0 4 0;
#X connect 2 0 5 0;
diff --git a/abs/rad2deg.pd b/abs/rad2deg.pd
new file mode 100644
index 0000000..eea2f9f
--- /dev/null
+++ b/abs/rad2deg.pd
@@ -0,0 +1,21 @@
+#N canvas 437 75 457 368 10;
+#X obj 181 93 loadbang;
+#X obj 109 178 f;
+#X text 93 282 deg=rad*180/pi;
+#X text 63 66 convert radiant to degree;
+#X obj 109 82 inlet rad;
+#X obj 109 231 outlet deg;
+#X msg 181 158 45 \$1;
+#X obj 181 179 /;
+#X obj 109 202 * 57.2958;
+#X msg 181 115 1;
+#X obj 181 136 atan;
+#X text 272 20 part of zexy;
+#X connect 0 0 9 0;
+#X connect 1 0 8 0;
+#X connect 4 0 1 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 1;
+#X connect 8 0 5 0;
+#X connect 9 0 10 0;
+#X connect 10 0 6 0;
diff --git a/examples/segregate.pd b/abs/segregate-help.pd
index 0e47699..a70815c 100644
--- a/examples/segregate.pd
+++ b/abs/segregate-help.pd
@@ -1,33 +1,35 @@
-#N canvas 543 205 450 496 10;
-#X obj 136 344 segregate;
-#X obj 136 447 print BANG;
-#X obj 145 430 print FLOAT;
-#X obj 155 413 print SYMBOL;
-#X obj 175 379 print POINTER;
-#X obj 165 396 print LIST;
-#X floatatom 155 226;
-#X symbolatom 171 255;
-#X msg 136 197 bang;
-#X msg 184 281 1 2 3 4;
-#X msg 185 307 come on \, my house;
-#X text 131 31 segregate;
-#X text 51 87 segregates the inputs by their type;
-#X text 50 112 known types (in order of their outlets)::;
-#X text 93 131 BANG \, FLOAT \, SYMBOL \, LIST \, POINTER;
-#X text 86 196 bang;
-#X text 86 226 float;
-#X text 87 256 symbol;
-#X obj 185 362 print ANYTHING;
-#X text 88 309 anythings;
-#X text 87 284 list;
-#X connect 0 0 1 0;
-#X connect 0 1 2 0;
-#X connect 0 2 3 0;
-#X connect 0 3 5 0;
-#X connect 0 4 4 0;
-#X connect 0 5 18 0;
-#X connect 6 0 0 0;
-#X connect 7 0 0 0;
-#X connect 8 0 0 0;
-#X connect 9 0 0 0;
-#X connect 10 0 0 0;
+#N canvas 543 205 450 496 10;
+#X obj 136 344 segregate;
+#X obj 136 447 print BANG;
+#X obj 145 430 print FLOAT;
+#X obj 155 413 print SYMBOL;
+#X obj 175 379 print POINTER;
+#X obj 165 396 print LIST;
+#X floatatom 155 226 0 0 0 0 - - -;
+#X symbolatom 171 255 0 0 0 0 - - -;
+#X msg 136 197 bang;
+#X msg 184 281 1 2 3 4;
+#X msg 185 307 come on \, my house;
+#X text 131 31 segregate;
+#X text 51 87 segregates the inputs by their type;
+#X text 50 112 known types (in order of their outlets)::;
+#X text 93 131 BANG \, FLOAT \, SYMBOL \, LIST \, POINTER;
+#X text 86 196 bang;
+#X text 86 226 float;
+#X text 87 256 symbol;
+#X text 88 309 anythings;
+#X text 87 284 list;
+#X text 313 15 part of zexy;
+#X text 281 468 updated for zexy-2.0;
+#X obj 185 362 print unknown;
+#X connect 0 0 1 0;
+#X connect 0 1 2 0;
+#X connect 0 2 3 0;
+#X connect 0 3 5 0;
+#X connect 0 4 4 0;
+#X connect 0 5 22 0;
+#X connect 6 0 0 0;
+#X connect 7 0 0 0;
+#X connect 8 0 0 0;
+#X connect 9 0 0 0;
+#X connect 10 0 0 0;
diff --git a/abs/segregate.pd b/abs/segregate.pd
new file mode 100644
index 0000000..4e5b71a
--- /dev/null
+++ b/abs/segregate.pd
@@ -0,0 +1,22 @@
+#N canvas 80 348 644 425 10;
+#X obj 56 37 inlet;
+#X obj 56 224 route bang float symbol list gpointer;
+#X obj 56 282 outlet BANG;
+#X obj 106 262 outlet FLOAT;
+#X obj 157 282 outlet SYMBOL;
+#X obj 208 382 outlet LIST;
+#X obj 259 282 outlet POINTER;
+#X obj 208 360 a2l;
+#X text 239 362 since the "list" selector gets stripped by [route]
+;
+#X text 478 28 part of zexy;
+#X text 141 72 [segregate] a message based on it's type.;
+#X obj 310 262 outlet reject;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 1 1 3 0;
+#X connect 1 2 4 0;
+#X connect 1 3 7 0;
+#X connect 1 4 6 0;
+#X connect 1 5 11 0;
+#X connect 7 0 5 0;
diff --git a/abs/sgn~-help.pd b/abs/sgn~-help.pd
new file mode 100644
index 0000000..3c2d4bb
--- /dev/null
+++ b/abs/sgn~-help.pd
@@ -0,0 +1,25 @@
+#N canvas 201 257 575 388 10;
+#X obj 92 103 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 92 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X text 45 283 performance is worse than with the external version
+;
+#X text 45 315 if you want to use the external version of this object
+\, you have to load zexy;
+#X text 43 255 this is the abstraction version of this object \, which
+is using [expr~];
+#X obj 92 152 sgn~;
+#X text 67 46 signum of a signal;
+#X connect 0 0 12 0;
+#X connect 3 0 4 0;
+#X connect 5 0 3 0;
+#X connect 6 0 5 0;
+#X connect 7 0 0 0;
+#X connect 12 0 3 0;
diff --git a/abs/sgn~.pd b/abs/sgn~.pd
new file mode 100644
index 0000000..8fb6d54
--- /dev/null
+++ b/abs/sgn~.pd
@@ -0,0 +1,11 @@
+#N canvas 491 108 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X obj 30 112 expr~ if ($v1<0 \, -1 \, if ($v1>0 \, 1 \, 0));
+#X text 36 44 [sgn~];
+#X text 33 187 therefore we _also_ provide [sgn~] as external.;
+#X connect 0 0 5 0;
+#X connect 5 0 1 0;
diff --git a/abs/sph2cart-help.pd b/abs/sph2cart-help.pd
new file mode 100644
index 0000000..ccdb805
--- /dev/null
+++ b/abs/sph2cart-help.pd
@@ -0,0 +1,25 @@
+#N canvas 274 257 513 356 10;
+#X text 360 325 updated for zexy-2.0;
+#X floatatom 175 198 5 0 0 1 theta - -;
+#X floatatom 134 156 5 0 0 1 phi - -;
+#X obj 134 174 t b f;
+#X floatatom 124 138 5 0 0 1 R - -;
+#X floatatom 175 268 0 0 0 0 z - -;
+#X floatatom 149 288 0 0 0 0 y - -;
+#X floatatom 124 308 0 0 0 0 x - -;
+#X msg 32 204 1 2 3;
+#X text 21 76 all angles are in rad.;
+#X obj 124 246 sph2cart;
+#X text 24 31 [sph2cart]: convert spherical coordinates to cartesian
+coordinates;
+#X text 77 204 R phi theta;
+#X text 394 14 part of zexy;
+#X connect 1 0 10 2;
+#X connect 2 0 3 0;
+#X connect 3 0 10 0;
+#X connect 3 1 10 1;
+#X connect 4 0 10 0;
+#X connect 8 0 10 0;
+#X connect 10 0 7 0;
+#X connect 10 1 6 0;
+#X connect 10 2 5 0;
diff --git a/abs/sph2cart.pd b/abs/sph2cart.pd
new file mode 100644
index 0000000..6828082
--- /dev/null
+++ b/abs/sph2cart.pd
@@ -0,0 +1,52 @@
+#N canvas 437 75 580 399 10;
+#X obj 276 331 outlet z;
+#X obj 99 82 inlet r;
+#X obj 179 82 inlet phi;
+#X obj 99 331 outlet x;
+#X obj 196 331 outlet y;
+#X text 63 26 convert spherical to cartesian coordinates;
+#X obj 259 82 inlet theta;
+#X obj 99 125 unpack 0 0 0;
+#X text 285 160 x=r*cos(phi)*cos(theta);
+#X text 285 175 y=r*sin(phi)*cos(theta);
+#X text 285 190 z=r*sin(theta);
+#X obj 178 151 t f f;
+#X obj 208 171 sin;
+#X obj 178 171 cos;
+#X obj 138 192 t f f;
+#X obj 168 212 sin;
+#X obj 138 212 cos;
+#X obj 99 306 * 1;
+#X obj 196 307 * 0;
+#X obj 276 309 * 0;
+#X obj 178 192 t f f;
+#X obj 99 259 t f f f;
+#X obj 115 284 * 1;
+#X obj 212 281 * 0;
+#X obj 99 105 pack \$1 \$2 \$3;
+#X text 415 20 part of zexy;
+#X connect 1 0 24 0;
+#X connect 2 0 24 1;
+#X connect 6 0 24 2;
+#X connect 7 0 21 0;
+#X connect 7 1 14 0;
+#X connect 7 2 11 0;
+#X connect 11 0 13 0;
+#X connect 11 1 12 0;
+#X connect 12 0 19 1;
+#X connect 13 0 20 0;
+#X connect 14 0 16 0;
+#X connect 14 1 15 0;
+#X connect 15 0 23 0;
+#X connect 16 0 22 0;
+#X connect 17 0 3 0;
+#X connect 18 0 4 0;
+#X connect 19 0 0 0;
+#X connect 20 0 22 1;
+#X connect 20 1 23 1;
+#X connect 21 0 17 0;
+#X connect 21 1 18 0;
+#X connect 21 2 19 0;
+#X connect 22 0 17 1;
+#X connect 23 0 18 1;
+#X connect 24 0 7 0;
diff --git a/abs/sph2pol-help.pd b/abs/sph2pol-help.pd
new file mode 100644
index 0000000..98960e2
--- /dev/null
+++ b/abs/sph2pol-help.pd
@@ -0,0 +1,25 @@
+#N canvas 200 209 457 355 10;
+#X text 297 321 updated for zexy-2.0;
+#X floatatom 168 198 5 0 0 1 theta - -;
+#X floatatom 134 156 5 0 0 1 phi - -;
+#X obj 134 174 t b f;
+#X floatatom 124 138 5 0 0 1 R - -;
+#X floatatom 168 268 0 0 0 0 z - -;
+#X floatatom 146 288 0 0 0 0 phi - -;
+#X floatatom 124 308 0 0 0 0 r - -;
+#X msg 22 210 1 2 3;
+#X text 21 76 all angles are in rad.;
+#X text 24 31 [sph2pol]: convert spherical coordinates to polar coordinates
+;
+#X obj 124 246 sph2pol;
+#X text 19 192 R phi theta;
+#X text 321 15 part of zexy;
+#X connect 1 0 11 2;
+#X connect 2 0 3 0;
+#X connect 3 0 11 0;
+#X connect 3 1 11 1;
+#X connect 4 0 11 0;
+#X connect 8 0 11 0;
+#X connect 11 0 7 0;
+#X connect 11 1 6 0;
+#X connect 11 2 5 0;
diff --git a/abs/sph2pol.pd b/abs/sph2pol.pd
new file mode 100644
index 0000000..3093449
--- /dev/null
+++ b/abs/sph2pol.pd
@@ -0,0 +1,41 @@
+#N canvas 437 75 457 368 10;
+#X obj 259 331 outlet z;
+#X obj 99 125 unpack 0 0 0;
+#X obj 99 82 inlet r;
+#X obj 179 82 inlet phi;
+#X text 63 26 convert spherical to polar coordinates;
+#X obj 259 82 inlet theta;
+#X obj 82 331 outlet r;
+#X obj 179 331 outlet phi;
+#X text 295 156 phi=phi;
+#X text 295 169 z=r*sin(theta);
+#X text 294 141 R=r*cos(theta);
+#X obj 106 265 pack 0 0 0;
+#X obj 106 285 unpack 0 0 0;
+#X obj 178 152 t f f;
+#X obj 208 172 sin;
+#X obj 178 172 cos;
+#X obj 106 239 * 1;
+#X obj 171 239 * 0;
+#X obj 99 152 t f f;
+#X obj 99 105 pack \$1 \$2 \$3;
+#X text 344 10 part of zexy;
+#X connect 1 0 18 0;
+#X connect 1 1 11 1;
+#X connect 1 2 13 0;
+#X connect 2 0 19 0;
+#X connect 3 0 19 1;
+#X connect 5 0 19 2;
+#X connect 11 0 12 0;
+#X connect 12 0 6 0;
+#X connect 12 1 7 0;
+#X connect 12 2 0 0;
+#X connect 13 0 15 0;
+#X connect 13 1 14 0;
+#X connect 14 0 17 1;
+#X connect 15 0 16 1;
+#X connect 16 0 11 0;
+#X connect 17 0 11 2;
+#X connect 18 0 16 0;
+#X connect 18 1 17 0;
+#X connect 19 0 1 0;
diff --git a/abs/||~-help.pd b/abs/||~-help.pd
new file mode 100644
index 0000000..3a48a01
--- /dev/null
+++ b/abs/||~-help.pd
@@ -0,0 +1,31 @@
+#N canvas 274 174 575 388 10;
+#X text 67 46 comparing 2 signals;
+#X obj 72 103 sig~;
+#X obj 120 102 sig~;
+#X text 272 20 part of zexy;
+#X text 351 61 updated for zexy-2.0;
+#X obj 93 178 snapshot~;
+#X floatatom 93 204 5 0 0 0 - - -;
+#X obj 146 153 metro 100;
+#X obj 146 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X floatatom 120 82 5 0 0 0 - - -;
+#X floatatom 72 81 5 0 0 0 - - -;
+#X text 16 243 note:;
+#X text 45 302 performance is worse than with the external version
+;
+#X text 45 325 if you want to use the external version of this object
+\, you have to load zexy;
+#X text 43 255 this is the abstraction version of this object \, which
+is using [expr~];
+#X obj 92 152 ||~;
+#X text 46 287 you *cannot* use arguments with this version \, like
+[||~ 2.7];
+#X connect 1 0 15 0;
+#X connect 2 0 15 1;
+#X connect 5 0 6 0;
+#X connect 7 0 5 0;
+#X connect 8 0 7 0;
+#X connect 9 0 2 0;
+#X connect 10 0 1 0;
+#X connect 15 0 5 0;
diff --git a/abs/||~.pd b/abs/||~.pd
new file mode 100644
index 0000000..dad7a44
--- /dev/null
+++ b/abs/||~.pd
@@ -0,0 +1,13 @@
+#N canvas 655 230 450 300 10;
+#X obj 30 88 inlet~;
+#X obj 30 136 outlet~;
+#X text 33 169 using [expr~] is slower than doing it in C...;
+#X text 319 21 part of zexy;
+#X text 250 261 updated for zexy-2.0;
+#X obj 124 90 inlet~;
+#X text 36 44 [||~];
+#X obj 31 113 expr~ $v1||$v2;
+#X text 33 187 therefore we _also_ provide [||~] as external.;
+#X connect 0 0 7 0;
+#X connect 5 0 7 1;
+#X connect 7 0 1 0;
diff --git a/examples/any2list.pd b/examples/any2list.pd
index 9c460c0..bfd7c15 100644
--- a/examples/any2list.pd
+++ b/examples/any2list.pd
@@ -1,8 +1,8 @@
#N canvas 319 129 450 458 10;
#X text 113 30 convert "anything" to lists;
#X text 116 56 pass through the rest;
-#X floatatom 46 229 0 0 0;
-#X symbolatom 46 203 0 0 0;
+#X floatatom 46 229 0 0 0 0 - - -;
+#X symbolatom 46 203 0 0 0 0 - - -;
#X msg 46 162 this is anything;
#X msg 46 182 list this is a list;
#X obj 35 276 print a2l;
@@ -10,10 +10,11 @@
#X obj 319 339 route list;
#X msg 319 318 list this is a list;
#X obj 319 359 print l2a;
-#X obj 56 30 any2list;
+#X obj 48 30 any2list;
#X text 245 223 alias;
-#X obj 280 223 a2l;
+#X obj 286 223 a2l;
#X obj 35 256 any2list;
+#X text 356 6 part of zexy;
#X connect 2 0 14 0;
#X connect 3 0 14 0;
#X connect 4 0 14 0;
diff --git a/examples/atoi.pd b/examples/atoi.pd
index c6a507a..a84b57e 100644
--- a/examples/atoi.pd
+++ b/examples/atoi.pd
@@ -1,28 +1,34 @@
-#N canvas 271 320 749 300 10;
+#N canvas 274 494 749 300 10;
#X obj 125 21 atoi;
#X text 174 19 convert ascii to integer;
#X obj 72 178 atoi;
-#X floatatom 72 201 4 0 0;
+#X floatatom 72 201 4 0 0 0 - - -;
#X obj 72 132 makefilename %4d;
-#X symbolatom 72 155 10 0 0;
-#X floatatom 72 110 4 0 0;
-#X floatatom 177 110 4 0 0;
+#X symbolatom 72 155 10 0 0 0 - - -;
+#X floatatom 72 110 4 0 0 0 - - -;
+#X floatatom 177 110 4 0 0 0 - - -;
#X obj 177 132 makefilename 0%d;
-#X floatatom 280 110 4 0 0;
+#X floatatom 280 110 4 0 0 0 - - -;
#X obj 280 132 makefilename 0x%d;
#X text 74 92 decimal;
#X text 178 94 octal;
#X text 280 93 sedecimal;
-#X floatatom 417 109 4 0 0;
+#X floatatom 417 109 4 0 0 0 - - -;
#X obj 417 127 makefilename %d;
-#X floatatom 502 106 4 0 0;
+#X floatatom 502 106 4 0 0 0 - - -;
#X text 506 93 base;
#X obj 417 146 pack s 2;
#X msg 417 86 101;
#X msg 443 86 10011;
-#X text 241 214 symbols starting with "0x" are converted as hex-numbers;
-#X text 242 228 symbols starting with "0" are converted as octal numbers;
-#X text 241 243 symbols starting with numbers but "0" are converted as decimal numbers;
+#X text 241 214 symbols starting with "0x" are converted as hex-numbers
+;
+#X text 242 228 symbols starting with "0" are converted as octal numbers
+;
+#X text 241 243 symbols starting with numbers but "0" are converted
+as decimal numbers;
+#X text 360 325 updated for zexy-2.0;
+#X text 360 325 updated for zexy-2.0;
+#X text 539 17 part of zexy;
#X connect 2 0 3 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
diff --git a/examples/avg~.pd b/examples/avg~.pd
index 9ae5626..451814e 100644
--- a/examples/avg~.pd
+++ b/examples/avg~.pd
@@ -1,22 +1,24 @@
-#N canvas 288 18 580 361 10;
-#X floatatom 59 148;
-#X floatatom 59 254;
-#X floatatom 129 255;
-#X obj 59 276 dbtorms;
-#X floatatom 59 299;
-#X text 272 269 see also:;
-#X obj 277 296 env~;
-#X obj 373 296 tavg~;
-#X obj 71 51 avg~;
-#X obj 129 234 avg~;
-#X obj 59 233 env~;
-#X text 155 49 calculates the arithmetic mean of one signal vector;
-#X obj 315 296 envrms~;
-#X obj 59 173 osc~ 5512.5;
-#X connect 0 0 13 0;
-#X connect 1 0 3 0;
-#X connect 3 0 4 0;
-#X connect 9 0 2 0;
-#X connect 10 0 1 0;
-#X connect 13 0 9 0;
-#X connect 13 0 10 0;
+#N canvas 288 18 580 361 10;
+#X floatatom 59 148 0 0 0 0 - - -;
+#X floatatom 59 254 0 0 0 0 - - -;
+#X floatatom 129 255 0 0 0 0 - - -;
+#X obj 59 276 dbtorms;
+#X floatatom 59 299 0 0 0 0 - - -;
+#X text 272 269 see also:;
+#X obj 277 296 env~;
+#X obj 373 296 tavg~;
+#X obj 71 51 avg~;
+#X obj 129 234 avg~;
+#X obj 59 233 env~;
+#X text 155 49 calculates the arithmetic mean of one signal vector
+;
+#X obj 315 296 envrms~;
+#X obj 59 173 osc~ 5512.5;
+#X text 456 11 part of zexy;
+#X connect 0 0 13 0;
+#X connect 1 0 3 0;
+#X connect 3 0 4 0;
+#X connect 9 0 2 0;
+#X connect 10 0 1 0;
+#X connect 13 0 9 0;
+#X connect 13 0 10 0;
diff --git a/examples/blockmirror~.pd b/examples/blockmirror~.pd
index 101410c..8dc48ec 100644
--- a/examples/blockmirror~.pd
+++ b/examples/blockmirror~.pd
@@ -1,13 +1,7 @@
-#N canvas 0 0 705 533 10;
-#X obj 71 367 dac~ 1;
-#X obj 71 342 *~;
-#X obj 32 293 dbtorms;
-#X floatatom 32 269 0 0 0 0 - - -;
+#N canvas 425 385 705 533 10;
#X floatatom 26 203 0 0 0 0 - - -;
#X msg 118 228 help;
-#X msg 404 59 \; pd dsp 1;
-#X obj 71 317 sig~ 0.2;
-#X msg 482 61 \; pd dsp 0;
+#X msg 488 83 \; pd dsp 1;
#N canvas 0 0 450 300 graph5 0;
#X array scope 100 float 0;
#X coords 0 1 100 -1 400 300 1;
@@ -17,19 +11,74 @@
#X text 287 166 note: there will be a break at 64 samples (signal-vector!)
;
#X obj 26 227 osc~ 440;
-#X obj 122 198 tgl 15 0 empty empty on/off 0 -6 0 8 -262144 -1 -1 1
+#X obj 122 198 tgl 15 0 empty empty on/off 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 101 12 blockmirror~;
#X obj 87 255 blockmirror~;
#X text 200 13 play back a signal-vector in a time-reversed way!;
-#X connect 1 0 0 0;
-#X connect 2 0 7 0;
-#X connect 3 0 2 0;
-#X connect 4 0 13 0;
-#X connect 5 0 16 0;
-#X connect 7 0 1 0;
-#X connect 11 0 10 0;
-#X connect 13 0 16 0;
-#X connect 14 0 16 0;
-#X connect 16 0 1 1;
-#X connect 16 0 10 0;
+#X floatatom 116 442 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 25 0;
+#X connect 5 0 25 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 26 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 24 0 1 1;
+#X connect 24 0 9 0;
+#X restore 87 470 pd output;
+#X msg 145 442 MUTE;
+#X text 111 423 output amplitude;
+#X text 595 41 part of zexy;
+#X connect 0 0 7 0;
+#X connect 1 0 10 0;
+#X connect 5 0 4 0;
+#X connect 7 0 10 0;
+#X connect 8 0 10 0;
+#X connect 10 0 4 0;
+#X connect 10 0 13 0;
+#X connect 12 0 13 1;
+#X connect 13 0 12 0;
+#X connect 14 0 13 2;
diff --git a/examples/blockswap~.pd b/examples/blockswap~.pd
index 2ff6fd1..011372f 100644
--- a/examples/blockswap~.pd
+++ b/examples/blockswap~.pd
@@ -1,13 +1,7 @@
-#N canvas 0 0 705 533 10;
-#X obj 71 367 dac~ 1;
-#X obj 71 342 *~;
-#X obj 32 293 dbtorms;
-#X floatatom 32 269 0 0 0 0 - - -;
+#N canvas 380 305 705 533 10;
#X floatatom 26 203 0 0 0 0 - - -;
#X msg 118 228 help;
#X msg 404 59 \; pd dsp 1;
-#X obj 71 317 sig~ 0.2;
-#X msg 482 61 \; pd dsp 0;
#N canvas 0 0 450 300 graph5 0;
#X array scope 100 float 0;
#X coords 0 1 100 -1 400 300 1;
@@ -20,17 +14,72 @@
#X obj 26 227 osc~ 440;
#X obj 123 12 blockswap~;
#X text 200 13 swap upper and lower half of the signal-vector;
-#X obj 122 198 tgl 15 0 empty empty on/off 0 -6 0 8 -262144 -1 -1 1
+#X obj 122 198 tgl 15 0 empty empty on/off 0 -6 0 8 -262144 -1 -1 0
1;
#X text 287 151 note: there will be a break at 32 samples (swap!);
-#X connect 1 0 0 0;
-#X connect 2 0 7 0;
-#X connect 3 0 2 0;
-#X connect 4 0 14 0;
-#X connect 5 0 13 0;
-#X connect 7 0 1 0;
-#X connect 11 0 10 0;
-#X connect 13 0 1 1;
-#X connect 13 0 10 0;
+#X floatatom 116 442 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 87 470 pd output;
+#X msg 145 442 MUTE;
+#X text 111 423 output amplitude;
+#X text 477 63 part of zexy;
+#X connect 0 0 8 0;
+#X connect 1 0 7 0;
+#X connect 5 0 4 0;
+#X connect 7 0 4 0;
+#X connect 7 0 14 0;
+#X connect 8 0 7 0;
+#X connect 11 0 7 0;
+#X connect 13 0 14 1;
#X connect 14 0 13 0;
-#X connect 17 0 13 0;
+#X connect 15 0 14 2;
diff --git a/examples/coordinates.pd b/examples/coordinates.pd
index 0004931..e751b39 100644
--- a/examples/coordinates.pd
+++ b/examples/coordinates.pd
@@ -1,4 +1,4 @@
-#N canvas 114 89 754 537 10;
+#N canvas 413 385 754 537 10;
#X text 122 40 convert between SPHeric \, POLar and CARTesian coordinates
;
#X obj 99 305 cart2sph;
@@ -45,6 +45,7 @@
#X obj 309 305 pol2cart;
#X text 112 450 angles are given in RADian \, if you want DEGree you
might want to use [deg2rad] and [rad2deg];
+#X text 599 17 part of zexy;
#X connect 1 0 7 0;
#X connect 1 1 6 0;
#X connect 1 2 5 0;
diff --git a/examples/date.pd b/examples/date.pd
index 96ef8ca..b3cdeb2 100644
--- a/examples/date.pd
+++ b/examples/date.pd
@@ -1,4 +1,4 @@
-#N canvas 253 26 421 483 10;
+#N canvas 683 311 421 483 10;
#X obj 71 203 date;
#X msg 71 174 bang;
#X floatatom 94 350 0 0 0 0 - - -;
@@ -14,7 +14,7 @@
#X text 175 373 month;
#X text 179 399 year;
#X text 70 151 local;
-#X text 284 151 GMT;
+#X text 294 153 GMT;
#X floatatom 124 240 0 0 0 0 - - -;
#X floatatom 112 264 0 0 0 0 - - -;
#X floatatom 101 291 0 0 0 0 - - -;
@@ -25,6 +25,7 @@
#X text 179 267 day of year;
#X text 180 293 day of week;
#X text 180 349 day of month;
+#X text 316 6 part of zexy;
#X connect 0 0 4 0;
#X connect 0 1 3 0;
#X connect 0 2 2 0;
diff --git a/examples/demultiplex.pd b/examples/demultiplex.pd
index 1d69b08..dfcc1b5 100644
--- a/examples/demultiplex.pd
+++ b/examples/demultiplex.pd
@@ -1,35 +1,42 @@
-#N canvas 350 196 655 292 10;
-#X obj 51 171 demux 1 2 3 4;
-#X obj 51 91 metro 320;
-#X obj 51 111 t b b;
-#X obj 51 130 random 100;
-#X msg 51 69 1;
-#X msg 76 69 0;
-#X floatatom 135 147;
-#X obj 51 239 print output0;
-#X obj 135 129 random 4;
-#X obj 75 222 print outpu1;
-#X obj 99 205 print outp2;
-#X obj 124 188 print out3;
-#X msg 51 150 bet \$1;
-#X text 231 10 demultiplex the inlet to the specified output;
-#X obj 111 12 demultiplex;
-#X obj 315 236 demux;
-#X text 271 237 alias;
-#X text 268 166 creation: "demultiplex [<in1?> [<in2?> [<in3?> ... ]]]";
-#X text 303 185 the number of arguments defines the number of outlets;
-#X text 277 81 the right inlet specifies \, to which outlet the left inlet is routed;
-#X text 280 119 outlets number from 0..(n-1);
-#X connect 0 0 7 0;
-#X connect 0 1 9 0;
-#X connect 0 2 10 0;
-#X connect 0 3 11 0;
-#X connect 1 0 2 0;
-#X connect 2 0 3 0;
-#X connect 2 1 8 0;
-#X connect 3 0 12 0;
-#X connect 4 0 1 0;
-#X connect 5 0 1 0;
-#X connect 6 0 0 1;
-#X connect 8 0 6 0;
-#X connect 12 0 0 0;
+#N canvas 425 439 709 294 10;
+#X obj 51 171 demux 1 2 3 4;
+#X obj 51 91 metro 320;
+#X obj 51 111 t b b;
+#X obj 51 130 random 100;
+#X msg 51 69 1;
+#X msg 76 69 0;
+#X floatatom 135 147 0 0 0 0 - - -;
+#X obj 51 239 print output0;
+#X obj 135 129 random 4;
+#X obj 75 222 print outpu1;
+#X obj 99 205 print outp2;
+#X obj 124 188 print out3;
+#X msg 51 150 bet \$1;
+#X text 231 10 demultiplex the inlet to the specified output;
+#X obj 111 12 demultiplex;
+#X obj 315 236 demux;
+#X text 271 237 alias;
+#X text 303 159 the number of arguments defines the number of outlets
+;
+#X text 277 81 the right inlet specifies \, to which outlet the left
+inlet is routed;
+#X text 280 119 outlets number from 0..(n-1);
+#X text 549 33 part of zexy;
+#X text 263 174 even though this seems to be a bit weird \, this makes
+patches more readable (as the object becomes wider if it has more outlets)
+;
+#X text 268 140 creation: "demultiplex [<out1?> [<out2?> [<out3?> ...
+]]]";
+#X connect 0 0 7 0;
+#X connect 0 1 9 0;
+#X connect 0 2 10 0;
+#X connect 0 3 11 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 8 0;
+#X connect 3 0 12 0;
+#X connect 4 0 1 0;
+#X connect 5 0 1 0;
+#X connect 6 0 0 1;
+#X connect 8 0 6 0;
+#X connect 12 0 0 0;
diff --git a/examples/demultiplex~.pd b/examples/demultiplex~.pd
index 290fd72..6f43fd6 100644
--- a/examples/demultiplex~.pd
+++ b/examples/demultiplex~.pd
@@ -1,33 +1,34 @@
-#N canvas 79 72 635 302 12;
-#X obj 72 139 sig~ 1;
-#X floatatom 110 93 4 0 0;
-#X obj 71 229 env~;
-#X floatatom 71 255 4 0 0;
-#X text 428 109 alias;
-#X obj 71 193 demultiplex~ . . . . .;
-#X obj 113 229 env~;
-#X floatatom 113 255 4 0 0;
-#X obj 156 230 env~;
-#X floatatom 156 256 4 0 0;
-#X obj 199 229 env~;
-#X floatatom 199 255 4 0 0;
-#X obj 242 227 env~;
-#X floatatom 242 253 4 0 0;
-#X text 156 94 select an outlet;
-#X obj 75 23 demultiplex~;
-#X text 210 22 demultiplex 1 signal to 1-of-n outlets;
-#X obj 480 110 demux~;
-#X text 154 174 the number of arguments specifies the number of outlets
-;
-#X connect 0 0 5 0;
-#X connect 1 0 5 0;
-#X connect 2 0 3 0;
-#X connect 5 0 2 0;
-#X connect 5 1 6 0;
-#X connect 5 2 8 0;
-#X connect 5 3 10 0;
-#X connect 5 4 12 0;
-#X connect 6 0 7 0;
-#X connect 8 0 9 0;
-#X connect 10 0 11 0;
-#X connect 12 0 13 0;
+#N canvas 301 479 635 302 12;
+#X obj 72 139 sig~ 1;
+#X floatatom 110 93 4 0 0 0 - - -;
+#X obj 71 229 env~;
+#X floatatom 71 255 4 0 0 0 - - -;
+#X text 428 109 alias;
+#X obj 71 193 demultiplex~ . . . . .;
+#X obj 113 229 env~;
+#X floatatom 113 255 4 0 0 0 - - -;
+#X obj 156 230 env~;
+#X floatatom 156 256 4 0 0 0 - - -;
+#X obj 199 229 env~;
+#X floatatom 199 255 4 0 0 0 - - -;
+#X obj 242 227 env~;
+#X floatatom 242 253 4 0 0 0 - - -;
+#X text 156 94 select an outlet;
+#X obj 75 23 demultiplex~;
+#X text 210 22 demultiplex 1 signal to 1-of-n outlets;
+#X obj 480 110 demux~;
+#X text 154 174 the number of arguments specifies the number of outlets
+;
+#X text 513 3 part of zexy;
+#X connect 0 0 5 0;
+#X connect 1 0 5 0;
+#X connect 2 0 3 0;
+#X connect 5 0 2 0;
+#X connect 5 1 6 0;
+#X connect 5 2 8 0;
+#X connect 5 3 10 0;
+#X connect 5 4 12 0;
+#X connect 6 0 7 0;
+#X connect 8 0 9 0;
+#X connect 10 0 11 0;
+#X connect 12 0 13 0;
diff --git a/examples/dfreq~.pd b/examples/dfreq~.pd
index a211c63..1f033f3 100644
--- a/examples/dfreq~.pd
+++ b/examples/dfreq~.pd
@@ -1,15 +1,20 @@
-#N canvas 307 9 598 301 10;
-#X obj 61 163 dfreq~;
-#X obj 61 133 osc~ 440;
-#X obj 61 231 print~;
-#X msg 96 208 bang;
-#X obj 85 28 dfreq~;
-#X text 146 27 a frequency detector that counts zero-crossings;
-#X floatatom 61 109;
-#X text 182 104 every zero-crossing the frequency-estimation is updated \, therefore this estimation is given as a signal...;
-#X text 179 170 this detector won't work properly on complex signals (e.g. zero-crossings should not be caused by higher partials);
-#X text 177 205 on the other hand \, this is much cheaper than fft's or fiddle...;
-#X connect 0 0 2 0;
-#X connect 1 0 0 0;
-#X connect 3 0 2 0;
-#X connect 6 0 1 0;
+#N canvas 441 541 598 301 10;
+#X obj 61 163 dfreq~;
+#X obj 61 133 osc~ 440;
+#X obj 61 231 print~;
+#X msg 96 208 bang;
+#X obj 85 28 dfreq~;
+#X text 146 27 a frequency detector that counts zero-crossings;
+#X floatatom 61 109 0 0 0 0 - - -;
+#X text 182 104 every zero-crossing the frequency-estimation is updated
+\, therefore this estimation is given as a signal...;
+#X text 179 170 this detector won't work properly on complex signals
+(e.g. zero-crossings should not be caused by higher partials);
+#X text 177 205 on the other hand \, this is much cheaper than fft's
+or fiddle...;
+#X text 503 7 part of zexy;
+#X text 183 265 thanks to w.ritsch for this one;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 3 0 2 0;
+#X connect 6 0 1 0;
diff --git a/examples/digidistort.pd b/examples/digidistort.pd
index 6764a3b..2a876da 100644
--- a/examples/digidistort.pd
+++ b/examples/digidistort.pd
@@ -1,69 +1,170 @@
-#N canvas 0 -1 708 652 10;
-#X obj 99 529 swap~;
-#X text 172 515 byte-swap the signal;
-#X text 214 164 quantize a signal with a variable step-number;
-#X text 171 533 this object first converts the signal to 16bit \, then swaps upper and lower byte.;
-#X text 117 11 objects~ that are distorting in a very "digital" way;
-#X msg 128 113 8bit;
-#X msg 128 89 16bit;
-#X msg 128 66 float;
-#X floatatom 129 42;
-#X obj 77 273 dac~ 1;
-#X obj 77 248 *~;
-#X obj 39 199 dbtorms;
-#X floatatom 39 175;
-#X msg 122 441 0;
-#X msg 122 417 1;
-#X msg 121 466 bang;
-#X obj 35 136 osc~ 440;
-#X floatatom 35 112;
-#X obj 96 164 quantize~ 16;
-#X obj 35 496 osc~ 440;
-#X floatatom 35 472;
-#X msg 121 491 help;
-#X obj 83 609 *~;
-#X obj 45 560 dbtorms;
-#X floatatom 45 536;
-#X msg 127 137 help;
-#X obj 83 634 dac~ 2;
-#X msg 404 59 \; pd dsp 1;
-#X obj 78 223 sig~ 0.2;
-#X obj 83 584 sig~ 0.2;
-#X msg 482 61 \; pd dsp 0;
-#X graph graph5 0 -1 100 1 298 494 698 194;
-#X array scope 100 float;
-#X pop;
-#X obj 148 223 tabwrite~ scope;
-#X msg 148 198 bang;
-#X obj 178 634 tabwrite~ scope;
-#X msg 178 609 bang;
-#X text 161 466 toggle;
-#X text 154 416 on;
-#X text 156 440 off;
-#X connect 0 0 22 1;
-#X connect 0 0 34 0;
-#X connect 5 0 18 0;
-#X connect 6 0 18 0;
-#X connect 7 0 18 0;
-#X connect 8 0 18 0;
-#X connect 10 0 9 0;
-#X connect 11 0 28 0;
-#X connect 12 0 11 0;
-#X connect 13 0 0 0;
-#X connect 14 0 0 0;
-#X connect 15 0 0 0;
-#X connect 16 0 18 0;
-#X connect 17 0 16 0;
-#X connect 18 0 10 1;
-#X connect 18 0 32 0;
-#X connect 19 0 0 0;
-#X connect 20 0 19 0;
-#X connect 21 0 0 0;
-#X connect 22 0 26 0;
-#X connect 23 0 29 0;
-#X connect 24 0 23 0;
-#X connect 25 0 18 0;
-#X connect 28 0 10 0;
-#X connect 29 0 22 0;
-#X connect 33 0 32 0;
-#X connect 35 0 34 0;
+#N canvas 390 139 803 782 10;
+#X obj 99 529 swap~;
+#X text 172 515 byte-swap the signal;
+#X text 214 164 quantize a signal with a variable step-number;
+#X text 171 533 this object first converts the signal to 16bit \, then
+swaps upper and lower byte.;
+#X text 117 11 objects~ that are distorting in a very "digital" way
+;
+#X msg 128 113 8bit;
+#X msg 128 89 16bit;
+#X msg 128 66 float;
+#X floatatom 129 42 0 0 0 0 - - -;
+#X msg 122 441 0;
+#X msg 122 417 1;
+#X msg 121 466 bang;
+#X obj 35 136 osc~ 440;
+#X floatatom 35 112 0 0 0 0 - - -;
+#X obj 96 164 quantize~ 16;
+#X obj 35 496 osc~ 440;
+#X floatatom 35 472 0 0 0 0 - - -;
+#X msg 121 491 help;
+#X msg 127 137 help;
+#X msg 404 59 \; pd dsp 1;
+#N canvas 0 0 450 300 graph5 0;
+#X array scope 100 float 0;
+#X coords 0 1 100 -1 400 300 1;
+#X restore 298 194 graph;
+#X obj 148 223 tabwrite~ scope;
+#X msg 148 198 bang;
+#X obj 178 634 tabwrite~ scope;
+#X msg 178 609 bang;
+#X text 161 466 toggle;
+#X text 154 416 on;
+#X text 156 440 off;
+#X floatatom 129 695 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl2;
+#X obj 199 100 s \$0master-lvl2;
+#X obj 338 210 s \$0master-lvl2;
+#X obj 397 92 r \$0master-lvl2;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 25 0;
+#X connect 5 0 25 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 26 0 1 1;
+#X connect 26 0 9 0;
+#X restore 100 723 pd output;
+#X msg 158 695 MUTE;
+#X text 124 676 output amplitude;
+#X floatatom 125 301 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 24 0;
+#X connect 5 0 24 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 26 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 96 329 pd output;
+#X msg 154 301 MUTE;
+#X text 120 282 output amplitude;
+#X text 657 13 part of zexy;
+#X connect 0 0 23 0;
+#X connect 0 0 29 0;
+#X connect 5 0 14 0;
+#X connect 6 0 14 0;
+#X connect 7 0 14 0;
+#X connect 8 0 14 0;
+#X connect 9 0 0 0;
+#X connect 10 0 0 0;
+#X connect 11 0 0 0;
+#X connect 12 0 14 0;
+#X connect 13 0 12 0;
+#X connect 14 0 21 0;
+#X connect 14 0 33 0;
+#X connect 15 0 0 0;
+#X connect 16 0 15 0;
+#X connect 17 0 0 0;
+#X connect 18 0 14 0;
+#X connect 22 0 21 0;
+#X connect 24 0 23 0;
+#X connect 28 0 29 1;
+#X connect 29 0 28 0;
+#X connect 30 0 29 2;
+#X connect 32 0 33 1;
+#X connect 33 0 32 0;
+#X connect 34 0 33 2;
diff --git a/examples/dirac~.pd b/examples/dirac~.pd
index d1317dd..6d0e755 100644
--- a/examples/dirac~.pd
+++ b/examples/dirac~.pd
@@ -1,43 +1,47 @@
-#N canvas 202 49 564 290 8;
-#X obj 123 230 dirac~;
-#X floatatom 95 186;
-#X obj 95 208 t b f;
-#X obj 123 253 print~;
-#X text 40 30 dirac~ ::;
-#X text 40 60 IN :;
-#X text 115 30 produces a unit:sample:sequence;
-#X text 114 61 define the nth sample after the float::bang:message for the unit:sample to take place;
-#X text 98 165 position;
-#N canvas 0 0 765 385 application 0;
-#X obj 75 82 t b b b;
-#X msg 119 104 \; pd dsp 1;
-#X obj 97 139 dirac~;
-#X floatatom 181 141;
-#X obj 97 181 tabwrite~ unit::response;
-#X graph graph1 0 -1 64 1 358 325 758 25;
-#X array unit::response 64 float;
-#X pop;
-#X msg 70 283 \; unit::response resize 64;
-#X text 32 353 we thought it useful to have a tool that would be able to easily plot the unit::response of a system;
-#X text 111 61 press me;
-#X msg 75 61 bang;
-#X obj 97 160 hip~ 5000;
-#X connect 0 0 4 0;
-#X connect 0 1 2 0;
-#X connect 0 2 1 0;
-#X connect 2 0 10 0;
-#X connect 3 0 10 1;
-#X connect 9 0 0 0;
-#X connect 10 0 4 0;
-#X restore 270 148 page application;
-#X obj 53 208 t f b;
-#X msg 53 187 2;
-#X msg 185 225 2;
-#X connect 0 0 3 0;
-#X connect 1 0 2 0;
-#X connect 2 0 3 0;
-#X connect 2 1 0 0;
-#X connect 10 0 3 0;
-#X connect 10 1 0 0;
-#X connect 11 0 10 0;
-#X connect 12 0 3 0;
+#N canvas 484 494 564 290 10;
+#X obj 123 230 dirac~;
+#X floatatom 95 186 0 0 0 0 - - -;
+#X obj 95 208 t b f;
+#X obj 123 253 print~;
+#X text 40 30 dirac~ ::;
+#X text 40 60 IN :;
+#X text 115 30 produces a unit:sample:sequence;
+#X text 114 61 define the nth sample after the float::bang:message
+for the unit:sample to take place;
+#X text 98 165 position;
+#N canvas 0 0 765 385 application 0;
+#X obj 75 82 t b b b;
+#X msg 119 104 \; pd dsp 1;
+#X obj 97 139 dirac~;
+#X floatatom 181 141 0 0 0 0 - - -;
+#X obj 97 181 tabwrite~ unit::response;
+#N canvas 0 0 450 300 graph1 0;
+#X array unit::response 64 float 0;
+#X coords 0 1 63 -1 400 300 1;
+#X restore 358 25 graph;
+#X msg 70 283 \; unit::response resize 64;
+#X text 32 353 we thought it useful to have a tool that would be able
+to easily plot the unit::response of a system;
+#X text 111 61 press me;
+#X msg 75 61 bang;
+#X obj 97 160 hip~ 5000;
+#X connect 0 0 4 0;
+#X connect 0 1 2 0;
+#X connect 0 2 1 0;
+#X connect 2 0 10 0;
+#X connect 3 0 10 1;
+#X connect 9 0 0 0;
+#X connect 10 0 4 0;
+#X restore 270 148 page application;
+#X obj 53 208 t f b;
+#X msg 53 187 2;
+#X msg 185 225 2;
+#X text 462 7 part of zexy;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 0 0;
+#X connect 10 0 3 0;
+#X connect 10 1 0 0;
+#X connect 11 0 10 0;
+#X connect 12 0 3 0;
diff --git a/examples/drip.pd b/examples/drip.pd
index 1aa7557..4bf4cfc 100644
--- a/examples/drip.pd
+++ b/examples/drip.pd
@@ -1,70 +1,77 @@
-#N canvas 378 65 854 849 10;
-#X msg 30 108 come on \, my house;
-#X obj 30 210 print UNFOLDED;
-#X msg 48 135 1 two tre quatre 5 se;
-#X text 72 10 drip;
-#X obj 30 183 drip;
-#X text 311 104 drip is like a medical drip - you can adjust the drop-speed;
-#X obj 316 198 drip 1000;
-#X obj 316 218 print DROP;
-#X msg 316 152 this is that slow;
-#X floatatom 365 179;
-#X text 439 545 drip without arguments will do no scheduling (this is: output all the atoms at once);
-#X text 424 182 drop-delay in [ms];
-#X obj 36 599 drip;
-#X obj 95 601 drip 0;
-#X msg 36 548 5 4 3 2 1 ready go;
-#X obj 36 569 t l l;
-#X obj 95 639 print SCHEDULED;
-#X obj 36 661 print DESCHEDUL;
-#X obj 248 592 drip -10;
-#X obj 248 621 print DESCHED;
-#X msg 248 556 bang;
-#X obj 639 805 unfold;
-#X text 423 790 for historical reasons (finding no proper object-name...) we still provide the obsolete alias;
-#X text 44 27 unfolds a package to a sequence;
-#X text 43 50 since you can switch to scheduled mode \, this might be used to reduce CPU-load;
-#X text 55 817 see also :;
-#X obj 127 819 repack;
-#X obj 35 299 t l l b;
-#X obj 151 350 t l l;
-#X obj 35 375 unfold 200 flush;
-#X obj 141 375 unfold 200;
-#X obj 151 309 del 250;
-#X msg 35 280 list some atoms could be saved while others;
-#X msg 151 329 list might get lost;
-#X obj 35 412 print TIGHT;
-#X obj 141 413 print LOOSE;
-#X obj 35 393 pipe s 1500;
-#X text 411 309 creation:;
-#X text 475 309 "drip [<n> [flush]]";
-#X text 457 397 <n> is the initial drop-delay in [ms];
-#X text 452 333 "flush" indicates whether non-empty buffers should be flushed when a new package arrives or not.;
-#X text 453 362 default is no_flush;
-#X text 457 430 n==0 will DO scheduling (and is therefore somewhat "slower" than without arguments;
-#X text 455 415 default is NO scheduling;
-#X text 456 465 negative values for <n> turn off scheduling;
-#X connect 0 0 4 0;
-#X connect 2 0 4 0;
-#X connect 4 0 1 0;
-#X connect 6 0 7 0;
-#X connect 8 0 6 0;
-#X connect 9 0 6 1;
-#X connect 12 0 17 0;
-#X connect 13 0 16 0;
-#X connect 14 0 15 0;
-#X connect 15 0 12 0;
-#X connect 15 1 13 0;
-#X connect 18 0 19 0;
-#X connect 20 0 18 0;
-#X connect 27 0 29 0;
-#X connect 27 1 30 0;
-#X connect 27 2 31 0;
-#X connect 28 0 29 0;
-#X connect 28 1 30 0;
-#X connect 29 0 36 0;
-#X connect 30 0 35 0;
-#X connect 31 0 33 0;
-#X connect 32 0 27 0;
-#X connect 33 0 28 0;
-#X connect 36 0 34 0;
+#N canvas 340 54 854 849 10;
+#X msg 30 108 come on \, my house;
+#X obj 30 210 print UNFOLDED;
+#X msg 48 135 1 two tre quatre 5 se;
+#X text 72 10 drip;
+#X obj 30 183 drip;
+#X text 311 104 drip is like a medical drip - you can adjust the drop-speed
+;
+#X obj 316 198 drip 1000;
+#X obj 316 218 print DROP;
+#X msg 316 152 this is that slow;
+#X floatatom 365 179 0 0 0 0 - - -;
+#X text 439 545 drip without arguments will do no scheduling (this
+is: output all the atoms at once);
+#X text 424 182 drop-delay in [ms];
+#X obj 36 599 drip;
+#X obj 95 601 drip 0;
+#X msg 36 548 5 4 3 2 1 ready go;
+#X obj 36 569 t l l;
+#X obj 95 639 print SCHEDULED;
+#X obj 36 661 print DESCHEDUL;
+#X obj 248 592 drip -10;
+#X obj 248 621 print DESCHED;
+#X msg 248 556 bang;
+#X obj 639 805 unfold;
+#X text 423 770 for historical reasons (finding no proper object-name...)
+we still provide the obsolete alias;
+#X text 44 27 unfolds a package to a sequence;
+#X text 43 50 since you can switch to scheduled mode \, this might
+be used to reduce CPU-load;
+#X text 55 817 see also :;
+#X obj 127 819 repack;
+#X obj 35 299 t l l b;
+#X obj 151 350 t l l;
+#X obj 35 375 unfold 200 flush;
+#X obj 141 375 unfold 200;
+#X obj 151 309 del 250;
+#X msg 35 280 list some atoms could be saved while others;
+#X msg 151 329 list might get lost;
+#X obj 35 412 print TIGHT;
+#X obj 141 413 print LOOSE;
+#X obj 35 393 pipe s 1500;
+#X text 411 309 creation:;
+#X text 475 309 "drip [<n> [flush]]";
+#X text 457 397 <n> is the initial drop-delay in [ms];
+#X text 452 333 "flush" indicates whether non-empty buffers should
+be flushed when a new package arrives or not.;
+#X text 453 362 default is no_flush;
+#X text 457 430 n==0 will DO scheduling (and is therefore somewhat
+"slower" than without arguments;
+#X text 455 415 default is NO scheduling;
+#X text 456 465 negative values for <n> turn off scheduling;
+#X text 717 13 part of zexy;
+#X connect 0 0 4 0;
+#X connect 2 0 4 0;
+#X connect 4 0 1 0;
+#X connect 6 0 7 0;
+#X connect 8 0 6 0;
+#X connect 9 0 6 1;
+#X connect 12 0 17 0;
+#X connect 13 0 16 0;
+#X connect 14 0 15 0;
+#X connect 15 0 12 0;
+#X connect 15 1 13 0;
+#X connect 18 0 19 0;
+#X connect 20 0 18 0;
+#X connect 27 0 29 0;
+#X connect 27 1 30 0;
+#X connect 27 2 31 0;
+#X connect 28 0 29 0;
+#X connect 28 1 30 0;
+#X connect 29 0 36 0;
+#X connect 30 0 35 0;
+#X connect 31 0 33 0;
+#X connect 32 0 27 0;
+#X connect 33 0 28 0;
+#X connect 36 0 34 0;
diff --git a/examples/envrms~.pd b/examples/envrms~.pd
index c0a4cc0..469886e 100644
--- a/examples/envrms~.pd
+++ b/examples/envrms~.pd
@@ -1,24 +1,29 @@
-#N canvas 288 18 580 361 10;
-#X obj 71 51 envrms~;
-#X text 174 51 an envelope follower that outputs rms instead of dB;
-#X obj 59 172 sig~ 3;
-#X floatatom 59 148;
-#X obj 59 233 env~;
-#X floatatom 59 254;
-#X floatatom 129 255;
-#X obj 129 234 envrms~;
-#X text 177 93 (i found it very often quite annoying \, to get dB all the times \, and i wouldn't use snapshot~ instead);
-#X obj 59 276 dbtorms;
-#X floatatom 59 299;
-#X text 179 172 of course \, this is cheaper than using env~ + dbtorms;
-#X text 272 269 see also:;
-#X obj 277 296 env~;
-#X obj 315 296 avg~;
-#X obj 354 296 tavg~;
-#X connect 2 0 7 0;
-#X connect 2 0 4 0;
-#X connect 3 0 2 0;
-#X connect 4 0 5 0;
-#X connect 5 0 9 0;
-#X connect 7 0 6 0;
-#X connect 9 0 10 0;
+#N canvas 366 497 580 361 10;
+#X obj 71 51 envrms~;
+#X text 174 51 an envelope follower that outputs rms instead of dB
+;
+#X obj 59 172 sig~ 3;
+#X floatatom 59 148 0 0 0 0 - - -;
+#X obj 59 233 env~;
+#X floatatom 59 254 0 0 0 0 - - -;
+#X floatatom 129 255 0 0 0 0 - - -;
+#X obj 129 234 envrms~;
+#X text 177 93 (i found it very often quite annoying \, to get dB all
+the times \, and i wouldn't use snapshot~ instead);
+#X obj 59 276 dbtorms;
+#X floatatom 59 299 0 0 0 0 - - -;
+#X text 179 172 of course \, this is cheaper than using env~ + dbtorms
+;
+#X text 272 269 see also:;
+#X obj 277 296 env~;
+#X obj 315 296 avg~;
+#X obj 354 296 tavg~;
+#X msg 484 217 \; pd dsp 1;
+#X text 479 17 part of zexy;
+#X connect 2 0 7 0;
+#X connect 2 0 4 0;
+#X connect 3 0 2 0;
+#X connect 4 0 5 0;
+#X connect 5 0 9 0;
+#X connect 7 0 6 0;
+#X connect 9 0 10 0;
diff --git a/examples/glue.pd b/examples/glue.pd
index ecc8603..a888c69 100644
--- a/examples/glue.pd
+++ b/examples/glue.pd
@@ -1,4 +1,4 @@
-#N canvas 652 218 777 455 10;
+#N canvas 243 428 595 456 10;
#X obj 111 58 glue;
#X text 171 58 glue together 2 packages (append \, prepend \, ...)
;
@@ -12,6 +12,7 @@
#X msg 51 179 bang;
#X obj 95 210 glue;
#X obj 277 206 glue and stick;
+#X text 490 14 part of zexy;
#X connect 2 0 10 0;
#X connect 3 0 10 1;
#X connect 6 0 11 0;
diff --git a/examples/index.pd b/examples/index.pd
index e7e1232..836f86f 100644
--- a/examples/index.pd
+++ b/examples/index.pd
@@ -1,87 +1,92 @@
-#N canvas 240 25 854 550 10;
-#X msg 117 288 reset;
-#X msg 216 288 auto 0;
-#X msg 354 287 help;
-#X floatatom 441 288;
-#X floatatom 192 439;
-#X obj 117 419 index 128 3;
-#X text 224 441 index;
-#X msg 216 313 auto 1;
-#X msg 128 85 add alias;
-#X msg 128 103 add bind;
-#X msg 128 121 add break;
-#X msg 128 140 add built-in;
-#X msg 128 159 add case;
-#X msg 384 103 delete bind;
-#X msg 384 121 delete break;
-#X msg 384 140 delete built-in;
-#X msg 384 159 delete case;
-#X obj 231 179 symbol;
-#X msg 250 159 case;
-#X msg 250 140 built-in;
-#X msg 250 121 break;
-#X msg 250 103 bind;
-#X msg 250 85 alias;
-#X obj 231 197 send 2index;
-#X obj 117 372 receive 2index;
-#X obj 372 197 send 2index;
-#X obj 114 197 send 2index;
-#X text 239 48 get item index;
-#X text 233 62 (evt. add new item);
-#X text 106 269 clear map;
-#X text 68 48 add new item to map;
-#X text 382 46 delete item from map;
-#X text 190 269 set/reset AUTO-adding;
-#X text 353 271 help;
-#X text 440 272 debug: which item has index #;
-#X text 61 9 index: create a symbol->int map;
-#X text 349 402 creation : "index [<n> [<auto>]]";
-#X text 290 517 in NON-AUTO mode \, only ADDED symbols (eg. "add <symbol>") are added to the map;
-#X text 289 495 in AUTO mode \, unknown symbols are automatically added to the map \;;
-#X msg 384 85 delete alias;
-#N canvas 601 96 333 308 print2screen 0;
-#X obj 114 58 inlet;
-#X obj 157 59 inlet;
-#X obj 114 231 pack 0 s;
-#X msg 114 252 \$2 -> \$1;
-#X obj 114 271 print mapped;
-#X obj 157 192 route add symbol delete;
-#X obj 157 212 symbol;
-#X obj 246 173 loadbang;
-#X connect 0 0 2 0;
-#X connect 1 0 5 0;
-#X connect 2 0 3 0;
-#X connect 3 0 4 0;
-#X connect 5 0 6 0;
-#X connect 5 1 6 0;
-#X connect 5 2 6 0;
-#X connect 6 0 2 1;
-#X connect 7 0 6 0;
-#X restore 117 488 pd print2screen;
-#X text 387 420 n :: max. number of elements in list (defaults to 128);
-#X text 369 429 auto :: 1_sets auto ON \, 0_sets auto OFF (default off);
-#X connect 0 0 5 0;
-#X connect 1 0 5 0;
-#X connect 2 0 5 0;
-#X connect 3 0 5 0;
-#X connect 5 0 4 0;
-#X connect 5 0 40 0;
-#X connect 7 0 5 0;
-#X connect 8 0 26 0;
-#X connect 9 0 26 0;
-#X connect 10 0 26 0;
-#X connect 11 0 26 0;
-#X connect 12 0 26 0;
-#X connect 13 0 25 0;
-#X connect 14 0 25 0;
-#X connect 15 0 25 0;
-#X connect 16 0 25 0;
-#X connect 17 0 23 0;
-#X connect 18 0 17 0;
-#X connect 19 0 17 0;
-#X connect 20 0 17 0;
-#X connect 21 0 17 0;
-#X connect 22 0 17 0;
-#X connect 24 0 40 1;
-#X connect 24 0 5 0;
-#X connect 39 0 25 0;
+#N canvas 347 343 854 550 10;
+#X msg 117 288 reset;
+#X msg 216 288 auto 0;
+#X msg 354 287 help;
+#X floatatom 441 288 0 0 0 0 - - -;
+#X floatatom 192 439 0 0 0 0 - - -;
+#X obj 117 419 index 128 3;
+#X text 224 441 index;
+#X msg 216 313 auto 1;
+#X msg 128 85 add alias;
+#X msg 128 103 add bind;
+#X msg 128 121 add break;
+#X msg 128 140 add built-in;
+#X msg 128 159 add case;
+#X msg 384 103 delete bind;
+#X msg 384 121 delete break;
+#X msg 384 140 delete built-in;
+#X msg 384 159 delete case;
+#X obj 231 179 symbol;
+#X msg 250 159 case;
+#X msg 250 140 built-in;
+#X msg 250 121 break;
+#X msg 250 103 bind;
+#X msg 250 85 alias;
+#X obj 231 197 send 2index;
+#X obj 117 372 receive 2index;
+#X obj 372 197 send 2index;
+#X obj 114 197 send 2index;
+#X text 239 48 get item index;
+#X text 233 62 (evt. add new item);
+#X text 106 269 clear map;
+#X text 68 48 add new item to map;
+#X text 382 46 delete item from map;
+#X text 190 269 set/reset AUTO-adding;
+#X text 353 271 help;
+#X text 440 272 debug: which item has index #;
+#X text 61 9 index: create a symbol->int map;
+#X text 349 402 creation : "index [<n> [<auto>]]";
+#X text 290 517 in NON-AUTO mode \, only ADDED symbols (eg. "add <symbol>")
+are added to the map;
+#X text 289 495 in AUTO mode \, unknown symbols are automatically added
+to the map \;;
+#X msg 384 85 delete alias;
+#N canvas 601 96 333 308 print2screen 0;
+#X obj 114 58 inlet;
+#X obj 157 59 inlet;
+#X obj 114 231 pack 0 s;
+#X msg 114 252 \$2 -> \$1;
+#X obj 114 271 print mapped;
+#X obj 157 192 route add symbol delete;
+#X obj 157 212 symbol;
+#X obj 246 173 loadbang;
+#X connect 0 0 2 0;
+#X connect 1 0 5 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 5 0 6 0;
+#X connect 5 1 6 0;
+#X connect 5 2 6 0;
+#X connect 6 0 2 1;
+#X connect 7 0 6 0;
+#X restore 117 488 pd print2screen;
+#X text 387 420 n :: max. number of elements in list (defaults to 128)
+;
+#X text 369 429 auto :: 1_sets auto ON \, 0_sets auto OFF (default
+off);
+#X text 705 14 part of zexy;
+#X connect 0 0 5 0;
+#X connect 1 0 5 0;
+#X connect 2 0 5 0;
+#X connect 3 0 5 0;
+#X connect 5 0 4 0;
+#X connect 5 0 40 0;
+#X connect 7 0 5 0;
+#X connect 8 0 26 0;
+#X connect 9 0 26 0;
+#X connect 10 0 26 0;
+#X connect 11 0 26 0;
+#X connect 12 0 26 0;
+#X connect 13 0 25 0;
+#X connect 14 0 25 0;
+#X connect 15 0 25 0;
+#X connect 16 0 25 0;
+#X connect 17 0 23 0;
+#X connect 18 0 17 0;
+#X connect 19 0 17 0;
+#X connect 20 0 17 0;
+#X connect 21 0 17 0;
+#X connect 22 0 17 0;
+#X connect 24 0 40 1;
+#X connect 24 0 5 0;
+#X connect 39 0 25 0;
diff --git a/examples/length.pd b/examples/length.pd
index c75f45a..e5ce4f0 100644
--- a/examples/length.pd
+++ b/examples/length.pd
@@ -1,13 +1,14 @@
-#N canvas 186 166 450 300 10;
+#N canvas 231 541 421 294 10;
#X obj 77 40 length;
#X text 141 43 get the length of a list;
#X obj 72 186 length;
-#X floatatom 72 206 4 0 0;
+#X floatatom 72 206 4 0 0 0 - - -;
#X msg 72 109 list these are 4 elements;
#X msg 83 128 1 2 3;
#X msg 95 155 auralization by wave field synthesis;
#X msg 25 113 bang;
-#X floatatom 14 146 4 0 0;
+#X floatatom 14 146 4 0 0 0 - - -;
+#X text 324 19 part of zexy;
#X connect 2 0 3 0;
#X connect 4 0 2 0;
#X connect 5 0 2 0;
diff --git a/examples/limiter~.pd b/examples/limiter~.pd
index 3749f18..99f8df2 100644
--- a/examples/limiter~.pd
+++ b/examples/limiter~.pd
@@ -1,4 +1,4 @@
-#N canvas 283 98 625 388 8;
+#N canvas 354 454 851 449 10;
#X text 189 15 limiter;
#X text 187 25 ========;
#N canvas 0 0 591 391 creation 0;
@@ -23,78 +23,78 @@
#X obj 22 219 limiter~ 0 1 2 3;
#X obj 22 253 limiter~ 1 2;
#X obj 18 310 limiter~ We need 4 inlets;
-#X restore 39 202 page creation;
+#X restore 39 322 page creation;
#N canvas 62 0 762 828 modes 0;
-#X text -259 189 MODE 0 : 1-treshold-limiter;
-#X text -261 384 MODE 1 : 2-tresholds-limiter;
-#X msg 62 255 print;
-#X obj 16 316 limiter~;
-#X obj 39 141 limiter~;
-#X msg 103 123 help;
-#X msg 102 104 print;
-#X msg 39 32 mode 0;
-#X msg 102 31 LIMIT;
-#X msg 39 50 mode 1;
-#X msg 102 49 CRACK;
-#X msg 39 67 mode 2;
-#X msg 102 66 COMPRESS;
-#X text 172 48 crack limiter (2 tresholds);
-#X text 172 66 compressor (1 treshold);
-#X text 181 102 context status;
-#X text 82 30 ==;
-#X text 81 49 ==;
-#X text 80 68 ==;
-#X msg 77 302 LIMIT;
-#X obj 77 286 loadbang;
-#X text 171 30 normal limiter (1 treshold) [default];
-#X msg 61 459 print;
-#X obj 13 522 limiter~;
-#X obj 74 492 loadbang;
-#X msg 74 508 CRACK;
-#X msg 47 716 print;
-#X obj 60 760 loadbang;
-#X text -255 590 MODE 2 : compressor;
-#X msg 60 776 COMPRESS;
-#X msg 52 629 ratio 0.5;
-#X text 159 628 set compress-ratio (0.5 == 1:2);
-#X text 159 605 set the treshold \, where the compressor should start
+#X text -189 189 MODE 0 : 1-treshold-limiter;
+#X text -191 384 MODE 1 : 2-tresholds-limiter;
+#X msg 232 255 print;
+#X obj 186 316 limiter~;
+#X obj 209 141 limiter~;
+#X msg 273 123 help;
+#X msg 272 104 print;
+#X msg 209 32 mode 0;
+#X msg 272 31 LIMIT;
+#X msg 209 50 mode 1;
+#X msg 272 49 CRACK;
+#X msg 209 67 mode 2;
+#X msg 272 66 COMPRESS;
+#X text 342 48 crack limiter (2 tresholds);
+#X text 342 66 compressor (1 treshold);
+#X text 351 102 context status;
+#X text 252 30 ==;
+#X text 251 49 ==;
+#X text 250 68 ==;
+#X msg 247 302 LIMIT;
+#X obj 247 286 loadbang;
+#X text 341 30 normal limiter (1 treshold) [default];
+#X msg 231 459 print;
+#X obj 183 522 limiter~;
+#X obj 244 492 loadbang;
+#X msg 244 508 CRACK;
+#X msg 217 716 print;
+#X obj 230 760 loadbang;
+#X text -185 590 MODE 2 : compressor;
+#X msg 230 776 COMPRESS;
+#X msg 222 629 ratio 0.5;
+#X text 329 628 set compress-ratio (0.5 == 1:2);
+#X text 329 605 set the treshold \, where the compressor should start
to compress;
-#X text 162 677 set the compressor (limit/treshold/ratio);
-#X text 161 655 set limit/holdtime/releasetime at once;
-#X text 163 717 view actual settings;
-#X text 147 459 view actual settings;
-#X msg 64 188 limit 90;
-#X msg 64 211 set 105 40 150;
-#X msg 62 404 set 105 40 150;
-#X msg 65 426 set2 120 1 10;
-#X msg 51 654 set 110 40 150;
-#X msg 51 611 treshold 10;
-#X msg 50 677 compress 96 88 0.5;
-#X text 158 591 set the output-limit;
-#X msg 51 593 limit 98;
-#X text 148 254 view actual settings;
-#X text 149 212 set limit/holdtime/releasetime at once;
-#X text 149 185 set output limit;
-#X obj -1 790 limiter~;
-#X text 145 404 set limiter1 (output-limit/hold-time/release-time)
+#X text 352 677 set the compressor (limit/treshold/ratio);
+#X text 331 655 set limit/holdtime/releasetime at once;
+#X text 333 717 view actual settings;
+#X text 337 459 view actual settings;
+#X msg 234 188 limit 90;
+#X msg 234 211 set 105 40 150;
+#X msg 232 404 set 105 40 150;
+#X msg 235 426 set2 120 1 10;
+#X msg 221 654 set 110 40 150;
+#X msg 221 611 treshold 10;
+#X msg 220 677 compress 96 88 0.5;
+#X text 328 591 set the output-limit;
+#X msg 221 593 limit 98;
+#X text 338 254 view actual settings;
+#X text 339 212 set limit/holdtime/releasetime at once;
+#X text 339 185 set output limit;
+#X obj 169 790 limiter~;
+#X text 335 404 set limiter1 (output-limit/hold-time/release-time)
;
#X text -260 621 the output signal will never become louder than the
specified output-limit.;
-#X text -260 643 if the input-signal becomes loader than the input-treshold
+#X text -260 653 if the input-signal becomes loader than the input-treshold
\, a compressor will start working \, compressing the dynamic range
by the specified ratio. Signals lesser than the treshold will pass
through uncompressed.;
#X text -231 59 set the limiter~ to one of the 3 modes;
-#X text 144 380 set both limits;
-#X text -261 220 this is simple : the output will not become bigger
+#X text 334 380 set both limits;
+#X text -259 210 this is simple : the output will not become bigger
than the specified limit. When the input becomes small enough again
so that this condition is matched even without (positive) amplification
(this is \, when the input signal level falls below the limit) \, the
amplification will increase gradually (depending on hold- & release-time)
towards 1;
-#X text 144 427 set limiter2 (input-treshold/hold-time/release-time)
+#X text 334 427 set limiter2 (input-treshold/hold-time/release-time)
;
-#X msg 62 381 limits 100 108;
+#X msg 232 381 limits 100 108;
#X text -260 414 this limiter can be used to handle disgusting things
like cracks \, which are much louder than the "normal" musical signal.
Typically hold- and release-times for the second limiter are far smaller
@@ -103,10 +103,10 @@ quite fast (since the crack would disturb the sensation anyhow \, we
do not care much about the distortion caused by a fast limiter). The
treshold for the 2nd limiter must be greater than the ouput-limit (if
not \, the limiter will be reset to MODE 0);
-#X text -257 288 all levels (limts/tresholds) should be given in dB
+#X text -257 298 all levels (limts/tresholds) should be given in dB
to produce satisfying results (following pd's agreement on the deziBel-scale
\, 100dB are equal to 1 \, 0dB equals 0 \, ...);
-#X text 184 123 context(!) help;
+#X text 354 123 context(!) help;
#X connect 2 0 3 0;
#X connect 5 0 4 0;
#X connect 6 0 4 0;
@@ -134,22 +134,19 @@ to produce satisfying results (following pd's agreement on the deziBel-scale
#X connect 43 0 49 0;
#X connect 45 0 49 0;
#X connect 57 0 23 0;
-#X restore 184 201 page modes;
-#X msg 338 192 print;
-#X obj 385 316 dac~;
-#X obj 385 259 *~;
-#X obj 416 259 *~;
-#X floatatom 401 112 0 0 0;
-#X floatatom 482 110 0 0 0;
-#X floatatom 440 111 0 0 0;
-#X text 437 98 both;
-#X text 396 98 left;
-#X text 478 98 right;
-#X obj 416 206 limiter~ 50 1;
+#X restore 184 321 page modes;
+#X msg 398 249 print;
+#X obj 445 319 *~;
+#X obj 476 319 *~;
+#X floatatom 476 199 0 0 0 2 left - -;
+#X floatatom 562 200 0 0 0 2 right - -;
+#X floatatom 520 181 0 0 0 2 both - -;
+#X obj 476 266 limiter~ 50 1;
#N canvas 0 153 455 493 tabwrite 0;
-#X graph graph1 0 -1 32767 1 130 336 330 196;
+#N canvas 0 0 450 300 graph1 0;
#X array array1 32768 float 0;
-#X pop;
+#X coords 0 1 32767 -1 200 140 1;
+#X restore 130 196 graph;
#X obj 111 63 inlet~;
#X msg 214 78 \; array1 resize 32768;
#X obj 111 85 tabwrite~ array1;
@@ -159,11 +156,11 @@ to produce satisfying results (following pd's agreement on the deziBel-scale
#X connect 1 0 3 0;
#X connect 4 0 3 0;
#X connect 5 0 2 0;
-#X restore 443 318 pd tabwrite;
-#X obj 416 317 env~;
-#X floatatom 416 335 4 0 0;
-#X text 30 184 to learn more about this object \, try these;
-#X text 48 301 http://iem.kug.ac.at/~zmoelnig;
+#X restore 372 408 pd tabwrite;
+#X obj 382 341 env~;
+#X floatatom 382 359 4 0 0 0 - - -;
+#X text 30 304 to learn more about this object \, try these;
+#X text 48 371 http://iem.kug.ac.at/~zmoelnig;
#N canvas 59 76 600 400 generator~ 0;
#X obj 86 49 inlet;
#X obj 252 54 inlet;
@@ -195,32 +192,105 @@ to produce satisfying results (following pd's agreement on the deziBel-scale
#X connect 12 0 9 0;
#X connect 14 0 11 0;
#X connect 15 0 12 0;
-#X restore 416 161 pd generator~;
-#X obj 426 240 nop~;
-#X obj 385 240 nop~;
-#X text 37 91 it is quite important to delay the original signals before
+#X restore 476 221 pd generator~;
+#X text 37 99 it is quite important to delay the original signals before
the limiter-amplification is applied to prevent clicks !!!;
-#X text 52 283 1906:forum::für::umläute:2001;
+#X text 52 353 1906:forum::für::umläute:2001;
#X text 36 41 limiter will output the amplification-factor that has
to be applied on all INlet~s to get a beautiful limited multichannel-signal
that preserves the balance between the channels;
-#X text 401 72 level of the inlets;
-#X text 389 83 (give some 190dB and notice no clipping);
-#X connect 4 0 14 0;
-#X connect 6 0 5 0;
-#X connect 7 0 5 1;
+#X text 585 170 level of the inlets;
+#X text 511 148 (give some 190dB and notice no clipping);
+#X obj 493 298 z~ 64;
+#X obj 445 299 z~ 64;
+#X text 539 17 part of zexy;
+#X floatatom 496 354 0 0 100 0 - - -;
+#N canvas 159 26 532 285 output 0;
+#X obj 348 160 t b;
+#X obj 348 110 f;
+#X obj 348 60 inlet;
+#X text 354 29 mute;
+#X obj 348 185 f;
+#X msg 436 180 0;
+#X msg 348 85 bang;
+#X obj 348 135 moses 1;
+#X obj 407 110 moses 1;
+#X obj 133 148 dbtorms;
+#X obj 20 155 inlet~;
+#X obj 239 41 inlet;
+#X text 239 18 level;
+#X msg 146 65 set \$1;
+#X obj 146 90 outlet;
+#X msg 254 65 \; pd dsp 1;
+#X obj 133 198 line~;
+#X obj 20 207 *~;
+#X obj 20 232 dac~;
+#X obj 133 173 pack 0 50;
+#X text 20 132 audio;
+#X text 146 114 show level;
+#X obj 436 155 t b;
+#X obj 20 181 hip~ 1;
+#X obj 133 42 r \$0master-lvl;
+#X obj 80 155 inlet~;
+#X obj 80 207 *~;
+#X obj 80 181 hip~ 1;
+#X obj 239 105 s \$0master-lvl;
+#X obj 407 85 r \$0master-lvl;
+#X obj 348 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 30 0;
+#X connect 5 0 30 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 22 0;
+#X connect 8 1 4 1;
+#X connect 9 0 19 0;
+#X connect 10 0 23 0;
+#X connect 11 0 15 0;
+#X connect 11 0 28 0;
+#X connect 13 0 14 0;
+#X connect 16 0 17 1;
+#X connect 16 0 26 1;
+#X connect 17 0 18 0;
+#X connect 19 0 16 0;
+#X connect 22 0 5 0;
+#X connect 23 0 17 0;
+#X connect 24 0 9 0;
+#X connect 24 0 13 0;
+#X connect 25 0 27 0;
+#X connect 26 0 18 1;
+#X connect 27 0 26 0;
+#X connect 29 0 1 1;
+#X connect 29 0 8 0;
+#X restore 458 382 pd output;
+#X msg 534 355 MUTE;
+#X text 37 132 this is \, because the limiter algorithm needs some
+time (e.g. the outcoming signal is delayed by some samples) \; directly
+multiplying would therefore be a bit too late \, in case a spike appears.
+Adding a small delay takes care of this psychoacoustically (you won't
+here the click);
+#X text 532 300 just a small delay of 64 samples;
+#X text 531 44 updated for zexy-2.0;
+#X connect 4 0 10 0;
+#X connect 5 0 26 0;
+#X connect 5 0 12 0;
+#X connect 6 0 11 0;
+#X connect 6 0 26 1;
#X connect 7 0 16 0;
-#X connect 7 0 15 0;
-#X connect 8 0 20 0;
-#X connect 9 0 20 1;
-#X connect 10 0 20 0;
-#X connect 10 0 20 1;
-#X connect 14 0 7 0;
-#X connect 14 0 6 1;
-#X connect 16 0 17 0;
-#X connect 20 0 14 0;
-#X connect 20 0 22 0;
-#X connect 20 1 14 1;
-#X connect 20 1 21 0;
-#X connect 21 0 7 1;
-#X connect 22 0 6 0;
+#X connect 8 0 16 1;
+#X connect 9 0 7 0;
+#X connect 9 0 8 0;
+#X connect 10 0 6 0;
+#X connect 10 0 5 1;
+#X connect 12 0 13 0;
+#X connect 16 0 10 0;
+#X connect 16 0 23 0;
+#X connect 16 1 10 1;
+#X connect 16 1 22 0;
+#X connect 22 0 6 1;
+#X connect 23 0 5 0;
+#X connect 25 0 26 2;
+#X connect 26 0 25 0;
+#X connect 27 0 26 3;
diff --git a/examples/list2int.pd b/examples/list2int.pd
index d850396..607183e 100644
--- a/examples/list2int.pd
+++ b/examples/list2int.pd
@@ -1,17 +1,18 @@
-#N canvas 104 89 612 302 12;
-#X obj 106 246 print;
-#X msg 141 139 3.14159 2 hello 1;
-#X msg 150 170 gosh 2.3 1;
-#X obj 106 212 list2int;
-#X text 145 23 list to integer;
-#X text 98 49 cast all floats of a list to integers;
-#X msg 106 110 1 2 -1.567 3 2;
-#X text 225 110 list of floats;
-#X text 316 138 list with symbols;
-#X text 240 169 anything;
-#X obj 412 248 l2i;
-#X text 365 248 alias;
-#X connect 1 0 3 0;
-#X connect 2 0 3 0;
-#X connect 3 0 0 0;
-#X connect 6 0 3 0;
+#N canvas 265 308 612 302 12;
+#X obj 106 246 print;
+#X msg 141 139 3.14159 2 hello 1;
+#X msg 150 170 gosh 2.3 1;
+#X obj 106 212 list2int;
+#X text 145 23 list to integer;
+#X text 98 49 cast all floats of a list to integers;
+#X msg 106 110 1 2 -1.567 3 2;
+#X text 238 110 list of floats;
+#X text 304 139 list with symbols;
+#X obj 412 248 l2i;
+#X text 365 248 alias;
+#X text 451 15 part of zexy;
+#X text 248 169 not really a list;
+#X connect 1 0 3 0;
+#X connect 2 0 3 0;
+#X connect 3 0 0 0;
+#X connect 6 0 3 0;
diff --git a/examples/list2symbol.pd b/examples/list2symbol.pd
index 12c0592..846a85a 100644
--- a/examples/list2symbol.pd
+++ b/examples/list2symbol.pd
@@ -1,22 +1,26 @@
-#N canvas 198 171 809 343 10;
+#N canvas 228 508 809 343 10;
#X obj 135 48 list2symbol;
#X text 219 48 convert a list into a symbol;
#X obj 457 50 l2s;
-#X symbolatom 75 286 50 0 0;
-#X obj 75 258 list2symbol;
+#X symbolatom 75 286 0 0 0 0 - - -;
#X msg 75 97 list this was a list and is now a symbol;
#X msg 159 118 anythings work fine too;
#X obj 507 268 l2s my bonnie is over the ocean;
#X obj 507 288 print;
#X msg 507 247 bang;
-#X symbolatom 147 223 10 0 0;
-#X msg 147 188 symbol --;
-#X text 230 187 by default \, list-elements are separated by spaces.
+#X symbolatom 147 223 10 0 0 0 - - -;
+#X msg 147 158 symbol --;
+#X text 230 157 by default \, list-elements are separated by spaces.
You can set the separator to any symbol;
-#X connect 4 0 3 0;
-#X connect 5 0 4 0;
-#X connect 6 0 4 0;
-#X connect 7 0 8 0;
-#X connect 9 0 7 0;
-#X connect 10 0 4 1;
-#X connect 11 0 10 0;
+#X text 536 31 part of zexy;
+#X msg 156 201 symbol;
+#X obj 75 258 list2symbol;
+#X text 222 203 even to a zero-length symbol!;
+#X connect 4 0 14 0;
+#X connect 5 0 14 0;
+#X connect 6 0 7 0;
+#X connect 8 0 6 0;
+#X connect 9 0 14 1;
+#X connect 10 0 9 0;
+#X connect 13 0 9 0;
+#X connect 14 0 3 0;
diff --git a/examples/lister.pd b/examples/lister.pd
index 66dd74e..c9b4ec8 100644
--- a/examples/lister.pd
+++ b/examples/lister.pd
@@ -1,4 +1,4 @@
-#N canvas 194 86 685 518 10;
+#N canvas 385 348 685 518 10;
#X obj 110 16 lister;
#X text 160 17 - store a list;
#X msg 41 132 bang;
@@ -34,6 +34,7 @@ a symbol \, you need to cast it as a list:;
#X obj 154 52 float;
#X obj 202 52 int;
#X obj 237 52 symbol;
+#X text 497 29 part of zexy;
#X connect 2 0 10 0;
#X connect 9 0 10 1;
#X connect 10 0 6 0;
diff --git a/examples/lpt.pd b/examples/lpt.pd
index 2a317b7..d9f461d 100644
--- a/examples/lpt.pd
+++ b/examples/lpt.pd
@@ -1,20 +1,44 @@
#N canvas 173 205 772 508 10;
-#X obj 90 33 lp;
#X text 129 36 write data to the (parallel) port;
-#X text 82 70 this is LINUX ONLY !!!;
-#X text 17 125 note:;
-#X text 59 126 you might have to be root to get write-permissions on your specified port.;
-#X text 59 160 you can access all ports on your system when using "lp <hex-port-address>";
-#X text 59 194 if your port-address exceeds 0x3ff \, "lp" will try to get all permissions with the iopl()-command. this might be dangerous !;
-#X obj 81 411 lp 0;
-#X obj 110 411 lp 1;
-#X obj 139 411 lp 2;
#X text 75 390 parallel ports 0 \, 1 \, 2;
-#X obj 294 415 lp 0x378;
#X text 289 394 another port;
-#X obj 81 337 lp 1;
#X obj 81 305 % 256;
-#X floatatom 81 283 4 0 0;
+#X floatatom 81 283 4 0 0 0 - - -;
#X text 122 284 write an 8bit-word;
-#X connect 14 0 13 0;
-#X connect 15 0 14 0;
+#X obj 90 33 lpt;
+#X obj 81 337 lpt 1;
+#X obj 81 411 lpt 0;
+#X obj 120 411 lpt 1;
+#X obj 159 411 lpt 2;
+#X obj 294 415 lpt 0x378;
+#X text 521 30 part of zexy;
+#X text 82 70 this does not work on osX (as there is no parallel port)
+;
+#X text 79 194 if your port-address exceeds 0x3ff \, "lpt" will try
+to get all permissions with the iopl()-command. this might be dangerous
+!;
+#X text 79 160 you can access all ports on your system when using "lpt
+<hex-port-address>";
+#N canvas 0 0 631 406 windows 0;
+#X text 32 16 To get it running under WinNT/2000/XP a special kernel
+driver is needed. These systems do not allow direct access to I/O ports.
+;
+#X text 53 207 If you ever whish to remove the kernel driver start
+the programm again and click 'Stop'.;
+#X text 54 242 Under Win95/98/Me all this is not needed!!!;
+#X text 52 272 Good Luck!;
+#X text 54 141 The subfolder 'UserPort' contains a kernel driver that
+handles the I/O stuff. Just copy the file UserPort.sys into %WINDIR%/system32/drivers
+(e.g. C:/WinNT/system32/drivers) and run the program UserPort.exe.
+Click on 'Start' and then 'Exit'.;
+#X text 175 112 ftp://iem.at/DOSen/UserPort/;
+#X text 172 82 http://www.embeddedtronics.com/public/Electronics/minidaq/..
+../userport;
+#X text 49 79 downloads:;
+#X text 267 326 thanks to Olaf Matthes for this;
+#X restore 292 94 pd windows;
+#X text 78 94 windoze users shoud read this:;
+#X text 79 122 linux users might have to be root to get write-permissions
+on your specified port.;
+#X connect 3 0 7 0;
+#X connect 4 0 3 0;
diff --git a/examples/makesymbol.pd b/examples/makesymbol.pd
index 2fced08..1e6fd10 100644
--- a/examples/makesymbol.pd
+++ b/examples/makesymbol.pd
@@ -1,4 +1,4 @@
-#N canvas 469 38 727 656 10;
+#N canvas 382 48 796 839 10;
#X obj 57 15 makesymbol;
#X text 152 13 makesymbol is something between the "symbol" and the
"makefilename" object.;
@@ -30,7 +30,7 @@ argument on the second input or as a creation-argument.;
#X text 321 255 if the right inlet (mask) does not have any format-tags
\, the left one won't get through !!;
#X floatatom 61 458 0 0 0 0 - - -;
-#X text 149 471 it doesn't matter whether you are using numbers \,
+#X text 177 473 it doesn't matter whether you are using numbers \,
symbols...;
#X text 235 567 note:: every member of the list will be converted to
a STRING \, so there's no use \, using %d \, %f...;
@@ -40,7 +40,6 @@ a STRING \, so there's no use \, using %d \, %f...;
#X symbolatom 92 427 25 0 0 0 - - -;
#X symbolatom 72 306 25 0 0 0 - - -;
#X symbolatom 80 619 25 0 0 0 - - -;
-#X obj 61 478 ftos;
#X symbolatom 58 166 0 0 0 0 - - -;
#X text 58 98 The result will always be a symbol.;
#X msg 58 118 list you can have up to ten members in your list.;
@@ -48,10 +47,18 @@ a STRING \, so there's no use \, using %d \, %f...;
#X obj 19 426 print B;
#X obj 10 618 print C;
#X obj 13 305 print A;
+#X obj 61 478 makefilename %d;
+#X text 551 18 part of zexy;
+#X text 25 719 a personal ntoe: this object is somewhat obsoleted \;
+use the following instead:;
+#X obj 167 742 makefilename;
+#X obj 167 772 l2s;
+#X text 260 741 (plain pd!);
+#X text 260 775 (zexy);
#X connect 3 0 32 0;
-#X connect 3 0 41 0;
+#X connect 3 0 40 0;
#X connect 4 0 33 0;
-#X connect 4 0 40 0;
+#X connect 4 0 39 0;
#X connect 5 0 3 0;
#X connect 6 0 11 0;
#X connect 7 0 4 0;
@@ -59,7 +66,7 @@ a STRING \, so there's no use \, using %d \, %f...;
#X connect 9 0 3 0;
#X connect 10 0 3 0;
#X connect 11 0 31 0;
-#X connect 11 0 39 0;
+#X connect 11 0 38 0;
#X connect 12 0 11 0;
#X connect 13 0 3 1;
#X connect 14 0 3 1;
@@ -71,8 +78,8 @@ a STRING \, so there's no use \, using %d \, %f...;
#X connect 20 0 19 0;
#X connect 21 0 11 1;
#X connect 22 0 11 1;
-#X connect 26 0 34 0;
+#X connect 26 0 41 0;
#X connect 29 0 11 0;
-#X connect 34 0 19 0;
-#X connect 37 0 38 0;
-#X connect 38 0 35 0;
+#X connect 36 0 37 0;
+#X connect 37 0 34 0;
+#X connect 41 0 19 0;
diff --git a/examples/matrix.pd b/examples/matrix.pd
deleted file mode 100644
index a1c6332..0000000
--- a/examples/matrix.pd
+++ /dev/null
@@ -1,133 +0,0 @@
-#N canvas 94 0 1118 745 10;
-#X obj 258 -23 matrix;
-#X obj 61 187 mtx_check;
-#X obj 61 216 mtx_print;
-#X obj 544 -21 mtx;
-#X obj 30 535 mtx_print;
-#X obj 30 513 matrix;
-#X msg 42 372 zeros 5;
-#X msg 30 353 eye 3;
-#X msg 49 390 ones 4;
-#X msg 55 411 diag 1 2 3 4;
-#X obj 369 531 matrix;
-#X obj 471 496 loadbang;
-#X obj 471 516 mtx_diag 4 3 1 2;
-#X obj 369 553 print;
-#X msg 369 364 row;
-#X msg 539 497 bang;
-#X msg 379 404 row \$1;
-#X floatatom 379 385 4 0 0;
-#X floatatom 391 424 4 0 0;
-#X msg 391 443 row \$1 1 2 3 4;
-#X floatatom 498 382 4 0 0;
-#X floatatom 510 421 4 0 0;
-#X msg 488 362 col;
-#X msg 498 401 col \$1;
-#X msg 510 440 col \$1 1 2 3 4;
-#X msg 592 364 element;
-#X msg 623 406 element \$1;
-#X floatatom 643 428 4 0 0;
-#X msg 643 447 element 3 \$1;
-#X floatatom 623 386 4 0 0;
-#X msg 61 162 matrix 3 3 1 2 3 4 5 6 7;
-#X msg 39 136 matrix 3 3 1 2 3 4 5 6 7;
-#X text 43 79 this is \, how a matrix really looks...;
-#X text 216 134 an "illegal" matrix;
-#X text 122 187 make the "illegal" matrix consistent;
-#X text 216 103 a "legal" matrix;
-#X msg 40 103 matrix 3 3 1 2 3 1 2 4 7 6 5;
-#X obj 590 218 mtx_print;
-#X obj 590 196 matrix;
-#X obj 655 174 mtx_ones 10;
-#X msg 655 154 bang;
-#X text 121 218 print to stderr (like "print");
-#X msg 590 64 bang;
-#X floatatom 615 103 4 0 0;
-#X msg 604 85 matrix 2 3 10 10 30 20 -5 8;
-#X msg 627 126 1 2 3 1 2 3 10 20 30;
-#X text 758 118 a list of elements;
-#X text 759 132 has to fit the size of the "current" matrix;
-#X text 651 104 set all elements of the current matrix to a value;
-#X text 366 345 get/set rows;
-#X text 479 344 get/set columns;
-#X text 5 564 create various matrices;
-#X text 356 -21 matrix operations;
-#X text 636 197 ==;
-#X obj 660 197 mtx;
-#X msg 335 398 bang;
-#X text 586 344 get/set elements;
-#X msg 654 486 element \$1 2 10;
-#X floatatom 654 468 4 0 0;
-#X msg 702 406 element \$1 \$1;
-#X text 687 406 ==;
-#X obj 161 479 matrix 3 2;
-#X obj 161 525 mtx_print;
-#X msg 161 357 bang;
-#X text 143 542 an "empty" [3 \, 2] matrix;
-#X msg 73 433 egg 4;
-#X msg 75 455 diegg 3 2 1;
-#X obj 126 671 mtx_element;
-#X obj 225 646 mtx_size;
-#X obj 225 669 mtx_transpose;
-#X obj 427 650 mtx_mean;
-#X obj 427 669 mtx_rand;
-#X obj 338 670 mtx_inverse;
-#X obj 126 646 mtx_eye;
-#X obj 338 645 mtx_+;
-#X text 127 620 see also help for:;
-#X msg 912 383 write /tmp/my_matrix.mtx;
-#X msg 912 406 read /tmp/my_matrix.mtx;
-#X obj 810 412 mtx_rand;
-#X msg 810 390 4 5;
-#X msg 858 389 bang;
-#X obj 858 464 mtx_print;
-#X text 848 351 load and save matrices;
-#X obj 858 440 matrix test.mtx;
-#X connect 1 0 2 0;
-#X connect 5 0 4 0;
-#X connect 6 0 5 0;
-#X connect 7 0 5 0;
-#X connect 8 0 5 0;
-#X connect 9 0 5 0;
-#X connect 10 0 13 0;
-#X connect 11 0 12 0;
-#X connect 12 0 10 1;
-#X connect 14 0 10 0;
-#X connect 15 0 12 0;
-#X connect 16 0 10 0;
-#X connect 17 0 16 0;
-#X connect 18 0 19 0;
-#X connect 19 0 10 0;
-#X connect 20 0 23 0;
-#X connect 21 0 24 0;
-#X connect 22 0 10 0;
-#X connect 23 0 10 0;
-#X connect 24 0 10 0;
-#X connect 25 0 10 0;
-#X connect 26 0 10 0;
-#X connect 27 0 28 0;
-#X connect 28 0 10 0;
-#X connect 29 0 26 0;
-#X connect 30 0 1 0;
-#X connect 31 0 2 0;
-#X connect 36 0 2 0;
-#X connect 38 0 37 0;
-#X connect 39 0 38 1;
-#X connect 40 0 39 0;
-#X connect 42 0 38 0;
-#X connect 43 0 38 0;
-#X connect 44 0 38 0;
-#X connect 45 0 38 0;
-#X connect 55 0 10 0;
-#X connect 57 0 10 0;
-#X connect 58 0 57 0;
-#X connect 61 0 62 0;
-#X connect 63 0 61 0;
-#X connect 65 0 5 0;
-#X connect 66 0 5 0;
-#X connect 76 0 83 0;
-#X connect 77 0 83 0;
-#X connect 78 0 83 0;
-#X connect 79 0 78 0;
-#X connect 80 0 83 0;
-#X connect 83 0 81 0;
diff --git a/examples/matrix~.pd b/examples/matrix~.pd
deleted file mode 100644
index 5b0fa07..0000000
--- a/examples/matrix~.pd
+++ /dev/null
@@ -1,58 +0,0 @@
-#N canvas 59 -12 889 589 12;
-#X obj 68 271 osc~ 100;
-#X obj 68 297 *~ 0.2;
-#X obj 112 320 osc~ 1000;
-#X obj 112 346 *~ 1.5;
-#X obj 157 295 osc~ 432;
-#X obj 68 411 env~;
-#X floatatom 68 435 4 0 0;
-#X obj 127 410 env~;
-#X floatatom 127 434 4 0 0;
-#X obj 187 410 env~;
-#X floatatom 187 434 4 0 0;
-#X obj 247 409 env~;
-#X floatatom 247 433 4 0 0;
-#X floatatom 284 350 4 0 0;
-#X text 332 353 fade time in [ms];
-#X msg 265 100 bang;
-#X obj 265 127 mtx_eye 3 4;
-#X msg 362 100 bang;
-#X obj 362 127 mtx_egg 3 4;
-#X msg 261 179 bang;
-#X msg 362 178 bang;
-#X obj 261 206 mtx_ones 3 4;
-#X obj 362 205 mtx_zeros 3 4;
-#X obj 68 371 matrix~ 3 4 100 .......;
-#X obj 98 32 matrix~;
-#X text 174 24 matrix-multiply m IN~signals to n OUT~signals;
-#X text 174 37 matrices are interpolated a la line~;
-#X text 473 91 the one-before-last inlet eats;
-#X text 476 104 matrix-messages to control the gains;
-#X text 475 117 of the matrix~;
-#X text 484 333 the last inlet gets the fade-time between two matrix-messages.
-;
-#X obj 78 505 matrix~;
-#X text 154 503 creation: "matrix~ [<num_in> [<num_out> [<fade_time>]]]
-;
-#X connect 0 0 1 0;
-#X connect 1 0 23 0;
-#X connect 2 0 3 0;
-#X connect 3 0 23 1;
-#X connect 4 0 23 2;
-#X connect 5 0 6 0;
-#X connect 7 0 8 0;
-#X connect 9 0 10 0;
-#X connect 11 0 12 0;
-#X connect 13 0 23 4;
-#X connect 15 0 16 0;
-#X connect 16 0 23 3;
-#X connect 17 0 18 0;
-#X connect 18 0 23 3;
-#X connect 19 0 21 0;
-#X connect 20 0 22 0;
-#X connect 21 0 23 3;
-#X connect 22 0 23 3;
-#X connect 23 0 5 0;
-#X connect 23 1 7 0;
-#X connect 23 2 9 0;
-#X connect 23 3 11 0;
diff --git a/examples/mavg.pd b/examples/mavg.pd
index 55a5e0e..3d08d03 100644
--- a/examples/mavg.pd
+++ b/examples/mavg.pd
@@ -1,16 +1,17 @@
-#N canvas 0 0 452 302 12;
-#X obj 119 132 metro 100;
-#X obj 119 155 random 10;
-#X floatatom 119 235 4 0 0;
-#X msg 120 107 1;
-#X msg 153 108 0;
-#X obj 119 202 mavg 4;
-#X floatatom 220 181 4 0 0;
-#X text 59 20 moving average filter;
-#X text 261 181 samples to average;
-#X connect 0 0 1 0;
-#X connect 1 0 5 0;
-#X connect 3 0 0 0;
-#X connect 4 0 0 0;
-#X connect 5 0 2 0;
-#X connect 6 0 5 1;
+#N canvas 404 326 452 302 12;
+#X obj 119 132 metro 100;
+#X obj 119 155 random 10;
+#X floatatom 119 235 4 0 0 0 - - -;
+#X msg 120 107 1;
+#X msg 153 108 0;
+#X obj 119 202 mavg 4;
+#X floatatom 220 181 4 0 0 0 - - -;
+#X text 59 20 moving average filter;
+#X text 261 181 samples to average;
+#X text 277 47 part of zexy;
+#X connect 0 0 1 0;
+#X connect 1 0 5 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 5 0 2 0;
+#X connect 6 0 5 1;
diff --git a/examples/mean.pd b/examples/mean.pd
deleted file mode 100644
index ca2851b..0000000
--- a/examples/mean.pd
+++ /dev/null
@@ -1,9 +0,0 @@
-#N canvas 186 94 383 302 12;
-#X obj 83 154 mean;
-#X floatatom 83 202 4 0 0;
-#X msg 96 96 2 4;
-#X text 46 17 get the mean value of a list of floats;
-#X msg 83 69 1 2 3 -4 5 6;
-#X connect 0 0 1 0;
-#X connect 2 0 0 0;
-#X connect 4 0 0 0;
diff --git a/examples/minmax.pd b/examples/minmax.pd
index 8675c12..676a5ba 100644
--- a/examples/minmax.pd
+++ b/examples/minmax.pd
@@ -1,11 +1,12 @@
-#N canvas 230 189 450 300 10;
+#N canvas 369 451 561 303 10;
#X obj 73 61 minmax;
#X text 127 60 get minimum and maximum of a (list of floats);
#X obj 45 152 minmax;
-#X floatatom 45 184 4 0 0;
-#X floatatom 76 184 4 0 0;
+#X floatatom 45 184 4 0 0 0 - - -;
+#X floatatom 76 184 4 0 0 0 - - -;
#X msg 45 112 10 2;
#X msg 80 129 1 2 3 4 9 6 -1 7;
+#X text 352 14 part of zexy;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 5 0 2 0;
diff --git a/examples/msgfile.pd b/examples/msgfile.pd
index 2e8ff56..0721612 100644
--- a/examples/msgfile.pd
+++ b/examples/msgfile.pd
@@ -1,109 +1,117 @@
-#N canvas 127 -1 1027 898 10;
-#X msg 463 10 rewind;
-#X obj 392 853 print done;
-#X text 575 665 read a file;
-#X text 609 686 write one;
-#X text 23 356 see also:;
-#X text 512 9 go to beginning;
-#X msg 466 223 bang;
-#X text 474 724 write a file \, terminating lines only with carriage return (omitting semicolons.) You can read files this way too \, in which case carriage returns are mapped to semicolons.;
-#X obj 355 871 print list;
-#X msg 466 281 clear;
-#X text 123 872 this outlet gets the lines in sequence.;
-#X msg 470 571 set 2 4 6 8;
-#X text 576 570 clear and then add one message;
-#X msg 466 388 add cis boom bah;
-#X msg 465 407 add2 bang;
-#X msg 465 782 print;
-#X text 507 784 debugging printout;
-#X obj 73 9 msgfile;
-#X text 127 9 read and write messages into text files;
-#X obj 355 815 msgfile;
-#X obj 84 357 textfile;
-#X text 18 57 The msgfile object is derived from the textfile object and expands its features.;
-#X text 15 97 new features are :;
-#X text 127 110 insert \, append \, delete \, replace;
-#X msg 464 33 end;
-#X text 511 33 go the the end;
-#X msg 462 84 skip -1;
-#X msg 463 181 next;
-#X msg 462 139 prev;
-#X msg 462 108 where;
-#X text 515 107 where are we now ?;
-#X msg 463 160 this;
-#X text 516 84 go to the <n>th line from here;
-#X text 512 58 go to line number <n>;
-#X text 515 220 output one line as a list and move to the next;
-#X text 520 282 empty the object;
-#X msg 467 321 delete 2;
-#X text 9 183 changed behaviour :;
-#X text 130 183 add2 : read "add too" \; append to an existing line;
-#X text 602 433 insert a message before the current line;
-#X text 605 455 add to the previous line (CHANGED BEHAVIOUR !!!);
-#X text 567 405 add to the last line (CHANGED BEHAVIOUR !!!);
-#X text 568 385 add a message at the end of the object;
-#X msg 467 489 append after the break of dawn;
-#X text 661 486 add a message at the current position;
-#X text 660 506 add to the current line (CHANGED BEHAVIOUR !!!);
-#X msg 468 537 replace the new day;
-#X text 660 537 replace the current line;
-#X msg 466 437 insert before sunrise;
-#X msg 466 455 insert2 inserted;
-#X msg 467 508 append2 appendix;
-#X msg 467 250 flush;
-#X text 516 249 output all lines;
-#X text 457 836 This outlet gets a bang when you hit the end of the sequence \; it will also get the current position when using "when";
-#X msg 467 666 read msgfile.txt;
-#X msg 467 708 write /tmp/msgfile2.txt cr;
-#X msg 466 761 read msgfile2.txt cr;
-#X text 511 139 output the previous line;
-#X text 513 179 output the next line;
-#X text 511 159 output the current line;
-#X msg 462 59 goto 8;
-#X msg 467 301 delete;
-#X text 521 302 delete the current line;
-#X text 524 321 delete the specified line;
-#X msg 467 340 delete 4 7;
-#X text 535 341 delete the specified region;
-#X msg 467 360 delete 7 4;
-#X msg 467 687 write /tmp/msgfile.txt;
-#X text 538 360 delete all but the specified region;
-#X msg 472 600 find test 6;
-#X msg 472 619 find test * 7 *;
-#X text 576 606 find a matching list ("*" is the only wildcard supported);
-#X text 127 97 end \, goto \, skip;
-#X text 131 127 flush \, where \, this \, prev \, next;
-#X text 128 145 find;
-#X text 73 163 read/write can handle csv files too;
-#X connect 0 0 19 0;
-#X connect 6 0 19 0;
-#X connect 9 0 19 0;
-#X connect 11 0 19 0;
-#X connect 13 0 19 0;
-#X connect 14 0 19 0;
-#X connect 15 0 19 0;
-#X connect 19 0 8 0;
-#X connect 19 1 1 0;
-#X connect 24 0 19 0;
-#X connect 26 0 19 0;
-#X connect 27 0 19 0;
-#X connect 28 0 19 0;
-#X connect 29 0 19 0;
-#X connect 31 0 19 0;
-#X connect 36 0 19 0;
-#X connect 43 0 19 0;
-#X connect 46 0 19 0;
-#X connect 48 0 19 0;
-#X connect 49 0 19 0;
-#X connect 50 0 19 0;
-#X connect 51 0 19 0;
-#X connect 54 0 19 0;
-#X connect 55 0 19 0;
-#X connect 56 0 19 0;
-#X connect 60 0 19 0;
-#X connect 61 0 19 0;
-#X connect 64 0 19 0;
-#X connect 66 0 19 0;
-#X connect 67 0 19 0;
-#X connect 69 0 19 0;
-#X connect 70 0 19 0;
+#N canvas 127 0 1027 898 10;
+#X msg 463 10 rewind;
+#X obj 392 853 print done;
+#X text 575 665 read a file;
+#X text 609 686 write one;
+#X text 23 356 see also:;
+#X text 512 9 go to beginning;
+#X msg 466 223 bang;
+#X text 474 724 write a file \, terminating lines only with carriage
+return (omitting semicolons.) You can read files this way too \, in
+which case carriage returns are mapped to semicolons.;
+#X obj 355 871 print list;
+#X msg 466 281 clear;
+#X text 73 872 this outlet gets the lines in sequence.;
+#X msg 470 571 set 2 4 6 8;
+#X text 576 570 clear and then add one message;
+#X msg 466 388 add cis boom bah;
+#X msg 465 407 add2 bang;
+#X msg 465 782 print;
+#X text 507 784 debugging printout;
+#X obj 73 9 msgfile;
+#X text 127 9 read and write messages into text files;
+#X obj 355 815 msgfile;
+#X obj 84 357 textfile;
+#X text 18 57 The msgfile object is derived from the textfile object
+and expands its features.;
+#X text 15 97 new features are :;
+#X text 127 110 insert \, append \, delete \, replace;
+#X msg 464 33 end;
+#X text 511 33 go the the end;
+#X msg 462 84 skip -1;
+#X msg 463 181 next;
+#X msg 462 139 prev;
+#X msg 462 108 where;
+#X text 515 107 where are we now ?;
+#X msg 463 160 this;
+#X text 516 84 go to the <n>th line from here;
+#X text 512 58 go to line number <n>;
+#X text 515 220 output one line as a list and move to the next;
+#X text 520 282 empty the object;
+#X msg 467 321 delete 2;
+#X text 9 183 changed behaviour :;
+#X text 130 183 add2 : read "add too" \; append to an existing line
+;
+#X text 602 433 insert a message before the current line;
+#X text 605 455 add to the previous line (CHANGED BEHAVIOUR !!!);
+#X text 567 405 add to the last line (CHANGED BEHAVIOUR !!!);
+#X text 568 385 add a message at the end of the object;
+#X msg 467 489 append after the break of dawn;
+#X text 661 486 add a message at the current position;
+#X text 660 506 add to the current line (CHANGED BEHAVIOUR !!!);
+#X msg 468 537 replace the new day;
+#X text 660 537 replace the current line;
+#X msg 466 437 insert before sunrise;
+#X msg 466 455 insert2 inserted;
+#X msg 467 508 append2 appendix;
+#X msg 467 250 flush;
+#X text 516 249 output all lines;
+#X text 467 836 This outlet gets a bang when you hit the end of the
+sequence \; it will also get the current position when using "when"
+;
+#X msg 467 666 read msgfile.txt;
+#X msg 467 708 write /tmp/msgfile2.txt cr;
+#X msg 466 761 read msgfile2.txt cr;
+#X text 511 139 output the previous line;
+#X text 513 179 output the next line;
+#X text 511 159 output the current line;
+#X msg 462 59 goto 8;
+#X msg 467 301 delete;
+#X text 521 302 delete the current line;
+#X text 524 321 delete the specified line;
+#X msg 467 340 delete 4 7;
+#X text 535 341 delete the specified region;
+#X msg 467 360 delete 7 4;
+#X msg 467 687 write /tmp/msgfile.txt;
+#X text 538 360 delete all but the specified region;
+#X msg 472 600 find test 6;
+#X msg 472 619 find test * 7 *;
+#X text 576 606 find a matching list ("*" is the only wildcard supported)
+;
+#X text 127 97 end \, goto \, skip;
+#X text 131 127 flush \, where \, this \, prev \, next;
+#X text 128 145 find;
+#X text 73 163 read/write can handle csv files too;
+#X text 890 17 part of zexy;
+#X connect 0 0 19 0;
+#X connect 6 0 19 0;
+#X connect 9 0 19 0;
+#X connect 11 0 19 0;
+#X connect 13 0 19 0;
+#X connect 14 0 19 0;
+#X connect 15 0 19 0;
+#X connect 19 0 8 0;
+#X connect 19 1 1 0;
+#X connect 24 0 19 0;
+#X connect 26 0 19 0;
+#X connect 27 0 19 0;
+#X connect 28 0 19 0;
+#X connect 29 0 19 0;
+#X connect 31 0 19 0;
+#X connect 36 0 19 0;
+#X connect 43 0 19 0;
+#X connect 46 0 19 0;
+#X connect 48 0 19 0;
+#X connect 49 0 19 0;
+#X connect 50 0 19 0;
+#X connect 51 0 19 0;
+#X connect 54 0 19 0;
+#X connect 55 0 19 0;
+#X connect 56 0 19 0;
+#X connect 60 0 19 0;
+#X connect 61 0 19 0;
+#X connect 64 0 19 0;
+#X connect 66 0 19 0;
+#X connect 67 0 19 0;
+#X connect 69 0 19 0;
+#X connect 70 0 19 0;
diff --git a/examples/mtx_binops.pd b/examples/mtx_binops.pd
deleted file mode 100644
index a0ae6d0..0000000
--- a/examples/mtx_binops.pd
+++ /dev/null
@@ -1,142 +0,0 @@
-#N canvas 79 32 859 673 10;
-#X obj 87 360 mtx_mul;
-#X obj 157 360 mtx_*;
-#X obj 88 163 mtx_add;
-#X obj 167 166 mtx_+;
-#X obj 155 134 mtx_diag 1 2 3 4 5;
-#X obj 88 134 mtx_ones 5;
-#X obj 88 111 t b b;
-#X obj 88 185 mtx_print;
-#X msg 88 92 bang;
-#X text 142 165 ==;
-#X obj 305 134 mtx_eye 4;
-#X obj 305 159 mtx_add 10;
-#X msg 305 107 bang;
-#X obj 305 186 mtx_print;
-#X floatatom 374 101 4 0 0 0 - - -;
-#X obj 374 119 t b f;
-#X obj 392 160 mtx_+ 10;
-#X text 371 161 ==;
-#X obj 87 394 mtx_print;
-#X msg 87 270 bang;
-#X obj 133 332 mtx_diag 1 2;
-#X obj 87 297 t b b;
-#X obj 87 332 mtx_+ 3;
-#X text 137 361 ==;
-#X obj 87 314 mtx_eye 3 2;
-#X obj 249 399 mtx_print;
-#X obj 249 292 t b f;
-#X floatatom 249 274 4 0 0 0 - - -;
-#X msg 249 315 4 2 1 3;
-#X obj 249 335 mtx_diag;
-#X obj 249 363 mtx_mul 2;
-#X obj 328 363 mtx_* 2;
-#X obj 393 363 mtx_.* 2;
-#X text 310 363 ==;
-#X text 376 364 ==;
-#X obj 522 366 mtx_.*;
-#X obj 522 401 mtx_print;
-#X obj 522 304 mtx_diag 1 2 3;
-#X obj 553 322 mtx_ones 3;
-#X obj 522 283 t b b;
-#X msg 522 264 bang;
-#X obj 553 341 mtx_* 2;
-#X text 80 214 add 2 matrices;
-#X text 274 218 add an offset to a matrix;
-#X text 70 423 multiply 2 matrices;
-#X text 245 422 multiply a matrix with a scalar;
-#X text 506 425 multiply 2 matrices element by element;
-#X text 334 19 matrix arithmetic;
-#X obj 88 599 mtx_print;
-#X obj 88 492 t b f;
-#X floatatom 88 474 4 0 0 0 - - -;
-#X msg 88 515 4 2 1 3;
-#X obj 88 535 mtx_diag;
-#X obj 323 600 mtx_print;
-#X obj 323 503 mtx_diag 1 2 3;
-#X obj 354 521 mtx_ones 3;
-#X obj 354 540 mtx_* 2;
-#X text 84 622 divide a matrix by a scalar;
-#X obj 88 563 mtx_./ 2;
-#X obj 323 565 mtx_./;
-#X text 307 624 divide 2 matrices element by element;
-#X obj 323 482 t b b f;
-#X floatatom 323 463 4 0 0 0 - - -;
-#X obj 709 538 matrix;
-#X text 592 538 see also help for;
-#X obj 550 141 mtx_diag 1 2 3 4 5;
-#X obj 483 141 mtx_ones 5;
-#X obj 483 118 t b b;
-#X obj 483 192 mtx_print;
-#X msg 483 99 bang;
-#X text 537 172 ==;
-#X obj 700 141 mtx_eye 4;
-#X msg 700 114 bang;
-#X obj 700 193 mtx_print;
-#X floatatom 769 108 4 0 0 0 - - -;
-#X obj 769 126 t b f;
-#X text 762 168 ==;
-#X obj 483 170 mtx_sub;
-#X obj 562 173 mtx_-;
-#X obj 779 169 mtx_sub 10;
-#X obj 700 166 mtx_- 10;
-#X text 481 221 subtract 2 matrices;
-#X text 669 225 subtract an offset from a matrix;
-#X connect 0 0 18 0;
-#X connect 2 0 7 0;
-#X connect 4 0 2 1;
-#X connect 5 0 2 0;
-#X connect 6 0 5 0;
-#X connect 6 1 4 0;
-#X connect 8 0 6 0;
-#X connect 10 0 11 0;
-#X connect 11 0 13 0;
-#X connect 12 0 10 0;
-#X connect 14 0 15 0;
-#X connect 15 0 10 0;
-#X connect 15 1 11 1;
-#X connect 19 0 21 0;
-#X connect 20 0 0 1;
-#X connect 21 0 24 0;
-#X connect 21 1 20 0;
-#X connect 22 0 0 0;
-#X connect 24 0 22 0;
-#X connect 26 0 28 0;
-#X connect 26 1 30 1;
-#X connect 27 0 26 0;
-#X connect 28 0 29 0;
-#X connect 29 0 30 0;
-#X connect 30 0 25 0;
-#X connect 35 0 36 0;
-#X connect 37 0 35 0;
-#X connect 38 0 41 0;
-#X connect 39 0 37 0;
-#X connect 39 1 38 0;
-#X connect 40 0 39 0;
-#X connect 41 0 35 1;
-#X connect 49 0 51 0;
-#X connect 49 1 58 1;
-#X connect 50 0 49 0;
-#X connect 51 0 52 0;
-#X connect 52 0 58 0;
-#X connect 54 0 59 0;
-#X connect 55 0 56 0;
-#X connect 56 0 59 1;
-#X connect 58 0 48 0;
-#X connect 59 0 53 0;
-#X connect 61 0 54 0;
-#X connect 61 1 55 0;
-#X connect 61 2 56 1;
-#X connect 62 0 61 0;
-#X connect 65 0 77 1;
-#X connect 66 0 77 0;
-#X connect 67 0 66 0;
-#X connect 67 1 65 0;
-#X connect 69 0 67 0;
-#X connect 71 0 80 0;
-#X connect 72 0 71 0;
-#X connect 74 0 75 0;
-#X connect 75 0 71 0;
-#X connect 75 1 80 1;
-#X connect 77 0 68 0;
-#X connect 80 0 73 0;
diff --git a/examples/mtx_element.pd b/examples/mtx_element.pd
deleted file mode 100644
index a69e642..0000000
--- a/examples/mtx_element.pd
+++ /dev/null
@@ -1,64 +0,0 @@
-#N canvas 220 134 544 776 10;
-#X obj 53 302 mtx_print;
-#X obj 53 283 mtx_element 4 3;
-#X obj 64 260 mtx_ones 5 3;
-#X msg 64 241 bang;
-#X floatatom 53 191 4 0 0;
-#X msg 138 184 3 2;
-#X msg 144 202 2 0;
-#X msg 144 219 0 1;
-#X msg 145 237 0 0;
-#X text 179 184 set element [3 \, 2];
-#X text 179 202 set all elements in row [2];
-#X text 177 217 set all elements in column [1];
-#X text 178 236 set all elements of matrix;
-#X text 153 285 creation: mtx_element [<row> <col> [<posR> <posC>]];
-#X obj 53 469 mtx_print;
-#X obj 64 427 mtx_ones 5 3;
-#X msg 64 408 bang;
-#X obj 53 450 mtx_row 4 3;
-#X msg 122 405 0;
-#X text 153 405 set all rows;
-#X msg 114 383 2;
-#X text 154 380 set row [2];
-#X msg 53 356 -1 2 3 4 5;
-#X obj 50 658 mtx_print;
-#X obj 61 616 mtx_ones 5 3;
-#X msg 61 597 bang;
-#X msg 131 592 0;
-#X msg 123 570 2;
-#X msg 50 545 -1 2 3 4 5;
-#X obj 50 639 mtx_col 4 3 3;
-#X text 163 567 set column [2];
-#X text 162 593 set all columns;
-#X text 137 640 creation: mtx_col [<row> <col> [<posC>]];
-#X text 133 452 creation: mtx_row [<row> <col> [<posR>]];
-#X text 52 163 set matrix elements;
-#X text 55 339 set matrix rows;
-#X text 49 529 set matrix columns;
-#X text 187 50 get/set elements/rows/columns of a matrix;
-#X obj 90 33 mtx_element;
-#X obj 89 53 mtx_row;
-#X obj 90 75 mtx_col;
-#X obj 210 738 matrix;
-#X text 98 737 see also help for;
-#X connect 1 0 0 0;
-#X connect 2 0 1 0;
-#X connect 3 0 2 0;
-#X connect 4 0 1 0;
-#X connect 5 0 1 1;
-#X connect 6 0 1 1;
-#X connect 7 0 1 1;
-#X connect 8 0 1 1;
-#X connect 15 0 17 0;
-#X connect 16 0 15 0;
-#X connect 17 0 14 0;
-#X connect 18 0 17 1;
-#X connect 20 0 17 1;
-#X connect 22 0 17 0;
-#X connect 24 0 29 0;
-#X connect 25 0 24 0;
-#X connect 26 0 29 1;
-#X connect 27 0 29 1;
-#X connect 28 0 29 0;
-#X connect 29 0 23 0;
diff --git a/examples/mtx_inverse.pd b/examples/mtx_inverse.pd
deleted file mode 100644
index 9cca9fe..0000000
--- a/examples/mtx_inverse.pd
+++ /dev/null
@@ -1,18 +0,0 @@
-#N canvas 50 156 465 427 10;
-#X obj 92 208 mtx_inverse;
-#X obj 92 292 mtx_print;
-#X msg 103 140 matrix 3 3 1 2 3 2 3 4 3 4 5;
-#X text 280 142 singular;
-#X msg 92 108 matrix 3 3 1 2 4 2 3 4 3 4 5;
-#X text 265 107 regular;
-#X text 85 310 get the inverse of a matrix;
-#X text 286 158 regular;
-#X text 287 168 but badly conditioned;
-#X msg 111 164 matrix 3 3 1 2 3 2 4 4 3 4 5;
-#X text 82 26 get the inverse of a matrix;
-#X obj 233 381 matrix;
-#X text 116 381 see also help for;
-#X connect 0 0 1 0;
-#X connect 2 0 0 0;
-#X connect 4 0 0 0;
-#X connect 9 0 0 0;
diff --git a/examples/mtx_mean.pd b/examples/mtx_mean.pd
deleted file mode 100644
index 02b02fb..0000000
--- a/examples/mtx_mean.pd
+++ /dev/null
@@ -1,13 +0,0 @@
-#N canvas 128 104 450 300 10;
-#X obj 57 146 mtx_mean;
-#X obj 63 91 mtx_print;
-#X obj 57 201 print mean_row;
-#X obj 57 76 mtx_rand;
-#X msg 57 52 4 5;
-#X text 55 229 get the mean value of each column;
-#X obj 175 275 matrix;
-#X text 58 275 see also help for;
-#X connect 0 0 2 0;
-#X connect 3 0 1 0;
-#X connect 3 0 0 0;
-#X connect 4 0 3 0;
diff --git a/examples/mtx_rand.pd b/examples/mtx_rand.pd
deleted file mode 100644
index 491d6de..0000000
--- a/examples/mtx_rand.pd
+++ /dev/null
@@ -1,20 +0,0 @@
-#N canvas 120 116 450 300 10;
-#X obj 59 148 mtx_rand;
-#X obj 59 194 mtx_print;
-#X obj 83 100 mtx_ones 6 3;
-#X msg 83 82 bang;
-#X msg 74 58 5 7;
-#X msg 59 35 3;
-#X msg 115 133 seed 12;
-#X text 51 219 get a matrix containing;
-#X text 51 232 random elements (0..1];
-#X text 165 131 set seed;
-#X obj 357 274 matrix;
-#X text 240 274 see also help for;
-#X text 129 11 fill a matrix with random values;
-#X connect 0 0 1 0;
-#X connect 2 0 0 0;
-#X connect 3 0 2 0;
-#X connect 4 0 0 0;
-#X connect 5 0 0 0;
-#X connect 6 0 0 0;
diff --git a/examples/mtx_size.pd b/examples/mtx_size.pd
deleted file mode 100644
index 85d7747..0000000
--- a/examples/mtx_size.pd
+++ /dev/null
@@ -1,44 +0,0 @@
-#N canvas 161 60 833 285 10;
-#X obj 386 214 mtx_print;
-#X obj 386 106 mtx_ones;
-#X msg 386 83 3 5;
-#X obj 386 192 mtx_resize;
-#X text 383 67 resize a matrix;
-#X msg 441 91 3 2;
-#X msg 447 109 2 0;
-#X msg 448 144 0 0;
-#X text 482 91 resize to [3 \, 2];
-#X text 482 109 resize to 2 rows \, leave row-length unchanged;
-#X text 481 143 don't resize;
-#X msg 452 169 2;
-#X text 484 171 resize to [2 \, 2];
-#X text 458 192 creation: mtx_resize [<rows> [<cols>]];
-#X msg 447 126 0 4;
-#X text 482 124 resize to 4 columns \, leave column-length unchanged;
-#X floatatom 81 178 4 0 0;
-#X text 78 68 get the size of a matrix;
-#X obj 81 140 mtx_size;
-#X msg 115 91 3 2;
-#X msg 81 91 7;
-#X obj 81 115 mtx_ones;
-#X floatatom 124 178 4 0 0;
-#X text 122 194 columns;
-#X text 82 195 rows;
-#X obj 150 22 mtx_size;
-#X obj 421 23 mtx_resize;
-#X text 223 24 get/set the size of a matrix;
-#X obj 306 252 matrix;
-#X text 189 252 see also help for;
-#X connect 1 0 3 0;
-#X connect 2 0 1 0;
-#X connect 3 0 0 0;
-#X connect 5 0 3 1;
-#X connect 6 0 3 1;
-#X connect 7 0 3 1;
-#X connect 11 0 3 1;
-#X connect 14 0 3 1;
-#X connect 18 0 16 0;
-#X connect 18 1 22 0;
-#X connect 19 0 21 0;
-#X connect 20 0 21 0;
-#X connect 21 0 18 0;
diff --git a/examples/mtx_special.pd b/examples/mtx_special.pd
deleted file mode 100644
index b230a0f..0000000
--- a/examples/mtx_special.pd
+++ /dev/null
@@ -1,60 +0,0 @@
-#N canvas 113 77 498 667 10;
-#X obj 117 136 mtx_eye 5;
-#X obj 117 162 mtx_print;
-#X msg 117 65 bang;
-#X msg 147 109 3 5;
-#X msg 133 85 10;
-#X obj 120 332 mtx_print;
-#X msg 120 234 bang;
-#X msg 150 279 3 5;
-#X msg 136 255 10;
-#X obj 311 337 mtx_print;
-#X msg 311 239 bang;
-#X msg 341 284 3 5;
-#X msg 327 260 10;
-#X obj 120 306 mtx_ones 5;
-#X obj 311 311 mtx_zeros 5;
-#X obj 124 496 mtx_print;
-#X msg 136 417 1 2 3 4 5;
-#X msg 124 395 bang;
-#X obj 124 468 mtx_diag 7 6 5 4;
-#X text 93 181 identity matrix;
-#X text 104 358 all matrix elements=1;
-#X text 290 359 all matrix elements=0;
-#X text 113 522 diagonal-matrix;
-#X obj 333 162 mtx_print;
-#X msg 333 65 bang;
-#X msg 363 109 3 5;
-#X msg 349 85 10;
-#X obj 333 136 mtx_egg 5;
-#X obj 316 491 mtx_print;
-#X msg 328 412 1 2 3 4 5;
-#X msg 316 390 bang;
-#X obj 316 463 mtx_diegg 7 6 5 4;
-#X text 305 517 turned diagonal-matrix;
-#X text 309 181 turned identity matrix;
-#X text 173 19 create special matrices;
-#X obj 245 612 matrix;
-#X text 128 612 see also help for;
-#X connect 0 0 1 0;
-#X connect 2 0 0 0;
-#X connect 3 0 0 0;
-#X connect 4 0 0 0;
-#X connect 6 0 13 0;
-#X connect 7 0 13 0;
-#X connect 8 0 13 0;
-#X connect 10 0 14 0;
-#X connect 11 0 14 0;
-#X connect 12 0 14 0;
-#X connect 13 0 5 0;
-#X connect 14 0 9 0;
-#X connect 16 0 18 0;
-#X connect 17 0 18 0;
-#X connect 18 0 15 0;
-#X connect 24 0 27 0;
-#X connect 25 0 27 0;
-#X connect 26 0 27 0;
-#X connect 27 0 23 0;
-#X connect 29 0 31 0;
-#X connect 30 0 31 0;
-#X connect 31 0 28 0;
diff --git a/examples/mtx_trace.pd b/examples/mtx_trace.pd
deleted file mode 100644
index ad48fd8..0000000
--- a/examples/mtx_trace.pd
+++ /dev/null
@@ -1,24 +0,0 @@
-#N canvas 137 140 916 465 10;
-#X obj 79 361 mtx_diag;
-#X obj 79 389 print;
-#X obj 79 308 mtx_ones 7;
-#X msg 79 288 bang;
-#X obj 84 106 mtx_ones 7;
-#X msg 84 83 bang;
-#X obj 84 147 mtx_trace;
-#X floatatom 84 189 4 0 0 0 - - -;
-#X text 86 68 get trace of a matrix;
-#X text 79 271 get diagonal of a matrix;
-#X text 81 204 trace = sum(diagonal elements);
-#X text 243 28 get information of the diagonale of a matrix;
-#X text 440 176 see also help for;
-#X obj 571 175 matrix;
-#X obj 699 269 mtx_eye;
-#X text 332 270 to create diagonale matrices with [mtx_diag] \, see
-;
-#X connect 0 0 1 0;
-#X connect 2 0 0 0;
-#X connect 3 0 2 0;
-#X connect 4 0 6 0;
-#X connect 5 0 4 0;
-#X connect 6 0 7 0;
diff --git a/examples/mtx_transpose.pd b/examples/mtx_transpose.pd
deleted file mode 100644
index afe5c7b..0000000
--- a/examples/mtx_transpose.pd
+++ /dev/null
@@ -1,66 +0,0 @@
-#N canvas 199 -133 718 600 10;
-#X obj 48 162 mtx_print;
-#X obj 48 134 mtx_transpose;
-#X obj 48 81 mtx_ones;
-#X msg 48 59 3 5;
-#X text 45 42 transpose a matrix;
-#X text 188 7 tranpose/shift matrices;
-#X obj 37 349 mtx_print;
-#X msg 37 246 1 2 3 4 5;
-#X text 33 229 shift rows of a matrix;
-#X floatatom 104 301 4 0 0 0 - - -;
-#X obj 37 321 mtx_scroll 1;
-#X obj 37 268 mtx_diag;
-#X obj 414 333 mtx_print;
-#X msg 414 230 1 2 3 4 5;
-#X floatatom 481 285 4 0 0 0 - - -;
-#X obj 414 252 mtx_diag;
-#X text 410 213 shift columns of a matrix;
-#X obj 414 306 mtx_roll 1;
-#X text 517 286 shift amount (0=no-shift \; 1=1-column-right \; -2=2-columns-left
-\; ...);
-#X text 143 299 shift amount (0=no-shift \; 1=1-row-down \; -2=2-rows-up
-\; ...);
-#X text 29 419 pivot-transform a matrix;
-#X obj 33 494 mtx_pivot;
-#N canvas 352 114 190 367 rand-matrix 0;
-#X obj 74 163 inlet;
-#X obj 74 270 outlet;
-#X obj 74 195 mtx_rand;
-#X obj 74 215 mtx_* 10;
-#X obj 74 237 l2i;
-#X connect 0 0 2 0;
-#X connect 2 0 3 0;
-#X connect 3 0 4 0;
-#X connect 4 0 1 0;
-#X restore 33 458 pd rand-matrix;
-#X msg 33 436 4 3;
-#X obj 82 515 mtx_print post;
-#X obj 57 535 mtx_print pre;
-#X obj 33 575 mtx_print pivot;
-#X obj 485 95 matrix;
-#X text 435 77 see also help for;
-#X text 280 494 the first outlet is the pivot-transformed matrix.;
-#X text 279 520 the other outlets are the 1/0-matrices that have to
-be pre-multiplied (row-tranform) and post-multiplied (column-tranform)
-to the original matrix to get the pivot-tranformation. this is useful
-for de-pivoting.;
-#X text 281 445 this will tranform the columns and rows \, so that
-the result will have all maximum values in the diagonale. the maximum
-of the matrix will be located at the upper-left corner.;
-#X connect 1 0 0 0;
-#X connect 2 0 1 0;
-#X connect 3 0 2 0;
-#X connect 7 0 11 0;
-#X connect 9 0 10 1;
-#X connect 10 0 6 0;
-#X connect 11 0 10 0;
-#X connect 13 0 15 0;
-#X connect 14 0 17 1;
-#X connect 15 0 17 0;
-#X connect 17 0 12 0;
-#X connect 21 0 26 0;
-#X connect 21 1 25 0;
-#X connect 21 2 24 0;
-#X connect 22 0 21 0;
-#X connect 23 0 22 0;
diff --git a/examples/multiline~.pd b/examples/multiline~.pd
index ae9d791..6f6ccb6 100644
--- a/examples/multiline~.pd
+++ b/examples/multiline~.pd
@@ -2,30 +2,30 @@
#X obj 67 53 multiline~;
#X text 209 55 line~d multiplication of multiple signals;
#X obj 47 201 sig~ 1;
-#X obj 89 201 sig~ 10;
-#X floatatom 57 281 4 0 0;
-#X floatatom 154 282 4 0 0;
+#X obj 96 201 sig~ 10;
+#X floatatom 57 281 4 0 0 0 - - -;
+#X floatatom 154 282 4 0 0 0 - - -;
#X msg 153 181 0 -1;
#X obj 57 261 avg~;
#X obj 154 262 avg~;
-#X floatatom 215 208 4 0 0;
+#X floatatom 215 208 4 0 0 0 - - -;
#X text 252 209 line-time;
-#X floatatom 121 129 4 0 0;
+#X floatatom 121 129 4 0 0 0 - - -;
#X text 157 132 multiply all signals with the same value;
#X obj 57 223 multiline~ 1 2 50;
#X msg 154 154 2 1;
#X obj 452 235 multiline~ 1 1 1 1 1000;
#X obj 452 253 avg~;
-#X floatatom 452 272 4 0 0;
+#X floatatom 452 272 4 0 0 0 - - -;
#X obj 452 193 sig~ 1;
#X obj 496 253 avg~;
-#X floatatom 496 272 4 0 0;
+#X floatatom 496 272 4 0 0 0 - - -;
#X obj 496 193 sig~ 1;
#X obj 540 253 avg~;
-#X floatatom 540 272 4 0 0;
+#X floatatom 540 272 4 0 0 0 - - -;
#X obj 540 193 sig~ 1;
#X obj 585 254 avg~;
-#X floatatom 585 273 4 0 0;
+#X floatatom 585 273 4 0 0 0 - - -;
#X obj 585 194 sig~ 1;
#X msg 653 171 0 0 0 0;
#X msg 653 207 1 0 2 0;
@@ -34,7 +34,9 @@
#X text 49 397 creation:;
#X obj 121 400 multiline~ g1 g2 g3 ... g<n> fade-time;
#X text 194 166 gain1 gain2 ...;
-#X text 367 394 will make <n> outlets and (n+2) inlets (1 extra for the gain-list \, 1 extra for the fade-time);
+#X text 397 394 will make <n> outlets and (n+2) inlets (1 extra for
+the gain-list \, 1 extra for the fade-time);
+#X text 551 18 part of zexy;
#X connect 2 0 13 0;
#X connect 3 0 13 1;
#X connect 6 0 13 2;
diff --git a/examples/multiplex.pd b/examples/multiplex.pd
new file mode 100644
index 0000000..f4611f8
--- /dev/null
+++ b/examples/multiplex.pd
@@ -0,0 +1,38 @@
+#N canvas 170 131 827 407 10;
+#X obj 51 91 metro 320;
+#X msg 51 69 1;
+#X msg 76 69 0;
+#X text 271 237 alias;
+#X text 549 33 part of zexy;
+#X obj 111 12 multiplex;
+#X text 231 10 multiplex the selected inlet to the outlet;
+#X text 277 81 the rightmost inlet specifies \, which inlet is routed
+to the outlet;
+#X text 280 119 inlets number from 0..(n-1);
+#X text 268 166 creation: "multiplex [<in1?> [<in2?> [<in3?> ... ]]]"
+;
+#X obj 51 311 mux 1 2 3 4;
+#X text 303 185 the number of arguments defines the number of inlets
+;
+#X obj 315 236 mux;
+#X obj 51 369 print output;
+#X obj 123 240 vradio 15 1 0 4 empty empty select 20 7 0 8 -262144
+-1 -1 3;
+#X obj 51 111 t b b b b;
+#X msg 69 161 bang;
+#X floatatom 51 143 5 0 0 0 - - -;
+#X msg 87 183 list 4 2;
+#X msg 105 211 symbol coppenrath;
+#X connect 0 0 15 0;
+#X connect 1 0 0 0;
+#X connect 2 0 0 0;
+#X connect 10 0 13 0;
+#X connect 14 0 10 4;
+#X connect 15 0 17 0;
+#X connect 15 1 16 0;
+#X connect 15 2 18 0;
+#X connect 15 3 19 0;
+#X connect 16 0 10 1;
+#X connect 17 0 10 0;
+#X connect 18 0 10 2;
+#X connect 19 0 10 3;
diff --git a/examples/multiplex~.pd b/examples/multiplex~.pd
index 90e64aa..aef58e9 100644
--- a/examples/multiplex~.pd
+++ b/examples/multiplex~.pd
@@ -1,23 +1,24 @@
-#N canvas 79 72 637 304 12;
-#X obj 75 23 multiplex~;
-#X obj 72 193 multiplex~ . . . . .;
-#X text 210 23 multiplex 1-of-n signals to 1 outlet;
-#X obj 72 139 sig~ 1;
-#X obj 110 161 sig~ 0.5;
-#X obj 149 137 sig~ 50;
-#X obj 227 158 sig~ 0.1;
-#X floatatom 110 93 4 0 0;
-#X obj 72 229 env~;
-#X floatatom 72 255 4 0 0;
-#X text 156 93 select a signal;
-#X obj 306 262 mux~;
-#X text 254 261 alias;
-#X text 135 214 the number of arguments specifies the number of inlets
-;
-#X connect 1 0 8 0;
-#X connect 3 0 1 0;
-#X connect 4 0 1 1;
-#X connect 5 0 1 2;
-#X connect 6 0 1 4;
-#X connect 7 0 1 0;
-#X connect 8 0 9 0;
+#N canvas 386 552 637 304 12;
+#X obj 75 23 multiplex~;
+#X obj 72 193 multiplex~ . . . . .;
+#X text 210 23 multiplex 1-of-n signals to 1 outlet;
+#X obj 72 139 sig~ 1;
+#X obj 110 161 sig~ 0.5;
+#X obj 149 137 sig~ 50;
+#X obj 227 158 sig~ 0.1;
+#X floatatom 110 93 4 0 0 0 - - -;
+#X obj 72 229 env~;
+#X floatatom 72 255 4 0 0 0 - - -;
+#X text 156 93 select a signal;
+#X obj 306 262 mux~;
+#X text 254 261 alias;
+#X text 135 214 the number of arguments specifies the number of inlets
+;
+#X text 510 3 part of zexy;
+#X connect 1 0 8 0;
+#X connect 3 0 1 0;
+#X connect 4 0 1 1;
+#X connect 5 0 1 2;
+#X connect 6 0 1 4;
+#X connect 7 0 1 0;
+#X connect 8 0 9 0;
diff --git a/examples/niagara.pd b/examples/niagara.pd
index f5528ca..d77e0a7 100644
--- a/examples/niagara.pd
+++ b/examples/niagara.pd
@@ -1,21 +1,26 @@
-#N canvas 87 562 895 337 10;
-#X floatatom 124 175;
-#X obj 69 206 niagara 12;
-#X obj 69 288 print LEFT;
-#X obj 124 269 print RIGHT;
-#X msg 85 139 1 2 3 4 5 6 7 all good children go to heaven;
-#X obj 159 25 niagara;
-#X text 374 28 divide a package into 2 sub-packages;
-#X text 241 53 creation : "niagara <n>" creates a niagara-fall with a rock at point <n>;
-#X text 159 176 where to divide;
-#X text 451 143 list;
-#X text 451 111 anything;
-#X text 420 219 note :;
-#X text 467 233 if <anything> is passed \, then 2 <anything>s appear at the outputs;
-#X text 467 219 if a <list> is passed \, then 2 <list>s appear at the outputs;
-#X msg 69 102 some water will go down on the left side of the rock and the rest will come down on the other side;
-#X connect 0 0 1 1;
-#X connect 1 0 2 0;
-#X connect 1 1 3 0;
-#X connect 4 0 1 0;
-#X connect 14 0 1 0;
+#N canvas 87 562 895 337 10;
+#X floatatom 134 178 0 0 0 0 - - -;
+#X obj 69 206 niagara 12;
+#X obj 69 288 print LEFT;
+#X obj 124 269 print RIGHT;
+#X msg 69 103 1 2 3 4 5 6 7 all good children go to heaven;
+#X obj 159 25 niagara;
+#X text 374 28 divide a package into 2 sub-packages;
+#X text 241 53 creation : "niagara <n>" creates a niagara-fall with
+a rock at point <n>;
+#X text 169 179 where to divide;
+#X text 420 219 note :;
+#X text 467 233 if <anything> is passed \, then 2 <anything>s appear
+at the outputs;
+#X text 467 219 if a <list> is passed \, then 2 <list>s appear at the
+outputs;
+#X msg 90 122 some water will go down on the left side of the rock
+and the rest will come down on the other side;
+#X text 398 105 a list;
+#X text 492 131 not a list \, but works too;
+#X text 679 12 part of zexy;
+#X connect 0 0 1 1;
+#X connect 1 0 2 0;
+#X connect 1 1 3 0;
+#X connect 4 0 1 0;
+#X connect 12 0 1 0;
diff --git a/examples/noish~.pd b/examples/noish~.pd
index 72e7913..549ab0b 100644
--- a/examples/noish~.pd
+++ b/examples/noish~.pd
@@ -1,21 +1,81 @@
-#N canvas 183 18 591 404 8;
-#X text 119 43 draws a random number every n samples and interpolates between;
-#X text 121 87 DODGE:JERSE::computer:music::c3:9;
-#X floatatom 91 222;
-#X text 85 199 drawing rate in Hz;
-#X obj 91 321 dac~;
-#X obj 132 322 print~;
-#X msg 132 298 bang;
-#X obj 55 321 env~;
-#X floatatom 55 347;
-#X text 223 219 maybe the input should be fixed to signal;
-#X text 45 44 noish~ ::;
-#X text 120 117 the effect is that you get a bandlimited noise of which the bandwidth of which can be conrtolled via the drawing:rate without having to use expensive filters;
-#X obj 91 245 noish~ 2756.25;
-#X connect 2 0 12 0;
-#X connect 6 0 5 0;
-#X connect 7 0 8 0;
-#X connect 12 0 5 0;
-#X connect 12 0 4 1;
-#X connect 12 0 4 0;
-#X connect 12 0 7 0;
+#N canvas 258 181 595 441 10;
+#X text 119 43 draws a random number every n samples and interpolates
+between;
+#X text 121 87 DODGE:JERSE::computer:music::c3:9;
+#X floatatom 91 222 0 0 0 0 - - -;
+#X text 85 199 drawing rate in Hz;
+#X obj 132 302 print~;
+#X msg 132 278 bang;
+#X obj 55 321 env~;
+#X floatatom 55 347 0 0 0 0 - - -;
+#X text 223 219 maybe the input should be fixed to signal;
+#X text 45 44 noish~ ::;
+#X text 120 117 the effect is that you get a bandlimited noise of which
+the bandwidth of which can be conrtolled via the drawing:rate without
+having to use expensive filters;
+#X obj 91 245 noish~ 2756.25;
+#X text 493 13 part of zexy;
+#X floatatom 119 352 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 90 380 pd output;
+#X msg 154 350 MUTE;
+#X text 114 333 output amplitude;
+#X connect 2 0 11 0;
+#X connect 5 0 4 0;
+#X connect 6 0 7 0;
+#X connect 11 0 4 0;
+#X connect 11 0 6 0;
+#X connect 11 0 14 0;
+#X connect 13 0 14 1;
+#X connect 14 0 13 0;
+#X connect 15 0 14 2;
diff --git a/examples/noisi~.pd b/examples/noisi~.pd
index c76c6d4..fa1430d 100644
--- a/examples/noisi~.pd
+++ b/examples/noisi~.pd
@@ -1,21 +1,81 @@
-#N canvas 183 18 588 401 8;
-#X text 45 44 noisi~ ::;
-#X text 119 43 draws a random number every n samples and interpolates between;
-#X text 116 87 DODGE:JERSE::computer:music::c3:9;
-#X floatatom 91 222;
-#X text 85 199 drawing rate in Hz;
-#X obj 91 321 dac~;
-#X obj 132 322 print~;
-#X msg 132 298 bang;
-#X obj 55 321 env~;
-#X floatatom 55 347;
-#X text 223 219 maybe the input should be fixed to signal;
-#X text 117 120 the effect is that you get a bandlimited:noise the bandwidth of which can be controlled via the drawing:rate without having to use expensive filters;
-#X obj 91 244 noisi~ 2756.25;
-#X connect 3 0 12 0;
-#X connect 7 0 6 0;
-#X connect 8 0 9 0;
-#X connect 12 0 5 0;
-#X connect 12 0 5 1;
-#X connect 12 0 6 0;
-#X connect 12 0 8 0;
+#N canvas 282 317 518 467 10;
+#X text 45 44 noisi~ ::;
+#X text 119 43 draws a random number every n samples and interpolates
+between;
+#X text 106 87 DODGE:JERSE::computer:music::c3:9;
+#X floatatom 91 222 0 0 0 0 - - -;
+#X text 85 199 drawing rate in Hz;
+#X obj 132 322 print~;
+#X msg 132 298 bang;
+#X obj 55 321 env~;
+#X floatatom 55 347 0 0 0 0 - - -;
+#X text 223 219 maybe the input should be fixed to signal;
+#X text 107 120 the effect is that you get a bandlimited:noise the
+bandwidth of which can be controlled via the drawing:rate without having
+to use expensive filters;
+#X obj 91 244 noisi~ 2756.25;
+#X floatatom 120 372 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 91 400 pd output;
+#X msg 149 372 MUTE;
+#X text 115 353 output amplitude;
+#X text 409 16 part of zexy;
+#X connect 3 0 11 0;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 11 0 5 0;
+#X connect 11 0 7 0;
+#X connect 11 0 13 0;
+#X connect 12 0 13 1;
+#X connect 13 0 12 0;
+#X connect 14 0 13 2;
diff --git a/examples/nop~.pd b/examples/nop~.pd
deleted file mode 100644
index 96673bc..0000000
--- a/examples/nop~.pd
+++ /dev/null
@@ -1,17 +0,0 @@
-#N canvas 25 -4 689 488 10;
-#X obj 89 71 nop~;
-#X text 134 73 will do nothing !!! but nevertheless it takes some time;
-#X text 132 85 so the signal is delay for 1 block...;
-#X text 131 98 Use this to synchronize signals;
-#X obj 60 216 osc~ 440;
-#X obj 60 312 -~;
-#X obj 60 339 env~;
-#X floatatom 59 364;
-#X obj 88 247 nop~;
-#X text 132 121 by the way \, you can use it as a cheap and very short delay too;
-#X text 135 158 ...or as a dummy for anything~...;
-#X connect 4 0 5 0;
-#X connect 4 0 8 0;
-#X connect 5 0 6 0;
-#X connect 6 0 7 0;
-#X connect 8 0 5 1;
diff --git a/examples/operating_system.pd b/examples/operating_system.pd
index 1686d6d..825ee50 100644
--- a/examples/operating_system.pd
+++ b/examples/operating_system.pd
@@ -1,4 +1,4 @@
-#N canvas 186 166 450 300 10;
+#N canvas 594 494 450 300 10;
#X obj 77 40 operating_system;
#X text 200 40 which OS are we running;
#X symbolatom 75 140 10 0 0 0 - - -;
@@ -11,6 +11,7 @@
#X obj 193 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 75 108 operating_system;
+#X text 293 8 part of zexy;
#X connect 2 0 4 0;
#X connect 3 0 8 0;
#X connect 4 0 5 0;
diff --git a/examples/packel.pd b/examples/packel.pd
index b7f2b56..049be17 100644
--- a/examples/packel.pd
+++ b/examples/packel.pd
@@ -1,20 +1,21 @@
-#N canvas 169 380 720 387 10;
-#X obj 48 34 packel;
-#X text 112 33 get the nth element of a package;
-#X msg 62 161 uno dva drei quattre five;
-#X floatatom 105 219;
-#X obj 62 239 packel 3;
-#X obj 62 268 print ELEMENT;
-#X msg 62 307 uno dva drei quattre five;
-#X obj 62 327 packel -2;
-#X obj 62 351 print REVERSE_ELEMENT;
-#X text 275 210 creation: packel [<n>];
-#X text 140 220 n;
-#X text 314 227 n indicates the index of the element to be output;
-#X text 314 245 n==0 ouputs the whole package;
-#X text 314 262 n<0 ouputs the nth-last element;
-#X connect 2 0 4 0;
-#X connect 3 0 4 1;
-#X connect 4 0 5 0;
-#X connect 6 0 7 0;
-#X connect 7 0 8 0;
+#N canvas 431 458 720 387 10;
+#X obj 48 34 packel;
+#X text 112 33 get the nth element of a package;
+#X msg 62 161 uno dva drei quattre five;
+#X floatatom 105 219 0 0 0 0 - - -;
+#X obj 62 239 packel 3;
+#X obj 62 268 print ELEMENT;
+#X msg 62 307 uno dva drei quattre five;
+#X obj 62 327 packel -2;
+#X obj 62 351 print REVERSE_ELEMENT;
+#X text 275 210 creation: packel [<n>];
+#X text 140 220 n;
+#X text 314 227 n indicates the index of the element to be output;
+#X text 314 245 n==0 ouputs the whole package;
+#X text 314 262 n<0 ouputs the nth-last element;
+#X text 511 26 part of zexy;
+#X connect 2 0 4 0;
+#X connect 3 0 4 1;
+#X connect 4 0 5 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
diff --git a/examples/pack~.pd b/examples/pack~.pd
index 24a9ec9..297e005 100644
--- a/examples/pack~.pd
+++ b/examples/pack~.pd
@@ -1,33 +1,34 @@
-#N canvas 420 353 697 479 10;
-#X floatatom 83 92;
-#X obj 83 111 osc~ 689.062;
-#X obj 83 320 unpack 0 0 0;
-#X obj 240 302 print;
-#X floatatom 83 359;
-#X floatatom 150 339;
-#X obj 83 230 t l l;
-#X obj 240 282 spigot;
-#X msg 271 262 1;
-#X msg 297 262 0;
-#X obj 83 300 spigot;
-#X msg 114 280 1;
-#X msg 140 280 0;
-#X obj 83 162 pack~;
-#X text 154 40 pack~;
-#X text 178 65 convert signals to float-packages;
-#X text 460 14 see also;
-#X obj 461 33 unpack~;
-#X text 98 379 1st and 3rd sample of each signal-vector;
-#X connect 0 0 1 0;
-#X connect 1 0 13 0;
-#X connect 2 0 4 0;
-#X connect 2 2 5 0;
-#X connect 6 0 10 0;
-#X connect 6 1 7 0;
-#X connect 7 0 3 0;
-#X connect 8 0 7 1;
-#X connect 9 0 7 1;
-#X connect 10 0 2 0;
-#X connect 11 0 10 1;
-#X connect 12 0 10 1;
-#X connect 13 0 6 0;
+#N canvas 420 353 697 479 10;
+#X floatatom 83 92 0 0 0 0 - - -;
+#X obj 83 111 osc~ 689.062;
+#X obj 83 320 unpack 0 0 0;
+#X obj 240 302 print;
+#X floatatom 83 359 0 0 0 0 - - -;
+#X floatatom 150 339 0 0 0 0 - - -;
+#X obj 83 230 t l l;
+#X obj 240 282 spigot;
+#X msg 271 262 1;
+#X msg 297 262 0;
+#X obj 83 300 spigot;
+#X msg 114 280 1;
+#X msg 140 280 0;
+#X obj 83 162 pack~;
+#X text 154 40 pack~;
+#X text 178 65 convert signals to float-packages;
+#X text 368 189 see also;
+#X obj 369 208 unpack~;
+#X text 98 379 1st and 3rd sample of each signal-vector;
+#X text 434 36 part of zexy;
+#X connect 0 0 1 0;
+#X connect 1 0 13 0;
+#X connect 2 0 4 0;
+#X connect 2 2 5 0;
+#X connect 6 0 10 0;
+#X connect 6 1 7 0;
+#X connect 7 0 3 0;
+#X connect 8 0 7 1;
+#X connect 9 0 7 1;
+#X connect 10 0 2 0;
+#X connect 11 0 10 1;
+#X connect 12 0 10 1;
+#X connect 13 0 6 0;
diff --git a/examples/pdf~.pd b/examples/pdf~.pd
index c6505b3..4f83277 100644
--- a/examples/pdf~.pd
+++ b/examples/pdf~.pd
@@ -1,25 +1,27 @@
-#N canvas 160 310 829 485 10;
-#X obj 90 43 pdf~;
-#X text 175 44 probability density function;
-#X obj 14 166 osc~ 440;
-#X msg 97 193 bang;
-#X obj 14 387 tabwrite array99;
-#X obj 14 303 pdf~ 128;
-#X msg 96 246 clear;
-#X msg 97 215 1;
-#X msg 96 269 0;
-#X text 146 260 clear the buffer;
-#X text 140 203 send the pdf to the outlet;
-#X obj 137 387 print;
-#X text 90 302 creation argument : number of steps;
-#X text 227 315 default is 64;
-#X graph graph1 0 -1 128 1 428 431 828 131;
-#X array array99 128 float;
-#X pop;
-#X connect 2 0 5 0;
-#X connect 3 0 5 0;
-#X connect 5 0 4 0;
-#X connect 5 0 11 0;
-#X connect 6 0 5 0;
-#X connect 7 0 5 0;
-#X connect 8 0 5 0;
+#N canvas 220 418 829 485 10;
+#X obj 90 43 pdf~;
+#X text 175 44 probability density function;
+#X obj 14 166 osc~ 440;
+#X msg 97 193 bang;
+#X obj 14 387 tabwrite array99;
+#X obj 14 303 pdf~ 128;
+#X msg 96 246 clear;
+#X msg 97 215 1;
+#X msg 96 269 0;
+#X text 146 260 clear the buffer;
+#X text 140 203 send the pdf to the outlet;
+#X obj 137 387 print;
+#X text 90 302 creation argument : number of steps;
+#X text 227 315 default is 64;
+#N canvas 0 0 450 300 graph1 0;
+#X array array99 128 float 0;
+#X coords 0 1 128 -1 400 300 1;
+#X restore 428 131 graph;
+#X text 532 42 part of zexy;
+#X connect 2 0 5 0;
+#X connect 3 0 5 0;
+#X connect 5 0 4 0;
+#X connect 5 0 11 0;
+#X connect 6 0 5 0;
+#X connect 7 0 5 0;
+#X connect 8 0 5 0;
diff --git a/examples/prime.pd b/examples/prime.pd
index 7fe557b..e10f36f 100644
--- a/examples/prime.pd
+++ b/examples/prime.pd
@@ -1,4 +1,4 @@
-#N canvas 0 0 450 300 10;
+#N canvas 525 238 450 300 10;
#X obj 34 32 prime;
#X text 82 34 a prime number detector;
#X floatatom 51 116 8 0 0 0 - - -;
@@ -11,6 +11,7 @@
#X msg 175 74 11117;
#X msg 227 74 1.23457e+06;
#X text 114 193 1 if input is prime \, 0 otherwise;
+#X text 303 9 part of zexy;
#X connect 2 0 3 0;
#X connect 3 0 8 0;
#X connect 4 0 2 0;
diff --git a/examples/quantize~.pd b/examples/quantize~.pd
index 02bd567..aef3127 100644
--- a/examples/quantize~.pd
+++ b/examples/quantize~.pd
@@ -1,37 +1,87 @@
-#N canvas 0 -1 705 533 10;
-#X text 242 9 quantize a signal with a variable step-number;
-#X msg 119 204 8bit;
-#X msg 119 180 16bit;
-#X msg 119 157 float;
-#X floatatom 120 133;
-#X obj 71 367 dac~ 1;
-#X obj 71 342 *~;
-#X obj 32 293 dbtorms;
-#X floatatom 32 269;
-#X obj 26 227 osc~ 440;
-#X floatatom 26 203;
-#X obj 87 255 quantize~ 16;
-#X msg 118 228 help;
-#X msg 404 59 \; pd dsp 1;
-#X obj 71 317 sig~ 0.2;
-#X msg 482 61 \; pd dsp 0;
-#X graph graph5 0 -1 100 1 298 494 698 194;
-#X array scope 100 float;
-#X pop;
-#X obj 139 314 tabwrite~ scope;
-#X msg 139 289 bang;
-#X obj 123 12 quantize~;
-#X connect 1 0 11 0;
-#X connect 2 0 11 0;
-#X connect 3 0 11 0;
-#X connect 4 0 11 0;
-#X connect 6 0 5 0;
-#X connect 7 0 14 0;
-#X connect 8 0 7 0;
-#X connect 9 0 11 0;
-#X connect 10 0 9 0;
-#X connect 11 0 6 1;
-#X connect 11 0 17 0;
-#X connect 12 0 11 0;
-#X connect 14 0 6 0;
-#X connect 18 0 17 0;
+#N canvas 388 370 705 533 10;
+#X text 133 66 quantize a signal with a variable step-number;
+#X msg 119 204 8bit;
+#X msg 119 180 16bit;
+#X msg 119 157 float;
+#X floatatom 120 133 0 0 0 0 - - -;
+#X obj 26 227 osc~ 440;
+#X floatatom 26 203 0 0 0 0 - - -;
+#X obj 87 255 quantize~ 16;
+#X msg 118 228 help;
+#X msg 352 132 \; pd dsp 1;
+#N canvas 0 0 450 300 graph5 0;
+#X array scope 100 float 0;
+#X coords 0 1 100 -1 400 300 1;
+#X restore 298 194 graph;
+#X obj 139 314 tabwrite~ scope;
+#X msg 139 289 bang;
+#X obj 56 65 quantize~;
+#X floatatom 117 422 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 88 450 pd output;
+#X msg 146 422 MUTE;
+#X text 112 403 output amplitude;
+#X text 528 15 part of zexy;
+#X connect 1 0 7 0;
+#X connect 2 0 7 0;
+#X connect 3 0 7 0;
+#X connect 4 0 7 0;
+#X connect 5 0 7 0;
+#X connect 6 0 5 0;
+#X connect 7 0 11 0;
+#X connect 7 0 15 0;
+#X connect 8 0 7 0;
+#X connect 12 0 11 0;
+#X connect 14 0 15 1;
+#X connect 15 0 14 0;
+#X connect 16 0 15 2;
diff --git a/examples/repack.pd b/examples/repack.pd
index 3b2560b..49fb81b 100644
--- a/examples/repack.pd
+++ b/examples/repack.pd
@@ -1,23 +1,25 @@
-#N canvas 222 219 739 549 10;
-#X obj 78 35 repack;
-#X obj 73 303 print;
-#X floatatom 73 120;
-#X msg 73 138 1 2 3 4 5 6 7 8 9 10;
-#X obj 73 265 repack 7;
-#X msg 73 157 hallo;
-#X text 149 33 (re)packs (packages of) floats/symbols/pointers/anythings to packages of a (given) size;
-#X msg 120 187 bang;
-#X floatatom 116 235;
-#X text 172 236 set the package-size;
-#X text 173 191 output the currently made package immediately;
-#X obj 56 501 repack 1;
-#X text 118 502 unfolds packages to atoms \; see also;
-#X obj 337 503 drip;
-#X text 72 407 creation:;
-#X text 140 408 "repack <n>" create packages of the length n;
-#X connect 2 0 4 0;
-#X connect 3 0 4 0;
-#X connect 4 0 1 0;
-#X connect 5 0 4 0;
-#X connect 7 0 4 0;
-#X connect 8 0 4 1;
+#N canvas 364 364 739 549 10;
+#X obj 78 35 repack;
+#X obj 73 303 print;
+#X floatatom 73 120 0 0 0 0 - - -;
+#X msg 73 138 1 2 3 4 5 6 7 8 9 10;
+#X obj 73 265 repack 7;
+#X msg 73 157 hallo;
+#X text 149 33 (re)packs (packages of) floats/symbols/pointers/anythings
+to packages of a (given) size;
+#X msg 120 187 bang;
+#X floatatom 116 235 0 0 0 0 - - -;
+#X text 172 236 set the package-size;
+#X text 173 191 output the currently made package immediately;
+#X obj 56 501 repack 1;
+#X text 118 502 unfolds packages to atoms \; see also;
+#X obj 337 503 drip;
+#X text 72 407 creation:;
+#X text 140 408 "repack <n>" create packages of the length n;
+#X text 582 11 part of zexy;
+#X connect 2 0 4 0;
+#X connect 3 0 4 0;
+#X connect 4 0 1 0;
+#X connect 5 0 4 0;
+#X connect 7 0 4 0;
+#X connect 8 0 4 1;
diff --git a/examples/repeat.pd b/examples/repeat.pd
index 0a66cf3..a3c251c 100644
--- a/examples/repeat.pd
+++ b/examples/repeat.pd
@@ -1,4 +1,4 @@
-#N canvas 59 45 599 332 10;
+#N canvas 429 454 599 332 10;
#X msg 41 151 bang;
#X msg 62 177 1 1 2 3 5 8 13 21 44 fibonacchi;
#X obj 160 14 repeat;
@@ -15,6 +15,7 @@ comes in;
#X obj 41 262 repeat 3;
#X text 143 236 reset the number of repetitions;
#X obj 41 303 print repetitio;
+#X text 471 32 part of zexy;
#X connect 0 0 11 0;
#X connect 1 0 11 0;
#X connect 5 0 11 1;
diff --git a/examples/scalarmult.pd b/examples/scalarmult.pd
index 1b988ef..1b54456 100644
--- a/examples/scalarmult.pd
+++ b/examples/scalarmult.pd
@@ -1,4 +1,4 @@
-#N canvas 193 440 857 589 10;
+#N canvas 296 375 857 589 10;
#X obj 83 45 .;
#X text 130 46 scalar multilicaton ("dot");
#X msg 71 156 1 2 3;
@@ -14,9 +14,9 @@
#X msg 481 160 1 2 3;
#X obj 481 245 print;
#X obj 375 218 . 0;
-#X floatatom 409 193 4 0 0;
+#X floatatom 409 193 4 0 0 0 - - -;
#X obj 481 219 . 7;
-#X floatatom 514 194 4 0 0;
+#X floatatom 514 194 4 0 0 0 - - -;
#X obj 62 456 .;
#X msg 62 377 1 2 3;
#X msg 178 378 1 2 3;
@@ -35,14 +35,15 @@
#X text 420 334 tricky:;
#X obj 431 453 print;
#X msg 447 403 1 2 3;
-#X floatatom 431 377 4 0 0;
+#X floatatom 431 377 4 0 0 0 - - -;
#X obj 431 430 .;
#X obj 536 460 print;
#X msg 536 414 1 2 3;
#X obj 536 437 .;
#X obj 536 392 t b l;
-#X floatatom 536 368 4 0 0;
+#X floatatom 536 368 4 0 0 0 - - -;
#X text 582 393 note that we "cast" the float to list;
+#X text 589 51 part of zexy;
#X connect 2 0 9 0;
#X connect 3 0 9 1;
#X connect 5 0 8 0;
diff --git a/examples/sf-play_record.pd b/examples/sf-play_record.pd
index d44b65e..0a500c6 100644
--- a/examples/sf-play_record.pd
+++ b/examples/sf-play_record.pd
@@ -1,57 +1,122 @@
-#N canvas 153 6 588 488 10;
-#X obj 436 382 sfplay 2;
-#X obj 38 385 sfrecord 2;
-#X msg 436 200 help;
-#X obj 436 412 dac~;
-#X msg 436 226 open test.raw l;
-#X msg 436 249 start;
-#X msg 485 249 bang;
-#X msg 525 249 1;
-#X msg 436 272 stop;
-#X msg 525 272 0;
-#X msg 436 321 goto 100;
-#X msg 436 298 rewind;
-#X msg 495 410 done;
-#X obj 495 435 print;
-#X msg 38 201 help;
-#X msg 38 250 start;
-#X msg 38 274 stop;
-#X msg 38 298 close;
-#X msg 38 226 open test.raw l;
-#X msg 38 323 bang;
-#X floatatom 38 411;
-#X text 72 411 status (1-recording / 0-not_recording);
-#X obj 45 361 osc~ 100;
-#X obj 113 361 osc~ 578;
-#X msg 436 347 close;
-#X text 122 47 a little harddisk-recording system;
-#X text 77 324 retrigger status-output;
-#X text 261 224 <name> <endianity>;
-#X text 205 226 open;
-#X text 135 385 sfrecord/sfplay <num. of channels>;
-#X text 53 77 this makes it possible to do multi-track recordings;
-#X text 52 92 up to now \, the "sfrecord" only supports .RAW format;
-#X text 51 107 "sfplay" can skip any header \, if you know it's size:: just call "sfplay <num.of.chan> <skip.bytes>;
-#X connect 0 0 3 0;
-#X connect 0 1 3 1;
-#X connect 0 2 12 0;
-#X connect 1 0 20 0;
-#X connect 2 0 0 0;
-#X connect 4 0 0 0;
-#X connect 5 0 0 0;
-#X connect 6 0 0 0;
-#X connect 7 0 0 0;
-#X connect 8 0 0 0;
-#X connect 9 0 0 0;
-#X connect 10 0 0 0;
-#X connect 11 0 0 0;
-#X connect 12 0 13 0;
-#X connect 14 0 1 0;
-#X connect 15 0 1 0;
-#X connect 16 0 1 0;
-#X connect 17 0 1 0;
-#X connect 18 0 1 0;
-#X connect 19 0 1 0;
-#X connect 22 0 1 0;
-#X connect 23 0 1 1;
-#X connect 24 0 0 0;
+#N canvas 341 307 588 488 10;
+#X obj 436 382 sfplay 2;
+#X obj 38 385 sfrecord 2;
+#X msg 436 200 help;
+#X msg 436 226 open test.raw l;
+#X msg 436 249 start;
+#X msg 485 249 bang;
+#X msg 525 249 1;
+#X msg 436 272 stop;
+#X msg 525 272 0;
+#X msg 436 321 goto 100;
+#X msg 436 298 rewind;
+#X msg 507 356 done;
+#X obj 507 381 print;
+#X msg 38 201 help;
+#X msg 38 250 start;
+#X msg 38 274 stop;
+#X msg 38 298 close;
+#X msg 38 226 open test.raw l;
+#X msg 38 323 bang;
+#X floatatom 38 411 0 0 0 0 - - -;
+#X text 72 411 status (1-recording / 0-not_recording);
+#X obj 45 361 osc~ 100;
+#X obj 113 361 osc~ 578;
+#X msg 436 347 close;
+#X text 122 47 a little harddisk-recording system;
+#X text 77 324 retrigger status-output;
+#X text 261 224 <name> <endianity>;
+#X text 205 226 open;
+#X text 135 385 sfrecord/sfplay <num. of channels>;
+#X text 53 77 this makes it possible to do multi-track recordings;
+#X text 52 92 up to now \, the "sfrecord" only supports .RAW format
+;
+#X text 51 107 "sfplay" can skip any header \, if you know it's size::
+just call "sfplay <num.of.chan> <skip.bytes>;
+#X floatatom 466 428 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 143 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 259 41 inlet;
+#X text 259 18 level;
+#X msg 156 65 set \$1;
+#X obj 156 89 outlet;
+#X msg 274 64 \; pd dsp 1;
+#X obj 143 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 143 171 pack 0 50;
+#X text 20 158 audio;
+#X text 153 110 show level;
+#X obj 143 42 r \$0master-lvl;
+#X obj 259 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X obj 72 181 inlet~;
+#X obj 72 212 *~;
+#X text 70 158 audio;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 17 0 28 1;
+#X connect 18 0 19 0;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X connect 27 0 28 0;
+#X connect 28 0 19 1;
+#X restore 437 456 pd output;
+#X msg 495 428 MUTE;
+#X text 111 423 output amplitude;
+#X text 435 37 part of zexy;
+#X connect 0 0 33 0;
+#X connect 0 1 33 1;
+#X connect 0 2 11 0;
+#X connect 1 0 19 0;
+#X connect 2 0 0 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 5 0 0 0;
+#X connect 6 0 0 0;
+#X connect 7 0 0 0;
+#X connect 8 0 0 0;
+#X connect 9 0 0 0;
+#X connect 10 0 0 0;
+#X connect 11 0 12 0;
+#X connect 13 0 1 0;
+#X connect 14 0 1 0;
+#X connect 15 0 1 0;
+#X connect 16 0 1 0;
+#X connect 17 0 1 0;
+#X connect 18 0 1 0;
+#X connect 21 0 1 0;
+#X connect 22 0 1 1;
+#X connect 23 0 0 0;
+#X connect 32 0 33 2;
+#X connect 33 0 32 0;
+#X connect 34 0 33 3;
diff --git a/examples/sigbinops+.pd b/examples/sigbinops+.pd
index 3797df9..1223ffc 100644
--- a/examples/sigbinops+.pd
+++ b/examples/sigbinops+.pd
@@ -1,106 +1,108 @@
-#N canvas 470 149 594 490 10;
-#X obj 62 193 abs~;
-#X obj 120 194 sgn~;
-#X obj 262 191 <~;
-#X obj 296 190 ==~;
-#X obj 330 191 >~;
-#X obj 388 190 &&~;
-#X obj 423 190 ||~;
-#X floatatom 423 238;
-#X floatatom 388 238;
-#X floatatom 330 239;
-#X floatatom 296 239;
-#X floatatom 120 242;
-#X floatatom 62 243;
-#X obj 62 221 avg~;
-#X obj 120 220 avg~;
-#X floatatom 262 239;
-#X obj 262 217 avg~;
-#X obj 296 216 avg~;
-#X obj 330 216 avg~;
-#X obj 388 216 avg~;
-#X obj 423 216 avg~;
-#X obj 62 163 sig~;
-#X floatatom 62 141;
-#X obj 330 126 sig~;
-#X floatatom 330 104;
-#X obj 404 126 sig~;
-#X floatatom 404 104;
-#X floatatom 440 448;
-#X floatatom 400 448;
-#X floatatom 349 448;
-#X floatatom 308 449;
-#X floatatom 274 449;
-#X obj 274 427 avg~;
-#X obj 308 426 avg~;
-#X obj 349 425 avg~;
-#X obj 400 426 avg~;
-#X obj 440 426 avg~;
-#X obj 349 337 sig~;
-#X floatatom 349 315;
-#X floatatom 430 316;
-#X obj 274 401 <~ 2;
-#X obj 308 400 ==~ 2;
-#X obj 349 400 >~ 2;
-#X obj 400 400 &&~ 2;
-#X obj 440 400 ||~ 2;
-#X text 83 30 more math and binary operations for signals;
-#X text 28 263 absolute;
-#X text 50 278 value;
-#X text 112 263 signum;
-#X text 249 267 greater;
-#X text 330 268 less;
-#X text 296 284 equal;
-#X text 393 261 logical;
-#X text 386 274 AND;
-#X text 431 274 OR;
-#X text 72 58 (this patch might be very CPU-consupmtious \, because of the float-atoms....);
-#X connect 0 0 13 0;
-#X connect 1 0 14 0;
-#X connect 2 0 16 0;
-#X connect 3 0 17 0;
-#X connect 4 0 18 0;
-#X connect 5 0 19 0;
-#X connect 6 0 20 0;
-#X connect 13 0 12 0;
-#X connect 14 0 11 0;
-#X connect 16 0 15 0;
-#X connect 17 0 10 0;
-#X connect 18 0 9 0;
-#X connect 19 0 8 0;
-#X connect 20 0 7 0;
-#X connect 21 0 0 0;
-#X connect 21 0 1 0;
-#X connect 22 0 21 0;
-#X connect 23 0 2 0;
-#X connect 23 0 3 0;
-#X connect 23 0 4 0;
-#X connect 23 0 5 0;
-#X connect 23 0 6 0;
-#X connect 24 0 23 0;
-#X connect 25 0 6 1;
-#X connect 25 0 5 1;
-#X connect 25 0 4 1;
-#X connect 25 0 3 1;
-#X connect 25 0 2 1;
-#X connect 26 0 25 0;
-#X connect 32 0 31 0;
-#X connect 33 0 30 0;
-#X connect 34 0 29 0;
-#X connect 35 0 28 0;
-#X connect 36 0 27 0;
-#X connect 37 0 40 0;
-#X connect 37 0 41 0;
-#X connect 37 0 42 0;
-#X connect 37 0 43 0;
-#X connect 37 0 44 0;
-#X connect 38 0 37 0;
-#X connect 39 0 43 1;
-#X connect 39 0 42 1;
-#X connect 39 0 41 1;
-#X connect 39 0 40 1;
-#X connect 40 0 32 0;
-#X connect 41 0 33 0;
-#X connect 42 0 34 0;
-#X connect 43 0 35 0;
-#X connect 44 0 36 0;
+#N canvas 470 149 594 490 10;
+#X obj 62 193 abs~;
+#X obj 120 194 sgn~;
+#X obj 262 191 <~;
+#X obj 296 190 ==~;
+#X obj 330 191 >~;
+#X obj 388 190 &&~;
+#X obj 423 190 ||~;
+#X floatatom 423 238 0 0 0 0 - - -;
+#X floatatom 388 238 0 0 0 0 - - -;
+#X floatatom 330 239 0 0 0 0 - - -;
+#X floatatom 296 239 0 0 0 0 - - -;
+#X floatatom 120 242 0 0 0 0 - - -;
+#X floatatom 62 243 0 0 0 0 - - -;
+#X obj 62 221 avg~;
+#X obj 120 220 avg~;
+#X floatatom 262 239 0 0 0 0 - - -;
+#X obj 262 217 avg~;
+#X obj 296 216 avg~;
+#X obj 330 216 avg~;
+#X obj 388 216 avg~;
+#X obj 423 216 avg~;
+#X obj 62 163 sig~;
+#X floatatom 62 141 0 0 0 0 - - -;
+#X obj 330 126 sig~;
+#X floatatom 330 104 0 0 0 0 - - -;
+#X obj 404 126 sig~;
+#X floatatom 404 104 0 0 0 0 - - -;
+#X floatatom 440 448 0 0 0 0 - - -;
+#X floatatom 400 448 0 0 0 0 - - -;
+#X floatatom 349 448 0 0 0 0 - - -;
+#X floatatom 308 449 0 0 0 0 - - -;
+#X floatatom 274 449 0 0 0 0 - - -;
+#X obj 274 427 avg~;
+#X obj 308 426 avg~;
+#X obj 349 425 avg~;
+#X obj 400 426 avg~;
+#X obj 440 426 avg~;
+#X obj 349 337 sig~;
+#X floatatom 349 315 0 0 0 0 - - -;
+#X floatatom 430 316 0 0 0 0 - - -;
+#X obj 274 401 <~ 2;
+#X obj 308 400 ==~ 2;
+#X obj 349 400 >~ 2;
+#X obj 400 400 &&~ 2;
+#X obj 440 400 ||~ 2;
+#X text 83 30 more math and binary operations for signals;
+#X text 28 263 absolute;
+#X text 50 278 value;
+#X text 112 263 signum;
+#X text 249 267 greater;
+#X text 330 268 less;
+#X text 296 284 equal;
+#X text 393 261 logical;
+#X text 386 274 AND;
+#X text 431 274 OR;
+#X text 430 16 part of zexy;
+#X text 72 58 (this patch might be very CPU-consumptious \, because
+of the float-atoms....);
+#X connect 0 0 13 0;
+#X connect 1 0 14 0;
+#X connect 2 0 16 0;
+#X connect 3 0 17 0;
+#X connect 4 0 18 0;
+#X connect 5 0 19 0;
+#X connect 6 0 20 0;
+#X connect 13 0 12 0;
+#X connect 14 0 11 0;
+#X connect 16 0 15 0;
+#X connect 17 0 10 0;
+#X connect 18 0 9 0;
+#X connect 19 0 8 0;
+#X connect 20 0 7 0;
+#X connect 21 0 0 0;
+#X connect 21 0 1 0;
+#X connect 22 0 21 0;
+#X connect 23 0 2 0;
+#X connect 23 0 3 0;
+#X connect 23 0 4 0;
+#X connect 23 0 5 0;
+#X connect 23 0 6 0;
+#X connect 24 0 23 0;
+#X connect 25 0 6 1;
+#X connect 25 0 5 1;
+#X connect 25 0 4 1;
+#X connect 25 0 3 1;
+#X connect 25 0 2 1;
+#X connect 26 0 25 0;
+#X connect 32 0 31 0;
+#X connect 33 0 30 0;
+#X connect 34 0 29 0;
+#X connect 35 0 28 0;
+#X connect 36 0 27 0;
+#X connect 37 0 40 0;
+#X connect 37 0 41 0;
+#X connect 37 0 42 0;
+#X connect 37 0 43 0;
+#X connect 37 0 44 0;
+#X connect 38 0 37 0;
+#X connect 39 0 43 1;
+#X connect 39 0 42 1;
+#X connect 39 0 41 1;
+#X connect 39 0 40 1;
+#X connect 40 0 32 0;
+#X connect 41 0 33 0;
+#X connect 42 0 34 0;
+#X connect 43 0 35 0;
+#X connect 44 0 36 0;
diff --git a/examples/sigzero~.pd b/examples/sigzero~.pd
index 4b5d09b..77b4eac 100644
--- a/examples/sigzero~.pd
+++ b/examples/sigzero~.pd
@@ -1,50 +1,110 @@
-#N canvas 0 0 594 494 10;
-#X obj 79 235 sigzero~;
-#X obj 79 187 sig~;
-#X floatatom 79 129;
-#X floatatom 79 262;
-#X obj 117 313 print signal;
-#X obj 117 264 select 0;
-#X msg 117 289 off;
-#X msg 176 288 on;
-#X text 72 42 sigzero~ detects whether there is a signal or not (e.g. zeroes throughout);
-#X obj 74 25 sigzero~;
-#X msg 136 161 bang;
-#X msg 135 185 off;
-#X floatatom 135 208;
-#X text 216 163 turn the detector on;
-#X text 216 188 turn it off;
-#X text 217 210 turn it on/off;
-#X text 114 128 try me;
-#X text 56 368;
-#N canvas 0 0 594 394 sub 0;
-#X obj 152 104 inlet~;
-#X obj 152 155 nop~;
-#X obj 152 210 outlet~;
-#X text 190 157 imagine we were doing some VERY heavy calcs here;
-#X obj 427 48 inlet;
-#X obj 427 75 switch~;
-#X text 35 272 if the heavy calculations done here are done in vain because there is no incoming signal \, it would be better to turn the whole sub-patch off...;
-#X connect 0 0 1 0;
-#X connect 1 0 2 0;
-#X connect 4 0 5 0;
-#X restore 76 433 page sub;
-#X obj 76 383 adc~ 1;
-#X obj 76 458 dac~ 1;
-#X obj 135 410 sigzero~;
-#X text 213 410 that's how i use it;
-#X connect 0 0 3 0;
-#X connect 0 0 5 0;
-#X connect 1 0 0 0;
-#X connect 2 0 1 0;
-#X connect 5 0 6 0;
-#X connect 5 1 7 0;
-#X connect 6 0 4 0;
-#X connect 7 0 4 0;
-#X connect 10 0 0 0;
-#X connect 11 0 0 0;
-#X connect 12 0 0 0;
-#X connect 18 0 20 0;
-#X connect 19 0 18 0;
-#X connect 19 0 21 0;
-#X connect 21 0 18 1;
+#N canvas 325 377 594 494 10;
+#X obj 79 235 sigzero~;
+#X obj 79 187 sig~;
+#X floatatom 79 129 0 0 0 0 - - -;
+#X floatatom 79 262 0 0 0 0 - - -;
+#X obj 117 313 print signal;
+#X obj 117 264 select 0;
+#X msg 117 289 off;
+#X msg 176 288 on;
+#X text 72 42 sigzero~ detects whether there is a signal or not (e.g.
+zeroes throughout);
+#X obj 74 25 sigzero~;
+#X msg 136 161 bang;
+#X msg 135 185 off;
+#X floatatom 135 208 0 0 0 0 - - -;
+#X text 216 163 turn the detector on;
+#X text 216 188 turn it off;
+#X text 217 210 turn it on/off;
+#X text 114 128 try me;
+#N canvas 0 0 594 394 sub 0;
+#X obj 152 104 inlet~;
+#X obj 152 155 nop~;
+#X obj 152 210 outlet~;
+#X text 190 157 imagine we were doing some VERY heavy calcs here;
+#X obj 427 48 inlet;
+#X obj 427 75 switch~;
+#X text 35 272 if the heavy calculations done here are done in vain
+because there is no incoming signal \, it would be better to turn the
+whole sub-patch off...;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 4 0 5 0;
+#X restore 76 393 page sub;
+#X obj 76 343 adc~ 1;
+#X obj 135 370 sigzero~;
+#X text 213 370 that's how i use it;
+#X floatatom 106 442 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 77 470 pd output;
+#X msg 135 442 MUTE;
+#X text 101 423 output amplitude;
+#X text 445 12 part of zexy;
+#X connect 0 0 3 0;
+#X connect 0 0 5 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X connect 5 0 6 0;
+#X connect 5 1 7 0;
+#X connect 6 0 4 0;
+#X connect 7 0 4 0;
+#X connect 10 0 0 0;
+#X connect 11 0 0 0;
+#X connect 12 0 0 0;
+#X connect 17 0 22 0;
+#X connect 18 0 17 0;
+#X connect 18 0 19 0;
+#X connect 19 0 17 1;
+#X connect 21 0 22 1;
+#X connect 22 0 21 0;
+#X connect 23 0 22 2;
diff --git a/examples/sort.pd b/examples/sort.pd
index 97729d3..2b3419a 100644
--- a/examples/sort.pd
+++ b/examples/sort.pd
@@ -1,77 +1,79 @@
-#N canvas 390 217 721 511 10;
-#X obj 86 231 print UNSORTED;
-#X msg 37 107 bang;
-#X obj 198 23 sort;
-#X text 314 87 any package-elements that are non-float will be interpreted as "0.0".;
-#X text 270 87 note :;
-#X obj 53 329 sort 1;
-#X obj 53 470 print ASCENDING;
-#X obj 37 347 sort -1;
-#X obj 37 487 print DESCENDING;
-#X text 278 297 creation : "sort [<dir>]";
-#X text 457 310 dir < 0 :: descending sort;
-#X text 456 297 dir >= 0 :: ascending sort;
-#X text 460 328 dir defaults to ascending;
-#N canvas 360 175 475 254 randompackage 0;
-#X obj 37 190 pack 0 0 0 0 0 0 0 0 0 0 0;
-#X obj 170 87 random 15;
-#X obj 156 104 random 15;
-#X obj 143 121 random 15;
-#X obj 130 138 random 15;
-#X obj 116 155 random 15;
-#X obj 103 172 random 15;
-#X obj 90 87 random 15;
-#X obj 76 104 random 15;
-#X obj 63 121 random 15;
-#X obj 50 138 random 15;
-#X obj 37 155 random 15;
-#X obj 37 52 inlet;
-#X obj 37 69 t b b b b b b b b b b b;
-#X obj 37 210 outlet;
-#X connect 0 0 14 0;
-#X connect 1 0 0 10;
-#X connect 2 0 0 9;
-#X connect 3 0 0 8;
-#X connect 4 0 0 7;
-#X connect 5 0 0 6;
-#X connect 6 0 0 5;
-#X connect 7 0 0 4;
-#X connect 8 0 0 3;
-#X connect 9 0 0 2;
-#X connect 10 0 0 1;
-#X connect 11 0 0 0;
-#X connect 12 0 13 0;
-#X connect 13 0 11 0;
-#X connect 13 1 10 0;
-#X connect 13 2 9 0;
-#X connect 13 3 8 0;
-#X connect 13 4 7 0;
-#X connect 13 5 6 0;
-#X connect 13 6 5 0;
-#X connect 13 7 4 0;
-#X connect 13 8 3 0;
-#X connect 13 9 2 0;
-#X connect 13 10 1 0;
-#X restore 37 195 pd randompackage;
-#X obj 72 177 print;
-#X msg 72 160 -----;
-#X obj 37 141 t b b;
-#X floatatom 88 293;
-#X text 122 295 direction;
-#X obj 37 213 t l l l l;
-#X obj 69 312 sort;
-#X obj 69 453 print SORTED;
-#X text 237 23 shell-sort a package of floats;
-#X connect 1 0 16 0;
-#X connect 5 0 6 0;
-#X connect 7 0 8 0;
-#X connect 13 0 19 0;
-#X connect 15 0 14 0;
-#X connect 16 0 13 0;
-#X connect 16 1 15 0;
-#X connect 17 0 20 1;
-#X connect 19 0 7 0;
-#X connect 19 1 5 0;
-#X connect 19 2 20 0;
-#X connect 19 3 0 0;
-#X connect 20 0 21 0;
+#N canvas 137 350 811 532 10;
+#X obj 86 231 print UNSORTED;
+#X msg 37 107 bang;
+#X obj 198 23 sort;
+#X text 314 87 any package-elements that are non-float will be interpreted
+as "0.0".;
+#X text 270 87 note :;
+#X obj 53 329 sort 1;
+#X obj 53 470 print ASCENDING;
+#X obj 37 347 sort -1;
+#X obj 37 487 print DESCENDING;
+#X text 278 297 creation : "sort [<dir>]";
+#X text 457 310 dir < 0 :: descending sort;
+#X text 456 297 dir >= 0 :: ascending sort;
+#X text 460 328 dir defaults to ascending;
+#N canvas 360 175 475 254 randompackage 0;
+#X obj 37 190 pack 0 0 0 0 0 0 0 0 0 0 0;
+#X obj 170 87 random 15;
+#X obj 156 104 random 15;
+#X obj 143 121 random 15;
+#X obj 130 138 random 15;
+#X obj 116 155 random 15;
+#X obj 103 172 random 15;
+#X obj 90 87 random 15;
+#X obj 76 104 random 15;
+#X obj 63 121 random 15;
+#X obj 50 138 random 15;
+#X obj 37 155 random 15;
+#X obj 37 52 inlet;
+#X obj 37 69 t b b b b b b b b b b b;
+#X obj 37 210 outlet;
+#X connect 0 0 14 0;
+#X connect 1 0 0 10;
+#X connect 2 0 0 9;
+#X connect 3 0 0 8;
+#X connect 4 0 0 7;
+#X connect 5 0 0 6;
+#X connect 6 0 0 5;
+#X connect 7 0 0 4;
+#X connect 8 0 0 3;
+#X connect 9 0 0 2;
+#X connect 10 0 0 1;
+#X connect 11 0 0 0;
+#X connect 12 0 13 0;
+#X connect 13 0 11 0;
+#X connect 13 1 10 0;
+#X connect 13 2 9 0;
+#X connect 13 3 8 0;
+#X connect 13 4 7 0;
+#X connect 13 5 6 0;
+#X connect 13 6 5 0;
+#X connect 13 7 4 0;
+#X connect 13 8 3 0;
+#X connect 13 9 2 0;
+#X connect 13 10 1 0;
+#X restore 37 195 pd randompackage;
+#X obj 72 177 print;
+#X msg 72 160 -----;
+#X obj 37 141 t b b;
+#X floatatom 88 293 0 0 0 0 - - -;
+#X text 122 295 direction;
+#X obj 37 213 t l l l l;
+#X obj 69 312 sort;
+#X obj 69 453 print SORTED;
+#X text 237 23 shell-sort a package of floats;
+#X text 553 16 part of zexy;
+#X connect 1 0 16 0;
+#X connect 5 0 6 0;
+#X connect 7 0 8 0;
+#X connect 13 0 19 0;
+#X connect 15 0 14 0;
+#X connect 16 0 13 0;
+#X connect 16 1 15 0;
+#X connect 17 0 20 1;
+#X connect 19 0 7 0;
+#X connect 19 1 5 0;
+#X connect 19 2 20 0;
+#X connect 19 3 0 0;
+#X connect 20 0 21 0;
diff --git a/examples/step~.pd b/examples/step~.pd
index 8b85d3d..f036839 100644
--- a/examples/step~.pd
+++ b/examples/step~.pd
@@ -1,74 +1,128 @@
-#N canvas 179 22 564 331 8;
-#X obj 243 283 step~;
-#X obj 243 309 print~;
-#X msg 186 236 bang;
-#X floatatom 283 259;
-#X floatatom 243 237;
-#X obj 186 259 t b b;
-#X obj 243 259 t f b;
-#X text 50 20 step~ ::;
-#X text 50 70 IN1 :;
-#X text 50 110 IN2 :;
-#X text 50 180 note :;
-#X text 100 20 produces a unit:step:sequence or a rectangle:window;
-#X text 100 70 define \, how many samples after the float::bang:message the rectangle:window will start;
-#X text 100 110 define the length of the rectangle:window choosing 1 will produce a dirac:impulse :: unit:sample:sequence) choosing 0 will make the rectangle infinitely long :: unit:step:sequence;
-#X text 100 180 1 sample equals 1:over:samplerate secs;
-#X text 235 217 position;
-#X text 303 239 length;
-#N canvas 169 79 597 397 application 0;
-#X obj 88 188 sig~ 440;
-#X obj 88 211 osc~;
-#X obj 88 235 *~;
-#X obj 149 211 osc~;
-#X obj 149 235 *~;
-#X obj 149 188 sig~ 550;
-#X floatatom 88 163;
-#X floatatom 149 163;
-#X obj 276 189 sig~ -1;
-#X obj 228 189 step~;
-#X msg 258 166 0;
-#X msg 291 166 44100;
-#X floatatom 338 166;
-#X msg 228 142 bang;
-#X obj 149 320 dac~;
-#X obj 149 290 *~;
-#X obj 431 227 dbtorms;
-#X obj 431 249 pack 0 100;
-#X obj 431 271 line~;
-#X floatatom 431 204;
-#X text 193 118 toggle::press;
-#X text 38 23 This \, of course \, is a quite barbarious use of the step~-object;
-#X text 124 51 but it was fast to do and I do think it illustrates the way it works.;
-#X connect 0 0 1 0;
-#X connect 1 0 2 0;
-#X connect 2 0 15 0;
-#X connect 3 0 4 0;
-#X connect 4 0 15 0;
-#X connect 5 0 3 0;
-#X connect 6 0 0 0;
-#X connect 7 0 5 0;
-#X connect 8 0 4 1;
-#X connect 9 0 2 1;
-#X connect 9 0 4 1;
-#X connect 10 0 9 1;
-#X connect 11 0 9 1;
-#X connect 12 0 9 1;
-#X connect 13 0 9 0;
-#X connect 15 0 14 0;
-#X connect 15 0 14 1;
-#X connect 16 0 17 0;
-#X connect 17 0 18 0;
-#X connect 18 0 15 1;
-#X connect 19 0 16 0;
-#X restore 439 186 page application;
-#X msg 186 283 1;
-#X connect 0 0 1 0;
-#X connect 2 0 5 0;
-#X connect 3 0 0 1;
-#X connect 4 0 6 0;
-#X connect 5 0 0 0;
-#X connect 5 1 18 0;
-#X connect 6 0 0 0;
-#X connect 6 1 1 0;
-#X connect 18 0 1 0;
+#N canvas 496 479 634 373 10;
+#X obj 243 283 step~;
+#X obj 243 309 print~;
+#X msg 186 236 bang;
+#X floatatom 283 259 0 0 0 0 - - -;
+#X floatatom 243 237 0 0 0 0 - - -;
+#X obj 186 259 t b b;
+#X obj 243 259 t f b;
+#X text 50 20 step~ ::;
+#X text 50 70 IN1 :;
+#X text 50 110 IN2 :;
+#X text 50 180 note :;
+#X text 100 20 produces a unit:step:sequence or a rectangle:window
+;
+#X text 100 70 define \, how many samples after the float::bang:message
+the rectangle:window will start;
+#X text 100 110 define the length of the rectangle:window choosing
+1 will produce a dirac:impulse :: unit:sample:sequence) choosing 0
+will make the rectangle infinitely long :: unit:step:sequence;
+#X text 100 180 1 sample equals 1:over:samplerate secs;
+#X text 235 217 position;
+#X text 303 239 length;
+#N canvas 169 79 820 553 application 0;
+#X obj 88 188 sig~ 440;
+#X obj 88 211 osc~;
+#X obj 88 235 *~;
+#X obj 149 211 osc~;
+#X obj 149 235 *~;
+#X obj 149 188 sig~ 550;
+#X floatatom 88 163 0 0 0 0 - - -;
+#X floatatom 149 163 0 0 0 0 - - -;
+#X obj 276 189 sig~ -1;
+#X obj 228 189 step~;
+#X msg 258 166 0;
+#X msg 291 166 44100;
+#X floatatom 338 166 0 0 0 0 - - -;
+#X msg 228 142 bang;
+#X text 193 118 toggle::press;
+#X text 38 23 This \, of course \, is a quite barbarious use of the
+step~-object;
+#X text 124 51 but it was fast to do and I do think it illustrates
+the way it works.;
+#X floatatom 178 342 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 149 370 pd output;
+#X msg 207 342 MUTE;
+#X text 173 323 output amplitude;
+#X obj 149 290 +~;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 21 0;
+#X connect 3 0 4 0;
+#X connect 4 0 21 0;
+#X connect 5 0 3 0;
+#X connect 6 0 0 0;
+#X connect 7 0 5 0;
+#X connect 8 0 4 1;
+#X connect 9 0 2 1;
+#X connect 9 0 4 1;
+#X connect 10 0 9 1;
+#X connect 11 0 9 1;
+#X connect 12 0 9 1;
+#X connect 13 0 9 0;
+#X connect 17 0 18 1;
+#X connect 18 0 17 0;
+#X connect 19 0 18 2;
+#X connect 21 0 18 0;
+#X restore 439 186 page application;
+#X msg 186 283 1;
+#X connect 0 0 1 0;
+#X connect 2 0 5 0;
+#X connect 3 0 0 1;
+#X connect 4 0 6 0;
+#X connect 5 0 0 0;
+#X connect 5 1 18 0;
+#X connect 6 0 0 0;
+#X connect 6 1 1 0;
+#X connect 18 0 1 0;
diff --git a/examples/strcmp.pd b/examples/strcmp.pd
index a2a64ee..7e168d4 100644
--- a/examples/strcmp.pd
+++ b/examples/strcmp.pd
@@ -1,26 +1,30 @@
-#N canvas 45 175 628 611 10;
-#X obj 90 54 strcmp;
-#X text 147 54 -- compare 2 lists as if they were strings;
-#X obj 71 398 strcmp this is list # 3;
-#X floatatom 71 423;
-#X obj 96 423 print strcmp;
-#X msg 71 184 list this is list # 3;
-#X msg 71 221 list this is list # 4;
-#X msg 71 239 1 2 3 4 5;
-#X msg 71 256 list yet another list;
-#X floatatom 83 286;
-#X msg 204 313 list yet another list;
-#X msg 222 366 list \$1;
-#X floatatom 222 349;
-#X text 278 357 to compare symbols/floats you have to make sure that they go to the 2nd inlet as lists;
-#X text 98 442 the output follows the "strcmp" of the C programming language;
-#X connect 2 0 4 0;
-#X connect 2 0 3 0;
-#X connect 5 0 2 0;
-#X connect 6 0 2 0;
-#X connect 7 0 2 0;
-#X connect 8 0 2 0;
-#X connect 9 0 2 0;
-#X connect 10 0 2 1;
-#X connect 11 0 2 1;
-#X connect 12 0 11 0;
+#N canvas 459 236 628 611 10;
+#X obj 90 54 strcmp;
+#X text 147 54 -- compare 2 lists as if they were strings;
+#X obj 71 398 strcmp this is list # 3;
+#X floatatom 71 423 0 0 0 0 - - -;
+#X obj 96 423 print strcmp;
+#X msg 71 184 list this is list # 3;
+#X msg 71 221 list this is list # 4;
+#X msg 71 239 1 2 3 4 5;
+#X msg 71 256 list yet another list;
+#X floatatom 83 286 0 0 0 0 - - -;
+#X msg 204 313 list yet another list;
+#X msg 222 366 list \$1;
+#X floatatom 222 349 0 0 0 0 - - -;
+#X text 278 357 to compare symbols/floats you have to make sure that
+they go to the 2nd inlet as lists;
+#X text 98 442 the output follows the "strcmp" of the C programming
+language;
+#X text 426 24 part of zexy;
+#X text 68 525 probably not very efficient!!;
+#X connect 2 0 4 0;
+#X connect 2 0 3 0;
+#X connect 5 0 2 0;
+#X connect 6 0 2 0;
+#X connect 7 0 2 0;
+#X connect 8 0 2 0;
+#X connect 9 0 2 0;
+#X connect 10 0 2 1;
+#X connect 11 0 2 1;
+#X connect 12 0 11 0;
diff --git a/examples/swap~.pd b/examples/swap~.pd
index 599811e..614fc75 100644
--- a/examples/swap~.pd
+++ b/examples/swap~.pd
@@ -1,39 +1,90 @@
-#N canvas 0 -1 718 576 10;
-#X obj 97 321 swap~;
-#X text 138 102 this object first converts the signal to 16bit \, then swaps upper and lower byte.;
-#X msg 120 233 0;
-#X msg 120 209 1;
-#X msg 119 258 bang;
-#X obj 33 288 osc~ 440;
-#X floatatom 33 264;
-#X msg 119 283 help;
-#X obj 81 401 *~;
-#X obj 43 352 dbtorms;
-#X floatatom 43 328;
-#X msg 445 28 \; pd dsp 1;
-#X obj 81 376 sig~ 0.2;
-#X msg 520 28 \; pd dsp 0;
-#X graph graph5 0 -1 100 1 298 494 698 194;
-#X array scope 100 float;
-#X pop;
-#X obj 176 426 tabwrite~ scope;
-#X msg 176 401 bang;
-#X text 159 258 toggle;
-#X text 152 208 on;
-#X text 154 232 off;
-#X obj 87 27 swap~;
-#X text 149 25 byte-swap a 16bit signal;
-#X obj 81 425 dac~ 1;
-#X connect 0 0 8 1;
-#X connect 0 0 15 0;
-#X connect 2 0 0 0;
-#X connect 3 0 0 0;
-#X connect 4 0 0 0;
-#X connect 5 0 0 0;
-#X connect 6 0 5 0;
-#X connect 7 0 0 0;
-#X connect 8 0 22 0;
-#X connect 9 0 12 0;
-#X connect 10 0 9 0;
-#X connect 12 0 8 0;
-#X connect 16 0 15 0;
+#N canvas 427 339 718 576 10;
+#X obj 97 321 swap~;
+#X text 138 102 this object first converts the signal to 16bit \, then
+swaps upper and lower byte.;
+#X msg 120 233 0;
+#X msg 120 209 1;
+#X msg 119 258 bang;
+#X obj 33 288 osc~ 440;
+#X floatatom 33 264 0 0 0 0 - - -;
+#X msg 119 283 help;
+#X msg 533 54 \; pd dsp 1;
+#N canvas 0 0 450 300 graph5 0;
+#X array scope 100 float 0;
+#X coords 0 1 100 -1 400 300 1;
+#X restore 298 194 graph;
+#X obj 143 345 tabwrite~ scope;
+#X msg 143 320 bang;
+#X text 159 258 toggle;
+#X text 152 208 on;
+#X text 154 232 off;
+#X obj 87 27 swap~;
+#X text 149 25 byte-swap a 16bit signal;
+#X floatatom 126 412 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 97 440 pd output;
+#X msg 155 412 MUTE;
+#X text 121 393 output amplitude;
+#X text 513 29 part of zexy;
+#X connect 0 0 10 0;
+#X connect 0 0 18 0;
+#X connect 2 0 0 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 5 0 0 0;
+#X connect 6 0 5 0;
+#X connect 7 0 0 0;
+#X connect 11 0 10 0;
+#X connect 17 0 18 1;
+#X connect 18 0 17 0;
+#X connect 19 0 18 2;
diff --git a/examples/symbol2list.pd b/examples/symbol2list.pd
index e53dccf..9b38423 100644
--- a/examples/symbol2list.pd
+++ b/examples/symbol2list.pd
@@ -28,6 +28,7 @@ up into its characters.;
#X text 375 412 banging the object will re-parse the list-symbol;
#X text 532 498 which does the inverse;
#X obj 75 428 symbol2list _;
+#X text 600 44 part of zexy;
#X connect 1 0 24 1;
#X connect 7 0 24 0;
#X connect 8 0 1 0;
diff --git a/examples/tabdump.pd b/examples/tabdump.pd
index e9379bd..7525a84 100644
--- a/examples/tabdump.pd
+++ b/examples/tabdump.pd
@@ -1,17 +1,21 @@
-#N canvas 178 229 861 353 10;
-#X graph graph2 0 -1 8 1 603 257 803 117;
-#X array my_array66 5 float;
-#X array my_array77 8 float;
-#X pop;
+#N canvas 293 375 861 353 10;
+#N canvas 0 0 450 300 graph2 0;
+#X array my_array66 5 float 0;
+#X array my_array77 8 float 0;
+#X coords 0 1 8 -1 200 140 1;
+#X restore 603 117 graph;
#X obj 283 138 loadbang;
#X obj 83 168 tabdump my_array66;
#X msg 83 100 bang;
#X obj 83 193 print;
#X msg 133 148 set my_array77;
-#X msg 283 164 \; my_array66 resize 5 \; my_array77 resize 8 \; my_array66 0.1 0.3 0.2 0.5 0.2 -0.1 \; my_array77 0.1 0.1 0.2 0.3 0.5 0.8 0.13 0.21 0.34;
+#X msg 283 164 \; my_array66 resize 5 \; my_array77 resize 8 \; my_array66
+0.1 0.3 0.2 0.5 0.2 -0.1 \; my_array77 0.1 0.1 0.2 0.3 0.5 0.8 0.13
+0.21 0.34;
#X obj 176 22 tabdump;
#X text 273 24 dump the contents of a table as a list;
#X msg 132 126 set my_array66;
+#X text 648 24 part of zexy;
#X connect 1 0 6 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
diff --git a/examples/tabset.pd b/examples/tabset.pd
index 28bfb68..9249342 100644
--- a/examples/tabset.pd
+++ b/examples/tabset.pd
@@ -1,17 +1,21 @@
-#N canvas 140 193 861 353 10;
-#X graph graph2 0 -1 8 1 603 257 803 117;
-#X array my_array99 5 float;
-#X array my_array97 8 float;
-#X pop;
+#N canvas 275 479 861 353 10;
+#N canvas 0 0 450 300 graph2 0;
+#X array my_array99 5 float 0;
+#X array my_array97 8 float 0;
+#X coords 0 1 8 -1 200 140 1;
+#X restore 603 117 graph;
#X obj 283 138 loadbang;
#X msg 132 126 set my_array99;
#X msg 133 148 set my_array97;
-#X msg 283 164 \; my_array99 resize 5 \; my_array97 resize 8 \; my_array99 0.1 0.3 0.2 0.5 0.2 -0.1 \; my_array97 0.1 0.1 0.2 0.3 0.5 0.8 0.13 0.21 0.34;
+#X msg 283 164 \; my_array99 resize 5 \; my_array97 resize 8 \; my_array99
+0.1 0.3 0.2 0.5 0.2 -0.1 \; my_array97 0.1 0.1 0.2 0.3 0.5 0.8 0.13
+0.21 0.34;
#X obj 176 22 tabdump;
#X text 273 24 dump the contents of a table as a list;
#X msg 83 73 1 0.7 0.5 0.3 0.2 0.1;
#X obj 83 168 tabset my_array99;
-#X floatatom 97 95 4 0 0;
+#X floatatom 97 95 4 0 0 0 - - -;
+#X text 631 28 part of zexy;
#X connect 1 0 4 0;
#X connect 2 0 8 0;
#X connect 3 0 8 0;
diff --git a/examples/tavg~.pd b/examples/tavg~.pd
index 03c7b20..6d59916 100644
--- a/examples/tavg~.pd
+++ b/examples/tavg~.pd
@@ -1,28 +1,30 @@
-#N canvas 288 18 580 361 10;
-#X floatatom 59 148;
-#X floatatom 59 254;
-#X floatatom 129 255;
-#X obj 59 276 dbtorms;
-#X floatatom 59 299;
-#X text 272 269 see also:;
-#X obj 277 296 env~;
-#X obj 59 233 env~;
-#X obj 315 296 envrms~;
-#X obj 59 173 osc~ 5512.5;
-#X obj 373 296 avg~;
-#X obj 129 234 tavg~;
-#X obj 71 51 tavg~;
-#X text 130 51 calculates the arithmetic mean of a signal between 2 bangs;
-#X obj 176 195 metro 1000;
-#X msg 176 167 bang;
-#X msg 211 167 stop;
-#X connect 0 0 9 0;
-#X connect 1 0 3 0;
-#X connect 3 0 4 0;
-#X connect 7 0 1 0;
-#X connect 9 0 7 0;
-#X connect 9 0 11 0;
-#X connect 11 0 2 0;
-#X connect 14 0 11 0;
-#X connect 15 0 14 0;
-#X connect 16 0 14 0;
+#N canvas 445 479 580 361 10;
+#X floatatom 59 148 0 0 0 0 - - -;
+#X floatatom 59 254 0 0 0 0 - - -;
+#X floatatom 129 255 0 0 0 0 - - -;
+#X obj 59 276 dbtorms;
+#X floatatom 59 299 0 0 0 0 - - -;
+#X text 272 269 see also:;
+#X obj 277 296 env~;
+#X obj 59 233 env~;
+#X obj 315 296 envrms~;
+#X obj 59 173 osc~ 5512.5;
+#X obj 373 296 avg~;
+#X obj 129 234 tavg~;
+#X obj 71 51 tavg~;
+#X text 130 51 calculates the arithmetic mean of a signal between 2
+bangs;
+#X obj 176 195 metro 1000;
+#X msg 176 167 bang;
+#X msg 211 167 stop;
+#X text 392 23 part of zexy;
+#X connect 0 0 9 0;
+#X connect 1 0 3 0;
+#X connect 3 0 4 0;
+#X connect 7 0 1 0;
+#X connect 9 0 7 0;
+#X connect 9 0 11 0;
+#X connect 11 0 2 0;
+#X connect 14 0 11 0;
+#X connect 15 0 14 0;
+#X connect 16 0 14 0;
diff --git a/examples/time.pd b/examples/time.pd
index e179e13..9ee8c09 100644
--- a/examples/time.pd
+++ b/examples/time.pd
@@ -1,31 +1,32 @@
-#N canvas 253 26 421 378 10;
-#X msg 71 174 bang;
-#X floatatom 86 261;
-#X floatatom 78 284;
-#X floatatom 71 307;
-#X obj 71 203 time;
-#X floatatom 94 238;
-#X text 151 241 msec;
-#X text 152 263 sec;
-#X text 153 284 min;
-#X text 152 306 hours;
-#X msg 219 175 bang;
-#X floatatom 253 259;
-#X floatatom 236 284;
-#X floatatom 219 308;
-#X floatatom 270 234;
-#X obj 219 204 time GMT;
-#X text 91 79 get the system time;
-#X text 64 149 local;
-#X text 222 152 GMT;
-#X obj 73 27 time;
-#X connect 0 0 4 0;
-#X connect 4 0 3 0;
-#X connect 4 1 2 0;
-#X connect 4 2 1 0;
-#X connect 4 3 5 0;
-#X connect 10 0 15 0;
-#X connect 15 0 13 0;
-#X connect 15 1 12 0;
-#X connect 15 2 11 0;
-#X connect 15 3 14 0;
+#N canvas 613 398 421 378 10;
+#X msg 71 174 bang;
+#X floatatom 86 261 0 0 0 0 - - -;
+#X floatatom 78 284 0 0 0 0 - - -;
+#X floatatom 71 307 0 0 0 0 - - -;
+#X obj 71 203 time;
+#X floatatom 94 238 0 0 0 0 - - -;
+#X text 151 241 msec;
+#X text 152 263 sec;
+#X text 153 284 min;
+#X text 152 306 hours;
+#X msg 219 175 bang;
+#X floatatom 253 259 0 0 0 0 - - -;
+#X floatatom 236 284 0 0 0 0 - - -;
+#X floatatom 219 308 0 0 0 0 - - -;
+#X floatatom 270 234 0 0 0 0 - - -;
+#X obj 219 204 time GMT;
+#X text 91 79 get the system time;
+#X text 64 149 local;
+#X text 222 152 GMT;
+#X obj 73 27 time;
+#X text 233 31 part of zexy;
+#X connect 0 0 4 0;
+#X connect 4 0 3 0;
+#X connect 4 1 2 0;
+#X connect 4 2 1 0;
+#X connect 4 3 5 0;
+#X connect 10 0 15 0;
+#X connect 15 0 13 0;
+#X connect 15 1 12 0;
+#X connect 15 2 11 0;
+#X connect 15 3 14 0;
diff --git a/examples/unpack~.pd b/examples/unpack~.pd
index c8cee41..784f291 100644
--- a/examples/unpack~.pd
+++ b/examples/unpack~.pd
@@ -1,59 +1,117 @@
-#N canvas 299 436 736 292 10;
-#X text 460 14 see also;
-#X obj 461 33 pack~;
-#X text 147 40 unpack~;
-#X text 178 65 convert float-packages to signals;
-#X obj 85 132 unpack~ 512;
-#X text 234 156 creation: "unpack~ [<bufsize>]";
-#X text 255 181 <bufsize>: in samples (defaults to 64) \; could be fine if you don't have a constant stream of floats;
-#N canvas 94 221 839 437 example 0;
-#X obj 69 75 osc~ 689.062;
-#X obj 69 123 pack~;
-#X obj 69 94 *~ 0.2;
-#X obj 69 142 unfold;
-#X obj 69 160 t b f;
-#X obj 69 178 +;
-#X obj 69 198 + 1;
-#X obj 69 236 select 0;
-#X obj 69 256 f;
-#X obj 69 332 unpack~;
-#X floatatom 69 50;
-#X obj 69 218 % 8;
-#X text 74 6 a simple samplerate-reducer;
-#X text 116 129 samplerate = 44.1kHz;
-#X text 126 258 samplerate = 5.5125kHz;
-#X text 108 363 reconstructed signal @ 44.1kHz;
-#X obj 127 114 dac~ 2;
-#X obj 69 387 dac~ 1;
-#X msg 69 276 \$1 \$1 \$1 \$1 \$1 \$1 \$1 \$1;
-#X graph graph2 0 -1 64 1 526 213 826 13;
-#X array high_rate 100 float;
-#X pop;
-#X graph graph3 0 -1 64 1 526 441 826 241;
-#X array low_rate 100 float;
-#X pop;
-#X obj 170 113 tabsend~ high_rate;
-#X obj 114 388 tabsend~ low_rate;
-#X msg 349 240 \; pd dsp 0;
-#X msg 349 179 \; pd dsp 1;
-#X obj 349 221 loadbang;
-#X connect 0 0 2 0;
-#X connect 1 0 3 0;
-#X connect 2 0 1 0;
-#X connect 2 0 16 0;
-#X connect 2 0 21 0;
-#X connect 3 0 4 0;
-#X connect 4 0 5 0;
-#X connect 4 1 8 1;
-#X connect 5 0 6 0;
-#X connect 6 0 11 0;
-#X connect 7 0 8 0;
-#X connect 8 0 18 0;
-#X connect 9 0 17 0;
-#X connect 9 0 22 0;
-#X connect 10 0 0 0;
-#X connect 11 0 5 1;
-#X connect 11 0 7 0;
-#X connect 18 0 9 0;
-#X connect 25 0 23 0;
-#X restore 85 249 pd example;
+#N canvas 321 479 736 292 10;
+#X text 460 14 see also;
+#X obj 461 33 pack~;
+#X text 147 40 unpack~;
+#X text 178 65 convert float-packages to signals;
+#X obj 85 132 unpack~ 512;
+#X text 234 156 creation: "unpack~ [<bufsize>]";
+#X text 255 181 <bufsize>: in samples (defaults to 64) \; could be
+fine if you don't have a constant stream of floats;
+#N canvas 94 221 845 529 example 1;
+#X obj 69 75 osc~ 689.062;
+#X obj 69 123 pack~;
+#X obj 69 94 *~ 0.2;
+#X obj 69 142 unfold;
+#X obj 69 160 t b f;
+#X obj 69 178 +;
+#X obj 69 198 + 1;
+#X obj 69 236 select 0;
+#X obj 69 256 f;
+#X obj 69 312 unpack~;
+#X floatatom 69 50 0 0 0 0 - - -;
+#X obj 69 218 % 8;
+#X text 74 6 a simple samplerate-reducer;
+#X text 116 129 samplerate = 44.1kHz;
+#X text 126 258 samplerate = 5.5125kHz;
+#X text 108 363 reconstructed signal @ 44.1kHz;
+#X obj 127 114 dac~ 2;
+#X msg 69 276 \$1 \$1 \$1 \$1 \$1 \$1 \$1 \$1;
+#N canvas 0 0 450 300 graph2 0;
+#X array high_rate 100 float 0;
+#X coords 0 1 64 -1 300 200 1;
+#X restore 526 13 graph;
+#N canvas 0 0 450 300 graph3 0;
+#X array low_rate 100 float 0;
+#X coords 0 1 64 -1 300 200 1;
+#X restore 526 241 graph;
+#X obj 170 113 tabsend~ high_rate;
+#X obj 156 344 tabsend~ low_rate;
+#X msg 349 179 \; pd dsp 1;
+#X floatatom 97 412 0 0 0 0 - - -;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X obj 83 42 r \$0master-lvl;
+#X obj 199 100 s \$0master-lvl;
+#X obj 397 92 r \$0master-lvl;
+#X obj 338 210 s \$0master-lvl;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 26 0;
+#X connect 5 0 26 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 20 0;
+#X connect 11 0 18 0;
+#X connect 12 0 16 0;
+#X connect 12 0 24 0;
+#X connect 14 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 20 0 17 0;
+#X connect 23 0 10 0;
+#X connect 23 0 14 0;
+#X connect 25 0 1 1;
+#X connect 25 0 9 0;
+#X restore 68 440 pd output;
+#X msg 126 412 MUTE;
+#X text 92 393 output amplitude;
+#X connect 0 0 2 0;
+#X connect 1 0 3 0;
+#X connect 2 0 1 0;
+#X connect 2 0 16 0;
+#X connect 2 0 20 0;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 4 1 8 1;
+#X connect 5 0 6 0;
+#X connect 6 0 11 0;
+#X connect 7 0 8 0;
+#X connect 8 0 17 0;
+#X connect 9 0 21 0;
+#X connect 9 0 24 0;
+#X connect 10 0 0 0;
+#X connect 11 0 5 1;
+#X connect 11 0 7 0;
+#X connect 17 0 9 0;
+#X connect 23 0 24 1;
+#X connect 24 0 23 0;
+#X connect 25 0 24 2;
+#X restore 85 249 pd example;
+#X text 530 34 part of zexy;
diff --git a/examples/urn.pd b/examples/urn.pd
index 34cf1cb..ce2ac94 100644
--- a/examples/urn.pd
+++ b/examples/urn.pd
@@ -1,4 +1,4 @@
-#N canvas 217 38 529 495 10;
+#N canvas 615 253 529 495 10;
#X obj 76 35 urn;
#X text 73 75 generates random numbers without repetition;
#X obj 25 110 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
@@ -58,6 +58,7 @@ via the second outlet;
#X restore 74 440 pd lotto;
#X obj 249 453 random;
#X text 182 453 see also:;
+#X text 346 21 part of zexy;
#X connect 2 0 4 0;
#X connect 4 1 13 0;
#X connect 7 0 4 1;
diff --git a/examples/wrap.pd b/examples/wrap.pd
index 50fb7cc..304c78c 100644
--- a/examples/wrap.pd
+++ b/examples/wrap.pd
@@ -1,4 +1,4 @@
-#N canvas 77 -120 738 641 10;
+#N canvas 477 186 738 641 10;
#X text 118 18 wrap a float between to limits;
#X obj 71 18 wrap;
#X obj 42 150 wrap;
@@ -35,6 +35,7 @@ as zero (0).;
f1 is ALWAYS less than f2.;
#X text 130 593 if you need wrapping between (f1 \, f2] you have to
multiply the numbers with -1 before and after wrapping.;
+#X text 458 20 part of zexy;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 5 0 13 0;
diff --git a/examples/z~.pd b/examples/z~.pd
index 49e5560..9f831f7 100644
--- a/examples/z~.pd
+++ b/examples/z~.pd
@@ -1,28 +1,33 @@
-#N canvas 267 156 597 497 8;
-#X obj 125 42 z~;
-#X text 177 41 samplewise delay;
-#X text 168 89 should make FIR-filter design possible;
-#X obj 65 222 osc~ 440;
-#X floatatom 65 191;
-#X obj 97 270 z~;
-#X obj 127 270 z~ 2;
-#X obj 167 270 z~ 3;
-#X obj 65 310 +~;
-#X obj 65 336 * 0.25;
-#X obj 65 366 dac~;
-#X text 235 269 4th order moving average filter;
-#X text 185 324 creation argument : delay in samples (default is 1);
-#X text 167 119 (note that you cannot do IIR-filters easily this way !);
-#X text 351 42 z;
-#X text 359 36 -N;
-#X connect 3 0 8 0;
-#X connect 3 0 5 0;
-#X connect 3 0 6 0;
-#X connect 3 0 7 0;
-#X connect 4 0 3 0;
-#X connect 5 0 8 0;
-#X connect 6 0 8 0;
-#X connect 7 0 8 0;
-#X connect 8 0 9 0;
-#X connect 9 0 10 0;
-#X connect 9 0 10 1;
+#N canvas 304 271 597 497 10;
+#X obj 125 42 z~;
+#X text 177 41 samplewise delay;
+#X text 168 89 should make FIR-filter design possible;
+#X obj 65 222 osc~ 440;
+#X floatatom 65 191 0 0 0 0 - - -;
+#X obj 97 270 z~;
+#X obj 127 270 z~ 2;
+#X obj 65 310 +~;
+#X text 235 269 4th order moving average filter;
+#X text 193 298 creation argument : delay in samples (default is 1)
+;
+#X text 167 119 (note that you cannot do IIR-filters easily this way
+!);
+#X text 351 42 z;
+#X text 359 36 -N;
+#X obj 65 336 *~ 0.25;
+#X text 442 11 part of zexy;
+#X obj 167 270 z~ 3;
+#X obj 65 384 tabwrite~ \$0scope;
+#X msg 82 361 bang;
+#X obj 258 388 table \$0scope;
+#X connect 3 0 7 0;
+#X connect 3 0 5 0;
+#X connect 3 0 6 0;
+#X connect 3 0 15 0;
+#X connect 4 0 3 0;
+#X connect 5 0 7 0;
+#X connect 6 0 7 0;
+#X connect 7 0 13 0;
+#X connect 13 0 16 0;
+#X connect 15 0 7 0;
+#X connect 17 0 16 0;
diff --git a/src/makefile.in b/src/Makefile.in
index ffb3705..5466507 100644
--- a/src/makefile.in
+++ b/src/Makefile.in
@@ -24,7 +24,9 @@ CFLAGS = -g -O2 $(DEFS) $(IFLAGS) $(WFLAGS)
LIBS = @LIBS@
#LIBS = -lpthread -lm -lc
-include make.source
+
+include Make.source
+
TARGETS = $(SOURCES:.c=.o)
@@ -51,11 +53,11 @@ cleaner: clean
-rm -f *~ _* config.*
cleanest: cleaner
- -rm -f makefile ../*.$(EXT) make.source
+ -rm -f Makefile ../*.$(EXT) Make.source
distclean: cleanest newmakefile
-install: install-bin install-doc
+install: install-bin install-doc install-abs
install-bin:
-install -d $(INSTALL_BIN)
@@ -65,16 +67,20 @@ install-doc:
-install -d $(INSTALL_DOC)
-install -m 644 ../examples/*.pd $(INSTALL_DOC)
+install-abs:
+ -install -d $(INSTALL_BIN)
+ -install -m 644 ../abs/*.pd $(INSTALL_BIN)
+
dist: all cleaner
(cd ../..;tar czvf $(TARNAME) $(LIBNAME))
everything: clean all install distclean
newmakefile:
- echo "current:">makefile
- echo " ./configure && make">>makefile
+ echo "current:">Makefile
+ echo " ./configure && make">>Makefile
make.source:
- echo "SOURCES = \\"> make.source
- echo `ls z_*.c $(LIBNAME).c` >> make.source
- echo >> make.source
+ echo "SOURCES = \\"> Make.source
+ echo `ls z_*.c $(LIBNAME).c` >> Make.source
+ echo >> Make.source
diff --git a/src/a2l.c b/src/a2l.c
new file mode 100644
index 0000000..8b8efbe
--- /dev/null
+++ b/src/a2l.c
@@ -0,0 +1,90 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+/* 2305:forum::für::umläute:2001 */
+
+#include "zexy.h"
+#include <string.h>
+
+/* ------------------------- a2l ------------------------------- */
+
+/* convert anythings to lists, pass through the rest */
+
+static t_class *a2l_class;
+
+typedef struct _a2l
+{
+ t_object x_obj;
+} t_a2l;
+
+static void a2l_anything(t_a2l *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int n = argc+1;
+ t_atom *cur, *alist = (t_atom *)getbytes(n * sizeof(t_atom));
+
+ cur = alist;
+ SETSYMBOL(cur, s);
+ cur++;
+
+ memcpy(cur, argv, argc * sizeof(t_atom));
+
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), n, alist);
+
+ freebytes(alist, n * sizeof(t_atom));
+
+}
+
+static void a2l_list(t_a2l *x, t_symbol *s, int argc, t_atom *argv)
+{ outlet_list(x->x_obj.ob_outlet, s, argc, argv);}
+
+static void a2l_float(t_a2l *x, t_floatarg f)
+{ outlet_float(x->x_obj.ob_outlet, f);}
+
+static void a2l_symbol(t_a2l *x, t_symbol *s)
+{ outlet_symbol(x->x_obj.ob_outlet, s);}
+
+static void a2l_pointer(t_a2l *x, t_gpointer *gp)
+{ outlet_pointer(x->x_obj.ob_outlet, gp);}
+
+static void a2l_bang(t_a2l *x)
+{ outlet_bang(x->x_obj.ob_outlet);}
+
+static void *a2l_new(void)
+{
+ t_a2l *x = (t_a2l *)pd_new(a2l_class);
+ outlet_new(&x->x_obj, 0);
+ return (x);
+}
+
+void a2l_setup(void)
+{
+
+ a2l_class = class_new(gensym("any2list"), (t_newmethod)a2l_new,
+ 0, sizeof(t_a2l), 0, 0);
+ class_addcreator((t_newmethod)a2l_new, gensym("a2l"), 0);
+
+
+ class_addbang (a2l_class, a2l_bang);
+ class_addfloat (a2l_class, a2l_float);
+ class_addsymbol (a2l_class, a2l_symbol);
+ class_addpointer (a2l_class, a2l_pointer);
+ class_addlist (a2l_class, a2l_list);
+ class_addanything(a2l_class, a2l_anything);
+
+ class_sethelpsymbol(a2l_class, gensym("zexy/any2list"));
+ zexy_register("a2l");
+}
diff --git a/src/atoi.c b/src/atoi.c
new file mode 100644
index 0000000..2dcd325
--- /dev/null
+++ b/src/atoi.c
@@ -0,0 +1,98 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+#include "zexy.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * atoi : ascii to integer
+*/
+
+/* atoi :: ascii to integer */
+
+static t_class *atoi_class;
+
+typedef struct _atoi
+{
+ t_object x_obj;
+ int i;
+} t_atoi;
+static void atoi_bang(t_atoi *x)
+{
+ outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
+}
+static void atoi_float(t_atoi *x, t_floatarg f)
+{
+ x->i = f;
+ outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
+}
+static void atoi_symbol(t_atoi *x, t_symbol *s)
+{
+ int base=10;
+ const char* c = s->s_name;
+ if(c[0]=='0'){
+ base=8;
+ if (c[1]=='x')base=16;
+ }
+ x->i=strtol(c, 0, base);
+ outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
+}
+static void atoi_list(t_atoi *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int base=10;
+ const char* c;
+
+ if (argv->a_type==A_FLOAT){
+ x->i=atom_getfloat(argv);
+ outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
+ return;
+ }
+
+ if (argc>1){
+ base=atom_getfloat(argv+1);
+ if (base<2) {
+ error("atoi: setting base to 10");
+ base=10;
+ }
+ }
+ c=atom_getsymbol(argv)->s_name;
+ x->i=strtol(c, 0, base);
+ outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
+}
+
+static void *atoi_new(void)
+{
+ t_atoi *x = (t_atoi *)pd_new(atoi_class);
+ outlet_new(&x->x_obj, gensym("float"));
+ return (x);
+}
+
+void atoi_setup(void)
+{
+ atoi_class = class_new(gensym("atoi"), (t_newmethod)atoi_new, 0,
+ sizeof(t_atoi), 0, A_DEFFLOAT, 0);
+
+ class_addbang(atoi_class, (t_method)atoi_bang);
+ class_addfloat(atoi_class, (t_method)atoi_float);
+ class_addlist(atoi_class, (t_method)atoi_list);
+ class_addsymbol(atoi_class, (t_method)atoi_symbol);
+ class_addanything(atoi_class, (t_method)atoi_symbol);
+
+ class_sethelpsymbol(atoi_class, gensym("zexy/atoi"));
+ zexy_register("atoi");
+}
diff --git a/src/avg_tilde.c b/src/avg_tilde.c
new file mode 100644
index 0000000..5011cee
--- /dev/null
+++ b/src/avg_tilde.c
@@ -0,0 +1,85 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+#include <math.h>
+
+/* ------------------------ average~ ----------------------------- */
+
+/* tilde object to take absolute value. */
+
+static t_class *avg_class;
+
+typedef struct _avg
+{
+ t_object x_obj;
+
+ t_float n_inv;
+ t_float buf;
+ int blocks;
+} t_avg;
+
+
+/* average :: arithmetic mean of one signal-vector */
+
+static t_int *avg_perform(t_int *w)
+{
+ t_float *in = (t_float *)(w[1]);
+
+ t_avg *x = (t_avg *)w[2];
+ int n = (int)(w[3]);
+
+ t_float buf = 0.;
+
+ while (n--)
+ {
+ buf += *in++;
+ }
+ outlet_float(x->x_obj.ob_outlet, buf*x->n_inv);
+
+ return (w+4);
+}
+
+static void avg_dsp(t_avg *x, t_signal **sp)
+{
+ x->n_inv=1./sp[0]->s_n;
+ dsp_add(avg_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
+}
+
+static void *avg_new(void)
+{
+ t_avg *x = (t_avg *)pd_new(avg_class);
+ outlet_new(&x->x_obj, gensym("float"));
+ return (x);
+}
+
+static void avg_help(void)
+{
+ post("avg~\t:: outputs the arithmetic mean of each signal-vector");
+}
+
+
+void avg_tilde_setup(void)
+{
+ avg_class = class_new(gensym("avg~"), (t_newmethod)avg_new, 0,
+ sizeof(t_avg), 0, A_DEFFLOAT, 0);
+ class_addmethod(avg_class, nullfn, gensym("signal"), 0);
+ class_addmethod(avg_class, (t_method)avg_dsp, gensym("dsp"), 0);
+
+ class_addmethod(avg_class, (t_method)avg_help, gensym("help"), 0);
+ class_sethelpsymbol(avg_class, gensym("zexy/avg~"));
+ zexy_register("avg~");
+}
diff --git a/src/blockmirror_tilde.c b/src/blockmirror_tilde.c
new file mode 100644
index 0000000..5c0efcc
--- /dev/null
+++ b/src/blockmirror_tilde.c
@@ -0,0 +1,104 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/*
+ 1110:forum::für::umläute:1999
+*/
+
+#include "zexy.h"
+
+/* ------------------------ blockmirror~ ----------------------------- */
+
+/* mirrors a signalblock around it's center:
+ {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]}
+*/
+
+static t_class *blockmirror_class;
+
+typedef struct _blockmirror
+{
+ t_object x_obj;
+ int doit;
+ int blocksize;
+ t_float *blockbuffer;
+} t_blockmirror;
+
+static void blockmirror_float(t_blockmirror *x, t_floatarg f)
+{
+ x->doit = (f != 0);
+}
+
+static t_int *blockmirror_perform(t_int *w)
+{
+ t_blockmirror *x = (t_blockmirror *)(w[1]);
+ t_float *in = (t_float *)(w[2]);
+ t_float *out = (t_float *)(w[3]);
+ int n = (int)(w[4]);
+ if (x->doit) {
+ if (in==out){
+ int N=n;
+ t_float *dummy=x->blockbuffer;
+ while(n--)*dummy++=*in++;
+ dummy--;
+ while(N--)*out++=*dummy--;
+ } else {
+ in+=n-1;
+ while(n--)*out++=*in--;
+ }
+ } else while (n--) *out++ = *in++;
+ return (w+5);
+}
+
+static void blockmirror_dsp(t_blockmirror *x, t_signal **sp)
+{
+ if (x->blocksize<sp[0]->s_n){
+ if(x->blockbuffer)freebytes(x->blockbuffer, sizeof(t_float)*x->blocksize);
+ x->blocksize = sp[0]->s_n;
+ x->blockbuffer = getbytes(sizeof(t_float)*x->blocksize);
+ }
+ dsp_add(blockmirror_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
+}
+
+static void blockmirror_helper(void)
+{
+ post("\n%c blockmirror~-object for reverting a signal", HEARTSYMBOL);
+ post("'help' : view this\n"
+ "signal~");
+ post("outlet : signal~");
+}
+
+static void *blockmirror_new()
+{
+ t_blockmirror *x = (t_blockmirror *)pd_new(blockmirror_class);
+ outlet_new(&x->x_obj, gensym("signal"));
+ x->doit = 1;
+ x->blocksize=0;
+ return (x);
+}
+
+void blockmirror_tilde_setup(void)
+{
+ blockmirror_class = class_new(gensym("blockmirror~"), (t_newmethod)blockmirror_new, 0,
+ sizeof(t_blockmirror), 0, A_DEFFLOAT, 0);
+ class_addmethod(blockmirror_class, nullfn, gensym("signal"), 0);
+ class_addmethod(blockmirror_class, (t_method)blockmirror_dsp, gensym("dsp"), 0);
+
+ class_addfloat(blockmirror_class, blockmirror_float);
+
+ class_addmethod(blockmirror_class, (t_method)blockmirror_helper, gensym("help"), 0);
+ class_sethelpsymbol(blockmirror_class, gensym("zexy/blockmirror~"));
+ zexy_register("blockmirror~");
+}
diff --git a/src/blockswap_tilde.c b/src/blockswap_tilde.c
new file mode 100644
index 0000000..8c323fb
--- /dev/null
+++ b/src/blockswap_tilde.c
@@ -0,0 +1,99 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+
+/* ------------------------ blockswap~ ----------------------------- */
+
+/* swaps a signalblock around it's center:
+ {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]}
+*/
+
+static t_class *blockswap_class;
+
+typedef struct _blockswap
+{
+ t_object x_obj;
+ int doit;
+ int blocksize;
+ t_float *blockbuffer;
+} t_blockswap;
+
+static void blockswap_float(t_blockswap *x, t_floatarg f)
+{
+ x->doit = (f != 0);
+}
+
+static t_int *blockswap_perform(t_int *w)
+{
+ t_blockswap *x = (t_blockswap *)(w[1]);
+ t_float *in = (t_float *)(w[2]);
+ t_float *out = (t_float *)(w[3]);
+ int N = (int)(w[4]);
+ int N2=N/2;
+ if (x->doit) {
+ int n=N2;
+ t_float *dummy=x->blockbuffer;
+ while(n--)*dummy++=*in++;
+ n=N-N2;
+ while(n--)*out++=*in++;
+ dummy=x->blockbuffer;
+ n=N2;
+ while(n--)*out++=*dummy++;
+ } else while (N--) *out++=*in++;
+ return (w+5);
+}
+
+static void blockswap_dsp(t_blockswap *x, t_signal **sp)
+{
+ if (x->blocksize*2<sp[0]->s_n){
+ if(x->blockbuffer)freebytes(x->blockbuffer, sizeof(t_float)*x->blocksize);
+ x->blocksize = sp[0]->s_n/2;
+ x->blockbuffer = getbytes(sizeof(t_float)*x->blocksize);
+ }
+ dsp_add(blockswap_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
+}
+
+static void blockswap_helper(void)
+{
+ post("\n%c blockswap~-object for blockwise-swapping of a signal ", HEARTSYMBOL);
+ post("'help' : view this\n"
+ "signal~");
+ post("outlet : signal~");
+}
+
+static void *blockswap_new()
+{
+ t_blockswap *x = (t_blockswap *)pd_new(blockswap_class);
+ outlet_new(&x->x_obj, gensym("signal"));
+ x->doit = 1;
+ x->blocksize=0;
+ return (x);
+}
+
+void blockswap_tilde_setup(void)
+{
+ blockswap_class = class_new(gensym("blockswap~"), (t_newmethod)blockswap_new, 0,
+ sizeof(t_blockswap), 0, A_DEFFLOAT, 0);
+ class_addmethod(blockswap_class, nullfn, gensym("signal"), 0);
+ class_addmethod(blockswap_class, (t_method)blockswap_dsp, gensym("dsp"), 0);
+
+ class_addfloat(blockswap_class, blockswap_float);
+
+ class_addmethod(blockswap_class, (t_method)blockswap_helper, gensym("help"), 0);
+ class_sethelpsymbol(blockswap_class, gensym("zexy/blockswap~"));
+ zexy_register("blockswap~");
+}
diff --git a/src/configure b/src/configure
deleted file mode 100755
index 1dffe74..0000000
--- a/src/configure
+++ /dev/null
@@ -1,4724 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="zexy.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT STK DFLAGS LFLAGS EXT LD STRIPFLAGS ZEXY_VERSION REFERENCEPATH PDLIBDIR INCLUDES SOURCES CPP EGREP LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-lpt enable parallelport-support
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pdversion=<ver> enforce a certain pd-version (e.g. 0.37)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd "$ac_popdir"
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pdversion or --without-pdversion was given.
-if test "${with_pdversion+set}" = set; then
- withval="$with_pdversion"
-
-fi;
-# Check whether --enable-lpt or --disable-lpt was given.
-if test "${enable_lpt+set}" = set; then
- enableval="$enable_lpt"
-
-fi;
-
-if test $includedir
-then
- for id in $includedir
- do
- if test -d $id
- then
- INCLUDES="-I$id $INCLUDES"
- fi
- done
-fi
-
-
-
-echo "$as_me:$LINENO: checking for main in -lc" >&5
-echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6
-if test "${ac_cv_lib_c_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_c_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_c_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&5
-echo "${ECHO_T}$ac_cv_lib_c_main" >&6
-if test $ac_cv_lib_c_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBC 1
-_ACEOF
-
- LIBS="-lc $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lm" >&5
-echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_m_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_m_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
-echo "${ECHO_T}$ac_cv_lib_m_main" >&6
-if test $ac_cv_lib_m_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
- LIBS="-lm $LIBS"
-
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-for ac_header in stdlib.h stdio.h string.h math.h time.h sys/time.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
-if test "${ac_cv_header_time+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_time=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_time=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6
-if test $ac_cv_header_time = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
-
-fi
-
-
-
-
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_func in getpagesize
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the file system buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propagated back to all the places they're supposed to be.
-
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !STDC_HEADERS && !HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h. */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h. */
-# if !HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize ();
-
- /* First, make a file with some known garbage in it. */
- data = (char *) malloc (pagesize);
- if (!data)
- exit (1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand ();
- umask (0);
- fd = creat ("conftest.mmap", 0600);
- if (fd < 0)
- exit (1);
- if (write (fd, data, pagesize) != pagesize)
- exit (1);
- close (fd);
-
- /* Next, try to mmap the file at a fixed address which already has
- something else allocated at it. If we can, also make sure that
- we see the same garbage. */
- fd = open ("conftest.mmap", O_RDWR);
- if (fd < 0)
- exit (1);
- data2 = (char *) malloc (2 * pagesize);
- if (!data2)
- exit (1);
- data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit (1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit (1);
-
- /* Finally, make sure that changes to the mapped area do not
- percolate back to the file as seen by read(). (This is a bug on
- some variants of i386 svr4.0.) */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = (char *) malloc (pagesize);
- if (!data3)
- exit (1);
- if (read (fd, data3, pagesize) != pagesize)
- exit (1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit (1);
- close (fd);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_mmap_fixed_mapped=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-fi
-rm -f conftest.mmap
-
-
-
-
-for ac_func in select socket strerror
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-LD=ld
-DFLAGS=""
-
-if test `uname -s` = Linux;
-then
- LFLAGS="-export_dynamic -shared"
- EXT=pd_linux
- STRIPFLAGS="--strip-unneeded"
-fi
-
-if test `uname -s` = Darwin;
-then
- LD=cc
- LFLAGS="-bundle -undefined suppress -flat_namespace"
- EXT=pd_darwin
- STRIPFLAGS=
- if test "$enable_lpt" = "yes"; then
- { { echo "$as_me:$LINENO: error: \"lpt not supported on this platform\"" >&5
-echo "$as_me: error: \"lpt not supported on this platform\"" >&2;}
- { (exit 1); exit 1; }; };
- fi
- if test "$enable_lpt" = ""; then
- { echo "$as_me:$LINENO: WARNING: \"lpt not supported on this platform - disabling\"" >&5
-echo "$as_me: WARNING: \"lpt not supported on this platform - disabling\"" >&2;};
- enable_lpt="no";
- fi
-fi
-if test `uname | sed -e 's/^MINGW.*/NT/'` = NT;
-then
- LD=gcc
- INCLUDES="-I@prefix@/src"
- DFLAGS="-DMSW -DNT"
- LFLAGS="-shared @prefix@/bin/pd.dll"
- EXT=dll
-else
- PDLIBDIR="/lib/pd"
- LIBS="-lc -lm"
-fi
-if test `uname -s` = IRIX64;
-then
- LFLAGS="-n32 -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -shared -rdata_shared"
- EXT=pd_irix6
- STRIPFLAGS="--strip-unneeded"
- if test "$enable_lpt" = "yes"; then
- { { echo "$as_me:$LINENO: error: \"lpt not supported on this platform\"" >&5
-echo "$as_me: error: \"lpt not supported on this platform\"" >&2;}
- { (exit 1); exit 1; }; };
- fi
- if test "$enable_lpt" = ""; then
- { echo "$as_me:$LINENO: WARNING: \"lpt not supported on this platform - disabling\"" >&5
-echo "$as_me: WARNING: \"lpt not supported on this platform - disabling\"" >&2;};
- enable_lpt="no";
- fi
-fi
-
-if test `uname -s` = IRIX32;
-then
- LFLAGS="-o32 -DUNIX -DIRIX -O2
- -shared -rdata_shared"
- EXT=pd_irix5
- STRIPFLAGS="--strip-unneeded"
- if test "$enable_lpt" = "yes"; then
- { { echo "$as_me:$LINENO: error: \"lpt not supported on this platform\"" >&5
-echo "$as_me: error: \"lpt not supported on this platform\"" >&2;}
- { (exit 1); exit 1; }; };
- fi
- if test "$enable_lpt" = ""; then
- { echo "$as_me:$LINENO: WARNING: \"lpt not supported on this platform - disabling\"" >&5
-echo "$as_me: WARNING: \"lpt not supported on this platform - disabling\"" >&2;};
- enable_lpt="no";
- fi
-fi
-
-echo "$as_me:$LINENO: checking \"pd\>=0.37\"" >&5
-echo $ECHO_N "checking \"pd\>=0.37\"... $ECHO_C" >&6
-
-if test "$with_pdversion" != ""
-then
-echo -n "($with_pdversion)... "
- PD_VERSION="$with_pdversion"
-else
-cat > conftest.c << EOF
-#include <stdio.h>
-#include "m_pd.h"
-int main(){
- printf("%d.%d\n", PD_MAJOR_VERSION, PD_MINOR_VERSION);
- return 0;
-}
-EOF
- if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1
- then
- PD_VERSION=`./conftest.o`
- else
- PD_VERSION=""
- fi
-fi
-
-let PD_MAJORVERSION=`echo $PD_VERSION | cut -d"." -f1`+0
-let PD_MINORVERSION=`echo $PD_VERSION | cut -d"." -f2`+0
-
-if test "$PD_MAJORVERSION" -gt 0 || test "$PD_MINORVERSION" -ge 37
-then
- REFERENCEPATH=extra/help-
- echo "yes"
-else
- REFERENCEPATH=doc/5.reference/
- echo "no"
-fi
-
-echo "$as_me:$LINENO: checking \"zexy-version\"" >&5
-echo $ECHO_N "checking \"zexy-version\"... $ECHO_C" >&6
-cat > conftest.c << EOF
-#include <stdio.h>
-#include "zexy.h"
-int main(){
- printf("%s\n", VERSION);
- return 0;
-}
-EOF
-
-if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1
-then
- ZEXY_VERSION=`./conftest.o`
- echo "$ZEXY_VERSION"
-else
- ZEXY_VERSION=""
- echo "(unknown)"
-fi
-
-
-echo "$as_me:$LINENO: checking \"parallel-port\"" >&5
-echo $ECHO_N "checking \"parallel-port\"... $ECHO_C" >&6
-if test "$enable_lpt" != "no"
-then
- if test "$enable_lpt" = "yes"
- then
- DFLAGS="$DFLAGS -DZ_WANT_LPT"
- echo "yes (forced)"
- else
-cat > conftest.c << EOF
-# include <sys/io.h>
-int main(){
- ioperm(0x3bc, 8, 1);
- outb(0, 0x3bc);
- ioperm(0x3bc, 8, 0);
- return 0;
-}
-EOF
-
- if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1
- then
- DFLAGS="$DFLAGS -DZ_WANT_LPT"
- echo "yes"
- else
- echo "no"
- fi
- fi
-else
- echo "no (ignored)"
-fi
-
-echo "SOURCES = \\"> make.source
-for i in `ls z_*.c zexy.c`
-do
- echo " $i\\">> make.source
-done
-echo >> make.source
-
- ac_config_files="$ac_config_files makefile"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@STK@,$STK,;t t
-s,@DFLAGS@,$DFLAGS,;t t
-s,@LFLAGS@,$LFLAGS,;t t
-s,@EXT@,$EXT,;t t
-s,@LD@,$LD,;t t
-s,@STRIPFLAGS@,$STRIPFLAGS,;t t
-s,@ZEXY_VERSION@,$ZEXY_VERSION,;t t
-s,@REFERENCEPATH@,$REFERENCEPATH,;t t
-s,@PDLIBDIR@,$PDLIBDIR,;t t
-s,@INCLUDES@,$INCLUDES,;t t
-s,@SOURCES@,$SOURCES,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-
-rm -f conftest.*
diff --git a/src/configure.in b/src/configure.in
index a2cbd49..1216d3f 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -214,13 +214,14 @@ else
echo "no (ignored)"
fi
-echo "SOURCES = \\"> make.source
-for i in `ls z_*.c zexy.c`
+echo "SOURCES = \\"> Make.source
+for i in `ls *.c`
do
- echo " $i\\">> make.source
+ echo " $i\\">> Make.source
done
-echo >> make.source
+echo >> Make.source
-AC_OUTPUT(makefile)
+AC_OUTPUT(Makefile)
-rm -f conftest.* \ No newline at end of file
+rm -f conftest.*
+./makesource.sh
diff --git a/src/z_datetime.c b/src/date.c
index 8f95fe1..bd513ac 100644
--- a/src/z_datetime.c
+++ b/src/date.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
(c) 1202:forum::für::umläute:2000
1506:forum::für::umläute:2003: use timeb only if needed (like on windoze)
@@ -8,102 +24,24 @@
*/
#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#define USE_TIMEB
+# define USE_TIMEB
#endif
#ifdef MACOSX
-#include <sys/types.h>
+# include <sys/types.h>
/* typedef _BSD_TIME_T_ time_t; */
#endif
#include "zexy.h"
#include <time.h>
-#ifdef USE_TIMEB
-#include <sys/timeb.h>
-#else
-#include <sys/time.h>
-#endif
-
-
-/* ----------------------- time --------------------- */
-
-static t_class *time_class;
-
-typedef struct _time
-{
- t_object x_obj;
-
- int GMT;
-
- t_outlet *x_outlet1;
- t_outlet *x_outlet2;
- t_outlet *x_outlet3;
- t_outlet *x_outlet4;
-} t_time;
-
-static void *time_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_time *x = (t_time *)pd_new(time_class);
- char buf[5];
-
- x->GMT=0;
- if (argc) {
- atom_string(argv, buf, 5);
- if (buf[0]=='G' && buf[1]=='M' && buf[2]=='T')
- x->GMT = 1;
- }
-
- x->x_outlet1 = outlet_new(&x->x_obj, &s_float);
- x->x_outlet2 = outlet_new(&x->x_obj, &s_float);
- x->x_outlet3 = outlet_new(&x->x_obj, &s_float);
- x->x_outlet4 = outlet_new(&x->x_obj, &s_float);
-
- return (x);
-}
-static void time_bang(t_time *x)
-{
- struct tm *resolvetime;
- float ms = 0.f;
#ifdef USE_TIMEB
- struct timeb mytime;
- ftime(&mytime);
- resolvetime = (x->GMT)?gmtime(&mytime.time):localtime(&mytime.time);
- ms=mytime.millitm;
+# include <sys/timeb.h>
#else
- struct timeval tv;
- gettimeofday(&tv, 0);
- resolvetime = (x->GMT)?gmtime(&tv.tv_sec):localtime(&tv.tv_sec);
- ms = tv.tv_usec*0.001;
+# include <sys/time.h>
#endif
- // outlet_float(x->x_outlet4, (t_float)(mytime.millitm));
- outlet_float(x->x_outlet4, (t_float)(ms));
- outlet_float(x->x_outlet3, (t_float)resolvetime->tm_sec);
- outlet_float(x->x_outlet2, (t_float)resolvetime->tm_min);
- outlet_float(x->x_outlet1, (t_float)resolvetime->tm_hour);
-}
-
-static void help_time(t_time *x)
-{
- post("\n%c time\t\t:: get the current system time", HEARTSYMBOL);
- post("\noutputs are\t: hour / minute / sec / msec");
- post("\ncreation\t:: 'time [GMT]': show local time or GMT");
-}
-void time_setup(void)
-{
- time_class = class_new(gensym("time"),
- (t_newmethod)time_new, 0,
- sizeof(t_time), 0, A_GIMME, 0);
-
- class_addbang(time_class, time_bang);
-
- class_addmethod(time_class, (t_method)help_time, gensym("help"), 0);
- class_sethelpsymbol(time_class, gensym("zexy/time"));
-}
/* ----------------------- date --------------------- */
@@ -182,14 +120,5 @@ void date_setup(void)
class_addmethod(date_class, (t_method)help_date, gensym("help"), 0);
class_sethelpsymbol(date_class, gensym("zexy/date"));
-}
-
-
-/* general setup */
-
-
-void z_datetime_setup(void)
-{
- time_setup();
- date_setup();
+ zexy_register("date");
}
diff --git a/src/z_multiplex.c b/src/demultiplex.c
index 2c1ec19..ff26b5d 100644
--- a/src/z_multiplex.c
+++ b/src/demultiplex.c
@@ -1,9 +1,26 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/* 1509:forum::für::umläute:2000 */
/*
demux : multiplex the input to a specified output
-to do:: mux : demultiplex a specified input to the output
+
+ TODO:: mux : demultiplex a specified input to the output
*/
#include "zexy.h"
@@ -82,7 +99,7 @@ static void *demux_new(t_symbol *s, int argc, t_atom *argv)
return (x);
}
-static void demux_setup(void)
+void demultiplex_setup(void)
{
demux_class = class_new(gensym("demultiplex"), (t_newmethod)demux_new,
0, sizeof(t_demux), 0, A_GIMME, 0);
@@ -94,78 +111,5 @@ static void demux_setup(void)
class_addmethod (demux_class, (t_method)demux_select, gensym("select"), A_DEFFLOAT, 0);
class_sethelpsymbol(demux_class, gensym("zexy/demultiplex"));
-}
-
-
-#ifdef MUX
-/* ------------------------- mux ------------------------------- */
-
-/*
- a multiplexer
-*/
-
-static t_class *mux_class;
-
-typedef struct _mux
-{
- t_object x_obj;
-
- int n_in;
- t_inlet **in, *selected;
-} t_mux;
-
-static void mux_select(t_mux *x, t_float f)
-{
- int n = ( (f<0) || (f>x->n_in) ) ? 0 : f;
-}
-
-static void mux_incoming(t_mux *x, t_symbol *s, int argc, t_atom *argv)
-{
- error("symbol @ %x", s);
-}
-
-static void *mux_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_mux *x = (t_mux *)pd_new(mux_class);
-
- int n = (argc < 2)?2:argc;
-
- x->n_in = n;
- x->in = (t_inlet **)getbytes(x->n_in * sizeof(t_inlet *));
-
- for (n = 0; n<x->n_in; n++) {
- char name[8];
- int i = 8;
-
- while (i--) name[i]=0;
-
- sprintf(name, "inlet%d", n);
-
- x->in[n] = inlet_new (&x->x_obj, &x->x_obj.ob_pd, &s_list, gensym(name));
- class_addmethod (mux_class, (t_method)mux_incoming, gensym(name), A_GIMME, 0);
- }
-
-
- outlet_new(&x->x_obj, 0);
- return (x);
-}
-
-static void mux_setup(void)
-{
- mux_class = class_new(gensym("multiplex"), (t_newmethod)mux_new,
- 0, sizeof(t_mux), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)mux_new, gensym("mux"), A_GIMME, 0);
-
- class_addfloat (mux_class, (t_method)mux_select);
-
- class_sethelpsymbol(mux_class, gensym("zexy/multiplex"));
-}
-#endif
-
-void z_multiplex_setup(void)
-{
- demux_setup();
-#ifdef MUX
- mux_setup();
-#endif
+ zexy_register("demultiplex");
}
diff --git a/src/demultiplex_tilde.c b/src/demultiplex_tilde.c
new file mode 100644
index 0000000..4d78583
--- /dev/null
+++ b/src/demultiplex_tilde.c
@@ -0,0 +1,119 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+
+/* ------------------------------------------------------------------------------ */
+
+/* demux~ : demultiplex a signal to a specified output */
+
+static t_class *demux_class;
+
+typedef struct _demux {
+ t_object x_obj;
+
+ int output;
+
+ int n_out;
+ t_float **out;
+
+} t_demux;
+
+static void demux_output(t_demux *x, t_floatarg f)
+{
+ if ((f>=0)&&(f<x->n_out)){
+ x->output=f;
+ } else
+ error("demultiplex: %d is channel out of range (0..%d)", (int)f, x->n_out);
+}
+
+
+static t_int *demux_perform(t_int *w)
+{
+ t_demux *x = (t_demux *)(w[1]);
+ t_float *in = (t_float *)(w[2]);
+ int N = (int)(w[3]);
+ int n = N;
+
+
+ int channel=x->n_out;
+
+
+ while(channel--){
+ t_float*out=x->out[channel];
+ n=N;
+ if(x->output==channel){
+ while(n--)*out++=*in++;
+ } else
+ while(n--)*out++=0.f;
+ }
+ return (w+4);
+}
+
+static void demux_dsp(t_demux *x, t_signal **sp)
+{
+ int n = x->n_out;
+ t_float **dummy=x->out;
+ while(n--)*dummy++=sp[x->n_out-n]->s_vec;
+ dsp_add(demux_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
+}
+
+
+static void demux_helper(void)
+{
+ post("\n%c demux~\t:: demultiplex a signal to one of various outlets", HEARTSYMBOL);
+ post("<#out>\t : the outlet-number (counting from 0) to witch the inlet is routed"
+ "'help'\t : view this");
+ post("creation : \"demux~ [arg1 [arg2...]]\"\t: the number of arguments equals the number of outlets\n");
+}
+
+static void demux_free(t_demux *x)
+{
+ freebytes(x->out, x->n_out * sizeof(t_float *));
+}
+
+static void *demux_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_demux *x = (t_demux *)pd_new(demux_class);
+ int i;
+
+ if (!argc)argc=2;
+ x->n_out=argc;
+ x->output=0;
+
+ while(argc--)outlet_new(&x->x_obj, gensym("signal"));
+
+ x->out = (t_float **)getbytes(x->n_out * sizeof(t_float *));
+ i=x->n_out;
+ while(i--)x->out[i]=0;
+
+ return (x);
+}
+
+void demultiplex_tilde_setup(void)
+{
+ demux_class = class_new(gensym("demultiplex~"), (t_newmethod)demux_new, (t_method)demux_free, sizeof(t_demux), 0, A_GIMME, 0);
+ class_addcreator((t_newmethod)demux_new, gensym("demux~"), A_GIMME, 0);
+
+ class_addfloat(demux_class, demux_output);
+ class_addmethod(demux_class, (t_method)demux_dsp, gensym("dsp"), 0);
+ class_addmethod(demux_class, nullfn, gensym("signal"), 0);
+
+ class_addmethod(demux_class, (t_method)demux_helper, gensym("help"), 0);
+ class_sethelpsymbol(demux_class, gensym("zexy/demultiplex~"));
+
+ zexy_register("demultiplex~");
+}
diff --git a/src/z_dfreq.c b/src/dfreq_tilde.c
index e5074a5..7be3d01 100644
--- a/src/z_dfreq.c
+++ b/src/dfreq_tilde.c
@@ -1,12 +1,23 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
#include <stdio.h>
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
/* ------------------------ dspobj~ ----------------------------- */
/* datendefinition */
@@ -88,7 +99,7 @@ static void helper(void)
}
-void z_dfreq_setup(void)
+void dfreq_tilde_setup(void)
{
dfreq_class = class_new(gensym("dfreq~"), (t_newmethod)dfreq_new, 0,
sizeof(t_dfreq), 0, A_DEFFLOAT, 0);
@@ -97,5 +108,5 @@ void z_dfreq_setup(void)
class_addmethod(dfreq_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(dfreq_class, gensym("zexy/dfreq~"));
+ zexy_register("dfreq~");
}
-
diff --git a/src/dirac_tilde.c b/src/dirac_tilde.c
new file mode 100644
index 0000000..72cc4d3
--- /dev/null
+++ b/src/dirac_tilde.c
@@ -0,0 +1,113 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+/*
+This external makes the two main test-functions available :
+dirac~ : will make a single peak (eg: a 1 in all the 0s) at a desired position in the signal-vector
+ the position can be passed as an argument when creating the object
+step~ : will make a unity step at a desired point in the signal-vector; the second input specifies a
+ length: after the so-specified time has elapsed, the step will toggle back to the previous
+ value;
+ the length can be passed as an argument when creating the object
+ with length==1 you might do the dirac~ thing a little bit more complicated
+ with length==0 the output just toggles between 0 and 1 every time you bang the object
+
+NOTE : the inlets do NOT specify any times but sample-NUMBERS; there are 64 samples in a signal-vector,
+ each "lasting" for 1/44100 secs.
+*/
+
+#include "zexy.h"
+
+/* ------------------------ dirac~ ----------------------------- */
+
+
+static t_class *dirac_class;
+
+typedef struct _dirac
+{
+ t_object x_obj;
+ t_float position;
+ t_float do_it;
+} t_dirac;
+
+static void dirac_bang(t_dirac *x)
+{
+ x->do_it = x->position;
+}
+
+static void dirac_float(t_dirac *x, t_float where)
+{
+ x->do_it = x->position = where;
+}
+
+static t_int *dirac_perform(t_int *w)
+{
+ t_dirac *x = (t_dirac *)(w[1]);
+ t_float *out = (t_float *)(w[2]);
+ int n = (int)(w[3]);
+
+ int do_it = x->do_it;
+
+ while (n--)
+ {
+ *out++ = (!do_it--);
+ }
+ x->do_it = do_it;
+
+ return (w+4);
+}
+
+static void dirac_dsp(t_dirac *x, t_signal **sp)
+{
+ dsp_add(dirac_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
+}
+
+static void dirac_helper(void)
+{
+ post("%c dirac~-object :: generates a dirac (unity-pulse)", HEARTSYMBOL);
+ post("creation : \"dirac~ [<position>]\" : create a dirac at specified position (in samples)\n"
+ "inlet\t: <position>\t: create a dirac at new position\n"
+ "\t 'bang'\t: create a dirac at specified position\n"
+ "\t 'help'\t: view this\n"
+ "outlet\t: signal~");
+}
+
+
+
+static void *dirac_new(t_floatarg where)
+{
+ t_dirac *x = (t_dirac *)pd_new(dirac_class);
+
+ outlet_new(&x->x_obj, gensym("signal"));
+
+ x->do_it = 0;
+ x->position = where;
+ return (x);
+}
+
+void dirac_tilde_setup(void)
+{
+ dirac_class = class_new(gensym("dirac~"), (t_newmethod)dirac_new, 0,
+ sizeof(t_dirac), 0, A_DEFFLOAT, 0);
+ class_addfloat(dirac_class, dirac_float);
+ class_addbang(dirac_class, dirac_bang);
+ class_addmethod(dirac_class, (t_method)dirac_dsp, gensym("dsp"), 0);
+
+ class_addmethod(dirac_class, (t_method)dirac_helper, gensym("help"), 0);
+ class_sethelpsymbol(dirac_class, gensym("zexy/dirac~"));
+ zexy_register("dirac~");
+}
diff --git a/src/dot.c b/src/dot.c
new file mode 100644
index 0000000..df0ec5c
--- /dev/null
+++ b/src/dot.c
@@ -0,0 +1,162 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* 2305:forum::für::umläute:2001 */
+
+/*skalar multiplikation */
+
+
+#include "zexy.h"
+
+static t_class *scalmul_class;
+static t_class *scalmul_scal_class;
+
+typedef struct _scalmul
+{
+ t_object x_obj;
+
+ t_int n1, n2;
+
+ t_float *buf1, *buf2;
+
+ t_float f;
+} t_scalmul;
+
+
+static void scalmul_lst2(t_scalmul *x, t_symbol *s, int argc, t_atom *argv)
+{
+ t_float *fp;
+ if (x->n2 != argc) {
+ freebytes(x->buf2, x->n2 * sizeof(t_float));
+ x->n2 = argc;
+ x->buf2=(t_float *)getbytes(sizeof(t_float)*x->n2);
+ };
+ fp = x->buf2;
+ while(argc--)*fp++=atom_getfloat(argv++);
+}
+
+static void scalmul_lst(t_scalmul *x, t_symbol *s, int argc, t_atom *argv)
+{
+ t_float *fp;
+ t_atom *ap;
+ int n;
+
+ if (argc){
+ if (x->n1 != argc) {
+ freebytes(x->buf1, x->n1 * sizeof(t_float));
+ x->n1 = argc;
+ x->buf1=(t_float *)getbytes(sizeof(t_float)*x->n1);
+ };
+ fp = x->buf1;
+ while(argc--)*fp++=atom_getfloat(argv++);
+ }
+
+ if (x->n1*x->n2==1){
+ outlet_float(x->x_obj.ob_outlet, *x->buf1**x->buf2);
+ return;
+ }
+ if (x->n1==1){
+ t_atom *a;
+ int i = x->n2;
+ t_float f = *x->buf1;
+ fp = x->buf2;
+ n = x->n2;
+ ap = (t_atom *)getbytes(sizeof(t_atom)*n);
+ a = ap;
+ while(i--){
+ SETFLOAT(a, *fp++*f);
+ a++;
+ }
+ } else if (x->n2==1){
+ t_float f = *x->buf2;
+ t_atom *a;
+ int i = x->n1;
+ n = x->n1;
+ ap = (t_atom *)getbytes(sizeof(t_atom)*n);
+ a = ap;
+ fp = x->buf1;
+ while(i--){
+ SETFLOAT(a, *fp++*f);
+ a++;
+ }
+ } else {
+ t_atom *a;
+ int i;
+ t_float *fp2=x->buf2;
+ fp = x->buf1;
+ n = x->n1;
+ if (x->n1!=x->n2){
+ post("scalar multiplication: truncating vectors to the same length");
+ if (x->n2<x->n1)n=x->n2;
+ }
+ ap = (t_atom *)getbytes(sizeof(t_atom)*n);
+ a = ap;
+ i=n;
+ while(i--){
+ SETFLOAT(a, *fp++**fp2++);
+ a++;
+ }
+ }
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), n, ap);
+ freebytes(ap, sizeof(t_atom)*n);
+}
+static void scalmul_free(t_scalmul *x)
+{
+ freebytes(x->buf1, sizeof(t_float)*x->n1);
+ freebytes(x->buf2, sizeof(t_float)*x->n2);
+}
+
+static void *scalmul_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_scalmul *x;
+
+ if (argc-1){
+ x = (t_scalmul *)pd_new(scalmul_class);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym(""));
+ } else x = (t_scalmul *)pd_new(scalmul_scal_class);
+
+ outlet_new(&x->x_obj, 0);
+
+ x->n1 =1;
+ x->buf1 =(t_float*)getbytes(sizeof(t_float));
+ *x->buf1=0;
+
+ if (argc)scalmul_lst2(x, gensym("list"), argc, argv);
+ else {
+ x->n2 =1;
+ x->buf2 =(t_float*)getbytes(sizeof(t_float));
+ *x->buf2=0;
+ }
+
+ if (argc==1)floatinlet_new(&x->x_obj, x->buf2);
+
+ return (x);
+}
+
+void dot_setup(void)
+{
+ scalmul_class = class_new(gensym("."), (t_newmethod)scalmul_new,
+ (t_method)scalmul_free, sizeof(t_scalmul), 0, A_GIMME, 0);
+ class_addlist(scalmul_class, scalmul_lst);
+ class_addmethod (scalmul_class, (t_method)scalmul_lst2, gensym(""), A_GIMME, 0);
+ scalmul_scal_class = class_new(gensym("."), 0, (t_method)scalmul_free,
+ sizeof(t_scalmul), 0, 0);
+ class_addlist(scalmul_scal_class, scalmul_lst);
+
+ class_sethelpsymbol(scalmul_class, gensym("zexy/scalarmult"));
+ class_sethelpsymbol(scalmul_scal_class, gensym("zexy/scalarmult"));
+ zexy_register(".");
+}
diff --git a/src/z_drip.c b/src/drip.c
index 939d547..2679588 100644
--- a/src/z_drip.c
+++ b/src/drip.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/* 3009:forum::für::umläute:2000 */
/* -------------------- drip ------------------------------ */
@@ -170,7 +186,7 @@ static void *drip_new(t_symbol *s, int argc, t_atom *argv)
return (x);
}
-void z_drip_setup(void)
+void drip_setup(void)
{
drip_class = class_new(gensym("drip"), (t_newmethod)drip_new,
(t_method)drip_free, sizeof(t_drip), 0 ,A_GIMME, 0);
@@ -182,4 +198,5 @@ void z_drip_setup(void)
class_addlist (drip_class, drip_list);
class_addanything(drip_class, drip_anything);
class_sethelpsymbol(drip_class, gensym("zexy/drip"));
+ zexy_register("drip");
}
diff --git a/src/z_sigaverage.c b/src/envrms_tilde.c
index 3e3e261..e9dc302 100644
--- a/src/z_sigaverage.c
+++ b/src/envrms_tilde.c
@@ -1,20 +1,26 @@
-#include "zexy.h"
-#include <math.h>
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#define sqrtf sqrt
-#endif
-
-#ifdef MACOSX
-#define sqrtf sqrt
-#endif
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
/* ---------------- envrms~ - simple envelope follower. ----------------- */
/* this is exactly the same as msp's env~-object, but does not output dB but RMS !! */
/* i found env~+dbtorms most inconvenient (and expensive...) */
+#include "zexy.h"
+#include <math.h>
+
#define MAXOVERLAP 10
#define MAXVSTAKEN 64
@@ -131,7 +137,7 @@ static void sigenvrms_help(void)
}
-void sigenvrms_setup(void )
+void envrms_tilde_setup(void)
{
sigenvrms_class = class_new(gensym("envrms~"), (t_newmethod)sigenvrms_new,
(t_method)sigenvrms_ff, sizeof(t_sigenvrms), 0, A_DEFFLOAT, A_DEFFLOAT, 0);
@@ -140,152 +146,5 @@ void sigenvrms_setup(void )
class_addmethod(sigenvrms_class, (t_method)sigenvrms_help, gensym("help"), 0);
class_sethelpsymbol(sigenvrms_class, gensym("zexy/envrms~"));
-}
-
-/* ------------------------ average~ ----------------------------- */
-
-/* tilde object to take absolute value. */
-
-static t_class *avg_class;
-
-typedef struct _avg
-{
- t_object x_obj;
-
- t_float n_inv;
- t_float buf;
- int blocks;
-} t_avg;
-
-
-/* average :: arithmetic mean of one signal-vector */
-
-static t_int *avg_perform(t_int *w)
-{
- t_float *in = (t_float *)(w[1]);
-
- t_avg *x = (t_avg *)w[2];
- int n = (int)(w[3]);
-
- t_float buf = 0.;
-
- while (n--)
- {
- buf += *in++;
- }
- outlet_float(x->x_obj.ob_outlet, buf*x->n_inv);
-
- return (w+4);
-}
-
-static void avg_dsp(t_avg *x, t_signal **sp)
-{
- x->n_inv=1./sp[0]->s_n;
- dsp_add(avg_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
-}
-
-static void *avg_new(void)
-{
- t_avg *x = (t_avg *)pd_new(avg_class);
- outlet_new(&x->x_obj, gensym("float"));
- return (x);
-}
-
-static void avg_help(void)
-{
- post("avg~\t:: outputs the arithmetic mean of each signal-vector");
-}
-
-
-void avg_setup(void)
-{
- avg_class = class_new(gensym("avg~"), (t_newmethod)avg_new, 0,
- sizeof(t_avg), 0, A_DEFFLOAT, 0);
- class_addmethod(avg_class, nullfn, gensym("signal"), 0);
- class_addmethod(avg_class, (t_method)avg_dsp, gensym("dsp"), 0);
-
- class_addmethod(avg_class, (t_method)avg_help, gensym("help"), 0);
- class_sethelpsymbol(avg_class, gensym("zexy/avg~"));
-}
-
-
-/* triggered average :: arithmetic mean between last and current BANG */
-
-static t_class *tavg_class;
-
-typedef struct _tavg
-{
- t_object x_obj;
-
- t_float n_inv;
- t_float buf;
- int blocks;
-} t_tavg;
-
-
-
-static void tavg_bang(t_avg *x)
-{
- if (x->blocks) {
- outlet_float(x->x_obj.ob_outlet, x->buf*x->n_inv/x->blocks);
- x->blocks = 0;
- x->buf = 0.;
- }
-}
-
-static t_int *tavg_perform(t_int *w)
-{
- t_float *in = (t_float *)(w[1]);
- t_tavg *x = (t_tavg *)w[2];
- int n = (int)(w[3]);
-
- t_float buf = x->buf;
-
- while (n--) buf += *in++;
-
- x->buf = buf;
- x->blocks++;
-
- return (w+4);
-}
-
-static void tavg_dsp(t_tavg *x, t_signal **sp)
-{
- x->n_inv=1./sp[0]->s_n;
- dsp_add(tavg_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
-}
-
-static void *tavg_new(void)
-{
- t_tavg *x = (t_tavg *)pd_new(tavg_class);
- outlet_new(&x->x_obj, gensym("float"));
- return (x);
-}
-
-static void tavg_help(void)
-{
- post("tavg~\t\t:: outputs the arithmetic mean of a signal when triggered");
- post("<bang>\t\t: triggers the output");
-}
-
-void tavg_setup(void)
-{
- tavg_class = class_new(gensym("tavg~"), (t_newmethod)tavg_new, 0,
- sizeof(t_tavg), 0, A_DEFFLOAT, 0);
- class_addmethod(tavg_class, nullfn, gensym("signal"), 0);
- class_addmethod(tavg_class, (t_method)tavg_dsp, gensym("dsp"), 0);
-
- class_addbang(tavg_class, tavg_bang);
-
- class_addmethod(tavg_class, (t_method)tavg_help, gensym("help"), 0);
- class_sethelpsymbol(tavg_class, gensym("zexy/tavg~"));
-}
-
-/* global setup routine */
-
-void z_sigaverage_setup(void)
-{
- avg_setup();
- tavg_setup();
- sigenvrms_setup();
+ zexy_register("envrms~");
}
diff --git a/src/glue.c b/src/glue.c
new file mode 100644
index 0000000..de9a88a
--- /dev/null
+++ b/src/glue.c
@@ -0,0 +1,114 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+#include "zexy.h"
+#include <string.h>
+
+
+/* ------------------------- glue ------------------------------- */
+
+/* glue 2 lists together (append) */
+
+static t_class *glue_class;
+
+typedef struct _glue
+{
+ t_object x_obj;
+
+ t_atom *ap2, *ap;
+ t_int n1, n2, n;
+
+ t_int changed;
+} t_glue;
+
+static void glue_lst2(t_glue *x, t_symbol *s, int argc, t_atom *argv)
+{
+ x->changed = 1;
+ if (x->n2 != argc) {
+ freebytes(x->ap2, x->n2 * sizeof(t_atom));
+ x->n2 = argc;
+ x->ap2 = copybytes(argv, argc * sizeof(t_atom));
+ } else memcpy(x->ap2, argv, argc * sizeof(t_atom));
+}
+
+static void glue_lst(t_glue *x, t_symbol *s, int argc, t_atom *argv)
+{
+ if (x->n != x->n2+argc) {
+ freebytes(x->ap, x->n * sizeof(t_atom));
+ x->n1 = argc;
+ x->n = x->n1+x->n2;
+ x->ap = (t_atom *)getbytes(sizeof(t_atom)*x->n);
+ memcpy(x->ap+argc, x->ap2, x->n2*sizeof(t_atom));
+ } else if ((x->n1 != argc)||x->changed)memcpy(x->ap+argc, x->ap2, x->n2*sizeof(t_atom));
+
+ x->n1 = argc;
+ memcpy(x->ap, argv, x->n1*sizeof(t_atom));
+
+ x->changed=0;
+
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->n, x->ap);
+}
+
+static void glue_bang(t_glue *x)
+{
+ if (x->changed) {
+ if (x->n1+x->n2 != x->n){
+ t_atom *ap = (t_atom*)getbytes(sizeof(t_atom)*(x->n1+x->n2));
+ memcpy(ap, x->ap, x->n1*sizeof(t_atom));
+ freebytes(x->ap, sizeof(t_atom)*x->n);
+ x->ap=ap;
+ x->n=x->n1+x->n2;
+ }
+ memcpy(x->ap+x->n1, x->ap2, x->n2*sizeof(t_atom));
+ x->changed=0;
+ }
+
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->n, x->ap);
+}
+
+static void glue_free(t_glue *x)
+{
+ freebytes(x->ap, sizeof(t_atom)*x->n);
+ freebytes(x->ap2, sizeof(t_atom)*x->n2);
+}
+
+static void *glue_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_glue *x = (t_glue *)pd_new(glue_class);
+
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym(""));
+ outlet_new(&x->x_obj, 0);
+ x->n =x->n2 = 0;
+ x->ap=x->ap2 = 0;
+ x->changed = 0;
+
+ if (argc)glue_lst2(x, gensym("list"), argc, argv);
+
+ return (x);
+}
+
+void glue_setup(void)
+{
+ glue_class = class_new(gensym("glue"), (t_newmethod)glue_new,
+ (t_method)glue_free, sizeof(t_glue), 0, A_GIMME, 0);
+ class_addlist(glue_class, glue_lst);
+ class_addmethod (glue_class, (t_method)glue_lst2, gensym(""), A_GIMME, 0);
+ class_addbang(glue_class, glue_bang);
+
+ class_sethelpsymbol(glue_class, gensym("zexy/glue"));
+ zexy_register("glue");
+}
diff --git a/src/z_index.c b/src/index.c
index cee5b61..2f59f8e 100644
--- a/src/z_index.c
+++ b/src/index.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
(c) 2005:forum::für::umläute:2000
@@ -188,7 +204,7 @@ static void helper(t_index *x)
post("\ncreation:\"index [<maxelements> [<auto>]]\": creates a <maxelements> sized index");
}
-void z_index_setup(void)
+void index_setup(void)
{
index_class = class_new(gensym("index"),
(t_newmethod)index_new, (t_method)index_free,
@@ -206,4 +222,5 @@ void z_index_setup(void)
class_addmethod(index_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(index_class, gensym("zexy/index"));
+ zexy_register("index");
}
diff --git a/src/length.c b/src/length.c
new file mode 100644
index 0000000..9ed19e1
--- /dev/null
+++ b/src/length.c
@@ -0,0 +1,61 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ ******************************************************/
+
+/* length :: get the length of a list */
+
+
+#include "zexy.h"
+#include <math.h>
+
+#ifdef MACOSX
+#define sqrtf sqrt
+#endif
+
+
+static t_class *length_class;
+
+typedef struct _length
+{
+ t_object x_obj;
+} t_length;
+
+static void length_list(t_length *x, t_symbol *s, int argc, t_atom *argv)
+{
+ outlet_float(x->x_obj.ob_outlet, (t_float)argc);
+}
+static void length_any(t_length *x, t_symbol *s, int argc, t_atom *argv)
+{
+ outlet_float(x->x_obj.ob_outlet, (t_float)argc+1);
+}
+
+static void *length_new(void)
+{
+ t_length *x = (t_length *)pd_new(length_class);
+ outlet_new(&x->x_obj, gensym("float"));
+ return (x);
+}
+
+void length_setup(void)
+{
+ length_class = class_new(gensym("length"), (t_newmethod)length_new, 0,
+ sizeof(t_length), 0, A_DEFFLOAT, 0);
+
+ class_addlist(length_class, (t_method)length_list);
+ class_addanything(length_class, (t_method)length_any);
+ // class_addbang(length_class, (t_method)length_bang);
+
+ class_sethelpsymbol(length_class, gensym("zexy/length"));
+ zexy_register("length");
+}
diff --git a/src/z_limiter.c b/src/limiter_tilde.c
index 9f18efe..fbe6e69 100644
--- a/src/z_limiter.c
+++ b/src/limiter_tilde.c
@@ -1,3 +1,20 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
/*
--------------------------------- limiter/compressor ---------------------------------
@@ -14,7 +31,7 @@
2108:forum::für::umläute:1999 all rights reserved and no warranties...
- see GNU-license for details (shipped with pd)
+ see GNU-license for details
*/
#define LIMIT0 0
@@ -24,12 +41,6 @@
#include "zexy.h"
#include <math.h>
-#ifdef NT
-#define fabsf fabs
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#define LN2 .69314718056
#define SINC1 .822462987
#define SINC2 .404460777
@@ -164,7 +175,7 @@ static void set_mode(t_limiter *x, float mode)
x->mode = LIMIT0;
break;
}
- post("mode set to %d", x->mode);
+ // post("mode set to %d", x->mode);
}
static void set_LIMIT(t_limiter *x)
@@ -673,7 +684,7 @@ void limiter_free(t_limiter *x)
-void z_limiter_setup(void)
+void limiter_tilde_setup(void)
{
limiter_class = class_new(gensym("limiter~"), (t_newmethod)limiter_new, (t_method)limiter_free,
sizeof(t_limiter), 0, A_GIMME, 0);
@@ -704,4 +715,5 @@ void z_limiter_setup(void)
class_addmethod(limiter_class, (t_method)reset, gensym("reset"), 0);
+ zexy_register("limiter~");
}
diff --git a/src/list2int.c b/src/list2int.c
new file mode 100644
index 0000000..af14812
--- /dev/null
+++ b/src/list2int.c
@@ -0,0 +1,81 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* 2305:forum::für::umläute:2001 */
+
+#include "zexy.h"
+#include <string.h>
+
+
+/* ------------------------- list2int ------------------------------- */
+
+/* cast each float of a list (or anything) to integer */
+
+static t_class *list2int_class;
+
+static void list2int_any(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv)
+{
+ t_atom *ap;
+ if (x->x_n != argc) {
+ freebytes(x->x_list, x->x_n * sizeof(t_atom));
+ x->x_n = argc;
+ x->x_list = copybytes(argv, argc * sizeof(t_atom));
+ } else memcpy(x->x_list, argv, argc * sizeof(t_atom));
+ ap = x->x_list;
+ while(argc--){
+ if(ap->a_type == A_FLOAT)ap->a_w.w_float=(int)ap->a_w.w_float;
+ ap++;
+ }
+ outlet_anything(x->x_obj.ob_outlet, s, x->x_n, x->x_list);
+}
+static void list2int_bang(t_mypdlist *x)
+{ outlet_bang(x->x_obj.ob_outlet);}
+static void list2int_float(t_mypdlist *x, t_float f)
+{ outlet_float(x->x_obj.ob_outlet, (int)f);}
+static void list2int_symbol(t_mypdlist *x, t_symbol *s)
+{ outlet_symbol(x->x_obj.ob_outlet, s);}
+static void list2int_pointer(t_mypdlist *x, t_gpointer *p)
+{ outlet_pointer(x->x_obj.ob_outlet, p);}
+
+static void *list2int_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_mypdlist *x = (t_mypdlist *)pd_new(list2int_class);
+ outlet_new(&x->x_obj, 0);
+ x->x_n = 0;
+ x->x_list = 0;
+ return (x);
+}
+
+
+static void mypdlist_free(t_mypdlist *x)
+{
+ freebytes(x->x_list, x->x_n * sizeof(t_atom));
+}
+
+void list2int_setup(void)
+{
+ list2int_class = class_new(gensym("list2int"), (t_newmethod)list2int_new,
+ (t_method)mypdlist_free, sizeof(t_mypdlist), 0, A_GIMME, 0);
+ class_addcreator((t_newmethod)list2int_new, gensym("l2i"), A_GIMME, 0);
+ class_addanything(list2int_class, list2int_any);
+ class_addlist(list2int_class, list2int_any);
+ class_addbang(list2int_class, list2int_bang);
+ class_addfloat(list2int_class, list2int_float);
+ class_addsymbol(list2int_class, list2int_symbol);
+ class_addpointer(list2int_class, list2int_pointer);
+ class_sethelpsymbol(list2int_class, gensym("zexy/list2int"));
+ zexy_register("list2int");
+}
diff --git a/src/list2symbol.c b/src/list2symbol.c
new file mode 100644
index 0000000..cc40aa7
--- /dev/null
+++ b/src/list2symbol.c
@@ -0,0 +1,141 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * list2symbol: convert a list into a single symbol
+*/
+
+/* ------------------------- list2symbol ------------------------------- */
+
+static t_class *list2symbol_class;
+
+typedef struct _list2symbol
+{
+ t_object x_obj;
+ int ac;
+ t_atom *ap;
+ t_symbol *s,*connector;
+} t_list2symbol;
+
+static void list2symbol_connector(t_list2symbol *x, t_symbol *s){
+ x->connector = s;
+}
+
+static void list2symbol_bang(t_list2symbol *x)
+{
+ t_atom *argv=x->ap;
+ int argc=x->ac;
+ char *result = 0;
+ int length = 0, len=0;
+ int i= argc;
+ char *connector=0;
+ char connlen=0;
+ if(x->connector)connector=x->connector->s_name;
+ if(connector)connlen=strlen(connector);
+
+ /* 1st get the length of the symbol */
+ if(x->s)length+=strlen(x->s->s_name);
+ else length-=connlen;
+
+ length+=i*connlen;
+
+ while(i--){
+ char buffer[MAXPDSTRING];
+ atom_string(argv++, buffer, MAXPDSTRING);
+ length+=strlen(buffer);
+ }
+
+ if (length<0){
+ outlet_symbol(x->x_obj.ob_outlet, gensym(""));
+ return;
+ }
+
+ result = (char*)getbytes((length+1)*sizeof(char));
+
+ /* 2nd create the symbol */
+ if (x->s){
+ char *buf = x->s->s_name;
+ strcpy(result+len, buf);
+ len+=strlen(buf);
+ if(i && connector){
+ strcpy(result+len, connector);
+ len += connlen;
+ }
+ }
+ i=argc;
+ argv=x->ap;
+ while(i--){
+ char buffer[MAXPDSTRING];
+ atom_string(argv++, buffer, MAXPDSTRING);
+ strcpy(result+len, buffer);
+ len += strlen(buffer);
+ if(i && connector){
+ strcpy(result+len, connector);
+ len += connlen;
+ }
+ }
+ result[length]=0;
+ outlet_symbol(x->x_obj.ob_outlet, gensym(result));
+ freebytes(result, (length+1)*sizeof(char));
+}
+
+static void list2symbol_anything(t_list2symbol *x, t_symbol *s, int argc, t_atom *argv)
+{
+ x->s =s;
+ x->ac=argc;
+ x->ap=argv;
+
+ list2symbol_bang(x);
+}
+
+static void list2symbol_list(t_list2symbol *x, t_symbol *s, int argc, t_atom *argv)
+{
+ list2symbol_anything(x, 0, argc, argv);
+}
+static void *list2symbol_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_list2symbol *x = (t_list2symbol *)pd_new(list2symbol_class);
+
+ outlet_new(&x->x_obj, 0);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym(""));
+ x->connector = gensym(" ");
+ list2symbol_anything(x, 0, argc, argv);
+
+ return (x);
+}
+
+static void list2symbol_free(t_list2symbol *x)
+{}
+
+
+void list2symbol_setup(void)
+{
+ list2symbol_class = class_new(gensym("list2symbol"), (t_newmethod)list2symbol_new,
+ (t_method)list2symbol_free, sizeof(t_list2symbol), 0, A_GIMME, 0);
+
+ class_addcreator((t_newmethod)list2symbol_new, gensym("l2s"), A_GIMME, 0);
+ class_addbang (list2symbol_class, list2symbol_bang);
+ class_addlist (list2symbol_class, list2symbol_list);
+ class_addanything(list2symbol_class, list2symbol_anything);
+ class_addmethod (list2symbol_class, (t_method)list2symbol_connector, gensym(""), A_SYMBOL, 0);
+
+ class_sethelpsymbol(list2symbol_class, gensym("zexy/list2symbol"));
+ zexy_register("list2symbol");
+}
diff --git a/src/lister.c b/src/lister.c
new file mode 100644
index 0000000..6e732ad
--- /dev/null
+++ b/src/lister.c
@@ -0,0 +1,84 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* 2305:forum::für::umläute:2001 */
+
+
+#include "zexy.h"
+
+/* ------------------------- list ------------------------------- */
+
+/* this is for packages, what "float" is for floats */
+
+static t_class *mypdlist_class;
+
+static void mypdlist_secondlist(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv)
+{
+ if (argc) {
+ if (x->x_n != argc) {
+ freebytes(x->x_list, x->x_n * sizeof(t_atom));
+ x->x_n = argc;
+ x->x_list = copybytes(argv, argc * sizeof(t_atom));
+ } else memcpy(x->x_list, argv, argc * sizeof(t_atom));
+ }
+}
+
+static void mypdlist_list(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv)
+{
+ if (x->x_n != argc) {
+ freebytes(x->x_list, x->x_n * sizeof(t_atom));
+ x->x_n = argc;
+ x->x_list = copybytes(argv, argc * sizeof(t_atom));
+ } else memcpy(x->x_list, argv, argc * sizeof(t_atom));
+
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->x_n, x->x_list);
+}
+static void mypdlist_bang(t_mypdlist *x)
+{ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->x_n, x->x_list);}
+
+static void mypdlist_free(t_mypdlist *x)
+{ freebytes(x->x_list, x->x_n * sizeof(t_atom)); }
+
+static void *mypdlist_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_mypdlist *x = (t_mypdlist *)pd_new(mypdlist_class);
+
+ outlet_new(&x->x_obj, 0);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2"));
+
+ x->x_n = 0;
+ x->x_list = 0;
+
+ mypdlist_secondlist(x, gensym("list"), argc, argv);
+
+ return (x);
+}
+
+void lister_setup(void)
+{
+ mypdlist_class = class_new(gensym("lister"), (t_newmethod)mypdlist_new,
+ (t_method)mypdlist_free, sizeof(t_mypdlist), 0, A_GIMME, 0);
+ /* i don't know how to get this work with name=="list" !!! */
+
+ class_addcreator((t_newmethod)mypdlist_new, gensym("l"), A_GIMME, 0);
+
+ class_addbang (mypdlist_class, mypdlist_bang);
+ class_addlist (mypdlist_class, mypdlist_list);
+ class_addmethod (mypdlist_class, (t_method)mypdlist_secondlist, gensym("lst2"), A_GIMME, 0);
+
+ class_sethelpsymbol(mypdlist_class, gensym("zexy/lister"));
+ zexy_register("lister");
+}
diff --git a/src/z_lp.c b/src/lpt.c
index bb1cc54..a48ec07 100644
--- a/src/z_lp.c
+++ b/src/lpt.c
@@ -1,27 +1,87 @@
- /*
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/*
(c) 2000:forum::für::umläute:2004
write to the parallel port
extended to write to any port (if we do have permissions)
+
+ thanks to
+ Olaf Matthes: porting to WindozeNT/2000/XP
+ Thomas Musil: adding "control-output" and "input"
*/
+
#define BASE0 0x3bc
#define BASE1 0x378
#define BASE2 0x278
#define MODE_IOPERM 1
#define MODE_IOPL 0
+#define MODE_NONE -1
#include "zexy.h"
/* ----------------------- lpt --------------------- */
#ifdef Z_WANT_LPT
-# include <sys/io.h>
# include <stdlib.h>
-static int count_iopl = 0;
-#endif
+# ifdef NT
+/* on windoze everything is so complicated... */
+extern int read_parport(int port);
+extern void write_parport(int port, int value);
+extern int open_port(int port);
+static int ioperm(int port, int a, int b)
+{
+ if(open_port(port) == -1)return(1);
+ return(0);
+}
+
+static int iopl(int i)
+{
+ return(-1);
+}
+
+static void sys_outb(unsigned char byte, int port)
+{
+ write_parport(port, byte);
+}
+static int sys_inb(int port)
+{
+ return read_parport(port);
+}
+# else
+/* thankfully there is linux */
+# include <sys/io.h>
+
+static void sys_outb(unsigned char byte, int port)
+{
+ outb(byte, port);
+}
+static int sys_inb(int port)
+{
+ inb(port);
+}
+# endif /* NT */
+#endif /* Z_WANT_LP */
+
+
+static int count_iopl = 0;
static t_class *lpt_class;
typedef struct _lpt
@@ -38,19 +98,43 @@ static void lpt_float(t_lpt *x, t_floatarg f)
#ifdef Z_WANT_LPT
if (x->port) {
unsigned char b = f;
- outb(b, x->port);
+ sys_outb(b, x->port+0);
+ }
+#endif /* Z_WANT_LPT */
+}
+
+static void lpt_control(t_lpt *x, t_floatarg f)
+{
+#ifdef Z_WANT_LPT
+ if (x->port) {
+ unsigned char b = f;
+ sys_outb(b, x->port+2);
}
#endif /* Z_WANT_LPT */
}
+static void lpt_bang(t_lpt *x)
+{
+#ifdef Z_WANT_LPT
+ if (x->port) {
+ outlet_float(x->x_obj.ob_outlet, (float)sys_inb(x->port+1));
+ }
+#endif /* Z_WANT_LPT */
+}
+
+
static void *lpt_new(t_symbol *s, int argc, t_atom *argv)
{
t_lpt *x = (t_lpt *)pd_new(lpt_class);
if(s==gensym("lp"))
error("lpt: the use of 'lp' has been deprecated; use 'lpt' instead");
-#ifdef Z_WANT_LPT
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("control"));
+ outlet_new(&x->x_obj, gensym("float"));
+ x->mode = MODE_NONE;
x->port = 0;
+
+#ifdef Z_WANT_LPT
if ((argc==0)||(argv->a_type==A_FLOAT)) {
/* FLOAT specifies a parallel port */
@@ -85,22 +169,23 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv)
if (x->port && x->port < 0x400){
if (ioperm(x->port, 8, 1)) {
- error("lpt : couldn't get write permissions");
- x->port = 0;
- return (x);
- }
- x->mode = MODE_IOPERM;
- } else {
+ x->mode=MODE_NONE;
+ } else x->mode = MODE_IOPERM;
+ }
+ if(x->mode==MODE_NONE){
if (iopl(3)){
- error("lpt : couldn't get write permissions");
- x->port = 0;
- return (x);
- }
- x->mode=MODE_IOPL;
+ x->mode=MODE_NONE;
+ } else x->mode=MODE_IOPL;
count_iopl++;
// post("iopl.............................%d", count_iopl);
}
+ if(x->mode==MODE_NONE){
+ error("lpt : couldn't get write permissions");
+ x->port = 0;
+ return (x);
+ }
+
post("connected to port %x in mode '%s'", x->port, (x->mode==MODE_IOPL)?"iopl":"ioperm");
if (x->mode==MODE_IOPL)post("warning: this might seriously damage your pc...");
#else
@@ -130,7 +215,7 @@ static void helper(t_lpt *x)
post("\t\t\"lpt <portaddr>\": connect to port @ <portaddr> (hex)");
}
-void z_lpt_setup(void)
+void lpt_setup(void)
{
lpt_class = class_new(gensym("lpt"),
(t_newmethod)lpt_new, (t_method)lpt_free,
@@ -138,11 +223,10 @@ void z_lpt_setup(void)
class_addcreator((t_newmethod)lpt_new, gensym("lp"), A_GIMME, 0);
class_addfloat(lpt_class, (t_method)lpt_float);
+ class_addmethod(lpt_class, (t_method)lpt_control, gensym("control"), A_FLOAT, 0);
+ class_addbang(lpt_class, (t_method)lpt_bang);
class_addmethod(lpt_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(lpt_class, gensym("zexy/lpt"));
-}
-
-void z_lp_setup(void){
- z_lpt_setup();
+ zexy_register("lpt");
}
diff --git a/src/makefile b/src/makefile
deleted file mode 100644
index f7b5ce8..0000000
--- a/src/makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-current:
- ./configure && make
diff --git a/src/makefile.darwin b/src/makefile.darwin
deleted file mode 100644
index e29363e..0000000
--- a/src/makefile.darwin
+++ /dev/null
@@ -1,167 +0,0 @@
-current: all
-
-
-# the ZEXY-EXTERNAL-makefile
-# everything is GnuGPL that should come with the zexy.tgz
-# NO WARRANTIES FOR ANYTHING
-# et cetera
-# 1999:forum::für::umläute:2001
-
-# make sure that the "m_pd.h" is somehow available either by putting it into this
-# directory, by adding it's path to the INCLUDE-path or by putting it into an
-# already included path, e.g. "/usr/local/include/"
-
-#these are the user adjustables : adjust them to fit into your system
-# PD will install to $(DESTDIR)$(INSTALLL_PREFIX)$(PDLIBDIR), which is /usr/local/lib/pd
-# by default
-DESTDIR =
-INSTALL_PREFIX = /usr/local
-PDLIBDIR = /pd
-#these were the user adjustables
-
-CC=gcc
-
-TARGETS = zexy \
- z_connective z_pack z_multiplex z_drip \
- z_makesymbol z_strings \
- z_index z_msgfile \
- z_stat z_average z_sort \
- z_tabread4 z_coordinates \
- z_datetime z_lp \
- z_matrix \
- z_noise z_testfun \
- z_multiline z_sigmatrix \
- z_nop z_zdelay \
- z_limiter z_quantize z_swap \
- z_sigbin z_sigaverage \
- z_dfreq z_sigzero z_pdf \
- z_sfplay z_sfrecord \
- z_sigpack z_wrap \
- z_prime z_random \
- z_operating_system
-
-# ----------------------- MACOSX ----------------------------
-.SUFFIXES: .pd_darwin
-
-
-MACOSXOBJECTS = $(TARGETS:%=%.o)
-ARCH = $(shell uname --machine)
-
-PD_DIR = $(DESTDIR)$(INSTALL_PREFIX)$(PDLIBDIR)
-
-ifeq (${ARCH},alpha)
-AFLAGS = -mieee -mcpu=ev56
-endif
-
-LINCLUDE = -I../../../pd/src
-
-$(MACOSXOBJECTS): *.h
-
-CFLAGS = -O2 -DMACOSX -Dunix -g -Wall-W -Wno-unused \
- -Wno-parentheses -Wno-switch $(LINCLUDE) $(UCFLAGS) $(AFLAGS)
-
-#MACOSXLINKFLAGS = -bundle -undefined suppress -flat_namespace
-MACOSXLINKFLAGS = -bundle -bundle_loader ../../../pd/bin/pd
-
-everything: clean all install distclean
-
-distclean:
- touch dummy.o
- touch dummy.pd_darwin
- touch dummy~
- touch _dummy
- rm *.o *.pd_darwin *~ _*
-
-clean:
- touch dummy.o
- touch dummy.pd_darwin
- rm *.o *.pd_darwin
-
-all: $(MACOSXOBJECTS)
-
- @echo :: $(MACOSXOBJECTS)
-
- $(CC) $(MACOSXLINKFLAGS) -o zexy.pd_darwin *.o -lc -lm
-# strip -x zexy.pd_darwin
-
-.c.pd_darwin:
- $(CC) $(CFLAGS) -DPD $(INCLUDE) -c -o $*.o $*.c
-
-install: installdocs
- install -m 644 zexy.pd_darwin $(PD_DIR)/extra
-
-installdocs:
- install -d $(PD_DIR)/doc/5.reference/zexy
- install -m644 ../examples/*.* $(PD_DIR)/doc/5.reference/zexy
-
-
-# added by Hans-Christoph Steiner <hans@eds.org>
-# to generate MacOS X packages
-
-ZEXY_VERSION = $(shell grep VERSION zexy.h | cut -d ' ' -f 3 | cut -d '"' -f 2)
-PACKAGE_PREFIX = pd-zexy
-PACKAGE_NAME = $(PACKAGE_PREFIX)-$(ZEXY_VERSION)
-
-darwin_pkg_license:
- # generate HTML version of License
- echo "<HTML><BODY><FONT SIZE="-1">" > License.html
- cat ../../creb/COPYING | sed -e 's/^$$/\<P\>/g' >> License.html
- echo "</FONT></BODY></HTML>" >> License.html
-
-darwin_pkg_welcome:
-# generate Welcome.html from ../README.txt
-# echo "<HTML><BODY><FONT SIZE="-1">" > ../Welcome.html
-# head -11 ../README.txt >> ../Welcome.html
-# sed -i -e 's/the zexy external/\<B\>the zexy external\<\/B\>/' ../Welcome.html
-# sed -i -e 's/^$$/\<P\>/' ../Welcome.html
-# echo "</FONT></BODY></HTML>" >> ../Welcome.html
- head -11 ../README.txt >> Welcome.txt
-
-darwin_pkg_clean:
- -sudo rm -Rf installroot/ $(PACKAGE_PREFIX)*.pkg/
- -rm -f ../$(PACKAGE_PREFIX)-*.info 1 License.html Welcome.???*
-
-
-# install into MSP's default: /usr/local/lib
-
-HELP_DIR = installroot/pd/doc/5.reference/help-zexy
-darwin_pkg: all darwin_pkg_clean darwin_pkg_license darwin_pkg_welcome
-# set up installroot dir
- test -d $(HELP_DIR) || mkdir -p $(HELP_DIR)
- install -m444 ../zexy.pd $(HELP_DIR)/..
- install -d $(HELP_DIR)/help-zexy
- install -m444 ../examples/*.* $(HELP_DIR)
- test -d installroot/pd/extra || mkdir -p installroot/pd/extra
- install -m444 *.pd_darwin installroot/pd/extra
- cp -f ../pd-zexy.info ../$(PACKAGE_NAME).info
-# delete cruft
- -find installroot -name .DS_Store -delete
- -rm -f 1
-# set proper permissions
- sudo chown -R root:staff installroot
- package installroot ../$(PACKAGE_NAME).info -d . -ignoreDSStore
-# install pkg docs
- install -m 644 License.html Welcome.txt $(PACKAGE_NAME).pkg/Contents/Resources
- sudo chown -R root:staff $(PACKAGE_NAME).pkg/Contents/Resources
-
-
-# install into MacOS X style paths: /Library/Pd
-
-darwin_altpkg: all darwin_pkg_clean darwin_pkg_license darwin_pkg_welcome
-# set up installroot dir
- test -d installroot/Help || mkdir -p installroot/Help
- -cp ../examples/* installroot/Help
- test -d installroot/Externals || mkdir -p installroot/Externals
- install -m444 *.pd_darwin installroot/Externals
- sed -e 's/\/usr\/local\/lib/\/Library\/Pd/' ../pd-zexy.info \
- | sed -e 's/MSP standard paths/MacOS X-style Paths/' \
- > ../$(PACKAGE_NAME)-alt.info
- # delete cruft
- -find installroot -name .DS_Store -delete
- -rm -f 1
- # set proper permissions
- sudo chown -R root:staff installroot
- package installroot ../$(PACKAGE_NAME)-alt.info -d . -ignoreDSStore
- # install pkg docs
- install -m 444 License.html Welcome.txt $(PACKAGE_NAME)-alt.pkg/Contents/Resources
- sudo chown -R root:staff $(PACKAGE_NAME)-alt.pkg/Contents/Resources
diff --git a/src/makefile.irix b/src/makefile.irix
deleted file mode 100644
index b644cf1..0000000
--- a/src/makefile.irix
+++ /dev/null
@@ -1,29 +0,0 @@
-current: irix5
-
-TARGETS = zexy \
- z_sfplay z_sfrecord \
- z_noise z_testfun \
- z_limiter \
- z_dfreq z_sigbin \
- z_sigzero z_pdf z_average \
- z_nop z_zdelay z_swap z_quantize \
- z_makesymbol z_tabread4 \
- z_datetime z_index \
- z_connective z_sigpack z_sort \
- z_multiplex z_drip z_pack \
-
-SGI5OBJECTS = $(TARGETS:%=%.pd_irix5)
-
-# ----------------------- IRIX ----------------------------
-.SUFFIXES: .pd_irix5
-SGIINCLUDE = -I../../src
-
-irix5: $(SGIOBJECTS)
-
-.c.pd_irix5:
- cc -g -w2 -fullwarn -mips2 -DFTS $(SGIINCLUDE) -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-clean::
- rm *.o obj/* *.pd_irix5 so_locations rm *.pd_linux *~
diff --git a/src/makefile.linux b/src/makefile.linux
deleted file mode 100644
index eda19ca..0000000
--- a/src/makefile.linux
+++ /dev/null
@@ -1,94 +0,0 @@
-current: all
-
-
-# the ZEXY-EXTERNAL-makefile
-# everything is GnuGPL that should come with the zexy.tgz
-# NO WARRANTIES FOR ANYTHING
-# et cetera
-# 1999:forum::für::umläute:2003
-
-# make sure that the "m_pd.h" is somehow available either by putting it into this
-# directory, by adding it's path to the INCLUDE-path or by putting it into an
-# already included path, e.g. "/usr/local/include/"
-
-#these are the user adjustables : adjust them to fit into your system
-# PD will install to $(DESTDIR)$(INSTALLL_PREFIX)$(PDLIBDIR), which is /usr/local/lib/pd
-# by default
-DESTDIR =
-INSTALL_PREFIX = /usr/local
-PDLIBDIR = /lib/pd
-#these were the user adjustables
-
-
-TARGETS = zexy \
- z_connective z_pack z_multiplex z_drip \
- z_makesymbol z_strings \
- z_index z_msgfile \
- z_stat z_average z_sort \
- z_tabread4 z_coordinates \
- z_datetime z_lp \
- z_matrix \
- z_noise z_testfun \
- z_multiline z_sigmatrix \
- z_nop z_zdelay \
- z_limiter z_quantize z_swap \
- z_sigbin z_sigaverage \
- z_dfreq z_sigzero z_pdf \
- z_sfplay z_sfrecord \
- z_sigpack \
- z_prime z_random z_wrap \
- z_operating_system
-
-# ----------------------- LINUX ----------------------------
-.SUFFIXES: .pd_linux
-
-
-LINUXOBJECTS = $(TARGETS:%=%.o)
-ARCH = $(shell uname --machine)
-
-PD_DIR = $(DESTDIR)$(INSTALL_PREFIX)$(PDLIBDIR)
-
-ifeq (${ARCH},alpha)
-AFLAGS = -mieee -mcpu=ev56
-endif
-
-LINCLUDE = -I../../../pd/src
-
-$(LINUXOBJECTS): *.h
-
-CFLAGS = -O2 -g -Wall $(LINCLUDE) $(UCFLAGS) $(AFLAGS)
-#CFLAGS = -O3 -march=pentium3 -g -Wall $(LINCLUDE) $(UCFLAGS) $(AFLAGS)
-
-
-everything: clean all install distclean
-
-distclean:
- touch dummy.o
- touch dummy.pd_linux
- touch dummy~
- touch _dummy
- rm *.o *.pd_linux *~ _*
-
-clean:
- touch dummy.o
- touch dummy.pd_linux
- rm *.o *.pd_linux
-
-all: $(LINUXOBJECTS)
-
- @echo :: $(LINUXOBJECTS)
-
- ld -export_dynamic -shared -o zexy.pd_linux *.o -lc -lm
- strip --strip-unneeded zexy.pd_linux
-
-.c.pd_linux:
- cc $(CFLAGS) -O2 -DPD -fPIC $(INCLUDE) -c -o $*.o $*.c
-
-
-install: installdocs
- install -d $(PD_DIR)/extra
- install -m 644 zexy.pd_linux $(PD_DIR)/extra
-
-installdocs:
- install -d $(PD_DIR)/doc/5.reference/zexy
- install -m644 ../examples/*.pd $(PD_DIR)/doc/5.reference/zexy
diff --git a/src/makefile.nt b/src/makefile.nt
deleted file mode 100755
index 0489002..0000000
--- a/src/makefile.nt
+++ /dev/null
@@ -1,30 +0,0 @@
-all: zexy.dll
-
-SRCS = z_average.c z_connective.c z_coordinates.c z_datetime.c z_dfreq.c z_drip.c z_index.c z_limiter.c z_lp.c z_makesymbol.c z_matrix.c z_msgfile.c z_multiline.c z_multiplex.c z_noise.c z_nop.c z_operating_system.c z_pack.c z_pdf.c z_prime.c z_quantize.c z_random.c z_sfplay.c z_sfrecord.c z_sigaverage.c z_sigbin.c z_sigmatrix.c z_sigpack.c z_sigzero.c z_sort.c z_stat.c z_strings.c z_swap.c z_tabread4.c z_testfun.c z_wrap.c z_zdelay.c zexy.c
-
-NTOBJETS = $(SRCS:.c=.obj)
-
-NTDLLS = *.dll
-
-PDNTCFLAGS = /DNT /DMSW /DPD /nologo
-
-PDNTINCLUDE = /I. /I..\..\..\src
-
-PDNTLDIR = "c:\program\vc2003\lib"
-
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\wsock32.lib \
- $(PDNTLDIR)\kernel32.lib \
- $(PDNTLDIR)\uuid.lib \
- ..\..\..\bin\pd.lib
-
-.c.obj:
- cl /c $(PDNTCFLAGS) $(PDNTINCLUDE) $*.c
-
-zexy.dll: $(NTOBJETS)
- -link /dll /out:zexy.dll /export:zexy_setup $(PDNTLIB) $(NTOBJETS)
-
-clean:
- del *.obj
- del *.dll
diff --git a/src/makefile.win b/src/makefile.win
deleted file mode 100755
index 820c17c..0000000
--- a/src/makefile.win
+++ /dev/null
@@ -1,58 +0,0 @@
-current: all
-prefix=../../..
-
-# the ZEXY-EXTERNAL-makefile
-# everything is GnuGPL that should come with the zexy.tgz
-# NO WARRANTIES FOR ANYTHING
-# et cetera
-# 1999:forum::für::umläute:2003
-
-TARGETS = zexy \
- z_connective z_pack z_multiplex z_drip \
- z_makesymbol z_strings \
- z_index z_msgfile \
- z_stat z_average z_sort \
- z_tabread4 z_coordinates \
- z_datetime \
- z_matrix \
- z_noise z_testfun \
- z_multiline z_sigmatrix \
- z_nop z_zdelay \
- z_limiter z_quantize z_swap \
- z_sigbin z_sigaverage \
- z_dfreq z_sigzero z_pdf \
- z_sfplay z_sfrecord \
- z_sigpack \
- z_prime z_random z_wrap \
- z_operating_system
-
-.SUFFIXES: .dll
-
-OBJECTS = $(TARGETS:%=%.o)
-
-INCLUDE = -I. -I$(prefix)/src
-
-$(OBJECTS): *.h
-
-CFLAGS = -DNT -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch $(INCLUDE)
-
-everything: clean all install
-
-clean:
- -rm *.dll *.o
-
-all: $(OBJECTS)
-
- @echo :: $(OBJECTS)
- gcc -shared -o zexy.dll *.o $(prefix)/bin/pd.dll
-
-.c.pd_linux:
- cc $(CFLAGS) -O2 -DPD -fPIC $(INCLUDE) -c -o $*.o $*.c
-
-install: installdocs
- @test -d $(prefix)/extra || mkdir -p $(prefix)/extra
- install *.dll $(prefix)/extra
-
-installdocs:
- install -d $(prefix)/doc/5.reference/zexy
- install -m644 ../examples/*.pd $(prefix)/doc/5.reference/zexy
diff --git a/src/makesource.sh b/src/makesource.sh
new file mode 100755
index 0000000..d2c527e
--- /dev/null
+++ b/src/makesource.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+ZEXY_H=z_zexy.h
+ZEXY_C=z_zexy.c
+ZEXY_S=Make.source
+
+function head_h() {
+ echo "/* zexy-setup autogenerated header-file"
+ echo " * generated by \"$0\""
+ echo " * !! DO NOT MANUALLY EDIT !!"
+ echo " */"
+ echo
+ echo "#ifndef Z_ZEXY_H__"
+ echo "#define Z_ZEXY_H__"
+}
+
+function foot_h() {
+ echo "#endif /* Z_ZEXY_H__ */"
+ echo ""
+}
+
+function head_c() {
+ echo "/* zexy-setup autogenerated setup-file"
+ echo " * generated by \"$0\""
+ echo " * !! DO NOT MANUALLY EDIT !!"
+ echo " */"
+ echo
+ echo "#include \"$ZEXY_H\""
+ echo
+ echo "void z_zexy_setup(void)"
+ echo "{"
+}
+
+function foot_c() {
+ echo "}"
+ echo
+}
+
+function head_s() {
+ echo "SOURCES = \\"
+}
+
+function foot_s() {
+ echo " zexy.c"
+ echo
+}
+
+head_h > $ZEXY_H
+head_c > $ZEXY_C
+head_s > $ZEXY_S
+
+for i in `ls *.c | grep -v zexy.c`
+do
+ NAME="${i%.c}"
+ SETUPNAME="void ${NAME}_setup(void)"
+ if grep "$SETUPNAME" $i > /dev/null
+ then
+# echo ${i%.c}
+ echo " $i \\" >> $ZEXY_S
+ echo "$SETUPNAME;" >> $ZEXY_H
+ echo " ${NAME}_setup();" >> $ZEXY_C
+ fi
+done
+
+foot_h >> $ZEXY_H
+foot_c >> $ZEXY_C
+foot_s >> $ZEXY_S
+
diff --git a/src/z_makesymbol.c b/src/makesymbol.c
index 89ba95f..662089a 100644
--- a/src/z_makesymbol.c
+++ b/src/makesymbol.c
@@ -1,3 +1,20 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
/*
(l) 1210:forum::für::umläute:1999
@@ -46,6 +63,8 @@ t_symbol* list2symbol(char *masque, int argc, t_atom *argv)
cstring buffer;
int i;
+ for(i=0; i<MAXSTRINGARGS; i++)*buf[i]=0;
+
for (i=0; i<argc; i++) {
atom_string(argv+i, buf[i], MAXSTRINGLENG);
}
@@ -110,7 +129,7 @@ static void helper(t_makesymbol *x)
post("\n\nmasq = %s", x->mask);
}
-void z_makesymbol_setup(void)
+void makesymbol_setup(void)
{
makesymbol_class = class_new(gensym("makesymbol"),
(t_newmethod)makesymbol_new, (t_method)makesymbol_free,
@@ -123,4 +142,5 @@ void z_makesymbol_setup(void)
class_addmethod(makesymbol_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(makesymbol_class, gensym("zexy/makesymbol"));
+ zexy_register("makesymbol");
}
diff --git a/src/z_average.c b/src/mavg.c
index f0c2fd9..2ed0352 100644
--- a/src/z_average.c
+++ b/src/mavg.c
@@ -1,11 +1,21 @@
-#include "zexy.h"
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-/* ------------------------ average ----------------------------- */
+#include "zexy.h"
/* mavg :: moving average filter */
@@ -90,7 +100,7 @@ static void mavg_help(void)
post("mavg\t:: moving average filter");
}
-static void mavg_setup(void)
+void mavg_setup(void)
{
mavg_class = class_new(gensym("mavg"), (t_newmethod)mavg_new, 0,
sizeof(t_mavg), 0, A_DEFFLOAT, 0);
@@ -102,12 +112,5 @@ static void mavg_setup(void)
class_addmethod(mavg_class, (t_method)mavg_resize, gensym(""), A_DEFFLOAT, 0);
class_sethelpsymbol(mavg_class, gensym("zexy/mavg"));
-}
-
-
-/* global setup routine */
-
-void z_average_setup(void)
-{
- mavg_setup();
+ zexy_register("mavg");
}
diff --git a/src/minmax.c b/src/minmax.c
new file mode 100644
index 0000000..f96b025
--- /dev/null
+++ b/src/minmax.c
@@ -0,0 +1,84 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+
+/* minmax :: get minimum and maximum of a list */
+
+static t_class *minmax_class;
+
+typedef struct _minmax
+{
+ t_object x_obj;
+ t_float min;
+ t_float max;
+
+ t_outlet *mino, *maxo;
+} t_minmax;
+
+static void minmax_bang(t_minmax *x)
+{
+ outlet_float(x->maxo,x->max);
+ outlet_float(x->mino,x->min);
+}
+
+static void minmax_list(t_minmax *x, t_symbol *s, int argc, t_atom *argv)
+{
+ t_float min = atom_getfloat(argv++);
+ t_float max=min;
+ argc--;
+
+ while(argc--){
+ t_float f = atom_getfloat(argv++);
+ if (f<min)min=f;
+ else if (f>max)max=f;
+ }
+
+ x->min=min;
+ x->max=max;
+
+ minmax_bang(x);
+}
+
+static void *minmax_new(void)
+{
+ t_minmax *x = (t_minmax *)pd_new(minmax_class);
+
+ x->mino=outlet_new(&x->x_obj, gensym("float"));
+ x->maxo=outlet_new(&x->x_obj, gensym("float"));
+
+ x->min = x->max = 0;
+
+ return (x);
+}
+
+static void minmax_help(void)
+{
+ post("minmax\t:: get minimum and maximum of a list of floats");
+}
+
+void minmax_setup(void)
+{
+ minmax_class = class_new(gensym("minmax"), (t_newmethod)minmax_new, 0,
+ sizeof(t_minmax), 0, A_DEFFLOAT, 0);
+
+ class_addlist(minmax_class, (t_method)minmax_list);
+ class_addbang(minmax_class, (t_method)minmax_bang);
+ class_addmethod(minmax_class, (t_method)minmax_help, gensym("help"), 0);
+
+ class_sethelpsymbol(minmax_class, gensym("zexy/minmax"));
+ zexy_register("minmax");
+}
diff --git a/src/z_msgfile.c b/src/msgfile.c
index 706ed60..a059fd5 100644
--- a/src/z_msgfile.c
+++ b/src/msgfile.c
@@ -1,10 +1,24 @@
-/* Copyright 1997-1998 Regents of the University of California.
-Permission is granted to use this software for any noncommercial purpose.
-For commercial licensing contact the UCSD Technology Transfer Office.
-
-UC MAKES NO WARRANTY, EXPRESS OR IMPLIED, IN CONNECTION WITH THIS SOFTWARE!
-
-Written by Miller Puckette (msp@ucsd.edu)
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+/*
+ this is heavily based on code from [textfile],
+ which is part of pd and written by Miller S. Pucket
+ pd (and thus [textfile]) come with their own license
*/
#include "zexy.h"
@@ -740,7 +754,7 @@ static void *msgfile_new(t_symbol *s, int argc, t_atom *argv)
return (x);
}
-static void msgfile_setup(void)
+void msgfile_setup(void)
{
msgfile_class = class_new(gensym("msgfile"), (t_newmethod)msgfile_new,
(t_method)msgfile_free, sizeof(t_msgfile), 0, A_GIMME, 0);
@@ -782,10 +796,5 @@ static void msgfile_setup(void)
class_addmethod(msgfile_class, (t_method)msgfile_help, gensym("help"), 0);
class_sethelpsymbol(msgfile_class, gensym("zexy/msgfile"));
+ zexy_register("msgfile");
}
-
-void z_msgfile_setup(void)
-{
- msgfile_setup();
-}
-
diff --git a/src/z_multiline.c b/src/multiline_tilde.c
index 9226ba1..2767df5 100644
--- a/src/z_multiline.c
+++ b/src/multiline_tilde.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
a multiline that MULTIplicates MULTIple signals with "ramped floats" (--> like "line~")
@@ -16,12 +32,6 @@
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-
/* --------------------------- multiline~ ---------------------------------- */
static t_class *mline_class;
@@ -237,7 +247,7 @@ static void *mline_new(t_symbol *s, int argc, t_atom *argv)
-void z_multiline_setup(void)
+void multiline_tilde_setup(void)
{
mline_class = class_new(gensym("multiline~"), (t_newmethod)mline_new, (t_method)mline_free,
sizeof(t_mline), 0, A_GIMME, 0);
@@ -249,4 +259,5 @@ void z_multiline_setup(void)
class_addmethod(mline_class, (t_method)mline_stop, gensym("stop"), 0);
class_sethelpsymbol(mline_class, gensym("zexy/multiline~"));
+ zexy_register("multiline_tilde");
}
diff --git a/src/multiplex.c b/src/multiplex.c
new file mode 100644
index 0000000..571db96
--- /dev/null
+++ b/src/multiplex.c
@@ -0,0 +1,106 @@
+
+/* 1903:forum::für::umläute:2005 */
+
+/*
+ * mulitplex : multiplex a specified input to the output
+ *
+ * THINK: should the selector-inlet be the first or the last ???
+ * pros/cons:
+ * the 1st inlet being the selector is not consistant with pd (hot/cold)
+ * but as it since the hot inlet is selectable, the whole object is not really consitant
+ * numbering would have to start with 1 (for the 1st not-leftmost inlet)
+ * if the selector is rightmost this would mean: cold is right(most), hot is (somewhere) left
+ * numbering would be ok
+ *
+ * conclusio: make the selector rightmost
+ *
+ */
+
+#include "zexy.h"
+#include <stdio.h>
+
+
+/* ------------------------- mux ------------------------------- */
+
+/*
+ a multiplexer
+*/
+
+static t_class *mux_class;
+static t_class *muxproxy_class;
+
+typedef struct _mux
+{
+ t_object x_obj;
+ struct _muxproxy **x_proxy;
+
+ int i_count;
+ int i_selected;
+ t_inlet **in;
+} t_mux;
+
+
+typedef struct _muxproxy
+{
+ t_object p_ob;
+ t_mux *p_master;
+ int id;
+} t_muxproxy;
+
+static void mux_select(t_mux *x, t_float f)
+{
+ x->i_selected=f;
+}
+
+static void mux_anything(t_muxproxy *y, t_symbol *s, int argc, t_atom *argv)
+{
+ t_mux*x=y->p_master;
+ if(y->id==x->i_selected)
+ outlet_anything(x->x_obj.ob_outlet, s, argc, argv);
+}
+
+static void *mux_new(t_symbol *s, int argc, t_atom *argv)
+{
+ int n = (argc < 2)?2:argc;
+ t_mux *x = (t_mux *)pd_new(mux_class);
+ // t_muxproxy *y=(t_muxproxy*)pd_new(muxproxy_class);
+ x->x_proxy = (t_muxproxy**)getbytes(sizeof(t_muxproxy*));
+
+ x->i_selected=0;
+ x->i_count = n;
+ x->in = (t_inlet **)getbytes(x->i_count * sizeof(t_inlet *));
+
+ for (n = 0; n<x->i_count; n++) {
+ x->x_proxy[n]=(t_muxproxy*)pd_new(muxproxy_class);
+ x->x_proxy[n]->p_master = x;
+ x->x_proxy[n]->id=n;
+ x->in[n] = inlet_new ((t_object*)x, (t_pd*)x->x_proxy[n], 0,0);
+ }
+
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
+
+ outlet_new(&x->x_obj, 0);
+ return (x);
+}
+
+static void mux_free(t_mux*x){
+
+}
+
+void multiplex_setup(void)
+{
+ mux_class = class_new(gensym("multiplex"), (t_newmethod)mux_new,
+ (t_method)mux_free, sizeof(t_mux), CLASS_NOINLET, A_GIMME, 0);
+ class_addcreator((t_newmethod)mux_new, gensym("mux"), A_GIMME, 0);
+
+ class_addmethod (mux_class, (t_method)mux_select, gensym(""), A_DEFFLOAT, 0);
+
+ muxproxy_class = class_new(gensym("mux proxy"), 0, 0,
+ sizeof(t_muxproxy),
+ CLASS_PD | CLASS_NOINLET, 0);
+ class_addanything(muxproxy_class, mux_anything);
+
+ class_sethelpsymbol(mux_class, gensym("zexy/multiplex"));
+
+ zexy_register("multiplex");
+}
diff --git a/src/multiplex_tilde.c b/src/multiplex_tilde.c
new file mode 100644
index 0000000..be141cd
--- /dev/null
+++ b/src/multiplex_tilde.c
@@ -0,0 +1,112 @@
+/******************************************************
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+
+
+/* ------------------------------------------------------------------------------ */
+
+/* mux~ : multiplex a specified signal to the output */
+
+static t_class *mux_class;
+
+typedef struct _mux {
+ t_object x_obj;
+
+ int input;
+
+ int n_in;
+ t_float **in;
+} t_mux;
+
+static void mux_input(t_mux *x, t_floatarg f)
+{
+ if ((f>=0)&&(f<x->n_in)){
+ x->input=f;
+ } else
+ error("multiplex: %d is channel out of range (0..%d)", (int)f, x->n_in);
+
+}
+
+static t_int *mux_perform(t_int *w)
+{
+ t_mux *x = (t_mux *)(w[1]);
+ t_float *out = (t_float *)(w[2]);
+ int n = (int)(w[3]);
+
+ t_float *in = x->in[x->input];
+
+ while(n--)*out++=*in++;
+
+ return (w+4);
+}
+
+static void mux_dsp(t_mux *x, t_signal **sp)
+{
+ int n = 0;
+ t_float **dummy=x->in;
+
+ for(n=0;n<x->n_in;n++)*dummy++=sp[n]->s_vec;
+
+ dsp_add(mux_perform, 3, x, sp[n]->s_vec, sp[0]->s_n);
+}
+
+static void mux_helper(void)
+{
+ post("\n%c mux~\t:: multiplex a one of various signals to one outlet", HEARTSYMBOL);
+ post("<#out>\t : the inlet-number (counting from 0) witch is routed to the outlet"
+ "'help'\t : view this");
+ post("creation : \"mux~ [arg1 [arg2...]]\"\t: the number of arguments equals the number of inlets\n");
+}
+
+static void mux_free(t_mux *x)
+{
+ freebytes(x->in, x->n_in * sizeof(t_float *));
+}
+
+static void *mux_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_mux *x = (t_mux *)pd_new(mux_class);
+ int i;
+
+ if (!argc)argc=2;
+ x->n_in=argc;
+ x->input=0;
+
+ argc--;
+ while(argc--)inlet_new(&x->x_obj,&x->x_obj.ob_pd,&s_signal,&s_signal);
+
+ x->in = (t_float **)getbytes(x->n_in * sizeof(t_float *));
+ i=x->n_in;
+ while(i--)x->in[i]=0;
+
+ outlet_new(&x->x_obj, gensym("signal"));
+
+ return (x);
+}
+
+void multiplex_tilde_setup(void)
+{
+ mux_class = class_new(gensym("multiplex~"), (t_newmethod)mux_new, (t_method)mux_free, sizeof(t_mux), 0, A_GIMME, 0);
+ class_addcreator((t_newmethod)mux_new, gensym("mux~"), A_GIMME, 0);
+
+ class_addfloat(mux_class, mux_input);
+ class_addmethod(mux_class, (t_method)mux_dsp, gensym("dsp"), 0);
+ class_addmethod(mux_class, nullfn, gensym("signal"), 0);
+
+ class_addmethod(mux_class, (t_method)mux_helper, gensym("help"), 0);
+ class_sethelpsymbol(mux_class, gensym("zexy/multiplex~"));
+ zexy_register("multiplex~");
+}
diff --git a/src/niagara.c b/src/niagara.c
new file mode 100644
index 0000000..5764952
--- /dev/null
+++ b/src/niagara.c
@@ -0,0 +1,110 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* 3108:forum::für::umläute:2000 */
+
+#include "zexy.h"
+#include <string.h>
+#include <memory.h>
+
+
+/* ------------------------- niagara ------------------------------- */
+
+/*
+divides a package into 2 sub-packages at a specified point
+like the niagara-falls, some water goes down to the left side, the rest to the right side, devided by the rock
+*/
+
+static t_class *niagara_class;
+
+typedef struct _niagara
+{
+ t_object x_obj;
+ t_float rock;
+ t_outlet *left, *right;
+} t_niagara;
+
+static void niagara_list(t_niagara *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int n_l, n_r;
+ t_atom *ap_l, *ap_r;
+ int dumrock = x->rock;
+ int rock = ((dumrock < 0.f)?(argc+dumrock):dumrock);
+
+ n_l = (rock < argc)?rock:argc;
+ ap_l = argv;
+
+ n_r = argc - n_l;
+ ap_r = &argv[n_l];
+
+ if (n_r) outlet_list(x->right, s, n_r, ap_r);
+ if (n_l) outlet_list(x->left, s, n_l, ap_l);
+}
+
+static void niagara_any(t_niagara *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int n_l, n_r;
+ t_atom *ap_l, *ap_r;
+ t_symbol *s_r, *s_l;
+ int dumrock = x->rock;
+ int rock = ((dumrock < 0.f)?(argc+dumrock):dumrock-1);
+
+ n_l = (rock < argc)?rock:argc;
+ ap_l = argv;
+ s_l = s;
+
+ n_r = argc - n_l;
+ ap_r = &argv[n_l];
+
+ if (n_r) {
+ s_r = 0;
+ if (ap_r->a_type == A_FLOAT) s_r = gensym("list");
+ else {
+ s_r = atom_getsymbol(ap_r);
+ ap_r++;
+ n_r--;
+ }
+ outlet_anything(x->right, s_r, n_r, ap_r);
+ }
+
+ if (n_l+1 ) outlet_anything(x->left, s_l, n_l, ap_l);
+}
+
+static void *niagara_new(t_floatarg f)
+{
+ t_niagara *x = (t_niagara *)pd_new(niagara_class);
+
+ x->rock = f;
+
+ x->left = outlet_new(&x->x_obj, &s_list);
+ x->right = outlet_new(&x->x_obj, &s_list);
+
+ floatinlet_new(&x->x_obj, &x->rock);
+
+ return (x);
+}
+
+void niagara_setup(void)
+{
+ niagara_class = class_new(gensym("niagara"), (t_newmethod)niagara_new,
+ 0, sizeof(t_niagara), 0, A_DEFFLOAT, 0);
+
+ class_addlist (niagara_class, niagara_list);
+ class_addanything(niagara_class, niagara_any);
+
+ class_sethelpsymbol(niagara_class, gensym("zexy/niagara"));
+ zexy_register("niagara");
+}
diff --git a/src/noish_tilde.c b/src/noish_tilde.c
new file mode 100644
index 0000000..6374242
--- /dev/null
+++ b/src/noish_tilde.c
@@ -0,0 +1,184 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/*
+ 30041999
+
+ two bandlimited noise gnerators based on DODGE/JERSE "computer music" c3.9 : RANDI & RANDH
+
+ I do not care for copyrights
+ (all in all, the used noise~-code (in fact, the pseude-random-code) is from Miller Puckette
+ and I made only very few modifications so look out for the LICENSE.TXT delivered with
+ puredata for further (c)-information
+
+ forum für umläute 1999
+
+ this is in fact the very same as the late "NOISE.C", except that I tried to optimize the code a little bit
+ (by partially removing those very expensive if..then's in about 15 minutes, so there are thousands of new bugs very likely)
+
+ 14071999
+ finally added changing seeds, this is to prevent to noise~-units to output the very same, something quite unnatural even for pseudo-random-noise
+*/
+
+#include "zexy.h"
+
+/* general */
+
+typedef struct _nois
+{
+ t_object x_obj;
+ int val;
+ t_float current;
+ t_float decrement;
+ t_float updater;
+ t_float to_go;
+} t_nois;
+
+
+static void set_freq(t_nois *x, t_floatarg freq)
+{
+ x->updater = (freq > 0) ? sys_getsr() / freq : 1;
+ if (x->updater < 1)
+ {
+ x->updater = 1;
+ }
+ x->to_go = 0;
+}
+
+
+/* ------------------------ noish~ ----------------------------- */
+
+static t_class *noish_class;
+
+static t_int *noish_perform(t_int *w)
+{
+ t_nois *x = (t_nois *)(w[1]);
+ t_float *out = (t_float *)(w[2]);
+ int n = (int)(w[3]);
+
+ int *vp = (int *)(&x->val);
+ int i_value = *vp;
+ t_float f_value = ((float)((i_value & 0x7fffffff) - 0x40000000)) *
+ (float)(1.0 / 0x40000000);
+ t_float all_to_go = x->updater;
+ t_float still_to_go = x->to_go;
+
+ if (all_to_go == 1)
+ { /* this is "pure white" noise, so we have to calculate each sample */
+ while (n--)
+ {
+ i_value *= 435898247;
+ i_value += 382842987;
+ *out++ = ((float)((i_value & 0x7fffffff) - 0x40000000)) * (float)(1.0 / 0x40000000);
+ }
+ }
+ else
+ if (n < still_to_go)
+ { /* signal won't change for the next 64 samples */
+ still_to_go -= n;
+ while (n--)
+ {
+ *out++ = f_value;
+ }
+ }
+ else
+ if (all_to_go + still_to_go > n)
+ { /* only one update calculation necessary for 64 samples !!! */
+ while (still_to_go-- > 0)
+ {
+ n--;
+ *out++ = f_value;
+ }
+
+ still_to_go += all_to_go + 1;
+
+ i_value *= 435898247;
+ i_value += 382842987;
+ f_value = ( (float)((i_value & 0x7fffffff) - 0x40000000) ) * (float)(1.0 / 0x40000000);
+
+ while (n--)
+ {
+ still_to_go--;
+ *out++ = f_value;
+ }
+ }
+ else
+ { /* anything else */
+ while (n--)
+ {
+ if (still_to_go-- <= 0) /* update only if all time has elapsed */
+ {
+ still_to_go += all_to_go;
+
+ i_value *= 435898247;
+ i_value += 382842987;
+
+ f_value = ( (float)((i_value & 0x7fffffff) - 0x40000000) ) * (float)(1.0 / 0x40000000);
+ }
+ *out++ = f_value;
+ }
+ }
+
+
+ *vp = i_value;
+ x->updater = all_to_go;
+ x->to_go = still_to_go;
+
+ return (w+4);
+}
+
+static void noish_dsp(t_nois *x, t_signal **sp)
+{
+ post("sr=%f\nsn=%f", sp[0]->s_sr, sp[0]->s_n);
+ dsp_add(noish_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
+}
+
+static void noish_helper(void)
+{
+ post("\n%c noish~\t:: a bandlimited pseudo-noise generator", HEARTSYMBOL);
+ post("<freq>\t : sampling-frequency (in Hz)\n"
+ "'help'\t : view this");
+ post("creation : \"noish~ [<freq>]\"\t: ('0'(default) will produce 'white' noise)\n");
+ post("note\t : the seed of the pseudo-noise generator changes from\n"
+ "\t instance to instance, so two noish~-objects created at the\n"
+ "\t same time will produce dífferent signals, something the original\n"
+ "\t noise~-object misses\n");
+ post("for further details see DODGE/JERSE \"computer music\" c3.9\n");
+}
+
+static void *noish_new(t_floatarg f)
+{
+ t_nois *x = (t_nois *)pd_new(noish_class);
+
+ static int init = 307;
+ x->val = (init *= 13);
+
+ set_freq(x, f);
+
+ outlet_new(&x->x_obj, gensym("signal"));
+ return (x);
+}
+
+void noish_tilde_setup(void)
+{
+ noish_class = class_new(gensym("noish~"), (t_newmethod)noish_new, 0, sizeof(t_nois), 0, A_DEFFLOAT, 0);
+
+ class_addfloat(noish_class, set_freq);
+ class_addmethod(noish_class, (t_method)noish_dsp, gensym("dsp"), 0);
+
+ class_addmethod(noish_class, (t_method)noish_helper, gensym("help"), 0);
+ class_sethelpsymbol(noish_class, gensym("zexy/noish~"));
+}
diff --git a/src/z_noise.c b/src/noisi_tilde.c
index 9d555bd..14fb1be 100644
--- a/src/z_noise.c
+++ b/src/noisi_tilde.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
30041999
@@ -18,10 +34,6 @@
*/
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
/* general */
@@ -36,7 +48,7 @@ typedef struct _nois
} t_nois;
-static void set_freq(t_nois *x, t_floatarg freq)
+static void set_noisfreq(t_nois *x, t_floatarg freq)
{
x->updater = (freq > 0) ? sys_getsr() / freq : 1;
if (x->updater < 1)
@@ -46,133 +58,6 @@ static void set_freq(t_nois *x, t_floatarg freq)
x->to_go = 0;
}
-
-/* ------------------------ noish~ ----------------------------- */
-
-static t_class *noish_class;
-
-static t_int *noish_perform(t_int *w)
-{
- t_nois *x = (t_nois *)(w[1]);
- t_float *out = (t_float *)(w[2]);
- int n = (int)(w[3]);
-
- int *vp = (int *)(&x->val);
- int i_value = *vp;
- t_float f_value = ((float)((i_value & 0x7fffffff) - 0x40000000)) *
- (float)(1.0 / 0x40000000);
- t_float all_to_go = x->updater;
- t_float still_to_go = x->to_go;
-
- if (all_to_go == 1)
- { /* this is "pure white" noise, so we have to calculate each sample */
- while (n--)
- {
- i_value *= 435898247;
- i_value += 382842987;
- *out++ = ((float)((i_value & 0x7fffffff) - 0x40000000)) * (float)(1.0 / 0x40000000);
- }
- }
- else
- if (n < still_to_go)
- { /* signal won't change for the next 64 samples */
- still_to_go -= n;
- while (n--)
- {
- *out++ = f_value;
- }
- }
- else
- if (all_to_go + still_to_go > n)
- { /* only one update calculation necessary for 64 samples !!! */
- while (still_to_go-- > 0)
- {
- n--;
- *out++ = f_value;
- }
-
- still_to_go += all_to_go + 1;
-
- i_value *= 435898247;
- i_value += 382842987;
- f_value = ( (float)((i_value & 0x7fffffff) - 0x40000000) ) * (float)(1.0 / 0x40000000);
-
- while (n--)
- {
- still_to_go--;
- *out++ = f_value;
- }
- }
- else
- { /* anything else */
- while (n--)
- {
- if (still_to_go-- <= 0) /* update only if all time has elapsed */
- {
- still_to_go += all_to_go;
-
- i_value *= 435898247;
- i_value += 382842987;
-
- f_value = ( (float)((i_value & 0x7fffffff) - 0x40000000) ) * (float)(1.0 / 0x40000000);
- }
- *out++ = f_value;
- }
- }
-
-
- *vp = i_value;
- x->updater = all_to_go;
- x->to_go = still_to_go;
-
- return (w+4);
-}
-
-static void noish_dsp(t_nois *x, t_signal **sp)
-{
- post("sr=%f\nsn=%f", sp[0]->s_sr, sp[0]->s_n);
- dsp_add(noish_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
-}
-
-static void noish_helper(void)
-{
- post("\n%c noish~\t:: a bandlimited pseudo-noise generator", HEARTSYMBOL);
- post("<freq>\t : sampling-frequency (in Hz)\n"
- "'help'\t : view this");
- post("creation : \"noish~ [<freq>]\"\t: ('0'(default) will produce 'white' noise)\n");
- post("note\t : the seed of the pseudo-noise generator changes from\n"
- "\t instance to instance, so two noish~-objects created at the\n"
- "\t same time will produce dífferent signals, something the original\n"
- "\t noise~-object misses\n");
- post("for further details see DODGE/JERSE \"computer music\" c3.9\n");
-}
-
-static void *noish_new(t_floatarg f)
-{
- t_nois *x = (t_nois *)pd_new(noish_class);
-
- static int init = 307;
- x->val = (init *= 13);
-
- set_freq(x, f);
-
- outlet_new(&x->x_obj, gensym("signal"));
- return (x);
-}
-
-void noish_setup(void)
-{
- noish_class = class_new(gensym("noish~"), (t_newmethod)noish_new, 0, sizeof(t_nois), 0, A_DEFFLOAT, 0);
-
- class_addfloat(noish_class, set_freq);
- class_addmethod(noish_class, (t_method)noish_dsp, gensym("dsp"), 0);
-
- class_addmethod(noish_class, (t_method)noish_helper, gensym("help"), 0);
- class_sethelpsymbol(noish_class, gensym("zexy/noish~"));
-}
-
-
-
/* ------------------------ noisi~ ----------------------------- */
static t_class *noisi_class;
@@ -265,25 +150,18 @@ static void *noisi_new(t_floatarg f){
static int init = 4259;
x->val = (init *= 17);
- set_freq (x, f);
+ set_noisfreq (x, f);
outlet_new(&x->x_obj, gensym("signal"));
return (x);
}
-void noisi_setup(void){
+void noisi_tilde_setup(void){
noisi_class = class_new(gensym("noisi~"), (t_newmethod)noisi_new, 0, sizeof(t_nois), 0, A_DEFFLOAT, 0);
- class_addfloat(noisi_class, set_freq);
+ class_addfloat(noisi_class, set_noisfreq);
class_addmethod(noisi_class, (t_method)noisi_dsp, gensym("dsp"), 0);
class_addmethod(noisi_class, (t_method)noisi_helper, gensym("help"), 0);
class_sethelpsymbol(noisi_class, gensym("zexy/noisi~"));
}
-
-/* global setup routine */
-
-void z_noise_setup(void){
- noish_setup();
- noisi_setup();
-}
diff --git a/src/z_operating_system.c b/src/operating_system.c
index fdac649..bea6156 100644
--- a/src/z_operating_system.c
+++ b/src/operating_system.c
@@ -1,5 +1,18 @@
-
-/* 1008:forum::für::umläute:2001 */
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
/*
operating_system : operating_system-code for message-objects
@@ -42,11 +55,12 @@ static void *operating_system_new(t_floatarg f)
return (x);
}
-void z_operating_system_setup(void)
+void operating_system_setup(void)
{
operating_system_class = class_new(gensym("operating_system"), (t_newmethod)operating_system_new,
0, sizeof(t_operating_system), 0, A_DEFFLOAT, 0);
class_addbang (operating_system_class, operating_system_bang);
class_sethelpsymbol(operating_system_class, gensym("zexy/operating_system"));
+ zexy_register("operating_system");
}
diff --git a/src/pack_tilde.c b/src/pack_tilde.c
new file mode 100644
index 0000000..ca762c9
--- /dev/null
+++ b/src/pack_tilde.c
@@ -0,0 +1,86 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+
+
+/* ------------------------ pack~ ----------------------------- */
+/* pack the signal-vector to a float-package */
+
+static t_class *sigpack_class;
+
+typedef struct _sigpack
+{
+ t_object x_obj;
+
+ int vector_length;
+ t_atom *buffer;
+
+} t_sigpack;
+
+static t_int *sigpack_perform(t_int *w)
+{
+ t_float *in = (t_float *)(w[1]);
+ t_sigpack *x = (t_sigpack *)w[2];
+ int n = (int)(w[3]), i = 0;
+ t_atom *buf = x->buffer;
+
+ while (n--) {
+ SETFLOAT(&buf[i], *in++);
+ i++;
+ }
+ outlet_list(x->x_obj.ob_outlet, &s_list, x->vector_length, x->buffer);
+
+ return (w+4);
+}
+
+static void sigpack_dsp(t_sigpack *x, t_signal **sp)
+{
+ if (x->vector_length != sp[0]->s_n) {
+ freebytes(x->buffer, x->vector_length * sizeof(t_atom));
+ x->vector_length = sp[0]->s_n;
+ x->buffer = (t_atom *)getbytes(x->vector_length * sizeof(t_atom));
+ }
+ dsp_add(sigpack_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
+}
+
+static void *sigpack_new(void)
+{
+ t_sigpack *x = (t_sigpack *)pd_new(sigpack_class);
+ x->vector_length = 0;
+ x->buffer = 0;
+ outlet_new(&x->x_obj, gensym("list"));
+
+ return (x);
+}
+
+static void sigpack_help(void)
+{
+ post("pack~\t:: outputs the signal-vectors as float-packages");
+}
+
+void pack_tilde_setup(void)
+{
+ sigpack_class = class_new(gensym("pack~"), (t_newmethod)sigpack_new, 0,
+ sizeof(t_sigpack), 0, A_DEFFLOAT, 0);
+ class_addmethod(sigpack_class, nullfn, gensym("signal"), 0);
+ class_addmethod(sigpack_class, (t_method)sigpack_dsp, gensym("dsp"), 0);
+
+ class_addmethod(sigpack_class, (t_method)sigpack_help, gensym("help"), 0);
+ class_sethelpsymbol(sigpack_class, gensym("zexy/pack~"));
+
+ zexy_register("pack~");
+}
diff --git a/src/packel.c b/src/packel.c
new file mode 100644
index 0000000..67c5211
--- /dev/null
+++ b/src/packel.c
@@ -0,0 +1,107 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+/* 3108:forum::für::umläute:2000 */
+
+/* ------------------------- packel ------------------------------- */
+
+/*
+ get the nth element of a package
+*/
+
+#include "zexy.h"
+#include <string.h>
+// do we need memory.h ?
+#include <memory.h>
+
+
+static t_class *packel_class;
+
+typedef struct _packel
+{
+ t_object x_obj;
+ t_float position;
+} t_packel;
+
+static void packel_list(t_packel *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int mypos = x->position;
+
+ if (mypos) {
+ t_atom *current;
+ int pos = (mypos < 0)?(argc+mypos):(mypos-1);
+
+ if(argc==0){
+ if (pos==0||pos==-1)outlet_bang(x->x_obj.ob_outlet);
+ return;
+ }
+
+ if (pos < 0 || pos >= argc)return;
+
+ current = &(argv[pos]);
+
+ switch (current->a_type) {
+ case A_FLOAT:
+ outlet_float(x->x_obj.ob_outlet, atom_getfloat(current));
+ break;
+ case A_SYMBOL:
+ outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(current));
+ break;
+ case A_POINTER:
+ outlet_pointer(x->x_obj.ob_outlet, current->a_w.w_gpointer);
+ break;
+ case A_NULL:
+ outlet_bang(x->x_obj.ob_outlet);
+ default:
+ ;
+ }
+ } else outlet_list(x->x_obj.ob_outlet, s, argc, argv);
+}
+
+static void packel_anything(t_packel *x, t_symbol *s, int argc, t_atom *argv)
+{
+ t_atom *av2 = (t_atom *)getbytes((argc + 1) * sizeof(t_atom));
+ int i;
+
+ for (i = 0; i < argc; i++)
+ av2[i + 1] = argv[i];
+ SETSYMBOL(av2, s);
+ packel_list(x, gensym("list"), argc+1, av2);
+ freebytes(av2, (argc + 1) * sizeof(t_atom));
+}
+
+static void *packel_new(t_floatarg f)
+{
+ t_packel *x = (t_packel *)pd_new(packel_class);
+ outlet_new(&x->x_obj, 0);
+ floatinlet_new(&x->x_obj, &x->position);
+ x->position = (int) f;
+
+ return (x);
+}
+
+void packel_setup(void)
+{
+ packel_class = class_new(gensym("packel"), (t_newmethod)packel_new,
+ 0, sizeof(t_packel), 0, A_DEFFLOAT, 0);
+
+ class_addlist (packel_class, packel_list);
+ class_addanything(packel_class, packel_anything);
+
+ class_sethelpsymbol(packel_class, gensym("zexy/packel"));
+ zexy_register("packel");
+}
diff --git a/src/z_pdf.c b/src/pdf_tilde.c
index dc6fbfe..e55bcf0 100644
--- a/src/z_pdf.c
+++ b/src/pdf_tilde.c
@@ -1,12 +1,23 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/* get the ProbabilityDensityFunction of a signal */
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
/* ------------------------ pdf~ ----------------------------- */
static t_class *pdf_class;
@@ -111,7 +122,7 @@ static void helper(void)
post("creation :: 'pdf~ [<n>]':: get the pdf for <n> (default: 64) values");
}
-void z_pdf_setup(void)
+void pdf_tilde_setup(void)
{
pdf_class = class_new(gensym("pdf~"), (t_newmethod)pdf_new, (t_method)pdf_free,
sizeof(t_pdf), 0, A_DEFFLOAT, 0);
@@ -125,4 +136,5 @@ void z_pdf_setup(void)
class_addmethod(pdf_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(pdf_class, gensym("zexy/pdf~"));
+ zexy_register("pdf~");
}
diff --git a/src/z_prime.c b/src/prime.c
index 6d0f100..2277019 100644
--- a/src/z_prime.c
+++ b/src/prime.c
@@ -1,3 +1,21 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* get the n-th prime number */
+
#include "zexy.h"
#include <math.h>
@@ -46,11 +64,12 @@ void *prime_new(void)
return (void *)x;
}
-void z_prime_setup(void) {
+void prime_setup(void) {
prime_class = class_new(gensym("prime"),
(t_newmethod)prime_new,
0, sizeof(t_prime),
CLASS_DEFAULT, 0);
class_addfloat(prime_class, prime_float);
+ zexy_register("prime");
}
diff --git a/src/z_quantize.c b/src/quantize_tilde.c
index a66c1eb..15190e6 100644
--- a/src/z_quantize.c
+++ b/src/quantize_tilde.c
@@ -1,15 +1,28 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
/*
- the long waited for quantize~-object that quantizes in many possible (but equal) steps
- of course, we´ll make a comfortable quantize of the float-signal for 16bit and 8bit
+ the long waited for quantize~-object that quantizes in many possible (but equal) steps
+ of course, we´ll make a comfortable quantize of the float-signal for 16bit and 8bit
- 1110:forum::für::umläute:1999
- */
+ 1110:forum::für::umläute:1999
+*/
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
/* ------------------------ quantize~ ----------------------------- */
@@ -83,17 +96,18 @@ static void *quantize_new(t_floatarg f)
return (x);
}
-void z_quantize_setup(void)
+void quantize_tilde_setup(void)
{
- quantize_class = class_new(gensym("quantize~"), (t_newmethod)quantize_new, 0,
- sizeof(t_quantize), 0, A_DEFFLOAT, 0);
- class_addmethod(quantize_class, nullfn, gensym("signal"), 0);
- class_addmethod(quantize_class, (t_method)quantize_dsp, gensym("dsp"), 0);
-
- class_addfloat(quantize_class, quantize_float);
- class_addmethod(quantize_class, (t_method)quantize_8bit, gensym("8bit"), 0);
- class_addmethod(quantize_class, (t_method)quantize_16bit, gensym("16bit"), 0);
-
- class_addmethod(quantize_class, (t_method)helper, gensym("help"), 0);
- class_sethelpsymbol(quantize_class, gensym("zexy/quantize~"));
+ quantize_class = class_new(gensym("quantize~"), (t_newmethod)quantize_new, 0,
+ sizeof(t_quantize), 0, A_DEFFLOAT, 0);
+ class_addmethod(quantize_class, nullfn, gensym("signal"), 0);
+ class_addmethod(quantize_class, (t_method)quantize_dsp, gensym("dsp"), 0);
+
+ class_addfloat(quantize_class, quantize_float);
+ class_addmethod(quantize_class, (t_method)quantize_8bit, gensym("8bit"), 0);
+ class_addmethod(quantize_class, (t_method)quantize_16bit, gensym("16bit"), 0);
+
+ class_addmethod(quantize_class, (t_method)helper, gensym("help"), 0);
+ class_sethelpsymbol(quantize_class, gensym("zexy/quantize~"));
+ zexy_register("quantize~");
}
diff --git a/src/repack.c b/src/repack.c
new file mode 100644
index 0000000..c7b527b
--- /dev/null
+++ b/src/repack.c
@@ -0,0 +1,182 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* 3108:forum::für::umläute:2000 */
+
+/* objects for manipulating packages*/
+
+/*
+ repack : (re)pack floats/symbols/pointers to fixed-length packages
+*/
+
+#include "zexy.h"
+#include <string.h>
+#include <memory.h>
+
+
+/* -------------------- repack ------------------------------ */
+
+/*
+(re)pack a sequence of (packages of) atoms into a package of given length
+
+"bang" gives out the current package immediately
+the second inlet lets you change the default package size
+*/
+
+static t_class *repack_class;
+
+typedef struct _repack
+{
+ t_object x_obj;
+ t_atom *buffer;
+ int bufsize;
+
+ int outputsize;
+ int current;
+} t_repack;
+
+
+static void repack_set(t_repack *x, t_float f)
+{
+ /* set the new default size */
+ int n = f;
+
+ if (n > 0) {
+
+ /* flush all the newsized packages that are in the buffer */
+ t_atom *dumbuf = x->buffer;
+ int dumcur = x->current;
+
+ while (n <= dumcur) {
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), n, dumbuf);
+ dumcur -= n;
+ dumbuf += n;
+ }
+
+ if (dumcur < 0) error("this should never happen :: dumcur = %d < 0", dumcur);
+ else {
+ memcpy(x->buffer, dumbuf, dumcur * sizeof(t_atom));
+ x->current = dumcur;
+ }
+
+ if (n > x->bufsize) {
+ dumbuf = (t_atom *)getbytes(n * sizeof(t_atom));
+ memcpy(dumbuf, x->buffer, x->current * sizeof(t_atom));
+ freebytes(x->buffer, x->bufsize * sizeof(t_atom));
+ x->buffer = dumbuf;
+ x->bufsize = n;
+ }
+
+ x->outputsize = n;
+ }
+}
+
+static void repack_bang(t_repack *x)
+{
+ /* output the list as far as we are now */
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->current, x->buffer);
+ x->current = 0;
+}
+
+static void repack_float(t_repack *x, t_float f)
+{
+ /* add a float-atom to the list */
+ SETFLOAT(&x->buffer[x->current], f);
+ x->current++;
+ if (x->current >= x->outputsize) repack_bang(x);
+}
+
+static void repack_symbol(t_repack *x, t_symbol *s)
+{
+ /* add a sym-atom to the list */
+ SETSYMBOL(&x->buffer[x->current], s);
+ x->current++;
+ if (x->current >= x->outputsize) repack_bang(x);
+}
+static void repack_pointer(t_repack *x, t_gpointer *p)
+{
+ /* add a pointer-atom to the list */
+ SETPOINTER(&x->buffer[x->current], p);
+ x->current++;
+ if (x->current >= x->outputsize) repack_bang(x);
+}
+static void repack_list(t_repack *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int remain = x->outputsize - x->current;
+ t_atom *ap = argv;
+
+ if (argc >= remain) {
+ memcpy(x->buffer+x->current, ap, remain * sizeof(t_atom));
+ ap += remain;
+ argc -= remain;
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->outputsize, x->buffer);
+ x->current = 0;
+ }
+
+ while (argc >= x->outputsize) {
+ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->outputsize, ap);
+ ap += x->outputsize;
+ argc -= x->outputsize;
+ }
+
+ memcpy(x->buffer + x->current, ap, argc * sizeof(t_atom));
+ x->current += argc;
+}
+static void repack_anything(t_repack *x, t_symbol *s, int argc, t_atom *argv)
+{
+ SETSYMBOL(&x->buffer[x->current], s);
+ x->current++;
+
+ if (x->current >= x->outputsize) {
+ repack_bang(x);
+ }
+ repack_list(x, gensym("list"), argc, argv);
+}
+
+static void *repack_new(t_floatarg f)
+{
+ t_repack *x = (t_repack *)pd_new(repack_class);
+
+
+
+ x->outputsize = x->bufsize = (f>0.f)?f:2 ;
+ x->current = 0;
+
+
+ x->buffer = (t_atom *)getbytes(x->bufsize * sizeof(t_atom));
+
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
+ outlet_new(&x->x_obj, 0);
+
+ return (x);
+}
+
+void repack_setup(void)
+{
+ repack_class = class_new(gensym("repack"), (t_newmethod)repack_new,
+ 0, sizeof(t_repack), 0, A_DEFFLOAT, 0);
+
+ class_addbang (repack_class, repack_bang);
+ class_addfloat (repack_class, repack_float);
+ class_addsymbol (repack_class, repack_symbol);
+ class_addpointer (repack_class, repack_pointer);
+ class_addlist (repack_class, repack_list);
+ class_addanything(repack_class, repack_anything);
+ class_addmethod (repack_class, (t_method)repack_set, gensym(""), A_DEFFLOAT, 0);
+
+ class_sethelpsymbol(repack_class, gensym("zexy/repack"));
+ zexy_register("repack");
+}
diff --git a/src/repeat.c b/src/repeat.c
new file mode 100644
index 0000000..dbeedc7
--- /dev/null
+++ b/src/repeat.c
@@ -0,0 +1,60 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* 2305:forum::für::umläute:2001 */
+
+/* connective objects */
+
+#include "zexy.h"
+
+/* ------------------------- repeat ------------------------------- */
+
+/* a no-operation - just pass through what you get in */
+
+static t_class *repeat_class;
+
+typedef struct _repeat
+{
+ t_object x_obj;
+ t_float fcount;
+} t_repeat;
+
+static void repeat_anything(t_repeat *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int i;
+ i=x->fcount;
+ if (i<0)i=1;
+ while(i--)outlet_anything(x->x_obj.ob_outlet, s, argc, argv);
+}
+
+static void *repeat_new(t_float f)
+{
+ t_repeat *x = (t_repeat *)pd_new(repeat_class);
+ x->fcount = f;
+ floatinlet_new(&x->x_obj, &x->fcount);
+ outlet_new(&x->x_obj, 0);
+ return (x);
+}
+
+void repeat_setup(void)
+{
+ repeat_class = class_new(gensym("repeat"), (t_newmethod)repeat_new,
+ 0, sizeof(t_repeat), 0, A_FLOAT, 0);
+ class_addanything(repeat_class, repeat_anything);
+
+ class_sethelpsymbol(repeat_class, gensym("zexy/repeat"));
+ zexy_register("repeat");
+}
diff --git a/src/z_sfplay.c b/src/sfplay.c
index 39ed4b9..fd3a884 100644
--- a/src/z_sfplay.c
+++ b/src/sfplay.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
sfplay.c - Author: Winfried Ritsch - IEM Graz 10.Mai 99 -
Modified:
@@ -632,7 +648,7 @@ static void sfplay_free(t_sfplay *x)
freebytes(x->filep, DACBLKSIZE*sizeof(short)*x->x_channels);
}
-void z_sfplay_setup(void)
+void sfplay_setup(void)
{
sfplay_class = class_new(gensym("sfplay"), (t_newmethod)sfplay_new, (t_method)sfplay_free,
sizeof(t_sfplay), 0, A_DEFFLOAT, A_DEFFLOAT,0);
@@ -655,4 +671,5 @@ void z_sfplay_setup(void)
class_addfloat(sfplay_class, sfplay_float);
/* start with bang */
class_addbang(sfplay_class,sfplay_bang);
+ zexy_register("sfplay");
}
diff --git a/src/z_sfrecord.c b/src/sfrecord.c
index f7eed96..2aa9515 100644
--- a/src/z_sfrecord.c
+++ b/src/sfrecord.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
sfplay.c - Author: Winfried Ritsch - IEM Graz 10.Mai 99 -
Modified:
@@ -8,7 +24,7 @@ ritsch@iem.kug.ac.at
zmoelnig@iem.kug.ac.at
*/
-/* to do :: add headers for wav, aiff etc files */
+/* TODO: deprecate this in favour of [sfplay~] */
/* #define DEBUG_ME // for debugging messages */
@@ -566,7 +582,7 @@ static void sfrecord_free(t_sfrecord *x)
freebytes(x->filep, DACBLKSIZE*sizeof(short)*x->x_channels);
}
-void z_sfrecord_setup(void)
+void sfrecord_setup(void)
{
sfrecord_class = class_new(gensym("sfrecord"), (t_newmethod)sfrecord_new, (t_method)sfrecord_free,
sizeof(t_sfrecord), 0, A_DEFFLOAT, A_DEFFLOAT,0);
@@ -589,4 +605,5 @@ void z_sfrecord_setup(void)
/* some help */
class_addmethod(sfrecord_class, (t_method)helper, gensym("help"), A_NULL);
class_sethelpsymbol(sfrecord_class, gensym("zexy/sf-play_record"));
+ zexy_register("sfrecord");
}
diff --git a/src/z_sigzero.c b/src/sigzero_tilde.c
index a3f0790..de9584d 100644
--- a/src/z_sigzero.c
+++ b/src/sigzero_tilde.c
@@ -1,8 +1,17 @@
-#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ ******************************************************/
/* ------------------------ sigzero~ ----------------------------- */
/*
@@ -10,6 +19,7 @@
this is really great together with the "switch~"-object
*/
+#include "zexy.h"
static t_class *sigzero_class;
@@ -84,7 +94,7 @@ static void *sigzero_new(t_symbol s)
return (x);
}
-void z_sigzero_setup(void)
+void sigzero_tilde_setup(void)
{
sigzero_class = class_new(gensym("sigzero~"), (t_newmethod)sigzero_new, 0,
sizeof(t_sigzero), 0, 0);
@@ -97,4 +107,5 @@ void z_sigzero_setup(void)
class_addmethod(sigzero_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(sigzero_class, gensym("zexy/sigzero~"));
+ zexy_register("sigzero~");
}
diff --git a/src/z_sort.c b/src/sort.c
index 633d128..97a7dd3 100644
--- a/src/z_sort.c
+++ b/src/sort.c
@@ -1,3 +1,18 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ ******************************************************/
+
/* 1309:forum::für::umläute:2000 */
@@ -102,7 +117,7 @@ static void *sort_new(t_floatarg f)
return (x);
}
-void z_sort_setup(void)
+void sort_setup(void)
{
sort_class = class_new(gensym("sort"), (t_newmethod)sort_new,
0, sizeof(t_sort), 0, A_DEFFLOAT, 0);
@@ -111,4 +126,5 @@ void z_sort_setup(void)
class_addmethod (sort_class, (t_method)sort_dir, gensym("direction"), A_DEFFLOAT, 0);
class_sethelpsymbol(sort_class, gensym("zexy/sort"));
+ zexy_register("sort");
}
diff --git a/src/z_testfun.c b/src/step_tilde.c
index 57d8f20..f1200e7 100644
--- a/src/z_testfun.c
+++ b/src/step_tilde.c
@@ -1,7 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ ******************************************************/
+
/*
-This external makes the two main test-functions available :
-dirac~ : will make a single peak (eg: a 1 in all the 0s) at a desired position in the signal-vector
- the position can be passed as an argument when creating the object
step~ : will make a unity step at a desired point in the signal-vector; the second input specifies a
length: after the so-specified time has elapsed, the step will toggle back to the previous
value;
@@ -14,95 +26,9 @@ NOTE : the inlets do NOT specify any times but sample-NUMBERS; there are 64 samp
*/
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* ------------------------ dirac~ ----------------------------- */
-
-
-static t_class *dirac_class;
-
-typedef struct _dirac
-{
- t_object x_obj;
- t_float position;
- t_float do_it;
-} t_dirac;
-
-static void dirac_bang(t_dirac *x)
-{
- x->do_it = x->position;
-}
-
-static void dirac_float(t_dirac *x, t_float where)
-{
- x->do_it = x->position = where;
-}
-
-static t_int *dirac_perform(t_int *w)
-{
- t_dirac *x = (t_dirac *)(w[1]);
- t_float *out = (t_float *)(w[2]);
- int n = (int)(w[3]);
-
- int do_it = x->do_it;
-
- while (n--)
- {
- *out++ = (!do_it--);
- }
- x->do_it = do_it;
-
- return (w+4);
-}
-
-static void dirac_dsp(t_dirac *x, t_signal **sp)
-{
- dsp_add(dirac_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
-}
-
-static void dirac_helper(void)
-{
- post("%c dirac~-object :: generates a dirac (unity-pulse)", HEARTSYMBOL);
- post("creation : \"dirac~ [<position>]\" : create a dirac at specified position (in samples)\n"
- "inlet\t: <position>\t: create a dirac at new position\n"
- "\t 'bang'\t: create a dirac at specified position\n"
- "\t 'help'\t: view this\n"
- "outlet\t: signal~");
-}
-
-
-
-static void *dirac_new(t_floatarg where)
-{
- t_dirac *x = (t_dirac *)pd_new(dirac_class);
-
- outlet_new(&x->x_obj, gensym("signal"));
-
- x->do_it = 0;
- x->position = where;
- return (x);
-}
-
-void dirac_setup(void)
-{
- dirac_class = class_new(gensym("dirac~"), (t_newmethod)dirac_new, 0,
- sizeof(t_dirac), 0, A_DEFFLOAT, 0);
- class_addfloat(dirac_class, dirac_float);
- class_addbang(dirac_class, dirac_bang);
- class_addmethod(dirac_class, (t_method)dirac_dsp, gensym("dsp"), 0);
-
- class_addmethod(dirac_class, (t_method)dirac_helper, gensym("help"), 0);
- class_sethelpsymbol(dirac_class, gensym("zexy/dirac~"));
-}
-
-
/* ------------------------ step~ ----------------------------- */
-
static t_class *step_class;
typedef struct _step
@@ -198,7 +124,7 @@ static void *step_new(t_floatarg farg)
return (x);
}
-void step_setup(void)
+void step_tilde_setup(void)
{
step_class = class_new(gensym("step~"), (t_newmethod)step_new, 0,
sizeof(t_step), 0, A_DEFFLOAT, 0);
@@ -211,12 +137,5 @@ void step_setup(void)
class_addmethod(step_class, (t_method)step_helper, gensym("help"), 0);
class_sethelpsymbol(step_class, gensym("zexy/step~"));
-}
-
-/* global setup routine */
-
-void z_testfun_setup(void)
-{
- step_setup();
- dirac_setup();
+ zexy_register("step~");
}
diff --git a/src/strcmp.c b/src/strcmp.c
new file mode 100644
index 0000000..4bfeb8b
--- /dev/null
+++ b/src/strcmp.c
@@ -0,0 +1,103 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * strcmp : compare 2 lists as if they were strings
+*/
+
+/* ------------------------- strcmp ------------------------------- */
+
+/* compare 2 lists ( == for lists) */
+
+static t_class *strcmp_class;
+
+typedef struct _strcmp
+{
+ t_object x_obj;
+
+ t_binbuf *bbuf1, *bbuf2;
+} t_strcmp;
+
+static void strcmp_bang(t_strcmp *x)
+{
+ char *str1=0, *str2=0;
+ int n1=0, n2=0;
+ int result = 0;
+
+ binbuf_gettext(x->bbuf1, &str1, &n1);
+ binbuf_gettext(x->bbuf2, &str2, &n2);
+
+ result = strcmp(str1, str2);
+
+ freebytes(str1, n1);
+ freebytes(str2, n2);
+
+ outlet_float(x->x_obj.ob_outlet, result);
+}
+
+static void strcmp_secondlist(t_strcmp *x, t_symbol *s, int argc, t_atom *argv)
+{
+ binbuf_clear(x->bbuf2);
+ binbuf_add(x->bbuf2, argc, argv);
+}
+
+static void strcmp_list(t_strcmp *x, t_symbol *s, int argc, t_atom *argv)
+{
+ binbuf_clear(x->bbuf1);
+ binbuf_add(x->bbuf1, argc, argv);
+
+ strcmp_bang(x);
+}
+
+static void *strcmp_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_strcmp *x = (t_strcmp *)pd_new(strcmp_class);
+
+ outlet_new(&x->x_obj, 0);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2"));
+
+ x->bbuf1 = binbuf_new();
+ x->bbuf2 = binbuf_new();
+
+
+ strcmp_secondlist(x, gensym("list"), argc, argv);
+
+ return (x);
+}
+
+static void strcmp_free(t_strcmp *x)
+{
+ binbuf_free(x->bbuf1);
+ binbuf_free(x->bbuf2);
+}
+
+
+void strcmp_setup(void)
+{
+ strcmp_class = class_new(gensym("strcmp"), (t_newmethod)strcmp_new,
+ (t_method)strcmp_free, sizeof(t_strcmp), 0, A_GIMME, 0);
+
+ class_addbang (strcmp_class, strcmp_bang);
+ class_addlist (strcmp_class, strcmp_list);
+ class_addmethod (strcmp_class, (t_method)strcmp_secondlist, gensym("lst2"), A_GIMME, 0);
+
+ class_sethelpsymbol(strcmp_class, gensym("zexy/strcmp"));
+ zexy_register("strcmp");
+}
diff --git a/src/sum.c b/src/sum.c
new file mode 100644
index 0000000..67019ee
--- /dev/null
+++ b/src/sum.c
@@ -0,0 +1,61 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+
+/* sum :: the sum of a list of floats */
+
+static t_class *sum_class;
+
+typedef struct _sum
+{
+ t_object x_obj;
+} t_sum;
+
+static void sum_list(t_sum *x, t_symbol *s, int argc, t_atom *argv)
+{
+ t_float sum = 0.f;
+
+ while(argc--)sum+=atom_getfloat(argv++);
+
+ outlet_float(x->x_obj.ob_outlet,sum);
+}
+
+static void *sum_new(void)
+{
+ t_sum *x = (t_sum *)pd_new(sum_class);
+
+ outlet_new(&x->x_obj, gensym("float"));
+
+ return (x);
+}
+
+static void sum_help(void)
+{
+ post("sum\t:: calculate the sum of a list of floats");
+}
+
+void sum_setup(void)
+{
+ sum_class = class_new(gensym("sum"), (t_newmethod)sum_new, 0,
+ sizeof(t_sum), 0, A_DEFFLOAT, 0);
+
+ class_addlist(sum_class, (t_method)sum_list);
+ class_addmethod(sum_class, (t_method)sum_help, gensym("help"), 0);
+
+ class_sethelpsymbol(sum_class, gensym("zexy/sum"));
+ zexy_register("sum");
+}
diff --git a/src/swap_tilde.c b/src/swap_tilde.c
new file mode 100644
index 0000000..668d8c2
--- /dev/null
+++ b/src/swap_tilde.c
@@ -0,0 +1,101 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ ******************************************************/
+
+/*
+ the long waited for swap~-object that does a byte swap
+ of course, we unfortunately have to quantize the float-signal to 16bit (to get bytes)
+
+ 1110:forum::für::umläute:1999
+*/
+
+#include "zexy.h"
+
+/* ------------------------ swap~ ----------------------------- */
+#define FLOAT2SHORT 32768.
+#define SHORT2FLOAT 1./32768.
+
+static t_class *swap_class;
+
+typedef struct _swap
+{
+ t_object x_obj;
+ int swapper;
+} t_swap;
+
+static void swap_float(t_swap *x, t_floatarg f)
+{
+ x->swapper = (f != 0);
+}
+
+static void swap_bang(t_swap *x)
+{
+ x->swapper ^= 1;
+}
+
+static t_int *swap_perform(t_int *w)
+{
+ t_swap *x = (t_swap *)(w[1]);
+ t_float *in = (t_float *)(w[2]);
+ t_float *out = (t_float *)(w[3]);
+ int n = (int)(w[4]);
+
+
+ if (x->swapper)
+ while (n--) {
+ short dummy = FLOAT2SHORT * *in++;
+ *out++ = SHORT2FLOAT * (short)( ((dummy & 0xFF) << 8) | ((dummy & 0xFF00) >> 8) );
+ }
+ else while (n--) *out++ = *in++;
+
+ return (w+5);
+}
+
+static void swap_dsp(t_swap *x, t_signal **sp)
+{
+ dsp_add(swap_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
+}
+
+static void swap_helper(void)
+{
+ post("\n%c swap~-object for byteswapping a signal", HEARTSYMBOL);
+ post("<1/0> : turn the swapper on/off\n"
+ "'bang' : toggle the swapper on/off\n"
+ "'help' : view this\n"
+ "signal~");
+ post("outlet : signal~");
+}
+
+static void *swap_new()
+{
+ t_swap *x = (t_swap *)pd_new(swap_class);
+ outlet_new(&x->x_obj, gensym("signal"));
+ x->swapper = 1;
+ return (x);
+}
+
+void swap_tilde_setup(void)
+{
+ swap_class = class_new(gensym("swap~"), (t_newmethod)swap_new, 0,
+ sizeof(t_swap), 0, A_DEFFLOAT, 0);
+ class_addmethod(swap_class, nullfn, gensym("signal"), 0);
+ class_addmethod(swap_class, (t_method)swap_dsp, gensym("dsp"), 0);
+
+ class_addfloat(swap_class, swap_float);
+ class_addbang(swap_class, swap_bang);
+
+ class_addmethod(swap_class, (t_method)swap_helper, gensym("help"), 0);
+ class_sethelpsymbol(swap_class, gensym("zexy/swap~"));
+ zexy_register("swap~");
+}
diff --git a/src/symbol2list.c b/src/symbol2list.c
new file mode 100644
index 0000000..7a29e2a
--- /dev/null
+++ b/src/symbol2list.c
@@ -0,0 +1,163 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef NT
+# define STATIC_INLINE static
+#endif
+
+/*
+ * symbol2list: convert a symbol into a list (with given delimiters)
+*/
+
+/* ------------------------- symbol2list ------------------------------- */
+
+static t_class *symbol2list_class;
+
+typedef struct _symbol2list
+{
+ t_object x_obj;
+ t_symbol *s, *delimiter;
+ t_atom *argv;
+ int argc, argnum; /* "argnum" is the number of reserved atoms (might be >argc) */
+} t_symbol2list;
+
+static void symbol2list_delimiter(t_symbol2list *x, t_symbol *s){
+ x->delimiter = s;
+}
+
+STATIC_INLINE void string2atom(t_atom *ap, char* cp, int clen){
+ char *buffer=getbytes(sizeof(char)*(clen+1));
+ char *endptr[1];
+ t_float ftest;
+ strncpy(buffer, cp, clen);
+ buffer[clen]=0;
+ // post("converting buffer '%s' %d", buffer, clen);
+ ftest=strtod(buffer, endptr);
+ if (*endptr == buffer){
+ /* strtof() failed, we have a symbol */
+ SETSYMBOL(ap, gensym(buffer));
+ } else {
+ /* it is a number. */
+ SETFLOAT(ap,ftest);
+ }
+ freebytes(buffer, sizeof(char)*(clen+1));
+}
+static void symbol2list_process(t_symbol2list *x)
+{
+ char *cc;
+ char *deli;
+ int dell;
+ char *cp, *d;
+ int i=1;
+
+ if (x->s==NULL){
+ x->argc=0;
+ return;
+ }
+ cc=x->s->s_name;
+ cp=cc;
+
+ if (x->delimiter==NULL || x->delimiter==&s_){
+ i=strlen(cc);
+ if(x->argnum<i){
+ freebytes(x->argv, x->argnum*sizeof(t_atom));
+ x->argnum=i+10;
+ x->argv=getbytes(x->argnum*sizeof(t_atom));
+ }
+ x->argc=i;
+ while(i--)string2atom(x->argv+i, cc+i, 1);
+ return;
+ }
+
+ deli=x->delimiter->s_name;
+ dell=strlen(deli);
+
+
+ /* get the number of tokens */
+ while((d=strstr(cp, deli))){
+ if (d!=NULL && d!=cp){
+ i++;
+ }
+ cp=d+dell;
+ }
+
+ /* resize the list-buffer if necessary */
+ if(x->argnum<i){
+ freebytes(x->argv, x->argnum*sizeof(t_atom));
+ x->argnum=i+10;
+ x->argv=getbytes(x->argnum*sizeof(t_atom));
+ }
+ x->argc=i;
+ /* parse the tokens into the list-buffer */
+ i=0;
+
+ /* find the first token */
+ cp=cc;
+ while(cp==(d=strstr(cp,deli))){cp+=dell;}
+ while((d=strstr(cp, deli))){
+ if(d!=cp){
+ string2atom(x->argv+i, cp, d-cp);
+ i++;
+ }
+ cp=d+dell;
+ }
+
+ if(cp)string2atom(x->argv+i, cp, strlen(cp));
+}
+static void symbol2list_bang(t_symbol2list *x){
+ symbol2list_process(x);
+ if(x->argc)outlet_list(x->x_obj.ob_outlet, 0, x->argc, x->argv);
+}
+static void symbol2list_symbol(t_symbol2list *x, t_symbol *s){
+ x->s = s;
+ symbol2list_bang(x);
+}
+static void *symbol2list_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_symbol2list *x = (t_symbol2list *)pd_new(symbol2list_class);
+
+ outlet_new(&x->x_obj, 0);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym(""));
+
+ x->argc=0;
+ x->argnum=16;
+ x->argv=getbytes(x->argnum*sizeof(t_atom));
+ symbol2list_delimiter(x, (argc)?atom_getsymbol(argv):gensym(" "));
+
+ return (x);
+}
+
+static void symbol2list_free(t_symbol2list *x)
+{
+}
+
+void symbol2list_setup(void)
+{
+ symbol2list_class = class_new(gensym("symbol2list"), (t_newmethod)symbol2list_new,
+ (t_method)symbol2list_free, sizeof(t_symbol2list), 0, A_GIMME, 0);
+
+ class_addcreator((t_newmethod)symbol2list_new, gensym("s2l"), A_GIMME, 0);
+ class_addsymbol (symbol2list_class, symbol2list_symbol);
+ class_addbang (symbol2list_class, symbol2list_bang);
+ class_addmethod (symbol2list_class, (t_method)symbol2list_delimiter, gensym(""), A_SYMBOL, 0);
+
+ class_sethelpsymbol(symbol2list_class, gensym("zexy/symbol2list"));
+ zexy_register("symbol2list");
+}
diff --git a/src/tabdump.c b/src/tabdump.c
new file mode 100644
index 0000000..d308454
--- /dev/null
+++ b/src/tabdump.c
@@ -0,0 +1,117 @@
+
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
+/* hack : 2108:forum::für::umläute:1999 @ iem */
+
+#include "zexy.h"
+
+
+/* =================== tabdump ====================== */
+
+static t_class *tabdump_class;
+
+typedef struct _tabdump
+{
+ t_object x_obj;
+ t_symbol *x_arrayname;
+ t_int startindex, stopindex;
+} t_tabdump;
+
+static void tabdump_bang(t_tabdump *x)
+{
+ t_garray *A;
+ int npoints;
+ t_float *vec;
+
+ if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
+ error("%s: no such array", x->x_arrayname->s_name);
+ else if (!garray_getfloatarray(A, &npoints, &vec))
+ error("%s: bad template for tabdump", x->x_arrayname->s_name);
+ else
+ {
+ int n;
+ t_atom *atombuf;
+
+ int start=x->startindex;
+ int stop =x->stopindex;
+ if(start<0||start>stop)start=0;
+ if(stop<start||stop>npoints)stop=npoints;
+ npoints=stop-start;
+
+ atombuf = (t_atom *)getbytes(sizeof(t_atom)*npoints);
+ for (n = 0; n < npoints; n++) SETFLOAT(&atombuf[n], vec[start+n]);
+ outlet_list(x->x_obj.ob_outlet, &s_list, npoints, atombuf);
+ freebytes(atombuf,sizeof(t_atom)*npoints);
+ }
+}
+
+static void tabdump_list(t_tabdump *x, t_symbol*s,int argc, t_atom*argv)
+{
+ int a,b;
+ switch(argc){
+ case 2:
+ a=atom_getint(argv);
+ b=atom_getint(argv+1);
+ x->startindex=(a<b)?a:b;
+ x->stopindex =(a>b)?a:b;
+ tabdump_bang(x);
+ break;
+ default:
+ error("tabdump: list must be 2 floats (is %d atoms)", argc);
+ }
+}
+
+static void tabdump_set(t_tabdump *x, t_symbol *s)
+{
+ x->x_arrayname = s;
+}
+
+static void *tabdump_new(t_symbol *s)
+{
+ t_tabdump *x = (t_tabdump *)pd_new(tabdump_class);
+ x->x_arrayname = s;
+ x->startindex=0;
+ x->stopindex=-1;
+ outlet_new(&x->x_obj, &s_list);
+
+ return (x);
+}
+
+static void tabdump_helper(void)
+{
+ post("\n%c tabdump - object : dumps a table as a package of floats", HEARTSYMBOL);
+ post("'set <table>'\t: read out another table\n"
+ "'bang'\t\t: dump the table\n"
+ "outlet\t\t: table-data as package of floats");
+ post("creation\t: \"tabdump <table>\"");
+
+}
+
+void tabdump_setup(void)
+{
+ tabdump_class = class_new(gensym("tabdump"), (t_newmethod)tabdump_new,
+ 0, sizeof(t_tabdump), 0, A_DEFSYM, 0);
+ class_addbang(tabdump_class, (t_method)tabdump_bang);
+ class_addlist(tabdump_class, (t_method)tabdump_list);
+
+ class_addmethod(tabdump_class, (t_method)tabdump_set, gensym("set"),
+ A_SYMBOL, 0);
+
+ class_addmethod(tabdump_class, (t_method)tabdump_helper, gensym("help"), 0);
+ class_sethelpsymbol(tabdump_class, gensym("zexy/tabdump"));
+}
diff --git a/src/tabminmax.c b/src/tabminmax.c
new file mode 100644
index 0000000..56307e2
--- /dev/null
+++ b/src/tabminmax.c
@@ -0,0 +1,140 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* hack : 2108:forum::für::umläute:1999 @ iem */
+
+#include "zexy.h"
+
+
+/* =================== tabminmax ====================== */
+
+static t_class *tabminmax_class;
+
+typedef struct _tabminmax
+{
+ t_object x_obj;
+ t_outlet*min_out, *max_out;
+ t_symbol *x_arrayname;
+ t_int startindex, stopindex;
+} t_tabminmax;
+
+static void tabminmax_bang(t_tabminmax *x)
+{
+ t_garray *A;
+ int npoints;
+ t_float *vec;
+
+ if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
+ error("%s: no such array", x->x_arrayname->s_name);
+ else if (!garray_getfloatarray(A, &npoints, &vec))
+ error("%s: bad template for tabminmax", x->x_arrayname->s_name);
+ else
+ {
+ int n;
+ t_atom atombuf[2];
+ t_float min, max;
+ int mindex, maxdex;
+
+ int start=x->startindex;
+ int stop =x->stopindex;
+ if(start<0||start>stop)start=0;
+ if(stop<start||stop>npoints)stop=npoints;
+ npoints=stop-start;
+
+ min=vec[start];
+ max=vec[start];
+
+ mindex=start;
+ maxdex=start;
+
+ for (n = 1; n < npoints; n++){
+ t_float val=vec[start+n];
+ if(val<min){
+ mindex=start+n;
+ min=val;
+ }
+ if(val>max){
+ maxdex=start+n;
+ max=val;
+ }
+ }
+
+ SETFLOAT(atombuf, max);
+ SETFLOAT(atombuf+1, maxdex);
+ outlet_list(x->max_out, &s_list, 2, atombuf);
+
+ SETFLOAT(atombuf, min);
+ SETFLOAT(atombuf+1, mindex);
+ outlet_list(x->min_out, &s_list, 2, atombuf);
+ }
+}
+
+static void tabminmax_list(t_tabminmax *x, t_symbol*s,int argc, t_atom*argv)
+{
+ int a,b;
+ switch(argc){
+ case 2:
+ a=atom_getint(argv);
+ b=atom_getint(argv+1);
+ x->startindex=(a<b)?a:b;
+ x->stopindex =(a>b)?a:b;
+ tabminmax_bang(x);
+ break;
+ default:
+ error("tabminmax: list must be 2 floats (is %d atoms)", argc);
+ }
+}
+
+static void tabminmax_set(t_tabminmax *x, t_symbol *s)
+{
+ x->x_arrayname = s;
+}
+
+static void *tabminmax_new(t_symbol *s)
+{
+ t_tabminmax *x = (t_tabminmax *)pd_new(tabminmax_class);
+ x->x_arrayname = s;
+ x->startindex=0;
+ x->stopindex=-1;
+ x->min_out=outlet_new(&x->x_obj, &s_list);
+ x->max_out=outlet_new(&x->x_obj, &s_list);
+
+ return (x);
+}
+
+static void tabminmax_helper(void)
+{
+ post("\n%c tabminmax - object : dumps a table as a package of floats", HEARTSYMBOL);
+ post("'set <table>'\t: read out another table\n"
+ "'bang'\t\t: get min and max of the table\n"
+ "outlet\t\t: table-data as package of floats");
+ post("creation\t: \"tabminmax <table>\"");
+
+}
+
+void tabminmax_setup(void)
+{
+ tabminmax_class = class_new(gensym("tabminmax"), (t_newmethod)tabminmax_new,
+ 0, sizeof(t_tabminmax), 0, A_DEFSYM, 0);
+ class_addbang(tabminmax_class, (t_method)tabminmax_bang);
+ class_addlist(tabminmax_class, (t_method)tabminmax_list);
+
+ class_addmethod(tabminmax_class, (t_method)tabminmax_set, gensym("set"),
+ A_SYMBOL, 0);
+
+ class_addmethod(tabminmax_class, (t_method)tabminmax_helper, gensym("help"), 0);
+ class_sethelpsymbol(tabminmax_class, gensym("zexy/tabminmax"));
+}
diff --git a/src/tabset.c b/src/tabset.c
new file mode 100644
index 0000000..9234935
--- /dev/null
+++ b/src/tabset.c
@@ -0,0 +1,102 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/* hack : 2108:forum::für::umläute:1999 @ iem */
+
+#include "zexy.h"
+
+
+/* =================== tabset ====================== */
+
+static t_class *tabset_class;
+
+typedef struct _tabset
+{
+ t_object x_obj;
+ t_symbol *x_arrayname;
+} t_tabset;
+
+static void tabset_float(t_tabset *x, t_floatarg f)
+{
+ t_garray *A;
+ int npoints;
+ t_float *vec;
+
+ if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
+ error("%s: no such array", x->x_arrayname->s_name);
+ else if (!garray_getfloatarray(A, &npoints, &vec))
+ error("%s: bad template for tabset", x->x_arrayname->s_name);
+ else {
+ while(npoints--)*vec++=f;
+ garray_redraw(A);
+ }
+}
+
+static void tabset_list(t_tabset *x, t_symbol *s, int argc, t_atom* argv)
+{
+ t_garray *A;
+ int npoints;
+ t_float *vec;
+
+ if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
+ error("%s: no such array", x->x_arrayname->s_name);
+ else if (!garray_getfloatarray(A, &npoints, &vec))
+ error("%s: bad template for tabset", x->x_arrayname->s_name);
+ else {
+ if (argc>=npoints)
+ while(npoints--)*vec++=atom_getfloat(argv++);
+ else {
+ npoints-=argc;
+ while (argc--)*vec++=atom_getfloat(argv++);
+ while (npoints--)*vec++=0;
+ }
+ garray_redraw(A);
+ }
+}
+static void tabset_set(t_tabset *x, t_symbol *s)
+{
+ x->x_arrayname = s;
+}
+
+static void *tabset_new(t_symbol *s)
+{
+ t_tabset *x = (t_tabset *)pd_new(tabset_class);
+ x->x_arrayname = s;
+
+ return (x);
+}
+
+static void tabset_helper(void)
+{
+ post("\n%c tabset - object : set a table with a package of floats", HEARTSYMBOL);
+ post("'set <table>'\t: set another table\n"
+ "<list>\t\t: set the table"
+ "<float>\t\t: set the table to constant float\n");
+ post("creation\t: \"tabset <table>\"");
+}
+
+void tabset_setup(void)
+{
+ tabset_class = class_new(gensym("tabset"), (t_newmethod)tabset_new,
+ 0, sizeof(t_tabset), 0, A_DEFSYM, 0);
+ class_addfloat(tabset_class, (t_method)tabset_float);
+ class_addlist (tabset_class, (t_method)tabset_list);
+ class_addmethod(tabset_class, (t_method)tabset_set, gensym("set"),
+ A_SYMBOL, 0);
+
+ class_addmethod(tabset_class, (t_method)tabset_helper, gensym("help"), 0);
+ class_sethelpsymbol(tabset_class, gensym("zexy/tabset"));
+}
diff --git a/src/tavg_tilde.c b/src/tavg_tilde.c
new file mode 100644
index 0000000..cddbd41
--- /dev/null
+++ b/src/tavg_tilde.c
@@ -0,0 +1,99 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "zexy.h"
+#include <math.h>
+
+#ifdef NT
+#define sqrtf sqrt
+#endif
+
+#ifdef MACOSX
+#define sqrtf sqrt
+#endif
+
+
+
+/* triggered average :: arithmetic mean between last and current BANG */
+
+static t_class *tavg_class;
+
+typedef struct _tavg
+{
+ t_object x_obj;
+ t_float n_inv;
+ t_float buf;
+ int blocks;
+} t_tavgtilde;
+
+
+static void tavg_bang(t_tavgtilde *x)
+{
+ if (x->blocks) {
+ outlet_float(x->x_obj.ob_outlet, x->buf*x->n_inv/x->blocks);
+ x->blocks = 0;
+ x->buf = 0.;
+ }
+}
+
+static t_int *tavg_perform(t_int *w)
+{
+ t_float *in = (t_float *)(w[1]);
+ t_tavgtilde *x = (t_tavgtilde *)w[2];
+ int n = (int)(w[3]);
+
+ t_float buf = x->buf;
+
+ while (n--) buf += *in++;
+
+ x->buf = buf;
+ x->blocks++;
+
+ return (w+4);
+}
+
+static void tavg_dsp(t_tavgtilde *x, t_signal **sp)
+{
+ x->n_inv=1./sp[0]->s_n;
+ dsp_add(tavg_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
+}
+
+static void *tavg_new(void)
+{
+ t_tavgtilde *x = (t_tavgtilde *)pd_new(tavg_class);
+ outlet_new(&x->x_obj, gensym("float"));
+ return (x);
+}
+
+static void tavg_help(void)
+{
+ post("tavg~\t\t:: outputs the arithmetic mean of a signal when triggered");
+ post("<bang>\t\t: triggers the output");
+}
+
+void tavg_tilde_setup(void)
+{
+ tavg_class = class_new(gensym("tavg~"), (t_newmethod)tavg_new, 0,
+ sizeof(t_tavgtilde), 0, A_DEFFLOAT, 0);
+ class_addmethod(tavg_class, nullfn, gensym("signal"), 0);
+ class_addmethod(tavg_class, (t_method)tavg_dsp, gensym("dsp"), 0);
+
+ class_addbang(tavg_class, tavg_bang);
+
+ class_addmethod(tavg_class, (t_method)tavg_help, gensym("help"), 0);
+ class_sethelpsymbol(tavg_class, gensym("zexy/tavg~"));
+ zexy_register("tavg~");
+}
diff --git a/src/time.c b/src/time.c
new file mode 100644
index 0000000..4f54871
--- /dev/null
+++ b/src/time.c
@@ -0,0 +1,122 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+/*
+ (c) 1202:forum::für::umläute:2000
+ 1506:forum::für::umläute:2003: use timeb only if needed (like on windoze)
+
+ "time" gets the current time from the system
+ "date" gets the current date from the system
+
+*/
+
+#ifdef NT
+#define USE_TIMEB
+#endif
+
+#ifdef MACOSX
+#include <sys/types.h>
+/* typedef _BSD_TIME_T_ time_t; */
+#endif
+
+
+#include "zexy.h"
+#include <time.h>
+
+#ifdef USE_TIMEB
+#include <sys/timeb.h>
+#else
+#include <sys/time.h>
+#endif
+
+
+/* ----------------------- time --------------------- */
+
+static t_class *time_class;
+
+typedef struct _time
+{
+ t_object x_obj;
+
+ int GMT;
+
+ t_outlet *x_outlet1;
+ t_outlet *x_outlet2;
+ t_outlet *x_outlet3;
+ t_outlet *x_outlet4;
+} t_time;
+
+static void *time_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_time *x = (t_time *)pd_new(time_class);
+ char buf[5];
+
+ x->GMT=0;
+ if (argc) {
+ atom_string(argv, buf, 5);
+ if (buf[0]=='G' && buf[1]=='M' && buf[2]=='T')
+ x->GMT = 1;
+ }
+
+ x->x_outlet1 = outlet_new(&x->x_obj, &s_float);
+ x->x_outlet2 = outlet_new(&x->x_obj, &s_float);
+ x->x_outlet3 = outlet_new(&x->x_obj, &s_float);
+ x->x_outlet4 = outlet_new(&x->x_obj, &s_float);
+
+ return (x);
+}
+
+static void time_bang(t_time *x)
+{
+ struct tm *resolvetime;
+ float ms = 0.f;
+#ifdef USE_TIMEB
+ struct timeb mytime;
+ ftime(&mytime);
+ resolvetime = (x->GMT)?gmtime(&mytime.time):localtime(&mytime.time);
+ ms=mytime.millitm;
+#else
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ resolvetime = (x->GMT)?gmtime(&tv.tv_sec):localtime(&tv.tv_sec);
+ ms = tv.tv_usec*0.001;
+#endif
+ // outlet_float(x->x_outlet4, (t_float)(mytime.millitm));
+ outlet_float(x->x_outlet4, (t_float)(ms));
+ outlet_float(x->x_outlet3, (t_float)resolvetime->tm_sec);
+ outlet_float(x->x_outlet2, (t_float)resolvetime->tm_min);
+ outlet_float(x->x_outlet1, (t_float)resolvetime->tm_hour);
+}
+
+static void help_time(t_time *x)
+{
+ post("\n%c time\t\t:: get the current system time", HEARTSYMBOL);
+ post("\noutputs are\t: hour / minute / sec / msec");
+ post("\ncreation\t:: 'time [GMT]': show local time or GMT");
+}
+
+void time_setup(void)
+{
+ time_class = class_new(gensym("time"),
+ (t_newmethod)time_new, 0,
+ sizeof(t_time), 0, A_GIMME, 0);
+
+ class_addbang(time_class, time_bang);
+
+ class_addmethod(time_class, (t_method)help_time, gensym("help"), 0);
+ class_sethelpsymbol(time_class, gensym("zexy/time"));
+ zexy_register("time");
+}
diff --git a/src/z_sigpack.c b/src/unpack_tilde.c
index d614543..f65d745 100644
--- a/src/z_sigpack.c
+++ b/src/unpack_tilde.c
@@ -1,84 +1,29 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/* 0109:forum::für::umläute:2000
- pack~ :: convert signals to float-packages
unpack~ :: convert float-(package)-inputs to signals
*/
-#include "zexy.h"
-#include <math.h>
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* ------------------------ pack~ ----------------------------- */
-/* pack the signal-vector to a float-package :: ~2message */
-
-static t_class *sigpack_class;
-
-typedef struct _sigpack
-{
- t_object x_obj;
-
- int vector_length;
- t_atom *buffer;
-
-} t_sigpack;
-
-static t_int *sigpack_perform(t_int *w)
-{
- t_float *in = (t_float *)(w[1]);
- t_sigpack *x = (t_sigpack *)w[2];
- int n = (int)(w[3]), i = 0;
- t_atom *buf = x->buffer;
-
- while (n--) {
- SETFLOAT(&buf[i], *in++);
- i++;
- }
- outlet_list(x->x_obj.ob_outlet, &s_list, x->vector_length, x->buffer);
-
- return (w+4);
-}
-
-static void sigpack_dsp(t_sigpack *x, t_signal **sp)
-{
- if (x->vector_length != sp[0]->s_n) {
- freebytes(x->buffer, x->vector_length * sizeof(t_atom));
- x->vector_length = sp[0]->s_n;
- x->buffer = (t_atom *)getbytes(x->vector_length * sizeof(t_atom));
- }
- dsp_add(sigpack_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
-}
-
-static void *sigpack_new(void)
-{
- t_sigpack *x = (t_sigpack *)pd_new(sigpack_class);
- x->vector_length = 0;
- x->buffer = 0;
- outlet_new(&x->x_obj, gensym("list"));
-
- return (x);
-}
-
-static void sigpack_help(void)
-{
- post("pack~\t:: outputs the signal-vectors as float-packages");
-}
-
-void sigpack_setup(void)
-{
- sigpack_class = class_new(gensym("pack~"), (t_newmethod)sigpack_new, 0,
- sizeof(t_sigpack), 0, A_DEFFLOAT, 0);
- class_addmethod(sigpack_class, nullfn, gensym("signal"), 0);
- class_addmethod(sigpack_class, (t_method)sigpack_dsp, gensym("dsp"), 0);
+/* ---------------------------- unpack~ ----------------------------- */
+/* unpack a sequence of float-package to a signal-vector */
- class_addmethod(sigpack_class, (t_method)sigpack_help, gensym("help"), 0);
- class_sethelpsymbol(sigpack_class, gensym("zexy/pack~"));
-}
-/* ---------------------------- unpack~ ----------------------------- */
-/* unpack a sequence of float-package to a signal-vector :: message2~ */
+#include "zexy.h"
+#include <math.h>
static t_class *sigunpack_class;
@@ -174,7 +119,7 @@ static void sigunpack_help(void)
post("unpack~\t:: outputs a sequence of floats as a signal");
}
-void sigunpack_setup(void)
+void unpack_tilde_setup(void)
{
sigunpack_class = class_new(gensym("unpack~"), (t_newmethod)sigunpack_new, 0,
sizeof(t_sigunpack), 0, A_DEFFLOAT, 0);
@@ -185,14 +130,5 @@ void sigunpack_setup(void)
class_addmethod(sigunpack_class, (t_method)sigunpack_help, gensym("help"), 0);
class_sethelpsymbol(sigunpack_class, gensym("zexy/unpack~"));
-}
-
-
-
-/* global setup routine */
-
-void z_sigpack_setup(void)
-{
- sigunpack_setup();
- sigpack_setup();
+ zexy_register("unpack~");
}
diff --git a/src/z_random.c b/src/urn.c
index c428fcf..83f94e9 100644
--- a/src/z_random.c
+++ b/src/urn.c
@@ -1,3 +1,18 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
/* 1008:forum::für::umläute:2001 */
@@ -123,7 +138,7 @@ static void *urn_new(t_symbol *s, int argc, t_atom *argv)
return (x);
}
-static void urn_setup(void)
+void urn_setup(void)
{
urn_class = class_new(gensym("urn"), (t_newmethod)urn_new,
0, sizeof(t_urn), 0, A_GIMME, 0);
@@ -135,9 +150,5 @@ static void urn_setup(void)
class_sethelpsymbol(urn_class, gensym("zexy/urn"));
-}
-
-void z_random_setup(void)
-{
- urn_setup();
+ zexy_register("urn");
}
diff --git a/src/winNT_portio.c b/src/winNT_portio.c
new file mode 100644
index 0000000..d892977
--- /dev/null
+++ b/src/winNT_portio.c
@@ -0,0 +1,107 @@
+/*
+ * this is a wrapper for the cor port i/o functions for WinNT/2000/XP.
+ * this is to be replaced by some functions that are platform/interface
+ * specific to access the data lines.
+ * for now, this is only for parport access, but in future there will be a way
+ * to plug this on the usb bus.
+ * if the interface changes, only this file has to be adopted for the target system
+ */
+#ifdef NT
+
+#include <stdio.h>
+#include <windows.h>
+
+int read_parport(int port);
+void write_parport(int port, int value);
+int open_port(int port);
+
+static BOOL bPrivException = FALSE;
+
+int read_parport(int port)
+{
+ // byte = _inp((unsigned short)port);
+ unsigned char value;
+
+ __asm mov edx,port
+ __asm in al,dx
+ __asm mov value,al
+ return (int)value;
+}
+
+void write_parport(int port, int invalue)
+{
+ // _outp((unsigned short)port, value);
+ BYTE value = (BYTE)invalue;
+ __asm mov edx,port
+ __asm mov al,value
+ __asm out dx,al
+}
+
+static LONG WINAPI HandlerExceptionFilter ( EXCEPTION_POINTERS *pExPtrs )
+{
+
+ if (pExPtrs->ExceptionRecord->ExceptionCode == EXCEPTION_PRIV_INSTRUCTION)
+ {
+ pExPtrs->ContextRecord->Eip ++; // Skip the OUT or IN instruction that caused the exception
+ bPrivException = TRUE;
+ return EXCEPTION_CONTINUE_EXECUTION;
+ }
+ else
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
+static BOOL StartUpIoPorts(UINT PortToAccess, BOOL bShowMessageBox, HWND hParentWnd)
+{
+ HANDLE hUserPort;
+
+ hUserPort = CreateFile("\\\\.\\UserPort", GENERIC_READ, 0, NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ CloseHandle(hUserPort); // Activate the driver
+ Sleep(100); // We must make a process switch
+
+ SetUnhandledExceptionFilter(HandlerExceptionFilter);
+
+ bPrivException = FALSE;
+ read_parport(PortToAccess); // Try to access the given port address
+
+ if (bPrivException)
+ {
+ if (bShowMessageBox)
+ {
+#if 0
+ MessageBox(hParentWnd,"Privileged instruction exception has occured!\r\n\r\n"
+ "To use this external under Windows NT, 2000 or XP\r\n"
+ "you need to install the driver 'UserPort.sys' and grant\r\n"
+ "access to the ports used by this program.\r\n\r\n"
+ "See the file README for further information!\r\n", NULL, MB_OK);
+#endif
+ }
+ return FALSE;
+ }
+ return TRUE;
+}
+ /* check if we are running NT/2k/XP */
+static int IsWinNT(void)
+{
+ OSVERSIONINFO OSVersionInfo;
+ OSVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ GetVersionEx(&OSVersionInfo);
+
+ return OSVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT;
+}
+
+ /* open parport */
+int open_port(int port)
+{
+ if(IsWinNT()) /* we are under NT and need kernel driver */
+ {
+ if(StartUpIoPorts(port, 1, 0))
+ return(0);
+ return(-1);
+ }
+ else /* no need to use kernel driver */
+ {
+ return(0);
+ }
+}
+#endif /* NT */
diff --git a/src/z_wrap.c b/src/wrap.c
index 80b0fcd..9707f3f 100644
--- a/src/z_wrap.c
+++ b/src/wrap.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/* wrap floats between to limits */
#include "zexy.h"
@@ -52,7 +68,7 @@ void *wrap_new(t_symbol *s, int argc, t_atom*argv)
return (void *)x;
}
-void z_wrap_setup(void) {
+void wrap_setup(void) {
wrap_class = class_new(gensym("wrap"),
(t_newmethod)wrap_new,
0, sizeof(t_wrap),
@@ -61,4 +77,5 @@ void z_wrap_setup(void) {
class_addfloat (wrap_class, wrap_float);
class_addmethod(wrap_class, (t_method)wrap_set, gensym("set"), A_GIMME, 0);
class_sethelpsymbol(wrap_class, gensym("zexy/wrap"));
+ zexy_register("wrap");
}
diff --git a/src/z_connective.c b/src/z_connective.c
deleted file mode 100644
index d54f476..0000000
--- a/src/z_connective.c
+++ /dev/null
@@ -1,621 +0,0 @@
-/* 2305:forum::für::umläute:2001 */
-
-/* connective objects */
-
-/*
- segregate : segregate atoms by their types
- nop : a do-nothing, pass-everything
- lister : the same as "float" for floats but for packages
- a2l : convert "anything" to "list"
- list2int : cast all floats of a list to integers
- glue : glue 2 lists together (append,...)
- . : scalar mult
- repeat : repeat a message a given number times
- TODO : any
-*/
-
-#include "zexy.h"
-#include <string.h>
-
-/* -------------------- segregate ------------------------------ */
-
-/*
- sorts the input by type ::
- known types are (in order of their outlets ::
- BANG, FLOAT, SYMBOL, LIST, POINTER, ANYTHING
-*/
-
-static t_class *segregate_class;
-
-typedef struct _segregate
-{
- t_object x_obj;
-
- t_outlet *bang_out, *float_out, *symbol_out, *list_out, *pointer_out, *any_out;
-} t_segregate;
-
-static void segregate_bang(t_segregate *x)
-{ outlet_bang(x->bang_out); }
-
-static void segregate_float(t_segregate *x, t_float f)
-{ outlet_float(x->float_out, f); }
-
-static void segregate_symbol(t_segregate *x, t_symbol *s)
-{ outlet_symbol(x->symbol_out, s); }
-
-static void segregate_pointer(t_segregate *x, t_gpointer *gp)
-{ outlet_pointer(x->pointer_out, gp); }
-
-static void segregate_list(t_segregate *x, t_symbol *s, int argc, t_atom *argv)
-{ outlet_list(x->list_out, s, argc, argv); }
-
-static void segregate_anything(t_segregate *x, t_symbol *s, int argc, t_atom *argv)
-{ outlet_anything(x->any_out, s, argc, argv); }
-
-static void *segregate_new(t_symbol *s)
-{
- t_segregate *x = (t_segregate *)pd_new(segregate_class);
-
- x->bang_out = outlet_new(&x->x_obj, &s_bang);
- x->float_out = outlet_new(&x->x_obj, &s_float);
- x->symbol_out = outlet_new(&x->x_obj, &s_symbol);
- x->list_out = outlet_new(&x->x_obj, &s_list);
- x->pointer_out = outlet_new(&x->x_obj, &s_pointer);
- x->any_out = outlet_new(&x->x_obj, 0);
-
- return (x);
-}
-
-static void segregate_setup(void)
-{
- segregate_class = class_new(gensym("segregate"), (t_newmethod)segregate_new,
- 0, sizeof(t_segregate), 0, 0);
-
- class_addbang(segregate_class, segregate_bang);
- class_addfloat(segregate_class, (t_method)segregate_float);
- class_addsymbol(segregate_class, segregate_symbol);
- class_addpointer(segregate_class, segregate_pointer);
- class_addlist(segregate_class, segregate_list);
- class_addanything(segregate_class, segregate_anything);
-
- class_sethelpsymbol(segregate_class, gensym("zexy/segregate"));
-}
-
-/* ------------------------- nop ------------------------------- */
-
-/* a no-operation - just pass through what you get in */
-
-static t_class *nop_class;
-
-typedef struct _nop
-{
- t_object x_obj;
-} t_nop;
-
-static void nop_anything(t_nop *x, t_symbol *s, int argc, t_atom *argv)
-{ outlet_anything(x->x_obj.ob_outlet, s, argc, argv);}
-
-static void nop_list(t_nop *x, t_symbol *s, int argc, t_atom *argv)
-{ outlet_list(x->x_obj.ob_outlet, s, argc, argv);}
-
-static void nop_float(t_nop *x, t_floatarg f)
-{ outlet_float(x->x_obj.ob_outlet, f);}
-
-static void nop_symbol(t_nop *x, t_symbol *s)
-{ outlet_symbol(x->x_obj.ob_outlet, s);}
-
-static void nop_pointer(t_nop *x, t_gpointer *gp)
-{ outlet_pointer(x->x_obj.ob_outlet, gp);}
-
-static void nop_bang(t_nop *x)
-{ outlet_bang(x->x_obj.ob_outlet);}
-
-static void *nop_new(void)
-{
- t_nop *x = (t_nop *)pd_new(nop_class);
- outlet_new(&x->x_obj, 0);
- return (x);
-}
-
-static void nop_setup(void)
-{
- nop_class = class_new(gensym("nop"), (t_newmethod)nop_new,
- 0, sizeof(t_nop), 0, 0);
-
- class_addbang (nop_class, nop_bang);
- class_addfloat (nop_class, nop_float);
- class_addsymbol (nop_class, nop_symbol);
- class_addpointer (nop_class, nop_pointer);
- class_addlist (nop_class, nop_list);
- class_addanything(nop_class, nop_anything);
-
- class_sethelpsymbol(nop_class, gensym("zexy/nop"));
-}
-
-
-
-
-/* ------------------------- a2l ------------------------------- */
-
-/* convert anythings to lists, pass through the rest */
-
-static t_class *a2l_class;
-
-typedef struct _a2l
-{
- t_object x_obj;
-} t_a2l;
-
-static void a2l_anything(t_a2l *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n = argc+1;
- t_atom *cur, *alist = (t_atom *)getbytes(n * sizeof(t_atom));
-
- cur = alist;
- SETSYMBOL(cur, s);
- cur++;
-
- memcpy(cur, argv, argc * sizeof(t_atom));
-
- outlet_list(x->x_obj.ob_outlet, gensym("list"), n, alist);
-
- freebytes(alist, n * sizeof(t_atom));
-
-}
-
-static void a2l_list(t_a2l *x, t_symbol *s, int argc, t_atom *argv)
-{ outlet_list(x->x_obj.ob_outlet, s, argc, argv);}
-
-static void a2l_float(t_a2l *x, t_floatarg f)
-{ outlet_float(x->x_obj.ob_outlet, f);}
-
-static void a2l_symbol(t_a2l *x, t_symbol *s)
-{ outlet_symbol(x->x_obj.ob_outlet, s);}
-
-static void a2l_pointer(t_a2l *x, t_gpointer *gp)
-{ outlet_pointer(x->x_obj.ob_outlet, gp);}
-
-static void a2l_bang(t_a2l *x)
-{ outlet_bang(x->x_obj.ob_outlet);}
-
-static void *a2l_new(void)
-{
- t_a2l *x = (t_a2l *)pd_new(a2l_class);
- outlet_new(&x->x_obj, 0);
- return (x);
-}
-
-static void a2l_setup(void)
-{
-
- a2l_class = class_new(gensym("any2list"), (t_newmethod)a2l_new,
- 0, sizeof(t_a2l), 0, 0);
- class_addcreator((t_newmethod)a2l_new, gensym("a2l"), 0);
-
-
- class_addbang (a2l_class, a2l_bang);
- class_addfloat (a2l_class, a2l_float);
- class_addsymbol (a2l_class, a2l_symbol);
- class_addpointer (a2l_class, a2l_pointer);
- class_addlist (a2l_class, a2l_list);
- class_addanything(a2l_class, a2l_anything);
-
- class_sethelpsymbol(a2l_class, gensym("zexy/any2list"));
-}
-
-/* ------------------------- list ------------------------------- */
-
-/* this is for packages, what "float" is for floats */
-
-static t_class *mypdlist_class;
-
-typedef struct _mypdlist
-{
- t_object x_obj;
-
- int x_n;
- t_atom *x_list;
-} t_mypdlist;
-
-static void mypdlist_secondlist(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv)
-{
- if (argc) {
- if (x->x_n != argc) {
- freebytes(x->x_list, x->x_n * sizeof(t_atom));
- x->x_n = argc;
- x->x_list = copybytes(argv, argc * sizeof(t_atom));
- } else memcpy(x->x_list, argv, argc * sizeof(t_atom));
- }
-}
-
-static void mypdlist_list(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv)
-{
- if (x->x_n != argc) {
- freebytes(x->x_list, x->x_n * sizeof(t_atom));
- x->x_n = argc;
- x->x_list = copybytes(argv, argc * sizeof(t_atom));
- } else memcpy(x->x_list, argv, argc * sizeof(t_atom));
-
- outlet_list(x->x_obj.ob_outlet, gensym("list"), x->x_n, x->x_list);
-}
-static void mypdlist_bang(t_mypdlist *x)
-{ outlet_list(x->x_obj.ob_outlet, gensym("list"), x->x_n, x->x_list);}
-
-static void mypdlist_free(t_mypdlist *x)
-{ freebytes(x->x_list, x->x_n * sizeof(t_atom)); }
-
-static void *mypdlist_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_mypdlist *x = (t_mypdlist *)pd_new(mypdlist_class);
-
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2"));
-
- x->x_n = 0;
- x->x_list = 0;
-
- mypdlist_secondlist(x, gensym("list"), argc, argv);
-
- return (x);
-}
-
-static void mypdlist_setup(void)
-{
- mypdlist_class = class_new(gensym("lister"), (t_newmethod)mypdlist_new,
- (t_method)mypdlist_free, sizeof(t_mypdlist), 0, A_GIMME, 0);
- /* i don't know how to get this work with name=="list" !!! */
-
- class_addcreator((t_newmethod)mypdlist_new, gensym("l"), A_GIMME, 0);
-
- class_addbang (mypdlist_class, mypdlist_bang);
- class_addlist (mypdlist_class, mypdlist_list);
- class_addmethod (mypdlist_class, (t_method)mypdlist_secondlist, gensym("lst2"), A_GIMME, 0);
-
- class_sethelpsymbol(mypdlist_class, gensym("zexy/lister"));
-}
-
-/* ------------------------- list2int ------------------------------- */
-
-/* cast each float of a list (or anything) to integer */
-
-static t_class *list2int_class;
-
-static void list2int_any(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_atom *ap;
- if (x->x_n != argc) {
- freebytes(x->x_list, x->x_n * sizeof(t_atom));
- x->x_n = argc;
- x->x_list = copybytes(argv, argc * sizeof(t_atom));
- } else memcpy(x->x_list, argv, argc * sizeof(t_atom));
- ap = x->x_list;
- while(argc--){
- if(ap->a_type == A_FLOAT)ap->a_w.w_float=(int)ap->a_w.w_float;
- ap++;
- }
- outlet_anything(x->x_obj.ob_outlet, s, x->x_n, x->x_list);
-}
-static void list2int_bang(t_mypdlist *x)
-{ outlet_bang(x->x_obj.ob_outlet);}
-static void list2int_float(t_mypdlist *x, t_float f)
-{ outlet_float(x->x_obj.ob_outlet, (int)f);}
-static void list2int_symbol(t_mypdlist *x, t_symbol *s)
-{ outlet_symbol(x->x_obj.ob_outlet, s);}
-static void list2int_pointer(t_mypdlist *x, t_gpointer *p)
-{ outlet_pointer(x->x_obj.ob_outlet, p);}
-
-static void *list2int_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_mypdlist *x = (t_mypdlist *)pd_new(list2int_class);
- outlet_new(&x->x_obj, 0);
- x->x_n = 0;
- x->x_list = 0;
- return (x);
-}
-
-static void list2int_setup(void)
-{
- list2int_class = class_new(gensym("list2int"), (t_newmethod)list2int_new,
- (t_method)mypdlist_free, sizeof(t_mypdlist), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)list2int_new, gensym("l2i"), A_GIMME, 0);
- class_addanything(list2int_class, list2int_any);
- class_addlist(list2int_class, list2int_any);
- class_addbang(list2int_class, list2int_bang);
- class_addfloat(list2int_class, list2int_float);
- class_addsymbol(list2int_class, list2int_symbol);
- class_addpointer(list2int_class, list2int_pointer);
- class_sethelpsymbol(list2int_class, gensym("zexy/list2int"));
-}
-
-/* ------------------------- glue ------------------------------- */
-
-/* glue 2 lists together (append) */
-
-static t_class *glue_class;
-
-typedef struct _glue
-{
- t_object x_obj;
-
- t_atom *ap2, *ap;
- t_int n1, n2, n;
-
- t_int changed;
-} t_glue;
-
-static void glue_lst2(t_glue *x, t_symbol *s, int argc, t_atom *argv)
-{
- x->changed = 1;
- if (x->n2 != argc) {
- freebytes(x->ap2, x->n2 * sizeof(t_atom));
- x->n2 = argc;
- x->ap2 = copybytes(argv, argc * sizeof(t_atom));
- } else memcpy(x->ap2, argv, argc * sizeof(t_atom));
-}
-
-static void glue_lst(t_glue *x, t_symbol *s, int argc, t_atom *argv)
-{
- if (x->n != x->n2+argc) {
- freebytes(x->ap, x->n * sizeof(t_atom));
- x->n1 = argc;
- x->n = x->n1+x->n2;
- x->ap = (t_atom *)getbytes(sizeof(t_atom)*x->n);
- memcpy(x->ap+argc, x->ap2, x->n2*sizeof(t_atom));
- } else if ((x->n1 != argc)||x->changed)memcpy(x->ap+argc, x->ap2, x->n2*sizeof(t_atom));
-
- x->n1 = argc;
- memcpy(x->ap, argv, x->n1*sizeof(t_atom));
-
- x->changed=0;
-
- outlet_list(x->x_obj.ob_outlet, gensym("list"), x->n, x->ap);
-}
-
-static void glue_bang(t_glue *x)
-{
- if (x->changed) {
- if (x->n1+x->n2 != x->n){
- t_atom *ap = (t_atom*)getbytes(sizeof(t_atom)*(x->n1+x->n2));
- memcpy(ap, x->ap, x->n1*sizeof(t_atom));
- freebytes(x->ap, sizeof(t_atom)*x->n);
- x->ap=ap;
- x->n=x->n1+x->n2;
- }
- memcpy(x->ap+x->n1, x->ap2, x->n2*sizeof(t_atom));
- x->changed=0;
- }
-
- outlet_list(x->x_obj.ob_outlet, gensym("list"), x->n, x->ap);
-}
-
-static void glue_free(t_glue *x)
-{
- freebytes(x->ap, sizeof(t_atom)*x->n);
- freebytes(x->ap2, sizeof(t_atom)*x->n2);
-}
-
-static void *glue_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_glue *x = (t_glue *)pd_new(glue_class);
-
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->n =x->n2 = 0;
- x->ap=x->ap2 = 0;
- x->changed = 0;
-
- if (argc)glue_lst2(x, gensym("list"), argc, argv);
-
- return (x);
-}
-
-static void glue_setup(void)
-{
- glue_class = class_new(gensym("glue"), (t_newmethod)glue_new,
- (t_method)glue_free, sizeof(t_glue), 0, A_GIMME, 0);
- class_addlist(glue_class, glue_lst);
- class_addmethod (glue_class, (t_method)glue_lst2, gensym(""), A_GIMME, 0);
- class_addbang(glue_class, glue_bang);
-
- class_sethelpsymbol(glue_class, gensym("zexy/glue"));
-}
-
-/*skalar multiplikation */
-
-static t_class *scalmul_class;
-static t_class *scalmul_scal_class;
-
-typedef struct _scalmul
-{
- t_object x_obj;
-
- t_int n1, n2;
-
- t_float *buf1, *buf2;
-
- t_float f;
-} t_scalmul;
-
-
-static void scalmul_lst2(t_scalmul *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_float *fp;
- if (x->n2 != argc) {
- freebytes(x->buf2, x->n2 * sizeof(t_float));
- x->n2 = argc;
- x->buf2=(t_float *)getbytes(sizeof(t_float)*x->n2);
- };
- fp = x->buf2;
- while(argc--)*fp++=atom_getfloat(argv++);
-}
-
-static void scalmul_lst(t_scalmul *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_float *fp;
- t_atom *ap;
- int n;
-
- if (argc){
- if (x->n1 != argc) {
- freebytes(x->buf1, x->n1 * sizeof(t_float));
- x->n1 = argc;
- x->buf1=(t_float *)getbytes(sizeof(t_float)*x->n1);
- };
- fp = x->buf1;
- while(argc--)*fp++=atom_getfloat(argv++);
- }
-
- if (x->n1*x->n2==1){
- outlet_float(x->x_obj.ob_outlet, *x->buf1**x->buf2);
- return;
- }
- if (x->n1==1){
- t_atom *a;
- int i = x->n2;
- t_float f = *x->buf1;
- fp = x->buf2;
- n = x->n2;
- ap = (t_atom *)getbytes(sizeof(t_atom)*n);
- a = ap;
- while(i--){
- SETFLOAT(a, *fp++*f);
- a++;
- }
- } else if (x->n2==1){
- t_float f = *x->buf2;
- t_atom *a;
- int i = x->n1;
- n = x->n1;
- ap = (t_atom *)getbytes(sizeof(t_atom)*n);
- a = ap;
- fp = x->buf1;
- while(i--){
- SETFLOAT(a, *fp++*f);
- a++;
- }
- } else {
- t_atom *a;
- int i;
- t_float *fp2=x->buf2;
- fp = x->buf1;
- n = x->n1;
- if (x->n1!=x->n2){
- post("scalar multiplication: truncating vectors to the same length");
- if (x->n2<x->n1)n=x->n2;
- }
- ap = (t_atom *)getbytes(sizeof(t_atom)*n);
- a = ap;
- i=n;
- while(i--){
- SETFLOAT(a, *fp++**fp2++);
- a++;
- }
- }
- outlet_list(x->x_obj.ob_outlet, gensym("list"), n, ap);
- freebytes(ap, sizeof(t_atom)*n);
-}
-static void scalmul_free(t_scalmul *x)
-{
- freebytes(x->buf1, sizeof(t_float)*x->n1);
- freebytes(x->buf2, sizeof(t_float)*x->n2);
-}
-
-static void *scalmul_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_scalmul *x;
-
- if (argc-1){
- x = (t_scalmul *)pd_new(scalmul_class);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym(""));
- } else x = (t_scalmul *)pd_new(scalmul_scal_class);
-
- outlet_new(&x->x_obj, 0);
-
- x->n1 =1;
- x->buf1 =(t_float*)getbytes(sizeof(t_float));
- *x->buf1=0;
-
- if (argc)scalmul_lst2(x, gensym("list"), argc, argv);
- else {
- x->n2 =1;
- x->buf2 =(t_float*)getbytes(sizeof(t_float));
- *x->buf2=0;
- }
-
- if (argc==1)floatinlet_new(&x->x_obj, x->buf2);
-
- return (x);
-}
-
-static void scalmul_setup(void)
-{
- scalmul_class = class_new(gensym("."), (t_newmethod)scalmul_new,
- (t_method)scalmul_free, sizeof(t_scalmul), 0, A_GIMME, 0);
- class_addlist(scalmul_class, scalmul_lst);
- class_addmethod (scalmul_class, (t_method)scalmul_lst2, gensym(""), A_GIMME, 0);
- scalmul_scal_class = class_new(gensym("."), 0, (t_method)scalmul_free,
- sizeof(t_scalmul), 0, 0);
- class_addlist(scalmul_scal_class, scalmul_lst);
-
- class_sethelpsymbol(scalmul_class, gensym("zexy/scalarmult"));
- class_sethelpsymbol(scalmul_scal_class, gensym("zexy/scalarmult"));
-}
-
-
-/* ------------------------- repeat ------------------------------- */
-
-/* a no-operation - just pass through what you get in */
-
-static t_class *repeat_class;
-
-typedef struct _repeat
-{
- t_object x_obj;
- t_float fcount;
-} t_repeat;
-
-static void repeat_anything(t_repeat *x, t_symbol *s, int argc, t_atom *argv)
-{
- int i;
- i=x->fcount;
- if (i<0)i=1;
- while(i--)outlet_anything(x->x_obj.ob_outlet, s, argc, argv);
-}
-
-static void *repeat_new(t_float f)
-{
- t_repeat *x = (t_repeat *)pd_new(repeat_class);
- x->fcount = f;
- floatinlet_new(&x->x_obj, &x->fcount);
- outlet_new(&x->x_obj, 0);
- return (x);
-}
-
-static void repeat_setup(void)
-{
- repeat_class = class_new(gensym("repeat"), (t_newmethod)repeat_new,
- 0, sizeof(t_repeat), 0, A_FLOAT, 0);
- class_addanything(repeat_class, repeat_anything);
-
- class_sethelpsymbol(repeat_class, gensym("zexy/repeat"));
-}
-
-
-
-/* -------------- overall setup routine for this file ----------------- */
-
-void z_connective_setup(void)
-{
- segregate_setup();
- nop_setup();
- mypdlist_setup();
- glue_setup();
-
- list2int_setup();
- scalmul_setup();
-
- a2l_setup();
- repeat_setup();
-
- /* I don't supply HELP - functionality, since this might harm overall-performance here */
-}
diff --git a/src/z_coordinates.c b/src/z_coordinates.c
deleted file mode 100644
index 59bd6aa..0000000
--- a/src/z_coordinates.c
+++ /dev/null
@@ -1,440 +0,0 @@
-#include "zexy.h"
-#include <math.h>
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#define atan2f atan2
-#define sqrtf sqrt
-#define sinf sin
-#define cosf cos
-#endif
-
-#ifdef MACOSX
-#define atan2f atan2
-#define sqrtf sqrt
-#define sinf sin
-#define cosf cos
-#endif
-
-/* ----------------------- deg/rad utils ----------------- */
-t_class *deg2rad_class, *rad2deg_class;
-typedef struct _deg2rad
-{
- t_object x_obj;
- t_float factor;
-} t_deg2rad;
-
-/* deg2rad :: degree 2 radian */
-
-static void deg2rad_float(t_deg2rad *x, t_float f)
-{
- outlet_float(x->x_obj.ob_outlet, x->factor*f);
-}
-
-static void *deg2rad_new(t_floatarg f)
-{
- t_deg2rad *x = (t_deg2rad *)pd_new(deg2rad_class);
- outlet_new(&x->x_obj, gensym("float"));
- x->factor=atan2f(1,1)/45.0;
-
- return (x);
-}
-
-static void deg2rad_help(void)
-{
- post("deg2rad\t:: convert degree 2 radians");
-}
-
-static void deg2rad_setup(void)
-{
- deg2rad_class = class_new(gensym("deg2rad"), (t_newmethod)deg2rad_new, 0,
- sizeof(t_deg2rad), 0, A_DEFFLOAT, 0);
-
- class_addmethod(deg2rad_class, (t_method)deg2rad_help, gensym("help"), 0);
- class_addfloat(deg2rad_class, deg2rad_float);
- class_sethelpsymbol(deg2rad_class, gensym("zexy/deg2rad"));
-}
-
-/* rad2deg :: radian 2 degree */
-t_class *rad2deg_class;
-
-static void rad2deg_float(t_deg2rad *x, t_float f)
-{
- outlet_float(x->x_obj.ob_outlet, x->factor*f);
-}
-
-static void *rad2deg_new(t_floatarg f)
-{
- t_deg2rad *x = (t_deg2rad *)pd_new(rad2deg_class);
- outlet_new(&x->x_obj, gensym("float"));
- x->factor=45.0/atan2f(1,1);
-
- return (x);
-}
-
-static void rad2deg_help(void)
-{
- post("rad2deg\t:: convert radian 2 degree");
-}
-
-static void rad2deg_setup(void)
-{
- rad2deg_class = class_new(gensym("rad2deg"), (t_newmethod)rad2deg_new, 0,
- sizeof(t_deg2rad), 0, A_DEFFLOAT, 0);
-
- class_addmethod(rad2deg_class, (t_method)rad2deg_help, gensym("help"), 0);
- class_addfloat(rad2deg_class, rad2deg_float);
- class_sethelpsymbol(rad2deg_class, gensym("zexy/deg2rad"));
-}
-
-/* ------------------------ coordinate transformations ----------------------------- */
-
-typedef struct _coordinates
-{
- t_object x_obj;
-
- t_outlet *out[3];
- t_float old_coord[3], new_coord[3];
-} t_coordinates;
-
-void coordinates_free(t_coordinates *x)
-{
-}
-
-void coord_bang(t_coordinates *x)
-{
- int i=3;
- while(i--)outlet_float(x->out[i], x->new_coord[i]);
-}
-
-
-/* cart2pol :: cartesian to polar coordinates */
-t_class *cart2pol_class;
-
-static void cart2pol_bang(t_coordinates *x)
-{
- t_float X=x->old_coord[0], Y=x->old_coord[1];
- x->new_coord[0]=sqrtf(X*X+Y*Y); /* R */
- x->new_coord[1]=atan2f(Y, X); /* PHI */
- x->new_coord[2]=x->old_coord[2]; /* Z */
- coord_bang(x);
-}
-
-static void cart2pol_float(t_coordinates *x, t_float f)
-{
- x->old_coord[0]=f;
- cart2pol_bang(x);
-}
-
-static void *cart2pol_new(t_floatarg X, t_floatarg Y, t_floatarg Z)
-{
- t_coordinates *x = (t_coordinates *)pd_new(cart2pol_class);
- int i=3;
- floatinlet_new(&x->x_obj, &x->old_coord[1]);
- floatinlet_new(&x->x_obj, &x->old_coord[2]);
- while(i--){
- x->out[2-i]=outlet_new(&x->x_obj, gensym("float"));
- x->new_coord[i]=0;
- }
- x->old_coord[0]=X;
- x->old_coord[1]=Y;
- x->old_coord[2]=Z;
-
- return (x);
-}
-
-static void cart2pol_help(void)
-{
- post("cart2pol\t:: convert cartesian to polar coordinates");
- post("\t\"<x> <y> <z>\": returns <r> <phi> <z>");
-}
-
-static void cart2pol_setup(void)
-{
- cart2pol_class = class_new(gensym("cart2pol"), (t_newmethod)cart2pol_new, (t_method)coordinates_free,
- sizeof(t_coordinates), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0);
-
- class_addmethod(cart2pol_class, (t_method)cart2pol_help, gensym("help"), 0);
- class_addfloat(cart2pol_class, cart2pol_float);
- class_addbang(cart2pol_class, cart2pol_bang);
-
- class_sethelpsymbol(cart2pol_class, gensym("zexy/cart2pol"));
-}
-
-
-/* pol2cart :: polar to cartesian coordinates */
-t_class *pol2cart_class;
-
-static void pol2cart_bang(t_coordinates *x)
-{
- x->new_coord[0]=x->old_coord[0]*cosf(x->old_coord[1]); /* X */
- x->new_coord[1]=x->old_coord[0]*sinf(x->old_coord[1]); /* Y */
- x->new_coord[2]=x->old_coord[2]; /* Z */
- coord_bang(x);
-}
-
-static void pol2cart_float(t_coordinates *x, t_float f)
-{
- x->old_coord[0]=f;
- pol2cart_bang(x);
-}
-
-static void *pol2cart_new(t_floatarg X, t_floatarg Y, t_floatarg Z)
-{
- t_coordinates *x = (t_coordinates *)pd_new(pol2cart_class);
- int i=3;
- floatinlet_new(&x->x_obj, &x->old_coord[1]);
- floatinlet_new(&x->x_obj, &x->old_coord[2]);
- while(i--){
- x->out[2-i]=outlet_new(&x->x_obj, gensym("float"));
- x->new_coord[i]=0;
- }
- x->old_coord[0]=X;
- x->old_coord[1]=Y;
- x->old_coord[2]=Z;
- return (x);
-}
-
-static void pol2cart_help(void)
-{
- post("pol2cart\t:: convert polar to cartesian coordinates");
- post("\t\"<r> <phi> <z>\": returns <x> <x> <z>");
-}
-
-static void pol2cart_setup(void)
-{
- pol2cart_class = class_new(gensym("pol2cart"), (t_newmethod)pol2cart_new, (t_method)coordinates_free,
- sizeof(t_coordinates), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0);
-
- class_addmethod(pol2cart_class, (t_method)pol2cart_help, gensym("help"), 0);
- class_addfloat(pol2cart_class, pol2cart_float);
- class_addbang(pol2cart_class, pol2cart_bang);
-
- class_sethelpsymbol(pol2cart_class, gensym("zexy/pol2cart"));
-}
-
-/* cart2sph :: cartesian to sphar coordinates */
-t_class *cart2sph_class;
-
-static void cart2sph_bang(t_coordinates *x)
-{
- t_float X=x->old_coord[0], Y=x->old_coord[1], Z=x->old_coord[2];
- x->new_coord[0]=sqrtf(X*X+Y*Y+Z*Z); /* R */
- x->new_coord[1]=atan2f(Y, X); /* PHI */
- x->new_coord[2]=atan2f(Z, sqrt(X*X+Y*Y)); /* THETA */
- coord_bang(x);
-}
-
-static void cart2sph_float(t_coordinates *x, t_float f)
-{
- x->old_coord[0]=f;
- cart2sph_bang(x);
-}
-
-static void *cart2sph_new(t_floatarg X, t_floatarg Y, t_floatarg Z)
-{
- t_coordinates *x = (t_coordinates *)pd_new(cart2sph_class);
- int i=3;
- floatinlet_new(&x->x_obj, &x->old_coord[1]);
- floatinlet_new(&x->x_obj, &x->old_coord[2]);
- while(i--){
- x->out[2-i]=outlet_new(&x->x_obj, gensym("float"));
- x->new_coord[i]=0;
- }
- x->old_coord[0]=X;
- x->old_coord[1]=Y;
- x->old_coord[2]=Z;
- return (x);
-}
-
-static void cart2sph_help(void)
-{
- post("cart2sph\t:: convert cartesian to sphar coordinates");
- post("\t\"<x> <y> <z>\": returns <r> <phi> <theta>");
-}
-
-static void cart2sph_setup(void)
-{
- cart2sph_class = class_new(gensym("cart2sph"), (t_newmethod)cart2sph_new, (t_method)coordinates_free,
- sizeof(t_coordinates), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0);
-
- class_addmethod(cart2sph_class, (t_method)cart2sph_help, gensym("help"), 0);
- class_addfloat(cart2sph_class, cart2sph_float);
- class_addbang(cart2sph_class, cart2sph_bang);
-
- class_sethelpsymbol(cart2sph_class, gensym("zexy/cart2sph"));
-}
-
-
-/* sph2cart :: sphar to cartesian coordinates */
-t_class *sph2cart_class;
-
-static void sph2cart_bang(t_coordinates *x)
-{
- x->new_coord[0]=x->old_coord[0]*cosf(x->old_coord[1])*cosf(x->old_coord[2]); /* X */
- x->new_coord[1]=x->old_coord[0]*sinf(x->old_coord[1])*cosf(x->old_coord[2]); /* Y */
- x->new_coord[2]=x->old_coord[0]*sinf(x->old_coord[2]); /* Z */
- coord_bang(x);
-}
-
-static void sph2cart_float(t_coordinates *x, t_float f)
-{
- x->old_coord[0]=f;
- sph2cart_bang(x);
-}
-
-static void *sph2cart_new(t_floatarg X, t_floatarg Y, t_floatarg Z)
-{
- t_coordinates *x = (t_coordinates *)pd_new(sph2cart_class);
- int i=3;
- floatinlet_new(&x->x_obj, &x->old_coord[1]);
- floatinlet_new(&x->x_obj, &x->old_coord[2]);
- while(i--){
- x->out[2-i]=outlet_new(&x->x_obj, gensym("float"));
- x->new_coord[i]=0;
- }
- x->old_coord[0]=X;
- x->old_coord[1]=Y;
- x->old_coord[2]=Z;
- return (x);
-}
-
-static void sph2cart_help(void)
-{
- post("sph2cart\t:: convert sphar to cartesian coordinates");
- post("\t\"<r> <phi> <theta>\": returns <x> <y> <z>");
-}
-
-static void sph2cart_setup(void)
-{
- sph2cart_class = class_new(gensym("sph2cart"), (t_newmethod)sph2cart_new, (t_method)coordinates_free,
- sizeof(t_coordinates), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0);
-
- class_addmethod(sph2cart_class, (t_method)sph2cart_help, gensym("help"), 0);
- class_addfloat(sph2cart_class, sph2cart_float);
- class_addbang(sph2cart_class, sph2cart_bang);
-
- class_sethelpsymbol(sph2cart_class, gensym("zexy/sph2cart"));
-}
-
-
-/* pol2sph :: polesian to sphar coordinates */
-t_class *pol2sph_class;
-
-static void pol2sph_bang(t_coordinates *x)
-{
- t_float r=x->old_coord[0], z=x->old_coord[2];
- x->new_coord[0]=sqrtf(r*r+z*z); /* R */
- x->new_coord[1]=x->old_coord[1]; /* PHI */
- x->new_coord[2]=atan2f(z,r); /* THETA */
- coord_bang(x);
-}
-
-static void pol2sph_float(t_coordinates *x, t_float f)
-{
- x->old_coord[0]=f;
- pol2sph_bang(x);
-}
-
-static void *pol2sph_new(t_floatarg X, t_floatarg Y, t_floatarg Z)
-{
- t_coordinates *x = (t_coordinates *)pd_new(pol2sph_class);
- int i=3;
- floatinlet_new(&x->x_obj, &x->old_coord[1]);
- floatinlet_new(&x->x_obj, &x->old_coord[2]);
- while(i--){
- x->out[2-i]=outlet_new(&x->x_obj, gensym("float"));
- x->new_coord[i]=0;
- }
- x->old_coord[0]=X;
- x->old_coord[1]=Y;
- x->old_coord[2]=Z;
- return (x);
-}
-
-static void pol2sph_help(void)
-{
- post("pol2sph\t:: convert polar to spheric coordinates");
- post("\t\"<r> <phi> <z>\": returns <r> <phi> <theta>");
-}
-
-static void pol2sph_setup(void)
-{
- pol2sph_class = class_new(gensym("pol2sph"), (t_newmethod)pol2sph_new, (t_method)coordinates_free,
- sizeof(t_coordinates), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0);
-
- class_addmethod(pol2sph_class, (t_method)pol2sph_help, gensym("help"), 0);
- class_addfloat(pol2sph_class, pol2sph_float);
- class_addbang(pol2sph_class, pol2sph_bang);
-
- class_sethelpsymbol(pol2sph_class, gensym("zexy/pol2sph"));
-}
-
-
-/* sph2pol :: sphar to polesian coordinates */
-t_class *sph2pol_class;
-
-static void sph2pol_bang(t_coordinates *x)
-{
- x->new_coord[0]=x->old_coord[0]*cosf(x->old_coord[2]); /* R */
- x->new_coord[1]=x->old_coord[1]; /* PHI */
- x->new_coord[2]=x->old_coord[0]*sinf(x->old_coord[2]); /* Z */
-
- coord_bang(x);
-}
-
-static void sph2pol_float(t_coordinates *x, t_float f)
-{
- x->old_coord[0]=f;
- sph2pol_bang(x);
-}
-
-static void *sph2pol_new(t_floatarg X, t_floatarg Y, t_floatarg Z)
-{
- t_coordinates *x = (t_coordinates *)pd_new(sph2pol_class);
- int i=3;
- floatinlet_new(&x->x_obj, &x->old_coord[1]);
- floatinlet_new(&x->x_obj, &x->old_coord[2]);
- while(i--){
- x->out[2-i]=outlet_new(&x->x_obj, gensym("float"));
- x->new_coord[i]=0;
- }
- x->old_coord[0]=X;
- x->old_coord[1]=Y;
- x->old_coord[2]=Z;
- return (x);
-}
-
-static void sph2pol_help(void)
-{
- post("sph2pol\t:: convert spherical to polar coordinates");
- post("\t\"<r> <phi> <theta>\": returns <r> <phi> <z>");
-}
-
-static void sph2pol_setup(void)
-{
- sph2pol_class = class_new(gensym("sph2pol"), (t_newmethod)sph2pol_new, (t_method)coordinates_free,
- sizeof(t_coordinates), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0);
-
- class_addmethod(sph2pol_class, (t_method)sph2pol_help, gensym("help"), 0);
- class_addfloat(sph2pol_class, sph2pol_float);
- class_addbang(sph2pol_class, sph2pol_bang);
-
- class_sethelpsymbol(sph2pol_class, gensym("zexy/sph2pol"));
-}
-
-/* global setup routine */
-
-void z_coordinates_setup(void)
-{
- cart2pol_setup();
- pol2cart_setup();
- cart2sph_setup();
- sph2cart_setup();
- pol2sph_setup();
- sph2pol_setup();
-
- deg2rad_setup();
- rad2deg_setup();
-}
diff --git a/src/z_matrix.c b/src/z_matrix.c
deleted file mode 100644
index a84fa4d..0000000
--- a/src/z_matrix.c
+++ /dev/null
@@ -1,2706 +0,0 @@
-/* 2504:forum::für::umläute:2001 */
-
-/* objects for manipulating matrices */
-/* mostly i refer to matlab/octave matrix functions */
-
-/*
- matrix : basic object : create and store matrices
- mtx : alias for matrix
-
- mtx_resize
- mtx_row
- mtx_col
- mtx_element
-
- mtx_ones
- mtx_zeros
- mtx_eye
- mtx_egg
-
- mtx_diag
- mtx_diegg
- mtx_trace
-
- mtx_mean
- mtx_rand
-
- mtx_transpose
- mtx_scroll
- mtx_roll
-
- mtx_add
- mtx_+
- mtx_mul
- mtx_*
- mtx_.*
- mtx_./
-
- mtx_inverse
- mtx_pivot
-
- mtx_size
-
- mtx_check
- mtx_print
-*/
-
-#define MY_WRITE
-
-#define T_FLOAT long double
-
-#include "zexy.h"
-#include <math.h>
-
-#ifdef MY_WRITE
-#include <stdio.h>
-#endif
-#include <string.h>
-
-#ifdef NT
-#include <memory.h>
-#define fabsf fabs
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-
-/* -------------------- matrix ------------------------------ */
-
-static t_class *matrix_class;
-
-typedef struct _matrix
-{
- t_object x_obj;
-
- int row;
- int col;
-
- t_atom *atombuffer;
-
- int current_row, current_col; /* this makes things easy for the mtx_row & mtx_col...*/
- t_float f;
-
- t_canvas *x_canvas;
-} t_matrix;
-
-/* intern utility functions */
-
-static void setdimen(t_matrix *x, int row, int col)
-{
- x->col = col;
- x->row = row;
- SETFLOAT(x->atombuffer, row);
- SETFLOAT(x->atombuffer+1, col);
-}
-
-static void adjustsize(t_matrix *x, int desiredRow, int desiredCol)
-{
- int col=x->col, row=x->row;
-
- if (desiredRow<1){
- post("cannot make less than 1 rows");
- desiredRow=1;
- }
- if (desiredCol<1){
- post("cannot make less than 1 columns");
- desiredCol=1;
- }
-
- if (col*row!=desiredRow*desiredCol){
- if(x->atombuffer)freebytes(x->atombuffer, (col*row+2)*sizeof(t_atom));
- x->atombuffer=(t_atom *)getbytes((desiredCol*desiredRow+2)*sizeof(t_atom));
- }
-
- setdimen(x, desiredRow, desiredCol);
- return;
-}
-
-static void debugmtx(int argc, t_float *buf, int id)
-{
- int i=argc;
- while(i--){
- int j=argc;
- startpost("debug%d: ", id);
- while(j--)
- startpost("%f ", *buf++);
- endpost();
- }
-}
-static T_FLOAT *matrix2float(t_atom *ap)
-{
- int row = atom_getfloat(ap++);
- int col=atom_getfloat(ap++);
- int length = row * col;
- T_FLOAT *buffer = (T_FLOAT *)getbytes(sizeof(T_FLOAT)*length);
- T_FLOAT *buf = buffer;
- while(length--)*buf++=atom_getfloat(ap++);
- return buffer;
-}
-static void float2matrix(t_atom *ap, T_FLOAT *buffer)
-{
- int row=atom_getfloat(ap++);
- int col=atom_getfloat(ap++);
- int length = row * col;
- T_FLOAT*buf= buffer;
- while(length--){
- SETFLOAT(ap, *buf++);
- ap++;
- }
- freebytes(buffer, row*col*sizeof(T_FLOAT));
-}
-
-
-/* core functions */
-
-static void matrix_bang(t_matrix *x)
-{
- /* output the matrix */
- if (x->atombuffer)outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), x->col*x->row+2, x->atombuffer);
-}
-
-static void matrix_matrix2(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row, col;
-
- if (argc<2){
- post("matrix : corrupt matrix passed");
- return;
- }
- row = atom_getfloat(argv);
- col = atom_getfloat(argv+1);
- if ((row<1)||(col<1)){
- post("matrix : corrupt matrix passed");
- return;
- }
- if (row*col > argc-2){
- post("matrix: sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
-
- /* this is fast and dirty, MAYBE make it slow and clean */
- /* or, to clean matrices, use the mtx_check object */
- if (row*col != x->row*x->col) {
- freebytes(x->atombuffer, x->row*x->col*sizeof(t_atom));
- x->atombuffer = copybytes(argv, (row*col+2)*sizeof(t_atom));
- } else memcpy(x->atombuffer, argv, (row*col+2)*sizeof(t_atom));
-
- setdimen(x, row, col);
-}
-
-static void matrix_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row, col;
-
- if (argc<2){
- post("matrix : corrupt matrix passed");
- return;
- }
- row = atom_getfloat(argv);
- col = atom_getfloat(argv+1);
- if ((row<1)||(col<1)){
- post("matrix : corrupt matrix passed");
- return;
- }
- if (row*col > argc-2){
- post("matrix: sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
-
- matrix_matrix2(x, s, argc, argv);
- matrix_bang(x);
-}
-
-
-/* basic functions */
-
-static void matrix_set(t_matrix *x, t_float f)
-{
- int size = x->col * x->row;
- t_atom *buf=x->atombuffer+2;
- if(x->atombuffer)while(size--)SETFLOAT(&buf[size], f);
-}
-
-static void matrix_zeros(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col, row;
-
- switch(argc) {
- case 0: /* zero out the actual matrix */
- matrix_set(x, 0);
- break;
- case 1:
- row=atom_getfloat(argv);
- adjustsize(x, row, row);
- matrix_set(x, 0);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- adjustsize(x, row, col);
-
- matrix_set(x, 0);
- }
-
- matrix_bang(x);
-}
-
-static void matrix_ones(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col, row;
-
- switch(argc) {
- case 0: /* zero out the actual matrix */
- matrix_set(x, 1);
- break;
- case 1:
- row=atom_getfloat(argv);
- adjustsize(x, row, row);
- matrix_set(x, 1);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- adjustsize(x, row, col);
-
- matrix_set(x, 1);
- }
-
- matrix_bang(x);
-}
-
-static void matrix_eye(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col, row;
- int n;
-
- switch(argc) {
- case 0: /* zero out the actual matrix */
- matrix_set(x, 0);
- break;
- case 1:
- row=atom_getfloat(argv);
- adjustsize(x, row, row);
- matrix_set(x, 0);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- adjustsize(x, row, col);
- matrix_set(x, 0);
- }
-
- col=x->col;
- row=x->row;
- n = (col<row)?col:row;
- while(n--)SETFLOAT(x->atombuffer+2+n*(1+col), 1);
-
- matrix_bang(x);
-}
-static void matrix_egg(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col, row;
- int n;
-
- switch(argc) {
- case 0: /* zero out the actual matrix */
- matrix_set(x, 0);
- break;
- case 1:
- row=atom_getfloat(argv);
- adjustsize(x, row, row);
- matrix_set(x, 0);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- adjustsize(x, row, col);
- matrix_set(x, 0);
- }
-
- col=x->col;
- row=x->row;
- n = (col<row)?col:row;
- while(n--)SETFLOAT(x->atombuffer+2+(n+1)*(col-1), 1);
-
- matrix_bang(x);
-}
-
-static void matrix_diag(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col=argc;
- argv+=argc-1;
- if (argc<1) {
- post("matrix: no diagonale present");
- return;
- }
- adjustsize(x, argc, argc);
- matrix_set(x, 0);
-
- while(argc--)SETFLOAT(x->atombuffer+2+argc*(1+col), atom_getfloat(argv--));
-
- matrix_bang(x);
-}
-static void matrix_diegg(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col=argc;
- argv+=argc-1;
- if (argc<1) {
- post("matrix: no dieggonale present");
- return;
- }
- adjustsize(x, argc, argc);
- matrix_set(x, 0);
-
- while(argc--){
- t_atom *ap=x->atombuffer+2+(argc+1)*(col-1);
- SETFLOAT(ap, atom_getfloat(argv--));
- }
-
- matrix_bang(x);
-}
-/* the rest */
-
-static void matrix_row(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_atom *ap;
- int row=x->row, col=x->col;
- int r;
- t_float f;
-
- switch (argc){
- case 0:
- for (r=0;r<row;r++)outlet_list(x->x_obj.ob_outlet, gensym("row"), col, x->atombuffer+r*col+2);
- break;
- case 1:
- r=atom_getfloat(argv)-1;
- if ((r<0)||(r>=row)){
- post("matrix: row index %d is out of range", r+1);
- return;
- }
- outlet_list(x->x_obj.ob_outlet, gensym("row"), col, x->atombuffer+r*col+2);
- break;
- case 2:
- r=atom_getfloat(argv)-1;
- f=atom_getfloat(argv+1);
- if ((r<0)||(r>=row)){
- post("matrix: row index %d is out of range", r+1);
- return;
- }
-
-
- default:
- r=atom_getfloat(argv++)-1;
- if (argc--<col){
- post("matrix: sparse rows not yet supported : use \"mtx_check\"");
- return;
- }
- if ((r<0)||(r>=row)){
- post("matrix: row index %d is out of range", r+1);
- return;
- }
- if (r==row) {
- } else {
- ap=x->atombuffer+2+col*r;
- memcpy(ap, argv, col*sizeof(t_atom));
- }
- }
-}
-
-static void matrix_col(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_atom *ap;
- int row=x->row, col=x->col;
- int c, r;
-
- switch (argc){
- case 0:
- ap=(t_atom *)getbytes(row*sizeof(t_atom));
- for (c=0;c<col;c++) {
- for (r=0;r<row;r++)SETFLOAT(&ap[r], atom_getfloat(x->atombuffer+2+c+col*r));
- outlet_list(x->x_obj.ob_outlet, gensym("col"), row, ap);
- }
- freebytes(ap, row*sizeof(t_atom));
- break;
- case 1:
- ap=(t_atom *)getbytes(row*sizeof(t_atom));
- c=atom_getfloat(argv)-1;
- if ((c<0)||(c>=col)){
- post("matrix: col index %d is out of range", c+1);
- return;
- }
- for (r=0;r<row;r++)SETFLOAT(&ap[r], atom_getfloat(x->atombuffer+2+c+col*r));
- outlet_list(x->x_obj.ob_outlet, gensym("col"), row, ap);
- freebytes(ap, row*sizeof(t_atom));
- break;
- default:
- c=atom_getfloat(argv++)-1;
- if (argc--<row){
- post("matrix: sparse cols not yet supported : use \"mtx_check\"");
- return;
- }
- if ((c<0)||(c>=col)){
- post("matrix: col index %d is out of range", c+1);
- return;
- }
- argv+=argc-1;
- if (argc>row)argc=row;
- while(argc--){
- ap=x->atombuffer+2+c+col*argc;
- SETFLOAT(ap, atom_getfloat(argv--));
- }
- }
-}
-
-static void matrix_element(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_atom *ap=x->atombuffer+2;
- int row=x->row, col=x->col;
- int r, c, i=row*col;
-
- switch (argc){
- case 0:
- while(i--)outlet_float(x->x_obj.ob_outlet, atom_getfloat(ap++));
- break;
- case 1:
- r=c=atom_getfloat(argv)-1;
- if ((r<0)||(r>=row)){
- post("matrix: row index %d is out of range", r+1);
- return;
- }
- if ((c<0)||(c>=col)){
- post("matrix: col index %d is out of range", c+1);
- return;
- }
- outlet_float(x->x_obj.ob_outlet, atom_getfloat(x->atombuffer+2+c+r*col));
- break;
- case 2:
- r=atom_getfloat(argv++)-1;
- c=atom_getfloat(argv++)-1;
- if ((r<0)||(r>=row)){ post("matrix: row index %d is out of range", r+1); return; }
- if ((c<0)||(c>=col)){ post("matrix: col index %d is out of range", c+1); return; }
- outlet_float(x->x_obj.ob_outlet, atom_getfloat(x->atombuffer+2+c+r*col));
- break;
- default:
- r=atom_getfloat(argv++)-1;
- c=atom_getfloat(argv++)-1;
- if ((r<0)||(r>=row)){ post("matrix: row index %d is out of range", r+1); return; }
- if ((c<0)||(c>=col)){ post("matrix: col index %d is out of range", c+1); return; }
- SETFLOAT(x->atombuffer+2+c+r*col, atom_getfloat(argv));
- }
-}
-
-static void matrix_float(t_matrix *x, t_float f)
-{
- matrix_set(x, f);
- matrix_bang(x);
-}
-
-/* ------------- file I/O ------------------ */
-
-static void matrix_read(t_matrix *x, t_symbol *filename)
-{
- t_binbuf *bbuf = binbuf_new();
- t_atom *ap;
- int n;
-
- if (binbuf_read_via_path(bbuf, filename->s_name, canvas_getdir(x->x_canvas)->s_name, 0))
- error("matrix: failed to read %s", filename->s_name);
-
- ap=binbuf_getvec(bbuf);
- n =binbuf_getnatom(bbuf)-1;
-
- if ((ap->a_type == A_SYMBOL) &&
- (!strcmp(ap->a_w.w_symbol->s_name,"matrix") || !strcmp(ap->a_w.w_symbol->s_name,"#matrix")) ){
- matrix_matrix2(x, gensym("matrix"), n, ap+1);
- }
-
- binbuf_free(bbuf);
-}
-#ifndef MY_WRITE
-static void matrix_write(t_matrix *x, t_symbol *filename)
-{
- t_binbuf *bbuf = binbuf_new();
- t_atom atom, *ap=x->atombuffer;
- char buf[MAXPDSTRING];
- int n = x->row;
-
- canvas_makefilename(x->x_canvas, filename->s_name, buf, MAXPDSTRING);
-
- /* we now write "#matrix" instead of "matrix",
- * so that these files can easily read by other
- * applications such as octave
- */
- SETSYMBOL(&atom, gensym("#matrix"));
- binbuf_add(bbuf, 1, &atom);
- binbuf_add(bbuf, 2, ap);
- binbuf_addsemi(bbuf);
- ap+=2;
- while(n--){
- binbuf_add(bbuf, x->col, ap);
- binbuf_addsemi(bbuf);
- ap+=x->col;
- }
-
- if (binbuf_write(bbuf, buf, "", 1)){
- error("matrix: failed to write %s", filename->s_name);
- }
-
- binbuf_free(bbuf);
-}
-#else
-static void matrix_write(t_matrix *x, t_symbol *filename)
-{
- t_atom *ap=x->atombuffer+2;
- char filnam[MAXPDSTRING];
- int rows = x->row, cols = x->col;
- FILE *f=0;
-
- sys_bashfilename(filename->s_name, filnam);
-
- /* open file */
- if (!(f = fopen(filnam, "w"))) {
- error("matrix : failed to open %s", filnam);
- } else {
- char *text=(char *)getbytes(sizeof(char)*MAXPDSTRING);
- int textlen;
-
- /* header:
- * we now write "#matrix" instead of "matrix",
- * so that these files can easily read by other
- * applications such as octave
- */
- sprintf(text, "#matrix %d %d\n", rows, cols);
- textlen = strlen(text);
- if (fwrite(text, textlen*sizeof(char), 1, f) < 1) {
- error("matrix : failed to write %s", filnam); goto end;
- }
-
- while(rows--) {
- int c = cols;
- while (c--) {
- t_float val = atom_getfloat(ap++);
- sprintf(text, "%.15f ", val);
- textlen=strlen(text);
- if (fwrite(text, textlen*sizeof(char), 1, f) < 1) {
- error("matrix : failed to write %s", filnam); goto end;
- }
- }
- if (fwrite("\n", sizeof(char), 1, f) < 1) {
- error("matrix : failed to write %s", filnam); goto end;
- }
- }
- freebytes(text, sizeof(char)*MAXPDSTRING);
- }
-
- end:
- /* close file */
- if (f) fclose(f);
-}
-#endif
-
-static void matrix_free(t_matrix *x)
-{
- freebytes(x->atombuffer, (x->col*x->row+2)*sizeof(t_atom));
- x->atombuffer=0;
- x->col=x->row=0;
-}
-static void matrix_list(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- /* like matrix, but without col/row information, so the previous size is kept */
- int row=x->row, col=x->col;
-
- if(!row*col){
- post("matrix : unknown matrix dimensions");
- return;
- }
- if (argc<row*col){
- post("matrix: sparse matrices not yet supported : use \"mtx_check\" !");
- return;
- }
-
- memcpy(x->atombuffer+2, argv, row*col*sizeof(t_atom));
- matrix_bang(x);
-}
-
-static void *matrix_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(matrix_class);
- int row, col;
-
-
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- outlet_new(&x->x_obj, 0);
-
- x->atombuffer = 0;
- x->x_canvas = canvas_getcurrent();
-
- switch (argc) {
- case 0:
- row = col = 0;
- break;
- case 1:
- if (argv->a_type == A_SYMBOL) {
- matrix_read(x, argv->a_w.w_symbol);
- return(x);
- }
- row = col = atom_getfloat(argv);
- break;
- default:
- row = atom_getfloat(argv++);
- col = atom_getfloat(argv++);
- }
-
- if(row*col){
- adjustsize(x, row, col);
- matrix_set(x, 0);
- }
-
- return (x);
-}
-
-static void matrix_setup(void)
-{
- matrix_class = class_new(gensym("matrix"), (t_newmethod)matrix_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)matrix_new, gensym("mtx"), A_GIMME, 0);
-
- /* the core : functions for matrices */
- class_addmethod (matrix_class, (t_method)matrix_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_matrix2, gensym(""), A_GIMME, 0);
-
- /* the basics : functions for creation */
- class_addmethod (matrix_class, (t_method)matrix_eye, gensym("eye"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_diag, gensym("diag"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_ones, gensym("ones"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_zeros, gensym("zeros"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_egg, gensym("egg"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_diegg, gensym("diegg"), A_GIMME, 0);
-
- /* the rest : functions for anything */
- class_addbang (matrix_class, matrix_bang);
- class_addfloat (matrix_class, matrix_float);
- class_addlist (matrix_class, matrix_list);
- class_addmethod (matrix_class, (t_method)matrix_row, gensym("row"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_col, gensym("column"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_col, gensym("col"), A_GIMME, 0);
- class_addmethod (matrix_class, (t_method)matrix_element, gensym("element"), A_GIMME, 0);
-
- /* the file functions */
- class_addmethod (matrix_class, (t_method)matrix_write, gensym("write"), A_SYMBOL, 0);
- class_addmethod (matrix_class, (t_method)matrix_read , gensym("read") , A_SYMBOL, 0);
-
-
- class_sethelpsymbol(matrix_class, gensym("zexy/matrix"));
-}
-
-
-/* ------------------------------------------------------------------------------------- */
-
-/* mtx_resize */
-
-static t_class *mtx_resize_class;
-static void mtx_resize_list2(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int r, c;
- if (argc<1)return;
- if (argc>2)error("mtx_resize : only rows & cols are needed, skipping the rest");
- if (argc==1)r=c=atom_getfloat(argv++);
- else{
- r=atom_getfloat(argv++);
- c=atom_getfloat(argv++);
- }
-
- if (r<0)r=0;
- if (c<0)c=0;
-
- x->current_row = r;
- x->current_col = c;
-}
-
-static void mtx_resize_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv);
- int col=atom_getfloat(argv+1);
- int r = x->current_row, c = x->current_col;
- int R=0, ROW, COL;
-
- if (argc<2){ post("mtx_add: crippled matrix"); return; }
- if ((col<1)||(row<1)) { post("mtx_add: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
-
- if (!r)r=row;
- if (!c)c=col;
-
- if (r==row && c==col) { // no need to change
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, argv);
- return;
- }
-
- x->atombuffer=(t_atom *)getbytes((c*r+2)*sizeof(t_atom));
- setdimen(x, r, c);
- matrix_set(x, 0);
-
- ROW=(r<row)?r:row;
- COL=(c<col)?c:col;
- R=ROW;
- while(R--)memcpy(x->atombuffer+2+(ROW-R-1)*c, argv+2+(ROW-R-1)*col, COL*sizeof(t_atom));
-
- matrix_bang(x);
-
- freebytes(x->atombuffer, (c*r+2)*sizeof(t_atom));
-}
-
-static void *mtx_resize_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_resize_class);
- int c=0, r=0;
-
- if(argc){
- if(argc-1){
- r=atom_getfloat(argv);
- c=atom_getfloat(argv+1);
- } else r=c=atom_getfloat(argv);
- if(c<0)c=0;
- if(r<0)r=0;
- }
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->current_row = r;
- x->current_col = c;
- x->row = x->col= 0;
- x->atombuffer = 0;
-
- return (x);
-}
-static void mtx_resize_setup(void)
-{
- mtx_resize_class = class_new(gensym("mtx_resize"), (t_newmethod)mtx_resize_new,
- 0, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addmethod (mtx_resize_class, (t_method)mtx_resize_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod (mtx_resize_class, (t_method)mtx_resize_list2, gensym(""), A_GIMME, 0);
- class_sethelpsymbol(mtx_resize_class, gensym("zexy/mtx_size"));
-}
-
-/* mtx_row */
-static t_class *mtx_row_class;
-
-static void mtx_row_float(t_matrix *x, t_floatarg f)
-{
- int i = f;
- if(i<0)i=0;
- x->current_row = i;
-}
-static void mtx_row_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row, col;
- if (argc<2){ post("matrix : corrupt matrix passed"); return; }
- row = atom_getfloat(argv);
- col = atom_getfloat(argv+1);
- if ((row<1)||(col<1)){ post("matrix : corrupt matrix passed"); return; }
- if (row*col > argc-2){ post("matrix: sparse matrices not yet supported : use \"mtx_check\""); return; }
- matrix_matrix2(x, s, argc, argv);
- matrix_bang(x);
-}
-static void mtx_row_list(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- if (argc==1){
- t_float f=atom_getfloat(argv);
- t_atom *ap=x->atombuffer+2+(x->current_row-1)*x->col;
- if (x->current_row>x->row){
- post("mtx_row : too high a row is to be set");
- return;
- }
- if (x->current_row){
- int n=x->col;
- while(n--){
- SETFLOAT(ap, f);
- ap++;
- }
- }
- matrix_bang(x);
- return;
- }
-
- if (argc<x->col){
- post("mtx_row : row length is too small for %dx%d-matrix", x->row, x->col);
- return;
- }
- if (x->current_row>x->row){
- post("mtx_row : too high a row is to be set");
- return;
- }
- if(x->current_row) {memcpy(x->atombuffer+2+(x->current_row-1)*x->col, argv, x->col*sizeof(t_atom));
- } else {
- int r=x->row;
- while(r--)memcpy(x->atombuffer+2+r*x->col, argv, x->col*sizeof(t_atom));
- }
- matrix_bang(x);
-}
-static void *mtx_row_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_row_class);
- int i, j, q;
-
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
- x->current_row=0;
- x->col=x->row=0;
- x->atombuffer=0;
- switch (argc) {
- case 0:break;
- case 1:
- i = atom_getfloat(argv);
- if (i<0)i=0;
- if(i)adjustsize(x, i, i);
- matrix_set(x, 0);
- break;
- case 2:
- i = atom_getfloat(argv++);if(i<0)i=0;
- j = atom_getfloat(argv++);if(j<0)j=0;
- if(i*j)adjustsize(x, i, j);
- matrix_set(x, 0);
- break;
- default:
- i = atom_getfloat(argv++);if(i<0)i=0;
- j = atom_getfloat(argv++);if(j<0)j=0;
- q = atom_getfloat(argv++);if(q<0)q=0;
- if(i*j)adjustsize(x, i, j);
- matrix_set(x, 0);
- x->current_row=q;
- }
- return (x);
-}
-static void mtx_row_setup(void)
-{
- mtx_row_class = class_new(gensym("mtx_row"), (t_newmethod)mtx_row_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_row_class, matrix_bang);
- class_addlist (mtx_row_class, mtx_row_list);
- class_addmethod(mtx_row_class, (t_method)mtx_row_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_row_class, (t_method)mtx_row_float, gensym(""), A_FLOAT, 0);
- class_sethelpsymbol(mtx_row_class, gensym("zexy/mtx_element"));
-}
-
-
-/* mtx_col */
-static t_class *mtx_col_class;
-
-static void mtx_col_float(t_matrix *x, t_floatarg f)
-{
- int i = f;
- if(i<0)i=0;
- x->current_col = i;
-}
-static void mtx_col_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row, col;
- if (argc<2){ post("matrix : corrupt matrix passed"); return; }
- row = atom_getfloat(argv);
- col = atom_getfloat(argv+1);
- if ((row<1)||(col<1)){ post("matrix : corrupt matrix passed"); return; }
- if (row*col > argc-2){ post("matrix: sparse matrices not yet supported : use \"mtx_check\""); return; }
- matrix_matrix2(x, s, argc, argv);
- matrix_bang(x);
-}
-static void mtx_col_list(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- if (argc==1){
- t_float f=atom_getfloat(argv);
- t_atom *ap=x->atombuffer+1+x->current_col;
- if (x->current_col>x->col){
- post("mtx_col : too high a column is to be set");
- return;
- }
- if (x->current_col){
- int n=x->row;
- while(n--){
- SETFLOAT(ap, f);
- ap+=x->row+1;
- }
- }
- matrix_bang(x);
- return;
- }
-
- if (argc<x->row){
- post("mtx_col : column length is too small for %dx%d-matrix", x->row, x->col);
- return;
- }
- if (x->current_col>x->col){
- post("mtx_col : too high a column is to be set");
- return;
- }
- if(x->current_col) {
- int r=x->row;
- t_atom *ap=x->atombuffer+1+x->current_col;
- while(r--)SETFLOAT(&ap[(x->row-r-1)*x->col], atom_getfloat(argv++));
- } else {
- int r=x->row;
- t_atom *ap=x->atombuffer+2;
- while (r--) {
- t_float f=atom_getfloat(argv++);
- int c=x->col;
- while(c--){
- SETFLOAT(ap, f);
- ap++;
- }
- }
- }
- matrix_bang(x);
-}
-static void *mtx_col_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_col_class);
- int i, j, q;
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
- x->current_col=0;
- x->col=x->row=0;
- x->atombuffer=0;
- switch (argc) {
- case 0:break;
- case 1:
- i = atom_getfloat(argv);
- if (i<0)i=0;
- if(i)adjustsize(x, i, i);
- matrix_set(x, 0);
- break;
- case 2:
- i = atom_getfloat(argv++);if(i<0)i=0;
- j = atom_getfloat(argv++);if(j<0)j=0;
- if(i*j)adjustsize(x, i, j);
- matrix_set(x, 0);
- break;
- default:
- i = atom_getfloat(argv++);if(i<0)i=0;
- j = atom_getfloat(argv++);if(j<0)j=0;
- q = atom_getfloat(argv++);if(q<0)q=0;
- if(i*j)adjustsize(x, i, j);
- matrix_set(x, 0);
- x->current_col=q;
- }
- return (x);
-}
-static void mtx_col_setup(void)
-{
- mtx_col_class = class_new(gensym("mtx_col"), (t_newmethod)mtx_col_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_col_class, matrix_bang);
- class_addlist (mtx_col_class, mtx_col_list);
- class_addmethod(mtx_col_class, (t_method)mtx_col_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_col_class, (t_method)mtx_col_float, gensym(""), A_FLOAT, 0);
- class_sethelpsymbol(mtx_col_class, gensym("zexy/mtx_element"));
-}
-
-/* mtx_element */
-static t_class *mtx_element_class;
-
-static void mtx_element_list2(t_matrix *x, t_floatarg f1, t_floatarg f2)
-{
- int r = f1, c= f2;
- if(r<0)r=0;
- if(c<0)c=0;
- x->current_row = r;
- x->current_col = c;
-}
-static void mtx_element_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row, col;
- if (argc<2){ post("matrix : corrupt matrix passed"); return; }
- row = atom_getfloat(argv);
- col = atom_getfloat(argv+1);
- if ((row<1)||(col<1)){ post("matrix : corrupt matrix passed"); return; }
- if (row*col > argc-2){ post("matrix: sparse matrices not yet supported : use \"mtx_check\""); return; }
- matrix_matrix2(x, s, argc, argv);
- matrix_bang(x);
-}
-static void mtx_element_float(t_matrix *x, t_floatarg f)
-{
- if(x->current_col>x->col || x->current_row>x->row){
- error("mtx_element: element position exceeds matrix dimensions");
- return;
- }
- if(x->current_row == 0 && x->current_col == 0){
- matrix_set(x, f);
- matrix_bang(x);
- return;
- }
- if(x->current_row*x->current_col)SETFLOAT(x->atombuffer+1+(x->current_row-1)*x->col+x->current_col, f);
- else {
- t_atom *ap=x->atombuffer+2;
- int count;
- if (!x->current_col){
- ap+=x->col*(x->current_row-1);
- count=x->col;
- while(count--)SETFLOAT(&ap[count], f);
- } else { // x->current_row==0
- ap+=x->current_col-1;
- count=x->row;
- while(count--)SETFLOAT(&ap[count*x->col], f);
- }
- }
- matrix_bang(x);
-}
-
-static void *mtx_element_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_element_class);
- int i, j, q;
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
- x->current_row=x->current_col=0;
- x->col=x->row=0;
- x->atombuffer=0;
- switch (argc) {
- case 1:
- i = atom_getfloat(argv);
- if (i<0)i=0;
- if(i)adjustsize(x, i, i);
- matrix_set(x, 0);
- break;
- case 2:
- i = atom_getfloat(argv++);if(i<0)i=0;
- j = atom_getfloat(argv++);if(j<0)j=0;
- if(i*j)adjustsize(x, i, j);
- matrix_set(x, 0);
- break;
- case 4:
- i = atom_getfloat(argv++);if(i<0)i=0;
- j = atom_getfloat(argv++);if(j<0)j=0;
- if(i*j)adjustsize(x, i, j);
- matrix_set(x, 0);
- q = atom_getfloat(argv++);if(q<0)q=0;
- x->current_row=q;
- q = atom_getfloat(argv++);if(q<0)q=0;
- x->current_col=q;
- break;
- default:;
- }
- return (x);
-}
-static void mtx_element_setup(void)
-{
- mtx_element_class = class_new(gensym("mtx_element"), (t_newmethod)mtx_element_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_element_class, matrix_bang);
- class_addfloat (mtx_element_class, mtx_element_float);
- class_addmethod(mtx_element_class, (t_method)mtx_element_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_element_class, (t_method)mtx_element_list2, gensym(""), A_FLOAT, A_FLOAT, 0);
- class_sethelpsymbol(mtx_element_class, gensym("zexy/mtx_element"));
-}
-
-/* mtx_eye */
-static t_class *mtx_eye_class;
-static void *mtx_eye_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_eye_class);
- int col=0, row=0;
- outlet_new(&x->x_obj, 0);
- x->row = x->col = 0;
- x->atombuffer = 0;
- switch(argc) {
- case 0:
- break;
- case 1:
- col=row=atom_getfloat(argv);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- }
- if(col<0)col=0;
- if(row<0)row=0;
- if (col*row){
- int n = (col<row)?col:row;
- x->atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom));
- setdimen(x, row, col);
- matrix_set(x, 0);
- while(n--)SETFLOAT(x->atombuffer+2+n*(1+col), 1);
- }
- return (x);
-}
-static void mtx_eye_setup(void)
-{
- mtx_eye_class = class_new(gensym("mtx_eye"), (t_newmethod)mtx_eye_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addlist(mtx_eye_class, matrix_eye);
- class_addbang(mtx_eye_class, matrix_bang);
- class_addmethod(mtx_eye_class, (t_method)matrix_eye, gensym("matrix"), A_GIMME, 0);
-
- class_sethelpsymbol(mtx_eye_class, gensym("zexy/mtx_special"));
-}
-/* mtx_egg */
-static t_class *mtx_egg_class;
-static void *mtx_egg_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_egg_class);
- int col=0, row=0;
- outlet_new(&x->x_obj, 0);
- x->row = x->col = 0;
- x->atombuffer = 0;
- switch(argc) {
- case 0:
- break;
- case 1:
- col=row=atom_getfloat(argv);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- }
- if(col<0)col=0;
- if(row<0)row=0;
- if (col*row){
- int n = (col<row)?col:row;
- x->atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom));
- setdimen(x, row, col);
- matrix_set(x, 0);
- while(n--)SETFLOAT(x->atombuffer+2+(n+1)*(col-1), 1);
- }
- return (x);
-}
-static void mtx_egg_setup(void)
-{
- mtx_egg_class = class_new(gensym("mtx_egg"), (t_newmethod)mtx_egg_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addlist(mtx_egg_class, matrix_egg);
- class_addbang(mtx_egg_class, matrix_bang);
- class_addmethod(mtx_egg_class, (t_method)matrix_egg, gensym("matrix"), A_GIMME, 0);
-
- class_sethelpsymbol(mtx_egg_class, gensym("zexy/mtx_special"));
-}
-/* mtx_ones */
-static t_class *mtx_ones_class;
-static void *mtx_ones_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_ones_class);
- int col=0, row=0;
- outlet_new(&x->x_obj, 0);
- x->row = x->col = 0;
- x->atombuffer = 0;
- switch(argc) {
- case 0:
- break;
- case 1:
- col=row=atom_getfloat(argv);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- }
- if(col<0)col=0;
- if(row<0)row=0;
- if (col*row){
- x->atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom));
- setdimen(x, row, col);
- matrix_set(x, 1);
- }
- return (x);
-}
-static void mtx_ones_setup(void)
-{
- mtx_ones_class = class_new(gensym("mtx_ones"), (t_newmethod)mtx_ones_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addlist(mtx_ones_class, matrix_ones);
- class_addbang(mtx_ones_class, matrix_bang);
- class_addmethod(mtx_ones_class, (t_method)matrix_ones, gensym("matrix"), A_GIMME, 0);
-
- class_sethelpsymbol(mtx_ones_class, gensym("zexy/mtx_special"));
-}
-
-/* mtx_zeros */
-static t_class *mtx_zeros_class;
-static void *mtx_zeros_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_zeros_class);
- int col=0, row=0;
- outlet_new(&x->x_obj, 0);
- x->row = x->col = 0;
- x->atombuffer = 0;
- switch(argc) {
- case 0:
- break;
- case 1:
- col=row=atom_getfloat(argv);
- break;
- default:
- row=atom_getfloat(argv++);
- col=atom_getfloat(argv);
- }
- if(col<0)col=0;
- if(row<0)row=0;
- if (col*row){
- x->atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom));
- setdimen(x, row, col);
- matrix_set(x, 0);
- }
- return (x);
-}
-static void mtx_zeros_setup(void)
-{
- mtx_zeros_class = class_new(gensym("mtx_zeros"), (t_newmethod)mtx_zeros_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addlist(mtx_zeros_class, matrix_zeros);
- class_addbang(mtx_zeros_class, matrix_bang);
- class_addmethod(mtx_zeros_class, (t_method)matrix_zeros, gensym("matrix"), A_GIMME, 0);
-
- class_sethelpsymbol(mtx_zeros_class, gensym("zexy/mtx_special"));
-}
-
-/* mtx_diag */
-static t_class *mtx_diag_class;
-static void mtx_diag_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- int length=(col<row)?col:row, n=length;
- t_atom *ap = (t_atom *)getbytes(length * sizeof(t_atom)), *dummy=ap;
- if(row*col>argc-2)post("mtx_diag: sparse matrices not yet supported : use \"mtx_check\"");
- else {
- for(n=0;n<length;n++, dummy++)SETFLOAT(dummy, atom_getfloat(argv+n*(col+1)));
- outlet_list(x->x_obj.ob_outlet, gensym("diag"), length, ap);
- }
- freebytes(ap, (length * sizeof(t_atom)));
-}
-
-static void *mtx_diag_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_diag_class);
- outlet_new(&x->x_obj, 0);
- x->row = x->col = 0;
- x->atombuffer = 0;
-
- if(!argc)return(x);
- x->atombuffer = (t_atom *)getbytes((argc*argc+2)*sizeof(t_atom));
- setdimen(x, argc, argc);
- matrix_set(x, 0);
- argv+=argc-1;
- while(argc--)SETFLOAT(x->atombuffer+2+argc*(1+x->col), atom_getfloat(argv--));
-
- return (x);
-}
-static void mtx_diag_setup(void)
-{
- mtx_diag_class = class_new(gensym("mtx_diag"), (t_newmethod)mtx_diag_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addlist (mtx_diag_class, matrix_diag);
- class_addbang (mtx_diag_class, matrix_bang);
- class_addmethod(mtx_diag_class, (t_method)mtx_diag_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_diag_class, gensym("zexy/mtx_trace"));
-}
-
-/* mtx_diegg */
-static t_class *mtx_diegg_class;
-static void mtx_diegg_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- int length=(col<row)?col:row, n=length;
- t_atom *ap = (t_atom *)getbytes(length * sizeof(t_atom)), *dummy=ap;
- if(row*col>argc-2)post("mtx_diegg: sparse matrices not yet supported : use \"mtx_check\"");
- else {
- for(n=0;n<length;n++, dummy++)SETFLOAT(dummy, atom_getfloat(argv+(n-1)*(col-1)));
- outlet_list(x->x_obj.ob_outlet, gensym("diegg"), length, ap);
- }
- freebytes(ap, (length * sizeof(t_atom)));
-}
-
-static void *mtx_diegg_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_diegg_class);
- outlet_new(&x->x_obj, 0);
- x->row = x->col = 0;
- x->atombuffer = 0;
-
- if(!argc)return(x);
- x->atombuffer = (t_atom *)getbytes((argc*argc+2)*sizeof(t_atom));
- setdimen(x, argc, argc);
- matrix_set(x, 0);
- argv+=argc-1;
- while(argc--)SETFLOAT(x->atombuffer+2+argc*(1+x->col), atom_getfloat(argv--));
-
- return (x);
-}
-static void mtx_diegg_setup(void)
-{
- mtx_diegg_class = class_new(gensym("mtx_diegg"), (t_newmethod)mtx_diegg_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addlist (mtx_diegg_class, matrix_diegg);
- class_addbang (mtx_diegg_class, matrix_bang);
- class_addmethod(mtx_diegg_class, (t_method)mtx_diegg_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_diegg_class, gensym("zexy/mtx_special"));
-}
-/* mtx_trace */
-static t_class *mtx_trace_class;
-typedef struct _mtx_trace
-{
- t_object x_obj;
- t_float trace;
-} t_mtx_trace;
-static void mtx_trace_bang(t_mtx_trace *x)
-{
- outlet_float(x->x_obj.ob_outlet, x->trace);
-}
-static void mtx_trace_matrix(t_mtx_trace *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- int length=(col<row)?col:row;
- t_float trace = 0;
- if(row*col>argc-2)post("mtx_trace: sparse matrices not yet supported : use \"mtx_check\"");
- else while(length--)trace+=atom_getfloat(argv+length*(col+1));
- x->trace=trace;
- mtx_trace_bang(x);
-}
-static void *mtx_trace_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_mtx_trace *x = (t_mtx_trace *)pd_new(mtx_trace_class);
- outlet_new(&x->x_obj, 0);
- x->trace=0;
- return (x);
-}
-static void mtx_trace_setup(void)
-{
- mtx_trace_class = class_new(gensym("mtx_trace"), (t_newmethod)mtx_trace_new,
- 0, sizeof(t_mtx_trace), 0, A_GIMME, 0);
- class_addbang (mtx_trace_class, mtx_trace_bang);
- class_addmethod(mtx_trace_class, (t_method)mtx_trace_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_trace_class, gensym("zexy/mtx_trace"));
-}
-
-/* mtx_mean */
-static t_class *mtx_mean_class;
-
-static void mtx_mean_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- t_atom *ip, *op;
- int c=col, r;
- t_float sum;
- t_float factor=1./row;
- adjustsize(x, 1, col);
- op=x->atombuffer;
-
- while(c--){
- sum=0;
- ip=argv+col-c-1;
- r=row;
- while(r--)sum+=atom_getfloat(ip+col*r);
- SETFLOAT(op, sum*factor);
- op++;
- }
- outlet_list(x->x_obj.ob_outlet, gensym("row"), col, x->atombuffer);
-}
-
-static void *mtx_mean_new(void)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_mean_class);
- outlet_new(&x->x_obj, 0);
- x->col=x->row=0;
- x->atombuffer=0;
- return (x);
-}
-static void mtx_mean_setup(void)
-{
- mtx_mean_class = class_new(gensym("mtx_mean"), (t_newmethod)mtx_mean_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, 0, 0);
- class_addmethod(mtx_mean_class, (t_method)mtx_mean_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_mean_class, gensym("zexy/mtx_mean"));
-}
-
-/* mtx_rand */
-static t_class *mtx_rand_class;
-
-static void mtx_rand_seed(t_matrix *x, t_float f)
-{
- x->current_row=f;
-}
-static int makeseed(void)
-{
- static unsigned int random_nextseed = 1489853723;
- random_nextseed = random_nextseed * 435898247 + 938284287;
- return (random_nextseed & 0x7fffffff);
-}
-static void mtx_rand_random(t_matrix *x)
-{
- long size = x->row * x->col;
- t_atom *ap=x->atombuffer+2;
- int val = x->current_row;
- while(size--)SETFLOAT(ap+size, ((float)(((val=val*435898247+382842987)&0x7fffffff)-0x40000000))*(float)(0.5/0x40000000)+0.5);
- x->current_row=val;
-}
-
-static void mtx_rand_list(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row = atom_getfloat(argv++);
- int col = atom_getfloat(argv++);
-
- if(!argv)return;
- if(argc==1)col=row;
-
- adjustsize(x, row, col);
- mtx_rand_random(x);
- matrix_bang(x);
-}
-static void mtx_rand_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- matrix_matrix2(x, s, argc, argv);
- mtx_rand_random(x);
- matrix_bang(x);
-}
-static void mtx_rand_bang(t_matrix *x)
-{
- mtx_rand_random(x);
- matrix_bang(x);
-}
-static void *mtx_rand_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_rand_class);
- int row, col;
- outlet_new(&x->x_obj, 0);
- x->col=x->row=0;
- x->atombuffer=0;
- x->current_row=makeseed();
-
- if (argc) {
- row=atom_getfloat(argv);
- col=(argc>1)?atom_getfloat(argv+1):row;
- adjustsize(x, row, col);
- mtx_rand_random(x);
- }
- return (x);
-}
-static void mtx_rand_setup(void)
-{
- mtx_rand_class = class_new(gensym("mtx_rand"), (t_newmethod)mtx_rand_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addmethod(mtx_rand_class, (t_method)mtx_rand_matrix, gensym("matrix"), A_GIMME, 0);
- class_addlist (mtx_rand_class, mtx_rand_list);
- class_addbang (mtx_rand_class, mtx_rand_bang);
-
- class_addmethod(mtx_rand_class, (t_method)mtx_rand_seed, gensym("seed"), A_FLOAT, 0);
- class_sethelpsymbol(mtx_rand_class, gensym("zexy/mtx_rand"));
-}
-
-
-/* mtx_scroll */
-/* scroll the rows */
-static t_class *mtx_scroll_class;
-
-static void mtx_scroll_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- int rowscroll = ((int)x->f%row+row)%row;
-
- if(row*col>argc-2) {
- post("mtx_scroll: sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
- adjustsize(x, row, col);
-
- memcpy(x->atombuffer+2, argv+(row-rowscroll)*col, rowscroll*col*sizeof(t_atom));
- memcpy(x->atombuffer+2+rowscroll*col, argv, (row-rowscroll)*col*sizeof(t_atom));
-
- matrix_bang(x);
-}
-
-static void *mtx_scroll_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_scroll_class);
- floatinlet_new(&x->x_obj, &(x->f));
- outlet_new(&x->x_obj, 0);
-
- x->f=argc?atom_getfloat(argv):0;
- x->col=x->row=0;
- x->atombuffer=0;
- return (x);
-}
-static void mtx_scroll_setup(void)
-{
- mtx_scroll_class = class_new(gensym("mtx_scroll"), (t_newmethod)mtx_scroll_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_scroll_class, matrix_bang);
- class_addmethod(mtx_scroll_class, (t_method)mtx_scroll_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_scroll_class, gensym("zexy/mtx_transpose"));
-}
-
-/* mtx_roll */
-/* roll the rows */
-static t_class *mtx_roll_class;
-
-static void mtx_roll_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- t_atom *ap;
- int colroll = ((int)x->f%col+col)%col;
- int c;
-
- if(row*col>argc-2) {
- post("mtx_roll: sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
-
- adjustsize(x, row, col);
- ap = x->atombuffer+2;
-
- c=col;
- while(c--){
- t_atom *in = argv+col-c-1;
- t_atom *out = ap +(col-c-1+colroll)%col;
- int r = row;
- while (r--){
- SETFLOAT(out, atom_getfloat(in));
- out+=col;
- in+=col;
- }
-
- }
-
- matrix_bang(x);
-}
-
-static void *mtx_roll_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_roll_class);
- floatinlet_new(&x->x_obj, &(x->f));
- outlet_new(&x->x_obj, 0);
-
- x->f=argc?atom_getfloat(argv):0;
- x->col=x->row=0;
- x->atombuffer=0;
- return (x);
-}
-static void mtx_roll_setup(void)
-{
- mtx_roll_class = class_new(gensym("mtx_roll"), (t_newmethod)mtx_roll_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_roll_class, matrix_bang);
- class_addmethod(mtx_roll_class, (t_method)mtx_roll_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_roll_class, gensym("zexy/mtx_transpose"));
-}
-
-/* mtx_transpose */
-static t_class *mtx_transpose_class;
-
-static void mtx_transpose_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- t_atom *ap;
- int r, c;
-
- if(row*col>argc-2) {
- post("mtx_transpose: sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
- if (col*row!=x->col*x->row) {
- freebytes(x->atombuffer, (x->col*x->row+2)*sizeof(t_atom));
- x->atombuffer = (t_atom *)getbytes((row*col+2)*sizeof(t_atom));
- }
- ap = x->atombuffer+2;
- setdimen(x, col, row);
- r = row;
- while(r--){
- c=col;
- while(c--) {
- t_float f = atom_getfloat(argv+r*col+c);
- SETFLOAT(ap+c*row+r, f);
- }
- }
-
- matrix_bang(x);
-}
-
-static void *mtx_transpose_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_transpose_class);
- outlet_new(&x->x_obj, 0);
- x->col=x->row=0;
- x->atombuffer=0;
- return (x);
-}
-static void mtx_transpose_setup(void)
-{
- mtx_transpose_class = class_new(gensym("mtx_transpose"), (t_newmethod)mtx_transpose_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_transpose_class, matrix_bang);
- class_addmethod(mtx_transpose_class, (t_method)mtx_transpose_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_transpose_class, gensym("zexy/mtx_transpose"));
-}
-
-/* -­------------------------------------------------------------- */
-/* matrix math */
-
-typedef struct _mtx_binscalar
-{
- t_object x_obj;
-
- t_matrix m; // the output matrix
- t_float f; // the second input
-} t_mtx_binscalar;
-
-typedef struct _mtx_binmtx
-{
- t_object x_obj;
-
- t_matrix m; // the output matrix
- t_matrix m2; // the second input
-} t_mtx_binmtx;
-
-static void mtx_bin_matrix2(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row = atom_getfloat(argv);
- int col = atom_getfloat(argv+1);
- if (argc<2){post("mtx_bin2: crippled matrix"); return;}
- if ((col<1)||(row<1)) {post("mtx_bin2: invalid dimensions %dx%d", row,col); return;}
- if (col*row+2>argc){ post("mtx_bin2: sparse matrix not yet supported : use \"mtx_check\""); return;}
-
- if (row*col!=x->m2.row*x->m2.col) {
- freebytes(x->m2.atombuffer, (x->m2.row*x->m2.col+2)*sizeof(t_atom));
- x->m2.atombuffer=copybytes(argv,(row*col+2)*sizeof(t_atom));
- }else memcpy(x->m2.atombuffer, argv, (row*col+2)*sizeof(t_atom));
- setdimen(&x->m2, row, col);
-}
-
-static void mtx_binmtx_bang(t_mtx_binmtx *x)
-{
- if((&x->m)&&(x->m.atombuffer))
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), x->m.col*x->m.row+2, x->m.atombuffer);
-}
-
-
-static void mtx_binmtx_free(t_mtx_binmtx *x)
-{
- matrix_free(&x->m);
- matrix_free(&x->m2);
-}
-static void mtx_binscalar_bang(t_mtx_binscalar *x)
-{
- if((&x->m)&&(x->m.atombuffer))
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), x->m.col*x->m.row+2, x->m.atombuffer);
-}
-static void mtx_binscalar_free(t_mtx_binscalar *x)
-{
- matrix_free(&x->m);
-}
-
-
-
-/* mtx_add */
-static t_class *mtx_add_class, *mtx_addscalar_class;
-
-static void mtx_addscalar_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc-2;
- int row=atom_getfloat(argv), col=atom_getfloat(argv+1);
-
- t_float offset=x->f;
- t_atom *buf;
- t_atom *ap=argv+2;
-
- if(argc<2){post("mtx_add: crippled matrix");return; }
- adjustsize(&x->m, row, col);
-
- buf=x->m.atombuffer+2;
-
- while(n--){
- buf->a_type = A_FLOAT;
- buf++->a_w.w_float = atom_getfloat(ap++) + offset;
- }
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_addscalar_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc;
- t_atom *m;
- t_float offset = x->f;
- adjustsize(&x->m, 1, argc);
- m = x->m.atombuffer;
-
- while(n--){
- m->a_type = A_FLOAT;
- (m++)->a_w.w_float = atom_getfloat(argv++) + offset;
- }
- outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
-}
-
-static void mtx_add_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv);
- int col=atom_getfloat(argv+1);
- t_atom *m;
- t_atom *m1 = argv+2;
- t_atom *m2 = x->m2.atombuffer+2;
- int n = argc-2;
-
- if (argc<2){ post("mtx_add: crippled matrix"); return; }
- if ((col<1)||(row<1)) { post("mtx_add: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
-
- if (!(x->m2.col*x->m2.row)) {
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, argv);
- return;
- }
-
- if ((col!=x->m2.col)||(row!=x->m2.row)){
- post("mtx_add: matrix dimensions do not match");
- /* LATER SOLVE THIS */
- return;
- }
- adjustsize(&x->m, row, col);
- m = x->m.atombuffer+2;
-
- while(n--){
- t_float f = atom_getfloat(m1++)+atom_getfloat(m2++);
- SETFLOAT(m, f);
- m++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_add_float(t_mtx_binmtx *x, t_float f)
-{
- t_matrix *m=&x->m, *m2=&x->m2;
- t_atom *ap, *ap2=m2->atombuffer+2;
- int row2, col2, n;
-
- if (!m2->atombuffer){ post("mulitply with what ?"); return; }
-
- row2=atom_getfloat(m2->atombuffer);
- col2=atom_getfloat(m2->atombuffer+1);
- adjustsize(m, row2, col2);
- ap=m->atombuffer+2;
-
- n=row2*col2;
-
- while(n--){
- SETFLOAT(ap, f+atom_getfloat(ap2++));
- ap++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer);
-}
-static void *mtx_add_new(t_symbol *s, int argc, t_atom *argv)
-{
- if (argc>1) post("mtx_add : extra arguments ignored");
- if (argc) {
- t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_addscalar_class);
- floatinlet_new(&x->x_obj, &x->f);
- x->f = atom_getfloatarg(0, argc, argv);
- outlet_new(&x->x_obj, 0);
- return(x);
- } else {
- t_mtx_binmtx *x = (t_mtx_binmtx *)pd_new(mtx_add_class);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->m.col = x->m.row = x->m2.col = x->m2.row = 0;
- x->m.atombuffer = x->m2.atombuffer = 0;
- return(x);
- }
-}
-
-static void mtx_add_setup(void)
-{
- mtx_add_class = class_new(gensym("mtx_add"), (t_newmethod)mtx_add_new, (t_method)mtx_binmtx_free,
- sizeof(t_mtx_binmtx), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)mtx_add_new, gensym("mtx_+"), A_GIMME,0);
- class_addmethod(mtx_add_class, (t_method)mtx_add_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_add_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0);
- class_addfloat (mtx_add_class, mtx_add_float);
- class_addbang (mtx_add_class, mtx_binmtx_bang);
-
- mtx_addscalar_class = class_new(gensym("mtx_add"), 0, (t_method)mtx_binscalar_free,
- sizeof(t_mtx_binscalar), 0, 0);
- class_addcreator(0, gensym("mtx_+"), 0, 0);
- class_addmethod(mtx_addscalar_class, (t_method)mtx_addscalar_matrix, gensym("matrix"), A_GIMME, 0);
- class_addlist (mtx_addscalar_class, mtx_addscalar_list);
- class_addbang (mtx_addscalar_class, mtx_binscalar_bang);
-
- class_sethelpsymbol(mtx_add_class, gensym("zexy/mtx_binops"));
- class_sethelpsymbol(mtx_addscalar_class, gensym("zexy/mtx_binops"));
-}
-
-/* mtx_sub */
-static t_class *mtx_sub_class, *mtx_subscalar_class;
-
-static void mtx_subscalar_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc-2;
- int row=atom_getfloat(argv), col=atom_getfloat(argv+1);
-
- t_float offset=x->f;
- t_atom *buf;
- t_atom *ap=argv+2;
-
- if(argc<2){post("mtx_sub: crippled matrix");return; }
- adjustsize(&x->m, row, col);
-
- buf=x->m.atombuffer+2;
-
- while(n--){
- buf->a_type = A_FLOAT;
- buf++->a_w.w_float = atom_getfloat(ap++) - offset;
- }
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_subscalar_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc;
- t_atom *m;
- t_float offset = x->f;
- adjustsize(&x->m, 1, argc);
- m = x->m.atombuffer;
-
- while(n--){
- m->a_type = A_FLOAT;
- (m++)->a_w.w_float = atom_getfloat(argv++) - offset;
- }
- outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
-}
-
-static void mtx_sub_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv);
- int col=atom_getfloat(argv+1);
- t_atom *m;
- t_atom *m1 = argv+2;
- t_atom *m2 = x->m2.atombuffer+2;
- int n = argc-2;
-
- if (argc<2){ post("mtx_sub: crippled matrix"); return; }
- if ((col<1)||(row<1)) { post("mtx_sub: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
-
- if (!(x->m2.col*x->m2.row)) {
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, argv);
- return;
- }
-
- if ((col!=x->m2.col)||(row!=x->m2.row)){
- post("mtx_sub: matrix dimensions do not match");
- /* LATER SOLVE THIS */
- return;
- }
- adjustsize(&x->m, row, col);
- m = x->m.atombuffer+2;
-
- while(n--){
- t_float f = atom_getfloat(m1++)-atom_getfloat(m2++);
- SETFLOAT(m, f);
- m++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_sub_float(t_mtx_binmtx *x, t_float f)
-{
- t_matrix *m=&x->m, *m2=&x->m2;
- t_atom *ap, *ap2=m2->atombuffer+2;
- int row2, col2, n;
-
- if (!m2->atombuffer){ post("mulitply with what ?"); return; }
-
- row2=atom_getfloat(m2->atombuffer);
- col2=atom_getfloat(m2->atombuffer+1);
- adjustsize(m, row2, col2);
- ap=m->atombuffer+2;
-
- n=row2*col2;
-
- while(n--){
- SETFLOAT(ap, f-atom_getfloat(ap2++));
- ap++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer);
-}
-static void *mtx_sub_new(t_symbol *s, int argc, t_atom *argv)
-{
- if (argc>1) post("mtx_sub : extra arguments ignored");
- if (argc) {
- t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_subscalar_class);
- floatinlet_new(&x->x_obj, &x->f);
- x->f = atom_getfloatarg(0, argc, argv);
- outlet_new(&x->x_obj, 0);
- return(x);
- } else {
- t_mtx_binmtx *x = (t_mtx_binmtx *)pd_new(mtx_sub_class);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->m.col = x->m.row = x->m2.col = x->m2.row = 0;
- x->m.atombuffer = x->m2.atombuffer = 0;
- return(x);
- }
-}
-
-static void mtx_sub_setup(void)
-{
- mtx_sub_class = class_new(gensym("mtx_sub"), (t_newmethod)mtx_sub_new, (t_method)mtx_binmtx_free,
- sizeof(t_mtx_binmtx), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)mtx_sub_new, gensym("mtx_-"), A_GIMME,0);
- class_addmethod(mtx_sub_class, (t_method)mtx_sub_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_sub_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0);
- class_addfloat (mtx_sub_class, mtx_sub_float);
- class_addbang (mtx_sub_class, mtx_binmtx_bang);
-
- mtx_subscalar_class = class_new(gensym("mtx_sub"), 0, (t_method)mtx_binscalar_free,
- sizeof(t_mtx_binscalar), 0, 0);
- class_addcreator(0, gensym("mtx_-"), 0, 0);
- class_addmethod(mtx_subscalar_class, (t_method)mtx_subscalar_matrix, gensym("matrix"), A_GIMME, 0);
- class_addlist (mtx_subscalar_class, mtx_subscalar_list);
- class_addbang (mtx_subscalar_class, mtx_binscalar_bang);
-
- class_sethelpsymbol(mtx_sub_class, gensym("zexy/mtx_binops"));
- class_sethelpsymbol(mtx_subscalar_class, gensym("zexy/mtx_binops"));
-}
-
-
-/* mtx_mul */
-static t_class *mtx_mul_class, *mtx_mulelement_class, *mtx_mulscalar_class;
-
-static void mtx_mul_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *m=&x->m, *m2=&x->m2;
- t_atom *ap, *ap1=argv+2, *ap2=m2->atombuffer+2;
- int row=atom_getfloat(argv), col=atom_getfloat(argv+1);
- int row2, col2, n, r, c;
-
- if (!m2->atombuffer){ post("mulitply with what ?"); return; }
- if (argc<2){ post("mtx_mul: crippled matrix"); return; }
- if ((col<1)||(row<1)){post("mtx_mul: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
-
- row2=atom_getfloat(m2->atombuffer);
- col2=atom_getfloat(m2->atombuffer+1);
-
- if (col!=row2) { post("mtx_mul: matrix dimensions do not match !"); return; }
-
- adjustsize(m, row, col2);
- ap=m->atombuffer+2;
-
- for(r=0;r<row;r++)
- for(c=0;c<col2;c++) {
- T_FLOAT sum = 0.f;
- for(n=0;n<col;n++)sum+=(T_FLOAT)atom_getfloat(ap1+col*r+n)*atom_getfloat(ap2+col2*n+c);
- SETFLOAT(ap+col2*r+c,sum);
- }
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer);
-}
-
-static void mtx_mul_float(t_mtx_binmtx *x, t_float f)
-{
- t_matrix *m=&x->m, *m2=&x->m2;
- t_atom *ap, *ap2=m2->atombuffer+2;
- int row2, col2, n;
-
- if (!m2->atombuffer){ post("mulitply with what ?"); return; }
-
- row2=atom_getfloat(m2->atombuffer);
- col2=atom_getfloat(m2->atombuffer+1);
- adjustsize(m, row2, col2);
- ap=m->atombuffer+2;
-
- n=row2*col2;
-
- while(n--){
- SETFLOAT(ap, f*atom_getfloat(ap2++));
- ap++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer);
-}
-
-static void mtx_mulelement_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- t_atom *m;
- t_atom *m2 = x->m2.atombuffer+2;
- int n = argc-2;
-
- if (argc<2){ post("mtx_mul: crippled matrix"); return; }
- if ((col<1)||(row<1)) { post("mtx_mul: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
- if (!(x->m2.col*x->m2.row)) {
- adjustsize(&x->m, row, col);
- matrix_set(&x->m, 0);
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
- return;
- }
- if ((col!=x->m2.col)||(row!=x->m2.row)){ post("matrix dimension do not match"); /* LATER SOLVE THIS */ return; }
-
- adjustsize(&x->m, row, col);
- m = x->m.atombuffer+2;
-
- while(n--){
- t_float f = atom_getfloat(argv++)*atom_getfloat(m2++);
- SETFLOAT(m, f);
- m++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-
-static void mtx_mulscalar_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc-2;
- t_atom *m;
- t_float factor = x->f;
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
-
- if (argc<2){
- post("mtx_mul: crippled matrix");
- return;
- }
- adjustsize(&x->m, row, col);
- m = x->m.atombuffer+2;
-
- while(n--){
- m->a_type = A_FLOAT;
- (m++)->a_w.w_float = atom_getfloat(argv++)*factor;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_mulscalar_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc;
- t_atom *m;
- t_float factor = x->f;
- adjustsize(&x->m, 1, argc);
- m = x->m.atombuffer;
-
- while(n--){
- m->a_type = A_FLOAT;
- (m++)->a_w.w_float = atom_getfloat(argv++)*factor;
- }
- outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
-}
-
-static void *mtx_mul_new(t_symbol *s, int argc, t_atom *argv)
-{
- if (argc>1) post("mtx_mul : extra arguments ignored");
- if (argc) {
- t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_mulscalar_class);
- floatinlet_new(&x->x_obj, &x->f);
- x->f = atom_getfloatarg(0, argc, argv);
- outlet_new(&x->x_obj, 0);
- return(x);
- } else {
- if (s->s_name[4]=='.') {
- /* element mul */
-
- t_matrix *x = (t_matrix *)pd_new(mtx_mulelement_class);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->col = x->row = 0;
- x->atombuffer = 0;
- return(x);
- } else {
- t_mtx_binmtx *x = (t_mtx_binmtx *)pd_new(mtx_mul_class);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->m.col = x->m.row = x->m2.col = x->m2.row = 0;
- x->m.atombuffer = x->m2.atombuffer = 0;
- return (x);
- }
- }
-}
-
-static void mtx_mul_setup(void)
-{
- mtx_mul_class = class_new(gensym("mtx_mul"), (t_newmethod)mtx_mul_new, (t_method)mtx_binmtx_free,
- sizeof(t_mtx_binmtx), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)mtx_mul_new, gensym("mtx_*"), A_GIMME,0);
- class_addmethod(mtx_mul_class, (t_method)mtx_mul_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_mul_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0);
- class_addfloat (mtx_mul_class, mtx_mul_float);
- class_addbang (mtx_mul_class, mtx_binmtx_bang);
-
- mtx_mulelement_class = class_new(gensym("mtx_.*"), (t_newmethod)mtx_mul_new, (t_method)mtx_binmtx_free,
- sizeof(t_mtx_binmtx), 0, A_GIMME, 0);
- class_addmethod(mtx_mulelement_class, (t_method)mtx_mulelement_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_mulelement_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0);
- class_addfloat (mtx_mulelement_class, mtx_mul_float);
- class_addbang (mtx_mulelement_class, mtx_binmtx_bang);
-
- mtx_mulscalar_class = class_new(gensym("mtx_mul"), 0, (t_method)mtx_binscalar_free,
- sizeof(t_mtx_binscalar), 0, 0);
- class_addcreator(0, gensym("mtx_*"), 0, 0);
- class_addcreator(0, gensym("mtx_.*"), 0, 0);
- class_addmethod(mtx_mulscalar_class, (t_method)mtx_mulscalar_matrix, gensym("matrix"), A_GIMME, 0);
- class_addlist (mtx_mulscalar_class, mtx_mulscalar_list);
- class_addbang (mtx_mulscalar_class, mtx_binscalar_bang);
-
- class_sethelpsymbol(mtx_mul_class, gensym("zexy/mtx_binops"));
- class_sethelpsymbol(mtx_mulelement_class, gensym("zexy/mtx_binops"));
- class_sethelpsymbol(mtx_mulscalar_class, gensym("zexy/mtx_binops"));
-}
-
-
-/* mtx_div */
-static t_class *mtx_divelement_class, *mtx_divscalar_class;
-
-static void mtx_divelement_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
- t_atom *m;
- t_atom *m2 = x->m2.atombuffer+2;
- int n = argc-2;
-
- if (argc<2){ post("mtx_div: crippled matrix"); return; }
- if ((col<1)||(row<1)) { post("mtx_div: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
- if (!(x->m2.col*x->m2.row)) {
- adjustsize(&x->m, row, col);
- matrix_set(&x->m, 0);
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
- return;
- }
- if ((col!=x->m2.col)||(row!=x->m2.row)){ post("matrix dimension do not match"); /* LATER SOLVE THIS */ return; }
-
- adjustsize(&x->m, row, col);
- m = x->m.atombuffer+2;
-
- while(n--){
- t_float f = atom_getfloat(argv++)/atom_getfloat(m2++);
- SETFLOAT(m, f);
- m++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_divelement_float(t_mtx_binmtx *x, t_float f)
-{
- t_matrix *m=&x->m, *m2=&x->m2;
- t_atom *ap, *ap2=m2->atombuffer+2;
- int row2, col2, n;
-
- if (!m2->atombuffer){ post("divide by what ?"); return; }
-
- row2=atom_getfloat(m2->atombuffer);
- col2=atom_getfloat(m2->atombuffer+1);
- adjustsize(m, row2, col2);
- ap=m->atombuffer+2;
-
- n=row2*col2;
-
- while(n--){
- SETFLOAT(ap, f/atom_getfloat(ap2++));
- ap++;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer);
-}
-static void mtx_divscalar_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc-2;
- t_atom *m;
- t_float factor = 1.0/x->f;
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
-
- if (argc<2){
- post("mtx_div: crippled matrix");
- return;
- }
- adjustsize(&x->m, row, col);
- m = x->m.atombuffer+2;
-
- while(n--){
- m->a_type = A_FLOAT;
- (m++)->a_w.w_float = atom_getfloat(argv++)*factor;
- }
-
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
-}
-static void mtx_divscalar_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n=argc;
- t_atom *m;
- t_float factor = 1.0/x->f;
-
- adjustsize(&x->m, 1, argc);
- m = x->m.atombuffer;
-
- while(n--){
- m->a_type = A_FLOAT;
- (m++)->a_w.w_float = atom_getfloat(argv++)*factor;
- }
-
- outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
-}
-
-static void *mtx_div_new(t_symbol *s, int argc, t_atom *argv)
-{
- if (argc>1) post("mtx_div : extra arguments ignored");
- if (argc) {
- /* scalar division */
- t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_divscalar_class);
- floatinlet_new(&x->x_obj, &x->f);
- x->f = atom_getfloatarg(0, argc, argv);
- outlet_new(&x->x_obj, 0);
- return(x);
- } else {
- /* element division */
- t_matrix *x = (t_matrix *)pd_new(mtx_divelement_class);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- outlet_new(&x->x_obj, 0);
- x->col = x->row = 0;
- x->atombuffer = 0;
- return(x);
- }
-}
-
-static void mtx_div_setup(void)
-{
- mtx_divelement_class = class_new(gensym("mtx_./"), (t_newmethod)mtx_div_new, (t_method)mtx_binmtx_free,
- sizeof(t_mtx_binmtx), 0, A_GIMME, 0);
- class_addmethod(mtx_divelement_class, (t_method)mtx_divelement_matrix, gensym("matrix"), A_GIMME, 0);
- class_addmethod(mtx_divelement_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0);
- class_addfloat (mtx_divelement_class, mtx_divelement_float);
- class_addbang (mtx_divelement_class, mtx_binmtx_bang);
-
- mtx_divscalar_class = class_new(gensym("mtx_./"), 0, (t_method)mtx_binscalar_free,
- sizeof(t_mtx_binscalar), 0, 0);
- class_addmethod(mtx_divscalar_class, (t_method)mtx_divscalar_matrix, gensym("matrix"), A_GIMME, 0);
- class_addlist (mtx_divscalar_class, mtx_divscalar_list);
- class_addbang (mtx_divscalar_class, mtx_binscalar_bang);
-
- class_sethelpsymbol(mtx_divelement_class, gensym("zexy/mtx_binops"));
- class_sethelpsymbol(mtx_divscalar_class, gensym("zexy/mtx_binops"));
-}
-
-/* mtx_inverse */
-static t_class *mtx_inverse_class;
-
-static void mtx_inverse_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- /* maybe we should do this in double or long double ? */
- int row=atom_getfloat(argv);
- int col=atom_getfloat(argv+1);
- int i, k, row2=row*row;
-
- T_FLOAT *original, *inverted;
- T_FLOAT *a1, *a2, *b1, *b2; // dummy pointers
-
- int ok = 0;
-
- if(row*col+2>argc){
- post("mtx_print : sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
- if (row!=col){
- post("mtx_inverse: only square matrices can be inverted");
- return;
- }
-
- // reserve memory for outputting afterwards
- adjustsize(x, row, row);
- // 1. get the 2 matrices : orig; invert (create as eye, but will be orig^(-1))
- inverted = (T_FLOAT *)getbytes(sizeof(T_FLOAT)*row2);
- // 1a extract values of A to float-buf
- original=matrix2float(argv);
- // 1b make an eye-shaped float-buf for B
- i=row2;
- b1=inverted;
- while(i--)*b1++=0;
- i=row;
- b1=inverted;
- while(i--)b1[i*(row+1)]=1;
-
- // 2. do the Gauss-Jordan
- for (k=0;k<row;k++) {
- // 2. adjust current row
- T_FLOAT diagel = original[k*(col+1)];
-#if 1
- T_FLOAT i_diagel = diagel?1./diagel:0;
- if (!diagel)ok++;
-#else
- T_FLOAT i_diagel = 1./diagel;
-#endif
-
- /* normalize current row (set the diagonal-element to 1 */
- a2=original+k*col;
- b2=inverted+k*col;
- i=row;
- while(i--){
- *a2++*=i_diagel;
- *b2++*=i_diagel;
- }
- /* eliminate the k-th element in each row by adding the weighted normalized row */
-
- a2=original+k*row;
- b2=inverted+k*row;
- for(i=0;i<row;i++)
- if (i-k) {
- T_FLOAT f=-*(original+i*row+k);
- int j = row;
- a1=original+i*row;
- b1=inverted+i*row;
- while (j--) {
- *(a1+j)+=f**(a2+j);
- *(b1+j)+=f**(b2+j);
- }
- }
- }
- // 3. output the matrix
- // 3a convert the floatbuf to an atombuf;
- float2matrix(x->atombuffer, inverted);
- // 3b destroy the buffers
- freebytes(original, sizeof(T_FLOAT)*row2);
-
- if (ok)post("mtx_inverse: couldn't really invert the matrix !!! %d error%c", ok, (ok-1)?'s':0);
-
- // 3c output the atombuf;
- matrix_bang(x);
-}
-
-static void *mtx_inverse_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_inverse_class);
- outlet_new(&x->x_obj, 0);
- x->col=x->row=0;
- x->atombuffer=0;
-
- return (x);
-}
-static void mtx_inverse_setup(void)
-{
- mtx_inverse_class = class_new(gensym("mtx_inverse"), (t_newmethod)mtx_inverse_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_inverse_class, matrix_bang);
- class_addmethod(mtx_inverse_class, (t_method)mtx_inverse_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_inverse_class, gensym("zexy/mtx_inverse"));
-}
-
-
-/* mtx_pivot */
-static t_class *mtx_pivot_class;
-
-typedef struct _mtx_pivot
-{
- t_object x_obj;
-
- t_matrix m; // the output matrix
- t_matrix m_pre; // the pre -multiply matrix
- t_matrix m_post; // the post-multiply matrix
-
- t_outlet *pivo, *pre, *post;
-
-} t_mtx_pivot;
-
-static void mtx_pivot_matrix(t_mtx_pivot *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv);
- int col=atom_getfloat(argv+1);
- t_atom *m_pre, *m_post;
- int i, j, k;
- int min_rowcol = (row<col)?row:col;
- T_FLOAT *buffer, *buf;
- int *i_pre, *i_post, *i_buf;
-
- int pivot_row, pivot_col;
-
- if (argc<2){ post("mtx_pivot: crippled matrix"); return; }
- if ((col<1)||(row<1)) { post("mtx_pivot: invalid dimensions"); return; }
- if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
-
- adjustsize(&x->m, row, col);
- adjustsize(&x->m_pre, row, row);
- adjustsize(&x->m_post,col, col);
- matrix_set(&x->m_pre, 0);
- matrix_set(&x->m_post, 0);
-
- buffer = matrix2float(argv);
- i_pre = (int *)getbytes(sizeof(int)*row);
- i_post = (int *)getbytes(sizeof(int)*col);
-
- /* clear pre&post matrices */
- i=row;
- i_buf=i_pre;
- while(i--)*i_buf++=row-i-1;
- i=col;
- i_buf=i_post;
- while(i--)*i_buf++=col-i-1;
-
- /* do the pivot thing */
-
- for (k=0; k<min_rowcol-1; k++){
- // 1. find max_element
- T_FLOAT max = 0;
- pivot_row = pivot_col = k;
-
- for(i=k; i<row; i++){
- buf=buffer+col*i+k;
-
- j=col-k;
- while(j--){
- T_FLOAT f = fabsf(*buf++);
- if (f>max) {
- max=f;
- pivot_row = i;
- pivot_col = col-j-1;
- }
- }
- }
- // 2. move max el to [k,k]
- // 2a swap rows
- if (k-pivot_row) {
- T_FLOAT *oldrow=buffer+col*k;
- T_FLOAT *newrow=buffer+col*pivot_row;
-
- i=col;
- while(i--){
- T_FLOAT f=*oldrow;
- *oldrow++=*newrow;
- *newrow++=f;
- }
- i=i_pre[k];
- i_pre[k]=i_pre[pivot_row];
- i_pre[pivot_row]=i;
- }
- // 2b swap columns
- if (k-pivot_col) {
- T_FLOAT *oldcol=buffer+k;
- T_FLOAT *newcol=buffer+pivot_col;
-
- i=row;
- while(i--){
- T_FLOAT f=*oldcol;
- *oldcol=*newcol;
- *newcol=f;
- oldcol+=col;
- newcol+=col;
- }
- i=i_post[k];
- i_post[k]=i_post[pivot_col];
- i_post[pivot_col]=i;
- }
- }
-
- float2matrix(x->m.atombuffer, buffer);
-
- i=col;
- m_post = x->m_post.atombuffer+2;
- while(i--){
- SETFLOAT(m_post+i_post[i]*col+i, 1);
- }
- i=row;
- m_pre = x->m_pre.atombuffer+2;
- while(i--)SETFLOAT(m_pre+i_pre[i]+i*col, 1);
-
-
- outlet_anything(x->post, gensym("matrix"), 2+col*col, x->m_post.atombuffer);
- outlet_anything(x->pre, gensym("matrix"), 2+row*row, x->m_pre.atombuffer);
- outlet_anything(x->pivo , gensym("matrix"), 2+row*col, x->m.atombuffer );
-}
-
-static void mtx_pivot_free(t_mtx_pivot *x)
-{
- matrix_free(&x->m);
- matrix_free(&x->m_pre);
- matrix_free(&x->m_post);
-}
-
-static void *mtx_pivot_new(void)
-{
- t_mtx_pivot *x = (t_mtx_pivot *)pd_new(mtx_pivot_class);
-
- x->pivo = outlet_new(&x->x_obj, 0);
- x->pre = outlet_new(&x->x_obj, 0);
- x->post = outlet_new(&x->x_obj, 0);
-
- x->m.atombuffer = x->m_pre.atombuffer = x->m_post.atombuffer = 0;
- x->m.row = x->m.col = x->m_pre.row = x->m_pre.col = x->m_post.row = x->m_post.col = 0;
-
- return(x);
-}
-
-static void mtx_pivot_setup(void)
-{
- mtx_pivot_class = class_new(gensym("mtx_pivot"), (t_newmethod)mtx_pivot_new, (t_method)mtx_pivot_free,
- sizeof(t_mtx_pivot), 0, 0, 0);
- class_addmethod(mtx_pivot_class, (t_method)mtx_pivot_matrix, gensym("matrix"), A_GIMME, 0);
-
- class_sethelpsymbol(mtx_pivot_class, gensym("zexy/mtx_transpose"));
-}
-
-
-/* -­------------------------------------------------------------- */
-/* utilities */
-/* mtx_check */
-static t_class *mtx_check_class;
-
-static void mtx_check_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int row=atom_getfloat(argv);
- int col=atom_getfloat(argv+1);
- t_atom *ap;
- int length=row*col, n;
- argc-=2;
-
- if(length>argc) {
- /* sparse matrix */
- adjustsize(x, row, col);
- matrix_set(x, 0);
- argv+=2;
- ap=x->atombuffer+2;
- n=argc;
- while(n--){
- t_float f = atom_getfloat(argv++);
- SETFLOAT(ap, f);
- ap++;
- }
- matrix_bang(x);
- } else {
- SETFLOAT(argv, row);
- SETFLOAT(argv+1, col);
- ap=argv+2;
- n=length;
- while(n--){
- t_float f = atom_getfloat(ap);
- SETFLOAT(ap, f);
- ap++;
- }
- outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), length+2, argv);
- }
-}
-
-static void *mtx_check_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_check_class);
- outlet_new(&x->x_obj, 0);
- x->col=x->row=0;
- x->atombuffer=0;
- return (x);
-}
-static void mtx_check_setup(void)
-{
- mtx_check_class = class_new(gensym("mtx_check"), (t_newmethod)mtx_check_new,
- (t_method)matrix_free, sizeof(t_matrix), 0, A_GIMME, 0);
- class_addbang (mtx_check_class, matrix_bang);
- class_addmethod(mtx_check_class, (t_method)mtx_check_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_check_class, gensym("zexy/matrix"));
-}
-
-/* mtx_size */
-static t_class *mtx_size_class;
-typedef struct _mtx_size
-{
- t_object x_obj;
-
- int row;
- int col;
-
- t_outlet *left, *right;
-} t_mtx_size;
-
-static void mtx_size_matrix(t_mtx_size *x, t_symbol *s, int argc, t_atom *argv)
-{
- if(argc<2)return;
- outlet_float(x->right, atom_getfloat(argv+1));
- outlet_float(x->left, atom_getfloat(argv));
-
-}
-
-static void *mtx_size_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_mtx_size *x = (t_mtx_size *)pd_new(mtx_size_class);
- x->left = outlet_new(&x->x_obj, 0);
- x->right = outlet_new(&x->x_obj, 0);
-
- return (x);
-}
-static void mtx_size_setup(void)
-{
- mtx_size_class = class_new(gensym("mtx_size"), (t_newmethod)mtx_size_new,
- 0, sizeof(t_mtx_size), 0, A_GIMME, 0);
- class_addmethod(mtx_size_class, (t_method)mtx_size_matrix, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_size_class, gensym("zexy/mtx_size"));
-}
-
-/* mtx_print */
-static t_class *mtx_print_class;
-static void mtx_print(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col, row;
- if (argc<2){
- post("mtx_print : crippled matrix");
- return;
- }
- row = atom_getfloat(argv++);
- col = atom_getfloat(argv++);
- if(row*col>argc-2){
- post("mtx_print : sparse matrices not yet supported : use \"mtx_check\"");
- return;
- }
- post("matrix:");
- while(row--){
- postatom(col, argv);
- argv+=col;
- endpost();
- }
- endpost();
-}
-static void *mtx_print_new(void)
-{
- t_matrix *x = (t_matrix *)pd_new(mtx_print_class);
- x->row = x->col = 0;
- x->atombuffer = 0;
- return (x);
-}
-static void mtx_print_setup(void)
-{
- mtx_print_class = class_new(gensym("mtx_print"), (t_newmethod)mtx_print_new,
- 0, sizeof(t_matrix), 0, 0, 0);
- class_addmethod (mtx_print_class, (t_method)mtx_print, gensym("matrix"), A_GIMME, 0);
- class_sethelpsymbol(mtx_print_class, gensym("zexy/matrix"));
-}
-
-
-/* -------------- overall setup routine for this file ----------------- */
-
-void z_matrix_setup(void)
-{
- matrix_setup();
-
- mtx_resize_setup();
- mtx_row_setup();
- mtx_col_setup();
- mtx_element_setup();
-
- mtx_eye_setup();
- mtx_egg_setup();
- mtx_zeros_setup();
- mtx_ones_setup();
- mtx_diag_setup();
- mtx_diegg_setup();
- mtx_trace_setup();
-
- mtx_transpose_setup();
- mtx_scroll_setup();
- mtx_roll_setup();
-
- mtx_mean_setup();
- mtx_rand_setup();
-
- mtx_add_setup();
- mtx_sub_setup();
- mtx_mul_setup();
- mtx_div_setup();
- mtx_inverse_setup();
- mtx_pivot_setup();
-
- mtx_size_setup();
-
- mtx_check_setup();
- mtx_print_setup();
-
- if (0) debugmtx(0,0,0); /* this is to avoid this compiler warning... */
-}
diff --git a/src/z_nop.c b/src/z_nop.c
deleted file mode 100644
index 6fa6ac0..0000000
--- a/src/z_nop.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* ------------------------ nop~ ----------------------------- */
-/* this will pass trough the signal unchanged except for a delay of 1 block */
-
-static t_class *nop_class;
-
-typedef struct _nop
-{
- t_object x_obj;
- t_float *buf;
- int n;
- int toggle;
-} t_nop;
-
-static t_int *nop_perform(t_int *w)
-{
- t_float *in = (t_float *)w[1];
- t_float *out = (t_float *)w[2];
- t_nop *x = (t_nop *)w[3];
- int n = x->n;
- t_float *rp = x->buf + n * x->toggle, *wp = x->buf + n * (x->toggle ^= 1);
-
- while (n--) {
- *wp++ = *in++;
- *out++ = *rp++;
- }
-
- return (w+4);
-}
-
-static void nop_dsp(t_nop *x, t_signal **sp)
-{
- if (x->n != sp[0]->s_n)
- {
- freebytes(x->buf, x->n * 2 * sizeof(t_float));
-
- x->buf = (t_float *)getbytes(sizeof(t_float) * 2 * (x->n = sp[0]->s_n));
- }
- dsp_add(nop_perform, 3, sp[0]->s_vec, sp[1]->s_vec, x);
-}
-
-static void helper(t_nop *x)
-{
- post("%c nop~-object ::\tdo_nothing but delay a signal for 1 block\n"
- "\t\t this might be helpful for synchronising signals", HEARTSYMBOL);
-}
-
-static void nop_free(t_nop *x)
-{
- freebytes(x->buf, x->n * sizeof(t_float));
-}
-
-
-static void *nop_new()
-{
- t_nop *x = (t_nop *)pd_new(nop_class);
- outlet_new(&x->x_obj, gensym("signal"));
- x->toggle = 0;
- x->n = 0;
-
- return (x);
-}
-
-void z_nop_setup(void)
-{
- nop_class = class_new(gensym("nop~"), (t_newmethod)nop_new, (t_method)nop_free,
- sizeof(t_nop), 0, A_DEFFLOAT, 0);
- class_addmethod(nop_class, nullfn, gensym("signal"), 0);
- class_addmethod(nop_class, (t_method)nop_dsp, gensym("dsp"), 0);
-
- class_addmethod(nop_class, (t_method)helper, gensym("help"), 0);
- class_sethelpsymbol(nop_class, gensym("zexy/nop~"));
-}
diff --git a/src/z_pack.c b/src/z_pack.c
deleted file mode 100644
index 6484093..0000000
--- a/src/z_pack.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* 3108:forum::für::umläute:2000 */
-
-/* objects for manipulating packages*/
-
-/*
- repack : (re)pack floats/symbols/pointers to fixed-length packages
- niagara : divides a package into 2 sub-packages
- packel : get a specifique element of a package by its index
-*/
-
-#include "zexy.h"
-#include <string.h>
-#ifdef NT
-#include <memory.h>
-//#error do we need memory.h
-#endif
-
-
-/* -------------------- repack ------------------------------ */
-
-/*
-(re)pack a sequence of (packages of) atoms into a package of given length
-
-"bang" gives out the current package immediately
-the second inlet lets you change the default package size
-*/
-
-static t_class *repack_class;
-
-typedef struct _repack
-{
- t_object x_obj;
- t_atom *buffer;
- int bufsize;
-
- int outputsize;
- int current;
-} t_repack;
-
-
-static void repack_set(t_repack *x, t_float f)
-{
- /* set the new default size */
- int n = f;
-
- if (n > 0) {
-
- /* flush all the newsized packages that are in the buffer */
- t_atom *dumbuf = x->buffer;
- int dumcur = x->current;
-
- while (n <= dumcur) {
- outlet_list(x->x_obj.ob_outlet, gensym("list"), n, dumbuf);
- dumcur -= n;
- dumbuf += n;
- }
-
- if (dumcur < 0) error("this should never happen :: dumcur = %d < 0", dumcur);
- else {
- memcpy(x->buffer, dumbuf, dumcur * sizeof(t_atom));
- x->current = dumcur;
- }
-
- if (n > x->bufsize) {
- dumbuf = (t_atom *)getbytes(n * sizeof(t_atom));
- memcpy(dumbuf, x->buffer, x->current * sizeof(t_atom));
- freebytes(x->buffer, x->bufsize * sizeof(t_atom));
- x->buffer = dumbuf;
- x->bufsize = n;
- }
-
- x->outputsize = n;
- }
-}
-
-static void repack_bang(t_repack *x)
-{
- /* output the list as far as we are now */
- outlet_list(x->x_obj.ob_outlet, gensym("list"), x->current, x->buffer);
- x->current = 0;
-}
-
-static void repack_float(t_repack *x, t_float f)
-{
- /* add a float-atom to the list */
- SETFLOAT(&x->buffer[x->current], f);
- x->current++;
- if (x->current >= x->outputsize) repack_bang(x);
-}
-
-static void repack_symbol(t_repack *x, t_symbol *s)
-{
- /* add a sym-atom to the list */
- SETSYMBOL(&x->buffer[x->current], s);
- x->current++;
- if (x->current >= x->outputsize) repack_bang(x);
-}
-static void repack_pointer(t_repack *x, t_gpointer *p)
-{
- /* add a pointer-atom to the list */
- SETPOINTER(&x->buffer[x->current], p);
- x->current++;
- if (x->current >= x->outputsize) repack_bang(x);
-}
-static void repack_list(t_repack *x, t_symbol *s, int argc, t_atom *argv)
-{
- int remain = x->outputsize - x->current;
- t_atom *ap = argv;
-
- if (argc >= remain) {
- memcpy(x->buffer+x->current, ap, remain * sizeof(t_atom));
- ap += remain;
- argc -= remain;
- outlet_list(x->x_obj.ob_outlet, gensym("list"), x->outputsize, x->buffer);
- x->current = 0;
- }
-
- while (argc >= x->outputsize) {
- outlet_list(x->x_obj.ob_outlet, gensym("list"), x->outputsize, ap);
- ap += x->outputsize;
- argc -= x->outputsize;
- }
-
- memcpy(x->buffer + x->current, ap, argc * sizeof(t_atom));
- x->current += argc;
-}
-static void repack_anything(t_repack *x, t_symbol *s, int argc, t_atom *argv)
-{
- SETSYMBOL(&x->buffer[x->current], s);
- x->current++;
-
- if (x->current >= x->outputsize) {
- repack_bang(x);
- }
- repack_list(x, gensym("list"), argc, argv);
-}
-
-static void *repack_new(t_floatarg f)
-{
- t_repack *x = (t_repack *)pd_new(repack_class);
-
-
-
- x->outputsize = x->bufsize = (f>0.f)?f:2 ;
- x->current = 0;
-
-
- x->buffer = (t_atom *)getbytes(x->bufsize * sizeof(t_atom));
-
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym(""));
- outlet_new(&x->x_obj, 0);
-
- return (x);
-}
-
-static void repack_setup(void)
-{
- repack_class = class_new(gensym("repack"), (t_newmethod)repack_new,
- 0, sizeof(t_repack), 0, A_DEFFLOAT, 0);
-
- class_addbang (repack_class, repack_bang);
- class_addfloat (repack_class, repack_float);
- class_addsymbol (repack_class, repack_symbol);
- class_addpointer (repack_class, repack_pointer);
- class_addlist (repack_class, repack_list);
- class_addanything(repack_class, repack_anything);
- class_addmethod (repack_class, (t_method)repack_set, gensym(""), A_DEFFLOAT, 0);
-
- class_sethelpsymbol(repack_class, gensym("zexy/repack"));
-}
-
-/* ------------------------- niagara ------------------------------- */
-
-/*
-divides a package into 2 sub-packages at a specified point
-like the niagara-falls, some water goes down to the left side, the rest to the right side, devided by the rock
-*/
-
-static t_class *niagara_class;
-
-typedef struct _niagara
-{
- t_object x_obj;
- t_float rock;
- t_outlet *left, *right;
-} t_niagara;
-
-static void niagara_list(t_niagara *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n_l, n_r;
- t_atom *ap_l, *ap_r;
- int dumrock = x->rock;
- int rock = ((dumrock < 0.f)?(argc+dumrock):dumrock);
-
- n_l = (rock < argc)?rock:argc;
- ap_l = argv;
-
- n_r = argc - n_l;
- ap_r = &argv[n_l];
-
- if (n_r) outlet_list(x->right, s, n_r, ap_r);
- if (n_l) outlet_list(x->left, s, n_l, ap_l);
-}
-
-static void niagara_any(t_niagara *x, t_symbol *s, int argc, t_atom *argv)
-{
- int n_l, n_r;
- t_atom *ap_l, *ap_r;
- t_symbol *s_r, *s_l;
- int dumrock = x->rock;
- int rock = ((dumrock < 0.f)?(argc+dumrock):dumrock-1);
-
- n_l = (rock < argc)?rock:argc;
- ap_l = argv;
- s_l = s;
-
- n_r = argc - n_l;
- ap_r = &argv[n_l];
-
- if (n_r) {
- s_r = 0;
- if (ap_r->a_type == A_FLOAT) s_r = gensym("list");
- else {
- s_r = atom_getsymbol(ap_r);
- ap_r++;
- n_r--;
- }
- outlet_anything(x->right, s_r, n_r, ap_r);
- }
-
- if (n_l+1 ) outlet_anything(x->left, s_l, n_l, ap_l);
-}
-
-static void *niagara_new(t_floatarg f)
-{
- t_niagara *x = (t_niagara *)pd_new(niagara_class);
-
- x->rock = f;
-
- x->left = outlet_new(&x->x_obj, &s_list);
- x->right = outlet_new(&x->x_obj, &s_list);
-
- floatinlet_new(&x->x_obj, &x->rock);
-
- return (x);
-}
-
-static void niagara_setup(void)
-{
- niagara_class = class_new(gensym("niagara"), (t_newmethod)niagara_new,
- 0, sizeof(t_niagara), 0, A_DEFFLOAT, 0);
-
- class_addlist (niagara_class, niagara_list);
- class_addanything(niagara_class, niagara_any);
-
- class_sethelpsymbol(niagara_class, gensym("zexy/niagara"));
-}
-
-/* ------------------------- packel ------------------------------- */
-
-/*
-get the nth element of a package
-*/
-
-static t_class *packel_class;
-
-typedef struct _packel
-{
- t_object x_obj;
- t_float position;
-} t_packel;
-
-static void packel_list(t_packel *x, t_symbol *s, int argc, t_atom *argv)
-{
- int mypos = x->position;
-
- if (mypos) {
- t_atom *current;
- int pos = (mypos < 0)?(argc+mypos):(mypos-1);
-
- if(argc==0){
- if (pos==0||pos==-1)outlet_bang(x->x_obj.ob_outlet);
- return;
- }
-
- if (pos < 0 || pos >= argc)return;
-
- current = &(argv[pos]);
-
- switch (current->a_type) {
- case A_FLOAT:
- outlet_float(x->x_obj.ob_outlet, atom_getfloat(current));
- break;
- case A_SYMBOL:
- outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(current));
- break;
- case A_POINTER:
- outlet_pointer(x->x_obj.ob_outlet, current->a_w.w_gpointer);
- break;
- case A_NULL:
- outlet_bang(x->x_obj.ob_outlet);
- default:
- ;
- }
- } else outlet_list(x->x_obj.ob_outlet, s, argc, argv);
-}
-
-static void packel_anything(t_packel *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_atom *av2 = (t_atom *)getbytes((argc + 1) * sizeof(t_atom));
- int i;
-
- for (i = 0; i < argc; i++)
- av2[i + 1] = argv[i];
- SETSYMBOL(av2, s);
- packel_list(x, gensym("list"), argc+1, av2);
- freebytes(av2, (argc + 1) * sizeof(t_atom));
-}
-
-static void *packel_new(t_floatarg f)
-{
- t_packel *x = (t_packel *)pd_new(packel_class);
- outlet_new(&x->x_obj, 0);
- floatinlet_new(&x->x_obj, &x->position);
- x->position = (int) f;
-
- return (x);
-}
-
-static void packel_setup(void)
-{
- packel_class = class_new(gensym("packel"), (t_newmethod)packel_new,
- 0, sizeof(t_packel), 0, A_DEFFLOAT, 0);
-
- class_addlist (packel_class, packel_list);
- class_addanything(packel_class, packel_anything);
-
- class_sethelpsymbol(packel_class, gensym("zexy/packel"));
-}
-
-/* -------------- overall setup routine for this file ----------------- */
-
-void z_pack_setup(void)
-{
- repack_setup();
- niagara_setup();
- packel_setup();
-
- /* I don't supply HELP - functionality, since this might harm overall-performance ere */
-}
diff --git a/src/z_sigbin.c b/src/z_sigbin.c
index b1023e7..dc4932e 100644
--- a/src/z_sigbin.c
+++ b/src/z_sigbin.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
finally :: some of the missing binops for signals :: abs~, sgn~, >~, <~, ==~, &&~, ||~
@@ -9,8 +25,6 @@
#ifdef NT
#define fabsf fabs
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
#endif
typedef struct _misc
@@ -798,4 +812,5 @@ void z_sigbin_setup(void)
sigEQUAL_setup();
sigOR_setup();
sigAND_setup();
+ zexy_register("sigbin");
}
diff --git a/src/z_sigmatrix.c b/src/z_sigmatrix.c
deleted file mode 100644
index f801950..0000000
--- a/src/z_sigmatrix.c
+++ /dev/null
@@ -1,506 +0,0 @@
-#include "zexy.h"
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* the sigmatrix objects ::
- matrix~ : multiply a n-vector of in~ with a matrix to get a m-vector of out~
- line~ between the 2 matrices, to make it useable as a mixer
- multiplex~ : multiplex 1-of-n in~ to 1 out~
- demultiplex~ : demultiplex 1 in~ to 1-of-n out~
-
- to do :
- patchbay~ : array of mux~ and demux~
-
-*/
-
-
-/* --------------------------- matrix~ ----------------------------------
- *
- * multiply a n-vector of signals with a (n*m) matrix, to get m output-streams.
- * make the (n*m)-matrix of scalars to be liny~
- *
- * 1703:forum::für::umläute:2001
- */
-
-static t_class *sigmtx_class;
-
-typedef struct _sigmtx {
- t_object x_obj;
-
- t_float time;
- int ticksleft;
- int retarget;
- t_float msec2tick;
-
- t_float **value;
- t_float **target;
- t_float **increment; /* single precision is really a bad, especially when doing long line~s.
- * but the biginc (like in msp's line~ (d_ctl.c) is far too expensive... */
- t_float **sigIN;
- t_float **sigOUT;
- t_float *sigBUF;
-
- int n_sigIN; /* columns */
- int n_sigOUT; /* rows */
-} t_sigmtx;
-
-/* the message thing */
-
-static void sigmtx_matrix(t_sigmtx *x, t_symbol *s, int argc, t_atom *argv)
-{
- int col, row, c=0, r=0;
-
- if (argc<2){
- post("matrix~ : bad matrix !");
- return;
- }
-
- row = atom_getfloat(argv++);
- col = atom_getfloat(argv++);
- argc-=2;
-
- if((col!=x->n_sigOUT)||(row!=x->n_sigIN)){
- post("matrix~ : matrix dimensions do not match !!");
- return;
- }
- if(argc<row*col){
- post("matrix~ : reduced matrices not yet supported");
- return;
- }
-
- if (x->time<=0) {
- for(r=0; r<row; r++)
- for(c=0; c<col; c++)
- x->target[c][r]=x->value[c][r]=atom_getfloat(argv++);
- x->time=x->ticksleft=x->retarget=0;
- } else {
- for(r=0; r<row; r++)
- for(c=0; c<col; c++)
- x->target[c][r]=atom_getfloat(argv++);
- x->retarget=1;
- }
-}
-
-static void sigmtx_stop(t_sigmtx *x)
-{
- int c = x->n_sigOUT, r;
- t_float *tgt, *val;
- while(c--){
- tgt=x->target[c];
- val=x->value [c];
- r=x->n_sigIN;
- while(r--)*tgt++=*val++;
- }
- x->ticksleft = x->retarget = 0;
-}
-
-
-/* the dsp thing */
-
-static t_int *sigmtx_perform(t_int *w)
-{
- t_sigmtx *x = (t_sigmtx *)(w[1]);
- int n = (int)(w[2]);
-
- int r, c;
-
- t_float **out = x->sigOUT;
- t_float **in = x->sigIN;
-
- t_float *buf = x->sigBUF, *sigBUF = buf;
-
- t_float **value = x->value;
- t_float **target = x->target;
- t_float **increment = x->increment;
-
- t_float *inc, *val, *tgt;
-
- int n_IN=x->n_sigIN, n_OUT=x->n_sigOUT;
-
- if (x->retarget) {
- int nticks = x->time * x->msec2tick;
- t_float oneovernos;
-
- if (!nticks) nticks = 1;
- oneovernos = 1./(nticks*n);
- x->ticksleft = nticks;
-
- c = n_OUT;
- while(c--) {
- inc=increment[c];
- val=value[c];
- tgt=target[c];
- r=n_IN;
- while(r--)*inc++=(*tgt++-*val++)*oneovernos;
- }
-
- x->retarget = 0;
- }
-
- if (x->ticksleft) {
- int N=n-1;
- n=-1;
- // while (n--) {
- while(n++<N){
- c = n_OUT;
- while(c--) {
- t_float sum = 0;
- val = value[c]+n_IN-1;
- inc = increment[c]+n_IN-1;
- r=n_IN;
-
- while(r--)sum+=in[r][n]*(*val--+=*inc--);
-
- sigBUF[c]=sum;
- }
- buf = sigBUF;
- c = n_OUT;
- while(c--)out[c][n]=*buf++;
- }
- if (!--x->ticksleft) {
- c = n_OUT;
- while(c--){
- val=value[c];
- tgt=target[c];
- r=n_IN;
- while(r--)*val++=*tgt++;
- }
- }
- } else { /* no ticks left */
- while (n--) {
- c = n_OUT;
- while(c--) {
- t_float sum = 0;
- val = value[c]+n_IN-1;
- r = n_IN;
- while(r--)sum+=in[r][n]**val--;
- sigBUF[c]=sum;
- }
- buf = sigBUF;
- c = n_OUT;
- while(c--)out[c][n]=*buf++;
- }
- }
- return (w+3);
-}
-
-static void sigmtx_dsp(t_sigmtx *x, t_signal **sp)
-{
- int o = x->n_sigOUT, i=x->n_sigIN, n=0;
- t_float **dummy = x->sigIN;
-
- while(i--)*dummy++=sp[n++]->s_vec;
-
- dummy =x->sigOUT;
- while(o--)dummy[o]=sp[n++]->s_vec;
-
- x->msec2tick = sp[0]->s_sr / (1000.f * sp[0]->s_n);
- dsp_add(sigmtx_perform, 2, x, sp[0]->s_n);
-}
-
-
-/* setup/setdown things */
-
-static void sigmtx_free(t_sigmtx *x)
-{
- int i = x->n_sigOUT;
- while(i--) {
- freebytes(x->value [i], x->n_sigOUT * sizeof(t_float *));
- freebytes(x->target [i], x->n_sigOUT * sizeof(t_float *));
- freebytes(x->increment[i], x->n_sigOUT * sizeof(t_float *));
- }
-
- freebytes(x->value, sizeof(x->value));
- freebytes(x->target, sizeof(x->target));
- freebytes(x->increment, sizeof(x->increment));
-
- freebytes(x->sigIN, x->n_sigIN * sizeof(t_float *));
- freebytes(x->sigOUT, x->n_sigOUT * sizeof(t_float *));
- freebytes(x->sigBUF, x->n_sigOUT * sizeof(t_float ));
-}
-
-static void *sigmtx_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_sigmtx *x = (t_sigmtx *)pd_new(sigmtx_class);
- int i;
-
- x->time = 0;
-
- switch (argc) {
- case 0:
- x->n_sigIN = x->n_sigOUT = 1;
- break;
- case 1:
- x->n_sigIN = x->n_sigOUT = atom_getfloat(argv);
- break;
- default:
- x->time= atom_getfloat(argv+2);
- case 2:
- x->n_sigIN = atom_getfloat(argv);
- x->n_sigOUT = atom_getfloat(argv+1);
- break;
- }
-
- if (x->time<0) x->time=0;
- if (x->n_sigIN <1) x->n_sigIN =1;
- if (x->n_sigOUT<1) x->n_sigOUT=1;
-
- /* the inlets */
- i=x->n_sigIN-1;
- while(i--)inlet_new(&x->x_obj,&x->x_obj.ob_pd,&s_signal,&s_signal);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym(""));
- floatinlet_new(&x->x_obj, &x->time);
-
- /* the outlets */
- i=x->n_sigOUT;
- while(i--)outlet_new(&x->x_obj,&s_signal);
-
- /* make all the buffers */
- x->sigIN = (t_float **)getbytes(x->n_sigIN * sizeof(t_float *));
- x->sigOUT = (t_float **)getbytes(x->n_sigOUT * sizeof(t_float *));
- x->sigBUF = (t_float *)getbytes(x->n_sigOUT * sizeof(t_float ));
-
- x->value = (t_float **)getbytes(x->n_sigOUT * sizeof(t_float));
- x->target = (t_float **)getbytes(x->n_sigOUT * sizeof(t_float));
- x->increment = (t_float **)getbytes(x->n_sigOUT * sizeof(t_float));
-
- i = x->n_sigOUT;
- while(i--){
- int j = x->n_sigIN;
- x->sigOUT [i] = 0;
- x->value [i] = (t_float *)getbytes(x->n_sigIN * sizeof(t_float));
- x->target [i] = (t_float *)getbytes(x->n_sigIN * sizeof(t_float));
- x->increment[i] = (t_float *)getbytes(x->n_sigIN * sizeof(t_float));
-
- while(j--)x->value[i][j]=x->target[i][j]=x->increment[i][j]=0;
- }
-
- i = x->n_sigIN;
- while(i--)x->sigIN[i] = 0;
-
- x->msec2tick = x->ticksleft = x->retarget = 0;
- return (x);
-}
-
-static void sigmtx_setup(void)
-{
- sigmtx_class = class_new(gensym("matrix~"), (t_newmethod)sigmtx_new, (t_method)sigmtx_free,
- sizeof(t_sigmtx), 0, A_GIMME, 0);
-
- class_addmethod(sigmtx_class, (t_method)sigmtx_dsp, gensym("dsp"), 0);
- class_addmethod(sigmtx_class, nullfn, gensym("signal"), 0);
-
- class_addmethod(sigmtx_class, (t_method)sigmtx_matrix, gensym(""), A_GIMME, 0);
- class_addmethod(sigmtx_class, (t_method)sigmtx_stop, gensym("stop"), 0);
-
- class_sethelpsymbol(sigmtx_class, gensym("zexy/matrix~"));
-}
-
-/* ------------------------------------------------------------------------------ */
-
-/* demux~ : demultiplex a signal to a specified output */
-
-static t_class *demux_class;
-
-typedef struct _demux {
- t_object x_obj;
-
- int output;
-
- int n_out;
- t_float **out;
-
-} t_demux;
-
-static void demux_output(t_demux *x, t_floatarg f)
-{
- if ((f>=0)&&(f<x->n_out)){
- x->output=f;
- } else
- error("demultiplex: %d is channel out of range (0..%d)", (int)f, x->n_out);
-}
-
-
-static t_int *demux_perform(t_int *w)
-{
- t_demux *x = (t_demux *)(w[1]);
- t_float *in = (t_float *)(w[2]);
- int N = (int)(w[3]);
- int n = N;
-
-
- int channel=x->n_out;
-
-
- while(channel--){
- t_float*out=x->out[channel];
- n=N;
- if(x->output==channel){
- while(n--)*out++=*in++;
- } else
- while(n--)*out++=0.f;
- }
- return (w+4);
-}
-
-static void demux_dsp(t_demux *x, t_signal **sp)
-{
- int n = x->n_out;
- t_float **dummy=x->out;
- while(n--)*dummy++=sp[x->n_out-n]->s_vec;
- dsp_add(demux_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
-}
-
-
-static void demux_helper(void)
-{
- post("\n%c demux~\t:: demultiplex a signal to one of various outlets", HEARTSYMBOL);
- post("<#out>\t : the outlet-number (counting from 0) to witch the inlet is routed"
- "'help'\t : view this");
- post("creation : \"demux~ [arg1 [arg2...]]\"\t: the number of arguments equals the number of outlets\n");
-}
-
-static void demux_free(t_demux *x)
-{
- freebytes(x->out, x->n_out * sizeof(t_float *));
-}
-
-static void *demux_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_demux *x = (t_demux *)pd_new(demux_class);
- int i;
-
- if (!argc)argc=2;
- x->n_out=argc;
- x->output=0;
-
- while(argc--)outlet_new(&x->x_obj, gensym("signal"));
-
- x->out = (t_float **)getbytes(x->n_out * sizeof(t_float *));
- i=x->n_out;
- while(i--)x->out[i]=0;
-
- return (x);
-}
-
-void demux_setup(void)
-{
- demux_class = class_new(gensym("demultiplex~"), (t_newmethod)demux_new, (t_method)demux_free, sizeof(t_demux), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)demux_new, gensym("demux~"), A_GIMME, 0);
-
- class_addfloat(demux_class, demux_output);
- class_addmethod(demux_class, (t_method)demux_dsp, gensym("dsp"), 0);
- class_addmethod(demux_class, nullfn, gensym("signal"), 0);
-
- class_addmethod(demux_class, (t_method)demux_helper, gensym("help"), 0);
- class_sethelpsymbol(demux_class, gensym("zexy/demultiplex~"));
-}
-
-
-/* ------------------------------------------------------------------------------ */
-
-/* mux~ : multiplex a specified signal to the output */
-
-static t_class *mux_class;
-
-typedef struct _mux {
- t_object x_obj;
-
- int input;
-
- int n_in;
- t_float **in;
-} t_mux;
-
-static void mux_input(t_mux *x, t_floatarg f)
-{
- if ((f>=0)&&(f<x->n_in)){
- x->input=f;
- } else
- error("multiplex: %d is channel out of range (0..%d)", (int)f, x->n_in);
-
-}
-
-static t_int *mux_perform(t_int *w)
-{
- t_mux *x = (t_mux *)(w[1]);
- t_float *out = (t_float *)(w[2]);
- int n = (int)(w[3]);
-
- t_float *in = x->in[x->input];
-
- while(n--)*out++=*in++;
-
- return (w+4);
-}
-
-static void mux_dsp(t_mux *x, t_signal **sp)
-{
- int n = 0;
- t_float **dummy=x->in;
-
- for(n=0;n<x->n_in;n++)*dummy++=sp[n]->s_vec;
-
- dsp_add(mux_perform, 3, x, sp[n]->s_vec, sp[0]->s_n);
-}
-
-static void mux_helper(void)
-{
- post("\n%c mux~\t:: multiplex a one of various signals to one outlet", HEARTSYMBOL);
- post("<#out>\t : the inlet-number (counting from 0) witch is routed to the outlet"
- "'help'\t : view this");
- post("creation : \"mux~ [arg1 [arg2...]]\"\t: the number of arguments equals the number of inlets\n");
-}
-
-static void mux_free(t_mux *x)
-{
- freebytes(x->in, x->n_in * sizeof(t_float *));
-}
-
-static void *mux_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_mux *x = (t_mux *)pd_new(mux_class);
- int i;
-
- if (!argc)argc=2;
- x->n_in=argc;
- x->input=0;
-
- argc--;
- while(argc--)inlet_new(&x->x_obj,&x->x_obj.ob_pd,&s_signal,&s_signal);
-
- x->in = (t_float **)getbytes(x->n_in * sizeof(t_float *));
- i=x->n_in;
- while(i--)x->in[i]=0;
-
- outlet_new(&x->x_obj, gensym("signal"));
-
- return (x);
-}
-
-void mux_setup(void)
-{
- mux_class = class_new(gensym("multiplex~"), (t_newmethod)mux_new, (t_method)mux_free, sizeof(t_mux), 0, A_GIMME, 0);
- class_addcreator((t_newmethod)mux_new, gensym("mux~"), A_GIMME, 0);
-
- class_addfloat(mux_class, mux_input);
- class_addmethod(mux_class, (t_method)mux_dsp, gensym("dsp"), 0);
- class_addmethod(mux_class, nullfn, gensym("signal"), 0);
-
- class_addmethod(mux_class, (t_method)mux_helper, gensym("help"), 0);
- class_sethelpsymbol(mux_class, gensym("zexy/multiplex~"));
-}
-
-/* ----------------------------------------------------------------------
- * main setup
- * ---------------------------------------------------------------------- */
-
-void z_sigmatrix_setup(void)
-{
- sigmtx_setup();
- demux_setup();
- mux_setup();
-}
diff --git a/src/z_skeleton.c b/src/z_skeleton.c
deleted file mode 100644
index e13c385..0000000
--- a/src/z_skeleton.c
+++ /dev/null
@@ -1,57 +0,0 @@
-
-/* 1008:forum::für::umläute:2001 */
-
-/*
- skeleton : skeleton-code for message-objects
-*/
-
-#include "zexy.h"
-
-/* ------------------------- skeleton ------------------------------- */
-
-/*
-MESSAGE SKELETON: simple and easy
-*/
-
-static t_class *skeleton_class;
-
-typedef struct _skeleton
-{
- t_object x_obj;
-
-} t_skeleton;
-
-
-static void skeleton_float(t_skeleton *x, t_float f)
-{
-
-}
-
-static void skeleton_list(t_skeleton *x, t_symbol *s, int argc, t_atom *argv)
-{
-
-}
-
-static void skeleton_foo(t_skeleton *x, t_float f)
-{
-
-}
-
-static void *skeleton_new(t_floatarg f)
-{
- t_skeleton *x = (t_skeleton *)pd_new(skeleton_class);
-
- return (x);
-}
-
-void z_skeleton_setup(void)
-{
- skeleton_class = class_new(gensym("skeleton"), (t_newmethod)skeleton_new,
- 0, sizeof(t_skeleton), 0, A_DEFFLOAT, 0);
-
- class_addlist (skeleton_class, skeleton_list);
- class_addfloat (skeleton_class, skeleton_float);
- class_addmethod(skeleton_class, (t_method)skeleton_foo, gensym("foo"), A_DEFFLOAT, 0);
-
- class_sethelpsymbol(skeleton_class, gensym("zexy/skeleton"));
-}
diff --git a/src/z_skeleton_tilde.c b/src/z_skeleton_tilde.c
deleted file mode 100644
index 4587afd..0000000
--- a/src/z_skeleton_tilde.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <stdio.h>
-
-#include "zexy.h"
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* skeleton~ : skeleton-code for a signal-object */
-
-/* ------------------------ skeleton~ ----------------------------- */
-
-static t_class *skeleton_class;
-
-typedef struct _skeleton
-{
- t_object x_obj;
-
-} t_skeleton;
-
-
-static t_int *skeleton_perform(t_int *w)
-{
- t_float *in = (t_float *)(w[1]);
- t_float *out = (t_float *)(w[2]);
- int n = (int)(w[3]);
- t_skeleton *x = (t_skeleton *) w[4];
-
- while (n--) {
- *in++=*out++;
- }
-
- return (w+5);
-}
-
-static void skeleton_dsp(t_skeleton *x, t_signal **sp)
-{
- dsp_add(skeleton_perform, 4, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n,x);
-}
-
-
-
-static void *skeleton_new()
-{
- t_skeleton *x = (t_skeleton *)pd_new(skeleton_class);
- outlet_new(&x->x_obj, gensym("signal"));
-
- return (x);
-}
-
-void z_skeleton_tilde_setup(void)
-{
- skeleton_class = class_new(gensym("skeleton~"), (t_newmethod)skeleton_new, 0,
- sizeof(t_skeleton), 0, A_DEFFLOAT, 0);
- class_addmethod(skeleton_class, nullfn, gensym("signal"), 0);
- class_addmethod(skeleton_class, (t_method)skeleton_dsp, gensym("dsp"), 0);
-
- class_sethelpsymbol(skeleton_class, gensym("zexy/skeleton~"));
-}
-
diff --git a/src/z_stat.c b/src/z_stat.c
deleted file mode 100644
index d667a5a..0000000
--- a/src/z_stat.c
+++ /dev/null
@@ -1,168 +0,0 @@
-#include "zexy.h"
-#include <math.h>
-
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#define sqrtf sqrt
-#endif
-
-#ifdef MACOSX
-#define sqrtf sqrt
-#endif
-
-/* mean :: the mean of a list of floats */
-
-static t_class *mean_class;
-
-typedef struct _mean
-{
- t_object x_obj;
-} t_mean;
-
-static void mean_list(t_mean *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_float factor = 1./argc;
- t_float sum = 0;
-
- while(argc--)sum+=atom_getfloat(argv++);
-
- outlet_float(x->x_obj.ob_outlet,sum*factor);
-}
-
-static void *mean_new(void)
-{
- t_mean *x = (t_mean *)pd_new(mean_class);
-
- outlet_new(&x->x_obj, gensym("float"));
-
- return (x);
-}
-
-static void mean_help(void)
-{
- post("mean\t:: calculate the mean of a list of floats");
-}
-
-static void mean_setup(void)
-{
- mean_class = class_new(gensym("mean"), (t_newmethod)mean_new, 0,
- sizeof(t_mean), 0, A_DEFFLOAT, 0);
-
- class_addlist(mean_class, (t_method)mean_list);
- class_addmethod(mean_class, (t_method)mean_help, gensym("help"), 0);
-
- class_sethelpsymbol(mean_class, gensym("zexy/mean"));
-}
-
-/* minmax :: get minimum and maximum of a list */
-
-static t_class *minmax_class;
-
-typedef struct _minmax
-{
- t_object x_obj;
- t_float min;
- t_float max;
-
- t_outlet *mino, *maxo;
-} t_minmax;
-
-static void minmax_bang(t_minmax *x)
-{
- outlet_float(x->maxo,x->max);
- outlet_float(x->mino,x->min);
-}
-
-static void minmax_list(t_minmax *x, t_symbol *s, int argc, t_atom *argv)
-{
- t_float min = atom_getfloat(argv++);
- t_float max=min;
- argc--;
-
- while(argc--){
- t_float f = atom_getfloat(argv++);
- if (f<min)min=f;
- else if (f>max)max=f;
- }
-
- x->min=min;
- x->max=max;
-
- minmax_bang(x);
-}
-
-static void *minmax_new(void)
-{
- t_minmax *x = (t_minmax *)pd_new(minmax_class);
-
- x->mino=outlet_new(&x->x_obj, gensym("float"));
- x->maxo=outlet_new(&x->x_obj, gensym("float"));
-
- x->min = x->max = 0;
-
- return (x);
-}
-
-static void minmax_help(void)
-{
- post("minmax\t:: get minimum and maximum of a list of floats");
-}
-
-static void minmax_setup(void)
-{
- minmax_class = class_new(gensym("minmax"), (t_newmethod)minmax_new, 0,
- sizeof(t_minmax), 0, A_DEFFLOAT, 0);
-
- class_addlist(minmax_class, (t_method)minmax_list);
- class_addbang(minmax_class, (t_method)minmax_bang);
- class_addmethod(minmax_class, (t_method)minmax_help, gensym("help"), 0);
-
- class_sethelpsymbol(minmax_class, gensym("zexy/minmax"));
-}
-
-/* length :: get minimum and maximum of a list */
-
-static t_class *length_class;
-
-typedef struct _length
-{
- t_object x_obj;
-} t_length;
-
-static void length_list(t_length *x, t_symbol *s, int argc, t_atom *argv)
-{
- outlet_float(x->x_obj.ob_outlet, (t_float)argc);
-}
-static void length_any(t_length *x, t_symbol *s, int argc, t_atom *argv)
-{
- outlet_float(x->x_obj.ob_outlet, (t_float)argc+1);
-}
-
-static void *length_new(void)
-{
- t_length *x = (t_length *)pd_new(length_class);
- outlet_new(&x->x_obj, gensym("float"));
- return (x);
-}
-
-static void length_setup(void)
-{
- length_class = class_new(gensym("length"), (t_newmethod)length_new, 0,
- sizeof(t_length), 0, A_DEFFLOAT, 0);
-
- class_addlist(length_class, (t_method)length_list);
- class_addanything(length_class, (t_method)length_any);
- // class_addbang(length_class, (t_method)length_bang);
-
- class_sethelpsymbol(length_class, gensym("zexy/length"));
-}
-
-/* global setup routine */
-
-void z_stat_setup(void)
-{
- mean_setup();
- minmax_setup();
- length_setup();
-}
diff --git a/src/z_strings.c b/src/z_strings.c
deleted file mode 100644
index 7ec8d40..0000000
--- a/src/z_strings.c
+++ /dev/null
@@ -1,433 +0,0 @@
-#include "zexy.h"
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef NT
-# pragma warning( disable : 4244 )
-# pragma warning( disable : 4305 )
-# define sqrtf sqrt
-# define STATIC_INLINE
-#else
-# define STATIC_INLINE static
-#endif
-
-/*
- * atoi : ascii to integer
- * strcmp : compare 2 lists as if they were strings
- * list2symbol: convert a list into a single symbol
- * symbol2list: vice versa
-*/
-
-/* atoi :: ascii to integer */
-
-static t_class *atoi_class;
-
-typedef struct _atoi
-{
- t_object x_obj;
- int i;
-} t_atoi;
-static void atoi_bang(t_atoi *x)
-{
- outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
-}
-static void atoi_float(t_atoi *x, t_floatarg f)
-{
- x->i = f;
- outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
-}
-static void atoi_symbol(t_atoi *x, t_symbol *s)
-{
- int base=10;
- const char* c = s->s_name;
- if(c[0]=='0'){
- base=8;
- if (c[1]=='x')base=16;
- }
- x->i=strtol(c, 0, base);
- outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
-}
-static void atoi_list(t_atoi *x, t_symbol *s, int argc, t_atom *argv)
-{
- int base=10;
- const char* c;
-
- if (argv->a_type==A_FLOAT){
- x->i=atom_getfloat(argv);
- outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
- return;
- }
-
- if (argc>1){
- base=atom_getfloat(argv+1);
- if (base<2) {
- error("atoi: setting base to 10");
- base=10;
- }
- }
- c=atom_getsymbol(argv)->s_name;
- x->i=strtol(c, 0, base);
- outlet_float(x->x_obj.ob_outlet, (t_float)x->i);
-}
-
-static void *atoi_new(void)
-{
- t_atoi *x = (t_atoi *)pd_new(atoi_class);
- outlet_new(&x->x_obj, gensym("float"));
- return (x);
-}
-
-static void atoi_setup(void)
-{
- atoi_class = class_new(gensym("atoi"), (t_newmethod)atoi_new, 0,
- sizeof(t_atoi), 0, A_DEFFLOAT, 0);
-
- class_addbang(atoi_class, (t_method)atoi_bang);
- class_addfloat(atoi_class, (t_method)atoi_float);
- class_addlist(atoi_class, (t_method)atoi_list);
- class_addsymbol(atoi_class, (t_method)atoi_symbol);
- class_addanything(atoi_class, (t_method)atoi_symbol);
-
- class_sethelpsymbol(atoi_class, gensym("zexy/atoi"));
-}
-
-/* ------------------------- strcmp ------------------------------- */
-
-/* compare 2 lists ( == for lists) */
-
-static t_class *strcmp_class;
-
-typedef struct _strcmp
-{
- t_object x_obj;
-
- t_binbuf *bbuf1, *bbuf2;
-} t_strcmp;
-
-static void strcmp_bang(t_strcmp *x)
-{
- char *str1=0, *str2=0;
- int n1=0, n2=0;
- int result = 0;
-
- binbuf_gettext(x->bbuf1, &str1, &n1);
- binbuf_gettext(x->bbuf2, &str2, &n2);
-
- result = strcmp(str1, str2);
-
- freebytes(str1, n1);
- freebytes(str2, n2);
-
- outlet_float(x->x_obj.ob_outlet, result);
-}
-
-static void strcmp_secondlist(t_strcmp *x, t_symbol *s, int argc, t_atom *argv)
-{
- binbuf_clear(x->bbuf2);
- binbuf_add(x->bbuf2, argc, argv);
-}
-
-static void strcmp_list(t_strcmp *x, t_symbol *s, int argc, t_atom *argv)
-{
- binbuf_clear(x->bbuf1);
- binbuf_add(x->bbuf1, argc, argv);
-
- strcmp_bang(x);
-}
-
-static void *strcmp_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_strcmp *x = (t_strcmp *)pd_new(strcmp_class);
-
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2"));
-
- x->bbuf1 = binbuf_new();
- x->bbuf2 = binbuf_new();
-
-
- strcmp_secondlist(x, gensym("list"), argc, argv);
-
- return (x);
-}
-
-static void strcmp_free(t_strcmp *x)
-{
- binbuf_free(x->bbuf1);
- binbuf_free(x->bbuf2);
-}
-
-
-static void strcmp_setup(void)
-{
- strcmp_class = class_new(gensym("strcmp"), (t_newmethod)strcmp_new,
- (t_method)strcmp_free, sizeof(t_strcmp), 0, A_GIMME, 0);
-
- class_addbang (strcmp_class, strcmp_bang);
- class_addlist (strcmp_class, strcmp_list);
- class_addmethod (strcmp_class, (t_method)strcmp_secondlist, gensym("lst2"), A_GIMME, 0);
-
- class_sethelpsymbol(strcmp_class, gensym("zexy/strcmp"));
-}
-
-/* ------------------------- list2symbol ------------------------------- */
-
-static t_class *list2symbol_class;
-
-typedef struct _list2symbol
-{
- t_object x_obj;
- int ac;
- t_atom *ap;
- t_symbol *s,*connector;
-} t_list2symbol;
-
-static void list2symbol_connector(t_list2symbol *x, t_symbol *s){
- x->connector = s;
-}
-
-static void list2symbol_bang(t_list2symbol *x)
-{
- t_atom *argv=x->ap;
- int argc=x->ac;
- char *result = 0;
- int length = 0, len=0;
- int i= argc;
- char *connector=0;
- char connlen=0;
- if(x->connector)connector=x->connector->s_name;
- if(connector)connlen=strlen(connector);
-
- /* 1st get the length of the symbol */
- if(x->s)length+=strlen(x->s->s_name);
- else length-=connlen;
-
- length+=i*connlen;
-
- while(i--){
- char buffer[MAXPDSTRING];
- atom_string(argv++, buffer, MAXPDSTRING);
- length+=strlen(buffer);
- }
-
- if (length<0){
- outlet_symbol(x->x_obj.ob_outlet, gensym(""));
- return;
- }
-
- result = (char*)getbytes((length+1)*sizeof(char));
-
- /* 2nd create the symbol */
- if (x->s){
- char *buf = x->s->s_name;
- strcpy(result+len, buf);
- len+=strlen(buf);
- if(i && connector){
- strcpy(result+len, connector);
- len += connlen;
- }
- }
- i=argc;
- argv=x->ap;
- while(i--){
- char buffer[MAXPDSTRING];
- atom_string(argv++, buffer, MAXPDSTRING);
- strcpy(result+len, buffer);
- len += strlen(buffer);
- if(i && connector){
- strcpy(result+len, connector);
- len += connlen;
- }
- }
- result[length]=0;
- outlet_symbol(x->x_obj.ob_outlet, gensym(result));
- freebytes(result, (length+1)*sizeof(char));
-}
-
-static void list2symbol_anything(t_list2symbol *x, t_symbol *s, int argc, t_atom *argv)
-{
- x->s =s;
- x->ac=argc;
- x->ap=argv;
-
- list2symbol_bang(x);
-}
-
-static void list2symbol_list(t_list2symbol *x, t_symbol *s, int argc, t_atom *argv)
-{
- list2symbol_anything(x, 0, argc, argv);
-}
-static void *list2symbol_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_list2symbol *x = (t_list2symbol *)pd_new(list2symbol_class);
-
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym(""));
- x->connector = gensym(" ");
- list2symbol_anything(x, 0, argc, argv);
-
- return (x);
-}
-
-static void list2symbol_free(t_list2symbol *x)
-{}
-
-
-static void list2symbol_setup(void)
-{
- list2symbol_class = class_new(gensym("list2symbol"), (t_newmethod)list2symbol_new,
- (t_method)list2symbol_free, sizeof(t_list2symbol), 0, A_GIMME, 0);
-
- class_addcreator((t_newmethod)list2symbol_new, gensym("l2s"), A_GIMME, 0);
- class_addbang (list2symbol_class, list2symbol_bang);
- class_addlist (list2symbol_class, list2symbol_list);
- class_addanything(list2symbol_class, list2symbol_anything);
- class_addmethod (list2symbol_class, (t_method)list2symbol_connector, gensym(""), A_SYMBOL, 0);
-
- class_sethelpsymbol(list2symbol_class, gensym("zexy/list2symbol"));
-}
-
-/* ------------------------- symbol2list ------------------------------- */
-
-static t_class *symbol2list_class;
-
-typedef struct _symbol2list
-{
- t_object x_obj;
- t_symbol *s, *delimiter;
- t_atom *argv;
- int argc, argnum; /* "argnum" is the number of reserved atoms (might be >argc) */
-} t_symbol2list;
-
-static void symbol2list_delimiter(t_symbol2list *x, t_symbol *s){
- x->delimiter = s;
-}
-
-STATIC_INLINE void string2atom(t_atom *ap, char* cp, int clen){
- char *buffer=getbytes(sizeof(char)*(clen+1));
- char *endptr[1];
- t_float ftest;
- strncpy(buffer, cp, clen);
- buffer[clen]=0;
- // post("converting buffer '%s' %d", buffer, clen);
- ftest=strtod(buffer, endptr);
- if (*endptr == buffer){
- /* strtof() failed, we have a symbol */
- SETSYMBOL(ap, gensym(buffer));
- } else {
- /* it is a number. */
- SETFLOAT(ap,ftest);
- }
- freebytes(buffer, sizeof(char)*(clen+1));
-}
-static void symbol2list_process(t_symbol2list *x)
-{
- char *cc;
- char *deli;
- int dell;
- char *cp, *d;
- int i=1;
-
- if (x->s==NULL){
- x->argc=0;
- return;
- }
- cc=x->s->s_name;
- cp=cc;
-
- if (x->delimiter==NULL || x->delimiter==&s_){
- i=strlen(cc);
- if(x->argnum<i){
- freebytes(x->argv, x->argnum*sizeof(t_atom));
- x->argnum=i+10;
- x->argv=getbytes(x->argnum*sizeof(t_atom));
- }
- x->argc=i;
- while(i--)string2atom(x->argv+i, cc+i, 1);
- return;
- }
-
- deli=x->delimiter->s_name;
- dell=strlen(deli);
-
-
- /* get the number of tokens */
- while((d=strstr(cp, deli))){
- if (d!=NULL && d!=cp){
- i++;
- }
- cp=d+dell;
- }
-
- /* resize the list-buffer if necessary */
- if(x->argnum<i){
- freebytes(x->argv, x->argnum*sizeof(t_atom));
- x->argnum=i+10;
- x->argv=getbytes(x->argnum*sizeof(t_atom));
- }
- x->argc=i;
- /* parse the tokens into the list-buffer */
- i=0;
-
- /* find the first token */
- cp=cc;
- while(cp==(d=strstr(cp,deli))){cp+=dell;}
- while((d=strstr(cp, deli))){
- if(d!=cp){
- string2atom(x->argv+i, cp, d-cp);
- i++;
- }
- cp=d+dell;
- }
-
- if(cp)string2atom(x->argv+i, cp, strlen(cp));
-}
-static void symbol2list_bang(t_symbol2list *x){
- symbol2list_process(x);
- if(x->argc)outlet_list(x->x_obj.ob_outlet, 0, x->argc, x->argv);
-}
-static void symbol2list_symbol(t_symbol2list *x, t_symbol *s){
- x->s = s;
- symbol2list_bang(x);
-}
-static void *symbol2list_new(t_symbol *s, int argc, t_atom *argv)
-{
- t_symbol2list *x = (t_symbol2list *)pd_new(symbol2list_class);
-
- outlet_new(&x->x_obj, 0);
- inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym(""));
-
- x->argc=0;
- x->argnum=16;
- x->argv=getbytes(x->argnum*sizeof(t_atom));
- symbol2list_delimiter(x, (argc)?atom_getsymbol(argv):gensym(" "));
-
- return (x);
-}
-
-static void symbol2list_free(t_symbol2list *x)
-{
-}
-
-
-static void symbol2list_setup(void)
-{
- symbol2list_class = class_new(gensym("symbol2list"), (t_newmethod)symbol2list_new,
- (t_method)symbol2list_free, sizeof(t_symbol2list), 0, A_GIMME, 0);
-
- class_addcreator((t_newmethod)symbol2list_new, gensym("s2l"), A_GIMME, 0);
- class_addsymbol (symbol2list_class, symbol2list_symbol);
- class_addbang (symbol2list_class, symbol2list_bang);
- class_addmethod (symbol2list_class, (t_method)symbol2list_delimiter, gensym(""), A_SYMBOL, 0);
-
- class_sethelpsymbol(symbol2list_class, gensym("zexy/symbol2list"));
-}
-/* global setup routine */
-
-void z_strings_setup(void)
-{
- atoi_setup();
- strcmp_setup();
- symbol2list_setup();
- list2symbol_setup();
-}
diff --git a/src/z_swap.c b/src/z_swap.c
deleted file mode 100644
index bdf6770..0000000
--- a/src/z_swap.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- the long waited for swap~-object that does a byte swap
- of course, we unfortunately have to quantize the float-signal to 16bit (to get bytes)
-
- 1110:forum::für::umläute:1999
- */
-
-#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* ------------------------ swap~ ----------------------------- */
-#define FLOAT2SHORT 32768.
-#define SHORT2FLOAT 1./32768.
-
-static t_class *swap_class;
-
-typedef struct _swap
-{
- t_object x_obj;
- int swapper;
-} t_swap;
-
-static void swap_float(t_swap *x, t_floatarg f)
-{
- x->swapper = (f != 0);
-}
-
-static void swap_bang(t_swap *x)
-{
- x->swapper ^= 1;
-}
-
-static t_int *swap_perform(t_int *w)
-{
- t_swap *x = (t_swap *)(w[1]);
- t_float *in = (t_float *)(w[2]);
- t_float *out = (t_float *)(w[3]);
- int n = (int)(w[4]);
-
-
- if (x->swapper)
- while (n--) {
- short dummy = FLOAT2SHORT * *in++;
- *out++ = SHORT2FLOAT * (short)( ((dummy & 0xFF) << 8) | ((dummy & 0xFF00) >> 8) );
- }
- else while (n--) *out++ = *in++;
-
- return (w+5);
-}
-
-static void swap_dsp(t_swap *x, t_signal **sp)
-{
- dsp_add(swap_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
-}
-
-static void swap_helper(void)
-{
- post("\n%c swap~-object for byteswapping a signal", HEARTSYMBOL);
- post("<1/0> : turn the swapper on/off\n"
- "'bang' : toggle the swapper on/off\n"
- "'help' : view this\n"
- "signal~");
- post("outlet : signal~");
-}
-
-static void *swap_new()
-{
- t_swap *x = (t_swap *)pd_new(swap_class);
- outlet_new(&x->x_obj, gensym("signal"));
- x->swapper = 1;
- return (x);
-}
-
-void z_swaptilde_setup(void)
-{
- swap_class = class_new(gensym("swap~"), (t_newmethod)swap_new, 0,
- sizeof(t_swap), 0, A_DEFFLOAT, 0);
- class_addmethod(swap_class, nullfn, gensym("signal"), 0);
- class_addmethod(swap_class, (t_method)swap_dsp, gensym("dsp"), 0);
-
- class_addfloat(swap_class, swap_float);
- class_addbang(swap_class, swap_bang);
-
- class_addmethod(swap_class, (t_method)swap_helper, gensym("help"), 0);
- class_sethelpsymbol(swap_class, gensym("zexy/swap~"));
-}
-
-/* ------------------------ blockmirror~ ----------------------------- */
-
-/* mirrors a signalblock around it's center:
- {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]}
-*/
-
-static t_class *blockmirror_class;
-
-typedef struct _blockmirror
-{
- t_object x_obj;
- int doit;
- int blocksize;
- t_float *blockbuffer;
-} t_blockmirror;
-
-static void blockmirror_float(t_blockmirror *x, t_floatarg f)
-{
- x->doit = (f != 0);
-}
-
-static t_int *blockmirror_perform(t_int *w)
-{
- t_blockmirror *x = (t_blockmirror *)(w[1]);
- t_float *in = (t_float *)(w[2]);
- t_float *out = (t_float *)(w[3]);
- int n = (int)(w[4]);
- if (x->doit) {
- if (in==out){
- int N=n;
- t_float *dummy=x->blockbuffer;
- while(n--)*dummy++=*in++;
- dummy--;
- while(N--)*out++=*dummy--;
- } else {
- in+=n-1;
- while(n--)*out++=*in--;
- }
- } else while (n--) *out++ = *in++;
- return (w+5);
-}
-
-static void blockmirror_dsp(t_blockmirror *x, t_signal **sp)
-{
- if (x->blocksize<sp[0]->s_n){
- if(x->blockbuffer)freebytes(x->blockbuffer, sizeof(t_float)*x->blocksize);
- x->blocksize = sp[0]->s_n;
- x->blockbuffer = getbytes(sizeof(t_float)*x->blocksize);
- }
- dsp_add(blockmirror_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
-}
-
-static void blockmirror_helper(void)
-{
- post("\n%c blockmirror~-object for reverting a signal", HEARTSYMBOL);
- post("'help' : view this\n"
- "signal~");
- post("outlet : signal~");
-}
-
-static void *blockmirror_new()
-{
- t_blockmirror *x = (t_blockmirror *)pd_new(blockmirror_class);
- outlet_new(&x->x_obj, gensym("signal"));
- x->doit = 1;
- x->blocksize=0;
- return (x);
-}
-
-void blockmirror_setup(void)
-{
- blockmirror_class = class_new(gensym("blockmirror~"), (t_newmethod)blockmirror_new, 0,
- sizeof(t_blockmirror), 0, A_DEFFLOAT, 0);
- class_addmethod(blockmirror_class, nullfn, gensym("signal"), 0);
- class_addmethod(blockmirror_class, (t_method)blockmirror_dsp, gensym("dsp"), 0);
-
- class_addfloat(blockmirror_class, blockmirror_float);
-
- class_addmethod(blockmirror_class, (t_method)blockmirror_helper, gensym("help"), 0);
- class_sethelpsymbol(blockmirror_class, gensym("zexy/blockmirror~"));
-}
-
-/* ------------------------ blockswap~ ----------------------------- */
-
-/* swaps a signalblock around it's center:
- {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]}
-*/
-
-static t_class *blockswap_class;
-
-typedef struct _blockswap
-{
- t_object x_obj;
- int doit;
- int blocksize;
- t_float *blockbuffer;
-} t_blockswap;
-
-static void blockswap_float(t_blockswap *x, t_floatarg f)
-{
- x->doit = (f != 0);
-}
-
-static t_int *blockswap_perform(t_int *w)
-{
- t_blockswap *x = (t_blockswap *)(w[1]);
- t_float *in = (t_float *)(w[2]);
- t_float *out = (t_float *)(w[3]);
- int N = (int)(w[4]);
- int N2=N/2;
- if (x->doit) {
- int n=N2;
- t_float *dummy=x->blockbuffer;
- while(n--)*dummy++=*in++;
- n=N-N2;
- while(n--)*out++=*in++;
- dummy=x->blockbuffer;
- n=N2;
- while(n--)*out++=*dummy++;
- } else while (N--) *out++=*in++;
- return (w+5);
-}
-
-static void blockswap_dsp(t_blockswap *x, t_signal **sp)
-{
- if (x->blocksize*2<sp[0]->s_n){
- if(x->blockbuffer)freebytes(x->blockbuffer, sizeof(t_float)*x->blocksize);
- x->blocksize = sp[0]->s_n/2;
- x->blockbuffer = getbytes(sizeof(t_float)*x->blocksize);
- }
- dsp_add(blockswap_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
-}
-
-static void blockswap_helper(void)
-{
- post("\n%c blockswap~-object for blockwise-swapping of a signal ", HEARTSYMBOL);
- post("'help' : view this\n"
- "signal~");
- post("outlet : signal~");
-}
-
-static void *blockswap_new()
-{
- t_blockswap *x = (t_blockswap *)pd_new(blockswap_class);
- outlet_new(&x->x_obj, gensym("signal"));
- x->doit = 1;
- x->blocksize=0;
- return (x);
-}
-
-void blockswap_setup(void)
-{
- blockswap_class = class_new(gensym("blockswap~"), (t_newmethod)blockswap_new, 0,
- sizeof(t_blockswap), 0, A_DEFFLOAT, 0);
- class_addmethod(blockswap_class, nullfn, gensym("signal"), 0);
- class_addmethod(blockswap_class, (t_method)blockswap_dsp, gensym("dsp"), 0);
-
- class_addfloat(blockswap_class, blockswap_float);
-
- class_addmethod(blockswap_class, (t_method)blockswap_helper, gensym("help"), 0);
- class_sethelpsymbol(blockswap_class, gensym("zexy/blockswap~"));
-}
-
-
-/* ----------------------------------------------------------------- */
-
-void z_swap_setup(void){
- z_swaptilde_setup();
- blockswap_setup();
- blockmirror_setup();
-}
-
diff --git a/src/z_tabread4.c b/src/z_tabread4.c
deleted file mode 100644
index c04cd41..0000000
--- a/src/z_tabread4.c
+++ /dev/null
@@ -1,312 +0,0 @@
-
-/* ---------- tabread4: control, interpolating ------------------------ */
-/* hack : 2108:forum::für::umläute:1999 @ iem */
-
-#include "zexy.h"
-
-
-/* =================== tabdump ====================== */
-
-static t_class *tabdump_class;
-
-typedef struct _tabdump
-{
- t_object x_obj;
- t_symbol *x_arrayname;
- t_int startindex, stopindex;
-} t_tabdump;
-
-static void tabdump_bang(t_tabdump *x)
-{
- t_garray *A;
- int npoints;
- t_float *vec;
-
- if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
- error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
- error("%s: bad template for tabdump", x->x_arrayname->s_name);
- else
- {
- int n;
- t_atom *atombuf;
-
- int start=x->startindex;
- int stop =x->stopindex;
- if(start<0||start>stop)start=0;
- if(stop<start||stop>npoints)stop=npoints;
- npoints=stop-start;
-
- atombuf = (t_atom *)getbytes(sizeof(t_atom)*npoints);
- for (n = 0; n < npoints; n++) SETFLOAT(&atombuf[n], vec[start+n]);
- outlet_list(x->x_obj.ob_outlet, &s_list, npoints, atombuf);
- freebytes(atombuf,sizeof(t_atom)*npoints);
- }
-}
-
-static void tabdump_list(t_tabdump *x, t_symbol*s,int argc, t_atom*argv)
-{
- int a,b;
- switch(argc){
- case 2:
- a=atom_getint(argv);
- b=atom_getint(argv+1);
- x->startindex=(a<b)?a:b;
- x->stopindex =(a>b)?a:b;
- tabdump_bang(x);
- break;
- default:
- error("tabdump: list must be 2 floats (is %d atoms)", argc);
- }
-}
-
-static void tabdump_set(t_tabdump *x, t_symbol *s)
-{
- x->x_arrayname = s;
-}
-
-static void *tabdump_new(t_symbol *s)
-{
- t_tabdump *x = (t_tabdump *)pd_new(tabdump_class);
- x->x_arrayname = s;
- x->startindex=0;
- x->stopindex=-1;
- outlet_new(&x->x_obj, &s_list);
-
- return (x);
-}
-
-static void tabdump_helper(void)
-{
- post("\n%c tabdump - object : dumps a table as a package of floats", HEARTSYMBOL);
- post("'set <table>'\t: read out another table\n"
- "'bang'\t\t: dump the table\n"
- "outlet\t\t: table-data as package of floats");
- post("creation\t: \"tabdump <table>\"");
-
-}
-
-static void tabdump_setup(void)
-{
- tabdump_class = class_new(gensym("tabdump"), (t_newmethod)tabdump_new,
- 0, sizeof(t_tabdump), 0, A_DEFSYM, 0);
- class_addbang(tabdump_class, (t_method)tabdump_bang);
- class_addlist(tabdump_class, (t_method)tabdump_list);
-
- class_addmethod(tabdump_class, (t_method)tabdump_set, gensym("set"),
- A_SYMBOL, 0);
-
- class_addmethod(tabdump_class, (t_method)tabdump_helper, gensym("help"), 0);
- class_sethelpsymbol(tabdump_class, gensym("zexy/tabdump"));
-}
-
-/* =================== tabminmax ====================== */
-
-static t_class *tabminmax_class;
-
-typedef struct _tabminmax
-{
- t_object x_obj;
- t_outlet*min_out, *max_out;
- t_symbol *x_arrayname;
- t_int startindex, stopindex;
-} t_tabminmax;
-
-static void tabminmax_bang(t_tabminmax *x)
-{
- t_garray *A;
- int npoints;
- t_float *vec;
-
- if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
- error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
- error("%s: bad template for tabminmax", x->x_arrayname->s_name);
- else
- {
- int n;
- t_atom atombuf[2];
- t_float min, max;
- int mindex, maxdex;
-
- int start=x->startindex;
- int stop =x->stopindex;
- if(start<0||start>stop)start=0;
- if(stop<start||stop>npoints)stop=npoints;
- npoints=stop-start;
-
- min=vec[start];
- max=vec[start];
-
- mindex=start;
- maxdex=start;
-
- for (n = 1; n < npoints; n++){
- t_float val=vec[start+n];
- if(val<min){
- mindex=start+n;
- min=val;
- }
- if(val>max){
- maxdex=start+n;
- max=val;
- }
- }
-
- SETFLOAT(atombuf, max);
- SETFLOAT(atombuf+1, maxdex);
- outlet_list(x->max_out, &s_list, 2, atombuf);
-
- SETFLOAT(atombuf, min);
- SETFLOAT(atombuf+1, mindex);
- outlet_list(x->min_out, &s_list, 2, atombuf);
- }
-}
-
-static void tabminmax_list(t_tabminmax *x, t_symbol*s,int argc, t_atom*argv)
-{
- int a,b;
- switch(argc){
- case 2:
- a=atom_getint(argv);
- b=atom_getint(argv+1);
- x->startindex=(a<b)?a:b;
- x->stopindex =(a>b)?a:b;
- tabminmax_bang(x);
- break;
- default:
- error("tabminmax: list must be 2 floats (is %d atoms)", argc);
- }
-}
-
-static void tabminmax_set(t_tabminmax *x, t_symbol *s)
-{
- x->x_arrayname = s;
-}
-
-static void *tabminmax_new(t_symbol *s)
-{
- t_tabminmax *x = (t_tabminmax *)pd_new(tabminmax_class);
- x->x_arrayname = s;
- x->startindex=0;
- x->stopindex=-1;
- x->min_out=outlet_new(&x->x_obj, &s_list);
- x->max_out=outlet_new(&x->x_obj, &s_list);
-
- return (x);
-}
-
-static void tabminmax_helper(void)
-{
- post("\n%c tabminmax - object : dumps a table as a package of floats", HEARTSYMBOL);
- post("'set <table>'\t: read out another table\n"
- "'bang'\t\t: get min and max of the table\n"
- "outlet\t\t: table-data as package of floats");
- post("creation\t: \"tabminmax <table>\"");
-
-}
-
-static void tabminmax_setup(void)
-{
- tabminmax_class = class_new(gensym("tabminmax"), (t_newmethod)tabminmax_new,
- 0, sizeof(t_tabminmax), 0, A_DEFSYM, 0);
- class_addbang(tabminmax_class, (t_method)tabminmax_bang);
- class_addlist(tabminmax_class, (t_method)tabminmax_list);
-
- class_addmethod(tabminmax_class, (t_method)tabminmax_set, gensym("set"),
- A_SYMBOL, 0);
-
- class_addmethod(tabminmax_class, (t_method)tabminmax_helper, gensym("help"), 0);
- class_sethelpsymbol(tabminmax_class, gensym("zexy/tabminmax"));
-}
-
-
-/* =================== tabset ====================== */
-
-static t_class *tabset_class;
-
-typedef struct _tabset
-{
- t_object x_obj;
- t_symbol *x_arrayname;
-} t_tabset;
-
-static void tabset_float(t_tabset *x, t_floatarg f)
-{
- t_garray *A;
- int npoints;
- t_float *vec;
-
- if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
- error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
- error("%s: bad template for tabset", x->x_arrayname->s_name);
- else {
- while(npoints--)*vec++=f;
- garray_redraw(A);
- }
-}
-
-static void tabset_list(t_tabset *x, t_symbol *s, int argc, t_atom* argv)
-{
- t_garray *A;
- int npoints;
- t_float *vec;
-
- if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
- error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
- error("%s: bad template for tabset", x->x_arrayname->s_name);
- else {
- if (argc>=npoints)
- while(npoints--)*vec++=atom_getfloat(argv++);
- else {
- npoints-=argc;
- while (argc--)*vec++=atom_getfloat(argv++);
- while (npoints--)*vec++=0;
- }
- garray_redraw(A);
- }
-}
-static void tabset_set(t_tabset *x, t_symbol *s)
-{
- x->x_arrayname = s;
-}
-
-static void *tabset_new(t_symbol *s)
-{
- t_tabset *x = (t_tabset *)pd_new(tabset_class);
- x->x_arrayname = s;
-
- return (x);
-}
-
-static void tabset_helper(void)
-{
- post("\n%c tabset - object : set a table with a package of floats", HEARTSYMBOL);
- post("'set <table>'\t: set another table\n"
- "<list>\t\t: set the table"
- "<float>\t\t: set the table to constant float\n");
- post("creation\t: \"tabset <table>\"");
-}
-
-static void tabset_setup(void)
-{
- tabset_class = class_new(gensym("tabset"), (t_newmethod)tabset_new,
- 0, sizeof(t_tabset), 0, A_DEFSYM, 0);
- class_addfloat(tabset_class, (t_method)tabset_float);
- class_addlist (tabset_class, (t_method)tabset_list);
- class_addmethod(tabset_class, (t_method)tabset_set, gensym("set"),
- A_SYMBOL, 0);
-
- class_addmethod(tabset_class, (t_method)tabset_helper, gensym("help"), 0);
- class_sethelpsymbol(tabset_class, gensym("zexy/tabset"));
-}
-
-
-void z_tabread4_setup(void)
-{
- tabdump_setup();
- tabminmax_setup();
- tabset_setup();
-}
diff --git a/src/z_zdelay.c b/src/z_tilde.c
index 1c4f1ed..7d786ca 100644
--- a/src/z_zdelay.c
+++ b/src/z_tilde.c
@@ -1,3 +1,19 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
/*
here we do some sample-wise delay, so you can do your own FIR-filter-designs
here are :: "z^(-1)", "z^(-N)"
@@ -8,11 +24,6 @@
#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
/* ----------------------------------------------------- */
static t_class *zNdelay_class;
@@ -107,7 +118,7 @@ static void zdel_helper(void)
}
-void z_zdelay_setup(void)
+void z_tilde_setup(void)
{
zNdelay_class = class_new(gensym("z~"), (t_newmethod)zNdelay_new, (t_method)zNdelay_free,
sizeof(t_zNdelay), 0, A_DEFFLOAT, 0);
@@ -117,4 +128,5 @@ void z_zdelay_setup(void)
class_addfloat(zNdelay_class, zdel_float);
class_addmethod(zNdelay_class, (t_method)zdel_helper, gensym("help"), 0);
class_sethelpsymbol(zNdelay_class, gensym("zexy/z~"));
+ zexy_register("z~");
}
diff --git a/src/zexy.c b/src/zexy.c
index 710072a..7758b57 100644
--- a/src/zexy.c
+++ b/src/zexy.c
@@ -1,7 +1,22 @@
+/******************************************************
+ *
+ * zexy - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1999:forum::für::umläute:2004
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+
/* ...this is a very ZEXY external ...
so have fun
-
- 1999:forum::für::umläute:2001
*/
#include "zexy.h"
@@ -134,147 +149,18 @@ static void zexy_help(void)
"this software is under the GnuGPL that is provided with these files", HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL, HEARTSYMBOL);
}
-void *zexy_new(void)
+static void *zexy_new(void)
{
t_zexy *x = (t_zexy *)pd_new(zexy_class);
return (void *)x;
}
-/* include some externals */
-#if 0
-void z_streamin_setup(); /* urps, i THINK this will be linux only */
-void z_streamout_setup();
-void z_stdinout_setup(); // not yet...
-#endif // 0
-void z_sfplay_setup();
-void z_sfrecord_setup();
-void z_noise_setup();
-void z_testfun_setup();
-void z_nop_setup();
-void z_zdelay_setup();
-void z_limiter_setup();
-void z_swap_setup();
-void z_quantize_setup();
-void z_sigzero_setup();
-void z_tabread4_setup();
-void z_makefilenamen_setup();
-void z_makesymbol_setup();
-
-void z_pdf_setup();
-void z_dfreq_setup();
-void z_sigaverage_setup();
-void z_sigpack_setup();
-
-void z_datetime_setup();
-
-void z_sigbin_setup();
-
-#if 0 // used to be Win32 only, but i somehow lost the fine code
-void z_execute_setup();
-#endif
-
-/* lp ports are only on i386 machines */
-#ifdef __i386__
-void z_lp_setup();
-#endif
-
-void z_index_setup();
-void z_connective_setup();
-void z_sort_setup();
-void z_multiplex_setup();
-void z_average_setup();
-void z_coordinates_setup();
-void z_stat_setup();
-
-void z_pack_setup();
-void z_drip_setup();
-
-void z_stdinout_setup();
-void z_msgfile_setup();
-void z_multiline_setup();
-void z_matrix_setup();
-void z_sigmatrix_setup();
-
-void z_strings_setup();
-
-void z_prime_setup();
-void z_random_setup();
-void z_wrap_setup();
-/*
- waiting to be released in near future:
- make stdin~ and stdout~ work
- MAKE streamin~ work !!!
- sql
- ...
-*/
-void z_operating_system_setup();
+#include "z_zexy.c"
void zexy_setup(void)
{
int i;
-#if 0
-#ifdef linux
- z_streamin_setup();
-#endif
- z_streamout_setup();
- z_stdinout_setup();
-#endif
- z_sfplay_setup();
- z_sfrecord_setup();
- z_noise_setup();
- z_testfun_setup();
- z_limiter_setup();
- z_nop_setup();
- z_zdelay_setup();
- z_swap_setup();
- z_quantize_setup();
-
- z_sigzero_setup();
- z_pdf_setup();
- z_dfreq_setup();
- z_sigaverage_setup();
- z_sigbin_setup();
-
- z_sigpack_setup();
-
- z_tabread4_setup();
- z_average_setup();
- z_coordinates_setup();
- z_stat_setup();
- z_makesymbol_setup();
-
- z_datetime_setup();
-
- z_index_setup();
- z_connective_setup();
- z_sort_setup();
- z_multiplex_setup();
- z_pack_setup();
- z_drip_setup();
-
- z_prime_setup();
- z_random_setup();
- z_wrap_setup();
-#if 0
- z_stdinout_setup();
-
- // we'll do this the next days
- z_execute_setup();
-#endif
- z_msgfile_setup();
-
- z_multiline_setup();
- z_matrix_setup();
- z_sigmatrix_setup();
-
- z_strings_setup();
- z_operating_system_setup();
-
-/* lp ports are only on i386 machines */
-#ifdef __i386__
- z_lp_setup();
-#endif
-
+ z_zexy_setup();
/* ************************************** */
startpost("\n\t");
for (i=0; i<28; i++) startpost("%c", HEARTSYMBOL);
diff --git a/src/zexy.dsp b/src/zexy.dsp
index 98c27ce..7c94124 100644
--- a/src/zexy.dsp
+++ b/src/zexy.dsp
@@ -39,7 +39,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEXY_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /I "..\..\..\pd\src" /D "WIN32" /D "NT" /D "_WINDOWS" /D "ZEXY" /FR /YX /FD /c
+# ADD CPP /nologo /Zp16 /W3 /GX /I "..\..\..\pd\src" /D "WIN32" /D "NT" /D "_WINDOWS" /D "ZEXY" /D "Z_WANT_LPT" /FR /YX /FD /c
+# SUBTRACT CPP /O<none>
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /win32
# SUBTRACT MTL /mktyplib203
@@ -60,147 +61,239 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
-SOURCE=.\z_average.c
+SOURCE=.\a2l.c
# End Source File
# Begin Source File
-SOURCE=.\z_connective.c
+SOURCE=.\atoi.c
# End Source File
# Begin Source File
-SOURCE=.\z_coordinates.c
+SOURCE=.\avg_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_datetime.c
+SOURCE=.\blockmirror_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_dfreq.c
+SOURCE=.\blockswap_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_drip.c
+SOURCE=.\date.c
# End Source File
# Begin Source File
-SOURCE=.\z_index.c
+SOURCE=.\demultiplex.c
# End Source File
# Begin Source File
-SOURCE=.\z_limiter.c
+SOURCE=.\demultiplex_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_makesymbol.c
+SOURCE=.\dfreq_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_matrix.c
+SOURCE=.\dirac_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_msgfile.c
+SOURCE=.\dot.c
# End Source File
# Begin Source File
-SOURCE=.\z_multiline.c
+SOURCE=.\drip.c
# End Source File
# Begin Source File
-SOURCE=.\z_multiplex.c
+SOURCE=.\envrms_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_noise.c
+SOURCE=.\glue.c
# End Source File
# Begin Source File
-SOURCE=.\z_nop.c
+SOURCE=.\index.c
# End Source File
# Begin Source File
-SOURCE=.\z_operating_system.c
+SOURCE=.\length.c
# End Source File
# Begin Source File
-SOURCE=.\z_pack.c
+SOURCE=.\limiter_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_pdf.c
+SOURCE=.\list2int.c
# End Source File
# Begin Source File
-SOURCE=.\z_prime.c
+SOURCE=.\list2symbol.c
# End Source File
# Begin Source File
-SOURCE=.\z_quantize.c
+SOURCE=.\lister.c
# End Source File
# Begin Source File
-SOURCE=.\z_random.c
+SOURCE=.\lpt.c
# End Source File
# Begin Source File
-SOURCE=.\z_sfplay.c
+SOURCE=.\makesymbol.c
# End Source File
# Begin Source File
-SOURCE=.\z_sfrecord.c
+SOURCE=.\mavg.c
# End Source File
# Begin Source File
-SOURCE=.\z_sigaverage.c
+SOURCE=.\minmax.c
# End Source File
# Begin Source File
-SOURCE=.\z_sigbin.c
+SOURCE=.\msgfile.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\multiline_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\multiplex.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\multiplex_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\niagara.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\noish_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\noisi_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\operating_system.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\pack_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\packel.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\pdf_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\prime.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\quantize_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\repack.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\repeat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sfplay.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sfrecord.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sigzero_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sort.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\step_tilde.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strcmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sum.c
# End Source File
# Begin Source File
-SOURCE=.\z_sigmatrix.c
+SOURCE=.\swap_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_sigpack.c
+SOURCE=.\symbol2list.c
# End Source File
# Begin Source File
-SOURCE=.\z_sigzero.c
+SOURCE=.\tabdump.c
# End Source File
# Begin Source File
-SOURCE=.\z_sort.c
+SOURCE=.\tabminmax.c
# End Source File
# Begin Source File
-SOURCE=.\z_stat.c
+SOURCE=.\tabset.c
# End Source File
# Begin Source File
-SOURCE=.\z_strings.c
+SOURCE=.\tavg_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_swap.c
+SOURCE=.\time.c
# End Source File
# Begin Source File
-SOURCE=.\z_tabread4.c
+SOURCE=.\unpack_tilde.c
# End Source File
# Begin Source File
-SOURCE=.\z_testfun.c
+SOURCE=.\urn.c
# End Source File
# Begin Source File
-SOURCE=.\z_wrap.c
+SOURCE=.\winNT_portio.c
# End Source File
# Begin Source File
-SOURCE=.\z_zdelay.c
+SOURCE=.\wrap.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\z_sigbin.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\z_tilde.c
# End Source File
# Begin Source File
@@ -219,5 +312,13 @@ SOURCE=..\..\src\m_pd.h
SOURCE=.\Zexy.h
# End Source File
# End Group
+# Begin Group "generic"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\z_zexy.h
+# End Source File
+# End Group
# End Target
# End Project
diff --git a/src/zexy.h b/src/zexy.h
index bd41ed6..7d6a2cb 100644
--- a/src/zexy.h
+++ b/src/zexy.h
@@ -32,14 +32,44 @@
#include "m_pd.h"
-#define VERSION "1.3"
+#define VERSION "2.0"
#ifdef NT
-/* yes, we have beautiful hearts under NT */
-#define HEARTSYMBOL 3
+# pragma warning( disable : 4244 )
+# pragma warning( disable : 4305 )
+# define HEARTSYMBOL 3
+# define sqrtf sqrt
+# define fabsf fabs
+# define STATIC_INLINE
#else
-/* but none for linux; indeed the only drawback */
-#define HEARTSYMBOL 169
+# define HEARTSYMBOL 169
#endif
+#ifdef MACOSX
+# define sqrtf sqrt
#endif
+
+
+typedef struct _mypdlist
+{
+ t_object x_obj;
+
+ int x_n;
+ t_atom *x_list;
+} t_mypdlist;
+
+#ifdef SINGLE_EXTERNALS
+static void zexy_register(char*object){
+ if(object!=0){
+ post("%s: part of the zexy external "VERSION"", object);
+ post("\t (l) forum::für::umläute");
+ post("\t IOhannes m zmölnig @ IEM");
+ post("\t compiled: "__DATE__" ");
+ }
+}
+#else
+static void zexy_register(char*object){}
+#endif /* SINGLE_EXTERNALS */
+
+
+#endif /* INCLUDE_ZEXY_H__ */
diff --git a/z_install.bat b/z_install.bat
index 52c3a86..d68034e 100644
--- a/z_install.bat
+++ b/z_install.bat
@@ -1,9 +1,10 @@
@echo off
echo installing zexy on your system
-mkdir ..\externs
-copy zexy.dll ..\externs
+mkdir ..\extra
+copy zexy.dll ..\extra
+
echo copying help files
-mkdir ..\doc\5.reference\zexy
-copy examples\* ..\doc\5.reference\zexy
+mkdir ..\extra\help-zexy
+copy examples\* ..\extra\help-zexy
+
echo done
-echo on