pax_global_header00006660000000000000000000000064126505173040014515gustar00rootroot0000000000000052 comment=fcb634fdede2b6c71b7c5ee2cea43f05622c126b zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/000077500000000000000000000000001265051730400207135ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/.gitignore000066400000000000000000000004111265051730400226770ustar00rootroot00000000000000# git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): *.[oa] *~ *.pd_linux *.pd_darwin *.dll zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/AUTHORS000066400000000000000000000005021265051730400217600ustar00rootroot00000000000000Copyright 1999-2011 IOhannes m zmoelnig contributions: Copyright 1998-2004 matt wright Copyright 1999-2000 winfried ritsch Copyright 1999 guenter geiger Copyright 1996-1999 miller s puckette Copyright 2005-2006 tim blechmann Copyright 2009-2010 franz zotter Copyright 1999-2011 zexy-contributors zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/BUGS.txt000066400000000000000000000005371265051730400222210ustar00rootroot00000000000000[drip] - sometimes crashes with small delays . according to the backtrace this should be a memory corruption . (actually the crashing patch was buggy by design and i haven't got a simple bug-patch yet) = UNREPRODUCIBLE [s2l] - numerically looking sub-symbols are converted wrongly to floats: e.g. "192.168.0.1" -> 192,168 + FIXED zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/ChangeLog000066400000000000000000000020101265051730400224560ustar00rootroot00000000000000zexy (2.2.6) RELEASED; urgency=low * Fixes NULL-pointer access and file handle leaks * Fixes for autotools * Allow to build both single-object and multiobject binaries in one go (just use "--enable-library=both") * Allow setting the build-date string via autoconf-args * Consistency fixes for objects. * Switched to git -- IOhannes m zmölnig Fri, 22 Jan 2016 22:16:02 +0100 zexy (2.2.5) RELEASED; urgency=low * switched to autotools * generate ChangeLog with "dch -c ChangeLog" -- IOhannes m zmoelnig (gpg-key at iem) Thu, 29 Sep 2011 14:19:18 +0200 zexy (2.2.4) RELEASED; urgency=low * disable SIMD code by default (prevent crashes) * [msgfile] does not crash with [add2( on an emtpy buffer * [pack]/[unpack] now accept all messages (like their vanilla counterparts) * [limiter~] on-the-fly oversampling parameters (higher precision) * all code is now UTF-8 -- IOhannes m zmoelnig (gpg-key at iem) Wed, 26 Sep 2011 21:20:20 +0200 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/INSTALL000066400000000000000000000363321265051730400217530ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/LICENSE.txt000066400000000000000000000355641265051730400225530ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/Makefile.am000066400000000000000000000004701265051730400227500ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src abs reference SUBDIRS += tests build zexydir=$(pkglibdir) dist_zexy_DATA = \ AUTHORS \ README.txt \ INSTALL \ LICENSE.txt \ ChangeLog \ zexy-meta.pd LIBTOOL_DEPS = @LIBTOOL_DEPS@ libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status libtool zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/README.txt000066400000000000000000000130451265051730400224140ustar00rootroot00000000000000============================================================================== the zexy external ============================================================================== outline of this file:: ============================================================================== + general + installation + linux, irix, OSX,... (autoconf) + w32 + using + license general:: ============================================================================== the zexy external is a collection of externals for miller.s.puckette's realtime-computermusic-environment called "puredata" (or abbreviated "pd") this zexy external will be of no use, if you don't have a running version of pd on your system. check out for http://pd.iem.at to learn more about pd and how to get it note: the zexy external is published under the Gnu General Public License that is included (GnuGPL.txt). some parts of the code are taken directly from the pd source-code, they, of course, fall under the license pd is published under. installation:: ============================================================================== linux, irix, osx, mingw,... : ------------------------------------------------------------------------------ see INSTALL for more detailed instructions #0> ./autogen.sh #1> ./configure #2> make #3> make install installation directory: by defaultm zexy will install into /usr/local/lib/pd/extra/zexy the path can be changed via the "--prefix", or "--libdir" e.g. "./configure --prefix=/usr" -> /usr/lib/pd/extra/zexy e.g. "./configure --libdir=/tmp/foo" -> /tmp/foo/zexy puredata headers: zexy needs to find the Pd headers (and Pd.lib on some systems) during the build process. if you have installed the headers in a non-standard location, you can specify them with the "--with-pd" option: "./configure --with-pd=/usr/include/pd" will add /usr/include/pd to the INCLUDE path. "./configure --with-pd=/home/me/src/Pd-0.43.1" can be used to add /home/me/src/Pd-0.43.1/src to the INCLUDEs and /home/me/src/Pd-0.43.1/bin to the library search path custom external extension: zexy does it's best to determine the correct external extension for your system. e.g. it will use "dll" on w32, or "pd_linux" on linux. if - for whatever obscure reasons - you want to force the extension to certain value, you can use the "--with-extension" flag: "./configure --with-extension=l_ia64" will use "l_ia64" for the resulting binaries SSE2 (SIMD): by default zexy is compiled without SIMD optimization (recently there have been reports about crashes, when SSE2 was enabled; until this is fixed, the default is to use the safe fallback) if you want to enable SSE2 optimization, configure with "./configure --enable-simd=SSE2" multi-object vs single-object libraries: by default, zexy builds a single library "zexy" that contains all objects. if - for some obscure reason - you insist on having a lot of small libraries each containing a single object, you can enable this by using the "--disable-library" flag parallel port support: if you don't want the parallel-port object [lpt] you can disable it with "--disable-lpt" (e.g.: because you don't have a parallel-port) fat (multiarch) binaries: for building multi-arch binaries (currently only supported on OSX), specify the wanted architectures in the "--enable-fat-binary" flag e.g. "./configure --enable-fat-binary=i386,ppc --with-extension=d_fat" win32 : ------------------------------------------------------------------------------ to compile: + w/ MSVC use the build project found in build/win-vs*/ OR + with GCC configure your pd path, eg: #> ./configure --prefix=/c/program/pd; make; make install OR + cross-compilation for windows on linux using mingw (assumes that the crosscompiler is "i586-mingw32msvc-cc") #> ./configure --host=i586-mingw32msvc --with-extension=dll \ --disable-PIC --with-pd=/path/to/win/pd/ #> make CFLAGS="-fno-unit-at-a-time" notes: configure tries to set the CFLAGS to "-g -O2" if the compiler accepts this; however, this optimization sometimes generates binaries that cannot be loaded by pd; it seems that disabling the "unit-at-a-time" optimization (which gets enabled by "-O2") is the cause of this problem. turning it off might help making pd run with the zexy external:: ============================================================================== make sure, that pd will be looking at this location (add "-path /pd/externs" either to your .pdrc or each time you execute pd) make sure, that you somehow load the zexy external (either add "-lib zexy" (if you advised pd somehow to look at the correct place) or "-lib /zexy" to your startup-script (.pdrc or whatever) or load it via the object "zexy" at runtime license:: ============================================================================== This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/000077500000000000000000000000001265051730400214605ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/&&~-help.pd000066400000000000000000000016471265051730400233340ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x260x260x7e.pd000066400000000000000000000006171265051730400236340ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x3c0x7e-help.pd000066400000000000000000000016361265051730400242220ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x3c0x7e.pd000066400000000000000000000006161265051730400232710ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x3d0x3d0x7e.pd000066400000000000000000000006171265051730400237720ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x3e0x7e-help.pd000066400000000000000000000016451265051730400242240ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x3e0x7e.pd000066400000000000000000000006161265051730400232730ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x7c0x7c0x7e-help.pd000066400000000000000000000016471265051730400247320ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/0x7c0x7c0x7e.pd000066400000000000000000000006171265051730400240000ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/==~-help.pd000066400000000000000000000016471265051730400234120ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/Makefile.am000066400000000000000000000023461265051730400235210ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign SUFFIXES = .pd zexydir=$(pkglibdir) dist_zexy_DATA= \ 0x260x260x7e.pd \ 0x3c0x7e-help.pd \ 0x3c0x7e.pd \ 0x3d0x3d0x7e.pd \ 0x3e0x7e-help.pd \ 0x3e0x7e.pd \ 0x7c0x7c0x7e-help.pd \ 0x7c0x7c0x7e.pd \ a2l.pd \ absgn~-help.pd \ absgn~.pd \ abs~-help.pd \ abs~.pd \ cart2pol-help.pd \ cart2pol.pd \ cart2sph-help.pd \ cart2sph.pd \ deg2rad-help.pd \ deg2rad.pd \ ==~-help.pd \ &&~-help.pd \ length.pd \ list2int.pd \ mavg.pd \ mean-help.pd \ mean.pd \ minmax.pd \ nop~-help.pd \ nop-help.pd \ nop~.pd \ nop.pd \ pol2cart-help.pd \ pol2cart.pd \ pol2sph-help.pd \ pol2sph.pd \ polyfun-help.pd \ polyfun.pd \ rad2deg-help.pd \ rad2deg.pd \ repack.pd \ segregate-help.pd \ segregate.pd \ sgn~-help.pd \ sgn~.pd \ sph2cart-help.pd \ sph2cart.pd \ sph2pol-help.pd \ sph2pol.pd \ sum.pd \ tabset.pd \ uniqsym-help.pd \ uniqsym.pd ############# # symlinks for aliases zexyaliasdir=$(pkglibdir) clean-local: clean_zexyalias .PHONY: clean_zexyalias dist_zexyalias_DATA = any2list.pd l2i.pd # create aliases $(dist_zexyalias_DATA): test -e $< && $(LN_S) $< $@ # delete aliases clean_zexyalias: -rm -f $(dist_zexyalias_DATA) # define aliases any2list.pd: a2l.pd l2i.pd: list2int.pd zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/a2l.pd000066400000000000000000000004551265051730400224670ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X obj 74 50 inlet; #X obj 74 172 outlet; #X obj 74 107 route bang; #X obj 149 128 list; #X text 286 38 part of zexy; #X text 174 81 requires pd>=0.39; #X text 58 25 convert anything into lists; #X connect 0 0 2 0; #X connect 2 0 1 0; #X connect 2 1 3 0; #X connect 3 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/absgn~-help.pd000066400000000000000000000016121265051730400242230ustar00rootroot00000000000000#N canvas 201 257 575 388 10; #X obj 92 103 sig~; #X text 272 20 part of zexy; #X obj 93 176 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 41 285 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 absgn~; #X text 349 61 updated for zexy-2.1; #X obj 163 176 snapshot~; #X floatatom 163 202 5 0 0 0 - - -; #X text 65 46 absolute value and signum of a signal; #X connect 0 0 11 0; #X connect 2 0 3 0; #X connect 4 0 2 0; #X connect 4 0 13 0; #X connect 5 0 4 0; #X connect 6 0 0 0; #X connect 11 0 2 0; #X connect 11 1 13 0; #X connect 13 0 14 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/absgn~.pd000066400000000000000000000010261265051730400232740ustar00rootroot00000000000000#N canvas 0 0 482 310 10; #X obj 30 88 inlet~; #X obj 30 136 outlet~; #X text 319 21 part of zexy; #X obj 187 137 outlet~; #X obj 31 113 abs~; #X obj 187 113 sgn~; #X text 36 44 [absgn~]; #X text 250 261 updated for zexy-2.1; #X text 41 183 [absgn~] \, [abs~] and [sgn~] are provided both as externals (fast!) and abstractions (slow!!) \; if you are using this abstraction of [absgn~] \, chances are high \, that [abs~] and [sgn~] are abstractions too.; #X connect 0 0 4 0; #X connect 0 0 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/abs~-help.pd000066400000000000000000000013761265051730400237050ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/abs~.pd000066400000000000000000000005431265051730400227520ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/alias000066400000000000000000000000321265051730400224670ustar00rootroot00000000000000a2l any2list list2int l2i zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/cart2pol-help.pd000066400000000000000000000012761265051730400244670ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/cart2pol.pd000066400000000000000000000023011265051730400235270ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/cart2sph-help.pd000066400000000000000000000013121265051730400244560ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/cart2sph.pd000066400000000000000000000031171265051730400235350ustar00rootroot00000000000000#N canvas 437 75 639 543 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 481 outlet r; #X obj 206 481 outlet phi; #X obj 279 481 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 obj 167 426 unpack 0 0 0; #X obj 167 406 pack 0 0 0; #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 31 1; #X connect 13 0 31 2; #X connect 14 0 31 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; #X connect 30 0 4 0; #X connect 30 1 5 0; #X connect 30 2 6 0; #X connect 31 0 30 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/deg2rad-help.pd000066400000000000000000000014411265051730400242430ustar00rootroot00000000000000#N canvas 421 168 450 300 10; #X obj 60 39 deg2rad; #X text 122 40 convert DEGree to RADian; #X obj 76 138 deg2rad; #X floatatom 76 167 5 0 0 0 - - -; #X floatatom 76 86 5 0 0 0 - - -; #X obj 132 129 / 180; #X obj 132 153 * 3.14159; #X obj 116 225 -; #X floatatom 132 176 5 0 0 0 - - -; #X obj 76 110 t f f; #X floatatom 116 257 16 0 0 0 - - -; #X floatatom 317 155 5 0 0 0 - - -; #X obj 317 172 deg2rad; #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; #X connect 5 0 6 0; #X connect 6 0 8 0; #X connect 7 0 10 0; #X connect 8 0 7 1; #X connect 9 0 2 0; #X connect 9 1 5 0; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 14 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/deg2rad.pd000066400000000000000000000007061265051730400233200ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/length.pd000066400000000000000000000004331265051730400232660ustar00rootroot00000000000000#N canvas 78 147 450 289 10; #X obj 62 145 inlet; #X obj 62 209 outlet; #X obj 62 189 list length; #X text 225 36 part of zexy; #X text 64 87 get the length of a list; #X text 188 190 requires pd>=0.40; #X obj 62 166 list; #X connect 0 0 6 0; #X connect 2 0 1 0; #X connect 6 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/list2int.pd000066400000000000000000000023061265051730400235560ustar00rootroot00000000000000#N canvas 0 0 450 496 10; #X obj 94 139 inlet; #X obj 94 457 outlet; #X obj 94 245 repack 1; #X obj 163 245 length; #X obj 94 315 repack; #X obj 94 270 route float; #X obj 94 291 int; #X obj 94 223 t a a; #X text 30 24 (c) 2006 IOhannes m zmoelnig \, IEM; #X text 31 75 cast any float in a list to integer. leave the rest untouched. ; #X obj 94 162 route list; #X obj 94 191 t a b; #X obj 169 190 t a b; #X obj 94 361 spigot 1; #X obj 172 360 spigot 0; #X obj 172 382 list trim; #X obj 94 340 t l l; #X obj 94 418 t a; #X obj 153 340 != 0; #X obj 231 340 == 0; #X obj 153 320 t f f; #X msg 153 298 1; #X msg 185 298 0; #X text 34 48 part of zexy; #X connect 0 0 10 0; #X connect 2 0 5 0; #X connect 3 0 4 1; #X connect 4 0 16 0; #X connect 5 0 6 0; #X connect 5 1 4 0; #X connect 6 0 4 0; #X connect 7 0 2 0; #X connect 7 1 3 0; #X connect 10 0 11 0; #X connect 10 1 12 0; #X connect 11 0 7 0; #X connect 11 1 21 0; #X connect 12 0 7 0; #X connect 12 1 22 0; #X connect 13 0 17 0; #X connect 14 0 15 0; #X connect 15 0 17 0; #X connect 16 0 13 0; #X connect 16 1 14 0; #X connect 17 0 1 0; #X connect 18 0 13 1; #X connect 19 0 14 1; #X connect 20 0 18 0; #X connect 20 1 19 0; #X connect 21 0 20 0; #X connect 22 0 20 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/mavg.pd000066400000000000000000000020141265051730400227340ustar00rootroot00000000000000#N canvas 0 354 450 482 10; #X obj 80 235 inlet; #X obj 80 334 outlet; #X obj 330 94 inlet taps; #X obj 80 274 list split \$1; #X obj 80 296 t l l; #X obj 80 254 list append; #X obj 80 315 mean; #X obj 261 95 loadbang; #X obj 261 115 i \$1; #X obj 261 141 t f f; #X obj 286 211 list append; #X obj 286 227 t l l; #X obj 286 177 until; #X obj 286 161 t f b; #X msg 324 195 list; #X obj 286 194 i; #X text 59 20 part of zexy; #X text 58 35 (c) 2006 IOhannes m zmoelnig; #X text 55 -19 moving average filter; #X text 62 73 requires pd>0.39; #X text 38 386 attention: not yet fully compatible with the zexy-external [mavg]; #X connect 0 0 5 0; #X connect 2 0 9 0; #X connect 3 0 4 0; #X connect 3 2 4 0; #X connect 4 0 6 0; #X connect 4 1 5 1; #X connect 5 0 3 0; #X connect 6 0 1 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 3 1; #X connect 9 1 13 0; #X connect 10 0 11 0; #X connect 11 0 5 1; #X connect 11 1 10 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 14 0; #X connect 14 0 10 1; #X connect 15 0 10 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/mean-help.pd000066400000000000000000000004651265051730400236600ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/mean.pd000066400000000000000000000006311265051730400227250ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/minmax.pd000066400000000000000000000016401265051730400232770ustar00rootroot00000000000000#N canvas 127 55 450 449 10; #X obj 40 27 inlet; #X obj 43 269 outlet min; #X obj 160 269 outlet max; #X obj 62 142 list split 1; #X obj 62 100 until; #X obj 62 121 list append; #X obj 153 163 bang; #X obj 62 169 t f f; #X obj 62 216 t f f; #X obj 43 237 f; #X obj 179 195 max; #X obj 179 216 t f f; #X obj 160 237 f; #X obj 62 195 min; #X obj 10 185 t b b; #X obj 40 69 t b b l f; #X obj 226 165 t f f; #X connect 0 0 15 0; #X connect 3 0 7 0; #X connect 3 1 5 1; #X connect 3 2 6 0; #X connect 4 0 5 0; #X connect 5 0 3 0; #X connect 6 0 4 1; #X connect 7 0 13 0; #X connect 7 1 10 0; #X connect 8 0 9 1; #X connect 8 1 13 1; #X connect 9 0 1 0; #X connect 10 0 11 0; #X connect 11 0 12 1; #X connect 11 1 10 1; #X connect 12 0 2 0; #X connect 13 0 8 0; #X connect 14 0 9 0; #X connect 14 1 12 0; #X connect 15 0 14 0; #X connect 15 1 4 0; #X connect 15 2 5 1; #X connect 15 3 16 0; #X connect 16 0 8 0; #X connect 16 1 11 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/nop-help.pd000066400000000000000000000010201265051730400235200ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/nop.pd000066400000000000000000000002321265051730400225760ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/nop~-help.pd000066400000000000000000000005661265051730400237340ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/nop~.pd000066400000000000000000000007251265051730400230030ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/pol2cart-help.pd000066400000000000000000000013031265051730400244560ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/pol2cart.pd000066400000000000000000000015061265051730400235350ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/pol2sph-help.pd000066400000000000000000000013041265051730400243200ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/pol2sph.pd000066400000000000000000000022261265051730400233760ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/polyfun-help.pd000066400000000000000000000012241265051730400244260ustar00rootroot00000000000000#N canvas 137 170 448 308 10; #X text 338 10 part of zexy; #X text 122 40 calculate a polynomial function; #X text 289 279 updated for zexy-2.1; #X floatatom 45 164 0 0 0 0 x - -; #X floatatom 45 264 0 0 0 0 y - -; #X msg 89 189 1 2; #X text 128 190 y=2x+1; #X msg 110 214 3 0 -1; #X text 166 215 y=3-x^2; #X text 32 80 on the right inlet you give the coefficients (a0..aN) of the polynomial function: y=a0+a1*x+a2*x^2+...+aN*x^N; #X text 33 109 the length of the coefficient list determines the order of the polynomial function.; #X obj 60 39 polyfun; #X obj 45 238 polyfun; #X connect 3 0 12 0; #X connect 5 0 12 1; #X connect 7 0 12 1; #X connect 12 0 4 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/polyfun.pd000066400000000000000000000036351265051730400235100ustar00rootroot00000000000000#N canvas 532 58 492 526 10; #X obj 97 112 inlet x; #X obj 97 437 outlet y=a0+a1*x+a2*x^2+a3*x^3+...; #X obj 97 415 f; #X obj 119 335 +; #X obj 119 302 * 1; #X obj 97 133 t b b f; #X obj 119 195 t l f; #X obj 199 111 inlet coefficients; #X obj 119 173 list; #X text 36 29 the right inlet takes the coefficients a0...aN \; whenever a value 'x' appears on the left inlet \, 'y' is calculated by:; #X text 96 68 y=a0+a1*x+a2*x^2+...+aN*x^N; #X text 93 14 polynomial function of order N; #X text 11 86 N is determined at execution time (depending on length of coeff-list).; #N canvas 0 0 543 426 repack 0; #X obj 158 194 list split 1; #X obj 158 284 list; #X obj 158 305 route list float; #X obj 211 331 t l; #X obj 119 126 list split 1; #X obj 188 241 outlet; #X obj 119 65 inlet; #X text 137 110 discard the 1st element (it is extracted outside); #X obj 158 218 t b f; #X connect 0 0 8 0; #X connect 0 1 1 1; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 1 3 0; #X connect 3 0 0 0; #X connect 4 1 0 0; #X connect 6 0 4 0; #X connect 8 0 1 0; #X connect 8 1 5 0; #X restore 119 220 pd repack 1; #N canvas 0 0 450 300 x^n 0; #X obj 158 203 * 1; #X obj 158 225 t f f; #X obj 158 182 f; #X msg 204 178 1; #X obj 174 157 t f b; #X obj 158 123 inlet bang; #X obj 249 123 inlet x; #X obj 158 250 outlet; #X connect 0 0 1 0; #X connect 1 0 7 0; #X connect 1 1 0 1; #X connect 2 0 0 0; #X connect 3 0 0 1; #X connect 4 0 2 1; #X connect 4 1 3 0; #X connect 5 0 2 0; #X connect 6 0 4 0; #X restore 149 273 pd x^n; #X obj 119 249 t f b; #X text 148 314 an*x^n; #X text 147 349 sum; #X obj 119 382 t f f; #X connect 0 0 5 0; #X connect 2 0 1 0; #X connect 3 0 18 0; #X connect 4 0 3 0; #X connect 5 0 2 0; #X connect 5 1 8 0; #X connect 5 2 14 1; #X connect 6 0 13 0; #X connect 6 1 3 1; #X connect 7 0 8 1; #X connect 8 0 6 0; #X connect 13 0 15 0; #X connect 14 0 4 1; #X connect 15 0 4 0; #X connect 15 1 14 0; #X connect 18 0 2 1; #X connect 18 1 3 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/rad2deg-help.pd000066400000000000000000000014441265051730400242460ustar00rootroot00000000000000#N canvas 421 168 450 300 10; #X floatatom 76 167 5 0 0 0 - - -; #X floatatom 76 86 5 0 0 0 - - -; #X obj 116 225 -; #X floatatom 132 176 5 0 0 0 - - -; #X obj 76 110 t f f; #X floatatom 116 257 16 0 0 0 - - -; #X floatatom 317 155 5 0 0 0 - - -; #X floatatom 317 217 5 0 0 0 - - -; #X text 317 129 example:; #X obj 76 138 rad2deg; #X obj 132 129 * 180; #X obj 132 153 / 3.14159; #X obj 60 39 rad2deg; #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; #X connect 3 0 2 1; #X connect 4 0 9 0; #X connect 4 1 10 0; #X connect 6 0 14 0; #X connect 9 0 0 0; #X connect 10 0 11 0; #X connect 11 0 3 0; #X connect 14 0 15 0; #X connect 15 0 7 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/rad2deg.pd000066400000000000000000000007541265051730400233230ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/repack.pd000066400000000000000000000032401265051730400232510ustar00rootroot00000000000000#N canvas 95 448 450 362 10; #X obj 38 162 inlet; #X obj 93 333 outlet; #X obj 319 211 inlet; #X obj 93 294 list append; #X obj 93 253 until; #X obj 93 230 t b a; #X obj 93 312 list split \$1; #X obj 154 276 list prepend; #X obj 166 330 t b l; #X obj 248 232 i \$1; #X obj 248 213 loadbang; #X obj 248 250 moses 1; #X msg 248 268 2; #X text 29 15 (re)packs (packages of) floats/symbols/pointers/anythings to packages of a (given) size; #X text 57 86 (c) 2006 IOhannes m zmoelnig \, IEM; #X text 58 106 part of zexy; #X obj 38 202 route bang; #X obj 38 267 list; #X obj 38 285 t l b; #X text 34 52 note: this is not yet fully compatible with zexy's binary [repack]; #N canvas 0 0 450 300 warning 0; #X obj 28 95 loadbang; #X obj 28 239 print warning; #X msg 28 222 [repack] abstraction not fully compatible with zexy's repack; #X text 57 66 LATER: think about saying this only once; #X obj 28 117 value repack_warning_instance=counter_long_name_to_make_it_less-likely:to-already-exist ; #X obj 28 161 t f f; #X obj 28 204 select 0; #X obj 53 179 + 1; #X connect 0 0 4 0; #X connect 2 0 1 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 4 0; #X restore 338 156 pd warning; #X connect 0 0 16 0; #X connect 2 0 9 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 5 1 7 0; #X connect 6 0 1 0; #X connect 6 1 3 1; #X connect 6 2 8 0; #X connect 7 0 3 1; #X connect 8 0 4 1; #X connect 8 1 7 1; #X connect 8 1 17 1; #X connect 9 0 11 0; #X connect 10 0 9 0; #X connect 11 0 12 0; #X connect 11 1 6 1; #X connect 12 0 6 1; #X connect 16 0 17 0; #X connect 16 1 5 0; #X connect 17 0 18 0; #X connect 18 0 1 0; #X connect 18 1 8 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/segregate-help.pd000066400000000000000000000017211265051730400247020ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/segregate.pd000066400000000000000000000011461265051730400237550ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sgn~-help.pd000066400000000000000000000013661265051730400237260ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sgn~.pd000066400000000000000000000007001265051730400227670ustar00rootroot00000000000000#N canvas 86 70 450 300 10; #X obj 30 88 inlet~; #X obj 30 186 outlet~; #X text 33 209 using [expr~] is slower than doing it in C...; #X text 319 21 part of zexy; #X text 36 44 [sgn~]; #X text 33 227 therefore we _also_ provide [sgn~] as external.; #X obj 71 124 <~ 0; #X obj 70 148 *~ -1; #X text 250 261 updated for zexy-2.1; #X obj 31 124 >~ 0; #X connect 0 0 6 0; #X connect 0 0 9 0; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 9 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sph2cart-help.pd000066400000000000000000000013231265051730400244600ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sph2cart.pd000066400000000000000000000023361265051730400235370ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sph2pol-help.pd000066400000000000000000000013201265051730400243160ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sph2pol.pd000066400000000000000000000017461265051730400234040ustar00rootroot00000000000000#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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/sum.pd000066400000000000000000000013421265051730400226110ustar00rootroot00000000000000#N canvas 300 91 450 300 10; #X obj 43 29 inlet; #X obj 46 229 outlet; #X obj 59 103 list split 1; #X obj 59 67 until; #X obj 59 85 list append; #X obj 126 120 bang; #X obj 59 138 route float; #X obj 59 171 +; #X obj 59 188 t f f; #X obj 46 206 f; #X msg 92 154 0; #X obj 43 48 t b b l b; #X text 289 21 part of zexy; #X text 37 11 sum up a list of floats; #X text 212 87 requires pd>=0.39; #X connect 0 0 11 0; #X connect 2 0 6 0; #X connect 2 1 4 1; #X connect 2 2 5 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 5 0 3 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 1; #X connect 8 1 7 1; #X connect 9 0 1 0; #X connect 10 0 8 0; #X connect 11 0 9 0; #X connect 11 1 3 0; #X connect 11 2 4 1; #X connect 11 3 10 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/tabset.pd000066400000000000000000000012171265051730400232700ustar00rootroot00000000000000#N canvas 205 66 450 337 10; #X obj 57 67 inlet; #X obj 142 109 list prepend 0; #X obj 142 275 s; #X obj 57 84 route set float; #X obj 179 254 symbol \$1; #X obj 228 234 symbol; #X msg 99 183 const \$1; #X obj 142 209 t a b b; #X msg 160 227 const 0; #X text 48 317 (c) 2007 IOhannes m zmoelnig@iem.at; #X text 215 53 part of zexy; #X text 59 12 set the contents of a table via list; #X text 61 29 (legacy object); #X connect 0 0 3 0; #X connect 1 0 7 0; #X connect 3 0 5 0; #X connect 3 1 6 0; #X connect 3 2 1 0; #X connect 4 0 2 1; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X connect 7 1 8 0; #X connect 7 2 4 0; #X connect 8 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/uniqsym-help.pd000066400000000000000000000017071265051730400244450ustar00rootroot00000000000000#N canvas 145 -43 722 431 10; #X text 564 24 part of zexy; #X text 97 30 remove duplicate symbols from a list or a stream; #X obj 45 268 uniqsym; #X obj 35 29 uniqsym; #X obj 45 302 print uniq; #X msg 73 165 bang; #X msg 45 87 reset; #X text 39 69 clear the current list of values; #X text 57 110 add symbols to the list of values; #X text 76 149 remove duplicate values \, sort the entire list and output it; #X msg 56 126 symbol trigger \, symbol pang \, symbol pang; #X msg 100 188 list chitty chitty pang pang; #X msg 117 243 mode \$1; #X obj 117 223 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X text 187 244 output as list (0=default) \, or as stream of single symbols (1); #X text 529 411 updated for zexy-2.2; #X obj 44 369 uniqsym 1; #X text 131 368 you can specify the mode with a creation argument; #X connect 2 0 4 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 10 0 2 0; #X connect 11 0 2 0; #X connect 12 0 2 0; #X connect 13 0 12 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/abs/uniqsym.pd000066400000000000000000000054111265051730400235130ustar00rootroot00000000000000#N canvas 144 0 541 589 10; #X obj 26 104 inlet; #X obj 123 178 symbol; #X msg 26 246 compact \, sort \, bang \, dump; #X msg 123 199 add \$1; #X msg 74 269 reset; #X obj 26 219 t b; #X obj 26 322 index; #X obj 26 294 nop; #X obj 26 537 outlet; #X obj 74 221 t b; #X text 21 11 filter out duplicate names; #X text 21 37 any symbol that comes in \, gets added to a list of symbols. ; #X text 20 51 when "bang" is received \, the symbols are output as a sorted list with uniqs removed.; #X text 22 79 "reset" cleans the entire list; #X obj 26 345 route list float; #X text 403 156 part of zexy; #X obj 245 202 repack 1; #X obj 220 177 t b l b; #X obj 79 468 spigot; #X obj 26 468 spigot; #X obj 122 447 == 0; #X obj 87 427 t f f; #X obj 79 497 repack; #N canvas 0 0 653 431 LICENSE 0; #X text 195 60 forum::fuer::umlaeute; #X text 195 79 institute of electronic music and acoustics \, IEM; #X text 197 95 university of music and dramatic arts \, graz \, austria ; #X text 19 165 This program is free software \; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation \; either version 2 of the License \, or (at your option) any later version.; #X text 19 246 This program is distributed in the hope that it will be useful \, but WITHOUT ANY WARRANTY \; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.; #X text 20 326 You should have received a copy of the GNU General Public License along with this program \; if not \, write to the Free Software Foundation \, Inc. \, 51 Franklin St \, Fifth Floor \, Boston \, MA 02110-1301 USA; #X text 17 42 copyright (C) 2006 IOhannes m zmoelnig; #X text 175 118 zmoelnig iem.at; #X text 239 117 @; #X restore 405 180 pd LICENSE; #X obj 220 154 list; #X floatatom 140 431 5 0 0 0 - - -; #X obj 87 407 i \$1; #X obj 26 366 symbol; #X obj 26 387 t s b; #X obj 26 446 t s s; #X obj 26 127 route bang reset add symbol list mode; #X obj 268 152 t f; #X connect 0 0 30 0; #X connect 1 0 3 0; #X connect 2 0 7 0; #X connect 3 0 7 0; #X connect 4 0 7 0; #X connect 5 0 2 0; #X connect 6 0 14 0; #X connect 7 0 6 0; #X connect 9 0 4 0; #X connect 14 0 27 0; #X connect 14 1 22 1; #X connect 16 0 1 0; #X connect 17 0 5 0; #X connect 17 1 16 0; #X connect 17 2 4 0; #X connect 18 0 22 0; #X connect 19 0 8 0; #X connect 20 0 18 1; #X connect 21 0 19 1; #X connect 21 1 20 0; #X connect 22 0 8 0; #X connect 24 0 17 0; #X connect 26 0 21 0; #X connect 26 0 25 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X connect 28 1 26 0; #X connect 29 0 19 0; #X connect 29 1 18 0; #X connect 30 0 5 0; #X connect 30 1 9 0; #X connect 30 2 1 0; #X connect 30 3 1 0; #X connect 30 4 24 0; #X connect 30 5 31 0; #X connect 31 0 26 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/autogen.sh000077500000000000000000000066461265051730400227300ustar00rootroot00000000000000#!/bin/sh package=zexy KERN=$(uname -s) case "${KERN}" in Darwin) PATH=/sw/bin:${PATH} ;; *) ;; esac echo PATH: $PATH AUTORECONF=$(which autoreconf) AUTOHEADER=$(which autoheader) AUTOMAKE=$(which automake) ACLOCAL=$(which aclocal) LIBTOOL=$(which libtool) LIBTOOLIZE=$(which libtoolize) AUTOCONF=$(which autoconf) case "${KERN}" in MINGW*) AUTORECONF="" ;; *) ;; esac #check whether the system supports pushd/popd if pushd . > /dev/null 2>&1 then popd > /dev/null 2>&1 else ## some shells (namely dash) don't support pushd/popd ## here we provide some dummies pushd () { echo "ignoring pushd to $@" } popd () { echo "ignoring popd ..." } fi autoconf_getsubdirs () { if [ -e configure.ac ]; then cat configure.ac | sed -e 's|#.*$||' | grep AC_CONFIG_SUBDIRS | \ sed -e 's|^.*AC_CONFIG_SUBDIRS(\[\(.*\)\]).*$|\1|' fi } runit () { echo " $@" $@ } manual_autoreconf_doit () { echo faking autoreconf for $1 pushd $1 runit $ACLOCAL -I . -I $BASEDIR/m4 || exit 1 runit $LIBTOOLIZE --automake -c || exit 1 runit $AUTOCONF || exit 1 if test -e configure.ac && grep AC_CONFIG_HEADER configure.ac > /dev/null 2>&1; then runit $AUTOHEADER --force || exit 1 fi if [ -e Makefile.am ]; then runit $AUTOMAKE --add-missing -c || exit 1 fi popd } manual_autoreconf () { echo faking autoreconf.. BASEDIR=${0%/*} pushd $BASEDIR BASEDIR=$(pwd) popd if [ "x${SUBDIRS}" = "x" ]; then #SUBDIRS=autoconf_getsubdirs SUBDIRS="." fi # check for all the needed helpers DIE=0 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have autoconf installed to compile $package." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have automake installed to compile $package." echo "Download the appropriate package for your system," echo "or get the source from one of the GNU ftp sites" echo "listed in http://www.gnu.org/order/ftp.html" DIE=1 } ($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have aclocal installed to compile $package." echo "Download the appropriate package for your system," echo "or get the source from one of the GNU ftp sites" echo "listed in http://www.gnu.org/order/ftp.html" DIE=1 } ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed to compile $package." echo "Download the appropriate package for your system," echo "or get the source from one of the GNU ftp sites" echo "listed in http://www.gnu.org/order/ftp.html" DIE=1 } ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtoolize installed to compile $package." echo "Download the appropriate package for your system," echo "or get the source from one of the GNU ftp sites" echo "listed in http://www.gnu.org/order/ftp.html" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi for s in ${SUBDIRS}; do manual_autoreconf_doit ${BASEDIR}/${s} done } if test x$AUTORECONF != x; then echo running autoreconf ${AUTORECONF} $AUTORECONF --force --verbose --install else echo not running autoreconf... manual_autoreconf fi zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/000077500000000000000000000000001265051730400220125ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/Makefile.am000066400000000000000000000007701265051730400240520ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign EXTRA_DIST = \ autoconf/README.txt \ README.txt \ win-vs2003/zexy.sln \ win-vs2003/zexy.vcproj \ win-vs2008/zexy.sln \ win-vs2008/zexy.vcproj \ win-vs6/zexy.dsp \ win-vs6/zexy.dsw \ win-vs7.10/zexy.sln \ win-vs7.10/zexy.vcproj \ autoconf/README.txt \ Makefile.am \ README.txt \ win-vs2003/zexy.sln \ win-vs2003/zexy.vcproj \ win-vs2008/zexy.sln \ win-vs2008/zexy.vcproj \ win-vs6/zexy.dsp \ win-vs6/zexy.dsw \ win-vs7.10/zexy.sln \ win-vs7.10/zexy.vcproj zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/README.txt000066400000000000000000000012731265051730400235130ustar00rootroot00000000000000build-instructions for zexy =========================== autoconf/make ============= this is the preferred way to build zexy, if your system supports autoconf/make. such systems include: - linux / gcc - os-x / gcc - windows / mingw - windows / cygwin - freebsd - ... just go into the zexy/src/ directory, and run % make or alternatively: % aclocal % autoconf % ./configure % make use % ./configure --help to see flags you can pass to configure to get special builds Microsoft Visual Studio ======================= use the provided project-files in the directories win-nmake: for nmake based builds win-vs6: for Microsoft VisualStudio 6 win-vs2003: for Microsoft VisualStudio .NET 2003 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/autoconf/000077500000000000000000000000001265051730400236305ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/autoconf/README.txt000066400000000000000000000004041265051730400253240ustar00rootroot00000000000000the build/autoconf system is currently under revision; if it doesn't work, try the autoconf-system in /src/ instead GENERIC INSTALL INSTRUCTIONS ============================ run the following commands: ./autogen.sh ./configure make make install zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs2003/000077500000000000000000000000001265051730400235425ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs2003/zexy.sln000066400000000000000000000013421265051730400252570ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zexy", "zexy.vcproj", "{6B55773B-3FF5-4F09-B538-2A7007DEC4DB}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release.ActiveCfg = Release|Win32 {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs2003/zexy.vcproj000066400000000000000000000172211265051730400257710ustar00rootroot00000000000000 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs2008/000077500000000000000000000000001265051730400235475ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs2008/zexy.sln000066400000000000000000000012551265051730400252670ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zexy", "zexy.vcproj", "{6B55773B-3FF5-4F09-B538-2A7007DEC4DB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release|Win32.ActiveCfg = Release|Win32 {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs2008/zexy.vcproj000066400000000000000000000176121265051730400260020ustar00rootroot00000000000000 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs6/000077500000000000000000000000001265051730400233235ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs6/zexy.dsp000066400000000000000000000163631265051730400250430ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="zexy" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=ZEXY - WIN32 RELEASE !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "zexy.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "zexy.mak" CFG="ZEXY - WIN32 RELEASE" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "zexy - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 1 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "obj\" # 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 /Zp16 /W3 /GX /I "..\..\..\pd\src" /I "C:\Programme\pd\src" /D "__WIN32__" /D "ZEXY" /D "Z_WANT_LPT" /D "ZEXY_LIBRARY" /FR /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /win32 # SUBTRACT MTL /mktyplib203 # ADD BASE RSC /l 0xc07 /d "NDEBUG" # ADD RSC /l 0xc07 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib wsock32.lib uuid.lib libc.lib oldnames.lib pd.lib /nologo /dll /machine:I386 /nodefaultlib /out:"..\zexy.dll" /libpath:"../../bin" /libpath:"C:\Programme\pd\bin" /export:zexy_setup # SUBTRACT LINK32 /pdb:none # Begin Target # Name "zexy - Win32 Release" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\0x260x260x7e.c # End Source File # Begin Source File SOURCE=.\0x2e.c # End Source File # Begin Source File SOURCE=.\0x3c0x7e.c # End Source File # Begin Source File SOURCE=.\0x3d0x3d0x7e.c # End Source File # Begin Source File SOURCE=.\0x3e0x7e.c # End Source File # Begin Source File SOURCE=.\0x7c0x7c0x7e.c # End Source File # Begin Source File SOURCE=.\a2l.c # End Source File # Begin Source File SOURCE=.\absgn~.c # End Source File # Begin Source File SOURCE=.\abs~.c # End Source File # Begin Source File SOURCE=.\atoi.c # End Source File # Begin Source File SOURCE=.\avg~.c # End Source File # Begin Source File SOURCE=.\blockmirror~.c # End Source File # Begin Source File SOURCE=.\blockshuffle~.c # End Source File # Begin Source File SOURCE=.\blockswap~.c # End Source File # Begin Source File SOURCE=.\date.c # End Source File # Begin Source File SOURCE=.\demultiplex.c # End Source File # Begin Source File SOURCE=.\demultiplex~.c # End Source File # Begin Source File SOURCE=.\dfreq~.c # End Source File # Begin Source File SOURCE=.\dirac~.c # End Source File # Begin Source File SOURCE=.\drip.c # End Source File # Begin Source File SOURCE=.\envrms~.c # End Source File # Begin Source File SOURCE=.\fifop.c # End Source File # Begin Source File SOURCE=.\freadln.c # End Source File # Begin Source File SOURCE=.\fwriteln.c # End Source File # Begin Source File SOURCE=.\glue.c # End Source File # Begin Source File SOURCE=.\index.c # End Source File # Begin Source File SOURCE=.\length.c # End Source File # Begin Source File SOURCE=.\lifop.c # End Source File # Begin Source File SOURCE=.\limiter~.c # End Source File # Begin Source File SOURCE=.\list2int.c # End Source File # Begin Source File SOURCE=.\list2lists.c # End Source File # Begin Source File SOURCE=.\list2symbol.c # End Source File # Begin Source File SOURCE=.\lister.c # End Source File # Begin Source File SOURCE=.\listfind.c # End Source File # Begin Source File SOURCE=.\lpt.c # End Source File # Begin Source File SOURCE=.\makesymbol.c # End Source File # Begin Source File SOURCE=.\matchbox.c # End Source File # Begin Source File SOURCE=.\mavg.c # End Source File # Begin Source File SOURCE=.\minmax.c # End Source File # Begin Source File SOURCE=.\msgfile.c # End Source File # Begin Source File SOURCE=.\multiline~.c # End Source File # Begin Source File SOURCE=.\multiplex.c # End Source File # Begin Source File SOURCE=.\multiplex~.c # End Source File # Begin Source File SOURCE=.\niagara.c # End Source File # Begin Source File SOURCE=.\noish~.c # End Source File # Begin Source File SOURCE=.\noisi~.c # End Source File # Begin Source File SOURCE=.\operating_system.c # End Source File # Begin Source File SOURCE=.\pack.c # End Source File # Begin Source File SOURCE=.\packel.c # End Source File # Begin Source File SOURCE=.\pack~.c # End Source File # Begin Source File SOURCE=.\pdf~.c # End Source File # Begin Source File SOURCE=.\prime.c # End Source File # Begin Source File SOURCE=.\quantize~.c # End Source File # Begin Source File SOURCE=.\regex.c # End Source File # Begin Source File SOURCE=.\relay.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=.\sgn~.c # End Source File # Begin Source File SOURCE=.\sigzero~.c # End Source File # Begin Source File SOURCE=.\sort.c # End Source File # Begin Source File SOURCE=.\step~.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=.\swap~.c # End Source File # Begin Source File SOURCE=.\symbol2list.c # End Source File # Begin Source File SOURCE=.\tabdump.c # End Source File # Begin Source File SOURCE=.\tabminmax.c # End Source File # Begin Source File SOURCE=.\tabread4~~.c # End Source File # Begin Source File SOURCE=.\tabset.c # End Source File # Begin Source File SOURCE=.\tavg~.c # End Source File # Begin Source File SOURCE=.\time.c # End Source File # Begin Source File SOURCE=.\unpack.c # End Source File # Begin Source File SOURCE=.\unpack~.c # End Source File # Begin Source File SOURCE=.\urn.c # End Source File # Begin Source File SOURCE=.\winNT_portio.c # End Source File # Begin Source File SOURCE=.\wrap.c # End Source File # Begin Source File SOURCE=.\z_zexy.c # End Source File # Begin Source File SOURCE=.\zexy.c # End Source File # Begin Source File SOURCE=.\z~.c # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\src\m_pd.h # End Source File # Begin Source File 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 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs6/zexy.dsw000066400000000000000000000010571265051730400250440ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "zexy"=.\zexy.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs7.10/000077500000000000000000000000001265051730400235435ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs7.10/zexy.sln000066400000000000000000000013201265051730400252540ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zexy", "zexy.vcproj", "{D6D6C3DC-5B5B-452F-9953-2B37FAC07F2A}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {D6D6C3DC-5B5B-452F-9953-2B37FAC07F2A}.Release.ActiveCfg = Release|Win32 {D6D6C3DC-5B5B-452F-9953-2B37FAC07F2A}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/build/win-vs7.10/zexy.vcproj000066400000000000000000000615221265051730400257750ustar00rootroot00000000000000 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/configure.ac000066400000000000000000000110751265051730400232050ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.60]) AC_INIT([zexy], [2.2.6], [zmoelnig@iem.at], [zexy], [https://git.iem.at/pd/zexy]) AM_INIT_AUTOMAKE([1.10 foreign]) m4_ifdef([LT_INIT], [LT_INIT([disable-static win32-dll])], [AC_ENABLE_SHARED AC_DISABLE_STATIC AC_LIBTOOL_WIN32_DLL]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile src/Makefile abs/Makefile reference/Makefile]) AC_CONFIG_FILES([tests/Makefile build/Makefile]) AC_CONFIG_FILES([zexy-meta.pd]) AC_CONFIG_SRCDIR([src/zexy.c]) IEM_OPERATING_SYSTEM ARCH=$(uname -m) KERN=$(uname -s) dnl m4_ifdef([AC_LIB_RPATH], [AC_LIB_RPATH]) dnl Checks for programs. AC_PROG_CC AC_PROG_LN_S AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_ARG_WITH([pd], [ --with-pd= where to look for pd-headers and and -libs]) AC_ARG_WITH([extension],[ --with-extension= enforce a certain extension for the dynamic library (e.g. dll)]) AC_ARG_ENABLE([library],[ --enable-library build zexy as multi-object library (default, "yes"), as single-object externals ("no") or as both ("both")]) AM_CONDITIONAL([LIBRARY], [test "x${enable_library}" != "xno"]) AM_CONDITIONAL([SINGLEOBJECTS], [test "x${enable_library}" = "xno" || test "x${enable_library}" = "xboth"]) ## override build-date AC_ARG_WITH([build-date], AC_HELP_STRING([--with-build-date=], [alternative date string])) AC_MSG_CHECKING([build-date]) AS_IF([test "x$with_build_date" = "xyes" ],[with_build_date=""]) AS_IF([test "x$with_build_date" = "xno" ],[with_build_date=""]) AS_IF([test "x$with_build_date" != "x" ],[ AC_DEFINE_UNQUOTED([BUILD_DATE], ["$with_build_date"], [user-defined build-date string])]) ## urgh, brackets need to be escaped with @<:@ and @:>@... AS_IF([test "x$with_build_date" != "x" ],[ with_build_date="@<:@default@:>@" ]) AC_MSG_RESULT([$with_build_date]) if test "x${libdir}" = "x\${exec_prefix}/lib"; then libdir='${exec_prefix}/lib/pd/extra' fi if test "x$with_pd" != "x"; then if test -d "${with_pd}"; then PDPATH=${with_pd} fi if test -d "${PDPATH}/src"; then AC_MSG_RESULT([adding ${PDPATH}/src to INCLUDES]) CPPFLAGS="-I${PDPATH}/src ${CPPFLAGS}" AC_MSG_RESULT([adding ${PDPATH}/src to LDFLAGS]) LDFLAGS="-L${PDPATH}/src ${LDFLAGS}" else if test -d "${PDPATH}"; then AC_MSG_RESULT([adding ${PDPATH} to INCLUDES]) CPPFLAGS="-I${PDPATH} ${CPPFLAGS}" fi fi if test -d "${PDPATH}/bin"; then AC_MSG_RESULT([adding ${PDPATH}/bin to LDFLAGS]) LDFLAGS="-L${PDPATH}/bin ${LDFLAGS}" else if test -d "${PDPATH}"; then AC_MSG_RESULT([adding ${PDPATH} to LDFLAGS]) LDFLAGS="-L${PDPATH} ${LDFLAGS}" fi fi fi dnl Checks for libraries. dnl Replace `main' with a function in -lc: AC_CHECK_LIB([c], [main]) AC_CHECK_LIB([crtdll], [fclose]) AC_CHECK_LIB([coldname], [lseek]) AC_CHECK_LIB([kernel32], [main]) AC_CHECK_LIB([user32], [main]) AC_CHECK_LIB([gdi32], [main]) dnl Replace `main' with a function in -lm: AC_CHECK_LIB([m], [main]) dnl Replace `main' with a function in -lpthread: dnl AC_CHECK_LIB([pthread], [main]) dnl Replace `main' with a function in -lstk: dnl AC_CHECK_LIB([stk], [main], [STK=yes]) tmp_pddll_LIBS=$LIBS AC_CHECK_LIB([:pd.dll], [nullfn], have_pddll="yes", have_pddll="no") LIBS=$tmp_pddll_LIBS if test "x$have_pddll" = "xyes" then EXTRA_LTFLAGS="$EXTRA_LTFLAGS -Xlinker -l:pd.dll" else AC_CHECK_LIB([pd], [nullfn]) fi AC_CHECK_LIB([regex], [regcomp]) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h stdio.h string.h math.h time.h sys/time.h regex.h alloca.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME dnl Checks for library functions. AC_FUNC_MMAP AC_CHECK_FUNCS([select socket strerror]) IEM_CHECK_FAT(ARCH_FLAG) IEM_CHECK_CFLAGS([-mms-bitfields]) IEM_CHECK_SIMD IEM_CHECK_LPT AC_MSG_CHECKING([extension]) if test "x$with_extension" != "x" then EXTENSION=$with_extension else case "$KERN" in Darwin) EXTENSION=pd_darwin ;; Linux) EXTENSION=pd_linux ;; IRIX64) EXTENSION=pd_irix6 ;; IRIX32) EXTENSION=pd_irix5 ;; IRIX64) EXTENSION=pd_irix6 ;; *CYGWIN*) EXTENSION=dll ;; *MINGW*) EXTENSION=dll ;; *) EXTENSION=pd_linux ;; esac fi AC_MSG_RESULT([$EXTENSION]) have_pd="no" AC_CHECK_HEADERS([pd/m_pd.h m_pd.h], [have_pd="yes"]) if test "x${have_pd}" = "xno" then AC_ERROR([m_pd.h is desperately needed! install pd and/or use "--with-pd="]) fi AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(DEFS) AC_SUBST(ARCH_FLAG) AC_SUBST([LIBTOOL_DEPS]) AC_SUBST([EXTRA_LTFLAGS]) AC_SUBST(EXTENSION) AC_OUTPUT() zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/examples/000077500000000000000000000000001265051730400225315ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/examples/README.txt000066400000000000000000000002761265051730400242340ustar00rootroot00000000000000here you (will) find example patches on how to make use of zexy objects. the reference-patches (aka help-patches) have been moved to ../reference mfg.asdr IOhannes - zmoelnig at iem dot at zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/m4/000077500000000000000000000000001265051730400212335ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/m4/iem_checkflags.m4000066400000000000000000000056421265051730400244300ustar00rootroot00000000000000dnl Copyright (C) 2005-2011 IOhannes m zmölnig dnl This file is free software; IOhannes m zmölnig dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # IEM_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(C) compiler accepts the ADDITIONAL-CPPFLAGS # if so, they are added to the CPPFLAGS AC_DEFUN([IEM_CHECK_CPPFLAGS], [ AC_MSG_CHECKING([whether $CPP accepts "$1"]) temp_check_cppflags="${CPPFLAGS}" CPPFLAGS="$1 ${CPPFLAGS}" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([[int main(void){return 0;}]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); CPPFLAGS="${temp_check_cppflags}"]) ])# IEM_CHECK_CPPFLAGS # IEM_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS # if so, they are added to the CFLAGS AC_DEFUN([IEM_CHECK_CFLAGS], [ AC_MSG_CHECKING([whether $CC accepts "$1"]) cat > conftest.c << EOF int main(){ return 0; } EOF if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1 then AC_MSG_RESULT([yes]) CFLAGS="${CFLAGS} [$1]" [$2] else AC_MSG_RESULT([no]) [$3] fi ])# IEM_CHECK_CFLAGS # IEM_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(CXX) (c++) compiler accepts the ADDITIONAL-CXXFLAGS # if so, they are added to the CXXFLAGS AC_DEFUN([IEM_CHECK_CXXFLAGS], [ AC_MSG_CHECKING([whether $CXX accepts "$1"]) cat > conftest.c++ << EOF int main(){ return 0; } EOF if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1 then AC_MSG_RESULT([yes]) CXXFLAGS="${CXXFLAGS} [$1]" [$2] else AC_MSG_RESULT([no]) [$3] fi ])# IEM_CHECK_CXXFLAGS # IEM_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # AC_DEFUN([IEM_CHECK_FRAMEWORK], [ AC_MSG_CHECKING([for "$1"-framework]) temp_check_ldflags_org="${LDFLAGS}" LDFLAGS="-framework [$1] ${LDFLAGS}" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) if test "x$temp_check_ldflags_success" = "xyes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) LDFLAGS="$temp_check_ldflags_org" [$3] fi ])# IEM_CHECK_FRAMEWORK # IEM_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(LD) linker accepts the ADDITIONAL-LDFLAGS # if so, they are added to the LDFLAGS AC_DEFUN([IEM_CHECK_LDFLAGS], [ AC_MSG_CHECKING([whether linker accepts "$1"]) temp_check_ldflags_org="${LDFLAGS}" LDFLAGS="$1 ${LDFLAGS}" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) if test "x$temp_check_ldflags_success" = "xyes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) LDFLAGS="$temp_check_ldflags_org" [$3] fi ])# IEM_CHECK_LDFLAGS zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/m4/iem_fat.m4000066400000000000000000000034651265051730400231110ustar00rootroot00000000000000dnl Copyright (C) 2005-2006 IOhannes m zmölnig dnl This file is free software; IOhannes m zmölnig dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([IEM_CHECK_FAT], [ AC_ARG_ENABLE(fat-binary, [ --enable-fat-binary=ARCHS build an Apple Multi Architecture Binary (MAB); ARCHS is a comma-delimited list of architectures for which to build; if ARCHS is omitted, then the package will be built for all architectures supported by the platform (e.g. "ppc,i386" for MacOS/X and Darwin; if this option is disabled or omitted entirely, then the package will be built only for the target platform], [fat_binary=$enableval], [fat_binary=no]) if test "$fat_binary" != no; then AC_MSG_CHECKING([target architectures]) # Respect TARGET_ARCHS setting from environment if available. if test -z "$TARGET_ARCHS"; then # Respect ARCH given to --enable-fat-binary if present. if test "$fat_binary" != yes; then TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '` else # Choose a default set of architectures based upon platform. TARGET_ARCHS="ppc i386" fi fi AC_MSG_RESULT([$TARGET_ARCHS]) define([Name],[translit([$1],[./-], [___])]) # /usr/lib/arch_tool -archify_list $TARGET_ARCHS []Name="" for archs in $TARGET_ARCHS do []Name="$[]Name -arch $archs" done if test "x$[]Name" != "x"; then IEM_CHECK_CFLAGS($[]Name,,[]Name="") IEM_CHECK_CXXFLAGS($[]Name,,[]Name="") IEM_CHECK_LDFLAGS($[]Name,,[]Name="") fi undefine([Name]) fi ])# IEM_CHECK_FAT zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/m4/iem_operatingsystem.m4000066400000000000000000000016741265051730400255740ustar00rootroot00000000000000dnl try to figure out the target operating system and set some AM-macros accordingly dnl dnl Copyright (C) 2011 IOhannes m zmölnig AC_DEFUN([IEM_OPERATING_SYSTEM], [ AC_CANONICAL_HOST LINUX=no ANDROID=no MACOSX=no IPHONEOS=no BSD=no WINDOWS=no MINGW=no CYGWIN=no HURD=no IRIX=no case $host_os in *linux*) LINUX=yes ;; *darwin*) MACOSX=yes ;; GNU/kFreeBSD) BSD=yes ;; *mingw*) WINDOWS=yes MINGW=yes ;; *cygwin*) WINDOWS=yes CYGWIN=yes ;; GNU) HURD=yes ;; esac AM_CONDITIONAL(LINUX, test x$LINUX = xyes) AM_CONDITIONAL(ANDROID, test x$ANDROID = xyes) AM_CONDITIONAL(MACOSX, test x$MACOSX = xyes) AM_CONDITIONAL(IPHONEOS, test x$IPHONEOS = xyes) AM_CONDITIONAL(BSD, test x$BSD = xyes) AM_CONDITIONAL(WINDOWS, test x$WINDOWS = xyes) AM_CONDITIONAL(CYGWIN, test x$MINGW = xyes) AM_CONDITIONAL(MINGW, test x$MINGW = xyes) AM_CONDITIONAL(HURD, test x$HURD = xyes) AM_CONDITIONAL(IRIX, test x$IRIX = xyes) ]) dnl IEM_OPERATING_SYSTEM zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/m4/iem_parallelport.m4000066400000000000000000000022621265051730400250320ustar00rootroot00000000000000dnl Copyright (C) 2005-2006 IOhannes m zmölnig dnl This file is free software; IOhannes m zmölnig dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([IEM_CHECK_LPT], [ dnl check for LPT AC_ARG_ENABLE(lpt, [ --enable-lpt enable parallelport-support]) if test "x" = "x${enable_lpt}" ; then enable_lpt="${with_lpt}" fi AC_CHECK_HEADERS(linux/ppdev.h, [ have_ppdev=" (with device-support)" ], [ have_ppdev="" ]) if test x"$enable_lpt" != "xno" then AC_MSG_CHECKING([parallel-port]) if test "x$enable_lpt" = "xyes" then # forced AC_DEFINE([Z_WANT_LPT], [1], [Define if you want parallelport support]) have_lpt="yes (forced)" else AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ ioperm(0x3bc, 8, 1); outb(0, 0x3bc); ioperm(0x3bc, 8, 0); ]])], [have_lpt="yes"], [have_lpt="no"]) fi fi if test "x$have_lpt" != "xno"; then AC_DEFINE([Z_WANT_LPT], [1], [Define if you want line printer support]) AC_MSG_RESULT([$have_lpt$have_ppdev]) else AC_MSG_RESULT([no]) fi AM_CONDITIONAL([LPT], [test "x${have_lpt}" != "xno"]) ]) dnl IEM_CHECK_LPT zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/m4/iem_simd.m4000066400000000000000000000020371265051730400232650ustar00rootroot00000000000000dnl Copyright (C) 2005-2006 IOhannes m zmölnig dnl This file is free software; IOhannes m zmölnig dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([IEM_CHECK_SIMD], [ AC_ARG_ENABLE(simd, [ --enable-simd=ARCHS enable SIMD optimization; valid arguments are: SSE2 ], [simd=$enableval], [simd=no]) if test "$simd" != no; then AC_MSG_CHECKING([SIMD optimization]) # Respect SIMD given to --enable-simd if present. if test "$simd" != yes; then SIMD=`echo "$simd" | tr ',' ' '` else # Choose a default set of architectures based upon platform. SIMD="SSE2" fi for smd in $SIMD do case "${smd}" in SSE2|sse2) AC_MSG_RESULT([SSE2]) IEM_CHECK_CFLAGS([-mfpmath=sse -msse]) IEM_CHECK_CXXFLAGS([-mfpmath=sse -msse]) ;; *) AC_MSG_RESULT([unknown SIMD instructions: ${smd}]) ;; esac done fi ])# IEM_CHECK_SIMD zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/pd-zexy.info000066400000000000000000000004431265051730400231710ustar00rootroot00000000000000Title Zexy for Pd Version MSP standard paths Description IOhannes m zmoelnig's zexy DefaultLocation /usr/local/lib DeleteWarning ### Package Flags NeedsAuthorization YES Required NO Relocatable YES RequiresReboot NO UseUserMask YES OverwritePermissions NO InstallFat NO RootVolumeOnly NO zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/000077500000000000000000000000001265051730400226515ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/0.INTRO.txt000066400000000000000000000074341265051730400244530ustar00rootroot00000000000000These are the objects that come with the zexy-external ============================ DSP~ =============================== ---------------------------- IO~ -------------------------------- sfplay play back (multi-channel) soundfiles sfrecord record (multichannel) soundfiles ------------------------ generators~ ---------------------------- dirac~ dirac-pulse step~ unity step noish~ downsampled noise (hold) noisi~ downsampled noise (interpolate) ------------------------ processing~ ---------------------------- limiter~ a limiter/compressor module quantize~ quantizes signals swap~ bytes swap a 16bit-signal blockmirror~ time-reverse a signal-vector (1,2,...,64 -> 64,63,...,1) blockswap~ swap the upper and lower half of a signal-vector z~ samplewise delay ------------------------- analytic~ ----------------------------- sigzero~ detects whether a signal is zero throughout the vector or not pdf~ probability density function envrms~ like env~, but outputting rms instead of dB avg~ arithmetic mean of 1 signal-vector tavg~ arithmetic mean between two bangs dfreq~ frequency detector ------------------------- sigbinops~ ---------------------------- >~, <~, ==~, &&~, ||~ logical operators abs~ absolute value of a signal sgn~ signum of a signal --------------------------- misc~ ------------------------------- nop~ no-operation pack~ convert a signal to a list of floats unpack~ convert a list of floats to a signal multiline~ multiply a number of signals with scalars (interpolated) multiplex~ multiplex 1-of-n inlets to 1 outlet demultiplex~ demultiplex 1 inlet to 1-of-n outlets ========================= control ============================== -------------------------- basic ------------------------------- nop no-operation repeat repeat a message several times lister store lists (like "float" for floats) repack (re)pack atoms to packages of a given size packel get a specified element of a list drip extract the atoms of a package (opt. scheduled) length get the length of a list niagara split 1 packages into 2 glue append a package to another (glue them together) segregate segregate the input to various outlets, depending on the type any2list convert "anythings" to "lists" list2int cast each float of a list to integer atoi ascii to integer strcmp compare lists as strings list2symbol convert a list into a single symbol symbol2list convert a symbol to a list fifop list FIFO with priorities lifop list LIFO with priorities ------------------------ advanced ------------------------------ tabdump dump out a table as a list of floats tabset set a table with a list of floats tabminman get minimum and maximum of a table makesymbol concatenate lists to formatted symbols date get system date time get system time index map symbols to indices msgfile a powerful "textfile" derivative freadln a simplified "textfile" derivative for reading line-wise fwriteln a simplified "textfile" derivative for writing line-wise demultiplex demultiplex the input to a specified outlet lpt write to the (parallel) port operating_system get the current OS -------------------------- maths -------------------------------- mavg moving average filter for floats mean get the mean value of a list of floats sum get the sum of a list of floats minmax get minimum and maximum of a list of floats sort shell-sort a list of floats urn unique random numbers prime test whether a number is prime or not wrap wrap the float-input between to boundaries . scalar multiplication of vectors (=lists of floats) deg2rad convert between degree and radiant rad2deg convert between radiant and degree cart2pol, pol2cart, cart2sph, sph2cart, pol2sph, sph2pol convert between coordinate systems (cartesian, polar, shperic) zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/Makefile.am000066400000000000000000000043671265051730400247170ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign SUFFIXES = .pd zexydir=$(pkglibdir) empty= dist_zexy_DATA= \ a2l-help.pd \ atoi-help.pd \ avg~-help.pd \ blockmirror~-help.pd \ blockswap~-help.pd \ coordinates-help.pd \ date-help.pd \ demultiplex~-help.pd \ demultiplex-help.pd \ dfreq~-help.pd \ digidistort-help.pd \ dirac~-help.pd \ drip-help.pd \ envrms~-help.pd \ fifop-help.pd \ freadln-help.pd \ fwriteln-help.pd \ glue-help.pd \ index-help.pd \ length-help.pd \ lifop-help.pd \ limiter~-help.pd \ list2int-help.pd \ list2lists-help.pd \ list2symbol-help.pd \ lister-help.pd \ listfind-help.pd \ lpt-help.pd \ makesymbol-help.pd \ matchbox-help.pd \ mavg-help.pd \ minmax-help.pd \ msgfile-help.pd \ multiline~-help.pd \ multiplex~-help.pd \ multiplex-help.pd \ niagara-help.pd \ noish~-help.pd \ noisi~-help.pd \ operating_system-help.pd \ packel-help.pd \ pack~-help.pd \ pack-help.pd \ pdf~-help.pd \ prime-help.pd \ quantize~-help.pd \ rawprint-help.pd \ regex-help-help.pd \ regex-help.pd \ relay-help.pd \ repack-help.pd \ repeat-help.pd \ route~-help.pd \ scalarmult-help.pd \ sf-play_record-help.pd \ sigzero~-help.pd \ sort-help.pd \ step~-help.pd \ strcmp-help.pd \ sum-help.pd \ swap~-help.pd \ symbol2list-help.pd \ tabdump-help.pd \ tabminmax-help.pd \ tabset-help.pd \ tavg~-help.pd \ time-help.pd \ unpack~-help.pd \ unpack-help.pd \ urn-help.pd \ wrap-help.pd \ z~-help.pd \ zigbinops-help.pd \ $(empty) ############# # symlinks for aliases zexyaliasdir=$(pkglibdir) clean-local: clean_zexyalias .PHONY: clean_zexyalias dist_zexyalias_DATA= \ unfold-help.pd \ mux-help.pd \ demux~-help.pd \ l2i-help.pd \ l2s-help.pd \ any2list-help.pd \ lp-help.pd \ demux-help.pd \ l-help.pd \ mux~-help.pd \ s2l-help.pd # create aliases $(dist_zexyalias_DATA): test -e $< && $(LN_S) $< $@ # delete aliases clean_zexyalias: -rm -f $(dist_zexyalias_DATA) # define aliases any2list-help.pd: a2l-help.pd demux~-help.pd: demultiplex~-help.pd demux-help.pd: demultiplex-help.pd l2i-help.pd: list2int-help.pd l2s-help.pd: list2symbol-help.pd l-help.pd: lister-help.pd lp-help.pd: lpt-help.pd mux~-help.pd: multiplex~-help.pd mux-help.pd: multiplex-help.pd s2l-help.pd: symbol2list-help.pd unfold-help.pd: drip-help.pd zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/a2l-help.pd000066400000000000000000000021021265051730400245750ustar00rootroot00000000000000#N canvas 0 31 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 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; #X text 48 337 to make "anything"s out of lists \, try; #X obj 319 339 route list; #X msg 319 318 list this is a list; #X obj 319 359 print l2a; #X text 245 223 alias; #X obj 286 223 a2l; #X obj 35 256 any2list; #X text 356 6 part of zexy; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control conversion deprecated; #X text 12 45 DESCRIPTION convert an anything to a list; #X text 12 65 INLET_0 anything; #X text 12 85 OUTLET_0 list; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X restore 401 437 pd META; #X obj 48 30 any2list; #X connect 2 0 13 0; #X connect 3 0 13 0; #X connect 4 0 13 0; #X connect 5 0 13 0; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 13 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/atof-help.pd000066400000000000000000000017521265051730400250620ustar00rootroot00000000000000#N canvas 533 119 615 317 10; #X floatatom 42 231 4 0 0 0 - - -; #X symbolatom 42 155 10 0 0 0 - - -; #X text 509 17 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control conversion; #X text 12 45 DESCRIPTION convert ascii to integer; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 65 INLET_0 symbol; #X text 12 85 OUTLET_0 float; #X restore 565 297 pd META; #X obj 42 102 makefilename %g; #X obj 42 178 atof; #X symbolatom 79 201 10 0 0 1 reject - -; #X text 146 19 convert ascii to floats; #X obj 94 21 atof; #X text 328 286 updated for zexy-2.2.7; #X obj 45 64 hsl 128 15 0 2 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 8900 1; #X floatatom 42 84 5 0 0 0 - - -; #X msg 76 129 symbol foo; #X connect 1 0 5 0; #X connect 4 0 1 0; #X connect 5 0 0 0; #X connect 5 1 6 0; #X connect 10 0 11 0; #X connect 11 0 4 0; #X connect 12 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/atoi-help.pd000066400000000000000000000035251265051730400250650ustar00rootroot00000000000000#N canvas 4 49 615 317 10; #X obj 95 21 atoi; #X text 144 19 convert ascii to integer; #X obj 42 178 atoi; #X floatatom 42 201 4 0 0 0 - - -; #X obj 42 132 makefilename %4d; #X symbolatom 42 155 10 0 0 0 - - -; #X floatatom 42 110 4 0 0 0 - - -; #X floatatom 147 110 4 0 0 0 - - -; #X obj 147 132 makefilename 0%d; #X floatatom 250 110 4 0 0 0 - - -; #X obj 250 132 makefilename 0x%d; #X text 44 92 decimal; #X text 148 94 octal; #X text 250 93 sedecimal; #X floatatom 387 109 4 0 0 0 - - -; #X obj 387 127 makefilename %d; #X floatatom 472 106 4 0 0 0 - - -; #X text 476 93 base; #X obj 387 146 pack s 2; #X msg 387 86 101; #X msg 413 86 10011; #X text 211 194 symbols starting with "0x" are converted as hex-numbers ; #X text 212 208 symbols starting with "0" are converted as octal numbers ; #X text 211 223 symbols starting with numbers but "0" are converted as decimal numbers; #X text 509 17 part of zexy; #N canvas 517 185 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control conversion; #X text 12 45 DESCRIPTION convert ascii to integer; #X text 12 135 AUTHOR IOhannes m zmoelnig; #X text 12 65 INLET_0 symbol; #X text 12 85 OUTLET_0 float; #X text 12 102 OUTLET_1 symbol; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes and updated by IOhannes m zmölnig (for zexy-2.2.7); #X restore 565 297 pd META; #X symbolatom 63 228 10 0 0 3 reject - -; #X text 330 285 updated for zexy-2.2.7; #X text 213 254 if the symbol cannot be converted into a number \, it will be sent to the 2nd ("reject") outlet.; #X connect 2 0 3 0; #X connect 2 1 26 0; #X connect 4 0 5 0; #X connect 5 0 2 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 8 0 5 0; #X connect 9 0 10 0; #X connect 10 0 5 0; #X connect 14 0 15 0; #X connect 15 0 18 0; #X connect 16 0 18 1; #X connect 18 0 2 0; #X connect 19 0 14 0; #X connect 20 0 14 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/avg~-help.pd000066400000000000000000000020061265051730400250750ustar00rootroot00000000000000#N canvas 0 31 561 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 129 234 avg~; #X obj 59 233 env~; #X obj 315 296 envrms~; #X obj 59 173 osc~ 5512.5; #X text 456 11 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION calculate the arithmetic mean of one signal vector; #X text 12 5 KEYWORDS signal conversion; #X text 12 75 INLET_0 signal; #X text 12 95 OUTLET_0 float; #X restore 511 340 pd META; #X obj 71 51 avg~; #X text 155 49 calculates the arithmetic mean of one signal vector ; #X connect 0 0 11 0; #X connect 1 0 3 0; #X connect 3 0 4 0; #X connect 8 0 2 0; #X connect 9 0 1 0; #X connect 11 0 8 0; #X connect 11 0 9 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/blockmirror~-help.pd000066400000000000000000000047301265051730400266530ustar00rootroot00000000000000#N canvas 0 31 705 527 10; #X floatatom 26 183 0 0 0 0 - - -; #X msg 118 208 help; #X msg 488 63 \; pd dsp 1; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 100 float 0; #X coords 0 1 100 -1 400 300 1; #X restore 298 174 graph; #X msg 139 269 bang; #X text 287 146 note: there will be a break at 64 samples (signal-vector!) ; #X obj 26 207 osc~ 440; #X obj 122 178 tgl 15 0 empty empty on/off 0 -6 0 8 -262144 -1 -1 0 1; #X obj 101 12 blockmirror~; #X obj 87 235 blockmirror~; #X text 200 13 play back a signal-vector in a time-reversed way!; #X floatatom 112 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 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 450 pd output; #X msg 138 428 MUTE; #X text 107 409 output amplitude; #X text 595 41 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS signal block_oriented; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 75 INLET_0 float signal help; #X text 12 95 OUTLET_0 signal; #X text 12 45 DESCRIPTION play back a signal-vector in a time-reversed way!; #X restore 657 507 pd META; #X obj 139 294 tabwrite~ \$0-scope; #X connect 0 0 6 0; #X connect 1 0 9 0; #X connect 4 0 17 0; #X connect 6 0 9 0; #X connect 7 0 9 0; #X connect 9 0 12 0; #X connect 9 0 17 0; #X connect 11 0 12 1; #X connect 12 0 11 0; #X connect 13 0 12 2; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/blockswap~-help.pd000066400000000000000000000050561265051730400263150ustar00rootroot00000000000000#N canvas 0 31 705 547 10; #X floatatom 26 203 0 0 0 0 - - -; #X msg 118 228 help; #X msg 404 59 \; pd dsp 1; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 100 float 0; #X coords 0 1 100 -1 400 300 1; #X restore 298 194 graph; #X msg 139 289 bang; #X text 287 166 note: there will be a break at 64 samples (signal-vector!) ; #X obj 87 255 blockswap~; #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 0 1; #X text 287 151 note: there will be a break at 32 samples (swap!); #X floatatom 112 448 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 138 448 MUTE; #X text 107 429 output amplitude; #X text 477 63 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 5 GENRE help; #X text 12 25 KEYWORDS signal block_oriented; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 65 DESCRIPTION swap upper and lower half of the signal-vector ; #X text 12 85 INLET_0 float signal help; #X text 12 105 OUTLET_0 signal; #X restore 657 527 pd META; #X obj 139 314 tabwrite~ \$0-scope; #X connect 0 0 7 0; #X connect 1 0 6 0; #X connect 4 0 18 0; #X connect 6 0 13 0; #X connect 6 0 18 0; #X connect 7 0 6 0; #X connect 10 0 6 0; #X connect 12 0 13 1; #X connect 13 0 12 0; #X connect 14 0 13 2; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/coordinates-help.pd000066400000000000000000000060571265051730400264460ustar00rootroot00000000000000#N canvas 0 31 715 510 10; #X text 122 40 convert between SPHeric \, POLar and CARTesian coordinates ; #X obj 99 305 cart2sph; #X floatatom 150 286 5 0 0 0 z - -; #X floatatom 124 268 5 0 0 0 y - -; #X floatatom 99 248 5 0 0 0 x - -; #X floatatom 150 366 5 0 0 0 theta - -; #X floatatom 124 348 5 0 0 0 phi - -; #X floatatom 99 328 5 0 0 0 r - -; #X floatatom 150 116 5 0 0 0 z - -; #X floatatom 124 98 5 0 0 0 y - -; #X floatatom 99 78 5 0 0 0 x - -; #X floatatom 150 196 5 0 0 0 z - -; #X floatatom 124 178 5 0 0 0 phi - -; #X floatatom 99 158 5 0 0 0 r - -; #X obj 99 135 cart2pol; #X floatatom 353 116 5 0 0 0 z - -; #X floatatom 331 98 5 0 0 0 phi - -; #X floatatom 309 78 5 0 0 0 r - -; #X floatatom 353 196 5 0 0 0 theta - -; #X floatatom 331 178 5 0 0 0 phi - -; #X floatatom 309 158 5 0 0 0 r - -; #X floatatom 360 286 5 0 0 0 z - -; #X floatatom 334 268 5 0 0 0 phi - -; #X floatatom 309 248 5 0 0 0 r - -; #X floatatom 360 366 5 0 0 0 z - -; #X floatatom 334 348 5 0 0 0 y - -; #X floatatom 309 328 5 0 0 0 x - -; #X floatatom 573 286 5 0 0 0 theta - -; #X floatatom 551 268 5 0 0 0 phi - -; #X floatatom 529 248 5 0 0 0 r - -; #X floatatom 573 366 5 0 0 0 z - -; #X floatatom 551 348 5 0 0 0 phi - -; #X floatatom 529 328 5 0 0 0 r - -; #X obj 529 305 sph2pol; #X floatatom 580 116 5 0 0 0 theta - -; #X floatatom 554 98 5 0 0 0 phi - -; #X floatatom 529 78 5 0 0 0 r - -; #X floatatom 580 196 5 0 0 0 z - -; #X floatatom 554 178 5 0 0 0 y - -; #X floatatom 529 158 5 0 0 0 x - -; #X obj 529 135 sph2cart; #X obj 309 135 pol2sph; #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; #N canvas 473 173 494 344 META 0; #X text 12 235 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS control abstraction conversion; #X text 12 215 AUTHOR IOhannes m zmoelnig; #X text 12 65 DESCRIPTION convert between spheric \, polar and cartesian coordinates; #X text 12 95 INLET_0 float; #X text 12 115 INLET_1 float; #X text 12 135 INLET_2 float; #X text 12 155 OUTLET_0 float; #X text 12 175 OUTLET_1 float; #X text 12 196 OUTLET_2 float; #X text 12 5 NAME cart2pol pol2sph sph2cart cart2sph pol2cart sph2pol ; #X restore 664 487 pd META; #X connect 1 0 7 0; #X connect 1 1 6 0; #X connect 1 2 5 0; #X connect 2 0 1 2; #X connect 3 0 1 1; #X connect 4 0 1 0; #X connect 8 0 14 2; #X connect 9 0 14 1; #X connect 10 0 14 0; #X connect 14 0 13 0; #X connect 14 1 12 0; #X connect 14 2 11 0; #X connect 15 0 41 2; #X connect 16 0 41 1; #X connect 17 0 41 0; #X connect 21 0 42 2; #X connect 22 0 42 1; #X connect 23 0 42 0; #X connect 27 0 33 2; #X connect 28 0 33 1; #X connect 29 0 33 0; #X connect 33 0 32 0; #X connect 33 1 31 0; #X connect 33 2 30 0; #X connect 34 0 40 2; #X connect 35 0 40 1; #X connect 36 0 40 0; #X connect 40 0 39 0; #X connect 40 1 38 0; #X connect 40 2 37 0; #X connect 41 0 20 0; #X connect 41 1 19 0; #X connect 41 2 18 0; #X connect 42 0 26 0; #X connect 42 1 25 0; #X connect 42 2 24 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/date-help.pd000066400000000000000000000031771265051730400250510ustar00rootroot00000000000000#N canvas 0 31 421 483 10; #X obj 71 203 date; #X msg 71 174 bang; #X floatatom 94 350 0 0 0 0 - - -; #X floatatom 82 374 0 0 0 0 - - -; #X floatatom 71 401 0 0 0 0 - - -; #X msg 285 173 bang; #X floatatom 336 347 0 0 0 0 - - -; #X floatatom 310 373 0 0 0 0 - - -; #X floatatom 285 400 0 0 0 0 - - -; #X obj 285 202 date GMT; #X obj 73 26 date; #X text 91 79 get the system date; #X text 175 373 month; #X text 179 399 year; #X text 70 151 local; #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 - - -; #X floatatom 366 237 0 0 0 0 - - -; #X floatatom 340 263 0 0 0 0 - - -; #X floatatom 315 290 0 0 0 0 - - -; #X text 170 239 daylight-saving; #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; #N canvas 415 83 494 303 META 0; #X text 12 225 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 205 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION get the system date; #X text 12 5 KEYWORDS control time filesystem; #X text 12 65 INLET_0 bang; #X text 12 85 OUTLET_0 float; #X text 12 105 OUTLET_1 float; #X text 12 125 OUTLET_2 float; #X text 12 145 OUTLET_2 float; #X text 12 165 OUTLET_3 float; #X text 12 185 OUTLET_4 float; #X restore 372 462 pd META; #X connect 0 0 4 0; #X connect 0 1 3 0; #X connect 0 2 2 0; #X connect 0 3 18 0; #X connect 0 4 17 0; #X connect 0 5 16 0; #X connect 1 0 0 0; #X connect 5 0 9 0; #X connect 9 0 8 0; #X connect 9 1 7 0; #X connect 9 2 6 0; #X connect 9 3 21 0; #X connect 9 4 20 0; #X connect 9 5 19 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/demultiplex-help.pd000066400000000000000000000031351265051730400264620ustar00rootroot00000000000000#N canvas 0 31 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 [ [ [ ... ]]]"; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 65 INLET_0 anything; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION demultiplex the inlet to the specified output ; #X text 12 85 OUTLET_N anything; #X text 12 5 KEYWORDS control anything_op; #X restore 650 261 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/demultiplex~-help.pd000066400000000000000000000025001265051730400266530ustar00rootroot00000000000000#N canvas 0 31 635 302 10; #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 481 106 demux~; #X text 154 174 the number of arguments specifies the number of outlets ; #X text 513 3 part of zexy; #N canvas 520 254 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS signal; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 65 DESCRIPTION demultiplex 1 signal to 1-of-n outlets; #X text 12 85 INLET_0 float signal; #X text 12 5 ALIAS demux~; #X text 12 105 OUTLET_N signal; #X restore 578 279 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/dfreq~-help.pd000066400000000000000000000021721265051730400254250ustar00rootroot00000000000000#N canvas 0 0 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; #N canvas 515 193 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS signal analysis; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION a frequency detector that counts zero-crossings ; #X text 12 65 INLET_0 signal; #X text 12 85 OUTLET_0 signal; #X restore 540 272 pd META; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 3 0 2 0; #X connect 6 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/digidistort-help.pd000066400000000000000000000106001265051730400264460ustar00rootroot00000000000000#N canvas 0 31 746 635 10; #X obj 99 449 swap~; #X text 172 435 byte-swap the signal; #X text 214 89 quantize a signal with a variable step-number; #X text 171 453 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 361 0; #X msg 122 337 1; #X msg 121 386 bang; #X obj 35 136 osc~ 440; #X floatatom 35 112 0 0 0 0 - - -; #X obj 96 164 quantize~ 16; #X obj 35 416 osc~ 440; #X floatatom 35 392 0 0 0 0 - - -; #X msg 121 411 help; #X msg 127 137 help; #X msg 404 39 \; pd dsp 1; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 100 float 0; #X coords 0 1 100 -1 400 300 1; #X restore 298 119 graph; #X msg 148 198 bang; #X msg 178 499 bang; #X text 161 386 toggle; #X text 154 336 on; #X text 156 360 off; #X floatatom 125 571 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 593 pd output; #X msg 151 571 MUTE; #X text 120 552 output amplitude; #X floatatom 121 272 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 294 pd output; #X msg 147 272 MUTE; #X text 116 253 output amplitude; #X text 657 13 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 115 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS signal; #X text 12 95 AUTHOR IOhannes m zmoelnig; #X text 12 5 NAME quantize~ swap~; #X text 12 65 DESCRIPTION signal objects that are distorting in a very "digital" way; #X restore 697 612 pd META; #X obj 148 223 tabwrite~ \$0-scope; #X obj 178 524 tabwrite~ \$0-scope; #X connect 0 0 27 0; #X connect 0 0 37 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 31 0; #X connect 14 0 36 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 21 0 36 0; #X connect 22 0 37 0; #X connect 26 0 27 1; #X connect 27 0 26 0; #X connect 28 0 27 2; #X connect 30 0 31 1; #X connect 31 0 30 0; #X connect 32 0 31 2; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/dirac~-help.pd000066400000000000000000000032511265051730400254050ustar00rootroot00000000000000#N canvas 0 31 547 283 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 116 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; #X obj 53 208 t f b; #X msg 53 187 2; #X msg 185 225 2; #X text 462 7 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION produces a unit:sample:sequence; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 65 INLET_0 float; #X text 12 85 OUTLET_0 signal; #X restore 497 262 pd META; #N canvas 0 0 819 427 application 0; #X obj 85 92 t b b b; #X msg 129 114 \; pd dsp 1; #X obj 107 149 dirac~; #X floatatom 191 151 0 0 0 0 - - -; #X obj 107 191 tabwrite~ unit::response; #N canvas 0 0 450 300 (subpatch) 0; #X array unit::response 64 float 0; #X coords 0 1 63 -1 400 300 1; #X restore 368 35 graph; #X msg 80 293 \; unit::response resize 64; #X text 42 363 we thought it useful to have a tool that would be able to easily plot the unit::response of a system; #X text 121 71 press me; #X msg 85 71 bang; #X obj 107 170 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 295 141 pd application; #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 9 0 3 0; #X connect 9 1 0 0; #X connect 10 0 9 0; #X connect 11 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/drip-help.pd000066400000000000000000000052301265051730400250620ustar00rootroot00000000000000#N canvas 0 31 828 628 10; #X msg 30 88 come on \, my house; #X obj 30 190 print UNFOLDED; #X msg 48 115 1 two tre quatre 5 se; #X text 72 10 drip; #X obj 30 163 drip; #X text 311 84 drip is like a medical drip - you can adjust the drop-speed ; #X obj 316 178 drip 1000; #X obj 316 198 print DROP; #X msg 316 132 this is that slow; #X floatatom 365 159 0 0 0 0 - - -; #X text 439 475 drip without arguments will do no scheduling (this is: output all the atoms at once); #X text 424 162 drop-delay in [ms]; #X obj 36 529 drip; #X obj 95 531 drip 0; #X msg 36 478 5 4 3 2 1 ready go; #X obj 36 499 t l l; #X obj 95 569 print SCHEDULED; #X obj 36 591 print DESCHEDUL; #X obj 248 522 drip -10; #X obj 248 551 print DESCHED; #X msg 248 486 bang; #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 530 602 see also :; #X obj 602 604 repack; #X obj 35 259 t l l b; #X obj 181 310 t l l; #X obj 181 269 del 250; #X msg 35 240 list some atoms could be saved while others; #X msg 181 289 list might get lost; #X obj 35 382 print TIGHT; #X obj 171 373 print LOOSE; #X obj 35 363 pipe s 1500; #X text 411 269 creation:; #X text 475 269 "drip [ [flush]]"; #X text 447 357 is the initial drop-delay in [ms]; #X text 442 293 "flush" indicates whether non-empty buffers should be flushed when a new package arrives or not.; #X text 443 322 default is no_flush; #X text 447 390 n==0 will DO scheduling (and is therefore somewhat "slower" than without arguments; #X text 445 375 default is NO scheduling; #X text 446 425 negative values for turn off scheduling; #X obj 35 335 drip 200 flush; #X obj 171 335 drip 200; #X text 717 13 part of; #X obj 776 13 zexy; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 65 INLET_0 anything; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION unfolds a package to a sequence; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 float symbol pointer; #X text 12 5 KEYWORDS control list_op; #X restore 777 601 pd META; #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 25 0 41 0; #X connect 25 1 42 0; #X connect 25 2 27 0; #X connect 26 0 41 0; #X connect 26 1 42 0; #X connect 27 0 29 0; #X connect 28 0 25 0; #X connect 29 0 26 0; #X connect 32 0 30 0; #X connect 41 0 32 0; #X connect 42 0 31 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/envrms~-help.pd000066400000000000000000000023421265051730400256350ustar00rootroot00000000000000#N canvas 0 31 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; #N canvas 593 163 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION an envelope follower that outputs rms instead of dB; #X text 12 5 KEYWORDS signal conversion; #X text 12 75 INLET_0 signal; #X text 12 95 OUTLET_0 float; #X restore 525 333 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/fifop-help.pd000066400000000000000000000035631265051730400252360ustar00rootroot00000000000000#N canvas 0 31 587 503 10; #X text 471 31 part of; #X msg 58 85 1 2 3 4 5; #X msg 69 110 list a list; #X msg 81 137 5; #X msg 199 97 bang; #X floatatom 200 133 5 0 0 1 priority - -; #X text 45 61 input lists; #X text 50 400 priorities can be floating-point numbers (1.8 has a higher priority then 10); #X obj 58 192 fifop; #X text 47 18 fifop:: First-In-First-Out stack with Priorities; #X text 247 80 bang to output the first list that came in \; bang again to output the second list \; and so on; #X text 54 263 [fifop] manages a number of FIFO-stacks \; each stack has a priority value assigned \; the lower the value \, the higher the priority; #X text 52 310 banging the object will first empty the FIFO with the highest priority \, then the FIFO with the second highest priority and so on \, until the FIFO with the lowest priority is emptied.; #X text 51 368 when all FIFOs are emptied \, nothing will come out of the object any more.; #X obj 58 223 print FIFO; #X text 52 445 note: you can store any number of lists into the [fifop] \, but just pushing lists on the stack without popping them back will eat your memory.; #X msg 201 159 info; #X text 247 158 query the number of arguments in the LIFO; #X obj 156 209 print info; #X obj 533 30 zexy; #N canvas 593 163 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION first in first out stack with Priorities ; #X text 12 65 INLET_0 list float bang; #X text 12 105 OUTLET_0 list; #X text 12 125 OUTLET_1 float; #X text 12 5 KEYWORDS control list_op storage; #X text 12 85 INLET_1 float info; #X restore 535 473 pd META; #X connect 1 0 8 0; #X connect 2 0 8 0; #X connect 3 0 8 0; #X connect 4 0 8 0; #X connect 5 0 8 1; #X connect 8 0 14 0; #X connect 8 1 18 0; #X connect 16 0 8 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/freadln-help.pd000066400000000000000000000031161265051730400255400ustar00rootroot00000000000000#N canvas 0 31 859 326 10; #X obj 443 239 print done; #X text 72 260 see also:; #X msg 433 149 bang; #X text 334 293 this outlet gets the lines in sequence.; #X obj 130 281 textfile; #X text 482 150 output one line as a list and move to the next; #X text 508 222 This outlet gets a bang when you hit the end of the sequence \; it will also get the current position when using "when" ; #X text 618 7 part of zexy; #X obj 406 267 print data; #X obj 73 9 freadln; #X text 18 57 The [freadln] object is a simplified version if [textfile]. It only supports reading files.; #X text 15 95 features are :; #X text 60 108 the file is not read into the objects buffer. instead only the current line will be streamed from the file. this allows to read _large_ files (which need not fit into the main memory at all) ; #X text 58 199 no random access!; #X text 9 183 drawbacks are :; #X obj 130 262 fwriteln; #X msg 433 178 close; #X text 548 117 open a file in 'cr' mode; #X obj 406 201 freadln; #X msg 435 116 open test.mtx cr; #N canvas 708 249 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control storage filesystem; #X text 12 85 OUTLET_0 anything; #X text 12 105 OUTLET_1 bang; #X text 12 65 INLET_0 bang open close; #X text 12 45 DESCRIPTION read text files line by line; #X restore 806 297 pd META; #X text 127 9 read text-files line-by-line; #X connect 2 0 18 0; #X connect 16 0 18 0; #X connect 18 0 8 0; #X connect 18 1 0 0; #X connect 19 0 18 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/fwriteln-help.pd000066400000000000000000000031061265051730400257560ustar00rootroot00000000000000#N canvas 4 2 827 363 10; #X text 72 260 see also:; #X obj 130 281 textfile; #X text 482 150 output one line as a list and move to the next; #X text 618 7 part of zexy; #X text 15 95 features are :; #X text 58 199 no random access!; #X text 9 183 drawbacks are :; #X msg 433 248 close; #X text 578 117 open a file in 'cr' mode; #X obj 73 9 fwriteln; #X text 127 9 write text-files line-by-line; #X text 18 57 The [fwriteln] object is a simplified version if [textfile]. It only supports writing files.; #X text 60 108 the file is not cached in the object's buffer. instead the current line will be streamed directly into the file. this allows to write _large_ files (which need not fit into the main memory at all); #X obj 130 262 freadln; #X obj 406 271 fwriteln; #X msg 441 172 1 2 3.666; #X msg 441 194 foo bar; #X msg 443 216 list is a list is a list; #X msg 435 116 open /tmp/test.txt cr; #X text 489 249 close the file (ensure that it gets written); #X text 167 322 you can use the arguments "w" and "p" to set the width and precision of floating point numbers \, e.g.:; #X obj 602 331 fwriteln w 8 p 2; #N canvas 708 249 494 344 META 0; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 85 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control storage filesystem; #X text 12 45 DESCRIPTION write text files line by line; #X text 12 65 INLET_0 open close anything; #X restore 768 327 pd META; #X connect 7 0 14 0; #X connect 15 0 14 0; #X connect 16 0 14 0; #X connect 17 0 14 0; #X connect 18 0 14 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/glue-help.pd000066400000000000000000000020111265051730400250520ustar00rootroot00000000000000#N canvas 0 31 577 363 10; #X obj 111 58 glue; #X text 171 58 glue together 2 packages (append \, prepend \, ...) ; #X msg 95 143 1 2 3; #X msg 127 170 4 you and me; #X obj 95 274 print; #X obj 277 270 print; #X msg 277 154 bang; #X msg 317 154 symbol click; #X text 104 335 creation argument: preset the second inlet; #X msg 51 175 bang; #X obj 95 206 glue; #X obj 277 206 glue and stick; #X text 490 14 part of zexy; #N canvas 538 191 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 anything; #X text 12 45 DESCRIPTION glue together 2 packages (append \, prepend \, ...); #X text 12 65 INLET_0 anything; #X text 12 105 OUTLET_1 anything; #X text 12 5 KEYWORDS control anything_op storage; #X restore 524 335 pd META; #X connect 2 0 10 0; #X connect 3 0 10 1; #X connect 6 0 11 0; #X connect 7 0 11 0; #X connect 9 0 10 0; #X connect 10 0 4 0; #X connect 11 0 5 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/index-help.pd000066400000000000000000000104721265051730400252370ustar00rootroot00000000000000#N canvas 4 50 929 598 10; #X msg 33 364 help; #X floatatom 682 190 0 0 128 0 - - -; #X msg 58 185 add alias; #X msg 58 203 add bind; #X msg 58 221 add break; #X msg 58 240 add built-in; #X msg 58 259 add case; #X msg 582 407 delete bind; #X msg 582 425 delete break; #X msg 582 444 delete built-in; #X msg 582 463 delete case; #X obj 514 287 symbol; #X msg 533 267 case; #X msg 533 248 built-in; #X msg 533 229 break; #X msg 533 211 bind; #X msg 533 193 alias; #X obj 514 305 send \$0-2index; #X obj 61 421 receive \$0-2index; #X obj 570 501 send \$0-2index; #X obj 44 297 send \$0-2index; #X text 522 156 get item index; #X text 516 170 (evt. add new item); #X text 33 154 add new item to map; #X text 580 350 delete item from map; #X text 128 39 creation : "index [ []]"; #X msg 582 389 delete alias; #X text 162 73 auto :: 1_sets auto ON \, 0_sets auto OFF (default off) ; #X text 705 14 part of zexy; #X floatatom 61 563 0 0 0 0 - - -; #X symbolatom 121 562 0 0 0 0 - - -; #X obj 61 542 route float symbol; #X obj 196 542 print INDEX; #X obj 682 294 send \$0-2index; #X text 673 168 query an item at index #; #X text 61 9 index:: create a symbol->int map; #X text 164 59 n :: initial max. number of elements in list (default: 128); #X obj 460 7 index; #N canvas 0 0 849 372 administrative 0; #X obj 61 268 outlet; #X msg 61 77 reset; #X text 50 58 clear map; #X msg 103 155 auto \$1; #X obj 103 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 156 205 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 156 226 resize \$1; #X text 174 116 in AUTO mode \, unknown symbols are automatically added to the map \;; #X text 175 143 in NON-AUTO mode (default) \, only ADDed symbols (eg. "add ") are added to the map; #X text 235 197 normally \, the map will resize automatically if it gets to small. you can prevent it from resizing by sending a "resize 0" message.; #X connect 1 0 0 0; #X connect 3 0 0 0; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 6 0 0 0; #X restore 187 440 pd administrative; #N canvas 0 0 673 455 advanced 0; #X obj 76 298 outlet; #X msg 90 109 dump; #X msg 111 251 sort; #X msg 76 56 bang; #X text 124 56 output the number of stored entries; #X text 128 109 dump each entry in the format "list " ; #X msg 114 161 compact; #X text 173 161 compact the entries \, so there are no holes in the map; #X text 159 253 sort the elements alphabetically; #X text 172 198 this does not produce any immediate output!; #X text 177 179 (e.g. "1 ... foo \, 3 ... bar" --> "1 ... foo \, 2 ... bar"); #X text 156 270 (e.g. "1 ... foo \, 2 ... bar" --> "1 ... bar \, 2 ... foo"); #X text 161 288 this does not produce any immediate output!; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 6 0 0 0; #X restore 190 470 pd advanced; #X text 300 440 open subpatch for administrative messages; #X text 300 470 open subpatch for advanced messages; #X obj 61 497 index 10 1; #X obj 210 299 send \$0-2index; #X text 199 156 add new item to map at index#; #X msg 224 187 add foo 7; #X msg 231 221 add bar 2; #X text 205 168 (if that slot is still free); #X obj 724 504 send \$0-2index; #X text 734 353 delete item at index# from map; #X msg 724 392 delete 6; #X text 88 123 "0" indicates success \; "-1" indicates an error; #X text 45 105 NOTE: indices start counting from "1" !!!; #N canvas 607 221 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control conversion; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION create a symbol -> int map; #X text 12 65 INLET_0 add help reset auto resize bang dump compact sort; #X text 12 85 OUTLET_0 list; #X restore 875 572 pd META; #X connect 0 0 42 0; #X connect 1 0 33 0; #X connect 2 0 20 0; #X connect 3 0 20 0; #X connect 4 0 20 0; #X connect 5 0 20 0; #X connect 6 0 20 0; #X connect 7 0 19 0; #X connect 8 0 19 0; #X connect 9 0 19 0; #X connect 10 0 19 0; #X connect 11 0 17 0; #X connect 12 0 11 0; #X connect 13 0 11 0; #X connect 14 0 11 0; #X connect 15 0 11 0; #X connect 16 0 11 0; #X connect 18 0 42 0; #X connect 26 0 19 0; #X connect 31 0 29 0; #X connect 31 1 30 0; #X connect 31 2 32 0; #X connect 38 0 42 0; #X connect 39 0 42 0; #X connect 42 0 31 0; #X connect 45 0 43 0; #X connect 46 0 43 0; #X connect 50 0 48 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/length-help.pd000066400000000000000000000015271265051730400254120ustar00rootroot00000000000000#N canvas 0 31 416 236 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 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 0 - - -; #X text 324 19 part of zexy; #N canvas 607 221 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control list_op; #X text 12 65 INLET_0 anything; #X text 12 85 OUTLET_0 float; #X text 12 45 DESCRIPTION get the length of a list; #X restore 363 211 pd META; #X connect 2 0 3 0; #X connect 4 0 2 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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/lifop-help.pd000066400000000000000000000035501265051730400252400ustar00rootroot00000000000000#N canvas 0 31 568 508 10; #X text 471 31 part of; #X obj 533 30 zexy; #X obj 58 192 lifop; #X msg 58 85 1 2 3 4 5; #X msg 69 110 list a list; #X msg 81 137 5; #X msg 199 107 bang; #X floatatom 200 143 5 0 0 1 priority - -; #X text 45 61 input lists; #X text 247 90 bang to output the last list that came in \; bang again to output the second last list \; and so on; #X obj 58 223 print LIFO; #X text 47 18 lifop:: Last-In-First-Out stack with Priorities; #X text 54 263 [lifop] manages a number of LIFO-stacks \; each stack has assigned a priority value \; the lower the value \, the higher the priority; #X text 52 312 banging the object will first empty the LIFO with the highest priority \, then the LIFO with the second highest priority until the LIFO with the lowest priority is emptied.; #X text 52 363 when all LIFOs are emptied \, nothing will come out of the object any more.; #X text 50 400 priorities can be floating-point numbers (1.8 has a higher priority then 10); #X text 52 445 note: you can store any number of lists into the [fifop] \, but just pushing lists on the stack without popping them back will eat your memory.; #X msg 200 167 info; #X obj 112 203 print info; #X text 247 168 query the number of arguments in the LIFO; #N canvas 515 193 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION last in first out stack with priorities; #X text 12 5 KEYWORDS control storage list_op; #X text 12 65 INLET_0 list float bang info; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 list; #X text 12 125 OUTLET_1 float; #X restore 513 481 pd META; #X connect 2 0 10 0; #X connect 2 1 18 0; #X connect 3 0 2 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 7 0 2 1; #X connect 17 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/limiter~-help.pd000066400000000000000000000226551265051730400260010ustar00rootroot00000000000000#N canvas 4 50 762 443 10; #X text 189 15 limiter; #X text 187 25 ========; #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; #N canvas 0 0 450 300 (subpatch) 0; #X array array1 32768 float 0; #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; #X obj 151 64 bang~; #X obj 214 59 loadbang; #X obj 337 88 block~ 32768 8; #X connect 1 0 3 0; #X connect 4 0 3 0; #X connect 5 0 2 0; #X restore 372 408 pd tabwrite; #X obj 382 341 env~; #X floatatom 382 359 4 0 0 0 - - -; #X text 30 299 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; #X obj 112 229 outlet~; #X obj 112 185 *~; #X obj 151 185 *~; #X obj 122 128 osc~ 440; #X obj 151 145 osc~ 689.062; #X obj 112 163 line~; #X obj 167 162 line~; #X msg 167 128 \$1 100; #X msg 112 111 \$1 100; #X obj 86 97 f; #X obj 252 98 f; #X obj 154 229 outlet~; #X obj 86 72 dbtorms; #X obj 252 78 dbtorms; #X connect 0 0 14 0; #X connect 1 0 15 0; #X connect 3 0 2 0; #X connect 4 0 13 0; #X connect 5 0 3 1; #X connect 6 0 4 0; #X connect 7 0 3 0; #X connect 8 0 4 1; #X connect 9 0 8 0; #X connect 10 0 7 0; #X connect 11 0 10 0; #X connect 12 0 9 0; #X connect 14 0 11 0; #X connect 15 0 12 0; #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 353 1906:forum::für::umläute:2001; #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 492 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 520 354 MUTE; #X text 532 300 just a small delay of 64 samples; #X text 531 44 updated for zexy-2.0; #X text 37 132 this is because the limiter algorithm needs some time (e.g. the outgoing 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 hear the click); #N canvas 603 395 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 135 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION limiter; #X text 12 5 KEYWORDS signal filter analysis; #X text 12 65 INLET_0 signal print mode LIMIT CRACK COMPRESS help limit set limits set2 treshold compress; #X text 12 95 INLET_N signal; #X text 12 115 OUTLET_0 signal; #X restore 711 417 pd META; #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; #N canvas 4 50 951 819 modes 0; #X text 81 189 MODE 0 : 1-treshold-limiter; #X text 79 384 MODE 1 : 2-tresholds-limiter; #X msg 502 255 print; #X obj 456 316 limiter~; #X obj 479 141 limiter~; #X msg 543 123 help; #X msg 542 104 print; #X msg 479 32 mode 0; #X msg 542 31 LIMIT; #X msg 479 50 mode 1; #X msg 542 49 CRACK; #X msg 479 67 mode 2; #X msg 542 66 COMPRESS; #X text 612 48 crack limiter (2 tresholds); #X text 612 66 compressor (1 treshold); #X text 621 102 context status; #X text 522 30 ==; #X text 521 49 ==; #X text 520 68 ==; #X msg 517 302 LIMIT; #X obj 517 286 loadbang; #X text 611 30 normal limiter (1 treshold) [default]; #X msg 501 459 print; #X obj 453 522 limiter~; #X obj 514 492 loadbang; #X msg 514 508 CRACK; #X msg 487 716 print; #X obj 500 760 loadbang; #X text 85 590 MODE 2 : compressor; #X msg 500 776 COMPRESS; #X msg 492 629 ratio 0.5; #X text 599 628 set compress-ratio (0.5 == 1:2); #X text 599 605 set the treshold \, where the compressor should start to compress; #X text 622 677 set the compressor (limit/treshold/ratio); #X text 601 655 set limit/holdtime/releasetime at once; #X text 603 717 view actual settings; #X text 607 459 view actual settings; #X msg 504 188 limit 90; #X msg 504 211 set 105 40 150; #X msg 502 404 set 105 40 150; #X msg 505 426 set2 120 1 10; #X msg 491 654 set 110 40 150; #X msg 491 611 treshold 10; #X msg 490 677 compress 96 88 0.5; #X text 598 591 set the output-limit; #X msg 491 593 limit 98; #X text 608 254 view actual settings; #X text 609 212 set limit/holdtime/releasetime at once; #X text 609 185 set output limit; #X obj 439 790 limiter~; #X text 605 404 set limiter1 (output-limit/hold-time/release-time) ; #X text 10 621 the output signal will never become louder than the specified output-limit.; #X text 10 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 39 59 set the limiter~ to one of the 3 modes; #X text 604 380 set both limits; #X text 11 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 604 427 set limiter2 (input-treshold/hold-time/release-time) ; #X msg 502 381 limits 100 108; #X text 10 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 than those for the first \, to ensure that the disturbance will pass 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 13 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 624 123 context(!) help; #X connect 2 0 3 0; #X connect 5 0 4 0; #X connect 6 0 4 0; #X connect 7 0 4 0; #X connect 8 0 4 0; #X connect 9 0 4 0; #X connect 10 0 4 0; #X connect 11 0 4 0; #X connect 12 0 4 0; #X connect 19 0 3 0; #X connect 20 0 19 0; #X connect 22 0 23 0; #X connect 24 0 25 0; #X connect 25 0 23 0; #X connect 26 0 49 0; #X connect 27 0 29 0; #X connect 29 0 49 0; #X connect 30 0 49 0; #X connect 37 0 3 0; #X connect 38 0 3 0; #X connect 39 0 23 0; #X connect 40 0 23 0; #X connect 41 0 49 0; #X connect 42 0 49 0; #X connect 43 0 49 0; #X connect 45 0 49 0; #X connect 57 0 23 0; #X restore 189 322 pd modes; #N canvas 4 50 565 362 creation 0; #X text 211 152 creates a default limiter (MONO \, 9-samples-buffer) ; #X text 213 189 creates a limiter(MONO \, 10ms-buffer); #X text 213 223 creates a limiter (multichannel \, 9-samples-buffer) ; #X text 216 256 creates a limiter (multichannel \, 1ms-buffer !!); #X text 82 17 "limiter [] [ [ [...]]]"; #X text 148 70 creating inlets depends ONLY on the number of arguments \, not on the arguments themselves... !; #X text 218 313 creates a limiter (multichannel \, 9-samples-buffer) ; #X text 113 187 ______________; #X text 89 150 _________________; #X text 145 220 _________; #X text 114 254 ______________; #X text 199 311 __; #X obj 23 151 limiter~; #X obj 23 185 limiter~ 10; #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 322 pd creation; #X connect 2 0 8 0; #X connect 3 0 23 0; #X connect 3 0 10 0; #X connect 4 0 9 0; #X connect 4 0 23 1; #X connect 5 0 14 0; #X connect 6 0 14 1; #X connect 7 0 5 0; #X connect 7 0 6 0; #X connect 8 0 4 0; #X connect 8 0 3 1; #X connect 10 0 11 0; #X connect 14 0 8 0; #X connect 14 0 20 0; #X connect 14 1 8 1; #X connect 14 1 19 0; #X connect 19 0 4 1; #X connect 20 0 3 0; #X connect 22 0 23 2; #X connect 23 0 22 0; #X connect 24 0 23 3; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/list2int-help.pd000066400000000000000000000016311265051730400256750ustar00rootroot00000000000000#N canvas 0 31 497 302 10; #X obj 26 246 print; #X msg 61 139 3.14159 2 hello 1; #X msg 70 170 gosh 2.3 1; #X obj 26 212 list2int; #X text 65 23 list to integer; #X text 18 49 cast all floats of a list to integers; #X msg 26 110 1 2 -1.567 3 2; #X text 158 110 list of floats; #X text 224 139 list with symbols; #X obj 332 248 l2i; #X text 285 248 alias; #X text 371 15 part of zexy; #X text 168 169 not really a list; #N canvas 515 193 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION cast all floats of a list to integers; #X text 12 65 INLET_0 anything; #X text 12 5 KEYWORDS control conversion anything_op; #X text 12 85 OUTLET_0 anything; #X restore 433 271 pd META; #X connect 1 0 3 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 6 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/list2lists-help.pd000066400000000000000000000022421265051730400262400ustar00rootroot00000000000000#N canvas 0 31 597 383 10; #X text 497 29 part of zexy; #X obj 63 13 list2lists; #X text 136 13 - split a list into sublists; #X obj 88 220 print sublists; #X obj 88 175 list2lists; #X msg 88 83 1 2 3 4 5 6 7 8 9 10; #X text 232 153 an array of lengths of the sublists; #X text 226 84 a list to be split; #X text 186 214 outputs a number of sublists each having the length as specified to the object.; #X text 91 266 if the total length of the sublists exceeds the length of the input list \, the rest of the sublists is discarded; #X msg 143 153 4 3 0 0 -1 -2; #X text 94 293 zero-length sublists are "bangs"; #X text 77 351 see also; #X obj 150 350 repack; #X text 206 351 fixed sized sublists; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 OUTLET_0 list; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control conversion list_op; #X text 12 45 DESCRIPTION split a list into sublists; #X text 12 65 INLET_0 list; #X text 12 85 INLET_1 list; #X restore 541 357 pd META; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 10 0 4 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/list2symbol-help.pd000066400000000000000000000030261265051730400264100ustar00rootroot00000000000000#N canvas 0 31 716 373 10; #X obj 85 28 list2symbol; #X text 178 29 convert a list into a symbol; #X obj 407 30 l2s; #X symbolatom 25 266 0 0 0 0 - - -; #X msg 25 77 list this was a list and is now a symbol; #X msg 109 98 anythings work fine too; #X obj 457 268 print; #X symbolatom 97 203 10 0 0 0 - - -; #X msg 97 138 symbol --; #X text 180 137 by default \, list-elements are separated by spaces. You can set the separator to any symbol; #X text 486 11 part of zexy; #X msg 106 181 symbol; #X obj 25 238 list2symbol; #X text 172 183 even to a zero-length symbol!; #X msg 457 227 my bonnie is over the ovean; #X obj 457 248 l2s .; #X text 487 41 updated for zexy-2.2; #X text 504 250 argument: default delimiter; #X text 266 306 in prior versions of [list2symbol] \, the default delimiter was not settable via arguments \; instead the arguments denoted the incoming list. this has changed!!!!; #X text 271 282 Attention:; #N canvas 460 154 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 25 KEYWORDS control conversion symbol_op; #X text 12 65 DESCRIPTION convert a list into a symbol; #X text 12 85 INLET_0 anything; #X text 12 105 INLET_1 symbol; #X text 12 125 OUTLET_0 symbol; #X text 12 5 ALIAS l2s; #X restore 661 344 pd META; #X connect 4 0 12 0; #X connect 5 0 12 0; #X connect 7 0 12 1; #X connect 8 0 7 0; #X connect 11 0 7 0; #X connect 12 0 3 0; #X connect 14 0 15 0; #X connect 15 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/lister-help.pd000066400000000000000000000036251265051730400254340ustar00rootroot00000000000000#N canvas 0 31 627 499 10; #X obj 110 16 lister; #X text 160 17 - store a list; #X msg 41 132 bang; #X text 76 133 outputs a list; #X text 288 180 sets and outputs a list; #X text 243 336 creation argument initializes a list; #X obj 18 381 print; #X text 291 16 alias; #X obj 331 16 l; #X msg 232 315 2 3 5 7 11 prime; #X obj 41 336 lister 1 2 3 4 5 6 7 ordinal; #X msg 62 180 1 1 2 3 5 8 13 21 44 fibonacchi; #X text 64 77 of course \, this is similar to the "pack" object \, but here we handle list-lenghts dynamically and do not care about type checking !!!; #X obj 67 381 list2symbol; #X symbolatom 67 403 0 0 0 0 output: - -; #X msg 91 260 one 2 3 four; #X msg 96 283 list one 2 3 four; #X text 228 283 works; #X text 193 260 does NOT work (check console for error); #X text 353 315 right inlet sets a list without outputting; #X text 94 222 lists of mixed-type work but if any list starts with a symbol \, you need to cast it as a list:; #X msg 77 199 1 two three 4; #X msg 51 161 7 8 9; #X text 64 53 similar to:; #X obj 154 52 float; #X obj 202 52 int; #X obj 237 52 symbol; #X text 497 29 part of zexy; #X obj 202 470 list; #X text 35 448 this object has been deprecated by the advent of [list] in Pd-0.40 \; use that one instead!; #N canvas 460 154 494 344 META 0; #X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 135 OUTLET_0 list; #X text 12 155 AUTHOR IOhannes m zmoelnig; #X text 12 5 ALIAS l; #X text 12 25 KEYWORDS control storage list_op deprecated; #X text 12 65 DESCRIPTION store a list and/or append a list to another list; #X text 12 115 INLET_1 list; #X text 12 95 INLET_0 list; #X restore 571 470 pd META; #X connect 2 0 10 0; #X connect 9 0 10 1; #X connect 10 0 6 0; #X connect 10 0 13 0; #X connect 11 0 10 0; #X connect 13 0 14 0; #X connect 15 0 10 0; #X connect 16 0 10 0; #X connect 21 0 10 0; #X connect 22 0 10 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/listfind-help.pd000066400000000000000000000022471265051730400257450ustar00rootroot00000000000000#N canvas 0 31 567 344 10; #X text 467 29 part of zexy; #X obj 33 13 listfind; #X text 92 14 - find sublists in lists; #X obj 58 175 listfind; #X msg 249 154 1 2 3 2 1 8 2 3 4; #X obj 249 128 loadbang; #X msg 58 71 1; #X text 253 174 set the list to be searched; #X text 55 55 the list to be found; #X msg 70 95 list bla; #X msg 84 119 list 2 3; #X msg 96 142 list 8; #X obj 58 220 print found@; #X text 150 223 outputs a list of (0-based) indices of all occurences of the sublist; #X text 54 281 this is similar (and hopefully compatible) to foobar's [list-find] but it searches not only for single elements but for entire sub-lists; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 OUTLET_0 list; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control list_op; #X text 12 45 DESCRIPTION find sublists in lists; #X text 12 65 INLET_0 list; #X text 12 85 INLET_1 list; #X restore 511 317 pd META; #X connect 3 0 12 0; #X connect 4 0 3 1; #X connect 5 0 4 0; #X connect 6 0 3 0; #X connect 9 0 3 0; #X connect 10 0 3 0; #X connect 11 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/longload-help.pd000066400000000000000000000003521265051730400257230ustar00rootroot00000000000000#N canvas 553 320 450 300 10; #X text 148 51 takes long to load; #X obj 35 51 longload 5000; #X text 30 119 the optional argument specifies the time (in ms) \, this object takes to instantiate.; #X text 36 158 the default is 1000ms.; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/lpt-help.pd000066400000000000000000000061601265051730400247260ustar00rootroot00000000000000#N canvas 420 106 775 605 10; #X text 129 36 write data to the (parallel) port; #X floatatom 81 304 4 0 255 0 - - -; #X text 122 304 write an 8bit-word; #X obj 90 33 lpt; #X text 521 30 part of zexy; #X text 79 64 this does not work on osX (as there is no parallel port) ; #N canvas 4 49 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 86 pd windows; #X text 80 253 you should be member of the "lp" group or set the the permissions of the device file; #X obj 81 477 lpt /dev/parport0; #N canvas 4 49 553 385 raw 0; #X text 24 127 if your port-address exceeds 0x3ff \, "lpt" will try to get all permissions with the iopl()-command. this might be dangerous !; #X text 26 50 you can access all ports on your system when using "lpt "; #X text 26 89 you might have to be root (superuser) \, in order to gain raw access to the port.; #X text 75 230 parallel ports 0 \, 1 \, 2; #X obj 81 251 lpt 0; #X obj 130 251 lpt 1; #X obj 179 251 lpt 2; #X obj 68 329 lpt 0x378; #X text 63 308 another port (directly specifying the port address) ; #X restore 460 150 pd raw access; #X text 78 86 w32 users shoud read this:; #X text 81 153 linux users can use the deprecated RAW access method ; #X text 80 219 you can access your parallel ports by accessing /dev/parport0 (and similar); #X text 82 189 the preferred way for linux users is to use the device-filesystem: ; #X text 217 478 <-- access /dev/parport0; #X obj 84 545 lpt /dev/parports/0; #X text 222 546 <-- some systems might use this syntax; #X msg 335 309 control \$1; #X floatatom 335 291 4 0 255 0 - - -; #X floatatom 81 509 5 0 0 0 - - -; #X msg 337 433 bang; #X text 380 437 read the input bits; #X text 131 509 input bits; #N canvas 461 150 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION write data to the (parallel) port; #X text 12 65 INLET_0 float bang control; #X text 12 105 OUTLET_0 float; #X text 12 5 KEYWORDS control hardware interfacing; #X text 12 85 INLET_1 float; #X restore 571 557 pd META; #X floatatom 335 361 4 0 255 0 - - -; #X text 373 361 alternative way to set control bits; #X text 373 291 set control bits; #X connect 1 0 8 0; #X connect 8 0 19 0; #X connect 17 0 8 0; #X connect 18 0 17 0; #X connect 20 0 8 0; #X connect 24 0 8 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/makesymbol-help.pd000066400000000000000000000061351265051730400262740ustar00rootroot00000000000000#N canvas 0 31 776 744 10; #X obj 57 15 makesymbol; #X text 152 13 makesymbol is something between the "symbol" and the "makefilename" object.; #X text 57 42 Any list (with up to 10 members) on the first input will be applied on a C-like format-string that can be either given as an argument on the second input or as a creation-argument.; #X obj 59 281 makesymbol; #X obj 61 591 makesymbol %s_is_%s; #X msg 14 260 bang; #X msg 11 380 bang; #X msg 10 570 bang; #X msg 232 260 symbol cat; #X msg 65 222 symbol horse; #X msg 69 247 symbol cow; #X obj 58 401 makesymbol house; #X msg 67 370 symbol castle; #X msg 232 235 symbol %ss; #X symbolatom 233 210 0 0 0 0 - - -; #X symbolatom 59 196 0 0 0 0 - - -; #X symbolatom 200 340 0 0 0 0 - - -; #X msg 71 568 list conan back; #X floatatom 128 521 0 0 0 0 - - -; #X obj 61 546 pack s 12; #X msg 69 498 symbol eleven; #X msg 200 359 symbol %d; #X msg 200 378 symbol %s; #X text 288 380 only %s does; #X text 278 357 %d \, %f... won't work properly; #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 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...; #X floatatom 58 340 0 0 0 0 - - -; #X text 317 367 (at least \, you won't get what you normally want) ; #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 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.; #X obj 58 142 makesymbol 1%s_2%s_3%s_4%s_5%s_6%s_7%s_8%s_9%s_10%s; #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 obj 167 684 makefilename; #X obj 167 714 l2s; #X text 260 683 (plain pd!); #X text 260 717 (zexy); #X text 25 651 a personal note: this object is somewhat obsolete \; use the following instead:; #N canvas 460 154 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 135 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION something between the "symbol" and the "makefilename" object.; #X text 12 75 INLET_0 symbol bang list; #X text 12 95 INLET_1 symbol; #X text 12 115 OUTLET_0 symbol; #X text 12 5 KEYWORDS control symbol_op; #X restore 723 717 pd META; #X connect 3 0 32 0; #X connect 3 0 40 0; #X connect 4 0 33 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; #X connect 8 0 3 1; #X connect 9 0 3 0; #X connect 10 0 3 0; #X connect 11 0 31 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; #X connect 15 0 3 0; #X connect 16 0 11 1; #X connect 17 0 4 0; #X connect 18 0 19 1; #X connect 19 0 4 0; #X connect 20 0 19 0; #X connect 21 0 11 1; #X connect 22 0 11 1; #X connect 26 0 41 0; #X connect 29 0 11 0; #X connect 36 0 37 0; #X connect 37 0 34 0; #X connect 41 0 19 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/matchbox-help.pd000066400000000000000000000105751265051730400257410ustar00rootroot00000000000000#N canvas 0 31 640 573 10; #X text 68 38 you can store a number of lists by sending them to its right inlet.; #X text 50 14 [matchbox] - retrieve matching lists; #X text 67 67 when you send a list to the left inlet of [matchbox] \, it will be compared to each stored list \; any matches will be send to the first output of [matchbox]. the number of matches is sent to the 2nd outlet.; #X text 69 132 there are several matching algorithms available. you can choose between them via the "mode" message or by providing an argument at object creation.; #X text 70 176 currently available matching-modes:; #X text 90 195 '==': only matches if lists are exactly equal; #X text 90 207 'OSC': list-atoms are compared using OSC-pattern matching ; #X floatatom 248 450 5 0 0 1 num_results - -; #X obj 205 484 print results; #X msg 250 377 list this is my string \, list this is your string \, list this was my string; #X text 268 431 default is exact matching; #X msg 205 252 list this is my string; #X msg 218 274 list this is no string; #X msg 233 296 list this is * string; #X msg 120 311 mode ==; #X msg 120 333 mode OSC; #X msg 110 412 clear; #X msg 111 455 dump; #X text 28 396 delete all stored lists; #X text 35 438 output all stored lists; #X obj 250 355 loadbang; #X text 303 356 add lists to the pool; #X text 52 292 change matching mode; #X text 90 219 'regex': list-atoms are compared using regular expression pattern-matching; #X msg 120 355 mode regex; #X msg 247 318 list this .+ my string; #X text 394 296 an OSC pattern; #X text 394 319 a regular expression; #N canvas 0 0 556 395 default 0; #X floatatom 100 295 5 0 0 1 num_results - -; #X msg 100 161 list this is my string \, list this is your string \, list this was my string; #X msg 33 90 list this is my string; #X obj 33 238 matchbox OSC; #X obj 33 313 print OSCresults; #X msg 61 123 list this *s * string; #X msg 46 106 list this is * string; #X obj 100 145 loadbang; #X text 57 38 you can give the matching mode as 1st argument to matchbox] ; #X text 118 239 <-- this object does OSC-pattern matching; #X connect 1 0 3 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 1 0 0; #X connect 5 0 3 0; #X connect 6 0 3 0; #X connect 7 0 1 0; #X restore 205 527 pd default mode; #N canvas 220 74 737 499 deleting 0; #X obj 205 284 matchbox; #X obj 205 369 print results; #X msg 248 241 list this is my string \, list this is your string \, list this was my string; #X text 268 286 default is exact matching; #X msg 119 172 mode ==; #X msg 120 190 mode OSC; #X msg 110 267 clear; #X msg 351 342 dump; #X text 37 255 delete all stored lists; #X obj 248 225 loadbang; #X text 301 226 add lists to the pool; #X text 52 154 change matching mode; #X msg 120 210 mode regex; #X text 400 156 an OSC pattern; #X text 398 174 a regular expression; #X msg 205 116 delete this is my string; #X msg 217 135 delete this is no string; #X msg 234 155 delete this is * string; #X msg 247 173 delete this .+ my string; #X text 80 51 you can either "clear" all stored lists \, or "delete" them based pattern matching; #X text 327 316 after you have deleted something \, click "dump" to see the currently stored lists.; #X text 70 426 when "delete"ing \, [matchbox] will output the deleted list(s) with a "deleted" prepended; #X text 73 456 you can use [route delete] to distinguish between 'deleted' and 'found' results; #X connect 0 0 1 0; #X connect 2 0 0 1; #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 9 0 2 0; #X connect 12 0 0 0; #X connect 15 0 0 0; #X connect 16 0 0 0; #X connect 17 0 0 0; #X connect 18 0 0 0; #X restore 205 549 pd deleting; #X text 113 539 more info; #X text 475 15 part of zexy (2.1); #X obj 205 429 matchbox; #N canvas 515 193 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control storage; #X text 12 45 DESCRIPTION retrieve matching lists; #X text 12 65 INLET_0 mode clear dump list; #X text 12 85 INLET_1 list; #X text 12 105 OUTLET_0 list; #X text 12 125 OUTLET_1 float; #X restore 585 548 pd META; #X connect 9 0 32 1; #X connect 11 0 32 0; #X connect 12 0 32 0; #X connect 13 0 32 0; #X connect 14 0 32 0; #X connect 15 0 32 0; #X connect 16 0 32 0; #X connect 17 0 32 0; #X connect 20 0 9 0; #X connect 24 0 32 0; #X connect 25 0 32 0; #X connect 32 0 8 0; #X connect 32 1 7 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/mavg-help.pd000066400000000000000000000015071265051730400250610ustar00rootroot00000000000000#N canvas 0 31 452 302 10; #X obj 119 132 metro 100; #X obj 119 155 random 10; #X floatatom 119 245 4 0 0 0 - - -; #X msg 120 107 1; #X msg 153 108 0; #X obj 119 212 mavg 4; #X floatatom 158 188 4 0 0 0 - - -; #X text 59 20 moving average filter; #X text 199 188 samples to average; #X text 277 47 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION moving average filter; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 float; #X restore 390 271 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/minmax-help.pd000066400000000000000000000014311265051730400254140ustar00rootroot00000000000000#N canvas 0 31 477 241 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 0 - - -; #X floatatom 78 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; #N canvas 515 193 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION get minimum and maximum of a list of floats ; #X text 12 65 INLET_0 list; #X text 12 85 OUTLET_0 float; #X text 12 105 OUTLET_1 float; #X restore 420 212 pd META; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 5 0 2 0; #X connect 6 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/msgfile-help.pd000066400000000000000000000146771265051730400255710ustar00rootroot00000000000000#N canvas 0 31 854 331 10; #X obj 425 235 print done; #X text 72 260 see also:; #X msg 423 39 bang; #X text 314 293 this outlet gets the lines in sequence.; #X obj 73 9 msgfile; #X text 127 9 read and write messages into text files; #X obj 386 201 msgfile; #X obj 133 261 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 text 472 36 output one line as a list and move to the next; #X text 90 201 add2 : read "add too" \; append to an existing line ; #X text 508 222 This outlet gets a bang when you hit the end of the sequence \; it will also get the current position when using "when" ; #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 598 7 part of zexy; #N canvas 112 31 646 300 navigation 0; #X obj 54 272 outlet; #X msg 91 140 rewind; #X text 140 139 go to beginning; #X msg 92 163 end; #X text 139 163 go the the end; #X msg 92 214 skip -1; #X msg 92 238 where; #X text 145 237 where are we now ?; #X text 146 214 go to the th line from here; #X text 142 188 go to line number ; #X text 44 38 navigating through the lines of a [msgfile]; #X text 42 62 these messages will not output any data; #X text 41 80 'where' will output the position of the "cursor" at the 2nd outlet of [msgfile]; #X msg 92 189 goto 8; #X connect 1 0 0 0; #X connect 3 0 0 0; #X connect 5 0 0 0; #X connect 6 0 0 0; #X connect 13 0 0 0; #X restore 423 84 pd navigation; #N canvas 0 0 458 426 data 0; #X obj 54 332 outlet; #X msg 105 143 bang; #X msg 103 231 next; #X msg 102 189 prev; #X msg 103 210 this; #X text 154 140 output one line as a list and move to the next; #X text 151 189 output the previous line; #X text 153 229 output the next line; #X text 151 209 output the current line; #X msg 104 264 flush; #X text 153 263 output all lines; #X text 39 37 get the contents of the [msgfile] line-by-line; #X text 37 63 'prev' \, 'this' \, 'next' and 'flush' will not alter the current "cursor" position.; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 9 0 0 0; #X restore 423 64 pd data retrieval; #N canvas 0 31 669 573 editing 0; #X obj 54 512 outlet; #X msg 137 101 clear; #X msg 140 481 set 2 4 6 8; #X text 246 480 clear and then add one message; #X msg 136 258 add cis boom bah; #X msg 136 277 add2 bang; #X text 190 102 empty the object; #X msg 137 161 delete 2; #X text 272 303 insert a message before the current line; #X text 238 255 add a message at the end of the object; #X msg 137 359 append after the break of dawn; #X text 331 356 add a message at the current position; #X msg 138 437 replace the new day; #X text 330 437 replace the current line; #X msg 136 306 insert before sunrise; #X msg 136 325 insert2 inserted; #X msg 137 378 append2 appendix; #X msg 137 141 delete; #X text 191 142 delete the current line; #X text 194 161 delete the specified line; #X msg 137 180 delete 4 7; #X text 205 181 delete the specified region; #X msg 137 200 delete 7 4; #X text 208 200 delete all but the specified region; #X text 56 39 editing (adding \, modifying \, deleting) the content if the [msgfile]; #X text 237 275 add to the last line (INCOMPATIBLE with [textfile]) ; #X text 275 325 add to the previous line (INCOMPATIBLE with [textfile]) ; #X text 330 379 add to the current line (INCOMPATIBLE with [textfile]) ; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 4 0 0 0; #X connect 5 0 0 0; #X connect 7 0 0 0; #X connect 10 0 0 0; #X connect 12 0 0 0; #X connect 14 0 0 0; #X connect 15 0 0 0; #X connect 16 0 0 0; #X connect 17 0 0 0; #X connect 20 0 0 0; #X connect 22 0 0 0; #X restore 423 104 pd editing; #N canvas 0 21 676 304 searching 0; #X obj 54 272 outlet; #X msg 70 180 find test 6; #X msg 70 239 find test * 7 *; #X text 73 61 searching (and finding) lines within the [msgfile]; #X text 177 241 you can use '*' as a wildchard for a single atom. '*' is the only wildcard supported; #X text 174 178 find a matching list \, starting at the current position ; #X msg 72 208 find the new day; #X text 76 130 if the search fails \, a 'bang' is emitted at the 2nd outlet; #X text 77 99 if the searched list is found \, then the linenumber and the list is output (via the 2nd and 1st outlet).; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 6 0 0 0; #X restore 423 124 pd searching; #N canvas 0 0 853 402 file-i/o 0; #X obj 54 312 outlet; #X text 265 75 read a file; #X text 299 96 write one; #X text 305 164 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 msg 87 76 read msgfile.txt; #X msg 87 168 write /tmp/msgfile2.txt cr; #X msg 87 191 read msgfile2.txt cr; #X msg 87 97 write /tmp/msgfile.txt; #X text 51 26 reading from and writing the contents of [msgfile] to files; #X msg 111 248 write /tmp/msgfile3.txt $$; #X text 331 238 on writing replace every occurence of $$ with a single $. This way you can write pd-patches which can handle arguments.; #X msg 146 291 add #X obj f $\$1; #X msg 92 130 read2 msgfile.txt; #X text 264 131 read file and append it to the current buffer; #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 9 0 0 0; #X connect 11 0 0 0; #X connect 12 0 0 0; #X restore 423 144 pd file-i/o; #N canvas 67 162 450 397 misc 0; #X obj 84 282 outlet; #X msg 84 112 print; #X text 40 72 miscellaneous functionality of [msgfile]; #X text 126 114 debugging printout of the contents to the console; #X connect 1 0 0 0; #X restore 423 164 pd misc; #X obj 386 267 print data; #X text 9 183 incompatible with [textfile] :; #N canvas 652 236 494 344 META 0; #X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 155 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION read and write messages into text files; #X text 12 65 INLET_0 bang prev this next flush rewind end goto skip where clear delete add add2 insert insert2 append append2 replace set find read write read2; #X text 12 135 OUTLET_1 bang; #X text 12 115 OUTLET_0 list; #X restore 800 302 pd META; #X connect 2 0 6 0; #X connect 6 0 25 0; #X connect 6 1 0 0; #X connect 19 0 6 0; #X connect 20 0 6 0; #X connect 21 0 6 0; #X connect 22 0 6 0; #X connect 23 0 6 0; #X connect 24 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/multiline~-help.pd000066400000000000000000000042301265051730400263230ustar00rootroot00000000000000#N canvas 0 31 758 463 10; #X obj 67 43 multiline~; #X text 209 45 line~d multiplication of multiple signals; #X obj 47 191 sig~ 1; #X obj 96 191 sig~ 10; #X floatatom 57 271 4 0 0 0 - - -; #X floatatom 154 272 4 0 0 0 - - -; #X msg 153 171 0 -1; #X obj 57 251 avg~; #X obj 154 252 avg~; #X floatatom 215 198 4 0 0 0 - - -; #X text 252 199 line-time; #X floatatom 121 119 4 0 0 0 - - -; #X text 157 122 multiply all signals with the same value; #X obj 57 213 multiline~ 1 2 50; #X msg 154 144 2 1; #X obj 452 225 multiline~ 1 1 1 1 1000; #X obj 452 243 avg~; #X floatatom 452 262 4 0 0 0 - - -; #X obj 452 183 sig~ 1; #X obj 496 243 avg~; #X floatatom 496 262 4 0 0 0 - - -; #X obj 496 183 sig~ 1; #X obj 540 243 avg~; #X floatatom 540 262 4 0 0 0 - - -; #X obj 540 183 sig~ 1; #X obj 585 244 avg~; #X floatatom 585 263 4 0 0 0 - - -; #X obj 585 184 sig~ 1; #X msg 653 161 0 0 0 0; #X msg 653 197 1 0 2 0; #X msg 653 179 0 1 0 2; #X msg 653 215 1 1; #X text 49 387 creation:; #X obj 121 390 multiline~ g1 g2 g3 ... g fade-time; #X text 194 156 gain1 gain2 ...; #X text 397 384 will make outlets and (n+2) inlets (1 extra for the gain-list \, 1 extra for the fade-time); #X text 551 8 part of zexy; #N canvas 717 266 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 65 INLET_N signal; #X text 12 85 INLET_R list; #X text 12 105 OUTLET_N signal; #X text 12 45 DESCRIPTION line~d multiplication of multiple signals ; #X text 12 5 KEYWORDS signal ramp; #X restore 705 438 pd META; #X connect 2 0 13 0; #X connect 3 0 13 1; #X connect 6 0 13 2; #X connect 7 0 4 0; #X connect 8 0 5 0; #X connect 9 0 13 3; #X connect 11 0 13 2; #X connect 13 0 7 0; #X connect 13 1 8 0; #X connect 14 0 13 2; #X connect 15 0 16 0; #X connect 15 1 19 0; #X connect 15 2 22 0; #X connect 15 3 25 0; #X connect 16 0 17 0; #X connect 18 0 15 0; #X connect 19 0 20 0; #X connect 21 0 15 1; #X connect 22 0 23 0; #X connect 24 0 15 2; #X connect 25 0 26 0; #X connect 27 0 15 3; #X connect 28 0 15 4; #X connect 29 0 15 4; #X connect 30 0 15 4; #X connect 31 0 15 4; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/multiplex-help.pd000066400000000000000000000027301265051730400261510ustar00rootroot00000000000000#N canvas 7 5 666 402 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 [ [ [ ... ]]]" ; #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 0; #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; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION multiplex the selected inlet to the outlet ; #X text 12 5 KEYWORDS control; #X text 12 65 INLET_N anything; #X text 12 85 INLET_R float; #X text 12 105 OUTLET_0 anything; #X restore 608 373 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/multiplex~-help.pd000066400000000000000000000020621265051730400263450ustar00rootroot00000000000000#N canvas 0 31 610 291 10; #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; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION multiplex 1-of-n signals to 1 outlet; #X text 12 65 INLET_0 float signal; #X text 12 105 OUTLET_0 signal; #X text 12 85 INLET_1 signal; #X restore 548 263 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/niagara-help.pd000066400000000000000000000025361265051730400255340ustar00rootroot00000000000000#N canvas 0 31 707 337 10; #X floatatom 86 178 0 0 0 0 - - -; #X obj 29 206 niagara 12; #X obj 29 288 print LEFT; #X obj 86 263 print RIGHT; #X msg 29 100 1 2 3 4 5 6 7 all good children go to heaven; #X obj 119 25 niagara; #X text 201 53 creation : "niagara " creates a niagara-fall with a rock at point ; #X text 116 178 where to divide; #X text 290 219 note :; #X text 337 233 if is passed \, then 2 s appear at the outputs; #X text 337 219 if a is passed \, then 2 s appear at the outputs; #X msg 50 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 318 100 a list; #X text 412 131 not a list \, but works too; #X text 589 12 part of zexy; #N canvas 460 154 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 105 OUTLET_0 anything; #X text 12 45 DESCRIPTION divide a package into 2 sub-packages; #X text 12 5 KEYWORDS control anything_op; #X text 12 65 INLET_0 anything; #X text 12 85 INLET_1 float; #X text 12 125 OUTLET_1 anything; #X restore 648 306 pd META; #X text 334 28 divide a package into 2 sub-packages; #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 11 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/noish~-help.pd000066400000000000000000000047321265051730400254500ustar00rootroot00000000000000#N canvas 0 31 586 410 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 115 358 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 141 358 MUTE; #X text 110 339 output amplitude; #N canvas 460 154 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal random; #X text 12 45 DESCRIPTION draws a random number every n samples and interpolates between; #X text 12 75 INLET_0 float; #X text 12 95 OUTLET_0 signal; #X restore 527 381 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/noisi~-help.pd000066400000000000000000000047211265051730400254470ustar00rootroot00000000000000#N canvas 0 31 487 433 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 116 378 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 142 378 MUTE; #X text 111 359 output amplitude; #X text 409 16 part of zexy; #N canvas 460 154 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal random; #X text 12 45 DESCRIPTION draws a random number every n samples and interpolates between; #X text 12 75 INLET_0 float; #X text 12 95 OUTLET_0 signal; #X restore 429 399 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/operating_system-help.pd000066400000000000000000000017271265051730400275270ustar00rootroot00000000000000#N canvas 6 6 450 223 10; #X obj 77 40 operating_system; #X text 200 40 which OS are we running; #X symbolatom 75 140 10 0 0 0 - - -; #X msg 75 72 bang; #X obj 75 164 select linux windows macos; #X obj 75 190 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 134 190 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #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; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control filesystem; #X text 12 45 DESCRIPTION which OS are we running; #X text 12 65 INLET_0 bang; #X text 12 85 OUTLET_0 symbol; #X restore 395 196 pd META; #X connect 2 0 4 0; #X connect 3 0 8 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 4 2 7 0; #X connect 8 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/pack-help.pd000066400000000000000000000040341265051730400250430ustar00rootroot00000000000000#N canvas 0 31 686 432 10; #X text 491 16 part of zexy; #X obj 28 24 pack; #X text 73 23 - combine several atoms into one message; #X obj 101 238 zexy/pack; #X obj 101 267 print pack; #X floatatom 101 180 5 0 0 0 - - -; #X floatatom 164 197 5 0 0 0 - - -; #X symbolatom 121 160 10 0 0 0 - - -; #X symbolatom 169 215 10 0 0 0 - - -; #X text 46 58 this object is quite the same as pd's built-in [pack] \, but it does not have fixed types; #X text 48 88 an atom can be intialized as a number \, then become a symbol \, later become a number again \, ....; #X floatatom 319 181 5 0 0 0 - - -; #X floatatom 382 198 5 0 0 0 - - -; #X symbolatom 339 161 10 0 0 0 - - -; #X symbolatom 387 216 10 0 0 0 - - -; #X obj 319 239 zexy/pack 1 2 3; #X obj 319 268 print pack1; #X obj 488 273 print pack1; #X msg 488 216 bang; #X msg 277 205 bang; #X msg 65 204 bang; #X obj 488 244 zexy/pack s f another symbol; #X text 65 140 default; #X text 278 142 initialization; #X text 482 139 initialization with symbols; #X text 57 325 a note on symbol-initialization:; #X text 100 344 pd's built-in [pack] does not allow you to initialize symbols in a list \; instead things like 's' and 'f' are used for specifying the _type_ of the atoms.; #X text 103 391 therefore [pack f] will output the number "0" \, while [zexy/pack f] will output a symbol "f"; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 OUTLET_0 list; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION combine several atoms into one message; #X text 12 5 KEYWORDS control list_op; #X text 12 65 INLET_0 anything; #X text 12 85 INLET_N float symbol pointer; #X restore 631 405 pd META; #X connect 3 0 4 0; #X connect 5 0 3 0; #X connect 6 0 3 1; #X connect 7 0 3 0; #X connect 8 0 3 1; #X connect 11 0 15 0; #X connect 12 0 15 1; #X connect 13 0 15 0; #X connect 14 0 15 1; #X connect 15 0 16 0; #X connect 18 0 21 0; #X connect 19 0 15 0; #X connect 20 0 3 0; #X connect 21 0 17 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/packel-help.pd000066400000000000000000000027361265051730400253730ustar00rootroot00000000000000#N canvas 0 31 646 432 10; #X obj 48 34 packel; #X text 112 33 get the nth element of a package; #X floatatom 105 219 0 0 0 0 n - -; #X obj 62 239 packel 3; #X obj 62 268 print ELEMENT; #X obj 62 377 packel -2; #X obj 62 401 print REVERSE_ELEMENT; #X text 146 75 creation: packel []; #X text 185 92 n indicates the index of the element to be output; #X text 185 110 n==0 ouputs the whole package; #X text 185 127 n<0 ouputs the nth-last element; #X text 461 26 part of zexy; #X msg 62 191 list uno dva drei quattre five; #X msg 62 357 list uno dva drei quattre five; #X obj 380 302 print E1; #X obj 441 302 print E2; #X floatatom 410 249 4 -5 5 0 n1 - -; #X obj 380 273 packel 3 -1; #X floatatom 441 250 4 -5 5 1 n2 - -; #X text 380 199 you can also query several elements at once; #X msg 380 225 list uno dva drei quattre five; #X text 63 336 reading from the end of the list; #N canvas 293 85 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION get the nth element of a package; #X text 12 65 INLET_0 list; #X text 12 5 KEYWORDS control list_op; #X text 12 85 OUTLET_0 symbol float pointer; #X restore 587 396 pd META; #X connect 2 0 3 1; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 12 0 3 0; #X connect 13 0 5 0; #X connect 16 0 17 1; #X connect 17 0 14 0; #X connect 17 1 15 0; #X connect 18 0 17 2; #X connect 20 0 17 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/pack~-help.pd000066400000000000000000000024311265051730400252400ustar00rootroot00000000000000#N canvas 0 31 487 386 10; #X floatatom 33 65 0 0 0 0 - - -; #X obj 33 84 osc~ 689.062; #X obj 33 293 unpack 0 0 0; #X obj 190 295 print; #X floatatom 33 332 0 0 0 0 - - -; #X floatatom 100 312 0 0 0 0 - - -; #X obj 33 203 t l l; #X obj 190 255 spigot; #X msg 223 230 1; #X msg 259 230 0; #X obj 33 273 spigot; #X msg 64 253 1; #X msg 90 253 0; #X obj 33 135 pack~; #X text 104 13 pack~; #X text 128 38 convert signals to float-packages; #X text 318 162 see also; #X obj 319 181 unpack~; #X text 48 352 1st and 3rd sample of each signal-vector; #X text 384 9 part of zexy; #X obj 190 275 t l b; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 85 OUTLET_0 list; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION convert signals to lists; #X text 12 65 INLET_0 signal; #X text 12 5 KEYWORDS control list_op conversion; #X restore 431 357 pd META; #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 20 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; #X connect 20 0 3 0; #X connect 20 1 9 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/pdf~-help.pd000066400000000000000000000021561265051730400250770ustar00rootroot00000000000000#N canvas 0 31 767 473 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 (subpatch) 0; #X array array99 128 float 0; #X coords 0 1 128 -1 400 300 1; #X restore 338 111 graph; #X text 532 42 part of zexy; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 85 OUTLET_0 list; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal conversion; #X text 12 45 DESCRIPTION probability density function; #X text 12 65 INLET_0 signal bang float clear; #X restore 711 445 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/prime-help.pd000066400000000000000000000016171265051730400252450ustar00rootroot00000000000000#N canvas 0 31 428 257 10; #X obj 34 32 prime; #X text 82 34 a prime number detector; #X floatatom 51 116 8 0 0 0 - - -; #X obj 51 147 prime; #X msg 51 75 1; #X msg 81 75 2; #X msg 111 75 3; #X msg 142 74 4; #X floatatom 51 187 5 0 0 0 - - -; #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; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION a prime number detector; #X text 12 5 KEYWORDS control; #X text 12 65 INLET_0 float; #X text 12 85 OUTLET_0 float; #X restore 371 226 pd META; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 7 0 2 0; #X connect 9 0 2 0; #X connect 10 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/quantize~-help.pd000066400000000000000000000047171265051730400261730ustar00rootroot00000000000000#N canvas 0 31 705 486 10; #X text 133 46 quantize a signal with a variable step-number; #X msg 119 184 8bit; #X msg 119 160 16bit; #X msg 119 137 float; #X floatatom 120 113 0 0 0 0 - - -; #X obj 26 207 osc~ 440; #X floatatom 26 183 0 0 0 0 - - -; #X obj 87 235 quantize~ 16; #X msg 118 208 help; #X msg 352 77 \; pd dsp 1; #N canvas 0 0 450 300 (subpatch) 0; #X array scope 100 float 0; #X coords 0 1 100 -1 400 300 1; #X restore 295 134 graph; #X obj 139 294 tabwrite~ scope; #X msg 139 269 bang; #X obj 56 45 quantize~; #X floatatom 113 408 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 430 pd output; #X msg 139 408 MUTE; #X text 108 389 output amplitude; #X text 528 15 part of zexy; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION quantize a signal with a variable step-number ; #X text 12 5 KEYWORDS signal; #X text 12 65 INLET_0 float signal 16bit 8bit help; #X text 12 85 OUTLET_0 signal; #X restore 650 456 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/rawprint-help.pd000066400000000000000000000022341265051730400257730ustar00rootroot00000000000000#N canvas 0 31 499 300 10; #X text 303 9 part of zexy; #X obj 34 32 rawprint; #X text 104 34 print a message as raw as possible; #X msg 194 64 1; #X msg 218 94 symbol bla; #X msg 229 131 list 4 2 crash; #X text 40 253 this is similar to the built-in [print] but without trying to hide things from you; #X obj 194 222 rawprint raw; #X obj 318 223 print cooked; #X msg 259 154 gully; #X msg 354 152 symbol \$1; #X msg 354 130 symbol; #N canvas 0 0 450 300 nop 0; #X obj 75 51 inlet; #X obj 75 73 outlet; #X text 57 158 i don't use [trigger anything] here \, as this might do something to the messages.; #X connect 0 0 1 0; #X restore 194 200 pd nop; #N canvas 509 158 494 344 META 0; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 85 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION print a message as raw as possible; #X text 12 65 INLET_0 anything; #X restore 442 275 pd META; #X connect 3 0 12 0; #X connect 4 0 12 0; #X connect 5 0 12 0; #X connect 9 0 12 0; #X connect 10 0 12 0; #X connect 11 0 10 0; #X connect 12 0 7 0; #X connect 12 0 8 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/regex-help-help.pd000066400000000000000000000025361265051730400261720ustar00rootroot00000000000000#N canvas 0 31 427 323 10; #X msg 91 86 symbol a; #X obj 157 245 print DETAILS; #X obj 263 243 print NUMBER_OF_DETAILS; #X msg 36 89 123; #X obj 163 182 regex [0-9]*; #X msg 17 113 5; #X msg 246 121 regex [a-z]; #X msg 110 105 symbol A; #X msg 245 147 symbol [A-Z]; #X text 13 48 test cases; #X text 238 97 regex patterns; #X msg 193 51 case \$1; #X obj 194 26 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X text 253 50 case sensitivity; #X msg 73 66 symbol abcABC; #X obj 47 245 print RESULT; #X floatatom 140 207 5 0 0 0 - - -; #X floatatom 261 206 5 0 0 0 - - -; #N canvas 717 266 494 344 META 0; #X text 12 195 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 175 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION check whether a symbol matches a regular expression; #X text 12 5 KEYWORDS control; #X text 12 75 INLET_0 case list regex; #X text 12 95 INLET_1 symbol; #X text 12 115 OUTLET_0 float; #X text 12 135 OUTLET_1 list; #X text 12 155 OUTLET_2 float; #X restore 371 292 pd META; #X connect 0 0 4 0; #X connect 3 0 4 0; #X connect 4 0 15 0; #X connect 4 0 16 0; #X connect 4 1 1 0; #X connect 4 2 2 0; #X connect 4 2 17 0; #X connect 5 0 4 0; #X connect 6 0 4 0; #X connect 7 0 4 0; #X connect 8 0 4 1; #X connect 11 0 4 0; #X connect 12 0 11 0; #X connect 14 0 4 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/regex-help.pd000066400000000000000000000035031265051730400252370ustar00rootroot00000000000000#N canvas 0 31 458 529 10; #X floatatom 98 295 0 0 0 0 - - -; #X text 353 6 part of zexy; #X obj 17 36 regex; #X text 74 36 -- check whether a symbol matches a regular expression ; #X symbolatom 267 212 10 0 0 0 - - -; #X symbolatom 169 167 10 0 0 0 - - -; #X msg 50 143 case \$1; #X obj 56 121 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 46 327 print result; #X obj 126 327 print details; #X obj 212 327 print num; #X obj 245 178 symbol; #X msg 284 141 Ab; #X msg 293 170 bA; #X msg 297 191 bAc; #X msg 245 145 aba; #X msg 104 80 list a a a; #X text 11 352 list of details:; #X text 124 447 for more info \, see: http://www.delorie.com/gnu/docs/regex/regex_toc.html ; #X text 34 368 1) ID number of match (in case of multiple matches) ; #X text 34 417 3) position of the end of the match (or last character if no match); #X text 34 388 2) position of the start of the match (or first character if no match; #X obj 103 264 regex; #N canvas 717 266 494 344 META 0; #X text 12 195 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 175 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION check whether a symbol matches a regular expression; #X text 12 5 KEYWORDS control; #X text 12 75 INLET_0 case list regex; #X text 12 95 INLET_1 symbol; #X text 12 115 OUTLET_0 float; #X text 12 135 OUTLET_1 list; #X text 12 155 OUTLET_2 float; #X restore 402 495 pd META; #X msg 125 139 list aba Aa Ac; #X msg 222 89 list bA bA; #X connect 4 0 22 1; #X connect 5 0 22 0; #X connect 6 0 22 0; #X connect 7 0 6 0; #X connect 11 0 22 0; #X connect 12 0 11 0; #X connect 13 0 11 0; #X connect 14 0 11 0; #X connect 15 0 11 0; #X connect 16 0 22 0; #X connect 22 0 0 0; #X connect 22 0 8 0; #X connect 22 1 9 0; #X connect 22 2 10 0; #X connect 24 0 22 0; #X connect 25 0 22 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/relay-help.pd000066400000000000000000000061401265051730400252410ustar00rootroot00000000000000#N canvas 0 31 778 668 10; #X text 625 11 part of; #X obj 700 10 zexy; #X obj 183 223 print x1; #X obj 261 223 print x2; #X obj 339 223 print x3; #X obj 422 223 print x4; #X obj 183 195 relay 23 54 1; #X msg 183 165 234 345 456; #X msg 308 165 23 34 45; #X msg 414 165 54 43; #X msg 485 165 1 foo bar; #X msg 254 257 impeach ringo starr; #X obj 191 285 relay big apple; #X msg 435 258 apple pie; #X msg 191 257 1 2 3; #X msg 523 258 big apple pie; #X msg 578 165 walk the dog; #X text 45 43 Relay checks the first element of a message against each of its arguments \, which may be numbers or symbols (but not a mixture of the two.); #X text 19 195 numeric arguments:; #X text 17 285 symbolic arguments:; #X obj 157 499 print z1; #X obj 233 499 print z2; #X msg 124 434 bang; #X msg 170 434 list; #X msg 213 434 5; #X msg 251 434 float 5; #X msg 320 434 list 5; #X msg 385 434 symbol pie; #X msg 560 434 pie; #X msg 483 434 list pie; #X msg 70 434 1 2 3; #X obj 157 471 relay list float symbol bang; #X obj 310 499 print z3; #X obj 387 499 print z4; #X obj 461 499 print z5; #X obj 191 315 print y1; #X obj 269 315 print y2; #X obj 347 315 print y3; #X text 76 354 To avoid confusion between \, say \, the number 5 and the list contining only the number 5 \, both messages match "float" \, and ditto for symbols. An empty list matches "bang". In Pd these are all considered special cases of lists.; #X text 97 9 - relay messages according to their first element; #X obj 43 8 relay; #X text 44 93 If a match is found \, the complete(!) message appears on the corresponding outlet. If no match \, the message is repeated to the last "rejection" outlet. The number of outlets is the number of arguments plus one.; #X obj 624 541 route; #X text 72 576 the only difference is \, that a matching first element is NOT stripped from the message.; #X text 76 619 (btw \, this help patch has been taken from [route]) ; #X text 72 543 [relay] is very similar to pd's built-in object [route] ; #X text 612 520 see also; #X text 72 644 NOTE: "relay" as in "mail relay" \, not as in "reed relay"; #N canvas 509 158 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control; #X text 12 65 INLET_0 anything; #X text 12 85 INLET_N anything; #X text 12 105 INLET_R anything; #X text 12 45 DESCRIPTION relay messages according to their first element ; #X restore 715 637 pd META; #X connect 6 0 2 0; #X connect 6 1 3 0; #X connect 6 2 4 0; #X connect 6 3 5 0; #X connect 7 0 6 0; #X connect 8 0 6 0; #X connect 9 0 6 0; #X connect 10 0 6 0; #X connect 11 0 12 0; #X connect 12 0 35 0; #X connect 12 1 36 0; #X connect 12 2 37 0; #X connect 13 0 12 0; #X connect 14 0 12 0; #X connect 15 0 12 0; #X connect 16 0 6 0; #X connect 22 0 31 0; #X connect 23 0 31 0; #X connect 24 0 31 0; #X connect 25 0 31 0; #X connect 26 0 31 0; #X connect 27 0 31 0; #X connect 28 0 31 0; #X connect 29 0 31 0; #X connect 30 0 31 0; #X connect 31 0 20 0; #X connect 31 1 21 0; #X connect 31 2 32 0; #X connect 31 3 33 0; #X connect 31 4 34 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/repack-help.pd000066400000000000000000000023741265051730400253770ustar00rootroot00000000000000#N canvas 0 31 684 547 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 " create packages of the length n; #X text 582 11 part of zexy; #N canvas 509 158 494 344 META 0; #X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 155 AUTHOR IOhannes m zmoelnig; #X text 12 95 INLET_0 anything; #X text 12 45 DESCRIPTION (re)packs (packages of) floats/symbols/pointers/anythings to packages of a (given) size; #X text 12 115 INLET_1 float; #X text 12 135 OUTLET_0 anything; #X text 12 5 KEYWORDS control anything_op; #X restore 625 517 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/repeat-help.pd000066400000000000000000000021651265051730400254100ustar00rootroot00000000000000#N canvas 0 31 578 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; #X text 210 15 - repeat a message several times.; #X text 64 53 similar to [until] but doesn't output [bang( but whatever comes in; #X floatatom 99 237 5 0 0 0 - - -; #X text 76 152 repeat bangs; #X text 295 179 repeat a list; #X text 162 262 creation argument initializes the number of repeats ; #X msg 82 207 set 5; #X text 130 208 repeat anything; #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; #N canvas 509 158 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 65 INLET_0 anything; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 anything; #X text 12 5 KEYWORDS control anything_op; #X text 12 45 DESCRIPTION repeat a message several times.; #X restore 524 305 pd META; #X connect 0 0 11 0; #X connect 1 0 11 0; #X connect 5 0 11 1; #X connect 9 0 11 0; #X connect 11 0 13 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/route~-help.pd000066400000000000000000000016741265051730400254700ustar00rootroot00000000000000#N canvas 0 31 514 347 10; #X obj 65 92 osc~ 440; #X floatatom 65 61 0 0 0 0 - - -; #X text 412 11 part of zexy; #X msg 82 281 bang; #X obj 125 22 route~; #X text 177 21 separate signals from messages; #X obj 65 304 print~ signal; #X obj 104 223 print message; #X obj 65 200 route~; #X msg 107 128 2; #X symbolatom 127 155 10 0 0 0 - - -; #X msg 130 177 whatever; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION separate signals from messages; #X text 12 65 INLET_0 anything signal; #X text 12 85 OUTLET_0 signal; #X text 12 105 OUTLET_1 anything; #X restore 461 319 pd META; #X connect 0 0 8 0; #X connect 1 0 0 0; #X connect 3 0 6 0; #X connect 8 0 6 0; #X connect 8 1 7 0; #X connect 9 0 8 0; #X connect 10 0 8 0; #X connect 11 0 8 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/scalarmult-help.pd000066400000000000000000000041231265051730400262730ustar00rootroot00000000000000#N canvas 16 7 694 398 10; #X text 100 16 scalar multilicaton ("dot"); #X msg 41 66 1 2 3; #X msg 80 92 4 3 2; #X obj 41 151 print; #X msg 147 67 1 2 3; #X msg 205 95 4 3 2; #X obj 147 152 print; #X obj 147 126 . 10 10 1; #X obj 41 125 .; #X msg 345 69 1 2 3; #X obj 345 154 print; #X msg 451 70 1 2 3; #X obj 451 155 print; #X floatatom 379 103 4 0 0 0 - - -; #X obj 451 129 . 7; #X floatatom 484 104 4 0 0 0 - - -; #X obj 32 326 .; #X msg 32 247 1 2 3; #X msg 148 248 1 2 3; #X obj 148 324 . 0; #X text 28 212 these are NOT the same !!; #X obj 148 355 print SCAL; #X obj 32 355 print VECT; #X msg 48 281 2 2 1; #X msg 84 307 3; #X msg 177 300 2 2 1; #X msg 164 277 3; #X text 203 276 good; #X text 217 300 bad; #X text 96 281 good; #X text 110 305 bad; #X text 300 214 tricky:; #X obj 311 333 print; #X msg 327 283 1 2 3; #X floatatom 311 257 4 0 0 0 - - -; #X obj 311 310 .; #X obj 416 340 print; #X msg 416 294 1 2 3; #X obj 416 317 .; #X obj 416 272 t b l; #X floatatom 416 248 4 0 0 0 - - -; #X text 462 273 note that we "cast" the float to list; #X text 559 21 part of zexy; #X obj 53 15 .; #X obj 345 128 . 0; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 OUTLET_0 list; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION scalar multilicaton ("dot"); #X text 12 65 INLET_0 list; #X text 12 85 INLET_1 list; #X restore 638 367 pd META; #X connect 1 0 8 0; #X connect 2 0 8 1; #X connect 4 0 7 0; #X connect 5 0 7 1; #X connect 7 0 6 0; #X connect 8 0 3 0; #X connect 9 0 44 0; #X connect 11 0 14 0; #X connect 13 0 44 1; #X connect 14 0 12 0; #X connect 15 0 14 1; #X connect 16 0 22 0; #X connect 17 0 16 0; #X connect 18 0 19 0; #X connect 19 0 21 0; #X connect 23 0 16 1; #X connect 24 0 16 1; #X connect 25 0 19 1; #X connect 26 0 19 1; #X connect 33 0 35 1; #X connect 34 0 35 0; #X connect 35 0 32 0; #X connect 37 0 38 0; #X connect 38 0 36 0; #X connect 39 0 37 0; #X connect 39 1 38 1; #X connect 40 0 39 0; #X connect 44 0 10 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/sf-play_record-help.pd000066400000000000000000000071601265051730400270410ustar00rootroot00000000000000#N canvas 539 295 609 448 10; #X obj 436 322 sfplay 2; #X obj 38 325 sfrecord 2; #X msg 436 140 help; #X msg 436 166 open test.raw l; #X msg 436 189 start; #X msg 485 189 bang; #X msg 525 189 1; #X msg 436 212 stop; #X msg 525 212 0; #X msg 436 261 goto 100; #X msg 436 238 rewind; #X msg 507 296 done; #X obj 507 321 print; #X msg 38 141 help; #X msg 38 190 start; #X msg 38 214 stop; #X msg 38 238 close; #X msg 38 166 open test.raw l; #X msg 38 263 bang; #X floatatom 38 351 0 0 0 0 - - -; #X text 72 351 status (1-recording / 0-not_recording); #X obj 45 301 osc~ 100; #X obj 113 301 osc~ 578; #X msg 436 287 close; #X text 122 19 a little harddisk-recording system; #X text 77 264 retrigger status-output; #X text 135 325 sfrecord/sfplay ; #X text 53 49 this makes it possible to do multi-track recordings; #X text 52 64 up to now \, the "sfrecord" only supports .RAW format ; #X text 51 78 "sfplay" can skip any header \, if you know it's size:: just call "sfplay ; #X floatatom 471 356 0 0 0 0 - - -; #N canvas 160 49 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 378 pd output; #X msg 500 356 MUTE; #X text 111 363 output amplitude; #X text 435 9 part of zexy; #N canvas 589 163 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION a little harddisk recording system; #X text 12 65 INLET_0 float bang help open start stop rewind goto close ; #X text 12 105 OUTLET_N signal; #X text 12 125 OUTLET_R bang; #X text 12 85 INLET_1 float; #X text 12 5 KEYWORDS signal soundfile; #X restore 528 417 pd META; #X floatatom 514 272 5 0 0 2 undocumented - -; #X text 212 164 open ; #X text 54 106 you might be able to change the via the 2nd inlet of sfplay \, but thats a hidden feature.; #X connect 0 0 31 0; #X connect 0 1 31 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 30 0 31 2; #X connect 31 0 30 0; #X connect 32 0 31 3; #X connect 36 0 0 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/sigzero~-help.pd000066400000000000000000000061751265051730400260150ustar00rootroot00000000000000#N canvas 4 50 548 454 10; #X obj 75 195 sigzero~; #X obj 75 147 sig~; #X floatatom 75 89 0 0 0 0 - - -; #X floatatom 75 222 0 0 0 0 - - -; #X obj 113 273 print signal; #X obj 113 224 select 0; #X msg 113 249 off; #X msg 172 248 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 132 121 bang; #X msg 131 145 off; #X floatatom 131 168 0 0 0 0 - - -; #X text 212 123 turn the detector on; #X text 212 148 turn it off; #X text 213 170 turn it on/off; #X text 110 88 try me; #X obj 72 303 adc~ 1; #X obj 131 330 sigzero~; #X text 209 330 that's how i use it; #X floatatom 98 408 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 73 430 pd output; #X msg 124 408 MUTE; #X text 93 389 output amplitude; #X text 445 12 part of zexy; #N canvas 558 166 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 45 DESCRIPTION detects whether there is a signal or not (e.g. zeroes throughout); #X text 12 5 KEYWORDS signal analysis; #X text 12 75 INLET_0 signal bang off float; #X text 12 95 OUTLET_0 float; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X restore 491 425 pd META; #N canvas 4 50 551 343 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 73 364 pd sub; #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 18 0; #X connect 17 0 26 0; #X connect 18 0 26 1; #X connect 20 0 21 1; #X connect 21 0 20 0; #X connect 22 0 21 2; #X connect 26 0 21 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/sort-help.pd000066400000000000000000000051331265051730400251150ustar00rootroot00000000000000#N canvas 0 31 689 468 10; #X obj 95 193 print UNSORTED; #X msg 37 67 bang; #X obj 198 13 sort; #X text 314 77 any package-elements that are non-float will be interpreted as "0.0".; #X text 270 77 note :; #X obj 56 295 sort 1; #X obj 56 420 print ASCENDING; #X obj 37 337 sort -1; #X obj 37 442 print DESCENDING; #X text 278 287 creation : "sort []"; #X text 457 300 dir < 0 :: descending sort; #X text 456 287 dir >= 0 :: ascending sort; #X text 460 318 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 155 pd randompackage; #X msg 72 120 -----; #X obj 37 101 t b b; #X floatatom 94 228 0 0 0 0 - - -; #X text 128 230 direction; #X obj 37 173 t l l l l; #X obj 75 247 sort; #X obj 75 398 print SORTED; #X text 237 13 shell-sort a package of floats; #X text 553 6 part of zexy; #X obj 81 362 print indicesD; #X obj 93 317 print indicesA; #X obj 72 137 print -----; #X text 269 152 the second outlet gives the indices of the input data. ; #N canvas 558 166 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION shell sort a package of floats; #X text 12 65 INLET_0 list; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 list; #X text 12 125 OUTLET_1 list; #X text 12 5 KEYWORDS control list_op; #X restore 631 435 pd META; #X connect 1 0 15 0; #X connect 5 0 6 0; #X connect 5 1 24 0; #X connect 7 0 8 0; #X connect 7 1 23 0; #X connect 13 0 18 0; #X connect 14 0 25 0; #X connect 15 0 13 0; #X connect 15 1 14 0; #X connect 16 0 19 1; #X connect 18 0 7 0; #X connect 18 1 5 0; #X connect 18 2 19 0; #X connect 18 3 0 0; #X connect 19 0 20 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/step~-help.pd000066400000000000000000000072051265051730400253010ustar00rootroot00000000000000#N canvas 0 0 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; #X msg 186 283 1; #N canvas 0 0 566 451 application 0; #X obj 98 198 sig~ 440; #X obj 98 221 osc~; #X obj 98 245 *~; #X obj 159 221 osc~; #X obj 159 245 *~; #X obj 159 198 sig~ 550; #X floatatom 98 173 0 0 0 0 - - -; #X floatatom 159 173 0 0 0 0 - - -; #X obj 286 199 sig~ -1; #X obj 238 199 step~; #X msg 268 176 0; #X msg 301 176 44100; #X floatatom 348 176 0 0 0 0 - - -; #X msg 238 152 bang; #X text 203 128 toggle::press; #X text 48 33 This \, of course \, is a quite barbarious use of the step~-object; #X text 134 61 but it was fast to do and I do think it illustrates the way it works.; #X floatatom 188 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 159 380 pd output; #X msg 217 352 MUTE; #X text 183 333 output amplitude; #X obj 159 300 +~; #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 397 187 pd application; #N canvas 460 154 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 135 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION produces a unit:step:sequence or a rectangle window; #X text 12 75 INLET_0 float bang; #X text 12 95 INLET_1 float; #X text 12 115 OUTLET_0 signal; #X text 12 5 KEYWORDS signal conversion; #X restore 571 342 pd META; #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 17 0; #X connect 6 0 0 0; #X connect 6 1 1 0; #X connect 17 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/strcmp-help.pd000066400000000000000000000025441265051730400254410ustar00rootroot00000000000000#N canvas 0 31 628 559 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!!; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control list_op; #X text 12 45 DESCRIPTION compare two lists as if they were strings ; #X text 12 65 INLET_0 list float; #X text 12 85 INLET_1 list; #X text 12 105 OUTLET_0 float; #X restore 573 531 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/sum-help.pd000066400000000000000000000013261265051730400247320ustar00rootroot00000000000000#N canvas 0 31 421 294 10; #X floatatom 72 206 4 0 0 0 - - -; #X text 324 19 part of zexy; #X obj 72 186 sum; #X obj 77 40 sum; #X text 109 41 sum the elements of a list; #X msg 72 79 1; #X msg 83 108 1 2 3 4 5 6 7 8 9 10; #X msg 93 141 1000 3 2 -100 2 12; #N canvas 431 117 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control list_op; #X text 12 45 DESCRIPTION sum the elements of a list; #X text 12 65 INLET_0 list; #X text 12 85 OUTLET_0 float; #X restore 361 262 pd META; #X connect 2 0 0 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 7 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/swap~-help.pd000066400000000000000000000047761265051730400253120ustar00rootroot00000000000000#N canvas 0 0 699 487 10; #X obj 97 261 swap~; #X text 138 72 this object first converts the signal to 16bit \, then swaps upper and lower byte.; #X msg 120 173 0; #X msg 120 149 1; #X msg 119 198 bang; #X obj 33 228 osc~ 440; #X floatatom 33 204 0 0 0 0 - - -; #X msg 119 223 help; #X msg 533 54 \; pd dsp 1; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 100 float 0; #X coords 0 1 100 -1 400 300 1; #X restore 278 134 graph; #X msg 143 260 bang; #X text 159 198 toggle; #X text 152 148 on; #X text 154 172 off; #X obj 87 27 swap~; #X text 149 25 byte-swap a 16bit signal; #X floatatom 126 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 97 380 pd output; #X msg 155 352 MUTE; #X text 121 333 output amplitude; #X text 513 29 part of zexy; #X obj 143 285 tabwrite~ \$0-scope; #N canvas 623 80 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION byte-swap a 16 bit signal; #X text 12 65 INLET_0 signal float bang help; #X text 12 85 OUTLET_0 signal; #X text 12 5 KEYWORDS signal; #X restore 643 461 pd META; #X connect 0 0 17 0; #X connect 0 0 21 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 10 0 21 0; #X connect 16 0 17 1; #X connect 17 0 16 0; #X connect 18 0 17 2; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/symbol2list-help.pd000066400000000000000000000035451265051730400264160ustar00rootroot00000000000000#N canvas 4 50 648 517 10; #X symbolatom 35 487 22 0 0 0 - - -; #X symbolatom 107 363 10 0 0 0 - - -; #X obj 95 18 symbol2list; #X text 179 18 convert a symbol into a list; #X obj 418 20 s2l; #X symbolatom 66 470 16 0 0 0 - - -; #X symbolatom 97 453 10 0 0 0 - - -; #X msg 35 67 symbol a_dash_separated_list; #X msg 107 328 symbol -; #X msg 130 176 symbol _i; #X obj 130 196 t b s; #X obj 35 418 unpack s s s s; #X symbolatom 128 437 10 0 0 0 - - -; #X msg 119 88 symbol what_is-the_de-limiter_i-ask-(_i) ?; #X text 296 447 see also:; #X obj 407 447 list2symbol; #X text 213 159 by default \, list-elements are separated by spaces. You can set the separator to any symbol either with an argument or by setting the second inlet; #X text 210 210 using a zero-symbol as delimiter will break the symbol up into its characters.; #X msg 216 247 symbol; #X obj 216 266 t b s; #X text 181 363 delimiter; #X text 335 370 banging the object will re-parse the list-symbol; #X text 492 448 which does the inverse; #X obj 35 398 symbol2list _; #X text 560 14 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 65 DESCRIPTION convert a symbol into a list; #X text 12 25 KEYWORDS control conversion list_op symbol_op; #X text 12 5 ALIAS s2l; #X text 12 85 INLET_0 symbol; #X text 12 105 INLET_1 symbol; #X text 12 125 OUTLET_0 list; #X restore 598 496 pd META; #X msg 301 369 bang; #X connect 1 0 23 1; #X connect 7 0 23 0; #X connect 8 0 1 0; #X connect 9 0 10 0; #X connect 10 0 23 0; #X connect 10 1 1 0; #X connect 11 0 0 0; #X connect 11 1 5 0; #X connect 11 2 6 0; #X connect 11 3 12 0; #X connect 13 0 23 0; #X connect 18 0 19 0; #X connect 19 0 23 0; #X connect 19 1 1 0; #X connect 23 0 11 0; #X connect 26 0 23 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/tabdump-help.pd000066400000000000000000000021271265051730400255620ustar00rootroot00000000000000#N canvas 3 3 728 317 10; #N canvas 0 0 450 300 (subpatch) 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 513 117 graph; #X obj 193 138 loadbang; #X obj 23 168 tabdump my_array66; #X msg 23 100 bang; #X obj 23 193 print; #X msg 73 148 set my_array77; #X msg 193 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 116 22 tabdump; #X text 213 24 dump the contents of a table as a list; #X msg 72 126 set my_array66; #X text 555 22 part of zexy; #N canvas 515 193 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 list; #X text 12 45 DESCRIPTION dump the contents of a table as a list; #X text 12 65 INLET_0 bang set; #X text 12 5 KEYWORDS control array list_op; #X restore 668 286 pd META; #X connect 1 0 6 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 5 0 2 0; #X connect 9 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/tabminmax-help.pd000066400000000000000000000027541265051730400261140ustar00rootroot00000000000000#N canvas 1 4 848 357 10; #N canvas 0 0 450 300 (subpatch) 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 633 87 graph; #X obj 473 208 loadbang; #X msg 63 100 bang; #X msg 113 148 set my_array77; #X msg 473 234 \; 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 112 126 set my_array66; #X text 628 24 part of zexy; #X obj 156 22 tabminmax; #X text 236 24 get the minimum and the maximum of a table; #X obj 63 168 tabminmax my_array66; #X obj 63 192 unpack; #X floatatom 63 217 0 0 0 0 minimum - -; #X floatatom 100 218 2 0 0 3 idx - -; #X obj 193 192 unpack; #X floatatom 193 217 0 0 0 0 maximum - -; #X floatatom 230 218 2 0 0 3 idx - -; #X text 129 81 additionally this object gets the indices of the maxima. ; #N canvas 583 406 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control array; #X text 12 45 DESCRIPTION get the minimum and the maximum of a table ; #X text 12 65 INLET_0 bang set; #X text 12 105 OUTLET_1 float; #X text 12 85 OUTLET_0 float; #X restore 791 327 pd META; #X connect 1 0 4 0; #X connect 2 0 9 0; #X connect 3 0 9 0; #X connect 5 0 9 0; #X connect 9 0 10 0; #X connect 9 1 13 0; #X connect 10 0 11 0; #X connect 10 1 12 0; #X connect 13 0 14 0; #X connect 13 1 15 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/tabset-help.pd000066400000000000000000000021261265051730400254070ustar00rootroot00000000000000#N canvas 0 31 629 295 10; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0_array1 5 float 1; #A 0 0.3 0.2 0.5 0.2 -0.1; #X array \$0_array2 8 float 1; #A 0 0.1 0.2 0.3 0.5 0.8 0.13 0.21 0.34; #X coords 0 1 8 -1 200 140 1; #X restore 413 97 graph; #X msg 23 73 1 0.7 0.5 0.3 0.2 0.1; #X text 441 28 part of zexy; #X obj 116 22 tabset; #X text 173 22 set the contents of a table via a list; #X obj 23 208 tabset \$0_array1; #X msg 72 154 set \$1; #X floatatom 37 95 4 0 0 0 - - -; #X obj 72 133 symbol \$0_array1; #X msg 72 115 bang; #X msg 174 114 bang; #X obj 174 132 symbol \$0_array2; #N canvas 583 406 494 344 META 0; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 85 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control array; #X text 12 45 DESCRIPTION set the contents of a table via a list; #X text 12 65 INLET_0 list float bang; #X restore 574 267 pd META; #X connect 1 0 5 0; #X connect 6 0 5 0; #X connect 7 0 5 0; #X connect 8 0 6 0; #X connect 9 0 8 0; #X connect 10 0 11 0; #X connect 11 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/tavg~-help.pd000066400000000000000000000022401265051730400252610ustar00rootroot00000000000000#N canvas 0 31 518 348 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; #N canvas 460 154 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION calculates the arithmetic mean of a signal between 2 bangs; #X text 12 75 INLET_0 signal bang; #X text 12 95 OUTLET_0 float; #X text 12 5 KEYWORDS signal conversion; #X restore 463 319 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/test.mtx000066400000000000000000000000441265051730400243600ustar00rootroot00000000000000matrix 3 4 1 2 3 4 1 6 6 1 4 3 2 10 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/time-help.pd000066400000000000000000000024521265051730400250650ustar00rootroot00000000000000#N canvas 0 31 408 358 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; #N canvas 427 125 494 344 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 185 AUTHOR IOhannes m zmoelnig; #X text 12 105 OUTLET_0 float; #X text 12 65 DESCRIPTION get the system time; #X text 12 25 KEYWORDS control; #X text 12 85 INLET_0 bang; #X text 12 125 OUTLET_1 float; #X text 12 145 OUTLET_2 float; #X text 12 165 OUTLET_3 float; #X text 12 5 NAME time time_GMT; #X restore 353 329 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/unpack-help.pd000066400000000000000000000026751265051730400254170ustar00rootroot00000000000000#N canvas 0 31 618 378 10; #X text 511 26 part of zexy; #X text 68 98 an atom can be intialized as a number \, then become a symbol \, later become a number again \, ....; #X obj 121 268 zexy/unpack; #X msg 121 192 1 2; #X msg 158 243 bang; #X obj 48 34 unpack; #X text 102 38 - split a message to atoms; #X text 66 68 this object is quite the same as pd's built-in [unpack] \, but it does not have fixed types; #X obj 409 249 zexy/unpack 1 2 3; #X msg 140 215 list a list is a list; #X msg 409 175 1 2; #X msg 446 226 bang; #X msg 428 198 list a list is a list; #X text 129 144 creation arguments specify the _number_ of atoms expected (default 2); #X obj 141 297 print unpack2; #X obj 121 317 print unpack1; #X obj 409 268 print upack1; #X obj 506 268 print upack3; #X obj 457 289 print upack2; #N canvas 460 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION split a message to atoms; #X text 12 65 INLET_0 list bang float symbol pointer; #X text 12 85 OUTLET_N bang float symbol pointer; #X text 12 5 KEYWORDS control conversion list_op; #X restore 564 347 pd META; #X connect 2 0 15 0; #X connect 2 1 14 0; #X connect 3 0 2 0; #X connect 4 0 2 0; #X connect 8 0 16 0; #X connect 8 1 18 0; #X connect 8 2 17 0; #X connect 9 0 2 0; #X connect 10 0 8 0; #X connect 11 0 8 0; #X connect 12 0 8 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/unpack~-help.pd000066400000000000000000000104661265051730400256120ustar00rootroot00000000000000#N canvas 0 31 675 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~ []"; #X text 255 181 : in samples (defaults to 64) \; could be fine if you don't have a constant stream of floats; #N canvas 0 31 845 529 example 0; #X obj 69 75 osc~ 689.062; #X obj 69 123 pack~; #X obj 69 94 *~ 0.2; #X obj 69 203 f; #X obj 69 252 unpack~; #X floatatom 69 50 0 0 0 0 - - -; #X text 74 6 a simple samplerate-reducer; #X text 116 129 samplerate = 44.1kHz; #X text 126 205 samplerate = 5.5125kHz; #X text 108 303 reconstructed signal @ 44.1kHz; #X msg 69 223 \$1 \$1 \$1 \$1 \$1 \$1 \$1 \$1; #N canvas 0 0 450 300 (subpatch) 0; #X array high_rate 64 float 0; #X coords 0 1 63 -1 300 200 1; #X restore 526 13 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array low_rate 64 float 0; #X coords 0 1 63 -1 300 200 1; #X restore 526 241 graph; #X obj 180 114 tabsend~ high_rate; #X obj 156 284 tabsend~ low_rate; #X msg 349 179 \; pd dsp 1; #X floatatom 367 91 0 0 0 0 - - -; #X msg 418 91 MUTE; #X floatatom 116 357 0 0 0 0 - - -; #X msg 164 357 MUTE; #N canvas 159 26 734 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-lvlR; #X obj 338 210 s \$0master-lvlR; #X obj 199 100 s \$0master-lvlR; #X obj 397 92 r \$0master-lvlR; #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 25 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 316 114 pd output Right; #N canvas 159 26 734 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-lvlL; #X obj 199 100 s \$0master-lvlL; #X obj 338 210 s \$0master-lvlL; #X obj 397 92 r \$0master-lvlL; #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 69 380 pd output Left; #X obj 69 144 repack 8; #X connect 0 0 2 0; #X connect 1 0 22 0; #X connect 2 0 1 0; #X connect 2 0 13 0; #X connect 2 0 20 0; #X connect 3 0 10 0; #X connect 4 0 14 0; #X connect 4 0 21 0; #X connect 5 0 0 0; #X connect 10 0 4 0; #X connect 16 0 20 1; #X connect 17 0 20 2; #X connect 18 0 21 1; #X connect 19 0 21 2; #X connect 20 0 16 0; #X connect 21 0 18 0; #X connect 22 0 3 0; #X restore 85 249 pd example; #X text 530 34 part of zexy; #N canvas 533 307 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal conversion list_op; #X text 12 45 DESCRIPTION convert a list of floats to a signal; #X text 12 65 INLET_0 list; #X text 12 85 OUTLET_0 signal; #X restore 614 264 pd META; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/urn-help.pd000066400000000000000000000044771265051730400247440ustar00rootroot00000000000000#N canvas 4 50 488 488 10; #X obj 76 35 urn; #X text 73 75 generates random numbers without repetition; #X floatatom 25 290 5 0 0 1 urn - -; #X obj 25 259 urn 10; #X text 97 257 generates integer numbers between 0..(n-1); #X text 57 110 do generate!; #X floatatom 92 223 5 0 0 0 - - -; #X text 132 221 set (n); #X msg 80 141 seed 10; #X text 134 142 set the seed \, so you can reproduce the random-numbers ; #X msg 82 178 clear; #X text 126 177 put all the numbers back.; #X obj 62 333 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 106 35 a Unique Random Numbers generator; #X text 79 332 when all the numbers have been drawn from the pool \, the system is reset (the numbers are put back) and a bang is emitted via the second outlet; #N canvas 144 58 450 344 lotto 0; #X text 44 35 in austria \, lotto is 6-of-45; #X obj 88 133 urn 45; #X obj 88 161 + 1; #X obj 88 184 repack 6; #X obj 88 52 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 88 233 unpack 0 0 0 0 0 0; #X floatatom 88 253 2 0 0 0 - - -; #X floatatom 112 253 2 0 0 0 - - -; #X floatatom 136 253 2 0 0 0 - - -; #X floatatom 160 253 2 0 0 0 - - -; #X floatatom 184 253 2 0 0 0 - - -; #X floatatom 209 253 2 0 0 0 - - -; #X obj 88 207 sort; #X obj 88 112 until; #X msg 88 90 6; #X obj 88 71 t b b; #X msg 118 90 clear; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 12 0; #X connect 4 0 15 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 5 2 8 0; #X connect 5 3 9 0; #X connect 5 4 10 0; #X connect 5 5 11 0; #X connect 12 0 5 0; #X connect 13 0 1 0; #X connect 14 0 13 0; #X connect 15 0 14 0; #X connect 15 1 16 0; #X connect 16 0 1 0; #X restore 74 440 pd lotto; #X obj 249 453 random; #X text 182 453 see also:; #X text 346 21 part of zexy; #N canvas 498 241 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR IOhannes m zmoelnig; #X text 12 45 DESCRIPTION a Unique Random Numbers generator; #X text 12 5 KEYWORDS control random; #X text 12 65 INLET_0 bang seed clear; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 float; #X text 12 125 OUTLET_1 bang; #X restore 433 462 pd META; #X msg 25 109 bang; #X connect 3 0 2 0; #X connect 3 1 12 0; #X connect 6 0 3 1; #X connect 8 0 3 0; #X connect 10 0 3 0; #X connect 20 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/wrap-help.pd000066400000000000000000000037231265051730400251020ustar00rootroot00000000000000#N canvas 0 31 540 641 10; #X text 118 18 wrap a float between to limits; #X obj 71 18 wrap; #X obj 42 150 wrap; #X floatatom 42 132 5 0 0 0 - - -; #X floatatom 42 173 5 0 0 0 - - -; #X floatatom 42 242 5 0 0 0 - - -; #X floatatom 42 283 5 0 0 0 - - -; #X text 32 94 if called without arguments \, [wrap] will wrap the input between [0 \, 1); #X text 32 204 if called with one argument f \, [wrap] will wrap the input between [0 \, f); #X text 37 53 (somehow a float-capable modulo-function with some extensions) ; #X floatatom 32 342 5 0 0 0 - - -; #X floatatom 32 383 5 0 0 0 - - -; #X text 22 306 if called with two arguments f1 f2 \, [wrap] will wrap the input between [f1 \, f2); #X obj 42 260 wrap 10.5; #X floatatom 244 342 5 0 0 0 - - -; #X floatatom 244 383 5 0 0 0 - - -; #X text 127 361 is the same as; #X obj 31 467 wrap; #X floatatom 31 441 5 0 0 0 - - -; #X floatatom 31 490 5 0 0 0 - - -; #X obj 32 360 wrap 1 9.2; #X obj 244 360 wrap 9.2 1; #X msg 94 425 2 4; #X msg 94 448 -8; #X text 129 433 you can dynamically set the limits via the second inlet ; #X text 143 472 if only one argument is given \, the second is assumed as zero (0).; #X text 137 513 wrapping is always done between [f1 \, f2) \, where f1 is ALWAYS less than f2.; #X text 130 563 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; #N canvas 498 241 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 float; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION wrap a float between to limits; #X text 12 65 INLET_0 float; #X restore 483 617 pd META; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 5 0 13 0; #X connect 10 0 20 0; #X connect 13 0 6 0; #X connect 14 0 21 0; #X connect 17 0 19 0; #X connect 18 0 17 0; #X connect 20 0 11 0; #X connect 21 0 15 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/zigbinops-help.pd000066400000000000000000000065011265051730400261320ustar00rootroot00000000000000#N canvas 2 0 550 527 10; #X obj 44 193 abs~; #X obj 102 194 sgn~; #X obj 324 191 <~; #X obj 358 190 ==~; #X obj 392 191 >~; #X obj 450 190 &&~; #X obj 485 190 ||~; #X floatatom 485 238 0 0 0 0 - - -; #X floatatom 450 238 0 0 0 0 - - -; #X floatatom 392 239 0 0 0 0 - - -; #X floatatom 358 239 0 0 0 0 - - -; #X floatatom 102 242 0 0 0 0 - - -; #X floatatom 44 243 0 0 0 0 - - -; #X obj 44 221 avg~; #X obj 102 220 avg~; #X floatatom 324 239 0 0 0 0 - - -; #X obj 324 217 avg~; #X obj 358 216 avg~; #X obj 392 216 avg~; #X obj 450 216 avg~; #X obj 485 216 avg~; #X obj 44 163 sig~; #X floatatom 44 141 0 0 0 0 - - -; #X obj 392 126 sig~; #X floatatom 392 104 0 0 0 0 - - -; #X obj 466 126 sig~; #X floatatom 466 104 0 0 0 0 - - -; #X floatatom 502 448 0 0 0 0 - - -; #X floatatom 462 448 0 0 0 0 - - -; #X floatatom 411 448 0 0 0 0 - - -; #X floatatom 370 449 0 0 0 0 - - -; #X floatatom 336 449 0 0 0 0 - - -; #X obj 336 427 avg~; #X obj 370 426 avg~; #X obj 411 425 avg~; #X obj 462 426 avg~; #X obj 502 426 avg~; #X obj 411 337 sig~; #X floatatom 411 315 0 0 0 0 - - -; #X floatatom 492 316 0 0 0 0 - - -; #X obj 336 401 <~ 2; #X obj 370 400 ==~ 2; #X obj 411 400 >~ 2; #X obj 462 400 &&~ 2; #X obj 502 400 ||~ 2; #X text 65 30 more math and binary operations for signals; #X text 10 263 absolute; #X text 32 278 value; #X text 94 263 signum; #X text 311 267 greater; #X text 392 268 less; #X text 358 284 equal; #X text 455 261 logical; #X text 448 274 AND; #X text 493 274 OR; #X text 412 16 part of zexy; #X floatatom 212 242 0 0 0 0 - - -; #X floatatom 174 243 0 0 0 0 - - -; #X obj 174 221 avg~; #X obj 212 220 avg~; #X obj 174 193 absgn~; #X text 178 267 (both); #X text 54 58 (this help-patch might be very CPU-consumptious \, because of the float-atoms....); #N canvas 562 175 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 85 INLET_0 signal; #X text 12 105 OUTLET_0 signal; #X text 12 65 DESCRIPTION more math and binary operations for signals ; #X text 12 25 KEYWORDS signal; #X text 12 5 NAME abs~ sgn~ absgn~ <~ ==~ >~ &&~ ||~; #X restore 493 497 pd META; #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 21 0 60 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; #X connect 58 0 57 0; #X connect 59 0 56 0; #X connect 60 0 58 0; #X connect 60 1 59 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/reference/z~-help.pd000066400000000000000000000023611265051730400245750ustar00rootroot00000000000000#N canvas 0 31 547 376 10; #X obj 125 42 z~; #X text 177 41 samplewise delay; #X text 168 89 should make FIR-filter design possible; #X obj 35 182 osc~ 440; #X floatatom 35 151 0 0 0 0 - - -; #X obj 67 230 z~; #X obj 97 230 z~ 2; #X obj 35 270 +~; #X text 205 229 4th order moving average filter; #X text 163 258 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 35 296 *~ 0.25; #X text 442 11 part of zexy; #X obj 137 230 z~ 3; #X obj 35 344 tabwrite~ \$0scope; #X msg 52 321 bang; #X obj 228 348 table \$0scope; #N canvas 498 241 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION samplewise delay; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 signal; #X restore 493 347 pd META; #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; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/000077500000000000000000000000001265051730400215025ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/0x260x260x7e.c000066400000000000000000000220571265051730400234770ustar00rootroot00000000000000/* * &&~: logical AND for signals * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" /* ------------------------ logical~ ----------------------------- */ /* ----------------------------- andand_tilde ----------------------------- */ static t_class *andand_tilde_class, *scalarandand_tilde_class; typedef struct _andand_tilde { t_object x_obj; t_float x_f; } t_andand_tilde; typedef struct _scalarandand_tilde { t_object x_obj; t_float x_f; t_float x_g; /* inlet value */ } t_scalarandand_tilde; static void *andand_tilde_new(t_symbol * UNUSED(s), int argc, t_atom *argv) { if (argc > 1) { post("&&~: extra arguments ignored"); } if (argc) { t_scalarandand_tilde *x = (t_scalarandand_tilde *)pd_new( scalarandand_tilde_class); floatinlet_new(&x->x_obj, &x->x_g); x->x_g = atom_getfloatarg(0, argc, argv); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } else { t_andand_tilde *x = (t_andand_tilde *)pd_new(andand_tilde_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } } static t_int *andand_tilde_perform(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { int f=(int)*in1++; int g=(int)*in2++; *out++ = (f && g); } return (w+5); } static t_int *andand_tilde_perf8(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in1 += 8, in2 += 8, out += 8) { int f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; int f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; int g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; int g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; out[0] = f0 && g0; out[1] = f1 && g1; out[2] = f2 && g2; out[3] = f3 && g3; out[4] = f4 && g4; out[5] = f5 && g5; out[6] = f6 && g6; out[7] = f7 && g7; } return (w+5); } static t_int *scalarandand_tilde_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); int f = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = (int)*in++ && f; } return (w+5); } static t_int *scalarandand_tilde_perf8(t_int *w) { t_sample *in = (t_sample *)(w[1]); int g = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in += 8, out += 8) { int f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; int f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; out[0] = f0 && g; out[1] = f1 && g; out[2] = f2 && g; out[3] = f3 && g; out[4] = f4 && g; out[5] = f5 && g; out[6] = f6 && g; out[7] = f7 && g; } return (w+5); } #ifdef __SSE__ static int l_bitmask[]= {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; static t_int *andand_tilde_performSSE(t_int *w) { __m128 *in1 = (__m128 *)(w[1]); __m128 *in2 = (__m128 *)(w[2]); __m128 *out = (__m128 *)(w[3]); int n = (int)(w[4])>>4; const __m128 bitmask= _mm_loadu_ps((float*) l_bitmask); /* for getting the absolute value */ const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1, xmm2; xmm0 = _mm_and_ps (in1[0] , bitmask); /* =abs(f); */ xmm1 = _mm_and_ps (in2[0] , bitmask); xmm0 = _mm_cmpge_ps(xmm0 , one); /* =(abs(f)>=1.0)=i (a weird cast to integer) */ xmm1 = _mm_cmpge_ps(xmm1 , one); xmm2 = _mm_and_ps (xmm0 , xmm1); /* =(i0&&i1) */ out[0] = _mm_and_ps (xmm2 , one); /* 0xfffffff -> 1.0 */ xmm0 = _mm_and_ps (in1[1] , bitmask); xmm1 = _mm_and_ps (in2[1] , bitmask); xmm0 = _mm_cmpge_ps(xmm0 , one); xmm1 = _mm_cmpge_ps(xmm1 , one); xmm2 = _mm_and_ps (xmm0 , xmm1); out[1] = _mm_and_ps (xmm2 , one); xmm0 = _mm_and_ps (in1[2] , bitmask); xmm1 = _mm_and_ps (in2[2] , bitmask); xmm0 = _mm_cmpge_ps(xmm0 , one); xmm1 = _mm_cmpge_ps(xmm1 , one); xmm2 = _mm_and_ps (xmm0 , xmm1); out[2] = _mm_and_ps (xmm2 , one); xmm0 = _mm_and_ps (in1[3] , bitmask); xmm1 = _mm_and_ps (in2[3] , bitmask); xmm0 = _mm_cmpge_ps(xmm0 , one); xmm1 = _mm_cmpge_ps(xmm1 , one); xmm2 = _mm_and_ps (xmm0 , xmm1); out[3] = _mm_and_ps (xmm2 , one); in1+=4; in2+=4; out+=4; } return (w+5); } static t_int *scalarandand_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); float f = *(t_float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 bitmask= _mm_loadu_ps((float*) l_bitmask); /* for getting the absolute value */ const __m128 one = _mm_set1_ps(1.f); scalar = _mm_and_ps (scalar, bitmask); scalar = _mm_cmpge_ps(scalar, one ); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_and_ps (in[0], bitmask); /* =abs(f); */ xmm0 = _mm_cmpge_ps(xmm0 , one); /* =(abs(f)>=1.0)=i (a weird cast to integer) */ xmm0 = _mm_and_ps (xmm0 , scalar); /* =(i0&&i1) */ out[0] = _mm_and_ps (xmm0 , one); /* 0xfffffff -> 1.0 */ xmm1 = _mm_and_ps (in[1], bitmask); xmm1 = _mm_cmpge_ps(xmm1 , one); xmm1 = _mm_and_ps (xmm1 , scalar); out[1] = _mm_and_ps (xmm1 , one); xmm0 = _mm_and_ps (in[2], bitmask); xmm0 = _mm_cmpge_ps(xmm0 , one); xmm0 = _mm_and_ps (xmm0 , scalar); out[2] = _mm_and_ps (xmm0 , one); xmm1 = _mm_and_ps (in[3], bitmask); xmm1 = _mm_cmpge_ps(xmm1 , one); xmm1 = _mm_and_ps (xmm1 , scalar); out[3] = _mm_and_ps (xmm1 , one); in +=4; out+=4; } return (w+5); } #endif /* __SSE__ */ static void andand_tilde_dsp(t_andand_tilde *UNUSED(x), t_signal **sp) { t_sample*in1=sp[0]->s_vec; t_sample*in2=sp[1]->s_vec; t_sample*out=sp[2]->s_vec; int n=sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in1)&& Z_SIMD_CHKALIGN(in2)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(andand_tilde_performSSE, 4, in1, in2, out, n); } else #endif if (n&7) { dsp_add(andand_tilde_perform, 4, in1, in2, out, n); } else { dsp_add(andand_tilde_perf8, 4, in1, in2, out, n); } } static void scalarandand_tilde_dsp(t_scalarandand_tilde *x, t_signal **sp) { t_sample*in =sp[0]->s_vec; t_sample*out=sp[1]->s_vec; int n =sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(scalarandand_tilde_performSSE, 4, in, &x->x_g, out, n); } else #endif if (n&7) { dsp_add(scalarandand_tilde_perform, 4, in, &x->x_g, out, n); } else { dsp_add(scalarandand_tilde_perf8, 4, in, &x->x_g, out, n); } } static void andand_tilde_help(t_object*x) { post("\n"HEARTSYMBOL " &&~\t\t:: logical AND operation on 2 signals"); } void setup_0x260x260x7e(void) { andand_tilde_class = class_new(gensym("&&~"), (t_newmethod)andand_tilde_new, 0, sizeof(t_andand_tilde), 0, A_GIMME, 0); class_addmethod(andand_tilde_class, (t_method)andand_tilde_dsp, gensym("dsp"), 0); CLASS_MAINSIGNALIN(andand_tilde_class, t_andand_tilde, x_f); class_addmethod (andand_tilde_class, (t_method)andand_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(andand_tilde_class, gensym("zigbinops")); scalarandand_tilde_class = class_new(gensym("&&~"), 0, 0, sizeof(t_scalarandand_tilde), 0, 0); CLASS_MAINSIGNALIN(scalarandand_tilde_class, t_scalarandand_tilde, x_f); class_addmethod(scalarandand_tilde_class, (t_method)scalarandand_tilde_dsp, gensym("dsp"), 0); class_addmethod (scalarandand_tilde_class, (t_method)andand_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(scalarandand_tilde_class, gensym("zigbinops")); zexy_register("&&~"); } #ifndef ZEXY_LIBRARY void setup(void) { setup_0x260x260x7e(); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/0x2e.c000066400000000000000000000110211265051730400224170ustar00rootroot00000000000000/* * [.]: scala multiplication * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #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 *UNUSED(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* UNUSED(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->n2n1) { 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* UNUSED(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_help(t_scalmul*x) { post("\n"HEARTSYMBOL " .\t\t:: scalar multiplication (in-product)"); } void setup_0x2e(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); class_addmethod(scalmul_class, (t_method)scalmul_help, gensym("help"), A_NULL); scalmul_scal_class = class_new(gensym("."), 0, (t_method)scalmul_free, sizeof(t_scalmul), 0, 0); class_addlist(scalmul_scal_class, scalmul_lst); class_addmethod(scalmul_scal_class, (t_method)scalmul_help, gensym("help"), A_NULL); class_sethelpsymbol(scalmul_class, gensym("scalarmult")); class_sethelpsymbol(scalmul_scal_class, gensym("scalarmult")); zexy_register("."); } #ifndef ZEXY_LIBRARY void setup(void) { setup_0x2e(); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/0x3c0x7e.c000066400000000000000000000160141265051730400231310ustar00rootroot00000000000000/* * <~: signal comparision * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" /* ------------------------ relational~ ----------------------------- */ /* ----------------------------- lt_tilde ----------------------------- */ static t_class *lt_tilde_class, *scalarlt_tilde_class; typedef struct _lt_tilde { t_object x_obj; t_float x_f; } t_lt_tilde; typedef struct _scalarlt_tilde { t_object x_obj; t_float x_f; t_float x_g; /* inlet value */ } t_scalarlt_tilde; static void *lt_tilde_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { if (argc > 1) { post("<~: extra arguments ignored"); } if (argc) { t_scalarlt_tilde *x = (t_scalarlt_tilde *)pd_new(scalarlt_tilde_class); floatinlet_new(&x->x_obj, &x->x_g); x->x_g = atom_getfloatarg(0, argc, argv); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } else { t_lt_tilde *x = (t_lt_tilde *)pd_new(lt_tilde_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } } static t_int *lt_tilde_perform(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = *in1++ < *in2++; } return (w+5); } static t_int *lt_tilde_perf8(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in1 += 8, in2 += 8, out += 8) { t_sample f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; t_sample f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; t_sample g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; t_sample g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; out[0] = f0 < g0; out[1] = f1 < g1; out[2] = f2 < g2; out[3] = f3 < g3; out[4] = f4 < g4; out[5] = f5 < g5; out[6] = f6 < g6; out[7] = f7 < g7; } return (w+5); } static t_int *scalarlt_tilde_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample f = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = *in++ < f; } return (w+5); } static t_int *scalarlt_tilde_perf8(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample g = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in += 8, out += 8) { t_sample f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; t_sample f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; out[0] = f0 < g; out[1] = f1 < g; out[2] = f2 < g; out[3] = f3 < g; out[4] = f4 < g; out[5] = f5 < g; out[6] = f6 < g; out[7] = f7 < g; } return (w+5); } #ifdef __SSE__ static t_int *lt_tilde_performSSE(t_int *w) { __m128 *in1 = (__m128 *)(w[1]); __m128 *in2 = (__m128 *)(w[2]); __m128 *out = (__m128 *)(w[3]); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmplt_ps(in1[0], in2[0]); out[0] = _mm_and_ps (xmm0 , one); xmm1 = _mm_cmplt_ps(in1[1], in2[1]); out[1] = _mm_and_ps (xmm1 , one); xmm0 = _mm_cmplt_ps(in1[2], in2[2]); out[2] = _mm_and_ps (xmm0 , one); xmm1 = _mm_cmplt_ps(in1[3], in2[3]); out[3] = _mm_and_ps (xmm1 , one); in1+=4; in2+=4; out+=4; } return (w+5); } static t_int *scalarlt_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); float f = *(t_float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmplt_ps (in[0], scalar); out[0] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmplt_ps (in[1], scalar); out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmplt_ps (in[2], scalar); out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmplt_ps (in[3], scalar); out[3] = _mm_and_ps (xmm1, one); in +=4; out+=4; } return (w+5); } #endif /* __SSE__ */ static void lt_tilde_dsp(t_lt_tilde* UNUSED(x), t_signal **sp) { t_sample*in1=sp[0]->s_vec; t_sample*in2=sp[1]->s_vec; t_sample*out=sp[2]->s_vec; int n=sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in1)&& Z_SIMD_CHKALIGN(in2)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(lt_tilde_performSSE, 4, in1, in2, out, n); } else #endif if(n&7) { dsp_add(lt_tilde_perform, 4, in1, in2, out, n); } else { dsp_add(lt_tilde_perf8, 4, in1, in2, out, n); } } static void scalarlt_tilde_dsp(t_scalarlt_tilde *x, t_signal **sp) { t_sample*in =sp[0]->s_vec; t_sample*out=sp[1]->s_vec; int n =sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(scalarlt_tilde_performSSE, 4, in, &x->x_g, out, n); } else #endif if (n&7) { dsp_add(scalarlt_tilde_perform, 4, in, &x->x_g, out, n); } else { dsp_add(scalarlt_tilde_perf8, 4, in, &x->x_g, out, n); } } static void lt_tilde_help(t_object*x) { post("\n"HEARTSYMBOL " <~\t\t:: compare 2 signals"); } void setup_0x3c0x7e(void) { lt_tilde_class = class_new(gensym("<~"), (t_newmethod)lt_tilde_new, 0, sizeof(t_lt_tilde), 0, A_GIMME, 0); class_addmethod(lt_tilde_class, (t_method)lt_tilde_dsp, gensym("dsp"), 0); CLASS_MAINSIGNALIN(lt_tilde_class, t_lt_tilde, x_f); class_addmethod (lt_tilde_class, (t_method)lt_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(lt_tilde_class, gensym("zigbinops")); scalarlt_tilde_class = class_new(gensym("<~"), 0, 0, sizeof(t_scalarlt_tilde), 0, 0); CLASS_MAINSIGNALIN(scalarlt_tilde_class, t_scalarlt_tilde, x_f); class_addmethod(scalarlt_tilde_class, (t_method)scalarlt_tilde_dsp, gensym("dsp"), 0); class_addmethod (scalarlt_tilde_class, (t_method)lt_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(scalarlt_tilde_class, gensym("zigbinops")); zexy_register("<~"); } #ifndef ZEXY_LIBRARY void setup(void) { setup_0x3c0x7e(); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/0x3d0x3d0x7e.c000066400000000000000000000160231265051730400236310ustar00rootroot00000000000000/* * ==~: test signals for equality * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" /* ----------------------------- eq_tilde ----------------------------- */ static t_class *eq_tilde_class, *scalareq_tilde_class; typedef struct _eq_tilde { t_object x_obj; t_float x_f; } t_eq_tilde; typedef struct _scalareq_tilde { t_object x_obj; t_float x_f; t_float x_g; /* inlet value */ } t_scalareq_tilde; static void *eq_tilde_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { if (argc > 1) { post("==~: extra arguments ignored"); } if (argc) { t_scalareq_tilde *x = (t_scalareq_tilde *)pd_new(scalareq_tilde_class); floatinlet_new(&x->x_obj, &x->x_g); x->x_g = atom_getfloatarg(0, argc, argv); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } else { t_eq_tilde *x = (t_eq_tilde *)pd_new(eq_tilde_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } } static t_int *eq_tilde_perform(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = (*in1++ == *in2++); } return (w+5); } static t_int *eq_tilde_perf8(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in1 += 8, in2 += 8, out += 8) { t_sample f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; t_sample f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; t_sample g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; t_sample g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; out[0] = f0 == g0; out[1] = f1 == g1; out[2] = f2 == g2; out[3] = f3 == g3; out[4] = f4 == g4; out[5] = f5 == g5; out[6] = f6 == g6; out[7] = f7 == g7; } return (w+5); } static t_int *scalareq_tilde_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample f = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = (*in++ == f); } return (w+5); } static t_int *scalareq_tilde_perf8(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample g = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in += 8, out += 8) { t_sample f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; t_sample f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; out[0] = (f0 == g); out[1] = (f1 == g); out[2] = (f2 == g); out[3] = (f3 == g); out[4] = (f4 == g); out[5] = (f5 == g); out[6] = (f6 == g); out[7] = (f7 == g); } return (w+5); } #ifdef __SSE__ static t_int *eq_tilde_performSSE(t_int *w) { __m128 *in1 = (__m128 *)(w[1]); __m128 *in2 = (__m128 *)(w[2]); __m128 *out = (__m128 *)(w[3]); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpeq_ps(in1[0], in2[0]); out[0] = _mm_and_ps (xmm0 , one); xmm1 = _mm_cmpeq_ps(in1[1], in2[1]); out[1] = _mm_and_ps (xmm1 , one); xmm0 = _mm_cmpeq_ps(in1[2], in2[2]); out[2] = _mm_and_ps (xmm0 , one); xmm1 = _mm_cmpeq_ps(in1[3], in2[3]); out[3] = _mm_and_ps (xmm1 , one); in1+=4; in2+=4; out+=4; } return (w+5); } static t_int *scalareq_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); float f = *(float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpeq_ps (in[0], scalar); out[0] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpeq_ps (in[1], scalar); out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpeq_ps (in[2], scalar); out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpeq_ps (in[3], scalar); out[3] = _mm_and_ps (xmm1, one); in +=4; out+=4; } return (w+5); } #endif /* __SSE__ */ static void eq_tilde_dsp(t_eq_tilde* UNUSED(x), t_signal **sp) { t_sample*in1=sp[0]->s_vec; t_sample*in2=sp[1]->s_vec; t_sample*out=sp[2]->s_vec; int n=sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in1)&& Z_SIMD_CHKALIGN(in2)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(eq_tilde_performSSE, 4, in1, in2, out, n); } else #endif if (n&7) { dsp_add(eq_tilde_perform, 4, in1, in2, out, n); } else { dsp_add(eq_tilde_perf8, 4, in1, in2, out, n); } } static void scalareq_tilde_dsp(t_scalareq_tilde *x, t_signal **sp) { t_sample*in =sp[0]->s_vec; t_sample*out=sp[1]->s_vec; int n =sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in)&& Z_SIMD_CHKALIGN(out) && ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(scalareq_tilde_performSSE, 4, in, &x->x_g, out, n); } else #endif if (n&7) { dsp_add(scalareq_tilde_perform, 4, in, &x->x_g, out, n); } else { dsp_add(scalareq_tilde_perf8, 4, in, &x->x_g, out, n); } } static void eq_tilde_help(t_object*x) { post("\n"HEARTSYMBOL " &&~\t\t:: test 2 signals for equality"); } void setup_0x3d0x3d0x7e(void) { eq_tilde_class = class_new(gensym("==~"), (t_newmethod)eq_tilde_new, 0, sizeof(t_eq_tilde), 0, A_GIMME, 0); class_addmethod(eq_tilde_class, (t_method)eq_tilde_dsp, gensym("dsp"), 0); CLASS_MAINSIGNALIN(eq_tilde_class, t_eq_tilde, x_f); class_addmethod (eq_tilde_class, (t_method)eq_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(eq_tilde_class, gensym("zigbinops")); scalareq_tilde_class = class_new(gensym("==~"), 0, 0, sizeof(t_scalareq_tilde), 0, 0); CLASS_MAINSIGNALIN(scalareq_tilde_class, t_scalareq_tilde, x_f); class_addmethod(scalareq_tilde_class, (t_method)scalareq_tilde_dsp, gensym("dsp"), 0); class_addmethod (scalareq_tilde_class, (t_method)eq_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(scalareq_tilde_class, gensym("zigbinops")); zexy_register("==~"); } #ifndef ZEXY_LIBRARY void setup(void) { setup_0x3d0x3d0x7e(); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/0x3e0x7e.c000066400000000000000000000160231265051730400231330ustar00rootroot00000000000000/* * >~: signal comparision * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" /* ------------------------ relational~ ----------------------------- */ /* ----------------------------- gt_tilde ----------------------------- */ static t_class *gt_tilde_class, *scalargt_tilde_class; typedef struct _gt_tilde { t_object x_obj; t_float x_f; } t_gt_tilde; typedef struct _scalargt_tilde { t_object x_obj; t_float x_f; t_float x_g; /* inlet value */ } t_scalargt_tilde; static void *gt_tilde_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { if (argc > 1) { post(">~: extra arguments ignored"); } if (argc) { t_scalargt_tilde *x = (t_scalargt_tilde *)pd_new(scalargt_tilde_class); floatinlet_new(&x->x_obj, &x->x_g); x->x_g = atom_getfloatarg(0, argc, argv); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } else { t_gt_tilde *x = (t_gt_tilde *)pd_new(gt_tilde_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } } static t_int *gt_tilde_perform(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = *in1++ > *in2++; } return (w+5); } static t_int *gt_tilde_perf8(t_int *w) { t_sample *in1 = (t_sample *)(w[1]); t_sample *in2 = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in1 += 8, in2 += 8, out += 8) { t_sample f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; t_sample f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; t_sample g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; t_sample g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; out[0] = f0 > g0; out[1] = f1 > g1; out[2] = f2 > g2; out[3] = f3 > g3; out[4] = f4 > g4; out[5] = f5 > g5; out[6] = f6 > g6; out[7] = f7 > g7; } return (w+5); } static t_int *scalargt_tilde_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample f = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = *in++ > f; } return (w+5); } static t_int *scalargt_tilde_perf8(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample g = *(t_float *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in += 8, out += 8) { t_sample f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; t_sample f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; out[0] = f0 > g; out[1] = f1 > g; out[2] = f2 > g; out[3] = f3 > g; out[4] = f4 > g; out[5] = f5 > g; out[6] = f6 > g; out[7] = f7 > g; } return (w+5); } #ifdef __SSE__ static t_int *gt_tilde_performSSE(t_int *w) { __m128 *in1 = (__m128 *)(w[1]); __m128 *in2 = (__m128 *)(w[2]); __m128 *out = (__m128 *)(w[3]); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpgt_ps(in1[0], in2[0]); out[0] = _mm_and_ps (xmm0 , one); xmm1 = _mm_cmpgt_ps(in1[1], in2[1]); out[1] = _mm_and_ps (xmm1 , one); xmm0 = _mm_cmpgt_ps(in1[2], in2[2]); out[2] = _mm_and_ps (xmm0 , one); xmm1 = _mm_cmpgt_ps(in1[3], in2[3]); out[3] = _mm_and_ps (xmm1 , one); in1+=4; in2+=4; out+=4; } return (w+5); } static t_int *scalargt_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); float f = *(t_float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpgt_ps (in[0], scalar); out[0] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpgt_ps (in[1], scalar); out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpgt_ps (in[2], scalar); out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpgt_ps (in[3], scalar); out[3] = _mm_and_ps (xmm1, one); in +=4; out+=4; } return (w+5); } #endif /* __SSE__ */ static void gt_tilde_dsp(t_gt_tilde* UNUSED(x), t_signal **sp) { t_sample*in1=sp[0]->s_vec; t_sample*in2=sp[1]->s_vec; t_sample*out=sp[2]->s_vec; int n=sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in1)&& Z_SIMD_CHKALIGN(in2)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(gt_tilde_performSSE, 4, in1, in2, out, n); } else #endif if (n&7) { dsp_add(gt_tilde_perform, 4, in1, in2, out, n); } else { dsp_add(gt_tilde_perf8, 4, in1, in2, out, n); } } static void scalargt_tilde_dsp(t_scalargt_tilde *x, t_signal **sp) { t_sample*in =sp[0]->s_vec; t_sample*out=sp[1]->s_vec; int n =sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(scalargt_tilde_performSSE, 4, in, &x->x_g, out, n); } else #endif if (n&7) { dsp_add(scalargt_tilde_perform, 4, in, &x->x_g, out, n); } else { dsp_add(scalargt_tilde_perf8, 4, in, &x->x_g, out, n); } } static void gt_tilde_help(t_object*x) { post("\n"HEARTSYMBOL " >~\t\t:: compare 2 signals"); } void setup_0x3e0x7e(void) { gt_tilde_class = class_new(gensym(">~"), (t_newmethod)gt_tilde_new, 0, sizeof(t_gt_tilde), 0, A_GIMME, 0); class_addmethod(gt_tilde_class, (t_method)gt_tilde_dsp, gensym("dsp"), 0); CLASS_MAINSIGNALIN(gt_tilde_class, t_gt_tilde, x_f); class_addmethod (gt_tilde_class, (t_method)gt_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(gt_tilde_class, gensym("zigbinops")); scalargt_tilde_class = class_new(gensym(">~"), 0, 0, sizeof(t_scalargt_tilde), 0, 0); CLASS_MAINSIGNALIN(scalargt_tilde_class, t_scalargt_tilde, x_f); class_addmethod(scalargt_tilde_class, (t_method)scalargt_tilde_dsp, gensym("dsp"), 0); class_addmethod (scalargt_tilde_class, (t_method)gt_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(scalargt_tilde_class, gensym("zigbinops")); zexy_register(">~"); } #ifndef ZEXY_LIBRARY void setup(void) { setup_0x3e0x7e(); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/0x7c0x7c0x7e.c000066400000000000000000000174451265051730400236500ustar00rootroot00000000000000/* * ||~: logical OR for signals * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" /* ----------------------------- oror_tilde ----------------------------- */ static t_class *oror_tilde_class, *scalaroror_tilde_class; typedef struct _oror_tilde { t_object x_obj; t_float x_f; } t_oror_tilde; typedef struct _scalaroror_tilde { t_object x_obj; t_float x_f; t_float x_g; /* inlet value */ } t_scalaroror_tilde; static void *oror_tilde_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { if (argc > 1) { post("||~: extra arguments ignored"); } if (argc) { t_scalaroror_tilde *x = (t_scalaroror_tilde *)pd_new( scalaroror_tilde_class); floatinlet_new(&x->x_obj, &x->x_g); x->x_g = atom_getfloatarg(0, argc, argv); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } else { t_oror_tilde *x = (t_oror_tilde *)pd_new(oror_tilde_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } } static t_int *oror_tilde_perform(t_int *w) { t_float *in1 = (t_float *)(w[1]); t_float *in2 = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = (int)*in1++ || (int)*in2++; } return (w+5); } static t_int *oror_tilde_perf8(t_int *w) { t_float *in1 = (t_float *)(w[1]); t_float *in2 = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in1 += 8, in2 += 8, out += 8) { int f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; int f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; int g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; int g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; out[0] = f0 || g0; out[1] = f1 || g1; out[2] = f2 || g2; out[3] = f3 || g3; out[4] = f4 || g4; out[5] = f5 || g5; out[6] = f6 || g6; out[7] = f7 || g7; } return (w+5); } static t_int *scalaroror_tilde_perform(t_int *w) { t_float *in = (t_float *)(w[1]); int f = *(t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); while (n--) { *out++ = (int)*in++ || f; } return (w+5); } static t_int *scalaroror_tilde_perf8(t_int *w) { t_float *in = (t_float *)(w[1]); int g = *(t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in += 8, out += 8) { int f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; int f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; out[0] = f0 || g; out[1] = f1 || g; out[2] = f2 || g; out[3] = f3 || g; out[4] = f4 || g; out[5] = f5 || g; out[6] = f6 || g; out[7] = f7 || g; } return (w+5); } #ifdef __SSE__ static t_int *oror_tilde_performSSE(t_int *w) { __m128 *in1 = (__m128 *)(w[1]); __m128 *in2 = (__m128 *)(w[2]); __m128 *out = (__m128 *)(w[3]); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); const __m128 zero = _mm_setzero_ps(); while (n--) { __m128 xmm0, xmm1, xmm2; xmm0 = _mm_cmpneq_ps(in1[0], zero); xmm1 = _mm_cmpneq_ps(in2[0], zero); xmm2 = _mm_or_ps (xmm0 , xmm1); out[0] = _mm_and_ps (xmm2 , one); xmm0 = _mm_cmpneq_ps(in1[1], zero); xmm1 = _mm_cmpneq_ps(in2[1], zero); xmm2 = _mm_or_ps (xmm0 , xmm1); out[1] = _mm_and_ps (xmm2 , one); xmm0 = _mm_cmpneq_ps(in1[2], zero); xmm1 = _mm_cmpneq_ps(in2[2], zero); xmm2 = _mm_or_ps (xmm0 , xmm1); out[2] = _mm_and_ps (xmm2 , one); xmm0 = _mm_cmpneq_ps(in1[3], zero); xmm1 = _mm_cmpneq_ps(in2[3], zero); xmm2 = _mm_or_ps (xmm0 , xmm1); out[3] = _mm_and_ps (xmm2 , one); in1+=4; in2+=4; out+=4; } return (w+5); } static t_int *scalaroror_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); t_float f = *(t_float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); const __m128 zero = _mm_setzero_ps(); scalar = _mm_cmpneq_ps(scalar, zero); while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpneq_ps(in[0], zero); xmm1 = _mm_or_ps (xmm0 , scalar); out[0] = _mm_and_ps (xmm1 , one); xmm0 = _mm_cmpneq_ps(in[1], zero); xmm1 = _mm_or_ps (xmm0 , scalar); out[1] = _mm_and_ps (xmm1 , one); xmm0 = _mm_cmpneq_ps(in[2], zero); xmm1 = _mm_or_ps (xmm0 , scalar); out[2] = _mm_and_ps (xmm1 , one); xmm0 = _mm_cmpneq_ps(in[3], zero); xmm1 = _mm_or_ps (xmm0 , scalar); out[3] = _mm_and_ps (xmm1 , one); in +=4; out+=4; } return (w+5); } #endif /* __SSE__ */ static void oror_tilde_dsp(t_oror_tilde* UNUSED(x), t_signal **sp) { t_sample*in1=sp[0]->s_vec; t_sample*in2=sp[1]->s_vec; t_sample*out=sp[2]->s_vec; int n=sp[0]->s_n; #ifdef __SSE__ if( 0 && /* disabled for now since SSE2 code not compatible with [||] */ Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in1)&& Z_SIMD_CHKALIGN(in2)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(oror_tilde_performSSE, 4, in1, in2, out, n); } else #endif if(n&7) { dsp_add(oror_tilde_perform, 4, in1, in2, out, n); } else { dsp_add(oror_tilde_perf8, 4, in1, in2, out, n); } } static void scalaroror_tilde_dsp(t_scalaroror_tilde *x, t_signal **sp) { t_sample*in =sp[0]->s_vec; t_sample*out=sp[1]->s_vec; int n =sp[0]->s_n; #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in)&& Z_SIMD_CHKALIGN(out)&& ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(scalaroror_tilde_performSSE, 4, in, &x->x_g, out, n); } else #endif if (n&7) { dsp_add(scalaroror_tilde_perform, 4, in, &x->x_g, out, n); } else { dsp_add(scalaroror_tilde_perf8, 4, in, &x->x_g, out, n); } } static void oror_tilde_help(t_object*x) { post("\n"HEARTSYMBOL " &&~\t\t:: logical OR operation on 2 signals"); } void setup_0x7c0x7c0x7e(void) { oror_tilde_class = class_new(gensym("||~"), (t_newmethod)oror_tilde_new, 0, sizeof(t_oror_tilde), 0, A_GIMME, 0); class_addmethod(oror_tilde_class, (t_method)oror_tilde_dsp, gensym("dsp"), 0); CLASS_MAINSIGNALIN(oror_tilde_class, t_oror_tilde, x_f); class_addmethod (oror_tilde_class, (t_method)oror_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(oror_tilde_class, gensym("zigbinops")); scalaroror_tilde_class = class_new(gensym("||~"), 0, 0, sizeof(t_scalaroror_tilde), 0, 0); CLASS_MAINSIGNALIN(scalaroror_tilde_class, t_scalaroror_tilde, x_f); class_addmethod(scalaroror_tilde_class, (t_method)scalaroror_tilde_dsp, gensym("dsp"), 0); class_addmethod (scalaroror_tilde_class, (t_method)oror_tilde_help, gensym("help"), A_NULL); class_sethelpsymbol(scalaroror_tilde_class, gensym("zigbinops")); zexy_register("||~"); } #ifndef ZEXY_LIBRARY void setup(void) { setup_0x7c0x7c0x7e(); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/Makefile.am000066400000000000000000000134071265051730400235430ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 pkglib_LTLIBRARIES= AM_CFLAGS = AM_LDFLAGS= -module -avoid-version -shared -shrext .@EXTENSION@ if WINDOWS AM_LDFLAGS+= -no-undefined endif AM_LDFLAGS+= @EXTRA_LTFLAGS@ # RTE AM_CFLAGS += AM_LDFLAGS+= EXTRA_DIST = \ astyle.rc if LIBRARY pkglib_LTLIBRARIES+=zexy.la endif LIBRARY if SINGLEOBJECTS pkglib_LTLIBRARIES+= \ 0x260x260x7e.la \ 0x2e.la \ 0x3c0x7e.la \ 0x3d0x3d0x7e.la \ 0x3e0x7e.la \ 0x7c0x7c0x7e.la \ any2list.la \ a2l.la \ abs~.la \ absgn~.la \ atoi.la \ atof.la \ avg~.la \ blockmirror~.la \ blockshuffle~.la \ blockswap~.la \ date.la \ demultiplex~.la \ demux~.la \ demultiplex.la \ demux.la \ dfreq~.la \ dirac~.la \ doublepole~.la \ drip.la \ unfold.la \ envrms~.la \ fifop.la \ freadln.la \ fwriteln.la \ glue.la \ index.la \ length.la \ lifop.la \ limiter~.la \ l2i.la \ list2int.la \ list2lists.la \ l2s.la \ list2symbol.la \ l.la \ lister.la \ listfind.la \ liststorage.la \ longload.la \ lpt.la \ lp.la \ makesymbol.la \ matchbox.la \ mavg.la \ minmax.la \ msgfile.la \ multiline~.la \ mux~.la \ mux.la \ multiplex~.la \ multiplex.la \ multireceive.la \ niagara.la \ noish~.la \ noisi~.la \ operating_system.la \ pack~.la \ pack.la \ packel.la \ pdf~.la \ prime.la \ quantize~.la \ rawprint.la \ regex.la \ relay.la \ repack.la \ repeat.la \ route~.la \ sfplay.la \ sfrecord.la \ sgn~.la \ sigzero~.la \ sleepgrain.la \ sort.la \ step~.la \ strcmp.la \ sum.la \ swap~.la \ symbol2list.la \ s2l.la \ tabdump.la \ tabminmax.la \ tabread4~~.la \ tabset.la \ tavg~.la \ time.la \ unpack~.la \ unpack.la \ urn.la \ wrap.la \ z~.la endif SINGLEOBJECTS zexy_la_CPPFLAGS=-DZEXY_LIBRARY 0x260x260x7e_la_SOURCES = 0x260x260x7e.c 0x2e_la_SOURCES = 0x2e.c 0x3c0x7e_la_SOURCES = 0x3c0x7e.c 0x3d0x3d0x7e_la_SOURCES = 0x3d0x3d0x7e.c 0x3e0x7e_la_SOURCES = 0x3e0x7e.c 0x7c0x7c0x7e_la_SOURCES = 0x7c0x7c0x7e.c a2l_la_SOURCES = a2l.c any2list_la_SOURCES = a2l.c abs__la_SOURCES = abs~.c absgn__la_SOURCES = absgn~.c atoi_la_SOURCES = atoi.c atof_la_SOURCES = atof.c avg__la_SOURCES = avg~.c blockmirror__la_SOURCES = blockmirror~.c blockshuffle__la_SOURCES= blockshuffle~.c blockswap__la_SOURCES = blockswap~.c date_la_SOURCES = date.c demultiplex__la_SOURCES = demultiplex~.c demux__la_SOURCES = demultiplex~.c demultiplex_la_SOURCES = demultiplex.c demux_la_SOURCES = demultiplex.c dfreq__la_SOURCES = dfreq~.c dirac__la_SOURCES = dirac~.c doublepole__la_SOURCES = doublepole~.c drip_la_SOURCES = drip.c unfold_la_SOURCES = drip.c envrms__la_SOURCES = envrms~.c fifop_la_SOURCES = fifop.c freadln_la_SOURCES = freadln.c fwriteln_la_SOURCES = fwriteln.c glue_la_SOURCES = glue.c index_la_SOURCES = index.c length_la_SOURCES = length.c lifop_la_SOURCES = lifop.c limiter__la_SOURCES = limiter~.c list2int_la_SOURCES = list2int.c l2i_la_SOURCES = list2int.c list2lists_la_SOURCES = list2lists.c list2symbol_la_SOURCES = list2symbol.c l2s_la_SOURCES = list2symbol.c lister_la_SOURCES = lister.c l_la_SOURCES = lister.c listfind_la_SOURCES = listfind.c liststorage_la_SOURCES = liststorage.c longload_la_SOURCES = longload.c if LPT lpt_la_SOURCES = lpt.c lp_la_SOURCES = lpt.c if WINDOWS lpt_la_SOURCES += winNT_portio.c lp_la_SOURCES += winNT_portio.c endif endif makesymbol_la_SOURCES = makesymbol.c matchbox_la_SOURCES = matchbox.c mavg_la_SOURCES = mavg.c minmax_la_SOURCES = minmax.c msgfile_la_SOURCES = msgfile.c multiline__la_SOURCES = multiline~.c mux__la_SOURCES = multiplex~.c multiplex__la_SOURCES = multiplex~.c mux_la_SOURCES = multiplex.c multiplex_la_SOURCES = multiplex.c multireceive_la_SOURCES = multireceive.c niagara_la_SOURCES = niagara.c noish__la_SOURCES = noish~.c noisi__la_SOURCES = noisi~.c operating_system_la_SOURCES = operating_system.c pack__la_SOURCES = pack~.c pack_la_SOURCES = pack.c packel_la_SOURCES = packel.c pdf__la_SOURCES = pdf~.c prime_la_SOURCES = prime.c quantize__la_SOURCES = quantize~.c rawprint_la_SOURCES = rawprint.c regex_la_SOURCES = regex.c relay_la_SOURCES = relay.c repack_la_SOURCES = repack.c repeat_la_SOURCES = repeat.c route__la_SOURCES = route~.c sfplay_la_SOURCES = sfplay.c sfrecord_la_SOURCES = sfrecord.c sgn__la_SOURCES = sgn~.c sigzero__la_SOURCES = sigzero~.c sleepgrain_la_SOURCES = sleepgrain.c sort_la_SOURCES = sort.c step__la_SOURCES = step~.c strcmp_la_SOURCES = strcmp.c sum_la_SOURCES = sum.c swap__la_SOURCES = swap~.c symbol2list_la_SOURCES = symbol2list.c s2l_la_SOURCES = symbol2list.c tabdump_la_SOURCES = tabdump.c tabminmax_la_SOURCES = tabminmax.c tabread4___la_SOURCES = tabread4~~.c tabset_la_SOURCES = tabset.c tavg__la_SOURCES = tavg~.c time_la_SOURCES = time.c unpack__la_SOURCES = unpack~.c unpack_la_SOURCES = unpack.c urn_la_SOURCES = urn.c wrap_la_SOURCES = wrap.c z__la_SOURCES = z~.c zexy_la_SOURCES = zexy.c z_zexy.c \ zexy.h zexySIMD.h z_zexy.h zexyconf.h \ 0x260x260x7e.c 0x2e.c 0x3c0x7e.c 0x3d0x3d0x7e.c 0x3e0x7e.c 0x7c0x7c0x7e.c \ a2l.c abs~.c absgn~.c atoi.c atof.c avg~.c \ blockmirror~.c blockshuffle~.c blockswap~.c \ date.c demultiplex~.c demultiplex.c dfreq~.c dirac~.c doublepole~.c drip.c envrms~.c \ fifop.c freadln.c fwriteln.c glue.c index.c length.c lifop.c limiter~.c \ list2int.c list2lists.c list2symbol.c lister.c listfind.c liststorage.c longload.c lpt.c \ makesymbol.c matchbox.c mavg.c minmax.c msgfile.c multiline~.c multiplex~.c \ multiplex.c multireceive.c niagara.c noish~.c noisi~.c operating_system.c pack~.c \ pack.c packel.c pdf~.c prime.c quantize~.c rawprint.c regex.c relay.c repack.c \ repeat.c route~.c sfplay.c sfrecord.c sgn~.c sigzero~.c sleepgrain.c sort.c \ step~.c strcmp.c sum.c swap~.c symbol2list.c tabdump.c tabminmax.c tabread4~~.c \ tabset.c tavg~.c time.c unpack~.c unpack.c urn.c wrap.c z~.c if WINDOWS zexy_la_SOURCES += winNT_portio.c endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/Makefile.nt000066400000000000000000000015501265051730400235630ustar00rootroot00000000000000# ----------------------- NT ----------------------- .PHONY: clean cleaner all zexy LIBNAME=zexy current: $(LIBNAME) PREFIX=C:\Programme\pd EXT=dll CC=cl LD=link DEFS=/D__WIN32__ /DPD /DZEXY_LIBRARY IFLAGS=/I. /I$(PREFIX)\src WFLAGS=/W3 /WX /nologo ## for LinePrinter-support: (if you don't want it, comment it out) DEFS += /DZ_WANT_LPT .SUFFIXES: .$(EXT) SOURCES=$(sort $(filter %.c, $(wildcard *.c))) CFLAGS = /O2 $(DEFS) $(IFLAGS) $(WFLAGS) LIBS = libc.lib oldnames.lib kernel32.lib pd.lib LFLAGS = /dll /export:$(LIBNAME)_setup /LIBPATH:"$(PREFIX)\bin" TARGETS = $(SOURCES:.c=.obj) $(TARGETS): %.obj : %.c $(CC) $(CFLAGS) /c $*.c $(LIBNAME): $(TARGETS) $(LD) $(LFLAGS) /out:$(LIBNAME).$(EXT) *.obj $(LIBS) clean: del /f *.obj $(LIBNAME).$(EXT) cleaner: clean del /f *~ _* config.* $(LIBNAME).$(EXT) zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/a2l.c000066400000000000000000000045721265051730400223340ustar00rootroot00000000000000/* * a2l: convert anythings to lists (use [list] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include 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("a2l"), (t_newmethod)a2l_new, 0, sizeof(t_a2l), 0, 0); class_addcreator((t_newmethod)a2l_new, gensym("any2list"), 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); zexy_register("any2list"); } void any2list_setup(void) { a2l_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/absgn~.c000066400000000000000000000104161265051730400231400ustar00rootroot00000000000000/* * absgn~: combined absolute value and sign of a signal * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" typedef struct _absgn { t_object x_obj; t_float x_f; } t_absgn; /* ------------------------ sigABSGN~ ----------------------------- */ static t_class *sigABSGN_class; static t_int *sigABSGN_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); t_sample *out2 = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { t_sample val = *in++; *out++ = fabsf(val); if (val>0.) { *out2++=1.; } else if (val<0.) { *out2++=-1.; } else { *out2++=0.; } } return (w+5); } #ifdef __SSE__ static int l_bitmask[] = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; static int l_sgnbitmask[]= {0x80000000, 0x80000000, 0x80000000, 0x80000000}; static t_int *sigABSGN_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out1 = (__m128 *)(w[2]); __m128 *out2 = (__m128 *)(w[3]); int n = (int)(w[4])>>3; const __m128 bitmask= _mm_loadu_ps((float*)l_bitmask); const __m128 sgnmask= _mm_loadu_ps((float*)l_sgnbitmask); const __m128 zero = _mm_setzero_ps(); const __m128 one = _mm_set1_ps(1.f); do { __m128 val, val2, xmm0, xmm1, xmm2, xmm3; val=in[0]; xmm0 = _mm_cmpneq_ps(val, zero); /* mask for non-zeros */ xmm1 = _mm_and_ps (val, sgnmask);/* sign (without value) */ xmm0 = _mm_and_ps (xmm0, one); /* (abs) value: (val==0.f)?0.f:1.f */ out1[0]= _mm_and_ps (val, bitmask);/* abs: set sign-bit to "+" */ out2[0]= _mm_or_ps (xmm1, xmm0); /* merge sign and value */ val2=in[1]; xmm2 = _mm_cmpneq_ps(val2, zero); /* mask for non-zeros */ xmm3 = _mm_and_ps (val2, sgnmask);/* sign (without value) */ xmm2 = _mm_and_ps (xmm2, one); /* (abs) value: (val==0.f)?0.f:1.f */ out1[1]= _mm_and_ps (val2, bitmask);/* abs: set sign-bit to "+" */ out2[1]= _mm_or_ps (xmm3, xmm2); /* merge sign and value */ in +=2; out1+=2; out2+=2; } while (--n); return (w+5); } #endif /* __SSE__ */ static void sigABSGN_dsp(t_absgn* UNUSED(x), t_signal **sp) { #ifdef __SSE__ if( ZEXY_TYPE_EQUAL(t_sample, float) && /* currently SSE2 code is only for float (not for double) */ Z_SIMD_CHKBLOCKSIZE(sp[0]->s_n) && Z_SIMD_CHKALIGN(sp[0]->s_vec) && Z_SIMD_CHKALIGN(sp[1]->s_vec) && Z_SIMD_CHKALIGN(sp[2]->s_vec) && zexy_testSSE(sigABSGN_perform, sigABSGN_performSSE, 1, 2) ) { dsp_add(sigABSGN_performSSE, 4, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); } else #endif { dsp_add(sigABSGN_perform, 4, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); } } static void sigABSGN_helper(void) { post("\n"HEARTSYMBOL " absgn~ \t\t:: absolute value and sign of a signal"); post(" \t\t copyright (c) Tim Blechmann 2006"); } static void *sigABSGN_new(void) { t_absgn *x = (t_absgn *)pd_new(sigABSGN_class); x->x_f=0.f; outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); return (x); } void absgn_tilde_setup(void) { sigABSGN_class = class_new(gensym("absgn~"), (t_newmethod)sigABSGN_new, 0, sizeof(t_absgn), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(sigABSGN_class, t_absgn, x_f); class_addmethod(sigABSGN_class, (t_method)sigABSGN_dsp, gensym("dsp"), 0); class_addmethod(sigABSGN_class, (t_method)sigABSGN_helper, gensym("help"), 0); class_sethelpsymbol(sigABSGN_class, gensym("zigbinops")); zexy_register("absgn~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/abs~.c000066400000000000000000000103711265051730400226130ustar00rootroot00000000000000/* * abs~: absolute value for signals * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" typedef struct _abs { t_object x_obj; t_float x_f; } t_abs; /* ------------------------ sigABS~ ----------------------------- */ static t_class *sigABS_class; static t_int *sigABS_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); while (n--) { *out++ = fabsf(*in++); } return (w+4); } #ifdef __SSE__ static int l_bitmask[]= {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; static t_int *sigABS_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[2]); int n = (int)(w[3])>>4; __m128 bitmask= _mm_loadu_ps((float*)l_bitmask); while (n--) { out[0] = _mm_and_ps(in[0] , bitmask); out[1] = _mm_and_ps(in[1] , bitmask); out[2] = _mm_and_ps(in[2] , bitmask); out[3] = _mm_and_ps(in[3] , bitmask); in +=4; out+=4; } #if 0 /* * handwritten SSE-code by tim blechmann * * JMZ: the above (using intrinsics) is a little bit slower * but still about 4* as fast as the generic code * i prefer using intrinsics as i don't have to learn how to * assembler */ asm( ".section .rodata \n" ".align 16 \n" "2: \n" ".long 2147483647 \n" /* bitmask */ ".long 2147483647 \n" /* 0x7fffffff */ ".long 2147483647 \n" ".long 2147483647 \n" ".text \n" "movaps (2b), %%xmm0 \n" /* xmm0 = bitmask */ "shrl $4, %2 \n" /* loop: *dest = abs(*src) */ "1: \n" "movaps (%0,%3), %%xmm1 \n" "andps %%xmm0, %%xmm1 \n" "movaps %%xmm1, (%1,%3) \n" "movaps 16(%0,%3), %%xmm2 \n" "andps %%xmm0, %%xmm2 \n" "movaps %%xmm2, 16(%1,%3) \n" "movaps 32(%0,%3), %%xmm3 \n" "andps %%xmm0, %%xmm3 \n" "movaps %%xmm3, 32(%1,%3) \n" "movaps 48(%0,%3), %%xmm4 \n" "andps %%xmm0, %%xmm4 \n" "movaps %%xmm4, 48(%1,%3) \n" "addl $64, %3 \n" "loop 1b \n" : :"r"(in), "r"(out), "c"(n), "r"(0) :"%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4" ); #endif /*0*/ return (w+4); } #endif /* __SSE__ */ static void sigABS_dsp(t_abs *x, t_signal **sp) { #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(sp[0]->s_n) && Z_SIMD_CHKALIGN(sp[0]->s_vec) && Z_SIMD_CHKALIGN(sp[1]->s_vec) && ZEXY_TYPE_EQUAL(t_sample, float) && zexy_testSSE(sigABS_perform, sigABS_performSSE, 1, 1) ) { dsp_add(sigABS_performSSE, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } else #endif { dsp_add(sigABS_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } } static void sigABS_helper(void) { post("\n"HEARTSYMBOL " abs~ \t\t:: absolute value of a signal"); } static void *sigABS_new(void) { t_abs *x = (t_abs *)pd_new(sigABS_class); x->x_f=0.f; outlet_new(&x->x_obj, gensym("signal")); return (x); } void abs_tilde_setup(void) { sigABS_class = class_new(gensym("abs~"), (t_newmethod)sigABS_new, 0, sizeof(t_abs), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(sigABS_class, t_abs, x_f); class_addmethod(sigABS_class, (t_method)sigABS_dsp, gensym("dsp"), 0); class_addmethod(sigABS_class, (t_method)sigABS_helper, gensym("help"), 0); class_sethelpsymbol(sigABS_class, gensym("zigbinops")); zexy_register("abs~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/acinclude.m4000066400000000000000000000124201265051730400236720ustar00rootroot00000000000000dnl Copyright (C) 2005-2006 IOhannes m zmölnig dnl This file is free software; IOhannes m zmölnig dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # AC_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(C) compiler accepts the ADDITIONAL-CPPFLAGS # if so, they are added to the CPPFLAGS AC_DEFUN([AC_CHECK_CPPFLAGS], [ AC_MSG_CHECKING([whether $CPP accepts "$1"]) temp_check_cppflags="${CPPFLAGS}" CPPFLAGS="$1 ${CPPFLAGS}" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([[int main(void){return 0;}]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); CPPFLAGS="${temp_check_cppflags}"]) ])# AC_CHECK_CPPFLAGS # AC_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS # if so, they are added to the CFLAGS AC_DEFUN([AC_CHECK_CFLAGS], [ AC_MSG_CHECKING([whether $CC accepts "$1"]) cat > conftest.c << EOF int main(){ return 0; } EOF if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1 then AC_MSG_RESULT([yes]) CFLAGS="${CFLAGS} [$1]" AC_CHECK_CPPFLAGS([$1]) [$2] else AC_MSG_RESULT([no]) [$3] fi ])# AC_CHECK_CFLAGS # AC_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(CXX) (c++) compiler accepts the ADDITIONAL-CXXFLAGS # if so, they are added to the CXXFLAGS AC_DEFUN([AC_CHECK_CXXFLAGS], [ AC_MSG_CHECKING([whether $CXX accepts "$1"]) cat > conftest.c++ << EOF int main(){ return 0; } EOF if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1 then AC_MSG_RESULT([yes]) CXXFLAGS="${CXXFLAGS} [$1]" AC_CHECK_CPPFLAGS([$1]) [$2] else AC_MSG_RESULT([no]) [$3] fi ])# AC_CHECK_CXXFLAGS # AC_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # AC_DEFUN([AC_CHECK_FRAMEWORK], [ AC_MSG_CHECKING([for "$1"-framework]) temp_check_ldflags_org="${LDFLAGS}" LDFLAGS="-framework [$1] ${LDFLAGS}" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) if test "x$temp_check_ldflags_success" = "xyes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) LDFLAGS="$temp_check_ldflags_org" [$3] fi ])# AC_CHECK_FRAMEWORK # AC_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # # checks whether the $(LD) linker accepts the ADDITIONAL-LDFLAGS # if so, they are added to the LDFLAGS AC_DEFUN([AC_CHECK_LDFLAGS], [ AC_MSG_CHECKING([whether linker accepts "$1"]) temp_check_ldflags_org="${LDFLAGS}" LDFLAGS="$1 ${LDFLAGS}" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) if test "x$temp_check_ldflags_success" = "xyes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) LDFLAGS="$temp_check_ldflags_org" [$3] fi ])# AC_CHECK_LDFLAGS AC_DEFUN([AC_CHECK_FAT], [ AC_ARG_ENABLE(fat-binary, [ --enable-fat-binary=ARCHS build an Apple Multi Architecture Binary (MAB); ARCHS is a comma-delimited list of architectures for which to build; if ARCHS is omitted, then the package will be built for all architectures supported by the platform (e.g. "ppc,i386" for MacOS/X and Darwin; if this option is disabled or omitted entirely, then the package will be built only for the target platform], [fat_binary=$enableval], [fat_binary=no]) if test "$fat_binary" != no; then AC_MSG_CHECKING([target architectures]) # Respect TARGET_ARCHS setting from environment if available. if test -z "$TARGET_ARCHS"; then # Respect ARCH given to --enable-fat-binary if present. if test "$fat_binary" != yes; then TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '` else # Choose a default set of architectures based upon platform. TARGET_ARCHS="ppc i386" fi fi AC_MSG_RESULT([$TARGET_ARCHS]) define([Name],[translit([$1],[./-], [___])]) # /usr/lib/arch_tool -archify_list $TARGET_ARCHS []Name="" for archs in $TARGET_ARCHS do []Name="$[]Name -arch $archs" done if test "x$[]Name" != "x"; then AC_CHECK_CFLAGS($[]Name,,[]Name="") fi if test "x$[]Name" != "x"; then AC_CHECK_LDFLAGS($[]Name,,[]Name="") fi undefine([Name]) fi ])# AC_CHECK_FAT AC_DEFUN([AC_CHECK_SIMD], [ AC_ARG_ENABLE(simd, [ --enable-simd=ARCHS enable SIMD optimization; valid arguments are: SSE2 ], [simd=$enableval], [simd=no]) if test "$simd" != no; then AC_MSG_CHECKING([SIMD optimization]) # Respect SIMD given to --enable-simd if present. if test "$simd" != yes; then SIMD=`echo "$simd" | tr ',' ' '` else # Choose a default set of architectures based upon platform. SIMD="SSE2" fi AC_MSG_RESULT([$SIMD]) for smd in $SIMD do case "${smd}" in SSE2|sse2) AC_CHECK_CFLAGS([-mfpmath=sse -msse]) ;; *) AC_MSG_RESULT([unknown SIMD instructions: ${smd}]) ;; esac done fi ])# AC_CHECK_SIMD zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/alias000066400000000000000000000002321265051730400225130ustar00rootroot00000000000000a2l any2list demultiplex~ demux~ demultiplex demux drip unfold list2int l2i list2symbol l2s lister l lpt lp multiplex~ mux~ multiplex mux symbol2list s2l zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/astyle.rc000066400000000000000000000005261265051730400233340ustar00rootroot00000000000000## asytyle configuration for zexy # usage: astyle --options=astyle.conf *.c *.h ## CRLF line-ending lineend=linux ## make sure that code fits on an old-school terminal max-code-length=75 # maximum indentation on continuation lines max-instatement-indent=40 ## "One True Brace Style" style=1tbs ## hardly an indentation indent=spaces=2 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/atof.c000066400000000000000000000046541265051730400226100ustar00rootroot00000000000000/* * atof: ascii to A_FLOAT converter * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include #include static t_class *atof_class; typedef struct _atof { t_object x_obj; t_float x_f; t_outlet*x_reject; } t_atof; static void atof_bang(t_atof *x) { outlet_float(x->x_obj.ob_outlet, (t_float)x->x_f); } static void atof_float(t_atof *x, t_floatarg f) { x->x_f = f; atof_bang(x); } static void atof_symbol(t_atof *x, t_symbol *sym) { const char* s = sym->s_name; char*endptr=NULL; double d=strtod(s, &endptr); size_t len=strlen(s); if(endptr && ((s+len)==endptr)) { atof_float(x, d); } else { outlet_symbol(x->x_reject, sym); } } static void atof_list(t_atof *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { if(!argc) { atof_bang(x); return; } if (argv->a_type==A_FLOAT) { atof_float(x, atom_getfloat(argv)); return; } atof_symbol(x, atom_getsymbol(argv)); } static void atof_free(t_atof*x) { outlet_free(x->x_reject); x->x_reject=NULL; } static void *atof_new(void) { t_atof *x = (t_atof *)pd_new(atof_class); outlet_new(&x->x_obj, gensym("float")); x->x_reject=outlet_new(&x->x_obj, gensym("symbol")); x->x_f = 0.; return (x); } void atof_setup(void) { atof_class = class_new(gensym("atof"), (t_newmethod)atof_new, (t_method)atof_free, sizeof(t_atof), 0, A_DEFFLOAT, 0); class_addbang(atof_class, (t_method)atof_bang); class_addfloat(atof_class, (t_method)atof_float); class_addlist(atof_class, (t_method)atof_list); class_addsymbol(atof_class, (t_method)atof_symbol); class_addanything(atof_class, (t_method)atof_symbol); zexy_register("atof"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/atoi.c000066400000000000000000000052451265051730400226100ustar00rootroot00000000000000/* * atoi: ascii to integer converter * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include #include static t_class *atoi_class; typedef struct _atoi { t_object x_obj; int x_i; t_outlet*x_reject; } t_atoi; static void atoi_bang(t_atoi *x) { outlet_float(x->x_obj.ob_outlet, (t_float)x->x_i); } static void atoi_float(t_atoi *x, t_float f) { x->x_i = f; atoi_bang(x); } static void atoi_atoi(t_atoi *x, t_symbol*s, int base) { char*endptr=NULL; const char*str=s->s_name; long l=strtol(str, &endptr, base); size_t len=strlen(str); if(str+len == endptr) { atoi_float(x, l); } else { outlet_symbol(x->x_reject, s); } } static void atoi_symbol(t_atoi *x, t_symbol *sym) { int base=10; const char* s = sym->s_name; if(s[0]=='0') { base=8; if (s[1]=='x') { base=16; } } atoi_atoi(x, sym, base); } static void atoi_list(t_atoi *x, t_symbol* s, int argc, t_atom *argv) { int base=10; if (argv->a_type==A_FLOAT) { atoi_float(x, atom_getfloat(argv)); return; } if (argc>1) { base=atom_getfloat(argv+1); if (base<2) { error("atoi: setting base to 10"); base=10; } } atoi_atoi(x, s, base); } static void atoi_free(t_atoi *x) { outlet_free(x->x_reject); x->x_reject=NULL; } static void *atoi_new(void) { t_atoi *x = (t_atoi *)pd_new(atoi_class); outlet_new(&x->x_obj, gensym("float")); x->x_reject=outlet_new(&x->x_obj, gensym("symbol")); x->x_i=0; return (x); } void atoi_setup(void) { atoi_class = class_new(gensym("atoi"), (t_newmethod)atoi_new, (t_method)atoi_free, 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); zexy_register("atoi"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/avg~.c000066400000000000000000000041051265051730400226210ustar00rootroot00000000000000/* * avg~: calculate the average of a signal block * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------ average~ ----------------------------- */ /* tilde object to take absolute value. */ static t_class *avg_class; typedef struct _avg { t_object x_obj; t_float n_inv; int blocks; } t_avg; /* average :: arithmetic mean of one signal-vector */ static t_int *avg_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_avg *x = (t_avg *)w[2]; int n = (int)(w[3]); t_sample 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); zexy_register("avg~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/blockmirror~.c000066400000000000000000000065331265051730400244000ustar00rootroot00000000000000/* * blockmirror~: mirrors a signalblock around it's center * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #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_sample *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_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); if (x->doit) { if (in==out) { int N=n; t_sample *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->blocksizes_n) { if(x->blockbuffer) { freebytes(x->blockbuffer, sizeof(*x->blockbuffer)*x->blocksize); } x->blocksize = sp[0]->s_n; x->blockbuffer = getbytes(sizeof(*x->blockbuffer)*x->blocksize); } dsp_add(blockmirror_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void blockmirror_helper(t_blockmirror*x) { post("\n"HEARTSYMBOL " blockmirror~-object for reverting a signal"); post("'help' : view this\n" "signal~"); post("outlet : signal~"); } static void blockmirror_free(t_blockmirror*x) { if(x->blockbuffer) { freebytes(x->blockbuffer, sizeof(*x->blockbuffer)*x->blocksize); } x->blockbuffer=0; } static void *blockmirror_new(void) { 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, (t_method)blockmirror_free, sizeof(t_blockmirror), 0, A_NULL); 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); zexy_register("blockmirror~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/blockshuffle~.c000066400000000000000000000103741265051730400245200ustar00rootroot00000000000000/* * blockshuffle~: shuffle a signal block * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------ blockshuffle~ ----------------------------- */ /* 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 *blockshuffle_class; typedef struct _blockshuffle { t_object x_obj; t_sample*blockbuf; t_int* indices; int size; t_float *shuffle; int shufflesize; } t_blockshuffle; static void blockshuffle_buildindex(t_blockshuffle *x, int blocksize) { int i=0; if(blocksize!=x->size) { if(x->indices) { freebytes(x->indices, x->size); } if(x->blockbuf) { freebytes(x->blockbuf, x->size); } x->indices=getbytes (sizeof(t_int)*blocksize); x->blockbuf=getbytes(sizeof(t_sample)*blocksize); x->size=blocksize; } for(i=0; ishufflesize&&ishuffle[i]; if(idx>=blocksize) { idx=blocksize-1; } if(idx<0) { idx=0; } x->indices[i]=idx; } for(; iindices[i]=i; } } static void blockshuffle_list(t_blockshuffle *x, t_symbol*s, int argc, t_atom*argv) { int i; if(x->shuffle) { freebytes(x->shuffle, x->shufflesize); x->shuffle=0; } x->shufflesize=argc; x->shuffle=getbytes(sizeof(*x->shuffle)*argc); for(i=0; ishuffle[i]=atom_getfloat(argv++); } blockshuffle_buildindex(x, x->size); } static t_int *blockshuffle_perform(t_int *w) { t_blockshuffle*x = (t_blockshuffle *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); int i=0; t_sample *temp=x->blockbuf; t_int *idx =x->indices; if(idx) { for(i=0; iblockbuf; for(i=0; is_n); dsp_add(blockshuffle_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void blockshuffle_helper(void) { post("\n"HEARTSYMBOL " blockshuffle~-object for shuffling the samples within a signal-block"); post("'help' : view this\n" "signal~"); post("outlet : signal~"); } static void blockshuffle_free(t_blockshuffle *x) { if(x->indices) { freebytes(x->indices, sizeof(*x->indices) *x->size); } if(x->blockbuf) { freebytes(x->blockbuf, sizeof(*x->blockbuf)*x->size); } if(x->shuffle) { freebytes(x->shuffle, sizeof(*x->shuffle) *x->shufflesize); } } static void *blockshuffle_new(void) { t_blockshuffle *x = (t_blockshuffle *)pd_new(blockshuffle_class); outlet_new(&x->x_obj, gensym("signal")); x->size=0; x->blockbuf=0; x->indices=0; x->shuffle=0; x->shufflesize=0; return (x); } void blockshuffle_tilde_setup(void) { blockshuffle_class = class_new(gensym("blockshuffle~"), (t_newmethod)blockshuffle_new, (t_method)blockshuffle_free, sizeof(t_blockshuffle), 0, A_NULL); class_addmethod(blockshuffle_class, nullfn, gensym("signal"), 0); class_addmethod(blockshuffle_class, (t_method)blockshuffle_dsp, gensym("dsp"), 0); class_addlist(blockshuffle_class, blockshuffle_list); class_addmethod(blockshuffle_class, (t_method)blockshuffle_helper, gensym("help"), 0); zexy_register("blockshuffle~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/blockswap~.c000066400000000000000000000063421265051730400240360ustar00rootroot00000000000000/* * blockswap~: swaps a signalblock around it's center * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #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_sample *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_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int N = (int)(w[4]); int N2=N/2; if (x->doit) { int n=N2; t_sample *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*2s_n) { if(x->blockbuffer) { freebytes(x->blockbuffer, sizeof(*x->blockbuffer)*x->blocksize); } x->blocksize = sp[0]->s_n/2; x->blockbuffer = getbytes(sizeof(*x->blockbuffer)*x->blocksize); } dsp_add(blockswap_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void blockswap_helper(t_blockswap *x) { post("\n"HEARTSYMBOL " blockswap~-object for blockwise-swapping of a signal "); post("'help' : view this\n" "signal~"); post("outlet : signal~"); } static void blockswap_free(t_blockswap *x) { if(x->blockbuffer) { freebytes(x->blockbuffer, sizeof(*x->blockbuffer)*x->blocksize); } x->blockbuffer=0; } static void *blockswap_new(void) { 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, (t_method)blockswap_free, sizeof(t_blockswap), 0, A_NULL); 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); zexy_register("blockswap~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/bootstrap.sh000077500000000000000000000001471265051730400240600ustar00rootroot00000000000000#!/bin/sh cd .. && ./autogen.sh echo "now run './configure' for help on args run './configure --help'" zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/configure000077500000000000000000000001541265051730400234110ustar00rootroot00000000000000#!/bin/sh TOPDIR=.. echo "dummy configure... starting at top: ${TOPDIR}/" cd ${TOPDIR}/ ./configure $@ zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/date.c000066400000000000000000000073271265051730400225740ustar00rootroot00000000000000/* * date: gets the current date from the system * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /****************************************************** * * 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) */ #include "zexy.h" #ifdef __WIN32__ # define USE_TIMEB #endif #ifdef __APPLE__ # include /* typedef _BSD_TIME_T_ time_t; */ #endif #include #ifdef USE_TIMEB # include #else # include #endif /* ----------------------- date --------------------- */ static t_class *date_class; typedef struct _date { t_object x_obj; int GMT; t_outlet *x_outlet1; t_outlet *x_outlet2; t_outlet *x_outlet3; t_outlet *x_outlet4; t_outlet *x_outlet5; t_outlet *x_outlet6; } t_date; static void *date_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_date *x = (t_date *)pd_new(date_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, gensym("float")); x->x_outlet2 = outlet_new(&x->x_obj, gensym("float")); x->x_outlet3 = outlet_new(&x->x_obj, gensym("float")); x->x_outlet4 = outlet_new(&x->x_obj, gensym("float")); x->x_outlet5 = outlet_new(&x->x_obj, gensym("float")); x->x_outlet6 = outlet_new(&x->x_obj, gensym("float")); return (x); } static void date_bang(t_date *x) { struct tm *resolvetime; #ifdef USE_TIMEB struct timeb mytime; ftime(&mytime); resolvetime=(x->GMT)?gmtime(&mytime.time):localtime(&mytime.time); #else struct timeval tv; gettimeofday(&tv, 0); resolvetime = (x->GMT)?gmtime(&tv.tv_sec):localtime(&tv.tv_sec); #endif outlet_float(x->x_outlet6, (t_float)resolvetime->tm_isdst); outlet_float(x->x_outlet5, (t_float)resolvetime->tm_yday); outlet_float(x->x_outlet4, (t_float)resolvetime->tm_wday); outlet_float(x->x_outlet3, (t_float)resolvetime->tm_mday); outlet_float(x->x_outlet2, (t_float)resolvetime->tm_mon + 1); outlet_float(x->x_outlet1, (t_float)resolvetime->tm_year + 1900); } static void help_date(t_date* UNUSED(x)) { post("\n"HEARTSYMBOL " date\t\t:: get the current system date"); post("\noutputs are\t: year / month / day / day of week /day of year / daylightsaving (1/0)"); post("\ncreation\t::'date [GMT]': show local date or GMT"); } void date_setup(void) { date_class = class_new(gensym("date"), (t_newmethod)date_new, 0, sizeof(t_date), 0, A_GIMME, 0); class_addbang(date_class, date_bang); class_addmethod(date_class, (t_method)help_date, gensym("help"), 0); zexy_register("date"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/demultiplex.c000066400000000000000000000055121265051730400242050ustar00rootroot00000000000000/* * demux : demultiplex the input to a specified output * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include /* ------------------------- demux ------------------------------- */ /* a demultiplexer */ static t_class *demux_class; typedef struct _demux { t_object x_obj; int n_out; t_outlet **out, *selected; } t_demux; static void demux_select(t_demux *x, t_float f) { int n = ( (f<0) || (f>x->n_out) ) ? 0 : f; x->selected = x->out[n]; } static void demux_list(t_demux *x, t_symbol *s, int argc, t_atom *argv) { switch (argc) { case 0: outlet_bang(x->selected); break; case 1: switch (argv->a_type) { case A_FLOAT: outlet_float(x->selected, atom_getfloat(argv)); break; case A_SYMBOL: outlet_symbol(x->selected, atom_getsymbol(argv)); break; case A_POINTER: outlet_pointer(x->selected, argv->a_w.w_gpointer); break; default: outlet_list(x->selected, s, argc, argv); } break; default: outlet_list(x->selected, s, argc, argv); } } static void demux_any(t_demux *x, t_symbol *s, int argc, t_atom *argv) { outlet_anything(x->selected, s, argc, argv); } static void *demux_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) { t_demux *x = (t_demux *)pd_new(demux_class); int n = (argc < 2)?2:argc; x->n_out = n - 1; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("select")); x->out = (t_outlet **)getbytes(n * sizeof(t_outlet *)); for (n=0; n<=x->n_out; n++) { x->out[n] = outlet_new(&x->x_obj, 0); } x->selected = x->out[0]; return (x); } void demultiplex_setup(void) { demux_class = class_new(gensym("demultiplex"), (t_newmethod)demux_new, 0, sizeof(t_demux), 0, A_GIMME, 0); class_addcreator((t_newmethod)demux_new, gensym("demux"), A_GIMME, 0); class_addanything (demux_class, demux_any); class_addlist (demux_class, demux_list); class_addmethod (demux_class, (t_method)demux_select, gensym("select"), A_DEFFLOAT, 0); zexy_register("demultiplex"); } void demux_setup(void) { demultiplex_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/demultiplex~.c000066400000000000000000000062721265051730400244070ustar00rootroot00000000000000/* * demux~ : demultiplex a signal to a specified output * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *demux_class; typedef struct _demux { t_object x_obj; int output; int n_out; t_sample **out; } t_demux; static void demux_output(t_demux *x, t_floatarg f) { if ((f>=0)&&(fn_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_sample *in = (t_sample *)(w[2]); int N = (int)(w[3]); int n = N; int channel=x->n_out; while(channel--) { t_sample*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_sample **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"HEARTSYMBOL " demux~\t:: demultiplex a signal to one of various outlets"); 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_sample *)); } static void *demux_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(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_sample **)getbytes(x->n_out * sizeof(t_sample *)); 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); zexy_register("demultiplex~"); } void demux_tilde_setup(void) { demultiplex_tilde_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/dfreq~.c000066400000000000000000000054251265051730400231530ustar00rootroot00000000000000/* * dfreq~: cound zero-crossings as a simple fequency estimation * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include #include "zexy.h" /* ------------------------ dspobj~ ----------------------------- */ /* datendefinition */ static t_class *dfreq_class; typedef struct _dfreq { t_object x_obj; t_sample freq; /*frequenz variable */ t_sample alt; t_sample sampcount; t_sample sr; } t_dfreq; static t_int *dfreq_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); t_dfreq *x = (t_dfreq *) w[4]; t_sample a = x->alt; t_sample c = x->sampcount; t_sample freq = x->freq; t_sample sr=x->sr; t_sample delta_inv; while (n--) { if( (a **in) < 0 && (a < *in)) { /* interpolate for real zerocross */ delta_inv = 1./(*in-a); if(c > 0.0) { freq = sr / ((t_sample) c + a*delta_inv); } else { freq = sr; } c = *in*delta_inv; /*rest of time */ }; a = *in; in++; c += 1.0; *out++ = freq; } x->alt = a; x->sampcount = c; x->freq=freq; return (w+5); } static void dfreq_dsp(t_dfreq *x, t_signal **sp) { dsp_add(dfreq_perform, 4, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n,x); } static void *dfreq_new(void) { t_dfreq *x = (t_dfreq *)pd_new(dfreq_class); outlet_new(&x->x_obj, gensym("signal")); x->sr = sys_getsr(); return (x); } static void dfreq_tilde_helper(void) { post("\n"HEARTSYMBOL " dfreq~\t :: pitch-detector that counts zero-crossings"); post("\noutputs a frequency estimate as a stream~ that will be updated every zero-X"); post("\ncreation::\t'dfreq~': that's all"); } void dfreq_tilde_setup(void) { dfreq_class = class_new(gensym("dfreq~"), (t_newmethod)dfreq_new, 0, sizeof(t_dfreq), 0, A_NULL); class_addmethod(dfreq_class, nullfn, gensym("signal"), 0); class_addmethod(dfreq_class, (t_method)dfreq_dsp, gensym("dsp"), 0); class_addmethod(dfreq_class, (t_method)dfreq_tilde_helper, gensym("help"), 0); zexy_register("dfreq~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/dirac~.c000066400000000000000000000075531265051730400231400ustar00rootroot00000000000000/* * dirac~: unity sample * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * optimizations: * (c) 2005 tim blechmann * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* * 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 * * NOTE : the inlets do NOT specify any times but sample-NUMBERS; * there are 64 samples in a "standard" 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_int position; t_int 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 = (t_int)where; } static t_int *dirac_perform(t_int *w) { t_dirac *x = (t_dirac *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); t_int do_it = x->do_it; zero_perform(w+1); if (do_it >= n) { x->do_it -= n; } else if(do_it >= 0) { out[do_it] = 1.f; x->do_it = -1; } return (w+4); } #ifndef __WIN32__ /* LATER: investigate the occurence of zero_perf8() */ /* it seems, like pd has the symbol zero_perf8(), * but it is not exported by m_pd.h: * so linux can use it, but w32 not * have to tell miller about that */ t_int *zero_perf8(t_int *w); #else /* on w32 we have no access to this hidden function anyhow... */ # define zero_perf8 zero_perform #endif static t_int *dirac_perf8(t_int *w) { t_dirac *x = (t_dirac *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); t_int do_it = x->do_it; zero_perf8(w+1); if (do_it >= n) { x->do_it -= n; } else if(do_it >= 0) { out[do_it] = 1.f; x->do_it = -1; } return (w+4); } static void dirac_dsp(t_dirac *x, t_signal **sp) { if (sp[0]->s_n & 7) { dsp_add(dirac_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); } else { dsp_add(dirac_perf8, 3, x, sp[0]->s_vec, sp[0]->s_n); } } static void dirac_helper(void) { post(""HEARTSYMBOL " dirac~-object :: generates a dirac (unity-pulse)"); post("creation : \"dirac~ []\" : create a dirac at specified position (in samples)\n" "inlet\t: \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 = where; x->do_it = -1; if (where > 0) { x->position = where; } else { 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); zexy_register("dirac~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/doublepole~.c000066400000000000000000000072541265051730400242060ustar00rootroot00000000000000/* Copyright (c) 1997-1999 Miller Puckette. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ /* "filters", both linear and nonlinear. */ #include "m_pd.h" #include //* ---------------- doublepole~ - raw doublepole filter ----------------- */ typedef struct doublepolectl { t_sample c_x1; t_sample c_x2; t_sample c_fb1; t_sample c_fb2; } t_doublepolectl; typedef struct sigdoublepole { t_object x_obj; t_float x_f; t_doublepolectl x_cspace; t_doublepolectl *x_ctl; } t_sigdoublepole; static t_class *sigdoublepole_class = NULL; static void sigdoublepole_list(t_sigdoublepole *x, t_symbol *s, int argc, t_atom *argv); static void *sigdoublepole_new(t_symbol *s, int argc, t_atom *argv) { t_sigdoublepole *x = (t_sigdoublepole *)pd_new(sigdoublepole_class); outlet_new(&x->x_obj, &s_signal); x->x_ctl = &x->x_cspace; x->x_cspace.c_x1 = x->x_cspace.c_x2 = 0; sigdoublepole_list(x, s, argc, argv); x->x_f = 0; return (x); } static t_int *sigdoublepole_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); t_doublepolectl *c = (t_doublepolectl *)(w[3]); int n = (t_int)(w[4]); int i; t_sample last = c->c_x1; t_sample prev = c->c_x2; t_sample fb1 = c->c_fb1; t_sample fb2 = c->c_fb2; for (i = 0; i < n; i++) { t_sample output = *in++ + fb1 * last + fb2 * prev; if (PD_BIGORSMALL(output)) { output = 0; } *out++ = output; prev = last; last = output; } c->c_x1 = last; c->c_x2 = prev; return (w+5); } static void sigdoublepole_list(t_sigdoublepole *x, t_symbol *s, int argc, t_atom *argv) { t_float fb1 = atom_getfloatarg(0, argc, argv); t_float fb2 = atom_getfloatarg(1, argc, argv); t_float discriminant = fb1 * fb1 + 4 * fb2; t_doublepolectl *c = x->x_ctl; if (discriminant < 0) { /* imaginary roots -- resonant filter */ /* they're conjugates so we just check that the product is less than one */ if (fb2 >= -1.0f) { goto stable; } } else { /* real roots */ /* check that the parabola 1 - fb1 x - fb2 x^2 has a vertex between -1 and 1, and that it's nonnegative at both ends, which implies both roots are in [1-,1]. */ if (fb1 <= 2.0f && fb1 >= -2.0f && 1.0f - fb1 -fb2 >= 0 && 1.0f + fb1 - fb2 >= 0) { goto stable; } } /* if unstable, just bash to zero */ fb1 = fb2 = 0; stable: c->c_fb1 = fb1; c->c_fb2 = fb2; } static void sigdoublepole_set(t_sigdoublepole *x, t_symbol *s, int argc, t_atom *argv) { t_doublepolectl *c = x->x_ctl; c->c_x1 = atom_getfloatarg(0, argc, argv); c->c_x2 = atom_getfloatarg(1, argc, argv); } static void sigdoublepole_dsp(t_sigdoublepole *x, t_signal **sp) { dsp_add(sigdoublepole_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x->x_ctl, sp[0]->s_n); } void doublepole_tilde_setup(void) { sigdoublepole_class = class_new(gensym("doublepole~"), (t_newmethod)sigdoublepole_new, 0, sizeof(t_sigdoublepole), 0, A_GIMME, 0); CLASS_MAINSIGNALIN(sigdoublepole_class, t_sigdoublepole, x_f); class_addmethod(sigdoublepole_class, (t_method)sigdoublepole_dsp, gensym("dsp"), 0); class_addlist(sigdoublepole_class, sigdoublepole_list); class_addmethod(sigdoublepole_class, (t_method)sigdoublepole_set, gensym("set"), A_GIMME, 0); class_addmethod(sigdoublepole_class, (t_method)sigdoublepole_set, gensym("clear"), A_GIMME, 0); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/drip.c000066400000000000000000000122651265051730400226120ustar00rootroot00000000000000/* * drip: unfold a parallel data-structure (*pack*age) into a sequence * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* -------------------- drip ------------------------------ */ /* unfold a parallel data-structure (*pack*age) into a sequence like a medical drip you can adjust the drop-speed in [ms] */ #include "zexy.h" static t_class *drip_class; typedef struct _drip { t_object x_obj; t_atom *buffer, *current; int bufsize; t_clock *x_clock; t_float deltime; int flush; } t_drip; static void drip_makebuffer(t_drip *x, int n, t_atom *list) { if (x->buffer) { freebytes(x->buffer, x->bufsize * sizeof(t_atom)); x->buffer = 0; x->bufsize = 0; } x->buffer = copybytes(list, n * sizeof(t_atom)); x->bufsize = n; x->current = x->buffer; } static void drip_bang(t_drip *x) { outlet_bang(x->x_obj.ob_outlet); } static void drip_all(t_drip *x, int argc, t_atom *argv) { while (argc--) { switch (argv->a_type) { case A_FLOAT: outlet_float(x->x_obj.ob_outlet, atom_getfloat(argv)); break; case A_SYMBOL: outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(argv)); break; case A_POINTER: outlet_pointer(x->x_obj.ob_outlet, argv->a_w.w_gpointer); break; default: outlet_bang(x->x_obj.ob_outlet); } argv++; } } static void drip_tick(t_drip *x) { switch (x->current->a_type) { case A_FLOAT: outlet_float(x->x_obj.ob_outlet, atom_getfloat(x->current)); break; case A_SYMBOL: outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(x->current)); break; case A_POINTER: outlet_pointer(x->x_obj.ob_outlet, x->current->a_w.w_gpointer); break; case A_NULL: outlet_bang(x->x_obj.ob_outlet); default: break; } if (x->current + 1 >= x->buffer + x->bufsize) { /* ok, we're done */ clock_unset(x->x_clock); x->current = 0; } else { /* do it again */ x->current++; clock_delay(x->x_clock, x->deltime); } } static void drip_list(t_drip *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { if (x->flush && x->current) { /* do we want to flush */ drip_all(x, x->bufsize - (x->current - x->buffer), x->current); } if (x->deltime >= 0.f) { /* do we want to SCHEDULE ? */ /* outlet the first element */ switch (argv->a_type) { case (A_FLOAT): outlet_float(x->x_obj.ob_outlet, atom_getfloat(argv)); break; case (A_SYMBOL): outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(argv)); break; case (A_POINTER): outlet_pointer(x->x_obj.ob_outlet, argv->a_w.w_gpointer); break; default: outlet_bang(x->x_obj.ob_outlet); } /* create a buffer and copy the remaining list into it */ drip_makebuffer(x, argc-1, argv+1); /* set the clock and start */ clock_delay(x->x_clock, x->deltime); } else { /* UNSCHEDULED */ drip_all(x, argc, argv); } } static void drip_anything(t_drip *x, t_symbol *s, int argc, t_atom *argv) { if (x->flush && x->current) { /* do we want to flush */ drip_all(x, x->bufsize - (x->current - x->buffer), x->current); } /* outlet the first element */ outlet_symbol(x->x_obj.ob_outlet, s); if (x->deltime >= 0.f) { /* do we want to SCHEDULE ? */ /* create a buffer and copy the remaining list into it */ drip_makebuffer(x, argc, argv); /* set the clock and start */ clock_delay(x->x_clock, x->deltime); } else { /* UNSCHEDULED */ drip_all(x, argc, argv); } } static void drip_free(t_drip *x) { clock_free(x->x_clock); if (x->buffer) { freebytes(x->buffer, x->bufsize * sizeof(t_atom)); x->buffer = 0; x->bufsize = 0; } } static void *drip_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_drip *x = (t_drip *)pd_new(drip_class); if (argc>1) { x->flush = 1; } else { x->flush = 0; } if (argc) { x->deltime = atom_getfloat(argv); } else { x->deltime = -1.f; } if (x->deltime < 0.f) { x->deltime = -1.0; } x->x_clock = clock_new(x, (t_method)drip_tick); floatinlet_new(&x->x_obj, &x->deltime); outlet_new(&x->x_obj, 0); return (x); } 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); class_addcreator((t_newmethod)drip_new, gensym("unfold"), A_GIMME, 0); /* for historical reasons */ class_addbang (drip_class, drip_bang); class_addlist (drip_class, drip_list); class_addanything(drip_class, drip_anything); zexy_register("drip"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/envrms~.c000066400000000000000000000113751265051730400233650ustar00rootroot00000000000000/* * envrms~: simple envelope follower * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* ---------------- 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" #define MAXOVERLAP 10 #define MAXVSTAKEN 64 t_class *sigenvrms_class; typedef struct sigenvrms { t_object x_obj; /* header */ void *x_outlet; /* a "float" outlet */ void *x_clock; /* a "clock" object */ t_sample *x_buf; /* a Hanning window */ int x_phase; /* number of points since last output */ int x_period; /* requested period of output */ int x_realperiod; /* period rounded up to vecsize multiple */ int x_npoints; /* analysis window size in samples */ t_float x_result; /* result to output */ t_sample x_sumbuf[MAXOVERLAP]; /* summing buffer */ } t_sigenvrms; static void sigenvrms_tick(t_sigenvrms *x); static void *sigenvrms_new(t_floatarg fnpoints, t_floatarg fperiod) { int npoints = fnpoints; int period = fperiod; t_sigenvrms *x; t_sample *buf; int i; if (npoints < 1) { npoints = 1024; } if (period < 1) { period = npoints/2; } if (period < npoints / MAXOVERLAP + 1) { period = npoints / MAXOVERLAP + 1; } if (!(buf = getbytes(sizeof(*buf) * (npoints + MAXVSTAKEN)))) { error("env: couldn't allocate buffer"); return (0); } x = (t_sigenvrms *)pd_new(sigenvrms_class); x->x_buf = buf; x->x_npoints = npoints; x->x_phase = 0; x->x_period = period; for (i = 0; i < MAXOVERLAP; i++) { x->x_sumbuf[i] = 0; } for (i = 0; i < npoints; i++) { buf[i] = (1. - cos((2 * 3.141592654 * i) / npoints))/npoints; } for (; i < npoints+MAXVSTAKEN; i++) { buf[i] = 0; } x->x_clock = clock_new(x, (t_method)sigenvrms_tick); x->x_outlet = outlet_new(&x->x_obj, gensym("float")); return (x); } static t_int *sigenvrms_perform(t_int *w) { t_sigenvrms *x = (t_sigenvrms *)(w[1]); t_sample *in = (t_sample *)(w[2]); int n = (int)(w[3]); int count; t_sample *sump; in += n; for (count = x->x_phase, sump = x->x_sumbuf; count < x->x_npoints; count += x->x_realperiod, sump++) { t_sample *hp = x->x_buf + count; t_sample *fp = in; t_sample sum = *sump; int i; for (i = 0; i < n; i++) { fp--; sum += *hp++ * (*fp **fp); } *sump = sum; } sump[0] = 0; x->x_phase -= n; if (x->x_phase < 0) { x->x_result = x->x_sumbuf[0]; for (count = x->x_realperiod, sump = x->x_sumbuf; count < x->x_npoints; count += x->x_realperiod, sump++) { sump[0] = sump[1]; } sump[0] = 0; x->x_phase = x->x_realperiod - n; clock_delay(x->x_clock, 0L); } return (w+4); } static void sigenvrms_dsp(t_sigenvrms *x, t_signal **sp) { if (x->x_period % sp[0]->s_n) x->x_realperiod = x->x_period + sp[0]->s_n - (x->x_period % sp[0]->s_n); else { x->x_realperiod = x->x_period; } dsp_add(sigenvrms_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); if (sp[0]->s_n > MAXVSTAKEN) { bug("sigenvrms_dsp"); } } static void sigenvrms_tick(t_sigenvrms *x) /* callback function for the clock */ { outlet_float(x->x_outlet, sqrtf(x->x_result)); } static void sigenvrms_ff(t_sigenvrms *x) /* cleanup on free */ { clock_free(x->x_clock); freebytes(x->x_buf, (x->x_npoints + MAXVSTAKEN) * sizeof(*x->x_buf)); } static void sigenvrms_help(void) { post("envrms~\t:: envelope follower that does output rms instead of dB"); } 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); class_addmethod(sigenvrms_class, nullfn, gensym("signal"), 0); class_addmethod(sigenvrms_class, (t_method)sigenvrms_dsp, gensym("dsp"), 0); class_addmethod(sigenvrms_class, (t_method)sigenvrms_help, gensym("help"), 0); zexy_register("envrms~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/fifop.c000066400000000000000000000173111265051730400227540ustar00rootroot00000000000000/* * fifop: a FIFO (first-in first-out) with priorities * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include /* ------------------------- fifop ------------------------------- */ /* * a FIFO (first-in first-out) with priorities * * an incoming list is added to a fifo (based on its priority) * "bang" outputs the next element of the non-empty fifo with the highest priority * * high priority means low numeric value */ static t_class *fifop_class; typedef struct _fifop_list { int argc; t_atom *argv; struct _fifop_list *next; } t_fifop_list; typedef struct _fifop_prioritylist { t_float priority; t_fifop_list *fifo_start; t_fifop_list *fifo_end; struct _fifop_prioritylist *next; } t_fifop_prioritylist; typedef struct _fifop { t_object x_obj; t_fifop_prioritylist *fifo_list; t_float priority; /* current priority */ unsigned long counter; t_outlet *x_out, *x_infout; } t_fifop; static t_fifop_prioritylist*fifop_genprioritylist(t_fifop*x, t_float priority) { t_fifop_prioritylist*result=0, *dummy=0; if(x->fifo_list!=0) { /* * do we already have this priority ? * if so, just return a pointer to that fifo * else set the dummy-pointer to the fifo BEFORE the new one */ dummy=x->fifo_list; while(dummy!=0) { t_float prio=dummy->priority; if(prio==priority) { return dummy; } if(prio>priority) { break; } result=dummy; dummy=dummy->next; } dummy=result; /* dummy points to the FIFO-before the one we want to insert */ } /* create a new priority list */ result = (t_fifop_prioritylist*)getbytes(sizeof( t_fifop_prioritylist)); result->priority=priority; result->fifo_start=0; result->fifo_end=0; result->next=0; /* insert it into the list of priority lists */ if(dummy==0) { /* insert at the beginning */ result->next=x->fifo_list; x->fifo_list=result; } else { /* post insert into the list of FIFOs */ result->next=dummy->next; dummy->next =result; } /* return the result */ return result; } static int add2fifo(t_fifop_prioritylist*fifoprio, int argc, t_atom *argv) { t_fifop_list*fifo=0; t_fifop_list*entry=0; if(fifoprio==0) { error("pfifo: no fifos available"); return -1; } /* create an entry for the fifo */ if(!(entry = (t_fifop_list*)getbytes(sizeof(t_fifop_list)))) { error("pfifo: couldn't add entry to end of fifo"); return -1; } if(!(entry->argv=(t_atom*)getbytes(argc*sizeof(t_atom)))) { error("pfifo: couldn't add list to fifo!"); return -1; } memcpy(entry->argv, argv, argc*sizeof(t_atom)); entry->argc=argc; entry->next=0; /* insert entry into fifo */ if(fifoprio->fifo_end) { /* append to the end of the fifo */ fifo=fifoprio->fifo_end; /* add new entry to end of fifo */ fifo->next=entry; fifoprio->fifo_end=entry; } else { /* the new entry is the 1st entry of the fifo */ fifoprio->fifo_start=entry; /* and at the same time, it is the last entry */ fifoprio->fifo_end =entry; } return 0; } static t_fifop_prioritylist*getFifo(t_fifop_prioritylist*pfifo) { if(pfifo==0) { return 0; } /* get the highest non-empty fifo */ while(pfifo->fifo_start==0 && pfifo->next!=0) { pfifo=pfifo->next; } return pfifo; } static void fifop_list(t_fifop *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { t_fifop_prioritylist*pfifo=0; if(!(pfifo=fifop_genprioritylist(x, x->priority))) { error("[fifop]: couldn't get priority fifo"); return; } if(!add2fifo(pfifo, argc, argv)) { x->counter++; } } static void fifop_bang(t_fifop *x) { t_fifop_prioritylist*pfifo=0; t_fifop_list*fifo=0; t_atom*argv=0; int argc=0; if(!(pfifo=getFifo(x->fifo_list))) { outlet_bang(x->x_infout); return; } if(!(fifo=pfifo->fifo_start)) { outlet_bang(x->x_infout); return; } x->counter--; pfifo->fifo_start=fifo->next; if(0==pfifo->fifo_start) { pfifo->fifo_end=0; } /* get the list from the entry */ argc=fifo->argc; argv=fifo->argv; fifo->argc=0; fifo->argv=0; fifo->next=0; /* destroy the fifo-entry (important for recursion! */ freebytes(fifo, sizeof(t_fifop_list)); /* output the list */ outlet_list(x->x_out, gensym("list"), argc, argv); /* free the list */ freebytes(argv, argc*sizeof(t_atom)); } static void fifop_query(t_fifop*x) { z_verbose(1, "%d elements in fifo", (int)x->counter); outlet_float(x->x_infout, (t_float)x->counter); } static void fifop_clear(t_fifop*x) { t_fifop_prioritylist *fifo_list=x->fifo_list; while(fifo_list) { t_fifop_prioritylist *fifo_list2=fifo_list; t_fifop_list*fifo=fifo_list2->fifo_start; fifo_list=fifo_list->next; while(fifo) { t_fifop_list*fifo2=fifo; fifo=fifo->next; if(fifo2->argv) { freebytes(fifo2->argv, fifo2->argc*sizeof(t_atom)); } fifo2->argv=0; fifo2->argc=0; fifo2->next=0; freebytes(fifo2, sizeof(t_fifop_list)); } fifo_list2->priority =0; fifo_list2->fifo_start=0; fifo_list2->fifo_end =0; fifo_list2->next =0; freebytes(fifo_list2, sizeof( t_fifop_prioritylist)); } x->fifo_list=0; x->counter=0; } /* this is NOT re-entrant! */ static void fifop_dump(t_fifop*x) { t_fifop_prioritylist*pfifo=getFifo(x->fifo_list); if(!pfifo||!pfifo->fifo_start) { outlet_bang(x->x_infout); return; } while(pfifo) { t_fifop_list*fifo=pfifo->fifo_start; while(fifo) { t_atom*argv=fifo->argv; int argc=fifo->argc; /* output the list */ outlet_list(x->x_out, gensym("list"), argc, argv); fifo=fifo->next; } pfifo=pfifo->next; } } static void fifop_help(t_fifop*x) { post("\n"HEARTSYMBOL " fifop\t\t:: a First-In-First-Out queue with priorities"); } static void fifop_free(t_fifop *x) { fifop_clear(x); outlet_free(x->x_out); outlet_free(x->x_infout); } static void *fifop_new(void) { t_fifop *x = (t_fifop *)pd_new(fifop_class); floatinlet_new(&x->x_obj, &x->priority); x->x_out =outlet_new(&x->x_obj, gensym("list" )); x->x_infout=outlet_new(&x->x_obj, gensym("float")); x->fifo_list = 0; x->priority=0; return (x); } void fifop_setup(void) { fifop_class = class_new(gensym("fifop"), (t_newmethod)fifop_new, (t_method)fifop_free, sizeof(t_fifop), 0, A_NULL); class_addbang (fifop_class, fifop_bang); class_addlist (fifop_class, fifop_list); class_addmethod (fifop_class, (t_method)fifop_clear, gensym("clear"), A_NULL); class_addmethod (fifop_class, (t_method)fifop_dump, gensym("dump"), A_NULL); class_addmethod (fifop_class, (t_method)fifop_query, gensym("info"), A_NULL); class_addmethod (fifop_class, (t_method)fifop_help, gensym("help"), A_NULL); zexy_register("fifop"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/freadln.c000066400000000000000000000163151265051730400232670ustar00rootroot00000000000000/* * freadln: reads messages continuously from the lines of a file * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * (c) 2007 Franz Zotter , Institute of Electronic Music and Acoustics * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #ifdef __WIN32__ # define snprintf _snprintf #endif #include #include #include #ifdef __WIN32__ # include #else # include #endif #define MIN_FREADLN_LENGTH 10 /* freadln: reads messages continuously from the lines of * a file that doesn't necessarily need to fit * into the RAM of your system */ static t_class *freadln_class; typedef struct freadln { t_object x_ob; FILE *x_file; char *x_filename; char *x_textbuf; int x_textbuf_length; t_outlet *x_message_outlet; t_outlet *x_readybang_outlet; char linebreak_chr[3]; t_canvas *x_canvas; } t_freadln; static void freadln_close (t_freadln *x) { if(x->x_file) { z_fclose(x->x_file); } x->x_file=0; if(x->x_filename) { freebytes(x->x_filename, sizeof(char)*MAXPDSTRING); } x->x_filename=0; if(x->x_textbuf) { freebytes(x->x_textbuf, sizeof(char)*x->x_textbuf_length); } x->x_textbuf=0; x->x_textbuf_length=0; } static void freadln_open (t_freadln *x, t_symbol *s, t_symbol*type) { char filenamebuf[MAXPDSTRING], *filenamebufptr; char*dirname=canvas_getdir(x->x_canvas)->s_name; int fd, len; post("open: %s", s->s_name); freadln_close(x); /* if(type!=gensym("cr")) { pd_error(x, "currently only 'cr' type files are implemented!"); return; } */ if (type==gensym("cr")) { strcpy(x->linebreak_chr,"\n"); } else { strcpy(x->linebreak_chr,";\n"); } /* directory, filename, extension, dirresult, nameresult, unsigned int size, int bin */ if ((fd=open_via_path( dirname, s->s_name, "", filenamebuf, &filenamebufptr, MAXPDSTRING, 0)) < 0 ) { pd_error(x, "%s: failed to open %s", s->s_name, filenamebuf); return; } z_close(fd); len=strlen(filenamebuf); if (!(x->x_filename=(char*)getbytes(sizeof(char)*(len+strlen( s->s_name)+2)))) { pd_error(x, "out of memory"); freadln_close(x); return; } strcpy(x->x_filename,filenamebuf); strcpy(x->x_filename+len,"/"); strcpy(x->x_filename+len+1,filenamebufptr); if (!(x->x_file=z_fopen(x->x_filename, "r"))) { pd_error(x, "freadln: failed to fopen %s",x->x_filename); return; } if (!(x->x_textbuf = (char *) getbytes (MIN_FREADLN_LENGTH * sizeof( char)))) { pd_error(x, "out of memory!"); freadln_close(x); return; } x->x_textbuf_length=MIN_FREADLN_LENGTH; } static int enlarge_cstr_if_required(const char **c_str, int *len, const int desired_min_length) { if ((!(*c_str))||*len==0) { *c_str = (char*) calloc (1,sizeof(char)); return 1; } if (len[0]x_readybang_outlet); } static void freadln_readline (t_freadln *x) { int min_length=(x->x_textbuf_length < 1)?1:x->x_textbuf_length; int linebreak_pos=0; int items_read; t_binbuf *bbuf; t_atom *abuf; int abuf_length; int rewind_after; if (!x->x_file) { pd_error(x, "no file opened for reading"); freadln_done(x); return; } do { if (linebreak_pos==-1) { min_length<<=1; fseek(x->x_file,-(long)(x->x_textbuf_length),SEEK_CUR); } if (!enlarge_cstr_if_required((const char**) &x->x_textbuf, &x->x_textbuf_length, min_length)) { pd_error(x, "out of memory"); x->x_textbuf_length=0; freadln_close(x); freadln_done(x); return; } if (!(items_read=fread(x->x_textbuf,sizeof(char),x->x_textbuf_length, x->x_file))) { freadln_close(x); freadln_done(x); return; } x->x_textbuf[x->x_textbuf_length-1]=0; } while (((linebreak_pos=cstr_char_pos(x->x_textbuf, x->linebreak_chr[0]))==-1) && !(items_read < x->x_textbuf_length)); if (linebreak_pos-1 < items_read - strlen(x->linebreak_chr)) { rewind_after=items_read-linebreak_pos; fseek(x->x_file,-(long)(rewind_after),SEEK_CUR); } if (linebreak_pos==-1) { linebreak_pos=items_read; } x->x_textbuf[linebreak_pos-1]='\0'; if (!(bbuf=binbuf_new())) { pd_error(x, "out of memory"); freadln_close(x); freadln_done(x); return; } binbuf_text(bbuf, x->x_textbuf, linebreak_pos-1); abuf = binbuf_getvec(bbuf); abuf_length = binbuf_getnatom(bbuf); if (abuf_length>0) { if (abuf->a_type==A_SYMBOL) { outlet_anything(x->x_message_outlet, atom_getsymbol(abuf), abuf_length-1, abuf+1); } else { outlet_list(x->x_message_outlet, gensym("list"), abuf_length, abuf); } } else { outlet_list(x->x_message_outlet, atom_getsymbol(abuf), 0, abuf); } /* NOTE: the following line might be a problem in recursions * and could be performed before to outlet_* as well, * but(!) atom buffer abuf must be copied if doing so. */ binbuf_free(bbuf); } static void freadln_free (t_freadln *x) { freadln_close(x); outlet_free (x->x_message_outlet); outlet_free (x->x_readybang_outlet); } static void *freadln_new(void) { t_freadln *x = (t_freadln *)pd_new(freadln_class); x->x_message_outlet = outlet_new(&x->x_ob, gensym("list")); x->x_readybang_outlet = outlet_new(&x->x_ob, gensym("bang")); x->x_filename=0; x->x_file=0; x->x_textbuf=0; x->x_canvas = canvas_getcurrent(); return (void *)x; } void freadln_setup(void) { freadln_class = class_new(gensym("freadln"), (t_newmethod)freadln_new, (t_method) freadln_free, sizeof(t_freadln), 0, 0); class_addmethod(freadln_class, (t_method)freadln_open, gensym("open"), A_SYMBOL, A_DEFSYM, 0); class_addmethod(freadln_class, (t_method)freadln_close, gensym("close"), A_NULL, 0); class_addbang(freadln_class, (t_method)freadln_readline); zexy_register("freadln"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/fwriteln.c000066400000000000000000000164741265051730400235140ustar00rootroot00000000000000/* * fwriteln: writes messages continuously into a file * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * (c) 2007 Franz Zotter * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #ifdef __WIN32__ # define snprintf _snprintf #endif #include #include #include /* fwriteln: writes messages continuously into a file that * doesn't necessarily need to fit into the RAM of your system * * Franz Zotter zotter@iem.at, 2007 * Institute of Electronic Music and Acoustics * * parts of this externals were copied from Iohannes zmoelnig's * iemmatrix */ static t_class *fwriteln_class; typedef struct fwriteln { t_object x_ob; FILE *x_file; char *x_filename; char *x_textbuf; char linebreak_chr[3]; char format_string_afloats[10]; } t_fwriteln; static void fwriteln_close (t_fwriteln *x) { if(x->x_file) { z_fclose(x->x_file); } x->x_file=0; if(x->x_filename) { free(x->x_filename); } x->x_filename=0; if(x->x_textbuf) { freebytes(x->x_textbuf, MAXPDSTRING + 1); } x->x_textbuf=0; } static void string_copy(const char* const from, char** to) { if ((*to = malloc(strlen(from) + 1))) { strcpy(*to, from); } } static void fwriteln_open (t_fwriteln *x, t_symbol *s, t_symbol*type) { char* filename; string_copy(s->s_name, &filename); sys_bashfilename (filename, filename); fwriteln_close (x); /* if(0==type || type!=gensym("cr")) { pd_error(x, "unknown type '%s'", (type)?type->s_name:""); return; }*/ if (type==gensym("cr")) { strcpy(x->linebreak_chr,"\n"); } else { strcpy(x->linebreak_chr,";\n"); } if (!(x->x_file=z_fopen(filename, "w"))) { pd_error(x, "failed to open %128s",filename); free(filename); return; } string_copy(filename, &x->x_filename); free(filename); x->x_textbuf = (char *) getbytes (MAXPDSTRING + 1); } static void fwriteln_write (t_fwriteln *x, t_symbol *s, int argc, t_atom *argv) { int length=0; char *text=x->x_textbuf; if (x->x_file) { if ((s!=gensym("list"))||(argv->a_type==A_SYMBOL)) { snprintf(text,MAXPDSTRING,"%s ", s->s_name); text[MAXPDSTRING-1]=0; length=strlen(text); if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) { pd_error(x, "failed to write %128s",x->x_filename); freebytes (text, MAXPDSTRING * sizeof(char)); fwriteln_close(x); return; } } while (argc--) { switch (argv->a_type) { case A_FLOAT: snprintf(text,MAXPDSTRING,x->format_string_afloats, atom_getfloat(argv)); text[MAXPDSTRING-1]=0; length=strlen(text); if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) { pd_error(x, "failed to write %128s",x->x_filename); freebytes (text, MAXPDSTRING * sizeof(char)); fwriteln_close(x); return; } break; case A_SYMBOL: snprintf(text,MAXPDSTRING,"%s ", atom_getsymbol(argv)->s_name); text[MAXPDSTRING-1]=0; length=strlen(text); if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) { pd_error(x, "failed to write %128s",x->x_filename); freebytes (text, MAXPDSTRING * sizeof(char)); fwriteln_close(x); return; } break; case A_COMMA: snprintf(text,MAXPDSTRING,", "); length=strlen(text); if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) { pd_error(x, "failed to write %128s",x->x_filename); freebytes (text, MAXPDSTRING * sizeof(char)); fwriteln_close(x); return; } break; case A_SEMI: snprintf(text,MAXPDSTRING,"; "); length=strlen(text); if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) { pd_error(x, "failed to write %128s",x->x_filename); freebytes (text, MAXPDSTRING * sizeof(char)); fwriteln_close(x); return; } break; default: break; } argv++; } snprintf(text,MAXPDSTRING,"%s", x->linebreak_chr); length=strlen(text); if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) { pd_error(x, "failed to write %128s",x->x_filename); freebytes (text, MAXPDSTRING * sizeof(char)); fwriteln_close(x); return; } } else { pd_error(x, "no file opened for writing"); } } static void fwriteln_free (t_fwriteln *x) { fwriteln_close(x); } static void *fwriteln_new(t_symbol *s, int argc, t_atom *argv) { int k; int width; int precision; char float_format[3]="g "; char width_str[3]=""; char precision_str[4]=""; char prefix[3]="%"; t_fwriteln *x = (t_fwriteln *)pd_new(fwriteln_class); x->x_filename=0; x->x_file=0; x->x_textbuf=0; for (k=0; k=argc)||(argv[k+1].a_type!=A_FLOAT)) { post("fwriteln: no value given for precision!"); } else { precision=atom_getint(&argv[++k]); precision=(precision<0)?0:precision; precision=(precision>30)?30:precision; snprintf(precision_str,4,".%d",precision); } } else if (atom_getsymbol(&argv[k])==gensym("w")) { if ((k+1>=argc)||(argv[k+1].a_type!=A_FLOAT)) { post("fwriteln: no value given for width!"); } else { width=atom_getint(&argv[++k]); width=(width<1)?1:width; width=(width>40)?40:width; snprintf(width_str,3,"%d",width); } } else if (atom_getsymbol(&argv[k])==gensym("g")) { float_format[0]='g'; } else if (atom_getsymbol(&argv[k])==gensym("f")) { float_format[0]='f'; } else if (atom_getsymbol(&argv[k])==gensym("e")) { float_format[0]='e'; } else if (atom_getsymbol(&argv[k])==gensym("-")) { strcpy(prefix,"%-"); } else if (atom_getsymbol(&argv[k])==gensym("+")) { strcpy(prefix,"%+"); } } x->format_string_afloats[0]='\0'; strncat(x->format_string_afloats,prefix,2); strncat(x->format_string_afloats,width_str,2); strncat(x->format_string_afloats,precision_str,3); strncat(x->format_string_afloats,float_format,2); return (void *)x; } void fwriteln_setup(void) { fwriteln_class = class_new(gensym("fwriteln"), (t_newmethod)fwriteln_new, (t_method) fwriteln_free, sizeof(t_fwriteln), CLASS_DEFAULT, A_GIMME, 0); class_addmethod(fwriteln_class, (t_method)fwriteln_open, gensym("open"), A_SYMBOL, A_DEFSYM, 0); class_addmethod(fwriteln_class, (t_method)fwriteln_close, gensym("close"), A_NULL, 0); class_addanything(fwriteln_class, (t_method)fwriteln_write); zexy_register("fwriteln"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/glue.c000066400000000000000000000064501265051730400226070ustar00rootroot00000000000000/* * glue: glue two lists together (use [list append] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include static t_class *glue_class; typedef struct _zglue { 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* UNUSED(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* UNUSED(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* UNUSED(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_help(t_glue*x) { post("\n"HEARTSYMBOL " glue\t\t:: glue together 2 lists (like [list append])"); } 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_addmethod (glue_class, (t_method)glue_help, gensym("help"), 0); zexy_register("glue"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/index.c000066400000000000000000000267471265051730400227750ustar00rootroot00000000000000/* * index: associative dictionary * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* (c) 2005:forum::für::umläute:2000 "index" simulates an associative index :: that is : convert a symbol to an index CAVEATS: starts to count at "1" TODO: use "symbol" instead of "char*" : FIXED TODO: "dump" the contents (so we can share between [index]es, ...) FIXED TODO: "compact": move all entries to the beginning of the array FIXED TODO: "sort" FIXED TODO: "add" at a specific position (like "add 10 hallo" of "add hallo 10") (??) FIXED TODO: "delete" from a specific position (like "delete 4" deletes the 4th element) FIXED TODO: get the number of stored entries ("bang") FIXED TODO: resize the array if it gets to small */ #include "zexy.h" #include /* ----------------------- index --------------------- */ static t_class *index_class; typedef struct _index { t_object x_obj; int entries, maxentries; int auto_mode; /* 1--add if key doesn't already exist; 0--do not add; */ int auto_resize; /* 1--resize the array if we are running out of slots; 0--don't */ t_symbol **names; } t_index; /************************************ * index_helpers */ /* find the last non-NULL entry in the array * * LATER: shouldn't this return "-1" on failure ? */ static int find_last(t_symbol **names, int maxentries) { /* returns the index of the last entry (0..(maxentries-1)) */ while (maxentries--) if (names[maxentries]) { return maxentries; } return 0; } /* search the array for "key" * if it is not there, return "-1" */ static int find_item(const t_symbol *key, t_symbol **names, int maxentries) { /* returns index (0..[maxentries-1?]) on success; -1 if the item could not be found */ int i=-1; int max = find_last(names, maxentries); while (++i<=max) if (names[i] && key==names[i]) { return i; } return -1; } /* find the first NULL entry in the array * return "-1" if none can be found */ static int find_free(t_symbol **names, int maxentries) { int i=0; while (inames, x->maxentries)+1) ) { outlet_float(x->x_obj.ob_outlet, (t_float)element); } else if (x->auto_mode) { /* not yet stored: add automatically */ index_add(x, s, 0); } else { outlet_float(x->x_obj.ob_outlet, 0.f); /* not yet stored but do not add */ } } /* output the entry at a given index */ static void index_float(t_index *x, t_float findex) { int iindex = (int)findex; if ((iindex > 0) && (iindex <= x->maxentries) && (x->names[iindex-1])) { /* TB: output symbol to outlet */ outlet_symbol (x->x_obj.ob_outlet,x->names[iindex-1]); } } /* add a symbol to the map (if possible) */ static void index_add(t_index *x, t_symbol *s, t_float f) { int newentry=(int)f; if (! (find_item(s, x->names, x->maxentries)+1) ) { if (x->auto_resize && (x->entries==x->maxentries || newentry>=x->maxentries)) { /* do some resizing */ int maxentries=(newentry>x->maxentries)?newentry:(x->maxentries*2); int i; t_symbol**buf=(t_symbol **)getbytes(sizeof(t_symbol *) * maxentries); if(buf!=0) { memcpy(buf, x->names, sizeof(t_symbol *) * x->maxentries); for(i=x->maxentries; inames, sizeof(t_symbol *) * x->maxentries); x->names=buf; x->maxentries=maxentries; } } if ( x->entries < x->maxentries ) { if(newentry>0) { newentry--; if(x->names[newentry]) { /* it is already taken! */ z_verbose(1, "index :: couldn't add element '%s' at position %d (already taken)", s->s_name, newentry+1); outlet_float(x->x_obj.ob_outlet, -1.f); return; } } else { newentry=find_free(x->names, x->maxentries); } if (newentry + 1) { x->entries++; x->names[newentry]=s; outlet_float(x->x_obj.ob_outlet, (t_float)newentry+1); return; } else { error("index :: couldn't find any place for new entry"); } } else { error("index :: max number of elements (%d) reached !", x->maxentries); } } else { z_verbose(1, "index :: element '%s' already exists", s->s_name); } /* couldn't add the symbol to our index table */ outlet_float(x->x_obj.ob_outlet, -1.f); } /* delete a symbol from the map (if it is in there) */ static void index_delete(t_index *x, t_symbol* UNUSED(s), int argc, t_atom*argv) { int idx=-1; if(argc!=1) { error("index :: delete what ?"); return; } else { if(argv->a_type==A_FLOAT) { idx=atom_getint(argv)-1; } else if (argv->a_type==A_SYMBOL) { idx=find_item(atom_getsymbol(argv),x->names, x->maxentries); } else { error("index :: delete what ?"); return; } } if ( idx >= 0 && idx < x->maxentries) { x->names[idx]=0; x->entries--; outlet_float(x->x_obj.ob_outlet, 0.0); } else { z_verbose(1, "index :: couldn't find element"); outlet_float(x->x_obj.ob_outlet, -1.0); } } /* delete all symbols from the map */ static void index_reset(t_index *x) { int i=x->maxentries; while (i--) if (x->names[i]) { x->names[i]=0; } x->entries=0; outlet_float(x->x_obj.ob_outlet, 0.f); } /* output the number of entries stored in the array */ static void index_bang(t_index *x) { outlet_float(x->x_obj.ob_outlet, (t_float)x->entries); } /* dump each entry in the format: "list " */ static void index_dump(t_index *x) { t_atom ap[2]; int i=0; for(i=0; imaxentries; i++) { if(x->names[i]) { SETSYMBOL(ap, x->names[i]); SETFLOAT(ap+1, i+1); outlet_list(x->x_obj.ob_outlet, 0, 2, ap); } } } /* compact all entries, removing all holes in the map */ static void index_compact(t_index *x) { int i,j; for(i=0; ientries; i++) { if(!x->names[i]) { for(j=i+1; jmaxentries; j++) { if(x->names[j]) { x->names[i]=x->names[j]; x->names[j]=0; break; } } } } } /* sort the map alphabetically */ static void index_sort(t_index *x) { int entries=x->entries; int step=entries; int loops=1, n; t_symbol**buf=x->names; index_compact( x); /* couldn't we do it more "in-place", e.g. don't touch empty slots ? */ while(step>1) { int i = loops; step+=step%2; step>>=1; loops+=2; while(i--) { /* there might be some optimization in here */ for (n=0; n<(x->entries-step); n++) { int comp=strcmp(buf[n]->s_name,buf[n+step]->s_name); if (comp>0) { /* compare STRINGS not SYMBOLS */ t_symbol*s_tmp = buf[n]; buf[n] = buf[n+step]; buf[n+step] = s_tmp; } } } } } /* turn on/off auto-adding of elements that are not yet in the map */ static void index_auto(t_index *x, t_float automod) { x->auto_mode = !(!automod); } /* turn on/off auto-resizing of the map if it gets to small */ static void index_resize(t_index *x, t_float automod) { x->auto_resize = !(!automod); } static void *index_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_index *x = (t_index *)pd_new(index_class); t_symbol** buf; int maxentries = 0, automod=0; if (argc--) { maxentries = (int)atom_getfloat(argv++); if (argc) { automod = (int)atom_getfloat(argv++); } } if (maxentries<1) { maxentries=128; } buf = (t_symbol **)getbytes(sizeof(t_symbol *) * maxentries); x->entries = 0; x->maxentries = maxentries; x->names = buf; x->auto_mode = !(!automod); x->auto_resize = 1; while (maxentries--) { buf[maxentries]=0; } outlet_new(&x->x_obj, gensym("float")); return (x); } static void index_free(t_index *x) { freebytes(x->names, sizeof(t_symbol *) * x->maxentries); } static void index_helper(t_index *x) { endpost(); post(""HEARTSYMBOL " index :: index symbols to indices"); post(" : look up the in the index and return it's index"); post(" : look up the element at index in the index"); post("'add ' : add a new symbol to the index-map"); post("'add ' : add a new symbol at the index "); post("'delete ' : delete a symbol from the index-map"); post("'delete ' : delete the entry at index from the index-map"); post("'reset' : delete the whole index-map"); post("'bang' : return the number of entries in the index-map"); post("'dump' : dump each entry in the format \"list \""); post("'compact' : remove holes in the index-map"); endpost(); post("'sort' : alphabetically sort the entries"); post("'auto <1/0> : if auto is 1 and a yet unknown symbol is looked up it is\n\t\t\t automatically added to the index-map"); post("'resize <1/0> : if resize is 1 (default), the index-map is resized\n\t\t\t automatically if needed"); post("'help' : view this"); post("outlet : : index of the "); post(" : entry at "); endpost(); post("creation:\"index [ []]\": creates a sized index"); } void index_setup(void) { index_class = class_new(gensym("index"), (t_newmethod)index_new, (t_method)index_free, sizeof(t_index), 0, A_GIMME, 0); class_addsymbol(index_class, index_symbol); class_addmethod(index_class, (t_method)index_reset, gensym("reset"), 0); class_addmethod(index_class, (t_method)index_delete, gensym("delete"), A_GIMME, 0); /* class_addmethod(index_class, (t_method)index_add, gensym("add"), A_SYMBOL, 0); */ class_addmethod(index_class, (t_method)index_add, gensym("add"), A_SYMBOL, A_DEFFLOAT, 0); class_addmethod(index_class, (t_method)index_auto, gensym("auto"), A_FLOAT, 0); class_addmethod(index_class, (t_method)index_resize, gensym("resize"), A_FLOAT, 0); class_addfloat(index_class, (t_method)index_float); class_addbang(index_class, (t_method)index_bang); class_addmethod(index_class, (t_method)index_sort, gensym("sort"), 0); class_addmethod(index_class, (t_method)index_compact, gensym("compact"), 0); class_addmethod(index_class, (t_method)index_dump, gensym("dump"), 0); class_addmethod(index_class, (t_method)index_helper, gensym("help"), 0); zexy_register("index"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/length.c000066400000000000000000000032771265051730400231400ustar00rootroot00000000000000/* * length :: get the length of a list (use [list length] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *length_class; typedef struct _length { t_object x_obj; } t_length; static void length_list(t_length *x, t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) { outlet_float(x->x_obj.ob_outlet, (t_float)argc); } static void length_any(t_length *x, t_symbol* UNUSED(s), int argc, t_atom* UNUSED(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); zexy_register("length"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/lifop.c000066400000000000000000000161771265051730400227730ustar00rootroot00000000000000/* * lifop: a LIFO (last-in first-out) with priorities * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include /* ------------------------- lifop ------------------------------- */ /* * a LIFO (last-in first-out) with priorities * * an incoming list is added to a lifo (based on its priority) * "bang" outputs the last element of the non-empty lifo with the highest priority * * high priority means low numeric value */ static t_class *lifop_class; typedef struct _lifop_list { int argc; t_atom *argv; struct _lifop_list *next; } t_lifop_list; typedef struct _lifop_prioritylist { t_float priority; t_lifop_list *lifo_start; struct _lifop_prioritylist *next; } t_lifop_prioritylist; typedef struct _lifop { t_object x_obj; t_lifop_prioritylist *lifo_list; unsigned long counter; t_float priority; /* current priority */ t_outlet *x_out, *x_infout; } t_lifop; static t_lifop_prioritylist*lifop_genprioritylist(t_lifop*x, t_float priority) { t_lifop_prioritylist*result=0, *dummy=0; if(x->lifo_list!=0) { /* * do we already have this priority ? * if so, just return a pointer to that lifo * else set the dummy-pointer to the lifo BEFORE the new one */ dummy=x->lifo_list; while(dummy!=0) { t_float prio=dummy->priority; if(prio==priority) { return dummy; } if(prio>priority) { break; } result=dummy; dummy=dummy->next; } dummy=result; } /* create a new priority list */ result = (t_lifop_prioritylist*)getbytes(sizeof( t_lifop_prioritylist)); result->priority=priority; result->lifo_start=0; /* insert it into the list of priority lists */ if(dummy==0) { /* insert at the beginning */ result->next=x->lifo_list; x->lifo_list=result; } else { /* post insert into the list of LIFOs */ result->next=dummy->next; dummy->next =result; } /* return the result */ return result; } static int add2lifo(t_lifop_prioritylist*lifoprio, int argc, t_atom *argv) { t_lifop_list*entry=0; if(lifoprio==0) { error("plifo: no lifos available"); return -1; } /* create an entry for the lifo */ if(!(entry = (t_lifop_list*)getbytes(sizeof(t_lifop_list)))) { error("plifo: couldn't add entry to end of lifo"); return -1; } if(!(entry->argv=(t_atom*)getbytes(argc*sizeof(t_atom)))) { error("plifo: couldn't add list to lifo!"); return -1; } memcpy(entry->argv, argv, argc*sizeof(t_atom)); entry->argc=argc; entry->next=0; entry->next=lifoprio->lifo_start; lifoprio->lifo_start=entry; return 0; } static t_lifop_prioritylist*getLifo(t_lifop_prioritylist*plifo) { if(plifo==0) { return 0; } /* get the highest non-empty lifo */ while(plifo->lifo_start==0 && plifo->next!=0) { plifo=plifo->next; } return plifo; } static void lifop_list(t_lifop *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { t_lifop_prioritylist*plifo=0; if(!(plifo=lifop_genprioritylist(x, x->priority))) { error("[lifop]: couldn't get priority lifo"); return; } if(!add2lifo(plifo, argc, argv)) { x->counter++; } } static void lifop_bang(t_lifop *x) { t_lifop_prioritylist*plifo=0; t_lifop_list*lifo=0; t_atom*argv=0; int argc=0; if(!(plifo=getLifo(x->lifo_list))) { outlet_bang(x->x_infout); return; } if(!(lifo=plifo->lifo_start)) { outlet_bang(x->x_infout); return; } x->counter--; plifo->lifo_start=lifo->next; /* get the list from the entry */ argc=lifo->argc; argv=lifo->argv; lifo->argc=0; lifo->argv=0; lifo->next=0; /* destroy the lifo-entry (important for recursion! */ freebytes(lifo, sizeof(t_lifop_list)); /* output the list */ outlet_list(x->x_out, gensym("list"), argc, argv); /* free the list */ freebytes(argv, argc*sizeof(t_atom)); } static void lifop_query(t_lifop*x) { z_verbose(1, "%d elements in lifo", (int)x->counter); outlet_float(x->x_infout, (t_float)x->counter); } static void lifop_clear(t_lifop *x) { t_lifop_prioritylist *lifo_list=x->lifo_list; while(lifo_list) { t_lifop_prioritylist *lifo_list2=lifo_list; t_lifop_list*lifo=lifo_list2->lifo_start; lifo_list=lifo_list->next; while(lifo) { t_lifop_list*lifo2=lifo; lifo=lifo->next; if(lifo2->argv) { freebytes(lifo2->argv, lifo2->argc*sizeof(t_atom)); } lifo2->argv=0; lifo2->argc=0; lifo2->next=0; freebytes(lifo2, sizeof(t_lifop_list)); } lifo_list2->priority =0; lifo_list2->lifo_start=0; lifo_list2->next =0; freebytes(lifo_list2, sizeof( t_lifop_prioritylist)); } x->lifo_list=0; x->counter=0; } /* this is NOT re-entrant! */ static void lifop_dump(t_lifop*x) { t_lifop_prioritylist*plifo=getLifo(x->lifo_list); if(!plifo||!plifo->lifo_start) { outlet_bang(x->x_infout); return; } while(plifo) { t_lifop_list*lifo=plifo->lifo_start; while(lifo) { t_atom*argv=lifo->argv; int argc=lifo->argc; /* output the list */ outlet_list(x->x_out, gensym("list"), argc, argv); lifo=lifo->next; } plifo=plifo->next; } } static void lifop_free(t_lifop *x) { lifop_clear(x); outlet_free(x->x_out); outlet_free(x->x_infout); } static void *lifop_new(void) { t_lifop *x = (t_lifop *)pd_new(lifop_class); floatinlet_new(&x->x_obj, &x->priority); x->x_out=outlet_new(&x->x_obj, gensym("list")); x->x_infout=outlet_new(&x->x_obj, gensym("float")); x->lifo_list = 0; x->priority=0; x->counter=0; return (x); } static void lifop_help(t_lifop*x) { post("\n"HEARTSYMBOL " lifop\t\t:: a Last-In-First-Out queue with priorities"); } void lifop_setup(void) { lifop_class = class_new(gensym("lifop"), (t_newmethod)lifop_new, (t_method)lifop_free, sizeof(t_lifop), 0, A_NULL); class_addbang (lifop_class, lifop_bang); class_addlist (lifop_class, lifop_list); class_addmethod (lifop_class, (t_method)lifop_clear, gensym("clear"), A_NULL); class_addmethod (lifop_class, (t_method)lifop_dump, gensym("dump"), A_NULL); class_addmethod (lifop_class, (t_method)lifop_query, gensym("info"), A_NULL); class_addmethod (lifop_class, (t_method)lifop_help, gensym("help"), A_NULL); zexy_register("lifop"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/limiter~.c000066400000000000000000000503361265051730400235200ustar00rootroot00000000000000/* * limiter~: limit/compress signals * * (c) 1999-2011 IOhannes m zmölnig, forum::fÃŒr::umlÀute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* --------------------------------- limiter/compressor --------------------------------- for details on how it works watch out for "http://iem.kug.ac.at/~zmoelnig/pd" ...and search for "limiter" mail2me4more!n4m8ion : zmoelnig@iem.kug.ac.at */ /* this is a limiter/compressor-object the limiter is based on Falkner's thesis "Entwicklung eines digitalen Stereo-limiters mit Hilfe des Signalprozessors DSP56001" pp.14 2108:forum::fÃŒr::umlÀute:1999 all rights reserved and no warranties... see GNU-license for details */ #define LIMIT0 0 #define LIMIT1 1 #define COMPRESS 2 #include "zexy.h" /* log2 */ #define LN2 .69314718056 /* hmm, where do these values come from exactly? we are doing a 3* oversampling, so we need to calculate the samples that are +-1/3 off the current sample sinc([13 10 7 4 1 -2 -5 -8 -11]/3) * window window=cosine window */ /* #define SINC[4] .822462987 #define SINC[3] .404460777 #define SINC[5] -.188874003 #define SINC[2] -.143239449 #define SINC[6] .087796546 #define SINC[1] .06917082 #define SINC[7] -.041349667 #define SINC[0] -.030578954 #define SINC[8] .013226276 */ #define BUFSIZE 128 #define XTRASAMPS 9 #define TABLESIZE 512 /* compressor table */ static t_sample SINC[9]; #define PI 3.1415926535897932384626433832795029L /* pi */ static void init_sinc(void) { /* calculate the sinc (windowed with a cosine) */ int i=0; for(i=0; i<9; i++) { long double t=(3.*i - 11.)/3.; long double v=cos(t*PI/10.)*sin(PI*t)/(PI*t); SINC[i]=v; } } /* ------------------------------------------------------------------------------------ */ /* first define the structs... */ static t_class *limiter_class; typedef struct _limctl { /* variables changed by user */ t_float limit; t_float hold_samples; t_float change_of_amplification; } t_limctl; typedef struct _cmpctl { t_float treshold, ratio; /* uclimit is the very same is the limiter1-limit (decalculated relative to our treshold) */ t_float uclimit, climit_inverse; /* climit == compressed limit (uclimit == uncompressed limit) */ t_float limiter_limit; /* start limiting (stop compressing); == tresh/limit; */ t_float treshdB, oneminusratio; } t_cmpctl; typedef struct _inbuf { t_sample* ringbuf; int buf_position; } t_inbuf; typedef struct _limiter { t_object x_obj; int number_of_inlets, s_n; /* variables changed by process */ t_sample amplification; t_float samples_left, still_left; int mode; t_limctl *val1, *val2; t_cmpctl *cmp; /* note : limit is not the same for val1 & val2 : * at val1 it is the limit of the INPUT_VALUE * at val2 it is the limit for the AMPLIFICATION (in fact it is abs_limit1/abs_limit2) */ t_inbuf* in; int buf_size; } t_limiter; /* ------------------------------------------------------------------------------------ */ /* then do the message - thing */ /* do the user settings */ /* calcs */ static t_float calc_holdsamples(t_float htime, int buf) { /* hold_time must be greater than buffer_time to make sure that any peak_sample is amplified with its own factor */ t_float min_hold = buf / sys_getsr(); return (0.001 * sys_getsr() * ((htime > min_hold)?htime:(( min_hold > 50)?min_hold:50))); } static t_float calc_coa(t_float hlife) { return (exp(LN2 * 1000 / (((hlife > 0)?hlife:15) * sys_getsr()))); } static void set_uclimit(t_limiter *x) { t_cmpctl *c = x->cmp; t_float limit = x->val1->limit, limitdB = rmstodb(limit), ratio = c->ratio, tresh = c->treshold, treshdB = rmstodb(tresh); c->climit_inverse = limit / tresh; c->uclimit = tresh / dbtorms(treshdB+(limitdB - treshdB)/ratio); c->treshdB = treshdB; c->oneminusratio = 1. - ratio; } /* settings */ static void set_treshold(t_limiter *x, t_float treshold) { t_cmpctl *c = x->cmp; t_float tresh = dbtorms (treshold); if (tresh > x->val1->limit) { tresh = x->val1->limit; } c->treshold = tresh; set_uclimit(x); } static void set_ratio(t_limiter *x, t_float ratio) { if (ratio < 0) { ratio = 1; } x->cmp->ratio = ratio; set_uclimit(x); } static void set_mode(t_limiter *x, t_float mode) { int modus = mode; switch (modus) { case LIMIT0: x->mode = LIMIT0; break; case LIMIT1: x->mode = LIMIT1; break; case COMPRESS: x->mode = COMPRESS; break; default: x->mode = LIMIT0; break; } } static void set_LIMIT(t_limiter *x) { set_mode(x, LIMIT0); } static void set_CRACK(t_limiter *x) { set_mode(x, LIMIT1); } static void set_COMPRESS(t_limiter *x) { set_mode(x, COMPRESS); } static void set_bufsize(t_limiter *x, int size) { /* this is really unneeded...and for historical reasons only */ if (size < BUFSIZE) { size = BUFSIZE; } x->buf_size = size + XTRASAMPS; } static void set_limit(t_limiter *x, t_floatarg limit) { if (limit < 0.00001) { limit = 100; } x->val1->limit = dbtorms(limit); if (x->val1->limit < x->cmp->treshold) { x->cmp->treshold = x->val1->limit; } set_uclimit(x); } static void set_limits(t_limiter *x, t_floatarg limit1, t_floatarg limit2) { t_float lim1, lim2; if (limit1 < 0.00001) { limit1 = 100; } lim1 = dbtorms(limit1); lim2 = dbtorms(limit2); if (lim2 < lim1) { lim2 = 2*lim1; /* this is to prevent lim2 (which should trigger the FAST regulation) */ x->mode = 0; /* to underrun the SLOW regulation; this would cause distortion */ } x->val1->limit = lim1; x->val2->limit = lim1/lim2; if (lim1 < x->cmp->treshold) { x->cmp->treshold = lim1; } set_uclimit(x); } static void set1(t_limiter *x, t_floatarg limit, t_floatarg hold, t_floatarg release) { t_float lim = dbtorms(limit); x->val1->limit = (lim > 0)?lim:1; x->val1->hold_samples = calc_holdsamples(hold, x->buf_size); x->val1->change_of_amplification = calc_coa(release); if (lim < x->cmp->treshold) { x->cmp->treshold = lim; } set_uclimit(x); } static void set2(t_limiter *x, t_floatarg limit, t_floatarg hold, t_floatarg release) { t_float lim = dbtorms(limit); x->val2->limit = (lim > x->val1->limit)?(x->val1->limit/lim):.5; x->val2->hold_samples = calc_holdsamples(hold, x->buf_size); x->val2->change_of_amplification = calc_coa(release); } static void set_compressor(t_limiter *x, t_floatarg limit, t_floatarg treshold, t_floatarg ratio) { t_cmpctl *c = x->cmp; t_float lim = dbtorms(limit); t_float tresh = dbtorms(treshold); if ((limit == 0) && (treshold == 0) && (ratio == 0)) { set_mode(x, COMPRESS); return; } if (tresh > lim) { tresh = lim; } if (ratio < 0.) { ratio = 1.; } c->ratio = ratio; x->val1->limit = lim; c->treshold = tresh; set_uclimit(x); set_mode(x, COMPRESS); } static void reset(t_limiter *x) { x->amplification = 1.; } /* verbose */ static void status(t_limiter *x) { t_limctl *v1 = x->val1; t_limctl *v2 = x->val2; t_cmpctl *c = x->cmp; t_float sr = sys_getsr() / 1000.; switch (x->mode) { case LIMIT1: post("%d-channel crack-limiter @ %fkHz\n" "\noutput-limit\t= %fdB\nhold1\t\t= %fms\nrelease1\t= %fms\ncrack-limit\t= %fdB\nhold2\t\t= %fms\nrelease2\t= %fms\n" "\namplify\t\t= %fdB\n", x->number_of_inlets, sr, rmstodb(v1->limit), (v1->hold_samples) / sr, LN2 / (log(v1->change_of_amplification) * sr), rmstodb(v1->limit / v2->limit), (v2->hold_samples) / sr, LN2 / (log(v2->change_of_amplification) * sr), x->amplification); break; case LIMIT0: post("%d-channel limiter @ %fkHz\n" "\noutput-limit\t= %fdB\nhold\t\t= %fms\nrelease\t\t= %fms\n" "\namplify\t\t= %fdB\n", x->number_of_inlets, sr, rmstodb(v1->limit), (v1->hold_samples) / sr, LN2 / (log(v1->change_of_amplification) * sr), rmstodb(x->amplification)); break; case COMPRESS: post("%d-channel compressor @ %fkHz\n" "\noutput-limit\t= %fdB\ntreshold\t= %fdB\ninput-limit\t= %f\nratio\t\t= 1:%f\n" "\nhold\t\t= %fms\nrelease\t\t= %fms\n" "\namplify\t\t= %fdB\n", x->number_of_inlets, sr, rmstodb(c->treshold * c->climit_inverse), rmstodb(c->treshold), rmstodb(c->treshold / c->uclimit), 1./c->ratio, (v1->hold_samples) / sr, LN2 / (log(v1->change_of_amplification) * sr), rmstodb(x->amplification)); } } static void limiter_tilde_helper(t_limiter *x) { post("\n\n"HEARTSYMBOL " %d-channel limiter-object: mode %d", x->number_of_inlets, x->mode); poststring("\n'mode '\t\t\t: (0_limiter, 1_crack-limiter, 2_compressor)"); poststring("\n'LIMIT'\t\t\t\t: set to LIMITer"); poststring("\n'CRACK'\t\t\t\t: set to CRACK-limiter"); poststring("\n'COMPRESS'\t\t\t\t: set to COMPRESSor"); switch (x->mode) { case LIMIT0: poststring("\n'limit '\t\t\t: set limit (in dB)" "\n'set '\t: set limiter"); break; case LIMIT1: poststring("\n'limits '\t: set limits (in dB)" "\n'set '\t: set limiter 1" "\n'set2 '\t: set crack-limiter"); break; case COMPRESS: poststring("\n'ratio '\t\t: set compressratio (Ã…Å“0.5Ã…Å“ instead of Ã…Å“1:2Ã…Å“)" "\n'treshold '\t\t: set treshold of the compressor" "\n'compress '\t: set compressor" "\n..........note that is the same for COMPRESSOR and LIMITER.........."); break; default: break; } poststring("\n'print'\t\t\t\t: view actual settings" "\n'help'\t\t\t\t: view this\n"); poststring("\ncreating arguments are :\n" "\"limiter~ [ [ [ [...]]]]\": may be anything\n"); endpost(); } /* ------------------------------------------------------------------------------------ */ /* now do the dsp - thing */ /* ------------------------------------------------------------------------------------ */ static t_int *oversampling_maxima(t_int *w) { t_limiter *x = (t_limiter *)w[1]; t_inbuf *buf = (t_inbuf *)w[2]; t_sample *in = (t_sample *)w[3]; t_sample *out = (t_sample *)w[4]; int n = x->s_n; int bufsize = x->buf_size; int i = buf->buf_position; t_sample *vp = buf->ringbuf, *ep = vp + bufsize, *bp = vp + XTRASAMPS + i; i += n; while (n--) { t_sample os1, os2, max; t_sample last4, last3, last2, last1, sinccurrent, current, next1, next2, next3, next4; if (bp == ep) { vp[0] = bp[-9]; vp[1] = bp[-8]; vp[2] = bp[-7]; vp[3] = bp[-6]; vp[4] = bp[-5]; vp[5] = bp[-4]; vp[6] = bp[-3]; vp[7] = bp[-2]; vp[8] = bp[-1]; bp = vp + XTRASAMPS; i -= bufsize - XTRASAMPS; } last4 = bp[-8]; last3 = bp[-7]; last2 = bp[-6]; last1 = bp[-5]; current = bp[-4]; next1 = bp[-3]; next2 = bp[-2]; next3 = bp[-1]; next4 = bp[0]; sinccurrent = SINC[4] * current; os1= fabsf(SINC[0] * last4 + SINC[1] * last3 + SINC[2] * last2 + SINC[3] * last1 + sinccurrent + SINC[5] * next1 + SINC[6] * next2 + SINC[7] * next3 + SINC[8] * next4); os2= fabsf(SINC[0] * next4 + SINC[1] * next3 + SINC[2] * next2 + SINC[3] * next1 + sinccurrent + SINC[5] * last1 + SINC[6] * last2 + SINC[7] * last3 + SINC[8] * last4); max = fabsf(current); #if 0 if(max>1. || os1>1. || os2>1.) post("%f %f %f\t%f %f %f %f %f %f %f %f %f", max, os1, os2, last4, last3, last2, last1, current, next1, next2, next3, next4 ); #endif if (max < os1) { max = os1; } if (max < os2) { max = os2; } *bp++ = *in++; if (*out++ < max) { *(out-1) = max; } } buf->buf_position = i; return (w+5); } static t_int *limiter_perform(t_int *w) { t_limiter *x=(t_limiter *)w[1]; int n = x->s_n; t_sample *in = (t_sample *)w[2]; t_sample *out= (t_sample *)w[3]; t_limctl *v1 = (t_limctl *)(x->val1); t_limctl *v2 = (t_limctl *)(x->val2); t_cmpctl *c = (t_cmpctl *)(x->cmp); /* now let's make things a little bit faster */ /* these MUST NOT be changed by process */ const t_float limit = v1->limit; const t_float holdlong = v1->hold_samples; const t_float coa_long = v1->change_of_amplification; const t_float alimit = v2->limit; const t_float holdshort = v2->hold_samples; const t_float coa_short = v2->change_of_amplification; t_float tresh = c->treshold; t_float uclimit = c->uclimit; t_float climit_inv = c->climit_inverse; t_float oneminusratio = c->oneminusratio; /* these will be changed by process */ t_float amp = x->amplification; t_float samplesleft = x->samples_left; t_float stillleft = x->still_left; /* an intern variable... */ t_float max_val; switch (x->mode) { case LIMIT0: while (n--) { max_val = *in; /* the MAIN routine for the 1-treshold-limiter */ if ((max_val * amp) > limit) { amp = limit / max_val; samplesleft = holdlong; } else { if (samplesleft > 0) { samplesleft--; } else { if ((amp *= coa_long) > 1) { amp = 1; } } } *out++ = amp; *in++ = 0; } break; case LIMIT1: while (n--) { max_val = *in; /* the main routine 2 */ if ((max_val * amp) > limit) { samplesleft = ((amp = (limit / max_val)) < alimit)?holdshort:holdlong; stillleft = holdlong; } else { if (samplesleft > 0) { samplesleft--; stillleft--; } else { if (amp < alimit) { if ((amp *= coa_short) > 1) { amp = 1; } } else { if (stillleft > 0) { samplesleft = stillleft; } else { if ((amp *= coa_long) > 1) { amp = 1; } } } } } *out++ = amp; *in++ = 0; } x->still_left = stillleft; break; case COMPRESS: while (n--) { max_val = *in; /* the MAIN routine for the compressor (very similar to the 1-treshold-limiter) */ if (max_val * amp > tresh) { amp = tresh / max_val; samplesleft = holdlong; } else if (samplesleft > 0) { samplesleft--; } else if ((amp *= coa_long) > 1) { amp = 1; } if (amp < 1.) if (amp > uclimit) { /* amp is still UnCompressed uclimit==limitIN/tresh; */ *out++ = pow(amp, oneminusratio); } else { *out++ = amp * climit_inv; /* amp must fit for limiting : amp(new) = limit/maxval; = amp(old)*limitOUT/tresh; */ } else { *out++ = 1.; } *in++ = 0.; } break; default: while (n--) { *out++ = *in++ = 0.; } break; } /* now return the goodies */ x->amplification = amp; x->samples_left = samplesleft; return (w+4); } static void limiter_dsp(t_limiter *x, t_signal **sp) { int i = 0; t_sample* sig_buf = (t_sample *)getbytes(sizeof(*sig_buf) * sp[0]->s_n); x->s_n = sp[0]->s_n; if (x->amplification == 0) { x->amplification = 0.0000001; } if (x->val2->limit >= 1) { x->mode = 0; } while (i < x->number_of_inlets) { dsp_add(oversampling_maxima, 4, x, &(x->in[i]), sp[i]->s_vec, sig_buf); i++; } dsp_add(limiter_perform, 3, x, sig_buf, sp[i]->s_vec); } /* ------------------------------------------------------------------------------------ */ /* finally do the creation - things */ static void *limiter_new(t_symbol *s, int argc, t_atom *argv) { t_limiter *x = (t_limiter *)pd_new(limiter_class); int i = 0; if (argc) { set_bufsize(x, atom_getfloat(argv)); } else { argc = 1; set_bufsize(x, 0); } if (argc > 64) { argc=64; } if (argc == 0) { argc=1; } x->number_of_inlets = argc--; while (argc--) { inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); } outlet_new(&x->x_obj, gensym("signal")); x->in = (t_inbuf*)getbytes(sizeof(t_inbuf) * x->number_of_inlets); while (i < x->number_of_inlets) { int n; t_sample* buf = (t_sample *)getbytes(sizeof(*buf) * x->buf_size); x->in[i].ringbuf = buf; x->in[i].buf_position = 0; for (n = 0; n < x->buf_size; n++) { x->in[i].ringbuf[n] = 0.; } i++; } x->val1 = (t_limctl *)getbytes(sizeof(t_limctl)); x->val2 = (t_limctl *)getbytes(sizeof(t_limctl)); x->cmp = (t_cmpctl *)getbytes(sizeof(t_cmpctl)); x->cmp->ratio = 1.; x->cmp->treshold = 1; set1(x, 100, 30, 139); set2(x, 110, 5, 14.2); x->amplification= 1; x->samples_left = x->still_left = x->mode = 0; return (x); } static void limiter_free(t_limiter *x) { int i=0; freebytes(x->val1, sizeof(t_limctl)); freebytes(x->val2, sizeof(t_limctl)); freebytes(x->cmp , sizeof(t_cmpctl)); while (i < x->number_of_inlets) { freebytes(x->in[i++].ringbuf, x->buf_size * sizeof(t_sample)); } freebytes(x->in, x->number_of_inlets * sizeof(t_inbuf)); } /* ------------------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------------------ */ void limiter_tilde_setup(void) { init_sinc(); limiter_class = class_new(gensym("limiter~"), (t_newmethod)limiter_new, (t_method)limiter_free, sizeof(t_limiter), 0, A_GIMME, 0); class_addmethod(limiter_class, nullfn, gensym("signal"), 0); class_addmethod(limiter_class, (t_method)limiter_dsp, gensym("dsp"), 0); class_addmethod(limiter_class, (t_method)limiter_tilde_helper, gensym("help"), 0); class_addmethod(limiter_class, (t_method)status, gensym("print"), 0); class_addmethod(limiter_class, (t_method)set_mode, gensym("mode"), A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set_LIMIT, gensym("LIMIT"), 0); class_addmethod(limiter_class, (t_method)set_CRACK, gensym("CRACK"), 0); class_addmethod(limiter_class, (t_method)set_COMPRESS, gensym("COMPRESS"), 0); class_addmethod(limiter_class, (t_method)set_treshold, gensym("tresh"), A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set_treshold, gensym("treshold"), A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set_ratio, gensym("ratio"), A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set1, gensym("set"), A_FLOAT, A_FLOAT, A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set2, gensym("set2"), A_FLOAT, A_FLOAT, A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set_compressor,gensym("compress"), A_FLOAT, A_FLOAT, A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set_limits, gensym("limits"), A_FLOAT, A_FLOAT, 0); class_addmethod(limiter_class, (t_method)set_limit, gensym("limit"), A_FLOAT, 0); class_addfloat (limiter_class, set_limit); class_addmethod(limiter_class, (t_method)reset, gensym("reset"), 0); zexy_register("limiter~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/list2int.c000066400000000000000000000053571265051730400234300ustar00rootroot00000000000000/* * list2int: cast each float of a list (or anything) to integer * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include 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; list2int_any(x, s, argc, argv); 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); zexy_register("list2int"); } void l2i_setup(void) { list2int_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/list2lists.c000066400000000000000000000072561265051730400237740ustar00rootroot00000000000000/* * list2lists: split a list into several sublists given by their lenghts * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #if 0 # define DEBUG #endif #ifdef DEBUG # define DEBUGFUN(x) x #else # define DEBUGFUN(x) #endif static t_class *list2lists_class; typedef struct _list2lists { t_object x_obj; t_outlet *x_outlet; int x_n; t_inlet*x_lengin; int x_lcount; t_int *x_length; } t_list2lists; static void list2lists_list2(t_list2lists*x,t_symbol*s, int argc, t_atom*argv) { if(x->x_length!=0) { freebytes(x->x_length, sizeof(t_atom)*x->x_lcount); } x->x_lcount=0; x->x_length=0; DEBUGFUN(post("list of length %d", argc)); if(argc>0) { int i; x->x_lcount=argc; x->x_length=(t_int*)getbytes((x->x_lcount)*sizeof(t_int)); for(i=0; ix_length[i]=index; } } DEBUGFUN(post("list2: %d %x", x->x_lcount, x->x_length)); } static void list2lists_output(t_list2lists*x, int argc, t_atom*argv) { t_outlet*out=x->x_obj.ob_outlet; if(argc<=0) { outlet_bang(out); } else { outlet_list(out, gensym("list"), argc, argv); } } static void list2lists_list(t_list2lists *x, t_symbol *s, int argc, t_atom *argv) { int i; if(x->x_lcount<1) { outlet_anything(x->x_obj.ob_outlet, s, argc, argv); return; } for(i=0; ix_lcount; i++) { int len=x->x_length[i]; if(len>argc) { list2lists_output(x, argc, argv); return; } list2lists_output(x, len, argv); argv+=len; argc-=len; } } static void list2lists_free(t_list2lists *x) { if(x->x_length) { freebytes(x->x_length, x->x_lcount*sizeof(int)); x->x_length=0; x->x_lcount=0; } inlet_free(x->x_lengin); } static void *list2lists_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_list2lists *x = (t_list2lists *)pd_new(list2lists_class); outlet_new(&x->x_obj, 0); x->x_lengin=inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2")); x->x_lcount=0; x->x_length=0; list2lists_list2(x, gensym("list"), argc, argv); return (x); } static void list2lists_help(t_list2lists*x) { post("\n"HEARTSYMBOL " list2lists\t\t:: split lists into multiple sublists based on matches"); } void list2lists_setup(void) { list2lists_class = class_new(gensym("list2lists"), (t_newmethod)list2lists_new, (t_method)list2lists_free, sizeof(t_list2lists), 0, A_GIMME, 0); class_addlist (list2lists_class, list2lists_list); class_addmethod (list2lists_class, (t_method)list2lists_list2, gensym("lst2"), A_GIMME, 0); class_addmethod(list2lists_class, (t_method)list2lists_help, gensym("help"), A_NULL); zexy_register("list2lists"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/list2symbol.c000066400000000000000000000117151265051730400241360ustar00rootroot00000000000000/* * list2symbol: convert a list into a single symbol * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include /* ------------------------- list2symbol ------------------------------- */ static t_class *list2symbol_class; typedef struct _list2symbol { t_object x_obj; int ac; t_atom *ap; t_symbol *s,*connector; t_inlet *x_inlet2; t_outlet*x_outlet; } 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; char*buffer = (char*)getbytes(MAXPDSTRING*sizeof(char)); if(x->connector) { connector=x->connector->s_name; 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--) { int len2=0; if(A_SYMBOL==argv->a_type) { len2=strlen(argv->a_w.w_symbol->s_name); } else { atom_string(argv, buffer, MAXPDSTRING); len2=strlen(buffer); } length+=len2; argv++; } 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; int buflen=strlen(buf); strncpy(result+len, buf, length-len); len+=buflen; if(i && connector) { strncpy(result+len, connector, length-len); len += connlen; } } i=argc; argv=x->ap; while(i--) { if(A_SYMBOL==argv->a_type) { strncpy(result+len, argv->a_w.w_symbol->s_name, length-len); len+= strlen(argv->a_w.w_symbol->s_name); } else { atom_string(argv, buffer, MAXPDSTRING); strncpy(result+len, buffer, length-len); len += strlen(buffer); } argv++; if(i && connector) { strncpy(result+len, connector, length-len); len += connlen; } } freebytes(buffer, MAXPDSTRING*sizeof(char)); 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) { if(x->ap) { freebytes(x->ap, x->ac*sizeof(t_atom)); x->ap=0; } x->s =s; x->ac=argc; if(x->ac) { x->ap=(t_atom*)getbytes(x->ac*sizeof(t_atom)); } if(x->ap) { t_atom*ap=x->ap; while(argc--) { *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); x->x_outlet=outlet_new(&x->x_obj, 0); x->x_inlet2=inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("")); #if 0 /* old behaviour: the argument list is used as the list-to-be-converted */ x->connector = gensym(" "); list2symbol_anything(x, 0, argc, argv); #else /* new behaviour: set the delimiter with the argument */ list2symbol_connector(x, (argc)?atom_getsymbol(argv):gensym(" ")); #endif return (x); } static void list2symbol_free(t_list2symbol *x) { if(x->ap) { freebytes(x->ap, x->ac*sizeof(t_atom)); x->ap=0; } outlet_free(x->x_outlet); inlet_free(x->x_inlet2); } 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); zexy_register("list2symbol"); } void l2s_setup(void) { list2symbol_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/lister.c000066400000000000000000000071771265051730400231640ustar00rootroot00000000000000/* * lister: this is for lists, what "float" is for floats (use [list] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #ifdef HAVE_ALLOCA_H # include #endif #define LIST_NGETBYTE 100 /* bigger that this we use alloc, not alloca */ static t_class *mypdlist_class; #ifdef HAVE_ALLOCA_H # define ATOMS_ALLOCA(x, n) ((x) = (t_atom *)((n) < LIST_NGETBYTE ? \ alloca((n) * sizeof(t_atom)) : getbytes((n) * sizeof(t_atom)))) # define ATOMS_FREEA(x, n) ( \ ((n) < LIST_NGETBYTE || (freebytes((x), (n) * sizeof(t_atom)), 0))) #else # define ATOMS_ALLOCA(x, n) ((x) = (t_atom *)getbytes((n) * sizeof(t_atom))) # define ATOMS_FREEA(x, n) (freebytes((x), (n) * sizeof(t_atom))) #endif static void atoms_copy(int argc, t_atom *from, t_atom *to) { int i; for (i = 0; i < argc; i++) { to[i] = from[i]; } } static void mypdlist_storelist(t_mypdlist *x, int argc, t_atom *argv) { if(x->x_list) { freebytes(x->x_list, x->x_n*sizeof(t_atom)); } x->x_n=argc; x->x_list=(t_atom*)getbytes(x->x_n*sizeof(t_atom)); atoms_copy(argc, argv, x->x_list); } static void mypdlist_secondlist(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv) { mypdlist_storelist(x, argc, argv); } static void mypdlist_bang(t_mypdlist *x) { int outc=x->x_n; t_atom*outv; ATOMS_ALLOCA(outv, outc); atoms_copy(x->x_n, x->x_list, outv); outlet_list(x->x_obj.ob_outlet, gensym("list"), outc, outv); ATOMS_FREEA(outv, outc); } static void mypdlist_list(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv) { mypdlist_secondlist(x, s, argc, argv); mypdlist_bang(x); } 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; if(argc) { mypdlist_secondlist(x, gensym("list"), argc, argv); } return (x); } static void mypdlist_help(t_mypdlist*x) { post("\n"HEARTSYMBOL " lister\t\t:: basic list storage (use pd>=0.39 for real [list] objects)"); } 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_addmethod(mypdlist_class, (t_method)mypdlist_help, gensym("help"), A_NULL); zexy_register("lister"); } void l_setup(void) { lister_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/listfind.c000066400000000000000000000132021265051730400234600ustar00rootroot00000000000000/* * listfind: find a sublist in a list and return the index of the occurence (or indices if there are more) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #if 0 # define DEBUG #endif #ifdef DEBUG # define DEBUGFUN(x) x #else # define DEBUGFUN(x) #endif static t_class *listfind_class; typedef struct _listfind { t_object x_obj; t_outlet *x_outlet; int x_n; t_inlet*x_listin; int x_argc; t_atom *x_argv; } t_listfind; static void listfind_list2(t_listfind*x,t_symbol*s, int argc, t_atom*argv) { if(x->x_argv!=0) { freebytes(x->x_argv, sizeof(t_atom)*x->x_argc); } x->x_argc=0; x->x_argv=0; DEBUGFUN(post("list of length %d", argc)); if(argc>0) { int i; x->x_argc=argc; x->x_argv=(t_atom*)getbytes((x->x_argc)*sizeof(t_atom)); for(i=0; ix_argv[i]=argv[i]; } } DEBUGFUN(post("list2: %d %x", x->x_argc, x->x_argv)); } static int atom_equals(t_atom*a1, t_atom*a2) { if(a1->a_type!=a2->a_type) { return 0; } return(a1->a_w.w_symbol==a2->a_w.w_symbol); } static int list_equals(int count, t_atom*a1, t_atom*a2) { int i=0; DEBUGFUN(post("list(%d) equals?", count)); DEBUGFUN(postatom(count, a1)); DEBUGFUN(endpost()); DEBUGFUN(postatom(count, a2)); DEBUGFUN(endpost()); DEBUGFUN(endpost()); for(i=0; ia_type!=a2->a_type) { DEBUGFUN(post("atomtypes do not match!")); return 0; } if(A_FLOAT==a1->a_type) { if(atom_getfloat(a1)!=atom_getfloat(a2)) { return 0; } } else if(a1->a_w.w_symbol!=a2->a_w.w_symbol) { /* is it that simple? */ DEBUGFUN(post("atom values do not match: %x != %x", a1->a_w.w_symbol, a2->a_w.w_symbol )); return 0; } } DEBUGFUN(post("lists match")); return 1; } static int listfind_find(int argc, t_atom*argv, int matchc, t_atom*matchv) { int i=0; DEBUGFUN(post("match: %d vs %d elements", argc, matchc)); if(matchc>argc) { DEBUGFUN(post("list find -1")); return -1; } if(matchc==0) { DEBUGFUN(post("list find 0")); return 0; } for(i=0; i<=(argc-matchc); i++, argv++) { DEBUGFUN(post("checking at %d", i)); if(list_equals(matchc, argv, matchv)) { return i; } } return -1; } static void listfind_doit(t_outlet*out, int longcount, t_atom*longlist, int patterncount, t_atom*patternlist) { int count=0; int index; int offset=0; t_atom*ap=0; int length=1+((patterncount>0)?(longcount/patterncount): longcount); /* we shan't have more hits than this! */ if(length<1) { outlet_bang(out); } ap=(t_atom*)getbytes(length*sizeof(t_atom)); DEBUGFUN(post("expecting no more than %d results", length)); while((index=listfind_find(longcount-offset, longlist+offset, patterncount, patternlist))>=0) { offset+=index; SETFLOAT(ap+count, offset); count++; DEBUGFUN(post("new offset=%d", offset)); offset++; /* proceed to the next element */ } DEBUGFUN(post("got %d results", count)); outlet_list(out, gensym("list"), count, ap); freebytes(ap, length*sizeof(t_atom)); } static void listfind_list(t_listfind *x, t_symbol *s, int argc, t_atom *argv) { #if 0 /* entire list hot: * this is more intuitive when searching a pattern in many lists */ listfind_doit(x->x_obj.ob_outlet, argc, argv, x->x_argc, x->x_argv); #else /* pattern is hot * this is compatible with foobar's [list-find] * this is more intuitive when searching different patterns in a list */ listfind_doit(x->x_obj.ob_outlet, x->x_argc, x->x_argv, argc, argv); #endif /* personally i think that searching 1 pattern in many lists is more useful */ } static void listfind_free(t_listfind *x) { if(x->x_argv) { freebytes(x->x_argv, x->x_argc*sizeof(int)); x->x_argv=0; x->x_argc=0; } inlet_free(x->x_listin); } static void *listfind_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_listfind *x = (t_listfind *)pd_new(listfind_class); outlet_new(&x->x_obj, 0); x->x_listin=inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2")); x->x_argc=0; x->x_argv=0; listfind_list2(x, gensym("list"), argc, argv); return (x); } static void listfind_help(t_listfind*x) { post("\n"HEARTSYMBOL " listfind\t\t:: split lists into multiple sublists based on matches"); } void listfind_setup(void) { listfind_class = class_new(gensym("listfind"), (t_newmethod)listfind_new, (t_method)listfind_free, sizeof(t_listfind), 0, A_GIMME, 0); class_addlist (listfind_class, listfind_list); class_addmethod (listfind_class, (t_method)listfind_list2, gensym("lst2"), A_GIMME, 0); class_addmethod(listfind_class, (t_method)listfind_help, gensym("help"), A_NULL); zexy_register("listfind"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/liststorage.c000066400000000000000000000247421265051730400242170ustar00rootroot00000000000000/* * liststorage: stores a number of lists * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* this is heavily based on code from [textfile], which is part of pd and written by Miller S. Puckette pd (and thus [textfile]) come with their own license */ #include "zexy.h" #ifdef __WIN32__ # include #else # include #endif #include #include #include /* ****************************************************************************** */ /* liststorage : store several lists in a slots (array of lists of lists) */ /* a list of lists */ typedef struct _msglist { int argc; t_atom *argv; struct _msglist *next; } t_msglist; typedef struct _liststorage { t_object x_obj; /* everything */ t_outlet*x_dataout; /* where the data appears */ t_outlet*x_infoout; /* where meta-information appears */ t_inlet*x_slotin; /* setting the current slot */ int x_numslots, x_defaultnumslots; int x_currentslot; t_msglist**x_slots; } t_liststorage; static t_class *liststorage_class; /* ************************************************************************ */ /* helper functions */ static t_msglist*_liststorage_getslot(t_liststorage*x, int slot) { // post("getting slot %d of %d|%d", slot, 0, x->x_numslots); if(slot<0 || slot>=x->x_numslots) { pd_error(x, "[liststorage]: attempting to access invalid slot %d", slot); return NULL; } return x->x_slots[slot]; } static void _liststorage_deletemsglist(t_msglist*list) { t_msglist*x=list; while(x) { t_msglist*y=x; x=x->next; freebytes(y->argv, y->argc*sizeof(t_atom)); y->argc=0; y->argv=NULL; y->next=NULL; freebytes(y, sizeof(t_msglist)); } } static void _liststorage_deleteslot(t_liststorage*x, int slot) { t_msglist*list=_liststorage_getslot(x, slot); if(list) { _liststorage_deletemsglist(list); x->x_slots[slot]=NULL; } } static t_msglist*_liststorage_newslot(int argc, t_atom*argv) { t_msglist*slot=getbytes(sizeof(t_msglist)); int i=0; slot->argv=getbytes(sizeof(t_atom)*argc); for(i=0; iargv[i]=argv[i]; } slot->argc=argc; slot->next=NULL; return slot; } static t_msglist*_liststorage_add2slot(t_msglist*slot, int argc, t_atom*argv) { t_msglist*dummy=slot; t_msglist*newlist=_liststorage_newslot(argc, argv); if(NULL==slot) { // post("no data yet: new data is %x", newlist); return newlist; } while(dummy->next) { dummy=dummy->next; } dummy->next=newlist; // post("added data to slot @ %x", slot); return slot; } static int _liststorage_resize(t_liststorage*x, int size) { t_msglist**newarray=NULL; int i=0; if(size<0) { pd_error(x, "[liststorage]: refusing to resize for negative amount of slots"); return 0; } if(size==x->x_numslots) { verbose(1, "[liststorate] no need to resize array"); return size; } /* create a new array */ newarray=getbytes(sizeof(t_msglist*)*size); for(i=0; ix_numslots)?size:x->x_numslots; while(i-->0) { newarray[i]=x->x_slots[i]; x->x_slots[i]=NULL; } /* delete the old array */ for(i=0; ix_numslots; i++) { _liststorage_deleteslot(x, i); } freebytes(x->x_slots, sizeof(t_msglist*)); /* make the new array the current */ x->x_slots=newarray; x->x_numslots=size; return size; } static int _liststorage_checkslot(t_liststorage*x, const char*string, const int resize) { int slot=x->x_currentslot; t_atom atom; SETFLOAT(&atom, (t_float)slot); if(slot<0) { if(NULL!=string) { pd_error(x, "[liststorage]: %s %d", string, slot); } outlet_anything(x->x_infoout, gensym("invalidslot"), 1, &atom); return -1; } if(slot>=x->x_numslots) { if(resize) { _liststorage_resize(x, slot+1); } else { if(NULL!=string) { pd_error(x, "[liststorage]: %s %d", string, slot); } outlet_anything(x->x_infoout, gensym("invalidslot"), 1, &atom); return -1; } } return slot; } /* ************************************************************************ */ /* object methods */ /* recall all lists from the current slot */ static void liststorage_bang(t_liststorage *x) { t_atom atom; t_msglist*list=NULL; int slot=_liststorage_checkslot(x, "attempting to read data from invalid slot", 0); if(slot<0) { return; } list=_liststorage_getslot(x, slot); while(list) { outlet_list(x->x_dataout, gensym("list"), list->argc, list->argv); list=list->next; } SETFLOAT(&atom, (t_float)slot); /* no need for done: use [t b b b] to get beginning and end of output */ // outlet_anything(x->x_infoout, gensym("done"), 1, &atom); } /* add a new list to the current slot */ static void liststorage_add(t_liststorage *x, t_symbol *s, int ac, t_atom *av) { t_msglist*list=NULL; int slot=_liststorage_checkslot(x, "attempting to add data to invalid slot", 1); if(slot<0) { return; } list=_liststorage_getslot(x, slot); x->x_slots[slot]=_liststorage_add2slot(x->x_slots[slot], ac, av); } /* clear the current slot */ static void liststorage_clear(t_liststorage *x) { int slot=_liststorage_checkslot(x, "attempting to clear invalid slot", 0); if(slot<0) { return; } _liststorage_deleteslot(x, slot); } /* clear all slots */ static void liststorage_clearall(t_liststorage *x) { int i=0; for(i=0; ix_numslots; i++) { _liststorage_deleteslot(x, i); } } /* insert an empty slot at (before) given position */ static void liststorage_insert(t_liststorage *x, t_floatarg f) { int current=x->x_currentslot; int slot=-1; int i=0; x->x_currentslot=f; slot=_liststorage_checkslot(x, "attempting to insert invalid slot", 1); x->x_currentslot=current; if(slot<0) { return; } _liststorage_resize(x, x->x_numslots+1); for(i=x->x_numslots-1; i>slot; i--) { x->x_slots[i]=x->x_slots[i-1]; } x->x_slots[slot]=NULL; } /* get the number of slots */ static void liststorage_info(t_liststorage *x) { t_atom ap; SETFLOAT(&ap, (t_float)x->x_numslots); outlet_anything(x->x_infoout, gensym("numslots"), 1, &ap); } /* get the number of slots */ static void liststorage_slot(t_liststorage *x, t_floatarg f) { int slot=f; x->x_currentslot=slot; } /* remove empty slots */ static void liststorage_compress(t_liststorage *x) { t_msglist**newarray=NULL; int i=0, j=0; int size=0; for(i=0; ix_numslots; i++) { if(NULL!=x->x_slots[i]) { size++; } } if(size>=x->x_numslots) { // post("incomressible: %d of %d", size, x->x_numslots); return; } if(sizex_defaultnumslots) { size=x->x_defaultnumslots; } /* create a new array */ newarray=getbytes(sizeof(t_msglist*)*size); for(i=0; ix_numslots; i++) { if(NULL!=x->x_slots[i]) { newarray[j]=x->x_slots[i]; j++; } x->x_slots[i]=NULL; } /* delete the old array */ for(i=0; ix_numslots; i++) { _liststorage_deleteslot(x, i); } freebytes(x->x_slots, sizeof(t_msglist*)); /* make the new array the current */ x->x_slots=newarray; x->x_numslots=size; } /* ************************************************************************ */ /* constructor/destructor */ static void liststorage_free(t_liststorage *x) { liststorage_clearall(x); _liststorage_resize(x, 0); } /* constructor: argument is initial number of slots (can grow) */ static void *liststorage_new(t_floatarg f) { t_liststorage *x = (t_liststorage *)pd_new(liststorage_class); int slots=f; x->x_slotin=inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("slot")); x->x_dataout=outlet_new(&x->x_obj, gensym("list")); x->x_infoout=outlet_new(&x->x_obj, 0); if(slots<=0) { slots=20; } x->x_defaultnumslots=slots; x->x_numslots=0; x->x_currentslot=0; x->x_slots=NULL; _liststorage_resize(x, x->x_defaultnumslots); return (x); } void liststorage_setup(void) { liststorage_class = class_new(gensym("liststorage"), (t_newmethod)liststorage_new, (t_method)liststorage_free, sizeof(t_liststorage), 0, A_DEFFLOAT, 0); /* recall all lists from the current slot */ class_addbang(liststorage_class, (t_method)liststorage_bang); /* add a new list to the current slot */ class_addmethod(liststorage_class, (t_method)liststorage_add, gensym("add"), A_GIMME, 0); /* clear the current slot */ class_addmethod(liststorage_class, (t_method)liststorage_clear, gensym("clear"), 0); /* clear all slots */ class_addmethod(liststorage_class, (t_method)liststorage_clearall, gensym("clearall"), 0); /* add a new list to the current slot */ class_addmethod(liststorage_class, (t_method)liststorage_slot, gensym("slot"), A_FLOAT, 0); /* insert an empty slot at (before) given position */ class_addmethod(liststorage_class, (t_method)liststorage_insert, gensym("insert"), A_DEFFLOAT, 0); /* remove empty slots */ class_addmethod(liststorage_class, (t_method)liststorage_compress, gensym("compress"), 0); /* get the number of slots */ class_addmethod(liststorage_class, (t_method)liststorage_info, gensym("info"), 0); zexy_register("liststorage"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/longload.c000066400000000000000000000032451265051730400234510ustar00rootroot00000000000000/* * longload: takes a long time to load * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------- longload ------------------------------- */ #ifdef _WIN32 # include #else # include #endif static t_class *longload_class; typedef struct _longload { t_object x_obj; } t_longload; int millisleep(unsigned int milli) { #ifdef _WIN32 Sleep(milli); #else usleep(milli*1000); #endif return 0; } static void *longload_new(t_float f) { t_longload *x = (t_longload *)pd_new(longload_class); if(f>0.f) { millisleep(f); } else { millisleep(1000); } return (x); } void longload_setup(void) { longload_class = class_new(gensym("longload"), (t_newmethod)longload_new, 0, sizeof(t_longload), CLASS_NOINLET, A_DEFFLOAT, 0); zexy_register("longload"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/lpt.c000066400000000000000000000171031265051730400224470ustar00rootroot00000000000000/* * lpt: read/write the parallel port * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* (c) 2000:forum::für::umläute:2005 write to the parallel port extended to write to any port (if we do have permissions) 2005-09-28: write to devices instead of hardware-addresses http://people.redhat.com/twaugh/parport/html/ppdev.html TODO: don't lock when multiple objects refer to the same device TODO: allow readonly/writeonly access TODO: test for timeouts,... 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 # include # ifdef HAVE_LINUX_PPDEV_H # include # include # include # include # include # include # endif /* HAVE_LINUX_PPDEV_H */ # ifdef __WIN32__ /* 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 static void sys_outb(unsigned char byte, int port) { outb(byte, port); } static int sys_inb(int port) { return inb(port); } # endif /* __WIN32__ */ #endif /* Z_WANT_LP */ static int count_iopl = 0; static t_class *lpt_class; typedef struct _lpt { t_object x_obj; unsigned long port; int device; /* file descriptor of device, in case we are using one ...*/ int mode; /* MODE_IOPERM, MODE_IOPL */ } t_lpt; static void lpt_float(t_lpt *x, t_floatarg f) { #ifdef Z_WANT_LPT unsigned char b = f; # ifdef HAVE_LINUX_PPDEV_H if (x->device>0) { ioctl (x->device, PPWDATA, &b); } else # endif if (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 unsigned char b = f; # ifdef HAVE_LINUX_PPDEV_H if (x->device>0) { ioctl (x->device, PPWCONTROL, &b); } else # endif if (x->port) { sys_outb(b, x->port+2); } #endif /* Z_WANT_LPT */ } static void lpt_bang(t_lpt *x) { #ifdef Z_WANT_LPT # ifdef HAVE_LINUX_PPDEV_H if (x->device>0) { unsigned char b=0; ioctl (x->device, PPRCONTROL, &b); outlet_float(x->x_obj.ob_outlet, (t_float)b); } else # endif if (x->port) { outlet_float(x->x_obj.ob_outlet, (t_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); char*devname=atom_getsymbol(argv)->s_name; if(s==gensym("lp")) { error("lpt: the use of 'lp' has been deprecated; use 'lpt' instead"); } 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; x->device = -1; #ifdef Z_WANT_LPT if ((argc==0)||(argv->a_type==A_FLOAT)) { /* FLOAT specifies a parallel port */ switch ((int)((argc)?atom_getfloat(argv):0)) { case 0: x->port = BASE0; break; case 1: x->port = BASE1; break; case 2: x->port = BASE2; break; default: error("lpt : only lpt0, lpt1 and lpt2 are accessible"); x->port = 0; return (x); } } else { /* SYMBOL might be a file or a hex port-number; we ignore the file (device) case by now; LATER think about this */ x->device=-1; x->port=strtol(devname, 0, 16); if(0==x->port) { #ifdef HAVE_LINUX_PPDEV_H x->device = z_open(devname, O_RDWR); if(x->device<=0) { error("lpt: bad device %s", devname); return(x); } else { if (ioctl (x->device, PPCLAIM)) { perror ("PPCLAIM"); z_close (x->device); x->device=-1; } } #endif /* HAVE_LINUX_PPDEV_H */ } } if ((x->device<0) && (!x->port || x->port>65535)) { error("lpt : bad port %x", x->port); x->port = 0; return (x); } if (x->device<0) { /* this is ugly: when using a named device, * we are currently assuming that we have read/write-access * of course, this is not necessary true */ /* furthermore, we might also use the object * withOUT write permissions * (just reading the parport) */ if (x->port && x->port < 0x400) { if (ioperm(x->port, 8, 1)) { x->mode=MODE_NONE; } else { x->mode = MODE_IOPERM; } } if(x->mode==MODE_NONE) { if (iopl(3)) { x->mode=MODE_NONE; } else { x->mode=MODE_IOPL; } count_iopl++; } if(x->mode==MODE_NONE) { error("lpt : couldn't get write permissions"); x->port = 0; return (x); } } if(x->device>0) { post("lpt: connected to device %s", devname); } else { post("lpt: connected to port %x in mode '%s'", x->port, (x->mode==MODE_IOPL)?"iopl":"ioperm"); } if (x->mode==MODE_IOPL) { post("lpt-warning: this might seriously damage your pc..."); } #else error("zexy has been compiled without [lpt]!"); count_iopl=0; #endif /* Z_WANT_LPT */ devname=0; return (x); } static void lpt_free(t_lpt *x) { #ifdef Z_WANT_LPT # ifdef HAVE_LINUX_PPDEV_H if (x->device>0) { ioctl (x->device, PPRELEASE); z_close(x->device); x->device=0; } else # endif if (x->port) { if (x->mode==MODE_IOPERM && ioperm(x->port, 8, 0)) { error("lpt: couldn't clean up device"); } else if (x->mode==MODE_IOPL && (!--count_iopl) && iopl(0)) { error("lpt: couldn't clean up device"); } } #endif /* Z_WANT_LPT */ } static void lpt_helper(t_lpt*UNUSED(x)) { post("\n"HEARTSYMBOL " lpt :: direct access to the parallel port"); post("\t: write byte to the parallel-port"); post("\ncreation:\t\"lpt []\": connect to parallel port (0..2)"); post("\t\t\"lpt \": connect to port @ (hex)"); } void lpt_setup(void) { lpt_class = class_new(gensym("lpt"), (t_newmethod)lpt_new, (t_method)lpt_free, sizeof(t_lpt), 0, A_GIMME, 0); 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)lpt_helper, gensym("help"), 0); zexy_register("lpt"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/makealias.sh000077500000000000000000000030371265051730400237730ustar00rootroot00000000000000#!/bin/sh EXTENSIONS=".pd -help.pd .pd_linux .pd_darwin .pd_freebsd .dll .b_i386 .l_ia64 .l_i386 .d_fat .d_i386 .d_ppc .m_i386" ALIASFILE=$1 shift if [ "x$ALIASFILE" = "x-clean" ] then CLEANMODE=yes ALIASFILE=$1 shift else CLEANMODE= fi if [ -e "${ALIASFILE}" ]; then :; else echo cannot find alias-file ${ALIASFILE} exit 1 fi debug() { : # echo $@ } do_makealias() { local source local dest source=$1 dest=$2 if [ "x${CLEANMODE}" = "xyes" ] then if [ -e "${dest}" ]; then debug "removing alias ${dest}" rm ${dest} else debug "alias ${dest} does not exist" fi else debug "aliasing ${source} to ${dest}" if [ "x${COPYMODE}" = "xyes" ] then cp ${source} ${dest} else source=${source##*/} ln -s ${source} ${dest} fi fi } do_makealiases() { local dir local master local slave local extension dir=$1 master=$2 shift; shift if [ "x${master}" = "x" ]; then # no realname provided return fi if [ "x$@" = "x" ]; then # no aliases provided... return fi for extension in ${EXTENSIONS} do # echo "checking aliases for ${dir}/${master}${extension}" if [ -f "${dir}/${master}${extension}" ] then for slave in $@ do do_makealias ${dir}/${master}${extension} ${dir}/${slave}${extension} done fi done } for d in $@ do if [ -d "$d" ] then debug "scanning directory $d for aliases" cat ${ALIASFILE} | while read line do do_makealiases $d $line done else echo "skipping non-directory $d" fi done zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/makesource.sh000077500000000000000000000023361265051730400242030ustar00rootroot00000000000000#!/bin/sh ZEXY_H=z_zexy.h ZEXY_C=z_zexy.c GREP=grep AWK=awk SED=sed ################################# ## functions 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__" } foot_h() { echo "" echo "void z_zexy_setup(void);" echo "#endif /* Z_ZEXY_H__ */" echo "" } 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 "{" } foot_c() { echo "}" echo } setup_names() { find . -name "*.c" -not -name zexy.c -not -name z_zexy.c | sort | while read f; do i=${f##*/} i=${i%.c} SETUPNAME=$(echo $i | sed -e "s/.*0x.*/setup_&/g" -e "s/~/_tilde/g" -e "/0x/! s/.*/&_setup/") if grep -w ${SETUPNAME} $f > /dev/null; then echo ${SETUPNAME} ${i} fi done } ################################## ## body head_h > $ZEXY_H head_c > $ZEXY_C setup_names | while read SETUPNAME i; do echo "void ${SETUPNAME}(void); /* $i */" >> $ZEXY_H echo " ${SETUPNAME}(); /* $i */" >> $ZEXY_C done foot_h >> $ZEXY_H foot_c >> $ZEXY_C zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/makesymbol.c000066400000000000000000000106071265051730400240150ustar00rootroot00000000000000/* * makesymbol: yet another (formatted) symbol creation mechanism * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* (l) 1210:forum::für::umläute:1999 "makesymbol" is something between "symbol" and "makefilename", thus storing and creating (formatted) symbols... TODO: the use of only "%s" is really not very satisfying LATER: split the entire format string into subformats with only one format-placeholder ("%[^%]*[diufFgGxXoscpn]") . split the entire format string into subformats with only one format-placeholder, store the types when a list comes in, evaluate each subformat (with prior type-conversion) */ #include "zexy.h" #include #include #define MAXSTRINGARGS 10 #define MAXSTRINGLENG MAXPDSTRING /* ----------------------- makesymbol --------------------- */ static t_class *makesymbol_class; typedef struct _makesymbol { t_object x_obj; t_symbol *x_sym; char* mask; char* buf; } t_makesymbol; static void reset_mask(t_makesymbol *x, t_symbol *s) { if (*s->s_name) { x->mask = s->s_name; x->x_sym = s; } else { x->mask = "%s%s%s%s%s%s%s%s%s%s"; x->x_sym = gensym(""); } } typedef char cstring[MAXSTRINGLENG]; static t_symbol* list2symbol(char *masque, int argc, t_atom *argv) { cstring*buf=(cstring*)getbytes(MAXSTRINGARGS*sizeof(cstring)); cstring buffer; int i; for(i=0; ix_sym = list2symbol(x->mask, argc, argv); outlet_symbol(x->x_obj.ob_outlet, x->x_sym); } static void makesymbol_bang(t_makesymbol *x) { outlet_symbol(x->x_obj.ob_outlet, x->x_sym); } static void *makesymbol_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_makesymbol *x = (t_makesymbol *)pd_new(makesymbol_class); x->buf = (char *)getbytes(MAXSTRINGLENG * sizeof(char)); x->mask = x->buf; if (argc) { atom_string(argv, x->buf, MAXSTRINGLENG); x->x_sym = gensym(x->buf); } else { x->mask = "%s%s%s%s%s%s%s%s%s%s"; x->x_sym = gensym(""); } outlet_new(&x->x_obj, gensym("symbol")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("sym1")); return (x); } static void makesymbol_free(t_makesymbol *x) { freebytes(x->buf, MAXSTRINGLENG*sizeof(char)); } static void makesymbol_helper(t_makesymbol* UNUSED(x)) { post("\n"HEARTSYMBOL " makesymbol :: create a formatted symbol"); post("\t: glue up to 10 list-elements to 1 formatted symbol\n" "'bang'\t\t\t: re-output\n" "'help'\t\t\t: view this" "\ninlet2 : : new format-string (symbol !)" "\noutlet : \t: formatted concatenation"); post("\ncreation:\"makesymbol []\": C-style format-string (%s only)", "%s"); } void makesymbol_setup(void) { makesymbol_class = class_new(gensym("makesymbol"), (t_newmethod)makesymbol_new, (t_method)makesymbol_free, sizeof(t_makesymbol), 0, A_GIMME, 0); class_addlist(makesymbol_class, makesymbol_list); class_addbang(makesymbol_class, makesymbol_bang); class_addmethod(makesymbol_class, (t_method)reset_mask, gensym("sym1"), A_SYMBOL, 0); class_addmethod(makesymbol_class, (t_method)makesymbol_helper, gensym("help"), 0); zexy_register("makesymbol"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/matchbox.c000066400000000000000000000454271265051730400234670ustar00rootroot00000000000000/* * matchbox: see whether a regular expression matches a symbol in the box * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* LATER: add a creation argument to specify the initial search mode * * LATER: bind a "name" to the [matchbox] so several objects can share the same entries * if no name is given at creation time, the entries are local only * * even LATER: dynamically bind to several searchlists (via "set" message) */ #include "zexy.h" #define MATCHBOX_EXACT 0 #define MATCHBOX_OSC 1 #ifdef HAVE_REGEX_H # include # include #define MATCHBOX_REGEX 2 #endif #include #define FALSE 0 #define TRUE 1 /* ------------------------- matchbox ------------------------------- */ /* match the atoms of 2 lists */ static t_class *matchbox_class; typedef struct _listlist { int argc; t_atom *argv; struct _listlist *next; } t_listlist; typedef struct _matchbox { t_object x_obj; t_listlist*x_lists; unsigned int x_numlists; int x_mode; t_outlet*x_outResult; t_outlet*x_outNumResults; } t_matchbox; /* ----------- here comes some infrastructure stuff -------------- */ static t_listlist* addlistlist(t_listlist*list, int argc, t_atom*argv) { t_listlist*ll=(t_listlist*)getbytes(sizeof(t_listlist)); t_listlist*lp=0; ll->next=0; ll->argc=argc; ll->argv=(t_atom*)getbytes(argc*sizeof(t_atom)); memcpy(ll->argv, argv, argc*sizeof(t_atom)); if(0==list) { return ll; } lp=list; while(0!=lp->next) { lp=lp->next; } lp->next=ll; return list; } /* delete the _next_ element from the list */ static t_listlist* deletelistnext(t_listlist*list) { t_listlist*ll=0; if(!list || !list->next) { return list; /* nothing to delete */ } ll=list->next; list->next=ll->next; if(ll->argv) { freebytes(ll->argv, ll->argc*sizeof(t_atom)); } ll->argv=0; ll->argc=0; ll->next=0; freebytes(ll, sizeof(t_listlist)); return list; } /* delete the entire list of lists */ static void clearlistlist(t_listlist*list) { if(!list) { return; /* nothing to delete */ } while(list->next) { list=deletelistnext(list); } } /* -------------- here comes the matching algorithms ----------- */ static int atommatch_exact(t_atom*pattern, t_atom*atom) { if(pattern->a_type==atom->a_type) { switch(pattern->a_type) { case A_FLOAT: return atom_getfloat(pattern)==atom_getfloat(atom); case A_SYMBOL: return atom_getsymbol(pattern)==atom_getsymbol(atom); default: return pattern==atom; } } else { /* post("types don't match!"); */ return FALSE; } return TRUE; } #ifdef MATCHBOX_OSC /* OSC */ /* OSC pattern matching code was written by Matt Wright, The Center for New Music and Audio Technologies, University of California, Berkeley. Copyright (c) 1998,99,2000,01,02,03,04 The Regents of the University of California (Regents). Permission to use, copy, modify, distribute, and distribute modified versions of this software and its documentation without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies, modifications, and distributions. IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl */ #define OSCWarning post static int OSC_MatchBrackets (const char *pattern, const char *test, const char*theWholePattern); static int OSC_MatchList (const char *pattern, const char *test, const char*theWholePattern); static int OSC_PatternMatch (const char * pattern, const char * test, const char*theWholePattern) { if (pattern == 0 || pattern[0] == 0) { return test[0] == 0; } if (test[0] == 0) { if (pattern[0] == '*') { return OSC_PatternMatch (pattern+1,test, theWholePattern); } else { return FALSE; } } switch (pattern[0]) { case 0 : return test[0] == 0; case '?' : return OSC_PatternMatch (pattern + 1, test + 1, theWholePattern); case '*' : if (OSC_PatternMatch (pattern+1, test, theWholePattern)) { return TRUE; } else { return OSC_PatternMatch (pattern, test+1, theWholePattern); } case ']' : case '}' : z_verbose(1, "[matchbox]: spurious %c in OSC-pattern \".../%s/...\"", pattern[0], theWholePattern); return FALSE; case '[' : return OSC_MatchBrackets (pattern,test, theWholePattern); case '{' : return OSC_MatchList (pattern,test, theWholePattern); case '\\' : if (pattern[1] == 0) { return test[0] == 0; } else if (pattern[1] == test[0]) { return OSC_PatternMatch (pattern+2,test+1, theWholePattern); } else { return FALSE; } default : if (pattern[0] == test[0]) { return OSC_PatternMatch (pattern+1,test+1, theWholePattern); } else { return FALSE; } } } /* we know that pattern[0] == '[' and test[0] != 0 */ static int OSC_MatchBrackets (const char *pattern, const char *test, const char*theWholePattern) { int result; int negated = FALSE; const char *p = pattern; if (pattern[1] == 0) { z_verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", theWholePattern); return FALSE; } if (pattern[1] == '!') { negated = TRUE; p++; } while (*p != ']') { if (*p == 0) { z_verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", theWholePattern); return FALSE; } if (p[1] == '-' && p[2] != 0) { if (test[0] >= p[0] && test[0] <= p[2]) { result = !negated; goto advance; } } if (p[0] == test[0]) { result = !negated; goto advance; } p++; } result = negated; advance: if (!result) { return FALSE; } while (*p != ']') { if (*p == 0) { z_verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", theWholePattern); return FALSE; } p++; } return OSC_PatternMatch (p+1,test+1, theWholePattern); } static int OSC_MatchList (const char *pattern, const char *test, const char* theWholePattern) { const char *restOfPattern, *tp = test; for(restOfPattern = pattern; *restOfPattern != '}'; restOfPattern++) { if (*restOfPattern == 0) { z_verbose(1, "[matchbox]: unterminated { in OSC-pattern \".../%s/...\"", theWholePattern); return FALSE; } } restOfPattern++; /* skip close curly brace */ pattern++; /* skip open curly brace */ while (1) { if (*pattern == ',') { if (OSC_PatternMatch (restOfPattern, tp, theWholePattern)) { return TRUE; } else { tp = test; ++pattern; } } else if (*pattern == '}') { return OSC_PatternMatch (restOfPattern, tp, theWholePattern); } else if (*pattern == *tp) { ++pattern; ++tp; } else { tp = test; while (*pattern != ',' && *pattern != '}') { pattern++; } if (*pattern == ',') { pattern++; } } } } static int atommatch_osc(t_atom*pattern, t_atom*test) { char*s_pattern=0; char*s_test=0; int pattern_size=0, test_size=0; int result = FALSE; if(pattern->a_type==A_SYMBOL) { s_pattern=pattern->a_w.w_symbol->s_name; } else { pattern_size=sizeof(char)*MAXPDSTRING; s_pattern=(char*)getbytes(pattern_size); atom_string(pattern, s_pattern, pattern_size); } if(test->a_type==A_SYMBOL) { s_test=test->a_w.w_symbol->s_name; } else { test_size=sizeof(char)*MAXPDSTRING; s_test=(char*)getbytes(test_size); atom_string(test, s_test, test_size); } result = OSC_PatternMatch(s_pattern, s_test, s_pattern); if(pattern_size>0) { freebytes(s_pattern, pattern_size); s_pattern=0; pattern_size=0; } if(test_size>0) { freebytes(s_test, test_size); s_test=0; test_size=0; } return result; } #endif /* OSC */ #ifdef MATCHBOX_REGEX static int atommatch_regex(regex_t*pattern, t_atom*test) { int result=FALSE; char*s_test=0; int test_size=0; if(0==pattern) { return FALSE; } if(0==test) { return FALSE; } if(test->a_type==A_SYMBOL) { s_test=test->a_w.w_symbol->s_name; } else { test_size=sizeof(char)*MAXPDSTRING; s_test=(char*)getbytes(test_size); atom_string(test, s_test, test_size); } result=!(regexec(pattern, s_test, 0, 0, 0)); if(test_size>0) { freebytes(s_test, test_size); s_test=0; test_size=0; } return result; } static int listmatch_regex(int p_argc, regex_t**pattern, int t_argc, t_atom*test) { /* match the patterns to the test */ int argc=p_argc; if(p_argc!=t_argc) { return FALSE; } while(argc--) { if(FALSE==atommatch_regex(*pattern++, test++)) { return FALSE; } } return TRUE; } static t_listlist*matchlistlist_regex(unsigned int*numresults, t_listlist*searchlist, int p_argc, t_atom*p_argv, int flags, int delete_results) { regex_t**regexpressions=0; t_listlist*matchinglist=0, *sl; int i=0; int num=0; flags|=REG_EXTENDED; /* 1st compile the patterns */ regexpressions=(regex_t**)getbytes(sizeof(regex_t*)*p_argc); for(i=0; ia_type==A_SYMBOL) { s_pattern=pattern->a_w.w_symbol->s_name; } else { pattern_size=sizeof(char)*MAXPDSTRING; s_pattern=(char*)getbytes(pattern_size); atom_string(pattern, s_pattern, pattern_size); } regexpressions[i]=(regex_t*)getbytes(sizeof(regex_t)); if(regcomp(regexpressions[i], s_pattern, flags)) { z_verbose(1, "[matchbox]: invalid regular expression: %s", s_pattern); if(regexpressions[i]) { freebytes(regexpressions[i], sizeof(regex_t)); } regexpressions[i]=0; } if(pattern_size>0) { freebytes(s_pattern, pattern_size); s_pattern=0; pattern_size=0; } } /* match the patterns to the tests */ if(FALSE==delete_results) { for(sl=searchlist; 0!=sl; sl=sl->next) { if(TRUE==listmatch_regex(p_argc, regexpressions, sl->argc, sl->argv)) { matchinglist=addlistlist(matchinglist, sl->argc, sl->argv); num++; } } } else if (TRUE==delete_results) { /* yummy: delete matching lists! */ t_listlist*lastgood=searchlist; for(sl=searchlist; 0!=sl; sl=sl->next) { if(TRUE==listmatch_regex(p_argc, regexpressions, sl->argc, sl->argv)) { matchinglist=addlistlist(matchinglist, sl->argc, sl->argv); num++; sl=deletelistnext(lastgood); } else { lastgood=sl; } } } /* clear the patterns */ for(i=0; inext; 0!=sl; sl=sl->next) { if(matchlist(p_argc, p_argv, sl->argc, sl->argv, mode)) { matchinglist=addlistlist(matchinglist, sl->argc, sl->argv); num++; } } } else if (TRUE==delete_results) { /* yummy: delete matching lists! */ t_listlist*lastgood=searchlist; for(sl=searchlist->next; 0!=sl; sl=sl->next) { if(matchlist(p_argc, p_argv, sl->argc, sl->argv, mode)) { matchinglist=addlistlist(matchinglist, sl->argc, sl->argv); num++; sl=deletelistnext(lastgood); } else { lastgood=sl; } } } if(numresults!=0) { *numresults=num; } return matchinglist; } static void matchbox_list(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) { unsigned int results=0; int mode=x->x_mode; t_listlist*resultlist=matchlistlist(&results, x->x_lists, argc, argv, mode, FALSE); t_listlist*dummylist; outlet_float(x->x_outNumResults, (t_float)results); for(dummylist=resultlist; 0!=dummylist; dummylist=dummylist->next) { outlet_list(x->x_outResult, gensym("list"), dummylist->argc, dummylist->argv); } } static void matchbox_add(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) { /* 1st match, whether we already have this entry */ if(matchlistlist(0, x->x_lists, argc, argv, MATCHBOX_EXACT, FALSE)) { /* already there, skip the rest */ z_verbose(1, "[matchbox]: refusing to add already existing list to buffer..."); return; } /* 2nd if this is a new entry, add it */ x->x_lists=addlistlist(x->x_lists, argc, argv); x->x_numlists++; } static void matchbox_delete(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) { unsigned int results=0; int mode=x->x_mode; t_listlist*resultlist=matchlistlist(&results, x->x_lists, argc, argv, mode, TRUE); t_listlist*dummylist; t_symbol*delsym=gensym("deleted"); x->x_numlists-=results; outlet_float(x->x_outNumResults, (t_float)results); for(dummylist=resultlist; 0!=dummylist; dummylist=dummylist->next) { outlet_anything(x->x_outResult, delsym, dummylist->argc, dummylist->argv); } } static void matchbox_dump(t_matchbox*x) { t_listlist*lp=0; if(0==x->x_lists || 0==x->x_lists->next) { outlet_float(x->x_outNumResults, 0); return; } outlet_float(x->x_outNumResults, x->x_numlists); for(lp=x->x_lists->next; 0!=lp; lp=lp->next) { outlet_list(x->x_outResult, gensym("list"), lp->argc, lp->argv); } } static void matchbox_clear(t_matchbox*x) { clearlistlist(x->x_lists); x->x_numlists=0; } static void matchbox_mode(t_matchbox*x, t_symbol*s) { if(gensym("==")==s) { x->x_mode=MATCHBOX_EXACT; } else if (gensym("OSC")==s) { #ifdef MATCHBOX_OSC x->x_mode=MATCHBOX_OSC; #else pd_error(x, "[matchbox] has been compiled without 'OSC' support; ignoring your request"); #endif /* MATCHBOX_OSC */ } else if(gensym("regex")==s) { #ifdef MATCHBOX_REGEX x->x_mode=MATCHBOX_REGEX; #else pd_error(x, "[matchbox] has been compiled without 'regex' support; ignoring your request"); #endif /* MATCHBOX_REGEX */ } else { pd_error(x, "mode '%s' is unknown, switching to 'exact' mode", s->s_name); x->x_mode=MATCHBOX_EXACT; } } static void *matchbox_new(t_symbol *s, int argc, t_atom*argv) { t_matchbox *x = (t_matchbox *)pd_new(matchbox_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("add")); x->x_outResult =outlet_new(&x->x_obj, gensym("list")); x->x_outNumResults=outlet_new(&x->x_obj, gensym("float")); x->x_lists=(t_listlist*)getbytes(sizeof(t_listlist)); x->x_lists->next=0; x->x_lists->argc=0; x->x_lists->argv=0; x->x_numlists=0; x->x_mode = MATCHBOX_EXACT; if(argc && argv->a_type==A_SYMBOL) { matchbox_mode(x, atom_getsymbol(argv)); } return (x); } static void matchbox_free(t_matchbox *x) { matchbox_clear(x); freebytes(x->x_lists, sizeof(t_listlist)); x->x_lists=0; } static void matchbox_help(t_matchbox*x) { post("\n"HEARTSYMBOL " matchbox\t\t:: find a list in a pool of lists"); } void matchbox_setup(void) { #ifdef MATCHBOX_OSC post("matchbox: OSC-pattern matching code (c) Matt Wright, CNMAT"); #endif /* MATCHBOX_OSC */ matchbox_class = class_new(gensym("matchbox"), (t_newmethod)matchbox_new, (t_method)matchbox_free, sizeof(t_matchbox), 0, A_GIMME, 0); class_addlist (matchbox_class, matchbox_list); class_addmethod(matchbox_class, (t_method)matchbox_add, gensym("add"), A_GIMME, 0); class_addmethod(matchbox_class, (t_method)matchbox_delete, gensym("delete"), A_GIMME, 0); class_addmethod(matchbox_class, (t_method)matchbox_clear, gensym("clear"), A_NULL, 0); class_addmethod(matchbox_class, (t_method)matchbox_dump, gensym("dump"), A_NULL); class_addmethod(matchbox_class, (t_method)matchbox_mode, gensym("mode"), A_SYMBOL, 0); class_addmethod(matchbox_class, (t_method)matchbox_help, gensym("help"), A_NULL); zexy_register("matchbox"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/mavg.c000066400000000000000000000054531265051730400226070ustar00rootroot00000000000000/* * mavg :: moving average filter * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *mavg_class; typedef struct _mavg { t_object x_obj; t_float n_inv; t_float avg; int size; t_float *buf, *wp; } t_mavg; static void mavg_resize(t_mavg *x, t_float f) { int i; t_float *dumbuf; f = (int)f; if ((f<1) || (f == x->size)) { return; } freebytes(x->buf, sizeof(t_float)*x->size); x->n_inv = 1.0/f; x->size = f; x->buf = getbytes(sizeof(t_float)*x->size); dumbuf = x->wp = x->buf; i = x->size; while(i--) { *dumbuf++ = x->avg; } } static void mavg_set(t_mavg *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { int i = x->size; t_float *dummy = x->buf; t_float f=(argc)?atom_getfloat(argv):x->avg; while (i--) { *dummy++=f; } x->wp = x->buf; } static void mavg_float(t_mavg *x, t_float f) { int i = x->size; t_float dummy = 0; t_float *dumb = x->buf; *x->wp++ = f; if (x->wp == x->buf + x->size) { x->wp = x->buf; } while (i--) { dummy += *dumb++; } x->avg = dummy*x->n_inv; outlet_float(x->x_obj.ob_outlet,x->avg); } static void *mavg_new(t_floatarg f) { t_mavg *x = (t_mavg *)pd_new(mavg_class); int i = (f<1)?2:f; t_float *dumbuf; outlet_new(&x->x_obj, gensym("float")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); x->buf = x->wp = (t_float *)getbytes(sizeof(t_float) * i); x->size = i; x->n_inv = 1.0f/(t_float)i; dumbuf = x->buf; while (i--) { *dumbuf++=0; } return (x); } static void mavg_help(void) { post("mavg\t:: moving average filter"); } void mavg_setup(void) { mavg_class = class_new(gensym("mavg"), (t_newmethod)mavg_new, 0, sizeof(t_mavg), 0, A_DEFFLOAT, 0); class_addfloat(mavg_class, (t_method)mavg_float); class_addmethod(mavg_class, (t_method)mavg_help, gensym("help"), 0); class_addmethod(mavg_class, (t_method)mavg_set, gensym("set"), A_GIMME, 0); class_addmethod(mavg_class, (t_method)mavg_resize, gensym(""), A_DEFFLOAT, 0); zexy_register("mavg"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/minmax.c000066400000000000000000000042221265051730400231370ustar00rootroot00000000000000/* * minmax :: get minimum and maximum of a list * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" 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* UNUSED(s), int argc, t_atom *argv) { if(argc) { t_float min = atom_getfloat(argv++); t_float max=min; argc--; while(argc--) { t_float f = atom_getfloat(argv++); if (fmax) { 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); zexy_register("minmax"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/msgfile.c000066400000000000000000000621351265051730400233030ustar00rootroot00000000000000/* * msgfile: an improved version of [textfile] * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* this is heavily based on code from [textfile], which is part of pd and written by Miller S. Puckette pd (and thus [textfile]) come with their own license */ #include "zexy.h" #ifdef __WIN32__ # include #else # include #endif #include #include #include /* ****************************************************************************** */ /* msgfile : save and load messages... */ #define PD_MODE 0 #define CR_MODE 1 #define CSV_MODE 2 /* modi PD : separate items by ' '; seperate lines by ";\n" looks like a PD-file CR : separate items by ' '; seperate lines by " \n" how you would expect a file to look like CSV: separate items by ','; seperate lines by " \n" spreadsheet: each argument gets its own column */ typedef struct _msglist { int n; t_atom *thislist; void *next; void *previous; } t_msglist; typedef struct _msgfile { t_object x_obj; /* everything */ t_outlet *x_secondout; /* "done" */ int mode; t_msglist *start; t_msglist *current; /* pointer to our list */ t_msglist *previous; /* just in case we lost "current" */ t_symbol *x_dir; t_canvas *x_canvas; char eol, separator; } t_msgfile; static t_class *msgfile_class; /* ************************************************************************ */ /* forward declarations */ static void msgfile_end(t_msgfile *x); static void msgfile_goto(t_msgfile *x, t_float f); /* ************************************************************************ */ /* help functions */ static int node_wherearewe(t_msgfile *x) { int counter = 0; t_msglist *cur = x->start; while (cur && cur->next && cur!=x->current) { counter++; cur = cur->next; } if(cur&&cur->thislist) { return counter; } return -1; } static void write_currentnode(t_msgfile *x, int ac, t_atom *av) { /* append list to the current node list */ t_msglist *cur=x->current; t_atom *ap=NULL; int newsize = 0; if(!cur || (ac && av && A_SYMBOL==av->a_type && gensym("")==atom_getsymbol(av))) { /* ignoring empty symbols! */ return; } newsize = cur->n + ac; ap = (t_atom *)getbytes(newsize * sizeof(t_atom)); memcpy(ap, cur->thislist, cur->n * sizeof(t_atom)); cur->thislist = ap; memcpy(cur->thislist + cur->n, av, ac * sizeof(t_atom)); cur->n = newsize; } static void delete_currentnode(t_msgfile *x) { if (x&&x->current) { t_msglist *dummy = x->current; t_msglist *nxt=0; t_msglist *prv=0; if(dummy) { nxt=dummy->next; prv=dummy->previous; if(dummy==x->start) { x->start=nxt; } freebytes(dummy->thislist, sizeof(dummy->thislist)); dummy->thislist = 0; dummy->n = 0; dummy->next=0; dummy->previous=0; freebytes(dummy, sizeof(t_msglist)); dummy=0; } if (nxt) { nxt->previous = prv; } if (prv) { prv->next = nxt; } x->current = (nxt)?nxt:prv; if(x->current) { x->previous=x->current->previous; } else { x->previous=prv; } } } static void delete_emptynodes(t_msgfile *x) { x->current=x->start; x->previous=0; if (!x->current) { return; } while (x->current && x->current->next) { if (!x->current->thislist) { delete_currentnode(x); } else { x->previous=x->current; x->current = x->current->next; } } } static void add_currentnode(t_msgfile *x) { /* add (after the current node) a node at the current position (do not write the listbuf !!!) */ t_msglist *newnode = (t_msglist *)getbytes(sizeof(t_msglist)); t_msglist *prv, *nxt, *cur=x->current; newnode->n = 0; newnode->thislist = 0; prv = cur; nxt = (cur)?cur->next:0; newnode->next = nxt; newnode->previous = prv; if (prv) { prv->next = newnode; } if (nxt) { nxt->previous = newnode; } x->current = newnode; x->previous=prv; if(!x->start) { /* it's the first line in the buffer */ x->start=x->current; } } static void insert_currentnode(t_msgfile *x) { /* insert (add before the current node) a node (do not write a the listbuf !!!) */ t_msglist *newnode; t_msglist *prv, *nxt, *cur = x->current; if (!(cur && cur->thislist)) { add_currentnode(x); } else { newnode = (t_msglist *)getbytes(sizeof(t_msglist)); newnode->n = 0; newnode->thislist = 0; nxt = cur; prv = (cur)?cur->previous:0; newnode->next = nxt; newnode->previous = prv; if (prv) { prv->next = newnode; } if (nxt) { nxt->previous = newnode; } x->previous=prv; x->current = newnode; if(0==prv) { /* oh, we have a new start! */ x->start = newnode; } } } /* delete from line "start" to line "stop" * if "stop" is negative, delete from "start" to the end */ static void delete_region(t_msgfile *x, int start, int stop) { int n; int newwhere, oldwhere = node_wherearewe(x); /* get the number of lists in the buffer */ t_msglist *dummy = x->start; int counter = 0; /* go to the end of the buffer */ while (dummy && dummy->next) { counter++; dummy = dummy->next; } if ((stop > counter) || (stop == -1)) { stop = counter; } if ((stop+1) && (start > stop)) { return; } if (stop == 0) { return; } newwhere = (oldwhere < start)?oldwhere:( (oldwhere < stop)?start:start+ (oldwhere-stop)); n = stop - start; msgfile_goto(x, start); while (n--) { delete_currentnode(x); } if (newwhere+1) { msgfile_goto(x, newwhere); } else { msgfile_end(x); } } static int atomcmp(t_atom *this, t_atom *that) { if (this->a_type != that->a_type) { return 1; } switch (this->a_type) { case A_FLOAT: return !(atom_getfloat(this) == atom_getfloat(that)); break; case A_SYMBOL: return strcmp(atom_getsymbol(this)->s_name, atom_getsymbol(that)->s_name); break; case A_POINTER: return !(this->a_w.w_gpointer == that->a_w.w_gpointer); break; default: return 0; } return 1; } static void msgfile_binbuf2listbuf(t_msgfile *x, t_binbuf *bbuf) { int ac = binbuf_getnatom(bbuf); t_atom *ap = binbuf_getvec(bbuf); while (ac--) { if (ap->a_type == A_SEMI) { add_currentnode(x); } else { write_currentnode(x, 1, ap); } ap++; } delete_emptynodes(x); } /* ************************************************************************ */ /* object methods */ static void msgfile_rewind(t_msgfile *x) { // while (x->current && x->current->previous) x->current = x->current->previous; x->current = x->start; x->previous=0; } static void msgfile_end(t_msgfile *x) { if (!x->current) { return; } while (x->current->next) { x->previous= x->current; x->current = x->current->next; } } static void msgfile_goto(t_msgfile *x, t_float f) { int i = f; if (i<0) { return; } if (!x->current) { return; } msgfile_rewind(x); while (i-- && x->current->next) { x->previous= x->current; x->current = x->current->next; } } static void msgfile_skip(t_msgfile *x, t_float f) { int i; int counter = 0; t_msglist *dummy = x->start; if (!f) { return; } if (!x->current) { return; } while (dummy->next && dummy!=x->current) { counter++; dummy=dummy->next; } i = counter + f; if (i<0) { i=0; } msgfile_goto(x, i); } static void msgfile_clear(t_msgfile *x) { /* find the beginning */ msgfile_rewind(x); while (x->current) { delete_currentnode(x); } } static void msgfile_delete(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { if (ac==1) { int pos = atom_getfloat(av); int oldwhere = node_wherearewe(x); if (pos<0) { return; } if (oldwhere > pos) { oldwhere--; } msgfile_goto(x, pos); delete_currentnode(x); msgfile_goto(x, oldwhere); } else if (ac==2) { int pos1 = atom_getfloat(av++); int pos2 = atom_getfloat(av); if ((pos1 < pos2) || (pos2 == -1)) { if (pos2+1) { delete_region(x, pos1, pos2+1); } else { delete_region(x, pos1, -1); } } else { delete_region(x, pos1+1, -1); delete_region(x, 0, pos2); } } else { delete_currentnode(x); } } static void msgfile_add(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { msgfile_end(x); add_currentnode(x); write_currentnode(x, ac, av); } static void msgfile_add2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { msgfile_end(x); if (x->current) { if(x->current->previous) { x->current = x->current->previous; } } else { add_currentnode(x); } write_currentnode(x, ac, av); if (x->current && x->current->next) { x->previous= x->current; x->current = x->current->next; } } static void msgfile_append(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { add_currentnode(x); write_currentnode(x, ac, av); } static void msgfile_append2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { if(!x->current) { add_currentnode(x); } if (x->current->thislist) { write_currentnode(x, ac, av); } else { msgfile_append(x, s, ac, av); } } static void msgfile_insert(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { t_msglist *cur = x->current; insert_currentnode(x); write_currentnode(x, ac, av); x->current = cur; } static void msgfile_insert2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { t_msglist *cur = x->current; if ((x->current) && (x->current->previous)) { x->current = x->current->previous; } write_currentnode(x, ac, av); x->current = cur; } static void msgfile_set(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { msgfile_clear(x); msgfile_add(x, s, ac, av); } static void msgfile_replace(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { if(x->current) { if(x->current->thislist) { freebytes(x->current->thislist, sizeof(x->current->thislist)); } x->current->thislist = 0; x->current->n = 0; } else { add_currentnode(x); } write_currentnode(x, ac, av); } static void msgfile_flush(t_msgfile *x) { t_msglist *cur = x->start; while (cur && cur->thislist) { outlet_list(x->x_obj.ob_outlet, gensym("list"), cur->n, cur->thislist); cur = cur->next; } } static void msgfile_this(t_msgfile *x) { if ((x->current) && (x->current->thislist)) { outlet_list(x->x_obj.ob_outlet, gensym("list"), x->current->n, x->current->thislist); } else { outlet_bang(x->x_secondout); } } static void msgfile_next(t_msgfile *x) { if ((x->current) && (x->current->next)) { t_msglist *next = x->current->next; if (next->thislist) { outlet_list(x->x_obj.ob_outlet, gensym("list"), next->n, next->thislist); } else { outlet_bang(x->x_secondout); } } else { outlet_bang(x->x_secondout); } } static void msgfile_prev(t_msgfile *x) { t_msglist*prev=0; if ((x->current) && (x->current->previous)) { prev = x->current->previous; } else if (x->previous) { prev = x->previous; } if(prev) { if (prev->thislist) { outlet_list(x->x_obj.ob_outlet, gensym("list"), prev->n, prev->thislist); } else { outlet_bang(x->x_secondout); } } else { outlet_bang(x->x_secondout); } } static void msgfile_bang(t_msgfile *x) { if ((x->current) && (x->current->thislist)) { t_msglist*cur=x->current; x->current=cur->next; x->previous=cur; outlet_list(x->x_obj.ob_outlet, gensym("list"), cur->n, cur->thislist); } else { outlet_bang(x->x_secondout); } } static void msgfile_find(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { t_msglist *found = 0; t_msglist *cur=x->current; while (cur) { int n = cur->n; int equal = 1; t_atom *that = av; t_atom *this = cur->thislist; if(0==this) { cur=cur->next; continue; } if (ac < n) { n = ac; } while (n-->0) { if ( (strcmp("*", atom_getsymbol(that)->s_name) && atomcmp(that, this)) ) { equal = 0; } that++; this++; } if (equal) { found = cur; break; } cur=cur->next; } if(found) { x->current = found; x->previous= found->previous; outlet_float(x->x_secondout, node_wherearewe(x)); if(found->n && found->thislist) { outlet_list(x->x_obj.ob_outlet, gensym("list"), found->n, found->thislist); } } else { outlet_bang(x->x_secondout); } } static void msgfile_where(t_msgfile *x) { if (x->current && x->current->thislist) { outlet_float(x->x_secondout, node_wherearewe(x)); } else { outlet_bang(x->x_secondout); } } static void msgfile_sort(t_msgfile *x, t_symbol *s0, t_symbol*s1, t_symbol*r) { post("sorting not implemented yet: '%s', '%s' -> '%s'", s0->s_name, s1->s_name, r->s_name); #if 0 int step = argc, n; t_atom *atombuf = (t_atom *)getbytes(sizeof(t_atom) * argc); t_float *buf; t_int *idx; int i, loops = 1; sort_buffer(x, argc, argv); buf = x->buffer; idx = x->indices; while (step > 1) { step = (step % 2)?(step+1)/2:step/2; i = loops; loops += 2; while(i--) { /* there might be some optimization in here */ for (n=0; n<(argc-step); n++) { if (buf[n] > buf[n+step]) { t_int i_tmp = idx[n]; t_float f_tmp = buf[n]; buf[n] = buf[n+step]; buf[n+step] = f_tmp; idx[n] = idx[n+step]; idx[n+step] = i_tmp; } } } } #endif } /* ********************************** */ /* file I/O */ static void msgfile_read2(t_msgfile *x, t_symbol *filename, t_symbol *format) { int rmode = 0; int fd=0; FILE*fil=NULL; long readlength, length, pos; char filnam[MAXPDSTRING]; char buf[MAXPDSTRING], *bufptr, *readbuf; char *charbinbuf=NULL, *cbb; int charbinbuflength=0; char*dirname=canvas_getdir(x->x_canvas)->s_name; int mode = x->mode; char separator, eol; t_binbuf *bbuf = binbuf_new(); #ifdef __WIN32__ rmode |= O_BINARY; #endif fd = open_via_path(dirname, filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0); if (fd < 0) { /* open via path failed, fall back */ fd=z_open(filename->s_name, rmode); if(fd < 0) { pd_error(x, "can't open in %s/%s", dirname, filename->s_name); return; } else { z_close(fd); sprintf(filnam, "%s", filename->s_name); } } else { z_close(fd); sprintf(filnam, "%s/%s", buf, bufptr); } fil=z_fopen(filnam, "rb"); if(fil==NULL) { pd_error(x, "could not open '%s'", filnam); return; } fseek(fil, 0, SEEK_END); length=ftell(fil); fseek(fil, 0, SEEK_SET); if (!(readbuf = t_getbytes(length))) { pd_error(x, "msgfile_read: could not reserve %ld bytes to read into", length); z_fclose(fil); return; } if (gensym("cr")==format) { mode = CR_MODE; } else if (gensym("csv")==format) { mode = CSV_MODE; } else if (gensym("pd")==format) { mode = PD_MODE; } else if (*format->s_name) { pd_error(x, "msgfile_read: unknown flag: %s", format->s_name); } switch (mode) { case CR_MODE: separator = ' '; eol = '\n'; break; case CSV_MODE: separator = ','; eol = ' '; break; default: separator = '\n'; eol = ';'; break; } /* read */ if ((readlength = fread(readbuf, sizeof(char), length, fil)) < length) { pd_error(x, "msgfile_read: unable to read %s: %ld of %ld", filnam, readlength, length); z_fclose(fil); t_freebytes(readbuf, length); return; } /* close */ z_fclose(fil); /* convert separators and eols to what pd expects in a binbuf*/ bufptr=readbuf; # define MSGFILE_HEADROOM 1024 charbinbuflength=2*length+MSGFILE_HEADROOM; charbinbuf=(char*)getbytes(charbinbuflength); cbb=charbinbuf; for(pos=0; pos=charbinbuflength) { pd_error(x, "msgfile: read error (headroom %d too small!)", MSGFILE_HEADROOM); goto read_error; break; } if (*bufptr == separator) { *cbb = ' '; } else if (*bufptr==eol) { *cbb++=';'; pos++; *cbb='\n'; } else { *cbb=*bufptr; } bufptr++; cbb++; pos++; } /* convert to binbuf */ binbuf_text(bbuf, charbinbuf, charbinbuflength); msgfile_binbuf2listbuf(x, bbuf); read_error: binbuf_free(bbuf); t_freebytes(readbuf, length); t_freebytes(charbinbuf, charbinbuflength); } static void msgfile_read(t_msgfile *x, t_symbol *filename, t_symbol *format) { msgfile_clear(x); msgfile_read2(x, filename, format); } static void msgfile_write(t_msgfile *x, t_symbol *filename, t_symbol *format) { char buf[MAXPDSTRING]; t_binbuf *bbuf = binbuf_new(); t_msglist *cur = x->start; char *mytext = 0, *dumtext; char filnam[MAXPDSTRING]; int textlen = 0, i; char separator, eol; int mode = x->mode; FILE *f=0; while(cur) { binbuf_add(bbuf, cur->n, cur->thislist); binbuf_addsemi(bbuf); cur = cur->next; } if(format&&gensym("")!=format) { if(gensym("cr")==format) { mode = CR_MODE; } else if(gensym("csv")==format) { mode = CSV_MODE; } else if(gensym("pd")==format) { mode = PD_MODE; } else if(format&&format->s_name) { pd_error(x, "msgfile_write: ignoring unknown flag: %s", format->s_name); } } switch (mode) { case CR_MODE: separator = ' '; eol = ' '; break; case CSV_MODE: separator = ','; eol = ' '; break; default: separator = ' '; eol = ';'; break; } binbuf_gettext(bbuf, &mytext, &textlen); dumtext = mytext; i = textlen; while(i--) { if (*dumtext==' ') { *dumtext=separator; } else if ((*dumtext==';') && (dumtext[1]=='\n')) { *dumtext = eol; } dumtext++; } /* open */ canvas_makefilename(x->x_canvas, filename->s_name, buf, MAXPDSTRING); sys_bashfilename(buf, filnam); if (!(f = z_fopen(filnam, "w"))) { pd_error(x, "msgfile : failed to open %s", filnam); } else { /* write */ if (fwrite(mytext, textlen*sizeof(char), 1, f) < 1) { pd_error(x, "msgfile : failed to write %s", filnam); } } /* close */ if (f) { z_fclose(f); } binbuf_free(bbuf); } /* ********************************** */ /* misc */ static void msgfile_print(t_msgfile *x) { t_msglist *cur = x->start; int j=0; post("--------- msgfile contents: -----------"); while (cur) { t_msglist *dum=cur; int i; j++; startpost("line %d:", j); for (i = 0; i < dum->n; i++) { t_atom *a = dum->thislist + i; postatom(1, a); } endpost(); cur = cur->next; } } static void msgfile_help(t_msgfile *x) { post("\n"HEARTSYMBOL " msgfile\t:: handle and store files of lists"); post("goto \t: goto line " "\nrewind\t\t: goto the beginning of the file" "\nend\t\t: goto the end of the file" "\nskip \t: move relatively to current position" "\nbang\t\t: output current line and move forward" "\nprev\t\t: output previous line" "\nthis\t\t: output this line" "\nnext\t\t: output next line" "\nflush\t\t: output all lines"); post("set \t: clear the buffer and add " "\nadd \t: add at the end of the file" "\nadd2 \t: append to the last line of the file" "\nappend \t: append at the current position" "\nappend2 \t: append to the current line" "\ninsert \t: insert at the current position" "\ninsert2 \t: append to position [current-1]" "\nreplace \t: replace current line by " "\ndelete [ []]\t: delete lines or regions" "\nclear\t\t: delete the whole buffer"); post("where\t\t: output current position" "\nfind \t: search for " "\nread []\t: read as " "\nwrite []\t: write as " "\n\t\t: valid are\t: PD, CR, CSV" "\n\nprint\t\t: show buffer (for debugging)" "\nhelp\t\t: show this help"); post("creation: \"msgfile []\": defines fileaccess-mode(default is PD)"); } static void msgfile_free(t_msgfile *x) { msgfile_clear(x); freebytes(x->current, sizeof(t_msglist)); } static void *msgfile_new(t_symbol *s, int argc, t_atom *argv) { t_msgfile *x = (t_msgfile *)pd_new(msgfile_class); /* an empty node indicates the end of our listbuffer */ x->current = 0; x->start = 0; x->previous= 0; x->mode=PD_MODE; /* that's the default */ if ((argc==1) && (argv->a_type == A_SYMBOL)) { t_symbol*mode=atom_getsymbol(argv); if (gensym("cr") == mode) { x->mode = CR_MODE; } else if (gensym("csv")== mode) { x->mode = CSV_MODE; } else if (gensym("pd") == mode) { x->mode = PD_MODE; } else { pd_error(x, "msgfile: unknown argument %s", argv->a_w.w_symbol->s_name); } } outlet_new(&x->x_obj, gensym("list")); x->x_secondout = outlet_new(&x->x_obj, gensym("float")); x->x_canvas = canvas_getcurrent(); x->eol=' '; x->separator=','; return (x); } 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); class_addmethod(msgfile_class, (t_method)msgfile_goto, gensym("goto"), A_DEFFLOAT, 0); class_addmethod(msgfile_class, (t_method)msgfile_rewind, gensym("rewind"), 0); class_addmethod(msgfile_class, (t_method)msgfile_rewind, gensym("begin"), 0); class_addmethod(msgfile_class, (t_method)msgfile_end, gensym("end"), 0); class_addmethod(msgfile_class, (t_method)msgfile_next, gensym("next"), A_DEFFLOAT, 0); class_addmethod(msgfile_class, (t_method)msgfile_prev, gensym("prev"), A_DEFFLOAT, 0); class_addmethod(msgfile_class, (t_method)msgfile_skip, gensym("skip"), A_DEFFLOAT, 0); class_addmethod(msgfile_class, (t_method)msgfile_set, gensym("set"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_clear, gensym("clear"), 0); class_addmethod(msgfile_class, (t_method)msgfile_delete, gensym("delete"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_add, gensym("add"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_add2, gensym("add2"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_append, gensym("append"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_append2, gensym("append2"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_insert, gensym("insert"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_insert2, gensym("insert2"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_replace, gensym("replace"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_find, gensym("find"), A_GIMME, 0); class_addmethod(msgfile_class, (t_method)msgfile_read, gensym("read"), A_SYMBOL, A_DEFSYM, 0); class_addmethod(msgfile_class, (t_method)msgfile_read2, gensym("read2"), A_SYMBOL, A_DEFSYM, 0); class_addmethod(msgfile_class, (t_method)msgfile_write, gensym("write"), A_SYMBOL, A_DEFSYM, 0); class_addmethod(msgfile_class, (t_method)msgfile_print, gensym("print"), 0); class_addmethod(msgfile_class, (t_method)msgfile_flush, gensym("flush"), 0); class_addbang(msgfile_class, msgfile_bang); class_addmethod(msgfile_class, (t_method)msgfile_this, gensym("this"), 0); class_addmethod(msgfile_class, (t_method)msgfile_where, gensym("where"), 0); class_addmethod(msgfile_class, (t_method)msgfile_sort, gensym("sort"), A_SYMBOL, A_SYMBOL, A_SYMBOL, 0); class_addmethod(msgfile_class, (t_method)msgfile_help, gensym("help"), 0); zexy_register("msgfile"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/multiline~.c000066400000000000000000000160521265051730400240520ustar00rootroot00000000000000/* * multiline~: interpolating signal multiplier * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* a multiline that MULTIplicates MULTIple signals with "ramped floats" (--> like "line~") this is kind of multiplying some streams with the square diagonal matrix : diag*~ for smooth-results we do this line~ thing 1403:forum::für::umläute:2001 */ /* i am not sure, whether there is a difference between loop-unrolling by hand or by compiler * i somehow have the feeling, that doing it by hand increases(!) performance for about 2% * anyhow, if you think that the compiler can do this job better, just disable the UNROLLED define below */ #define UNROLLED #include "zexy.h" /* --------------------------- multiline~ ---------------------------------- */ static t_class *mline_class; typedef struct _mline { t_object x_obj; t_float time; int ticksleft; int retarget; t_float msec2tick; t_sample *value; t_sample *target; t_sample *increment; /* single precision is really a bad */ t_sample **sigIN; t_sample **sigOUT; t_sample *sigBUF; int sigNUM; } t_mline; /* the message thing */ static void mline_list(t_mline *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { if (argc>x->sigNUM) { x->time=atom_getfloat(argv+argc-1); } if (x->time <= 0) { if (argc==1) { t_float f = atom_getfloat(argv); int i=x->sigNUM; while(i--) { x->target[i]=x->value[i]=f; } } else { int offset = (argcsigNUM)?x->sigNUM-argc:0; int i=offset?argc:x->sigNUM; while(i--) { x->target[i+offset]=x->value[i+offset]=atom_getfloat(argv++); } } x->ticksleft=x->retarget=x->time=0; } else { if (argc==1) { int i = x->sigNUM; t_float f = atom_getfloat(argv); for(i=0; isigNUM; i++) { x->target[i]=f; } } else { int offset = (argcsigNUM)?x->sigNUM-argc:0; int i=offset?argc:x->sigNUM; while(i--) { x->target[i+offset]=atom_getfloat(argv++); } } x->retarget = 1; } } static void mline_stop(t_mline *x) { int i = x->sigNUM; while (i--) { x->target[i] = x->value[i]; } x->ticksleft = x->retarget = 0; } /* the dsp thing */ static t_int *mline_perform(t_int *w) { t_mline *x = (t_mline *)(w[1]); int n = (int)(w[2]); t_sample **out = x->sigOUT; t_sample **in = x->sigIN; t_sample *buf = x->sigBUF, *sigBUF = buf; t_sample *inc = x->increment, *increment = inc; t_sample *val = x->value, *value = val; t_sample *tgt = x->target, *target = tgt; int sigNUM = x->sigNUM; if (x->retarget) { int nticks = x->time * x->msec2tick; if (!nticks) { nticks = 1; } x->ticksleft = nticks; x->retarget = 0; } if (x->ticksleft) { int N=n-1; t_sample oneovernos = 1./(x->ticksleft*n); int i=sigNUM; while(i--) { *inc++=(*tgt++-*val++)*oneovernos; } n=-1; while (n++ticksleft) { val = value; tgt = target; i = sigNUM; while(i--) { *val++=*tgt++; } } } else { /* no ticks left */ int i = sigNUM; while (n--) { i = sigNUM; val = value; buf = sigBUF; while (i--) { *buf++=in[i][n]**val++; } i = sigNUM; buf = sigBUF; while (i--) { out[i][n]=*buf++; } } } return (w+3); } static void mline_dsp(t_mline *x, t_signal **sp) { int i = x->sigNUM, n = 0; t_sample **dummy = x->sigIN; while(i--) { *dummy++=sp[n++]->s_vec; } i = x->sigNUM; dummy =x->sigOUT; while(i--) { *dummy++=sp[n++]->s_vec; } x->msec2tick = sp[0]->s_sr / (1000.f * sp[0]->s_n); dsp_add(mline_perform, 2, x, sp[0]->s_n); } /* setup/setdown things */ static void mline_free(t_mline *x) { freebytes(x->value, sizeof(x->value)); freebytes(x->target, sizeof(x->target)); freebytes(x->increment, sizeof(x->increment)); freebytes(x->sigIN, sizeof(x->sigIN)); freebytes(x->sigOUT, sizeof(x->sigOUT)); freebytes(x->sigBUF, sizeof(x->sigBUF)); } static void *mline_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_mline *x = (t_mline *)pd_new(mline_class); int i; if (!argc) { argc = 1; x->time = 0; } else { x->time = atom_getfloat(argv+argc-1); if (x->time < 0) { x->time = 0; } argc--; if (!argc) { argc = 1; } } x->sigNUM = argc; i = argc-1; outlet_new(&x->x_obj, gensym("signal")); while (i--) { inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); } inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); floatinlet_new(&x->x_obj, &x->time); x->sigIN = (t_sample **)getbytes(x->sigNUM * sizeof(t_sample **)); x->sigOUT = (t_sample **)getbytes(x->sigNUM * sizeof(t_sample **)); x->sigBUF = (t_sample *)getbytes(x->sigNUM * sizeof(t_sample *)); x->value = (t_sample *)getbytes(x->sigNUM * sizeof(t_sample *)); x->target = (t_sample *)getbytes(x->sigNUM * sizeof(t_sample *)); x->increment = (t_sample *)getbytes(x->sigNUM * sizeof(t_sample *)); i = x->sigNUM; while (i--) { x->sigIN[i] = x->sigOUT[i] = 0; x->increment[i] = 0; x->value[x->sigNUM-i-1] = x->target[x->sigNUM-i-1] = atom_getfloat(argv+i); } x->msec2tick = x->ticksleft = x->retarget = 0; return (x); } static void mline_help(t_mline*x) { post("\n"HEARTSYMBOL " multiline~\t:: ramped multiplication of multiple signals"); } 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); class_addmethod(mline_class, (t_method)mline_dsp, gensym("dsp"), 0); class_addmethod(mline_class, nullfn, gensym("signal"), 0); class_addmethod(mline_class, (t_method)mline_list, gensym(""), A_GIMME, 0); class_addmethod(mline_class, (t_method)mline_stop, gensym("stop"), 0); class_addmethod (mline_class, (t_method)mline_help, gensym("help"), A_NULL); zexy_register("multiline_tilde"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/multiplex.c000066400000000000000000000074371265051730400237040ustar00rootroot00000000000000/* * mulitplex : multiplex a specified input to the output * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* 1903:forum::für::umläute:2005 */ /* * 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 /* ------------------------- 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_pd p_pd; 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); x->i_selected=0; x->i_count = n; x->in = (t_inlet **)getbytes(x->i_count * sizeof(t_inlet *)); x->x_proxy = (t_muxproxy**)getbytes(x->i_count * sizeof(t_muxproxy*)); for (n = 0; ni_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) { const int count = x->i_count; if(x->in && x->x_proxy) { int n=0; for(n=0; nin[n]) { inlet_free(x->in[n]); } x->in[n]=0; if(x->x_proxy[n]) { t_muxproxy *y=x->x_proxy[n]; y->p_master=0; y->id=0; pd_free(&y->p_pd); } x->x_proxy[n]=0; } freebytes(x->in, x->i_count * sizeof(t_inlet *)); freebytes(x->x_proxy, x->i_count * sizeof(t_muxproxy*)); } /* pd_free(&y->p_pd); */ } 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(0, 0, 0, sizeof(t_muxproxy), CLASS_PD | CLASS_NOINLET, 0); class_addanything(muxproxy_class, mux_anything); zexy_register("multiplex"); } void mux_setup(void) { multiplex_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/multiplex~.c000066400000000000000000000063261265051730400240760ustar00rootroot00000000000000/* * mux~ : multiplex a specified signal to the output * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *mux_tilde_class; typedef struct _mux { t_object x_obj; int input; int n_in; t_sample **in; } t_mux; static void mux_tilde_input(t_mux *x, t_floatarg f) { if ((f>=0)&&(fn_in)) { x->input=f; } else { error("multiplex~: %d is channel out of range (0..%d)", (int)f, x->n_in); } } static t_int *mux_tilde_perform(t_int *w) { t_mux *x = (t_mux *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); t_sample *in = x->in[x->input]; while(n--) { *out++=*in++; } return (w+4); } static void mux_tilde_dsp(t_mux *x, t_signal **sp) { int n = 0; t_sample **dummy=x->in; for(n=0; nn_in; n++) { *dummy++=sp[n]->s_vec; } dsp_add(mux_tilde_perform, 3, x, sp[n]->s_vec, sp[0]->s_n); } static void mux_tilde_helper(void) { post("\n"HEARTSYMBOL " multiplex~\t:: multiplex a one of various signals to one outlet"); 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_tilde_free(t_mux *x) { freebytes(x->in, x->n_in * sizeof(t_sample *)); } static void *mux_tilde_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) { t_mux *x = (t_mux *)pd_new(mux_tilde_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,gensym("signal"),gensym("signal")); } x->in = (t_sample **)getbytes(x->n_in * sizeof(t_sample *)); 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_tilde_class = class_new(gensym("multiplex~"), (t_newmethod)mux_tilde_new, (t_method)mux_tilde_free, sizeof(t_mux), 0, A_GIMME, 0); class_addcreator((t_newmethod)mux_tilde_new, gensym("mux~"), A_GIMME, 0); class_addfloat(mux_tilde_class, mux_tilde_input); class_addmethod(mux_tilde_class, (t_method)mux_tilde_dsp, gensym("dsp"), 0); class_addmethod(mux_tilde_class, nullfn, gensym("signal"), 0); class_addmethod(mux_tilde_class, (t_method)mux_tilde_helper, gensym("help"), 0); zexy_register("multiplex~"); } void mux_tilde_setup(void) { multiplex_tilde_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/multireceive.c000066400000000000000000000102121265051730400243370ustar00rootroot00000000000000/* * multireceive: receive messages for various receive-names * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* -------------------------- multireceive ------------------------------ */ static t_class *multireceive_class=NULL; static t_class *multireceive_proxy_class=NULL; typedef struct _symlist { t_symbol*s; struct _symlist*next; } t_symlist; typedef struct _multireceive_proxy { t_object x_obj; struct _multireceive*x_parent; } t_multireceive_proxy; typedef struct _multireceive { t_object x_obj; t_multireceive_proxy*x_proxy; t_symlist*x_symlist; t_outlet *x_out; } t_multireceive; static void multireceive_any(t_multireceive_proxy *x, t_symbol*s, int argc, t_atom*argv) { outlet_anything(x->x_parent->x_out, s, argc, argv); } static void multireceive_add(t_multireceive *x, t_symbol*s) { t_symlist*sl=x->x_symlist; t_symlist*element=NULL; if(sl) { while(sl->next) { if(s==sl->s) { // already bound to this symbol return; } sl=sl->next; } } element=(t_symlist*)getbytes(sizeof(t_symlist)); element->s=s; element->next=NULL; pd_bind(&x->x_proxy->x_obj.ob_pd, s); if(sl) { sl->next=element; } else { x->x_symlist=element; } } static void multireceive_clear(t_multireceive *x) { t_symlist*sl=x->x_symlist; t_symlist*current=NULL; while(sl) { current=sl; sl=sl->next; pd_unbind(&x->x_proxy->x_obj.ob_pd, current->s); current->s=NULL; current->next=NULL; freebytes(current, sizeof(t_symlist)); } x->x_symlist=NULL; } static void multireceive_set(t_multireceive *x, t_symbol*s, int argc, t_atom*argv) { multireceive_clear(x); while(argc-->0) { t_symbol*s=atom_getsymbol(argv); if(A_SYMBOL==argv->a_type) { multireceive_add(x, s); } else { verbose(1, "[multireceive]: ignoring non-symbol receive name"); } argv++; } } static void multireceive_free(t_multireceive *x) { multireceive_clear(x); pd_free((t_pd *)x->x_proxy); outlet_free(x->x_out); x->x_out=NULL; } static void *multireceive_new(t_symbol *s, int argc, t_atom *argv) { t_multireceive *x = (t_multireceive *)pd_new(multireceive_class); x->x_proxy=(t_multireceive_proxy*)pd_new(multireceive_proxy_class); x->x_proxy->x_parent=x; x->x_symlist=NULL; x->x_out = outlet_new(&x->x_obj, 0); multireceive_set(x, 0, argc, argv); return (x); } void multireceive_setup(void) { multireceive_class = class_new(gensym("multireceive"), (t_newmethod)multireceive_new, (t_method)multireceive_free, sizeof(t_multireceive), 0, A_GIMME, 0); class_addmethod(multireceive_class, (t_method)multireceive_set, gensym("set"), A_GIMME, 0); class_addmethod(multireceive_class, (t_method)multireceive_add, gensym("add"), A_SYMBOL, 0); multireceive_proxy_class = class_new( gensym("multireceive proxy "__DATE__""__TIME__""), 0, 0, sizeof(t_multireceive_proxy), CLASS_PD | CLASS_NOINLET, 0); class_addanything(multireceive_proxy_class, multireceive_any); zexy_register("multireceive"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/niagara.c000066400000000000000000000055561265051730400232630ustar00rootroot00000000000000/* * niagara: split a list into 2 (use [list split] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.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 nowadays you can do this with [list split] (though this cannot handle negative indices) */ 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, gensym("list")); x->right = outlet_new(&x->x_obj, gensym("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); zexy_register("niagara"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/noish~.c000066400000000000000000000123171265051730400231700ustar00rootroot00000000000000/* * noish~: bandlimited noise generator * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* 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_sample current; t_sample decrement; t_sample updater; t_sample 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; } static void set_noisseed(t_nois *x, t_floatarg seed) { x->val = seed; } /* ------------------------ noish~ ----------------------------- */ static t_class *noish_class; static t_int *noish_perform(t_int *w) { t_nois *x = (t_nois *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); int *vp = (int *)(&x->val); int i_value = *vp; t_sample f_value = ((t_sample)((i_value & 0x7fffffff) - 0x40000000)) * (t_sample)(1.0 / 0x40000000); t_sample all_to_go = x->updater; t_sample 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++ = ((t_sample)((i_value & 0x7fffffff) - 0x40000000)) * (t_sample)( 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 = ( (t_sample)((i_value & 0x7fffffff) - 0x40000000) ) * (t_sample)( 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 = ( (t_sample)((i_value & 0x7fffffff) - 0x40000000) ) * (t_sample)( 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) { dsp_add(noish_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); } static void noish_helper(void) { post("\n"HEARTSYMBOL " noish~\t:: a bandlimited pseudo-noise generator"); post("\t : sampling-frequency (in Hz)\n" "'help'\t : view this"); post("creation : \"noish~ []\"\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)set_noisseed, gensym("seed"), A_FLOAT, 0); class_addmethod(noish_class, (t_method)noish_helper, gensym("help"), 0); zexy_register("noish~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/noisi-test.pd000066400000000000000000000003071265051730400241250ustar00rootroot00000000000000#N canvas 1 51 450 300 10; #X obj 188 201 dac~; #X obj 200 111 noisi~ 200; #X obj 200 133 hip~ 5; #X obj 200 155 *~ 5; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 3 0 0 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/noisi~.c000066400000000000000000000124541265051730400231730ustar00rootroot00000000000000/* * noisi~: bandlimited noise generator * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* 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_sample current; t_sample decrement; t_sample updater; t_sample to_go; } t_nois; static void set_noisfreq(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; } static void set_noisseed(t_nois *x, t_floatarg seed) { x->val = seed; } /* ------------------------ noisi~ ----------------------------- */ static t_class *noisi_class; static inline t_sample int2sample(int i) { return ((t_sample)(i & 0x7fffffff) - 0x40000000) * (t_sample)( 1.0 / 0x40000000); } static inline int update_intNoise(int i) { i *= 435898247; i += 382842987; return i; } static t_int *noisi_perform(t_int *w) { t_nois *x = (t_nois *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); int i_value = x->val; t_sample f_value = x->current; t_sample decrement = x->decrement; t_sample all_to_go = x->updater; t_sample 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--) { *out++ = int2sample(i_value=update_intNoise(i_value)); } } else if (n < still_to_go) { /* signal won't change for the next 64 samples */ still_to_go -= n; while (n--) { *out++ = (f_value -= decrement); } } 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 -= decrement); } f_value = int2sample(i_value); i_value = update_intNoise(i_value); still_to_go += all_to_go + 1; decrement = (f_value - int2sample(i_value)) / all_to_go; while (n--) { still_to_go--; *out++ = (f_value -= decrement); } } else { /* anything else */ while (n--) { if (still_to_go-- <= 0) { /* update only if all time has elapsed */ still_to_go += all_to_go; f_value=int2sample(i_value); i_value=update_intNoise(i_value); decrement = (f_value - int2sample(i_value)) / all_to_go; } *out++ = (f_value -= decrement); } } x->val = i_value; x->current = f_value; x->decrement = decrement; x->to_go = still_to_go; return (w+4); } static void noisi_dsp(t_nois *x, t_signal **sp) { dsp_add(noisi_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); } static void noisi_helper(void) { post("\n"HEARTSYMBOL " noisi~\t:: a bandlimited interpolating pseudo-noise generator"); post("\t : sampling-frequency (in Hz)\n" "'help'\t : view this"); post("creation : \"noisi~ []\"\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 noisi~-objects created at the\n" "\t same time will produce different signals, something the original\n" "\t noise~-object misses\n"); post("for further details see DODGE/JERSE \"computer music\" c3.9\n"); } static void *noisi_new(t_floatarg f) { t_nois *x = (t_nois *)pd_new(noisi_class); static int init = 4259; x->val = (init *= 17); set_noisfreq (x, f); outlet_new(&x->x_obj, gensym("signal")); return (x); } 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_noisfreq); class_addmethod(noisi_class, (t_method)noisi_dsp, gensym("dsp"), 0); class_addmethod(noisi_class, (t_method)set_noisseed, gensym("seed"), A_FLOAT, 0); class_addmethod(noisi_class, (t_method)noisi_helper, gensym("help"), 0); zexy_register("noisi~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/operating_system.c000066400000000000000000000043061265051730400252450ustar00rootroot00000000000000/* * operating_system : get currently used OS * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------- operating_system ------------------------------- */ /* MESSAGE OPERATING_SYSTEM: simple and easy */ static t_class *operating_system_class; typedef struct _operating_system { t_object x_obj; } t_operating_system; static void operating_system_bang(t_operating_system *x) { /* LATER think about querying the version of the system at runtime! */ t_symbol *s=gensym("unknown"); #ifdef __linux__ s=gensym("linux"); #elif defined __APPLE__ s=gensym("macos"); #elif defined __WIN32__ s=gensym("windows"); #endif outlet_symbol(x->x_obj.ob_outlet, s); } static void *operating_system_new(void) { t_operating_system *x = (t_operating_system *)pd_new( operating_system_class); outlet_new(&x->x_obj, 0); return (x); } static void operating_system_help(t_operating_system*x) { post("\n"HEARTSYMBOL " operating_system\t:: get the current operating system"); } 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_NULL); class_addbang (operating_system_class, operating_system_bang); class_addmethod(operating_system_class, (t_method)operating_system_help, gensym("help"), A_NULL); zexy_register("operating_system"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/pack.c000066400000000000000000000116141265051730400225670ustar00rootroot00000000000000/* * pack: a type-agnostic version of [pack] * * (c) 2007-2011 forum::für::umläute * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* * this version of [pack] does not care about types, so you can send a symbol to a float inlet and vice versa * you can also initialize it with symbols, e.g. [pack foo bar] will output [list foo bar( when banged * * for know this object is named [zexy/pack], as there might be some issues with compatibility with the original [pack] */ #include "zexy.h" #include /* ------------------------- zexy/pack ------------------------------- */ static t_class *zpack_class; static t_class *zpackproxy_class; typedef struct _zpack { t_object x_obj; struct _zpackproxy **x_proxy; t_inlet **in; t_atom*x_argv; int x_argc; } t_zpack; typedef struct _zpackproxy { t_pd p_pd; t_zpack *p_master; int id; } t_zpackproxy; static void setatom(t_zpack *x, t_atom*from, int to) { x->x_argv[to].a_type=from->a_type; x->x_argv[to].a_w =from->a_w; } static void zpack_bang(t_zpack*x) { outlet_list(x->x_obj.ob_outlet, gensym("list"), x->x_argc, x->x_argv); } static void zpack_any(t_zpack*x, t_symbol *s, int argc, t_atom *argv) { int i=0; int count=x->x_argc; if(NULL!=s && x->x_argc>0) { t_atom a; SETSYMBOL(&a, s); setatom(x, &a, i++); count--; } if(count>argc) { count=argc; } while(count-->0) { setatom(x, argv++, i++); } zpack_bang(x); } static void zpack_list(t_zpack*x, t_symbol *s, int argc, t_atom *argv) { zpack_any(x, 0, argc, argv); } static void zpack_proxy_list(t_zpackproxy *y, t_symbol *s, int argc, t_atom *argv) { /* until we have lists of lists, this only uses the 1st element */ if(argc>0) { /* this filters out 'bang', and allows 'list', 'float' and 'symbol' */ setatom(y->p_master, argv, y->id); } } static void zpack_proxy_any(t_zpackproxy *y, t_symbol *s, int argc, t_atom *argv) { /* until we have lists of lists, this only uses the selector */ t_atom a; SETSYMBOL(&a, s); setatom(y->p_master, &a, y->id); } static void *zpack_new(t_symbol *s, int argc, t_atom *argv) { t_zpack *x = (t_zpack *)pd_new(zpack_class); int n =0; x->x_argc = (argc < 1)?2:argc; if(argc<1) { x->x_argv=(t_atom*)getbytes(2*sizeof(t_atom)); SETFLOAT(x->x_argv+0, 0.f); SETFLOAT(x->x_argv+1, 0.f); } else { int i=0; x->x_argv=(t_atom*)getbytes(x->x_argc*sizeof(t_atom)); for(i=0; ix_argc; i++) { setatom(x, argv+i, i); } } x->in = (t_inlet **)getbytes(x->x_argc * sizeof(t_inlet *)); x->x_proxy = (t_zpackproxy**)getbytes(x->x_argc * sizeof(t_zpackproxy*)); x->in[0] =0; x->x_proxy[0]=0; for (n = 1; nx_argc; n++) { x->x_proxy[n]=(t_zpackproxy*)pd_new(zpackproxy_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); } outlet_new(&x->x_obj, 0); return (x); } static void zpack_free(t_zpack*x) { const int count = x->x_argc; if(x->in && x->x_proxy) { int n=0; for(n=0; nin[n]) { inlet_free(x->in[n]); } x->in[n]=0; if(x->x_proxy[n]) { t_zpackproxy *y=x->x_proxy[n]; y->p_master=0; y->id=0; pd_free(&y->p_pd); } x->x_proxy[n]=0; } freebytes(x->in, x->x_argc * sizeof(t_inlet *)); freebytes(x->x_proxy, x->x_argc * sizeof(t_zpackproxy*)); } } void zpack_setup(void) { zpack_class = class_new(gensym("zexy/pack"), (t_newmethod)zpack_new, (t_method)zpack_free, sizeof(t_zpack), 0, A_GIMME, 0); #if 0 /* oops Pd>=0.42 allows us to override built-ins * this is bad as long as the 2 objects are not compatible */ class_addcreator((t_newmethod)zpack_new, gensym("pack"), A_GIMME, 0); #endif class_addbang(zpack_class, zpack_bang); class_addlist(zpack_class, zpack_list); class_addanything(zpack_class, zpack_any); zpackproxy_class = class_new(gensym("zpack proxy"), 0, 0, sizeof(t_zpackproxy), CLASS_PD | CLASS_NOINLET, 0); class_addlist(zpackproxy_class, zpack_proxy_list); class_addanything(zpackproxy_class, zpack_proxy_any); zexy_register("pack"); } void pack_setup(void) { zpack_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/packel.c000066400000000000000000000075271265051730400231200ustar00rootroot00000000000000/* * packel: get the nth element of a package * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *packel_class; typedef struct _packel { t_object x_obj; t_float *position; int count; t_inlet**x_inlet; t_outlet**x_outlet; int x_warningflag; } t_packel; static void packel_outelement(t_packel*x, int id, t_symbol*s,int argc, t_atom*argv) { t_outlet*out=x->x_outlet[id]; int index= x->position[id]; if (index) { t_atom *current; int pos = (index < 0)?(argc+index):(index-1); if(argc==0) { if (pos==0||pos==-1) { outlet_bang(out); } return; } if (pos < 0 || pos >= argc) { return; } current = &(argv[pos]); switch (current->a_type) { case A_NULL: outlet_bang(out); default: outlet_list(out, gensym("list"), 1, current); } } else { outlet_list(out, s, argc, argv); } } static void packel_list(t_packel *x, t_symbol *s, int argc, t_atom *argv) { int c=x->count; while(--c>=0) { packel_outelement(x, c, 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; if(x->x_warningflag) { pd_error(x, "deprecation warning: you should only use lists for list data"); x->x_warningflag=0; } 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_free(t_packel *x) { int i=0; for(i=0; icount; i++) { if(x->x_inlet &&x->x_inlet [i]) { inlet_free (x->x_inlet [i]); } if(x->x_outlet&&x->x_outlet[i]) { outlet_free(x->x_outlet[i]); } } if(x->position) { freebytes(x->position, x->count*sizeof(t_float)); } if(x->x_inlet) { freebytes(x->x_inlet, x->count*sizeof(t_inlet*)); } if(x->x_outlet) { freebytes(x->x_outlet, x->count*sizeof(t_outlet*)); } } static void *packel_new(t_symbol*s, int argc, t_atom*argv) { t_packel *x = (t_packel *)pd_new(packel_class); x->count=(argc>0)?argc:1; x->position=(t_float*)getbytes(x->count*sizeof(t_float)); x->x_inlet=(t_inlet**)getbytes(x->count*sizeof(t_inlet*)); x->x_outlet=(t_outlet**)getbytes(x->count*sizeof(t_outlet*)); if(argc<1) { x->position[0]=0.f; x->x_inlet[0]=floatinlet_new(&x->x_obj, x->position); x->x_outlet[0]=outlet_new(&x->x_obj, 0); } else { int i=0; for(i=0; icount; i++) { x->position[i]=atom_getfloat(argv+i); x->x_inlet [i]=floatinlet_new(&x->x_obj, x->position+i); x->x_outlet [i]=outlet_new(&x->x_obj, 0); } } x->x_warningflag=1; return (x); } void packel_setup(void) { packel_class = class_new(gensym("packel"), (t_newmethod)packel_new, (t_method)packel_free, sizeof(t_packel), 0, A_GIMME, 0); class_addlist (packel_class, packel_list); class_addanything(packel_class, packel_anything); zexy_register("packel"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/pack~.c000066400000000000000000000052611265051730400227660ustar00rootroot00000000000000/* * pack~: pack the signal-vector to a list of floats * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *sigpack_class; typedef struct _sigpack { t_object x_obj; int vector_length; t_atom *buffer; t_clock*x_clock; int x_outputindsp; } t_sigpack; static void sigpack_tick(t_sigpack*x) { outlet_list(x->x_obj.ob_outlet, gensym("list"), x->vector_length, x->buffer); } static t_int *sigpack_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sigpack *x = (t_sigpack *)w[2]; int n = (int)(w[3]), i = 0; t_atom *buf = x->buffer; while (n--) { t_float f=*in++; SETFLOAT(&buf[i], f); i++; } if(x->x_outputindsp) { sigpack_tick(x); } else { clock_delay(x->x_clock, 0); } 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_free(t_sigpack*x) { clock_free(x->x_clock); } 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")); x->x_clock=clock_new(x, (t_method)sigpack_tick); x->x_outputindsp=0; 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, (t_method)sigpack_free, 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); zexy_register("pack~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/pdf~.c000066400000000000000000000070171265051730400226220ustar00rootroot00000000000000/* * pdf~: get the ProbabilityDensityFunction of a signal * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------ pdf~ ----------------------------- */ static t_class *pdf_class; typedef struct _pdf { t_object x_obj; t_float *buf; int size; t_float halfsize; } t_pdf; static void clear_pdfbuf(t_pdf *x) { int n = x->size; t_float *buf = x->buf; while (n--) { *buf++=0.; } } static void pdf_bang(t_pdf *x) { int n = x->size; t_float *buf = x->buf, max = 0; t_atom a[2]; while (n--) if (max < *buf++) { max = buf[-1]; } n=x->size; buf = x->buf; if (max==0.) { max=1.; } max = 1./max; while (n--) { SETFLOAT(a, *buf++*max); SETFLOAT(a+1,x->size-n-1); outlet_list(x->x_obj.ob_outlet, gensym("list"), 2, (t_atom*)&a); } } static void pdf_float(t_pdf *x, t_floatarg f) { if (f) { pdf_bang(x); } else { clear_pdfbuf(x); } } static t_int *pdf_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_pdf *x = (t_pdf *)(w[2]); int n = (int)(w[3]); t_float *buf = x->buf; t_float halfsize = x->halfsize; while (n--) { t_sample f = *in++; int iindex = ((f + 1.0) * halfsize)+0.5; buf[(iindex<0)?0:((iindex>=x->size)?x->size-1:iindex)]+=1.; } return (w+4); } static void pdf_dsp(t_pdf *x, t_signal **sp) { x->halfsize = (x->size - 1) / 2.0; dsp_add(pdf_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); } static void *pdf_new(t_floatarg f) { int i = f; t_pdf *x = (t_pdf *)pd_new(pdf_class); x->size = (i)?i:64; x->buf = (t_float *)getbytes(x->size * sizeof(*x->buf)); clear_pdfbuf(x); outlet_new(&x->x_obj, gensym("list")); return (x); } static void pdf_free(t_pdf *x) { if(x->buf) { freebytes(x->buf, x->size*sizeof(*x->buf)); } } static void pdf_tilde_helper(void) { post("\n"HEARTSYMBOL " pdf~\t:: get the probability density function of a signal (-1.0 to +1.0)"); post("'bang'\t : output a list of the probabilities of 'n' function values" "\n'clear'\t : clear the buffer (set all probabilities to zero)" "\n<1/0>\t : short for 'bang' and 'clear'" "\n'help'\t : view this"); post("creation :: 'pdf~ []':: get the pdf for (default: 64) values"); } 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); class_addmethod(pdf_class, nullfn, gensym("signal"), 0); class_addmethod(pdf_class, (t_method)pdf_dsp, gensym("dsp"), 0); class_addmethod(pdf_class, (t_method)pdf_bang, gensym("bang"), 0); class_addmethod(pdf_class, (t_method)clear_pdfbuf, gensym("clear"), 0); class_addfloat(pdf_class, pdf_float); class_addmethod(pdf_class, (t_method)pdf_tilde_helper, gensym("help"), 0); zexy_register("pdf~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/prime.c000066400000000000000000000037351265051730400227720ustar00rootroot00000000000000/* * prime: get the n-th prime number * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *prime_class; typedef struct _prime { t_object x_obj; } t_prime; static void prime_float(t_prime *x, t_float f) { unsigned int i=f; unsigned int max_divisor; unsigned int divisor=1; if (f<2) { outlet_float(x->x_obj.ob_outlet, 0.0); return; } if (!(i%2)) { outlet_float(x->x_obj.ob_outlet, (t_float)(i==2)); return; } max_divisor = sqrt(f)+1; while ((divisor+=2)x_obj.ob_outlet, 0.0); return; } outlet_float(x->x_obj.ob_outlet, 1.0); } static void *prime_new(void) { t_prime *x = (t_prime *)pd_new(prime_class); outlet_new(&x->x_obj, gensym("float")); return (x); } static void prime_help(t_prime*x) { post("\n"HEARTSYMBOL " prime\t\t:: test whether a given number is prime"); } 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); class_addmethod(prime_class, (t_method)prime_help, gensym("help"), A_NULL); zexy_register("prime"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/quantize~.c000066400000000000000000000067371265051730400237210ustar00rootroot00000000000000/* * quantize~: quantize a signal to various bit-depths * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* 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 */ #include "zexy.h" /* ------------------------ quantize~ ----------------------------- */ static t_class *quantize_class; typedef struct _quantize { t_object x_obj; t_sample quantiz, dequantiz; } t_quantize; static void quantize_float(t_quantize *x, t_floatarg f) { x->quantiz = f; x->dequantiz = 1./f; } static void quantize_16bit(t_quantize *x) { x->quantiz = 32768.; x->dequantiz = 1./32768.; } static void quantize_8bit(t_quantize *x) { x->quantiz = 128.; x->dequantiz = 1./128.; } static t_int *quantize_perform(t_int *w) { t_quantize *x = (t_quantize *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); t_sample quantiz = x->quantiz, dequantiz = x->dequantiz; if (quantiz) while (n--) { *out++ = dequantiz*(int)(quantiz**in++); } else while (n--) { *out++ = *in++; } return (w+5); } static void quantize_dsp(t_quantize *x, t_signal **sp) { dsp_add(quantize_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void quantize_tilde_helper(t_quantize* UNUSED(x)) { post(""HEARTSYMBOL " quantize~-object\t:: used for quantizing signals by various degrees"); post(" : quantize a signal into steps ('0' turns quantizing off)\n" "'8bit' : quantize to 8 bit\n" "'16bit' : quantize to 16 bit (default)\n" "'float' : pass-through the signal unchanged\n" "'help' : view this\n" "signal~\n"); post("creation:: \"quantize~ []\""); } static void *quantize_new(t_floatarg f) { t_quantize *x = (t_quantize *)pd_new(quantize_class); outlet_new(&x->x_obj, gensym("signal")); if (f) { quantize_float(x, f); } else { quantize_16bit(x); } return (x); } 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)quantize_tilde_helper, gensym("help"), 0); zexy_register("quantize~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/rawprint.c000066400000000000000000000063211265051730400235160ustar00rootroot00000000000000/* * rawprint: print the incoming message as raw as possible * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include #ifdef _MSC_VER # define snprintf _snprintf #endif #if !defined( _MSC_VER ) && defined (_WIN32) # ifndef _get_output_format //int _get_output_format( void ){ return 0; } # endif #endif static t_class *rawprint_class; typedef struct _rawprint { t_object x_obj; t_symbol*label; } t_rawprint; static void rawprint_any(t_rawprint *x, t_symbol*s, int argc, t_atom*argv) { char buf[MAXPDSTRING]; if(x->label) { startpost("%s: ", x->label->s_name); } if(s) startpost("\"%s\"", s->s_name); else // this shouldn't happen, but sometimes does... startpost("NULL"); while(argc--) { switch(argv->a_type) { case A_FLOAT: snprintf(buf, MAXPDSTRING-1, "%f", atom_getfloat(argv)); break; case A_SYMBOL: snprintf(buf, MAXPDSTRING-1, "'%s'", atom_getsymbol(argv)->s_name); break; case A_POINTER: snprintf(buf, MAXPDSTRING-1, "pointer[%p]", argv->a_w.w_gpointer); break; case A_SEMI: snprintf(buf, MAXPDSTRING-1, "SEMI"); break; case A_COMMA: snprintf(buf, MAXPDSTRING-1, "COMMA"); break; case A_DEFFLOAT: snprintf(buf, MAXPDSTRING-1, "DEFFLOAT[%f]", atom_getfloat(argv)); break; case A_DEFSYM: snprintf(buf, MAXPDSTRING-1, "DEFSYM['%s']", atom_getsymbol(argv)->s_name); break; case A_DOLLAR: snprintf(buf, MAXPDSTRING-1, "DOLLAR['%s']", atom_getsymbol(argv)->s_name); break; case A_DOLLSYM: snprintf(buf, MAXPDSTRING-1, "DOLLSYM['%s']", atom_getsymbol(argv)->s_name); break; case A_GIMME: snprintf(buf, MAXPDSTRING-1, "GIMME"); break; case A_CANT: // we _really_ cannot do CANT snprintf(buf, MAXPDSTRING-1, "CANT"); break; default: snprintf(buf, MAXPDSTRING-1, "unknown[%d]", argv->a_type); } buf[MAXPDSTRING-1]=0; startpost(" %s", buf); argv++; } endpost(); } static void *rawprint_new(t_symbol*s) { t_rawprint *x = (t_rawprint *)pd_new(rawprint_class); x->label=NULL; if(s&&gensym("")!=s) { x->label=s; } return (x); } void rawprint_setup(void) { rawprint_class = class_new(gensym("rawprint"), (t_newmethod)rawprint_new, 0, sizeof(t_rawprint), CLASS_DEFAULT, A_DEFSYMBOL, 0); class_addanything(rawprint_class, rawprint_any); zexy_register("rawprint"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/regex.c000066400000000000000000000174731265051730400227740ustar00rootroot00000000000000/* * regex: regular expression pattern matcher * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #ifdef HAVE_REGEX_H # include # include # include #endif # define NUM_REGMATCHES 10 /* * regex : see whether a regular expression matches the given symbol */ /* ------------------------- regex ------------------------------- */ /* match a regular expression against a string */ static t_class *regex_class; typedef struct _regex { t_object x_obj; #ifdef HAVE_REGEX_H char *x_regexstring; /* the uncompiled regular expression */ int x_regexstringlength; regex_t *x_regexp; int x_matchnum; int x_flags; /* flags for the regex-compiler; REG_EXTENDED is always enabled */ #endif t_outlet*x_outResult; t_outlet*x_outDetails; t_outlet*x_outNumDetails; } t_regex; #ifdef HAVE_REGEX_H static char*regex_l2s(int *reslen, t_symbol*s, int argc, t_atom*argv) { char *result = 0; int pos=0, i=0; t_atom*ap; int length=0; if(reslen) { *reslen=length; } /* 1st get the length of the symbol */ if(s) { length+=strlen(s->s_name); } else { length-=1; } length+=argc; i=argc; ap=argv; while(i--) { char buffer[MAXPDSTRING]; int len=0; if(A_SYMBOL==ap->a_type) { len=strlen(ap->a_w.w_symbol->s_name); } else { atom_string(ap, buffer, MAXPDSTRING); len=strlen(buffer); } length+=len; ap++; } if(length<=0) { return(0); } result = (char*)getbytes((length+1)*sizeof(char)); if (s) { char *buf = s->s_name; strcpy(result+pos, buf); pos+=strlen(buf); if(i) { strcpy(result+pos, " "); pos += 1; } } ap=argv; i=argc; while(i--) { if(A_SYMBOL==ap->a_type) { strcpy(result+pos, ap->a_w.w_symbol->s_name); pos+= strlen(ap->a_w.w_symbol->s_name); } else { char buffer[MAXPDSTRING]; atom_string(ap, buffer, MAXPDSTRING); strcpy(result+pos, buffer); pos += strlen(buffer); } ap++; if(i) { strcpy(result+pos, " "); pos++; } } result[length]=0; if(reslen) { *reslen=length; } return result; } static void regex_compile(t_regex *x) { int flags = x->x_flags; flags |= REG_EXTENDED; if(0==x->x_regexstring || 0==x->x_regexstringlength) { pd_error(x, "[regex]: no regular expression given"); return; } if(x->x_regexp) { regfree(x->x_regexp); freebytes(x->x_regexp, sizeof(t_regex)); x->x_regexp=0; } x->x_regexp=(regex_t*)getbytes(sizeof(t_regex)); if(regcomp(x->x_regexp, x->x_regexstring, flags)) { pd_error(x, "[regex]: invalid regular expression: %s", x->x_regexstring); if(x->x_regexp) { freebytes(x->x_regexp, sizeof(t_regex)); } x->x_regexp=0; } } #endif static void regex_case(t_regex *x, t_float f) { #if HAVE_REGEX_H if(f>0.f) { x->x_flags |= REG_ICASE; } else { x->x_flags ^= REG_ICASE; } regex_compile(x); #endif } static void regex_regex(t_regex *x, t_symbol*s, int argc, t_atom*argv) { #ifdef HAVE_REGEX_H char*result=0; int length=0; result=regex_l2s(&length, 0, argc, argv); if(0==result || 0==length) { pd_error(x, "[regex]: no regular expression given"); return; } if(x->x_regexstring) { freebytes(x->x_regexstring, x->x_regexstringlength); x->x_regexstring=0; x->x_regexstringlength=0; } x->x_regexstring=result; x->x_regexstringlength=length; regex_compile(x); #endif } /* compare the given list as string with the precompiled regex */ static void regex_symbol(t_regex *x, t_symbol *s, int argc, t_atom*argv) { #ifdef HAVE_REGEX_H char*teststring=0; int length=0; int num_matches=x->x_matchnum; regmatch_t*match=(regmatch_t*)getbytes(sizeof(regmatch_t)*num_matches); t_atom*ap=(t_atom*)getbytes(sizeof(t_atom)*(3*num_matches)); int err=0; if(!x->x_regexp) { pd_error(x, "[regex]: no regular expression!"); goto cleanup; } teststring=regex_l2s(&length, 0, argc, argv); if(!teststring||!length) { pd_error(x, "[regex]: cannot evaluate string"); goto cleanup; } /* do the actual comparing against the regex */ err=regexec(x->x_regexp, teststring, num_matches, match, 0); if(teststring) { freebytes(teststring, length); teststring=0; } if(err) { /* NO match */ if(match) { freebytes(match, sizeof(regmatch_t)*num_matches); match=0; } outlet_float(x->x_outResult, 0.f); } else { /* match! */ int num_results=0; int i=0; t_atom*ap2=ap; for(i=0; i0 && (match[i].rm_so==match[i-1].rm_so) && (match[i].rm_eo==match[i-1].rm_eo)) { /* duplicate matches */ } else { SETFLOAT(ap2+0, (t_float)i); SETFLOAT(ap2+1, (t_float)match[i].rm_so); SETFLOAT(ap2+2, (t_float)match[i].rm_eo); ap2+=3; num_results++; } } } if(match) { freebytes(match, sizeof(regmatch_t)*num_matches); match=0; } outlet_float(x->x_outNumDetails, (t_float)num_results); for(i=0; ix_outDetails, gensym("list"), 3, ap+(i*3)); } outlet_float(x->x_outResult, 1.f); } cleanup: if(teststring) { freebytes(teststring, length); } if(match) { freebytes(match, sizeof(regmatch_t)*num_matches); } if(ap) { freebytes(ap, sizeof(t_atom)*(1+2*num_matches)); } #endif } static void *regex_new(t_symbol *s, int argc, t_atom*argv) { t_regex *x = (t_regex *)pd_new(regex_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("regex")); x->x_outResult=outlet_new(&x->x_obj, 0); x->x_outDetails=outlet_new(&x->x_obj, gensym("list")); x->x_outNumDetails=outlet_new(&x->x_obj, gensym("float")); #ifdef HAVE_REGEX_H x->x_flags=0; x->x_regexstring=0; x->x_regexstringlength=0; x->x_regexp=0; x->x_matchnum=NUM_REGMATCHES; if(argc) { regex_regex(x, gensym(""), argc, argv); } else { t_atom a; SETSYMBOL(&a, gensym(".*")); regex_regex(x, 0, 1, &a); } #else error("[regex] non-functional: compiled without regex-support!"); #endif return (x); } static void regex_free(t_regex *x) { #ifdef HAVE_REGEX_H if(x->x_regexstring) { freebytes(x->x_regexstring, x->x_regexstringlength); x->x_regexstring=0; x->x_regexstringlength=0; } if(x->x_regexp) { regfree(x->x_regexp); freebytes(x->x_regexp, sizeof(t_regex)); x->x_regexp=0; } #endif } static void regex_help(t_regex*x) { post("\n"HEARTSYMBOL " regex\t\t:: test the input whether it matches a regular expression"); } void regex_setup(void) { regex_class = class_new(gensym("regex"), (t_newmethod)regex_new, (t_method)regex_free, sizeof(t_regex), 0, A_GIMME, 0); class_addlist (regex_class, regex_symbol); class_addmethod(regex_class, (t_method)regex_regex, gensym("regex"), A_GIMME, 0); class_addmethod(regex_class, (t_method)regex_case, gensym("case"), A_FLOAT, 0); class_addmethod(regex_class, (t_method)regex_help, gensym("help"), A_NULL); zexy_register("regex"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/relay.c000066400000000000000000000110111265051730400227540ustar00rootroot00000000000000/* * relay: route without stripping selector * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* (c) 2106:forum::für::umläute:2005 "relay" is like "route" but doesn't change the incoming list example: [foo bar( --> [route foo] --> [bar( [foo bar( --> [relay foo] --> [foor bar( namings: direct, channel, relay, steer, guide, ?? in the meantime i choose [relay] (as in mail-relay) */ #include "zexy.h" /* -------------------------- relay ------------------------------ */ static t_class *relay_class; typedef struct _relayelement { t_word e_w; t_outlet *e_outlet; } t_relayelement; typedef struct _relay { t_object x_obj; t_atomtype x_type; t_int x_nelement; t_relayelement *x_vec; t_outlet *x_rejectout; } t_relay; static void relay_anything(t_relay *x, t_symbol *sel, int argc, t_atom *argv) { t_relayelement *e; int nelement; if (x->x_type == A_SYMBOL) { for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_symbol == sel) { outlet_anything(e->e_outlet, sel, argc, argv); return; } } } outlet_anything(x->x_rejectout, sel, argc, argv); } static void relay_list(t_relay *x, t_symbol *sel, int argc, t_atom *argv) { t_relayelement *e; int nelement; if (x->x_type == A_FLOAT) { t_float f; if (!argc) { outlet_bang(x->x_rejectout); return; } f = atom_getfloat(argv); for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_float == f) { if (!sel) { sel=(argc==1)?gensym("float"):gensym("list"); } outlet_anything(e->e_outlet, sel, argc, argv); return; } } } else { /* symbol arguments */ if (argc == 0) { /* no args: treat as "bang" */ for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_symbol == gensym("bang")) { outlet_bang(e->e_outlet); return; } } } else if (argc>1) { for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_symbol == gensym("list")) { outlet_anything(e->e_outlet, sel, argc, argv); return; } } } else if (argv[0].a_type == A_FLOAT) { /* one float arg */ for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_symbol == gensym("float")) { outlet_float(e->e_outlet, argv[0].a_w.w_float); return; } } } else { for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_symbol == gensym("symbol")) { outlet_symbol(e->e_outlet, argv[0].a_w.w_symbol); return; } } } } outlet_list(x->x_rejectout, gensym("list"), argc, argv); } static void relay_free(t_relay *x) { freebytes(x->x_vec, x->x_nelement * sizeof(*x->x_vec)); } static void *relay_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { int n; t_relayelement *e; t_relay *x = (t_relay *)pd_new(relay_class); t_atom a; if (argc == 0) { argc = 1; SETFLOAT(&a, 0); argv = &a; } x->x_type = argv[0].a_type; x->x_nelement = argc; x->x_vec = (t_relayelement *)getbytes(argc * sizeof(*x->x_vec)); for (n = 0, e = x->x_vec; n < argc; n++, e++) { e->e_outlet = outlet_new(&x->x_obj, gensym("list")); if (x->x_type == A_FLOAT) { e->e_w.w_float = atom_getfloatarg(n, argc, argv); } else { e->e_w.w_symbol = atom_getsymbolarg(n, argc, argv); } } x->x_rejectout = outlet_new(&x->x_obj, gensym("list")); return (x); } void relay_setup(void) { relay_class = class_new(gensym("relay"), (t_newmethod)relay_new, (t_method)relay_free, sizeof(t_relay), 0, A_GIMME, 0); class_addlist(relay_class, relay_list); class_addanything(relay_class, relay_anything); zexy_register("relay"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/repack.c000066400000000000000000000113521265051730400231150ustar00rootroot00000000000000/* * repack : (re)pack floats/symbols/pointers to fixed-length packages * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include /* -------------------- 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* UNUSED(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); zexy_register("repack"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/repeat.c000066400000000000000000000034651265051730400231360ustar00rootroot00000000000000/* * repeat: repeat a message multiple times * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------- repeat ------------------------------- */ 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_symbol* UNUSED(s), int argc, t_atom*argv) { t_repeat *x = (t_repeat *)pd_new(repeat_class); if(argc) { if(A_FLOAT==argv->a_type) { x->fcount = atom_getfloat(argv); } else { return 0; } } else { x->fcount=2; } 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_GIMME, 0); class_addanything(repeat_class, repeat_anything); zexy_register("repeat"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/route~.c000066400000000000000000000044751265051730400232140ustar00rootroot00000000000000/* * [route~]: 1-to-n signal routing * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *route_tilde_class; typedef struct _route_tilde { t_object x_obj; t_outlet*x_sigout, *x_msgout; } t_route_tilde; static void route_tilde_any(t_route_tilde *x, t_symbol *s, int argc, t_atom *argv) { outlet_anything(x->x_msgout, s, argc, argv); } t_int *route_tilde_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); while (n--) { *out++ = *in++; } return (w+4); } static void route_tilde_dsp(t_route_tilde *x, t_signal **sp) { if(sp) { dsp_add(route_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } else { route_tilde_any(x, gensym("dsp"), 0, 0); } } static void route_tilde_free(t_route_tilde *x) { outlet_free(x->x_sigout); outlet_free(x->x_msgout); } static void *route_tilde_new(void) { t_route_tilde *x = (t_route_tilde *)pd_new(route_tilde_class); x->x_sigout=outlet_new(&x->x_obj, gensym("signal")); x->x_msgout=outlet_new(&x->x_obj, 0); return (x); } void route_tilde_setup(void) { route_tilde_class = class_new(gensym("route~"), (t_newmethod)route_tilde_new, (t_method)route_tilde_free, sizeof(t_route_tilde), 0, A_NULL); class_addanything(route_tilde_class, (t_method)route_tilde_any); class_addmethod(route_tilde_class, nullfn, gensym("signal"), 0); class_addmethod(route_tilde_class, (t_method)route_tilde_dsp, gensym("dsp"), A_CANT, 0); zexy_register("route~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sfplay.c000066400000000000000000000376041265051730400231560ustar00rootroot00000000000000/* * sfplay: multichannel soundfile player (use [readsf~] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* sfplay.c - Author: Winfried Ritsch - IEM Graz 10.Mai 99 - Modified: Description: Soundfile player for playing many soundfiles in single speed. (Made for "3 Farben Schwarz" - exhibition in Graz 99 ) Filename must have the path or actual directory, since pathname search ist not supported to garantuee a fast open call. They idea is a state machine which handles open, skip, play, close, error so that a minimum intervall between OS-calls are made, to avoid peak load. It has shown, that the open call is slow if there are a lot of files to search for, then with the first skip the first part of a soundfile is also loaded by the OS. I experimented with asynchronous buffering with paralell process,which has shown no much performance hit, since more processes has to be handled and the modern OS's do caching anyway also caching is done in modern hard disk, so an additional cache woud be an overhead, if not special behaviour is needed (big jumps etc). This sfplayers should be used with an appropriate audio buffer for good performance, so also buffering on the object is an overhead. The sfread for linux using mmap has also not much improvement over this, if plain playing in one direction is done for random access the sfread should be used, even not knowing how to mmap in NT. Todo: Add the SPEED feature, but therefore there should be an own external using e.g. a 4-point interpolation. so overhead is reduced in this one. Split open to an own object called sfopen to hold more soundfiles then players and to enable glueless switching between soundfiles. please mail problems and ideas for improvements to ritsch@iem.kug.ac.at */ /*#define DEBUG_ME // for debugging messages */ #include "zexy.h" #define DACBLKSIZE 64 /* in m_imp.h, but error if it is included it here*/ #include #include #include /* ------------------------ sfplay ----------------------------- */ #define MAX_CHANS 8 /* channels for soundfiles 1,2,4,8 */ #ifdef __WIN32__ # define BINREADMODE "rb" #else # include # include # define BINREADMODE "r" #endif static t_class *sfplay_class; typedef struct _sfplay { t_object x_obj; t_outlet *bangout; /* end of file */ void* filep; /* pointer to file data read in mem */ t_symbol* filename; /* filename */ /* because there is no command queue, flags are used instead */ t_int play; /* play: 1, stop: 0 */ t_int please_stop; /* can be reset only by stop-state itself */ t_int please_close; /* can be reset only by close-state */ t_int x_channels; /* channels to play */ t_float x_offset; /* offsetto start reading */ t_float offset; /* inlet value offset in secs */ t_float x_skip; /* skip bytes because header */ t_int skip; /* pending skip if 1 */ t_float x_speed; /* play speed, not supported in this version */ t_int size; /* size of file (if memory mapped) */ t_int swap; /* swap bytes from l->b or b->m */ FILE *fp; /* file oper non-NULL of open */ t_int state; /* which state is player in */ t_int count; /* count for ticks before next step */ } t_sfplay; /* states of statemachine */ #define SFPLAY_WAIT 0 /* wait for open */ #define SFPLAY_OPEN 1 #define SFPLAY_CLOSE 2 #define SFPLAY_SKIP 3 #define SFPLAY_PLAY 4 #define SFPLAY_STOP 5 #define SFPLAY_ERROR -1 #define SFPLAY_WAITTICKS 10 /* 1 tick of 64 Samples is ca. 1.5ms on 441000 */ /* split the os-calls in as many steps as possible to split them on different ticks in steps of SFPLAY_WAITTICKS to avoid peak performance */ /* like the one from garray */ static int sfplay_am_i_big_endian(void) { unsigned short s = 1; unsigned char c = *(char *) (&s); return(c==0); } static void sfplay_helper(t_sfplay* UNUSED(x)) { post("\nsfplay :: a soundfile-player (c) winfried ritsch 1999"); post("\ncreation :: sfplay : channels set the number of channels, bytes skip fileheader"); post("\nopen [] []\t::open b(ig) or l(ittle) endian file" "\nclose\t\t\t::close file (aka eject)" "\nstart\t\t\t::start playing" "\nstop\t\t\t::stop playing" "\nrewind\t\t\t::rewind tape" "\ngoto \t\t::play from byte n"); post("\n\nyou can also start playing with a 'bang' or a '1', and stop with a '0'" "\nthe last outlet will do a bang after the last sample has been played"); } /* METHOD: "open" file */ /* this dont use memory map, because I dont know about this on NT ? Use of the buffered functions fopen, fseek fread fclose instead the non buffered ones open read close */ static void sfplay_open(t_sfplay *x,t_symbol *filename,t_symbol *endian) { if(x->state != SFPLAY_WAIT) { post("sfplay: first close %s before open %s",x->filename->s_name, filename->s_name); return; } /* test if big endian else asume little endian should be 'l' but could be anything*/ if(sfplay_am_i_big_endian()) { x->swap = !(endian->s_name[0] == 'b'); } else { x->swap = (endian->s_name[0] == 'b'); } x->skip = 1; /* skip header after open */ x->filename = filename; #ifdef DEBUG_ME post("sfplay: filename = %s",x->filename->s_name); #endif if (x->fp != NULL) { z_fclose(x->fp); /* should not happen */ } if (!(x->fp = z_fopen(x->filename->s_name,BINREADMODE))) { error("sfplay: can't open %s", x->filename->s_name); } } /* METHOD: close */ static void sfplay_close(t_sfplay *x) { x->play = 0; x->please_close = 1; /* now in state machine if(x->fp != NULL) { z_fclose(x->fp); x->fp = NULL; } */ #ifdef DEBUG_ME post("sfplay: close "); #endif return; } /* for skipping header of soundfile Dont use this for memory map */ static int sfplay_skip(t_sfplay *x) { if(!x->skip) { return 0; } x->skip = 0; if(fseek(x->fp, (long) x->x_offset, SEEK_SET) < 0) { error(" sfplay can't seek to byte %ld",(long) x->x_offset); x->x_offset = x->x_skip; x->skip = 1; return 0; } #ifdef DEBUG_ME post("sfplay:skip to %f",x->x_offset); #endif return 1; } /* Input, method for Start stop */ static void sfplay_start(t_sfplay *x) { long of = x->offset * sys_getsr() * x->x_channels; if(of < 0) { of = x->x_skip; } else { of += x->x_skip; /* offset in sec */ } of &= ~0x111l; /* no odds please (8 channels boundary) */ #ifdef DEBUG_ME post("sfplay: start"); #endif /* new offset postion ? (fom inlet offset) */ if( ((t_float) of) != x->x_offset) { x->skip=1; x->x_offset = of; } x->play=1; } static void sfplay_stop(t_sfplay *x) { #ifdef DEBUG_ME post("sfplay: stop"); #endif x->play=0; x->please_stop = 1; } static void sfplay_float(t_sfplay *x, t_floatarg f) { int t = f; if (t) { sfplay_start(x); } else { sfplay_stop(x); } } /* start playing at position offset*/ static void sfplay_offset(t_sfplay *x, t_floatarg f) { x->offset = f; x->skip = 1; /* correction in sfplay_play() */ #ifdef DEBUG_ME post("sfplay: offset %f",f); #endif return; } static void sfplay_rewind(t_sfplay *x) { #ifdef DEBUG_ME post("sfplay: rewind to %f",x->x_skip); #endif if(!x->fp) { return; } x->play=0; fseek(x->fp,(long) x->x_skip,SEEK_SET); } /* restart with bang */ static void sfplay_bang(t_sfplay* x) { x->skip = 1; sfplay_start(x); } static t_int *sfplay_perform(t_int *w) { t_sfplay* x = (t_sfplay*)(w[1]); short* buf = x->filep; int c = x->x_channels; int i,j,n; t_float* out[MAX_CHANS]; short s; int swap = x->swap; for (i=0; istate) { /* just wait */ case SFPLAY_WAIT: if(x->fp != NULL) { #ifdef DEBUG_ME post("wait -> open"); #endif x->state = SFPLAY_OPEN; x->count = SFPLAY_WAITTICKS; }; break; /* if in open state, already opened but wait for skip */ case SFPLAY_OPEN: /* file hase opened wait some time */ if(!(x->count--)) { #ifdef DEBUG_ME post("open -> skip"); #endif x->state = SFPLAY_SKIP; x->count = SFPLAY_WAITTICKS; }; break; /* in skipmode wait until ready for stop */ case SFPLAY_SKIP: if(x->count == SFPLAY_WAITTICKS) { if(!x->fp) { x->state = SFPLAY_CLOSE; x->count=1; #ifdef DEBUG_ME post("skip -> close"); #endif break; } sfplay_skip(x); } if(!(x->count--)) { #ifdef DEBUG_ME post("skip -> stop"); #endif x->state = SFPLAY_STOP; x->count = SFPLAY_WAITTICKS; }; break; case SFPLAY_STOP: /* in stop state mainly waits for play */ x->please_stop = 0; if(x->please_close) { x->state = SFPLAY_CLOSE; x->count = SFPLAY_WAITTICKS; #ifdef DEBUG_ME post("stop -> close"); #endif } else if(x->skip) { x->state = SFPLAY_SKIP; x->count = SFPLAY_WAITTICKS; #ifdef DEBUG_ME post("stop -> skip"); #endif } else if(x->play) { #ifdef DEBUG_ME post("stop -> play"); #endif x->state = SFPLAY_PLAY; } break; case SFPLAY_PLAY: /* yes play now */ if(!x->play || x->please_stop) { /* if closing dont need o go to stop */ if(x->please_close) { x->state = SFPLAY_CLOSE; x->count = SFPLAY_WAITTICKS; #ifdef DEBUG_ME post("play -> close"); #endif } else { x->state = SFPLAY_STOP; #ifdef DEBUG_ME post("play -> stop"); #endif }; break; } /* should never happen */ if(!x->filep) { x->state = SFPLAY_ERROR; error("sfplay: playing but no buffer ???? play"); return (w+4+c); } /* first read soundfile 16 bit*/ if((j=fread(buf,sizeof(short),c*n,x->fp)) < n) { outlet_bang(x->bangout); if(feof(x->fp)) { while (n--) { for (i=0; i 0) { s = *buf++; if(swap) { s = ((s & 0xFF)<< 8) | ((s& 0xFF00) >> 8); } *out[i]++ = s*(1./32768.); } else { *out[i]++ = 0; } } } x->state = SFPLAY_STOP; x->play = 0; return(w+c+4); } /* or error if(ferror()) */ x->state = SFPLAY_ERROR; x->count = SFPLAY_WAITTICKS; #ifdef DEBUG_ME post("play -> read error"); #endif break; }; /* copy 16 Bit to floats and swap if neccesairy */ while (n--) { for (i=0; i> 8); } *out[i]++ = s*(1./32768.); } } return (w+c+4); /* dont zero out outs */ /* ok read error please close */ case SFPLAY_ERROR: if(!(x->count--)) { x->state = SFPLAY_CLOSE; sfplay_close(x); #ifdef DEBUG_ME post("sfplay error reading sf: error -> close"); #endif x->count = SFPLAY_WAITTICKS; } break; /* in close state go to wait afterwards */ case SFPLAY_CLOSE: x->please_close = 0; /* wait until ready for close operation */ if(!(x->count--)) { x->state = SFPLAY_WAIT; x->count = SFPLAY_WAITTICKS; /* avoid openfiles */ if(x->fp) { z_fclose(x->fp); x->fp = NULL; }; #ifdef DEBUG_ME post("sfplay: close -> wait"); #endif } break; }; /*case */ /* zero out outs */ while (n--) { for (i=0; ix_channels) { case 1: dsp_add(sfplay_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, /* out 1 */ sp[0]->s_n); break; case 2: dsp_add(sfplay_perform, 5, x, sp[0]->s_vec, /* out 1*/ sp[1]->s_vec, /* out 2*/ sp[2]->s_vec, sp[0]->s_n); break; case 4: dsp_add(sfplay_perform, 7, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[0]->s_n); break; case 8: dsp_add(sfplay_perform, 11, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[5]->s_vec, sp[6]->s_vec, sp[7]->s_vec, sp[8]->s_vec, sp[0]->s_n); break; } } /* create sfplay with args */ static void *sfplay_new(t_floatarg chan,t_floatarg skip) { t_sfplay *x = (t_sfplay *)pd_new(sfplay_class); t_int c = chan; switch(c) { /* ok */ case 1: case 2: case 4: case 8: break; /* try it, good luck ... */ case 3: c = 2; break; case 5: case 6: case 7: c=7; break; default: c=1; break; } floatinlet_new(&x->x_obj, &x->offset); /* inlet 2 */ /* floatinlet_new(&x->x_obj, &x->speed); *//* inlet 3 */ x->x_channels = c; x->x_skip = x->x_offset = skip; x->offset = 0.; x->skip = 1; x->x_speed = 1.0; x->play = 0; x->please_stop = 0; x->please_close = 0; x->state = SFPLAY_WAIT; x->count = 0; x->filename = NULL; x->fp = NULL; x->swap = 1; while (c--) { outlet_new(&x->x_obj, gensym("signal")); /* channels outlet */ } x->bangout = outlet_new(&x->x_obj, gensym("bang")); x->filep = t_getbytes(DACBLKSIZE*sizeof(short)*x->x_channels); #ifdef DEBUG_ME post("get_bytes DACBLKSIZE*%d*%d->%ld",sizeof(short),x->x_channels, x->filep); post("sfplay: x_channels = %d, x_speed = %f, x_skip = %f",x->x_channels, x->x_speed,x->x_skip); #endif return (x); } static void sfplay_free(t_sfplay *x) { freebytes(x->filep, DACBLKSIZE*sizeof(short)*x->x_channels); } 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); class_addmethod(sfplay_class, nullfn, gensym("signal"), 0); class_addmethod(sfplay_class, (t_method)sfplay_dsp, gensym("dsp"), 0); class_addmethod(sfplay_class, (t_method)sfplay_helper, gensym("help"), A_NULL); class_sethelpsymbol(sfplay_class, gensym("sf-play_record")); /* method open with filename */ class_addmethod(sfplay_class, (t_method)sfplay_open, gensym("open"), A_SYMBOL,A_SYMBOL,A_NULL); class_addmethod(sfplay_class, (t_method)sfplay_close, gensym("close"), A_NULL); class_addmethod(sfplay_class, (t_method)sfplay_start, gensym("start"), A_NULL); class_addmethod(sfplay_class, (t_method)sfplay_stop, gensym("stop"), A_NULL); class_addmethod(sfplay_class, (t_method)sfplay_rewind, gensym("rewind"), A_NULL); class_addmethod(sfplay_class, (t_method)sfplay_offset, gensym("goto"), A_DEFFLOAT, A_NULL); /* start stop with 0 and 1 */ class_addfloat(sfplay_class, sfplay_float); /* start with bang */ class_addbang(sfplay_class,sfplay_bang); zexy_register("sfplay"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sfrecord.c000066400000000000000000000344201265051730400234600ustar00rootroot00000000000000/* * sfrecord: multichannel soundfile recorder (try [writesf~] instead) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* sfplay.c - Author: Winfried Ritsch - IEM Graz 10.Mai 99 - Modified: sfrecord.c - hacked from sfplay ::: 2308:forum::für::umläute:1999 @ iem please mail problems and ideas for improvements to ritsch@iem.kug.ac.at zmoelnig@iem.kug.ac.at */ /* TODO: deprecate this in favour of [writesf~] */ /* #define DEBUG_ME for debugging messages */ #include "zexy.h" /* #include "m_imp.h" */ #define DACBLKSIZE 64 /* in m_imp.h, but error if it is included it here*/ #include #include #include /* ------------------------ sfrecord ----------------------------- */ #define MAX_CHANS 8 /* channels for soundfiles 1,2,4,8 */ #ifdef __WIN32__ # define BINWRITEMODE "wb" #else # include # include # define BINWRITEMODE "w" #endif static t_class *sfrecord_class; typedef struct _sfrecord { t_object x_obj; void* filep; /* pointer to file data read in mem */ t_symbol* filename; /* filename */ /* because there is no command queue, flags are used instead */ t_int write; /* write: 1, stop: 0 */ t_int please_stop; /* can be reset only by stop-state itself */ t_int please_close; /* can be reset only by close-state */ t_int x_channels; /* channels to write */ t_float x_offset; /* offset to start writing */ t_float offset; /* inlet value offset in secs */ t_float x_skip; /* skip bytes because header */ t_int skip; /* pending skip if 1 */ t_float x_speed; /* write speed, not supported in this version */ t_int size; /* size of file (if memory mapped) */ t_int swap; /* swap bytes from l->b or b->m */ FILE *fp; /* file oper non-NULL of open */ t_int state; /* which state is writer in */ t_int count; /* count for ticks before next step */ } t_sfrecord; /* states of statemachine */ #define SFRECORD_WAIT 0 /* wait for open */ #define SFRECORD_OPEN 1 #define SFRECORD_CLOSE 2 #define SFRECORD_SKIP 3 #define SFRECORD_WRITE 4 #define SFRECORD_STOP 5 #define SFRECORD_ERROR -1 #define SFRECORD_WAITTICKS 10 /* 1 tick of 64 Samples is ca.1.5ms on 441000 */ /* split the os-calls in as many steps as possible to split them on different ticks in steps of SFRECORD_WAITTICKS to avoid peak performance */ /* like the one from garray */ static int sfrecord_am_i_big_endian(void) { unsigned short s = 1; unsigned char c = *(char *) (&s); #ifdef DEBUG_ME post("i am %s-endian", c?"little":"big"); #endif return(c==0); } static void state_out(t_sfrecord *x, int state) { /* outlet the actual state */ outlet_float(x->x_obj.ob_outlet, state); } /* METHOD: "open" file */ /* this dont use memory map, because I dont know about this on NT ? Use of the buffered functions fopen, fseek fread fclose instead the non buffered ones open read close */ static void sfrecord_open(t_sfrecord *x,t_symbol *filename, t_symbol *endian) { if(x->state != SFRECORD_WAIT) { post("sfrecord: first close %s before open %s",x->filename->s_name, filename->s_name); return; } /* test if big endian else asume little endian * should be 'l' but could be anything */ if(sfrecord_am_i_big_endian()) { x->swap = !(endian->s_name[0] == 'b'); } else { x->swap = (endian->s_name[0] == 'b'); } /* * skip header after open;; sometimes weŽll have to write a header using the x->skip; so donŽt delete it completely */ /* x->skip = 1; */ x->filename = filename; #ifdef DEBUG_ME post("sfrecord: opening %s",x->filename->s_name); #endif if (x->fp != NULL) { z_fclose(x->fp); /* should not happen */ } if (!(x->fp = z_fopen(x->filename->s_name,BINWRITEMODE))) { error("sfrecord: can't open %s", x->filename->s_name); } } /* METHOD: close */ static void sfrecord_close(t_sfrecord *x) { x->write = 0; x->please_close = 1; /* now in state machine if(x->fp != NULL) { z_fclose(x->fp); x->fp = NULL; } */ #ifdef DEBUG_ME post("sfrecord: closing "); #endif return; } /* for skipping header of soundfile DonŽt use this for memory map */ static int sfrecord_skip(t_sfrecord *x) { if(!x->skip) { return 0; } #ifdef DEBUG_ME post("sfrecord:skip to %f",x->x_skip); #endif x->skip = 0; return 1; } /* Input, method for Start stop */ static void sfrecord_start(t_sfrecord *x) { #ifdef DEBUG_ME post("sfrecord: start at %d", x->x_offset); #endif state_out(x, 1); x->write=1; } static void sfrecord_stop(t_sfrecord *x) { #ifdef DEBUG_ME post("sfrecord: stop"); #endif state_out(x, 0); x->write=0; x->please_stop = 1; } static void sfrecord_float(t_sfrecord *x, t_floatarg f) { int t = f; if (t) { sfrecord_start(x); } else { sfrecord_stop(x); } } /* say what state weŽre in */ static void sfrecord_bang(t_sfrecord* x) { if (x->state == SFRECORD_WRITE) { state_out(x, 1); } else { state_out(x, 0); } } /* ******************************************************************************** */ /* the work krow eht */ /* ******************************************************************************** */ static t_int *sfrecord_perform(t_int *w) { t_sfrecord* x = (t_sfrecord*)(w[1]); short* buf = x->filep; short* bufstart = buf; int c = x->x_channels; int i,j,n, s_n; t_float* in[MAX_CHANS]; short s; int swap = x->swap; for (i=0; istate) { /* just wait */ case SFRECORD_WAIT: if(x->fp != NULL) { #ifdef DEBUG_ME post("wait -> open"); #endif x->state = SFRECORD_OPEN; x->count = SFRECORD_WAITTICKS; }; break; /* if in open state, already opened but wait for skip */ case SFRECORD_OPEN: /* file has opened wait some time */ if(!(x->count--)) { #ifdef DEBUG_ME post("open -> skip"); #endif x->state = SFRECORD_SKIP; x->count = SFRECORD_WAITTICKS; }; break; /* in skipmode wait until ready for stop */ case SFRECORD_SKIP: if(x->count == SFRECORD_WAITTICKS) { if(!x->fp) { x->state = SFRECORD_CLOSE; x->count=1; #ifdef DEBUG_ME post("skip -> close"); #endif break; } sfrecord_skip(x); } if(!(x->count--)) { #ifdef DEBUG_ME post("skip -> stop"); #endif x->state = SFRECORD_STOP; x->count = SFRECORD_WAITTICKS; }; break; case SFRECORD_STOP: /* in stop state mainly waits for write */ x->please_stop = 0; if(x->please_close) { x->state = SFRECORD_CLOSE; x->count = SFRECORD_WAITTICKS; #ifdef DEBUG_ME post("stop -> close"); #endif } else if(x->skip) { x->state = SFRECORD_SKIP; x->count = SFRECORD_WAITTICKS; #ifdef DEBUG_ME post("stop -> skip"); #endif } else if(x->write) { #ifdef DEBUG_ME post("stop -> write"); #endif x->state = SFRECORD_WRITE; state_out(x, 1); } break; case SFRECORD_WRITE: /* yes write now */ if(!x->write || x->please_stop) { /* if closing dont need to go to stop */ if(x->please_close) { x->state = SFRECORD_CLOSE; x->count = SFRECORD_WAITTICKS; #ifdef DEBUG_ME post("write -> close"); #endif state_out(x, 0); } else { x->state = SFRECORD_STOP; #ifdef DEBUG_ME post("write -> stop"); #endif }; break; } /* should never happen */ if(!x->filep) { x->state = SFRECORD_ERROR; error("sfrecord: writing but no buffer ???? write"); return (w+4+c); } /* copy float to 16 Bit and swap if neccesairy */ /* LATER treat overflows */ while (n--) { for (i=0; i> 8); } *buf++ = s; } } /* then write soundfile 16 bit*/ if ( (j = fwrite(bufstart, sizeof(short), c*s_n, x->fp)) < 1) { x->state = SFRECORD_ERROR; x->count = SFRECORD_WAITTICKS; #ifdef DEBUG_ME post("write -> write error\t %xd\t%xd\t%d\t%d", x->filep, buf, c*s_n*sizeof(short), j); #endif break; } #if 0 if((j=fwrite(buf,sizeof(short),c*n,x->fp)) < (unsigned int) n) { if(feof(x->fp)) { while (n--) { for (i=0; i 0) { s = *buf++; if(swap) { s = ((s & 0xFF)<< 8) | ((s& 0xFF00) >> 8); } *out[i]++ = s*(1./32768.); } else { *out[i]++ = 0; } } } } x->state = SFRECORD_STOP; x->write = 0; return(w+c+3); } /* or error if(ferror()) */ x->state = SFRECORD_ERROR; x->count = SFRECORD_WAITTICKS; #ifdef DEBUG_ME post("write -> write error"); #endif break; }; #endif /* 0 */ return (w+c+3); /* writing was fine */ /* ok :?: write error, please close */ case SFRECORD_ERROR: if(!(x->count--)) { x->state = SFRECORD_CLOSE; sfrecord_close(x); #ifdef DEBUG_ME post("sfrecord error writing sf: error -> close"); #endif x->count = SFRECORD_WAITTICKS; } break; /* in close state go to wait afterwards */ case SFRECORD_CLOSE: x->please_close = 0; /* wait until ready for close operation */ if(!(x->count--)) { x->state = SFRECORD_WAIT; x->count = SFRECORD_WAITTICKS; /* avoid openfiles */ if(x->fp) { z_fclose(x->fp); x->fp = NULL; }; #ifdef DEBUG_ME post("sfrecord: close -> wait"); #endif } break; }; /*case */ return(w+c+3); } /* ---------------------- Setup junk -------------------------- */ static void sfrecord_dsp(t_sfrecord *x, t_signal **sp) { #ifdef DEBUG_ME post("sfrecord: dsp"); post("offset = %f\tspeed = %f\t", x->offset, x->x_speed); #endif switch (x->x_channels) { case 1: dsp_add(sfrecord_perform, 3, x, sp[0]->s_vec, /* in 1 */ sp[0]->s_n); break; case 2: dsp_add(sfrecord_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); break; case 4: dsp_add(sfrecord_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); break; case 8: dsp_add(sfrecord_perform, 9, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[5]->s_vec, sp[6]->s_vec, sp[7]->s_vec, sp[0]->s_n); break; } } /* create sfrecord with args */ static void *sfrecord_new(t_floatarg chan) { t_sfrecord *x = (t_sfrecord *)pd_new(sfrecord_class); t_int c = chan; switch(c) { /* ok */ case 1: case 2: case 4: case 8: break; /* try it, good luck ... */ case 3: c = 2; break; case 5: case 6: case 7: c=7; break; default: c=1; break; } outlet_new(&x->x_obj, gensym("float")); x->x_channels = c; x->x_skip = x->x_offset = 0; x->skip = 1; x->offset = 0.; x->x_speed = 1.0; x->write = 0; x->please_stop = 0; x->please_close = 0; x->state = SFRECORD_WAIT; x->count = 0; x->filename = NULL; x->fp = NULL; x->swap = 1; c--; while (c--) { #ifdef DEBUG_ME post("create extra channel #%d", c); #endif inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); /* channels inlet */ } x->filep = t_getbytes(DACBLKSIZE*sizeof(short)*x->x_channels); #ifdef DEBUG_ME post("get_bytes DACBLKSIZE*%d*%d->%ld",sizeof(short),x->x_channels, x->filep); post("sfrecord: x_channels = %d, x_speed = %f, x_skip = %f",x->x_channels, x->x_speed,x->x_skip); #endif return (x); } static void sfrecord_helper(void) { post("\nsfplay :: a raw-data soundfile-recorder"); post("\ncreation :: sfrecord \t: channels set the number of channels"); post("\nopen [] []\t:: open b(ig) or l(ittle) endian file" "\nclose\t\t\t:: close file (aka eject)" "\nstart\t\t\t:: start playing" "\nstop\t\t\t:: stop playing" "\nbang\t\t\t:: outputs the current state (1_recording, 0_not-recording)"); post("\n\nyou can also start recording with a '1', and stop with a '0'"); } static void sfrecord_free(t_sfrecord *x) { freebytes(x->filep, DACBLKSIZE*sizeof(short)*x->x_channels); } 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); class_addmethod(sfrecord_class, nullfn, gensym("signal"), 0); class_addmethod(sfrecord_class, (t_method)sfrecord_dsp, gensym("dsp"), 0); /* method open with filename */ class_addmethod(sfrecord_class, (t_method)sfrecord_open, gensym("open"), A_SYMBOL,A_SYMBOL,A_NULL); class_addmethod(sfrecord_class, (t_method)sfrecord_close, gensym("close"), A_NULL); class_addmethod(sfrecord_class, (t_method)sfrecord_start, gensym("start"), A_NULL); class_addmethod(sfrecord_class, (t_method)sfrecord_stop, gensym("stop"), A_NULL); /* start/stop with 0/1 */ class_addfloat(sfrecord_class, sfrecord_float); /* bang out the current-state to the outlet*/ class_addbang(sfrecord_class,sfrecord_bang); /* some help */ class_addmethod(sfrecord_class, (t_method)sfrecord_helper, gensym("help"), A_NULL); class_sethelpsymbol(sfrecord_class, gensym("sf-play_record")); zexy_register("sfrecord"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sgn~.c000066400000000000000000000116011265051730400226320ustar00rootroot00000000000000/* * sgn~: sign of a signal * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexySIMD.h" typedef struct _sgnTilde { t_object x_obj; } t_sgnTilde; /* ------------------------ sgn~ ----------------------------- */ static t_class *sgnTilde_class; static t_int *sgnTilde_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); t_sample x; while (n--) { x=*in++; if (x>0.) { *out++=1.; } else if (x<0.) { *out++=-1.; } else { *out++=0.; } } return (w+4); } static t_int *sgnTilde_perform8(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3])>>3; t_sample x; while(n--) { /* weirdly enough, the if/else/if/else is a lot faster than ()?:(()?:) */ if ((x=in[0])>0.) { out[0]=1.; } else if(x<0.) { out[0]=-1.; } else { out[0]=0.; } if ((x=in[1])>0.) { out[1]=1.; } else if(x<0.) { out[1]=-1.; } else { out[1]=0.; } if ((x=in[2])>0.) { out[2]=1.; } else if(x<0.) { out[2]=-1.; } else { out[2]=0.; } if ((x=in[3])>0.) { out[3]=1.; } else if(x<0.) { out[3]=-1.; } else { out[3]=0.; } if ((x=in[4])>0.) { out[4]=1.; } else if(x<0.) { out[4]=-1.; } else { out[4]=0.; } if ((x=in[5])>0.) { out[5]=1.; } else if(x<0.) { out[5]=-1.; } else { out[5]=0.; } if ((x=in[6])>0.) { out[6]=1.; } else if(x<0.) { out[6]=-1.; } else { out[6]=0.; } if ((x=in[7])>0.) { out[7]=1.; } else if(x<0.) { out[7]=-1.; } else { out[7]=0.; } in+=8; out+=8; } return (w+4); } #ifdef __SSE__ static int l_bitmask[]= {0x80000000, 0x80000000, 0x80000000, 0x80000000}; /* sign bitmask */ static t_int *sgnTilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[2]); __m128 val; int n = (int)(w[3])>>3; /* we do 8x loop-unrolling */ const __m128 sgnmask= _mm_loadu_ps((float*)l_bitmask); const __m128 zero = _mm_setzero_ps(); const __m128 one = _mm_set_ps(1.f, 1.f, 1.f, 1.f); __m128 xmm0, xmm1; while (n--) { val=in[0]; xmm0 = _mm_cmpneq_ps(val , zero);/* mask for non-zeros */ xmm1 = _mm_and_ps (val, sgnmask);/* sign (without value) */ xmm0 = _mm_and_ps (xmm0, one); /* (abs) value: (val==0.f)?0.f:1.f */ out[0]= _mm_or_ps (xmm1, xmm0);/* merge sign and value */ val=in[1]; xmm0 = _mm_cmpneq_ps(val , zero); xmm1 = _mm_and_ps (val, sgnmask); xmm0 = _mm_and_ps (xmm0, one); out[1]= _mm_or_ps (xmm1, xmm0); in +=2; out+=2; } return (w+4); } #endif /* __SSE__ */ static void sgnTilde_dsp(t_sgnTilde *x, t_signal **sp) { #ifdef __SSE__ if( Z_SIMD_CHKBLOCKSIZE(sp[0]->s_n) && Z_SIMD_CHKALIGN(sp[0]->s_vec) && Z_SIMD_CHKALIGN(sp[1]->s_vec) && ZEXY_TYPE_EQUAL(t_sample, float) && /* currently SSE2 code is only for float (not for double) */ zexy_testSSE(sgnTilde_perform, sgnTilde_performSSE, 1,1) ) { dsp_add(sgnTilde_performSSE, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } else #endif if (sp[0]->s_n & 7) { dsp_add(sgnTilde_perform , 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } else { dsp_add(sgnTilde_perform8, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } } static void sgnTilde_helper(void) { post("\n"HEARTSYMBOL " sgn~ \t\t:: sign of a signal"); } static void *sgnTilde_new(void) { t_sgnTilde *x = (t_sgnTilde *)pd_new(sgnTilde_class); outlet_new(&x->x_obj, gensym("signal")); return (x); } void sgn_tilde_setup(void) { sgnTilde_class = class_new(gensym("sgn~"), (t_newmethod)sgnTilde_new, 0, sizeof(t_sgnTilde), 0, A_DEFFLOAT, 0); class_addmethod(sgnTilde_class, nullfn, gensym("signal"), 0); class_addmethod(sgnTilde_class, (t_method)sgnTilde_dsp, gensym("dsp"), 0); class_addmethod(sgnTilde_class, (t_method)sgnTilde_helper, gensym("help"), 0); class_sethelpsymbol(sgnTilde_class, gensym("zigbinops")); zexy_register("sgn~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sigzero~.c000066400000000000000000000060541265051730400235330ustar00rootroot00000000000000/* * sigzero~: detect whether an entire signal vector is 0 * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* ------------------------ sigzero~ ----------------------------- */ /* a very useful function, which detects, whether a signal is zeroes-only this block or not this is really great together with the "switch~"-object */ #include "zexy.h" static t_class *sigzero_class; typedef struct _sigzero { t_object x_obj; int activate; int current; /* 0 == (signalblock == 0); 1==(signalblock != 0) */ } t_sigzero; static void sigzero_activate(t_sigzero *x, t_floatarg activate) { x->activate = (activate)?1:0; } static void sigzero_banged(t_sigzero *x) { x->activate = 1; } static void sigzero_off(t_sigzero *x) { x->activate = 0; } static t_int *sigzero_perform(t_int *w) { t_sample *in = (t_sample *)w[1]; t_sigzero *x = (t_sigzero *)w[2]; int n = (int)w[3]; int non_zero = 0; if (x->activate) { while (n--) { if (*in++ != 0.) { non_zero = 1; break; } } if (non_zero != x->current) { outlet_float(x->x_obj.ob_outlet, x->current = non_zero); } } return (w+4); } static void sigzero_dsp(t_sigzero *x, t_signal **sp) { dsp_add(sigzero_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); } static void sigzero_tilde_helper(void) { post("\n"HEARTSYMBOL " sigzero~-object :: for detecting whether a signal is currently zero or not"); post("'bang'\t: turn the detector on\n" "'off'\t: turn it off\n" "<1/0>\t: turn it on/off\n" "'help'\t: view this\n" "signal~"); post("outlet :: 1/0\t: signal turned to non-zero/zero\n"); } static void *sigzero_new(void) { t_sigzero *x = (t_sigzero *)pd_new(sigzero_class); outlet_new(&x->x_obj, gensym("float")); return (x); } void sigzero_tilde_setup(void) { sigzero_class = class_new(gensym("sigzero~"), (t_newmethod)sigzero_new, 0, sizeof(t_sigzero), 0, 0); class_addfloat(sigzero_class, sigzero_activate); class_addbang(sigzero_class, sigzero_banged); class_addmethod(sigzero_class, (t_method)sigzero_off, gensym("off"), 0); class_addmethod(sigzero_class, nullfn, gensym("signal"), 0); class_addmethod(sigzero_class, (t_method)sigzero_dsp, gensym("dsp"), 0); class_addmethod(sigzero_class, (t_method)sigzero_tilde_helper, gensym("help"), 0); zexy_register("sigzero~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sleepgrain.c000066400000000000000000000036761265051730400240130ustar00rootroot00000000000000/* * sleepgrain : get (and set?) the sleepgrain of Pd * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" EXTERN int* get_sys_sleepgrain(void ) ; /* ------------------------- sleepgrain ------------------------------- */ static t_class *sleepgrain_class; typedef struct _sleepgrain { t_object x_obj; } t_sleepgrain; static void sleepgrain_bang(t_sleepgrain *x) { int*current=get_sys_sleepgrain(); t_float f=*current; outlet_float(x->x_obj.ob_outlet, f); } static void sleepgrain_float(t_sleepgrain *x, t_float f) { int value=(int)f; int*current=get_sys_sleepgrain(); if(value<=0) { pd_error(x, "[sleepgrain]: sleepgrain cannot be <= 0"); return; } *current=value; // outlet_float(x->x_obj.ob_outlet, f); } static void *sleepgrain_new(void) { t_sleepgrain *x = (t_sleepgrain *)pd_new(sleepgrain_class); outlet_new(&x->x_obj, 0); return (x); } void sleepgrain_setup(void) { sleepgrain_class = class_new(gensym("sleepgrain"), (t_newmethod)sleepgrain_new, 0, sizeof(t_sleepgrain), 0, A_NULL); class_addbang (sleepgrain_class, sleepgrain_bang); class_addfloat (sleepgrain_class, sleepgrain_float); zexy_register("sleepgrain"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sort.c000066400000000000000000000075571265051730400226530ustar00rootroot00000000000000/* * sort : sort a list of floats * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------- sort ------------------------------- */ /* SHELL SORT: simple and easy */ static t_class *sort_class; typedef struct _sort { t_object x_obj; int bufsize; t_float *buffer; t_int *indices; int ascending; t_outlet*indexOut, *sortedOut; } t_sort; static void sort_dir(t_sort *x, t_float f) { x->ascending = (f < 0.f)?0:1; } static void sort_buffer(t_sort *x, int argc, t_atom *argv) { int n = argc; t_float *buf; t_atom *atombuf = argv; if (argc != x->bufsize) { if (x->buffer) { freebytes(x->buffer, x->bufsize * sizeof(t_float)); } if (x->indices) { freebytes(x->indices, x->bufsize * sizeof(t_int)); } x->bufsize = argc; x->buffer = getbytes(x->bufsize * sizeof(t_float)); x->indices = getbytes(x->bufsize * sizeof(t_int)); } buf = x->buffer; while (n--) { *buf++ = atom_getfloat(atombuf++); x->indices[n] = n; } } static void sort_list(t_sort *x, t_symbol *s, int argc, t_atom *argv) { int step = argc, n; t_atom *atombuf = (t_atom *)getbytes(sizeof(t_atom) * argc); t_float *buf; t_int *idx; int i, loops = 1; sort_buffer(x, argc, argv); buf = x->buffer; idx = x->indices; while (step > 1) { step = (step % 2)?(step+1)/2:step/2; i = loops; loops += 2; while(i--) { /* there might be some optimization in here */ for (n=0; n<(argc-step); n++) { if (buf[n] > buf[n+step]) { t_int i_tmp = idx[n]; t_float f_tmp = buf[n]; buf[n] = buf[n+step]; buf[n+step] = f_tmp; idx[n] = idx[n+step]; idx[n+step] = i_tmp; } } } } if (x->ascending) for (n = 0; n < argc; n++) { SETFLOAT(&atombuf[n], idx[n]); } else for (n = 0, i=argc-1; n < argc; n++, i--) { SETFLOAT(&atombuf[n], idx[i]); } outlet_list(x->indexOut , gensym("list"), n, atombuf); if (x->ascending) for (n = 0; n < argc; n++) { SETFLOAT(&atombuf[n], buf[n]); } else for (n = 0, i=argc-1; n < argc; n++, i--) { SETFLOAT(&atombuf[n], buf[i]); } outlet_list(x->sortedOut, gensym("list"), n, atombuf); freebytes(atombuf, argc*sizeof(t_atom)); } static void *sort_new(t_floatarg f) { t_sort *x = (t_sort *)pd_new(sort_class); x->ascending = (f < 0.f)?0:1; x->sortedOut=outlet_new(&x->x_obj, gensym("list")); x->indexOut=outlet_new(&x->x_obj, gensym("list")); x->bufsize = 0; x->buffer = NULL; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("direction")); return (x); } static void sort_help(t_sort*x) { post("\n"HEARTSYMBOL " sort\t\t:: sort a list of numbers"); } void sort_setup(void) { sort_class = class_new(gensym("sort"), (t_newmethod)sort_new, 0, sizeof(t_sort), 0, A_DEFFLOAT, 0); class_addlist (sort_class, sort_list); class_addmethod (sort_class, (t_method)sort_dir, gensym("direction"), A_DEFFLOAT, 0); class_addmethod(sort_class, (t_method)sort_help, gensym("help"), A_NULL); zexy_register("sort"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/step~.c000066400000000000000000000076511265051730400230300ustar00rootroot00000000000000/* * step~: unity step function * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* 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" /* ------------------------ step~ ----------------------------- */ static t_class *step_class; typedef struct _step { t_object x_obj; int position; int length; int toggle; int wait4start; int wait4stop; } t_step; static void step_bang(t_step *x) { x->wait4stop = x->length + (x->wait4start = x->position); } static void step_float(t_step *x, t_float where) { x->wait4stop = x->length + (x->wait4start = (x->position = (where>0)*where) ); } static void step_setlength(t_step *x, t_float arg) { x->length = 1 + (arg>0)*arg; } static t_int *step_perform(t_int *w) { t_step *x = (t_step *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); int toggle = x->toggle; int wait4start = x->wait4start, wait4stop = x->wait4stop; while (n--) { wait4stop--; if (!wait4start--) { toggle ^= 1; } else if (!wait4stop) { toggle ^= 1; } *out++ = toggle; } x->wait4start = wait4start; x->wait4stop = wait4stop; x->toggle = toggle; return (w+4); } static void step_dsp(t_step *x, t_signal **sp) { dsp_add(step_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); } static void step_helper(void) { post(""HEARTSYMBOL " step~-object :: generates a unity-step"); post("creation : \"dirac~ [ []]\" : create a rectangular window\n" "\t\t\tat specified position and with specified length (in samples)\n" "inlet1\t: \t: create a rectangular window at new position\n" "\t 'bang'\t: create a rectangular window at specified position\n" "\t 'help'\t: view this\n" "inlet2\t: \t: define new window length ('0' will make a unity-step)\n" "outlet\t: signal~"); } static void *step_new(t_floatarg farg) { t_step *x = (t_step *)pd_new(step_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1")); outlet_new(&x->x_obj, gensym("signal")); x->position = 0; x->wait4start = x->wait4stop = 0; x->toggle = 1; step_setlength(x, farg); return (x); } void step_tilde_setup(void) { step_class = class_new(gensym("step~"), (t_newmethod)step_new, 0, sizeof(t_step), 0, A_DEFFLOAT, 0); class_addfloat(step_class, step_float); class_addbang(step_class, step_bang); class_addmethod(step_class, (t_method)step_setlength, gensym("ft1"), A_FLOAT, 0); class_addmethod(step_class, (t_method)step_dsp, gensym("dsp"), 0); class_addmethod(step_class, (t_method)step_helper, gensym("help"), 0); zexy_register("step~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/strcmp.c000066400000000000000000000107751265051730400231700ustar00rootroot00000000000000/* * strcmp : compare 2 lists as if they were strings * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include #include /* ------------------------- strcmp ------------------------------- */ /* compare 2 lists ( == for lists) */ static t_class *strcmp_class; static t_class *strcmp_proxy_class; typedef struct _strcmp { t_object x_obj; struct _strcmp_proxy *x_proxy; t_binbuf *bbuf1, *bbuf2; char *str1, *str2; int n1, n2; } t_strcmp; typedef struct _strcmp_proxy { t_pd p_pd; t_strcmp *p_master; t_inlet *p_in; } t_strcmp_proxy; static void strcmp_bang(t_strcmp *x) { int result = 0; if(x->str1) { if(x->str2) { result = strcmp(x->str1, x->str2); } else { result = *x->str1; } } else { if(x->str2) { result = -*x->str2; } else { result = 0; } } outlet_float(x->x_obj.ob_outlet, result); } static void list2binbuf(t_binbuf**bbuf, int *n, char**str, int argc, t_atom*argv) { int i=0; char*s=0; if(*str&&*n) { freebytes(*str, *n); } binbuf_clear(*bbuf); binbuf_add(*bbuf, argc, argv); binbuf_gettext(*bbuf, str, n); i=*n; s=*str; if(' '==s[i]) { s[i]=0; } } static void strcmp_list(t_strcmp *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { list2binbuf(&x->bbuf1, &x->n1, &x->str1, argc, argv); strcmp_bang(x); } static void strcmp_symbol(t_strcmp *x, t_symbol *s) { if(x->str1&&x->n1) { freebytes(x->str1, x->n1); } x->n1=0; x->str1=s->s_name; strcmp_bang(x); } static void strcmp_secondlist(t_strcmp *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { list2binbuf(&x->bbuf2, &x->n2, &x->str2, argc, argv); } static void strcmp_secondsymbol(t_strcmp *x, t_symbol *s) { if(x->str2&&x->n2) { freebytes(x->str2, x->n2); } x->n2=0; x->str2=s->s_name; } static void strcmp_proxy_list(t_strcmp_proxy *y, t_symbol *s, int argc, t_atom *argv) { strcmp_secondlist(y->p_master, s, argc, argv); } static void strcmp_proxy_symbol(t_strcmp_proxy *y, t_symbol *s) { if(s) { strcmp_secondsymbol(y->p_master, s); } } static void *strcmp_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_strcmp *x = (t_strcmp *)pd_new(strcmp_class); x->x_proxy=(t_strcmp_proxy*)pd_new(strcmp_proxy_class); x->x_proxy->p_master = x; x->x_proxy->p_in = inlet_new ((t_object*)x, (t_pd*)x->x_proxy, 0,0); outlet_new(&x->x_obj, 0); x->bbuf1 = binbuf_new(); x->bbuf2 = binbuf_new(); x->str1=0; x->str2=0; x->n1=0; x->n2=0; if(argc) { strcmp_secondlist(x, gensym("list"), argc, argv); } return (x); } static void strcmp_free(t_strcmp *x) { binbuf_free(x->bbuf1); binbuf_free(x->bbuf2); if(x->str1&&x->n1) { freebytes(x->str1, x->n1); } if(x->str2&&x->n2) { freebytes(x->str2, x->n2); } inlet_free(x->x_proxy->p_in); x->x_proxy->p_master=0; pd_free(&x->x_proxy->p_pd); } static void strcmp_help(t_strcmp*x) { post("\n"HEARTSYMBOL " strcmp\t\t:: compare to lists as strings"); } 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_addsymbol (strcmp_class, strcmp_symbol); class_addlist (strcmp_class, strcmp_list); strcmp_proxy_class = class_new(gensym("strcmp proxy"), 0, 0, sizeof(t_strcmp_proxy), CLASS_PD | CLASS_NOINLET, 0); class_addsymbol(strcmp_proxy_class, strcmp_proxy_symbol); class_addlist(strcmp_proxy_class, strcmp_proxy_list); class_addmethod(strcmp_class, (t_method)strcmp_help, gensym("help"), A_NULL); zexy_register("strcmp"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/strip_objects000077500000000000000000000003701265051730400243020ustar00rootroot00000000000000#!/bin/sh TMPFILE=/tmp/pdobjects touch $TMPFILE rm $TMPFILE grep --no-filename class_new *.c | awk '{print $3}' >> $TMPFILE for i in `cat $TMPFILE`; do i=${i##class_new(gensym(\"}; i=${i%%\"),}; echo $i ; done | sort -u touch $TMPFILE rm $TMPFILE zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/sum.c000066400000000000000000000031171265051730400224540ustar00rootroot00000000000000/* * sum :: the sum of a list of floats * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *sum_class; typedef struct _sum { t_object x_obj; } t_sum; static void sum_list(t_sum *x, t_symbol* UNUSED(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); zexy_register("sum"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/swap~.c000066400000000000000000000054141265051730400230220ustar00rootroot00000000000000/* * swap~: byteswap a 16bit signal * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* 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_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(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"HEARTSYMBOL " swap~-object for byteswapping a signal"); 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(void) { 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_NULL); 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); zexy_register("swap~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/symbol2list.c000066400000000000000000000114331265051730400241330ustar00rootroot00000000000000/* * symbol2list: convert a symbol into a list (with given delimiters) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" #include #include /* ------------------------- 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; ftest=strtod(buffer, endptr); /* what should we do with the special cases of hexadecimal values, "INF" and "NAN" ??? * strtod() parses them to numeric values: * symbol "hallo 0x12" will become "list hallo 18" * do we want this ?? */ if (buffer+clen!=*endptr) { /* 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==gensym("")) { i=strlen(cc); if(x->argnumargv, 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->argnumargv, 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) { if(!(x->s) || x->s==gensym("")) { outlet_bang(x->x_obj.ob_outlet); return; } 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* UNUSED(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_help(t_symbol2list*x) { post("\n"HEARTSYMBOL " symbol2list\t:: split a symbol into a list of atoms"); } 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_addmethod(symbol2list_class, (t_method)symbol2list_help, gensym("help"), A_NULL); zexy_register("symbol2list"); } void s2l_setup(void) { symbol2list_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/tabdump.c000066400000000000000000000065041265051730400233070ustar00rootroot00000000000000/* * tabdump: get the content of a table as a list of floats * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #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; zarray_t *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); } else if (!zarray_getarray(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(stopnpoints) { stop=npoints; } npoints=stop-start; atombuf = (t_atom *)getbytes(sizeof(t_atom)*npoints); for (n = 0; n < npoints; n++) { SETFLOAT(&atombuf[n], zarray_getfloat(vec, start+n)); } outlet_list(x->x_obj.ob_outlet, gensym("list"), npoints, atombuf); freebytes(atombuf,sizeof(t_atom)*npoints); } } static void tabdump_list(t_tabdump *x, t_symbol* UNUSED(s),int argc, t_atom*argv) { int a,b; switch(argc) { case 2: a=atom_getint(argv); b=atom_getint(argv+1); x->startindex=(astopindex =(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, gensym("list")); return (x); } static void tabdump_helper(void) { post("\n"HEARTSYMBOL " tabdump - object : dumps a table as a package of floats"); post("'set '\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
\""); } 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); zexy_register("tabdump"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/tabminmax.c000066400000000000000000000075211265051730400236330ustar00rootroot00000000000000/* * tabminmax: get minimum and maximum of a table * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #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; zarray_t *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); } else if (!zarray_getarray(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(stopnpoints) { stop=npoints; } npoints=stop-start; min=zarray_getfloat(vec, start); max=min; mindex=start; maxdex=start; for (n = 1; n < npoints; n++) { t_float val=zarray_getfloat(vec, start+n); if(valmax) { maxdex=start+n; max=val; } } SETFLOAT(atombuf, max); SETFLOAT(atombuf+1, maxdex); outlet_list(x->max_out, gensym("list"), 2, atombuf); SETFLOAT(atombuf, min); SETFLOAT(atombuf+1, mindex); outlet_list(x->min_out, gensym("list"), 2, atombuf); } } static void tabminmax_list(t_tabminmax *x, t_symbol* UNUSED(s),int argc, t_atom*argv) { int a,b; switch(argc) { case 2: a=atom_getint(argv); b=atom_getint(argv+1); x->startindex=(astopindex =(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, gensym("list")); x->max_out=outlet_new(&x->x_obj, gensym("list")); return (x); } static void tabminmax_helper(void) { post("\n"HEARTSYMBOL " tabminmax - object : dumps a table as a package of floats"); post("'set
'\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
\""); } 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); zexy_register("tabminmax"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/tabread4~~.c000066400000000000000000000100731265051730400237310ustar00rootroot00000000000000/* * tabread4~~: a tabread with 2 inputs for higher precision * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* based on tabread4~ which is part of pd */ #include "zexy.h" /******************** tabread4~~ ***********************/ static t_class *tabread4_tilde_class; typedef struct _tabread4_tilde { t_object x_obj; int x_npoints; zarray_t *x_vec; t_symbol *x_arrayname; t_float x_f; } t_tabread4_tilde; static void *tabread4_tilde_new(t_symbol *s) { t_tabread4_tilde *x = (t_tabread4_tilde *)pd_new(tabread4_tilde_class); x->x_arrayname = s; x->x_vec = 0; x->x_npoints=0; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } static t_int *tabread4_tilde_perform(t_int *w) { t_tabread4_tilde *x = (t_tabread4_tilde *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *in1 = (t_sample *)(w[3]); t_sample *out = (t_sample *)(w[4]); int n = (int)(w[5]); int maxindex; zarray_t *buf = x->x_vec, *wp; int i; maxindex = x->x_npoints - 3; if (!buf) { while (n--) { *out++ = 0; } return (w+6); } for (i = 0; i < n; i++) { t_sample in0_s=*in++; t_sample in1_s=*in1++; double findex = (double)in0_s + (double)in1_s; long int index = findex; double frac; t_sample a, b, c, d, cminusb; if (index < 1) { index = 1, frac = 0; } else if (index > maxindex) { index = maxindex, frac = 1; } else { frac = findex - index; } wp = buf + index; a = zarray_getfloat(wp,-1); b = zarray_getfloat(wp, 0); c = zarray_getfloat(wp, 1); d = zarray_getfloat(wp, 2); cminusb = c-b; *out++ = b + frac * ( cminusb - 0.1666667f * (1.-frac) * ( (d - a - 3.0f * cminusb) * frac + (d + 2.0f*a - 3.0f*b) ) ); } return (w+6); } static void tabread4_tilde_set(t_tabread4_tilde *x, t_symbol *s) { t_garray *a; x->x_arrayname = s; if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { if (*s->s_name) { pd_error(x, "tabread4~~: %s: no such array", x->x_arrayname->s_name); } x->x_vec = 0; } else if (!zarray_getarray(a, &x->x_npoints, &x->x_vec)) { pd_error(x, "%s: bad template for tabread4~~", x->x_arrayname->s_name); x->x_vec = 0; } else { garray_usedindsp(a); } } static void tabread4_tilde_dsp(t_tabread4_tilde *x, t_signal **sp) { tabread4_tilde_set(x, x->x_arrayname); dsp_add(tabread4_tilde_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); } static void tabread4_tilde_free(t_tabread4_tilde *x) { } void tabread4_tilde_tilde_setup(void) { tabread4_tilde_class = class_new(gensym("tabread4~~"), (t_newmethod)tabread4_tilde_new, (t_method)tabread4_tilde_free, sizeof(t_tabread4_tilde), 0, A_DEFSYM, 0); CLASS_MAINSIGNALIN(tabread4_tilde_class, t_tabread4_tilde, x_f); class_addmethod(tabread4_tilde_class, (t_method)tabread4_tilde_dsp, gensym("dsp"), 0); class_addmethod(tabread4_tilde_class, (t_method)tabread4_tilde_set, gensym("set"), A_SYMBOL, 0); zexy_register("tabread4~~"); } void setup_tabread40x7e_tilde(void) { tabread4_tilde_tilde_setup(); } void setup_tabread40x7e0x7e(void) { tabread4_tilde_tilde_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/tabset.c000066400000000000000000000064711265051730400231400ustar00rootroot00000000000000/* * tabset: set a table with a list of floats * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* you could also send a message [0 ( to the table to achieve the same result */ #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; zarray_t *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); } else if (!zarray_getarray(A, &npoints, &vec)) { error("%s: bad template for tabset", x->x_arrayname->s_name); } else { while(npoints--) { zarray_setfloat(vec, 0, f); vec++; } garray_redraw(A); } } static void tabset_list(t_tabset *x, t_symbol* UNUSED(s), int argc, t_atom* argv) { t_garray *A; int npoints; zarray_t *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); } else if (!zarray_getarray(A, &npoints, &vec)) { error("%s: bad template for tabset", x->x_arrayname->s_name); } else { if (argc>=npoints) while(npoints--) { t_float f= atom_getfloat(argv++); zarray_setfloat(vec, 0, f); vec++; } else { npoints-=argc; while (argc--) { t_float f= atom_getfloat(argv++); zarray_setfloat(vec, 0, f); vec++; } while (npoints--) { zarray_setfloat(vec, 0, 0); vec++; } } 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"HEARTSYMBOL " tabset - object : set a table with a package of floats"); post("'set
'\t: set another table\n" "\t\t: set the table" "\t\t: set the table to constant float\n"); post("creation\t: \"tabset
\""); } 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); zexy_register("tabset"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/tavg~.c000066400000000000000000000044451265051730400230140ustar00rootroot00000000000000/* * tavg~: arithmetic mean between last and current 'bang' (triggered average on signals) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *tavg_class; typedef struct _tavg { t_object x_obj; t_sample n_inv; t_sample buf; unsigned int blocks; } t_tavgtilde; static void tavg_bang(t_tavgtilde *x) { if (x->blocks) { t_float result=x->buf*x->n_inv/x->blocks; outlet_float(x->x_obj.ob_outlet, result); x->blocks = 0; x->buf = 0.; } } static t_int *tavg_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_tavgtilde *x = (t_tavgtilde *)w[2]; int n = (int)(w[3]); t_sample 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("\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); zexy_register("tavg~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/time.c000066400000000000000000000060111265051730400226020ustar00rootroot00000000000000/* * time:: gets the current time from the system * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* * 1506:forum::für::umläute:2003: use timeb only if needed (like on windoze) */ #include "zexy.h" #ifdef __WIN32__ #define USE_TIMEB #endif #ifdef __APPLE__ #include /* typedef _BSD_TIME_T_ time_t; */ #endif #include #ifdef USE_TIMEB #include #else #include #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* UNUSED(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, gensym("float")); x->x_outlet2 = outlet_new(&x->x_obj, gensym("float")); x->x_outlet3 = outlet_new(&x->x_obj, gensym("float")); x->x_outlet4 = outlet_new(&x->x_obj, gensym("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)(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* UNUSED(x)) { post("\n"HEARTSYMBOL " time\t\t:: get the current system time"); 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); zexy_register("time"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/unpack.c000066400000000000000000000061271265051730400231350ustar00rootroot00000000000000/* * unpack: a type-agnostic version of [unpack] * * (c) 2007-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* * this version of [unpack] does not care about types, so the arguments are merely there for documentation reasons * (and to determine the number of outlets) * e.g. sending [symbol foo( to [zexy/unpack 0] will output [symbol foo( * * for know this object is named [zexy/unpack], as there might be some issues with compatibility with the original [unpack] */ #include "zexy.h" /* ------------------------- zunpack ------------------------------- */ /* like pack, but does no type-checking */ static t_class *zunpack_class; typedef struct _zunpack { t_object x_obj; t_outlet**x_out; t_int x_numouts; } t_zunpack; static void zunpack_any(t_zunpack *x, t_symbol *s, int argc, t_atom *argv) { int offset=(s!=NULL)?1:0; int count=((argc+offset)<(x->x_numouts))?(argc+offset):x->x_numouts; while(count-->offset) { outlet_list(x->x_out[count], gensym("list"), 1, argv+count-offset); } if(s!=NULL) { outlet_symbol(x->x_out[0], s); } } static void zunpack_list(t_zunpack *x, t_symbol *s, int argc, t_atom *argv) { zunpack_any(x, 0, argc, argv); } static void zunpack_bang(t_zunpack *x) { outlet_bang(x->x_out[0]); } static void zunpack_free(t_zunpack *x) { int i=0; for(i=0; ix_numouts; i++) { outlet_free(x->x_out[i]); } freebytes(x->x_out, x->x_numouts*sizeof(t_outlet*)); x->x_numouts=0; x->x_out=0; } static void *zunpack_new(t_symbol*s, int argc, t_atom*argv) { t_zunpack *x = (t_zunpack *)pd_new(zunpack_class); int count=(argc>0)?argc:2; int i=0; x->x_numouts=count; x->x_out=(t_outlet**)getbytes(count*sizeof(t_outlet*)); for(i=0; ix_out[i] =outlet_new(&x->x_obj, 0); } return (x); } void zunpack_setup(void) { zunpack_class = class_new(gensym("zexy/unpack"), (t_newmethod)zunpack_new, (t_method)zunpack_free, sizeof(t_zunpack), 0, A_GIMME, 0); #if 0 /* oops Pd-0.42 allows us to override built-ins * this is bad as long as the 2 objects are not compatible */ class_addcreator((t_newmethod)zunpack_new, gensym("unpack"), A_GIMME, 0); #endif class_addbang(zunpack_class, zunpack_bang); class_addlist(zunpack_class, zunpack_list); class_addanything(zunpack_class, zunpack_any); zexy_register("unpack"); } void unpack_setup(void) { zunpack_setup(); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/unpack~.c000066400000000000000000000067461265051730400233420ustar00rootroot00000000000000/* * unpack~ :: convert (list-of-) float inputs to signals * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *sigunpack_class; typedef struct _sigunpack { t_object x_obj; t_sample *buffer; t_sample *rp, *wp; int bufsize; } t_sigunpack; static void sigunpack_float(t_sigunpack *x, t_float f) { if (x->wp + 1 != x->rp) { *(x->wp)++ = f; if (x->wp == x->buffer + x->bufsize) { x->wp = x->buffer; } } } static void sigunpack_list(t_sigunpack *x, t_symbol *s, int argc, t_atom *argv) { t_atom *ap = argv; int i; for (i = 0, ap = argv; i < argc; ap++, i++) { if (x->wp + 1 != x->rp) { *(x->wp)++ = atom_getfloat(ap); if (x->wp == x->buffer + x->bufsize) { x->wp = x->buffer; } } } } static t_int *sigunpack_perform(t_int *w) { t_sample *out = (t_sample *)(w[1]); t_sigunpack *x = (t_sigunpack *)w[2]; int n = (int)(w[3]); t_sample *buf = x->rp; int hitchhike = 0; if ((x->wp >= x->rp) && (x->wp < x->rp+n)) { hitchhike=1; } x->rp += n; if (x->rp == x->buffer + x->bufsize) { x->rp = x->buffer; } if (hitchhike) { x->wp = x->rp; } while (n--) { *out++ = *buf; *buf++ = 0; } return (w+4); } static void sigunpack_dsp(t_sigunpack *x, t_signal **sp) { if (x->bufsize % sp[0]->s_n) { int newsize = sp[0]->s_n*(1+(int)(x->bufsize/sp[0]->s_n)); freebytes(x->buffer, x->bufsize * sizeof(*x->buffer)); x->buffer = (t_sample *)getbytes(newsize * sizeof(*x->buffer)); x->rp = x->wp = x->buffer; x->bufsize = newsize; } dsp_add(sigunpack_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); } static void *sigunpack_new(t_floatarg f) { t_sigunpack *x = (t_sigunpack *)pd_new(sigunpack_class); int suggestedsize = (int)f; int bufsize; if (!suggestedsize) { bufsize = 64; } else { bufsize = (suggestedsize % 64)?(64*(1+(int)(suggestedsize/64))): suggestedsize; } x->buffer = (t_sample *)getbytes(bufsize * sizeof(*x->buffer)); x->bufsize = bufsize; x->rp = x->wp = x->buffer; outlet_new(&x->x_obj, gensym("signal")); return (x); } static void sigunpack_help(void) { post("unpack~\t:: outputs a sequence of floats as a signal"); } void unpack_tilde_setup(void) { sigunpack_class = class_new(gensym("unpack~"), (t_newmethod)sigunpack_new, 0, sizeof(t_sigunpack), 0, A_DEFFLOAT, 0); class_addmethod(sigunpack_class, (t_method)sigunpack_dsp, gensym("dsp"), 0); class_addfloat(sigunpack_class, (t_method)sigunpack_float); class_addlist (sigunpack_class, (t_method)sigunpack_list); class_addmethod(sigunpack_class, (t_method)sigunpack_help, gensym("help"), 0); zexy_register("unpack~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/urn.c000066400000000000000000000077721265051730400224670ustar00rootroot00000000000000/* * urn : "generate random numbers without duplicates" (very max-like) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" /* ------------------------- urn ------------------------------- */ static t_class *urn_class; typedef struct _urn { t_object x_obj; unsigned int x_seed; /* the seed of the generator */ unsigned int x_range; /* max. random-number + 1 */ unsigned int x_count; /* how many random numbers have we generated ? */ char *x_state; /* has this number been generated already ? */ t_outlet *x_floatout, *x_bangout; char x_noauto; } t_urn; static int makeseed(void) { static unsigned int random_nextseed = 1489853723; random_nextseed = random_nextseed * 435898247 + 938284287; return (random_nextseed & 0x7fffffff); } static void makestate(t_urn *x, unsigned int newrange) { if (x->x_range == newrange) { return; } if (x->x_range && x->x_state) { freebytes(x->x_state, sizeof(char)*x->x_range); x->x_state=0; } x->x_range=newrange; x->x_state=getbytes(sizeof(char)*x->x_range); } static void urn_clear(t_urn *x) { unsigned int i=x->x_range; char *dummy=x->x_state; if (!dummy || !i) { return; } while(i--) { *dummy++=0; } x->x_count=0; } static void urn_bang(t_urn *x) { unsigned int range = (x->x_range<1?1:x->x_range); unsigned int randval = x->x_seed; unsigned int nval=0, used=1; if (x->x_count>=range) { outlet_bang(x->x_bangout); if (x->x_noauto) { return; } urn_clear(x); } while (used) { randval = randval * 472940017 + 832416023; nval = ((double)range) * ((double)randval) * (1./4294967296.); if (nval >= range) { nval = range-1; } used=x->x_state[nval]; } x->x_count++; x->x_state[nval]=1; x->x_seed = randval; outlet_float(x->x_floatout, nval); } static void urn_flt2(t_urn *x, t_float f) { unsigned int range = (f<1)?1:f; makestate(x, range); urn_clear(x); } static void urn_seed(t_urn *x, t_float f) { x->x_seed = f; } static void *urn_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_urn *x = (t_urn *)pd_new(urn_class); t_float f=0.; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); x->x_floatout=outlet_new(&x->x_obj, gensym("float")); x->x_bangout =outlet_new(&x->x_obj, gensym("bang")); x->x_seed = makeseed(); x->x_noauto = 0; while(argc--) { if (argv->a_type==A_SYMBOL) { if (atom_getsymbol(argv)==gensym("no_auto")) { x->x_noauto=1; } } else { f = atom_getfloat(argv); } argv++; } if (f<1.0) { f=1.0; } makestate(x, f); x->x_range = f; urn_clear(x); return (x); } static void urn_help(t_urn*x) { post("\n"HEARTSYMBOL " urn\t\t:: generate randum numbers without repetition"); } void urn_setup(void) { urn_class = class_new(gensym("urn"), (t_newmethod)urn_new, 0, sizeof(t_urn), 0, A_GIMME, 0); class_addbang (urn_class, urn_bang); class_addmethod(urn_class, (t_method)urn_clear, gensym("clear"), 0); class_addmethod(urn_class, (t_method)urn_flt2, gensym(""), A_DEFFLOAT, 0); class_addmethod(urn_class, (t_method)urn_seed, gensym("seed"), A_DEFFLOAT, 0); class_addmethod(urn_class, (t_method)urn_help, gensym("help"), A_NULL); zexy_register("urn"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/winNT_portio.c000066400000000000000000000065101265051730400243030ustar00rootroot00000000000000/* * 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 */ #if defined __WIN32__ && defined Z_WANT_LPT #include #include 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) { unsigned char value; #ifdef _MSC_VER __asm mov edx,port __asm in al,dx __asm mov value,al #else /* hmm, i should read some documentation about inline assembler */ post("lpt: cannot read from parport (recompile!)"); return 0; #endif return (int)value; } void write_parport(int port, int invalue) { /* _outp((unsigned short)port, value); */ BYTE value = (BYTE)invalue; #ifdef _MSC_VER __asm mov edx,port __asm mov al,value __asm out dx,al #else /* * hmm, i should read some documentation about inline assembler * and probably about assembler in general... */ post("lpt: cannot write to parport (recompile!)"); /* asm( "mov %%edx,%0\n" "mov %%al,%1\n" "out %%dx,%%al\n" : : "a"(port),"b"(value) ); */ #endif } 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 /* __WIN32__ & Z_WANT_LPT */ zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/wrap.c000066400000000000000000000046531265051730400226270ustar00rootroot00000000000000/* * wrap: wrap floats between two limits * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #include "zexy.h" static t_class *wrap_class; typedef struct _wrap { t_object x_obj; t_float f_upper, f_lower; } t_wrap; static void wrap_float(t_wrap *x, t_float f) { if (x->f_lower==x->f_upper) { outlet_float(x->x_obj.ob_outlet, x->f_lower); } else { t_float modulo = fmod((f-x->f_lower),(x->f_upper-x->f_lower)); if (modulo<0) { modulo+=(x->f_upper-x->f_lower); } outlet_float(x->x_obj.ob_outlet, x->f_lower+modulo); } } static void wrap_set(t_wrap *x, t_symbol* UNUSED(s), int argc, t_atom *argv) { t_float f1, f2; switch (argc) { case 0: f1=0.0; f2=1.0; break; case 1: f1=0.0; f2 = atom_getfloat(argv); break; default: f1 = atom_getfloat(argv); f2 = atom_getfloat(argv+1); } x->f_lower=(f1f_upper=(f1>f2)?f1:f2; } static void *wrap_new(t_symbol *s, int argc, t_atom*argv) { t_wrap *x = (t_wrap *)pd_new(wrap_class); wrap_set(x, s, argc, argv); outlet_new(&x->x_obj, gensym("float")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("set")); return (x); } static void wrap_help(t_wrap*x) { post("\n"HEARTSYMBOL " wrap\t\t:: wrap a float between to boundaries"); } void wrap_setup(void) { wrap_class = class_new(gensym("wrap"), (t_newmethod)wrap_new, 0, sizeof(t_wrap), CLASS_DEFAULT, A_GIMME, A_NULL); class_addfloat (wrap_class, wrap_float); class_addmethod(wrap_class, (t_method)wrap_set, gensym("set"), A_GIMME, 0); class_addmethod(wrap_class, (t_method)wrap_help, gensym("help"), A_NULL); zexy_register("wrap"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/z_zexy.c000066400000000000000000000061101265051730400231740ustar00rootroot00000000000000/* zexy-setup autogenerated setup-file * generated by "./makesource.sh" * !! DO NOT MANUALLY EDIT !! */ #include "z_zexy.h" void z_zexy_setup(void) { setup_0x260x260x7e(); /* 0x260x260x7e */ setup_0x2e(); /* 0x2e */ setup_0x3c0x7e(); /* 0x3c0x7e */ setup_0x3d0x3d0x7e(); /* 0x3d0x3d0x7e */ setup_0x3e0x7e(); /* 0x3e0x7e */ setup_0x7c0x7c0x7e(); /* 0x7c0x7c0x7e */ a2l_setup(); /* a2l */ abs_tilde_setup(); /* abs~ */ absgn_tilde_setup(); /* absgn~ */ atof_setup(); /* atof */ atoi_setup(); /* atoi */ avg_tilde_setup(); /* avg~ */ blockmirror_tilde_setup(); /* blockmirror~ */ blockshuffle_tilde_setup(); /* blockshuffle~ */ blockswap_tilde_setup(); /* blockswap~ */ date_setup(); /* date */ demultiplex_tilde_setup(); /* demultiplex~ */ demultiplex_setup(); /* demultiplex */ dfreq_tilde_setup(); /* dfreq~ */ dirac_tilde_setup(); /* dirac~ */ doublepole_tilde_setup(); /* doublepole~ */ drip_setup(); /* drip */ envrms_tilde_setup(); /* envrms~ */ fifop_setup(); /* fifop */ freadln_setup(); /* freadln */ fwriteln_setup(); /* fwriteln */ glue_setup(); /* glue */ index_setup(); /* index */ length_setup(); /* length */ lifop_setup(); /* lifop */ limiter_tilde_setup(); /* limiter~ */ list2int_setup(); /* list2int */ list2lists_setup(); /* list2lists */ list2symbol_setup(); /* list2symbol */ lister_setup(); /* lister */ listfind_setup(); /* listfind */ liststorage_setup(); /* liststorage */ longload_setup(); /* longload */ lpt_setup(); /* lpt */ makesymbol_setup(); /* makesymbol */ matchbox_setup(); /* matchbox */ mavg_setup(); /* mavg */ minmax_setup(); /* minmax */ msgfile_setup(); /* msgfile */ multiline_tilde_setup(); /* multiline~ */ multiplex_tilde_setup(); /* multiplex~ */ multiplex_setup(); /* multiplex */ multireceive_setup(); /* multireceive */ niagara_setup(); /* niagara */ noish_tilde_setup(); /* noish~ */ noisi_tilde_setup(); /* noisi~ */ operating_system_setup(); /* operating_system */ pack_tilde_setup(); /* pack~ */ pack_setup(); /* pack */ packel_setup(); /* packel */ pdf_tilde_setup(); /* pdf~ */ prime_setup(); /* prime */ quantize_tilde_setup(); /* quantize~ */ rawprint_setup(); /* rawprint */ regex_setup(); /* regex */ relay_setup(); /* relay */ repack_setup(); /* repack */ repeat_setup(); /* repeat */ route_tilde_setup(); /* route~ */ sfplay_setup(); /* sfplay */ sfrecord_setup(); /* sfrecord */ sgn_tilde_setup(); /* sgn~ */ sigzero_tilde_setup(); /* sigzero~ */ sleepgrain_setup(); /* sleepgrain */ sort_setup(); /* sort */ step_tilde_setup(); /* step~ */ strcmp_setup(); /* strcmp */ sum_setup(); /* sum */ swap_tilde_setup(); /* swap~ */ symbol2list_setup(); /* symbol2list */ tabdump_setup(); /* tabdump */ tabminmax_setup(); /* tabminmax */ tabread4_tilde_tilde_setup(); /* tabread4~~ */ tabset_setup(); /* tabset */ tavg_tilde_setup(); /* tavg~ */ time_setup(); /* time */ unpack_tilde_setup(); /* unpack~ */ unpack_setup(); /* unpack */ urn_setup(); /* urn */ wrap_setup(); /* wrap */ z_tilde_setup(); /* z~ */ } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/z_zexy.h000066400000000000000000000073121265051730400232060ustar00rootroot00000000000000/* zexy-setup autogenerated header-file * generated by "./makesource.sh" * !! DO NOT MANUALLY EDIT !! */ #ifndef Z_ZEXY_H__ #define Z_ZEXY_H__ void setup_0x260x260x7e(void); /* 0x260x260x7e */ void setup_0x2e(void); /* 0x2e */ void setup_0x3c0x7e(void); /* 0x3c0x7e */ void setup_0x3d0x3d0x7e(void); /* 0x3d0x3d0x7e */ void setup_0x3e0x7e(void); /* 0x3e0x7e */ void setup_0x7c0x7c0x7e(void); /* 0x7c0x7c0x7e */ void a2l_setup(void); /* a2l */ void abs_tilde_setup(void); /* abs~ */ void absgn_tilde_setup(void); /* absgn~ */ void atof_setup(void); /* atof */ void atoi_setup(void); /* atoi */ void avg_tilde_setup(void); /* avg~ */ void blockmirror_tilde_setup(void); /* blockmirror~ */ void blockshuffle_tilde_setup(void); /* blockshuffle~ */ void blockswap_tilde_setup(void); /* blockswap~ */ void date_setup(void); /* date */ void demultiplex_tilde_setup(void); /* demultiplex~ */ void demultiplex_setup(void); /* demultiplex */ void dfreq_tilde_setup(void); /* dfreq~ */ void dirac_tilde_setup(void); /* dirac~ */ void doublepole_tilde_setup(void); /* doublepole~ */ void drip_setup(void); /* drip */ void envrms_tilde_setup(void); /* envrms~ */ void fifop_setup(void); /* fifop */ void freadln_setup(void); /* freadln */ void fwriteln_setup(void); /* fwriteln */ void glue_setup(void); /* glue */ void index_setup(void); /* index */ void length_setup(void); /* length */ void lifop_setup(void); /* lifop */ void limiter_tilde_setup(void); /* limiter~ */ void list2int_setup(void); /* list2int */ void list2lists_setup(void); /* list2lists */ void list2symbol_setup(void); /* list2symbol */ void lister_setup(void); /* lister */ void listfind_setup(void); /* listfind */ void liststorage_setup(void); /* liststorage */ void longload_setup(void); /* longload */ void lpt_setup(void); /* lpt */ void makesymbol_setup(void); /* makesymbol */ void matchbox_setup(void); /* matchbox */ void mavg_setup(void); /* mavg */ void minmax_setup(void); /* minmax */ void msgfile_setup(void); /* msgfile */ void multiline_tilde_setup(void); /* multiline~ */ void multiplex_tilde_setup(void); /* multiplex~ */ void multiplex_setup(void); /* multiplex */ void multireceive_setup(void); /* multireceive */ void niagara_setup(void); /* niagara */ void noish_tilde_setup(void); /* noish~ */ void noisi_tilde_setup(void); /* noisi~ */ void operating_system_setup(void); /* operating_system */ void pack_tilde_setup(void); /* pack~ */ void pack_setup(void); /* pack */ void packel_setup(void); /* packel */ void pdf_tilde_setup(void); /* pdf~ */ void prime_setup(void); /* prime */ void quantize_tilde_setup(void); /* quantize~ */ void rawprint_setup(void); /* rawprint */ void regex_setup(void); /* regex */ void relay_setup(void); /* relay */ void repack_setup(void); /* repack */ void repeat_setup(void); /* repeat */ void route_tilde_setup(void); /* route~ */ void sfplay_setup(void); /* sfplay */ void sfrecord_setup(void); /* sfrecord */ void sgn_tilde_setup(void); /* sgn~ */ void sigzero_tilde_setup(void); /* sigzero~ */ void sleepgrain_setup(void); /* sleepgrain */ void sort_setup(void); /* sort */ void step_tilde_setup(void); /* step~ */ void strcmp_setup(void); /* strcmp */ void sum_setup(void); /* sum */ void swap_tilde_setup(void); /* swap~ */ void symbol2list_setup(void); /* symbol2list */ void tabdump_setup(void); /* tabdump */ void tabminmax_setup(void); /* tabminmax */ void tabread4_tilde_tilde_setup(void); /* tabread4~~ */ void tabset_setup(void); /* tabset */ void tavg_tilde_setup(void); /* tavg~ */ void time_setup(void); /* time */ void unpack_tilde_setup(void); /* unpack~ */ void unpack_setup(void); /* unpack */ void urn_setup(void); /* urn */ void wrap_setup(void); /* wrap */ void z_tilde_setup(void); /* z~ */ void z_zexy_setup(void); #endif /* Z_ZEXY_H__ */ zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/zexy.c000066400000000000000000000143731265051730400226550ustar00rootroot00000000000000/* * zexy: the swiss army knife for Pure Data * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* ...this is a very ZEXY external ... so have fun */ #include "zexy.h" #include "z_zexy.h" #include #include #ifdef __WIN32__ # define vsnprintf _vsnprintf #endif /* do a little help thing */ typedef struct zexy { t_object t_ob; } t_zexy; t_class *zexy_class; static void zexy_help(void) { endpost(); endpost(); post("...this is the zexy external "VERSION"..."); endpost(); post(""HEARTSYMBOL " handling signals"); #if 0 post("streamout~\t:: stream signals via a LAN : (%c) gige 1999"); post("streamin~\t:: catch signals from a LAN : based on gige"); #endif post("sfplay\t\t:: play back a (multichannel) soundfile : (c) ritsch 1999"); post("sfrecord\t:: record a (multichannel) soundfile : based on ritsch"); endpost(); post(""HEARTSYMBOL " generating signals"); post("noish~\t\t:: generate bandlimited noise"); post("noisi~\t\t:: generate bandlimited noise"); post("dirac~\t\t:: generate a dirac-pulse"); post("step~\t\t:: generate a unity-step"); post("dfreq~\t\t:: detect frequency by counting zero-crossings : (c) ritsch 1998"); endpost(); post(""HEARTSYMBOL " manipulating signals"); post("limiter~\t:: limit/compress one or more signals"); post("nop~\t\t:: pass through a signal (delay 1 block)"); post("z~\t\t:: samplewise delay"); post("swap~\t\t:: byte-swap a signal"); post("quantize~\t:: quantize a signal"); endpost(); post(""HEARTSYMBOL " binary operations on signals"); post("abs~, sgn~, >~, <~, ==~, &&~, ||~"); endpost(); post(""HEARTSYMBOL " multary operations on signals"); post("multiline~\t:: multiple line~ multiplication"); post("multiplex~\t:: multiplex 1 inlet~ to 1-of-various outlet~s"); post("demultiplex~\t:: demultiplex 1-of-various inlet~s to 1 outlet~"); endpost(); post(""HEARTSYMBOL " investigating signals in message-domain"); post("pack~\t\t:: convert a signal into a list of floats"); post("unpack~\t\t:: convert packages of floats into a signal"); post("sigzero~\t:: indicates whether a signal is zero throughout the block"); post("avg~\t\t:: outputs average of a signal as float"); post("tavg~\t\t:: outputs average of a signal between two bangs"); post("envrms~\t\t:: an env~-object that ouputs rms instead of db"); post("pdf~\t\t:: power density function"); endpost(); post(""HEARTSYMBOL " basic message objects"); post("nop\t\t:: a no-operation"); post("lister\t\t:: stores lists"); post("any2list\t\t:: converts \"anything\" to lists"); post("list2int\t:: cast each float of a list to integer"); post("atoi\t\t:: convert ascii to integer"); post("list2symbol\t:: convert a list into a single symbol"); post("symbol2list\t:: split a symbol into a list"); post("strcmp\t\t:: compare 2 lists as if they where strings"); post("repack\t\t:: (re)packs atoms to packages of a given size"); post("packel\t\t:: element of a package"); post("length\t\t:: length of a package"); post("niagara\t\t:: divide a package into 2 sub-packages"); post("glue\t\t:: append a list to another"); post("repeat\t\t:: repeat a message"); post("segregate\t:: sort inputs by type"); post(".\t\t:: scalar multiplication of vectors (lists of floats)"); endpost(); post(""HEARTSYMBOL " advanced message objects"); post("tabread4\t:: 4-point interpolating table-read object"); post("tabdump\t\t:: dump the table as a list"); post("tabset\t\t:: set a table with a list"); post("mavg\t\t:: a variable moving average filter"); post("mean\t\t:: get the arithmetic mean of a vector"); post("minmax\t\t:: get the minimum and the maximum of a vector"); post("makesymbol\t:: creates (formatted) symbols"); post("date\t\t:: get the current system date"); post("time\t\t:: get the current system time"); post("index\t\t:: convert symbols to indices"); post("drip\t\t:: converts a package to a sequence of atoms"); post("sort\t\t:: shell-sort a package of floats"); post("demux\t\t:: demultiplex the input to a specified output"); post("msgfile\t\t:: store and handles lists of lists"); post("lp\t\t:: write to the (parallel) port"); post("wrap\t\t:: wrap a floating number between 2 limits"); post("urn\t\t:: unique random numbers"); post("operating_system\t:: information on the OS"); endpost(); post("\n(l) forum::für::umläute except where indicated"); post("this software is released under the GnuGPL that is provided with these files"); endpost(); } static void *zexy_new(void) { t_zexy *x = (t_zexy *)pd_new(zexy_class); return (x); } void zexy_setup(void) { int i; startpost("\n\t"); for (i=0; i<3; i++) { startpost(""HEARTSYMBOL ""); } endpost(); post("\t"HEARTSYMBOL " the zexy external "VERSION); post("\t"HEARTSYMBOL " (c) 1999-2012 IOhannes m zmölnig"); post("\t"HEARTSYMBOL " forum::für::umläute"); post("\t"HEARTSYMBOL " iem @ kug"); post("\t"HEARTSYMBOL " compiled "BUILD_DATE); post("\t"HEARTSYMBOL " send me a 'help' message"); startpost("\t"); for (i=0; i<3; i++) { startpost(""HEARTSYMBOL ""); } endpost(); endpost(); zexy_class = class_new(gensym("zexy"), zexy_new, 0, sizeof(t_zexy), 0, 0); class_addmethod(zexy_class, zexy_help, gensym("help"), 0); zexy_register("zexy"); /* ************************************** */ z_zexy_setup(); } #ifndef __WIN32__ void verbose(int level, const char *fmt, ...) { char buf[MAXPDSTRING]; va_list ap; va_start(ap, fmt); vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); post("zverbose(%d): %s", level, buf); } #endif zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/zexy.h000066400000000000000000000114531265051730400226560ustar00rootroot00000000000000/* ********************************************** */ /* the ZEXY external */ /* ********************************************** */ /* forum::für::umläute */ /* ********************************************** */ /* the ZEXY external is a runtime-library for miller s. puckette's realtime-computermusic-software "pure data" * therefore you NEED "pure data" to make any use of the ZEXY external * (except if you want to use the code for other things) * download "pure data" at http://pd.iem.at ftp://iem.at/pd * * if you are looking for the latest release of the ZEXY-external you should have another look at http://puredata.info/community/projects/software/zexy/ ftp://iem.at/pd/Externals/ZEXY * * ZEXY is published under the GNU GeneralPublicLicense, that must be shipped with ZEXY. * if you are using Debian GNU/linux, the GNU-GPL can be found under /usr/share/common-licenses/GPL * if you still haven't found a copy of the GNU-GPL, have a look at http://www.gnu.org * * "pure data" has it's own license, that comes shipped with "pure data". * * there are ABSOLUTELY NO WARRANTIES for anything */ #ifndef INCLUDE_ZEXY_H__ #define INCLUDE_ZEXY_H__ #ifdef __WIN32__ # ifndef NT # define NT # endif # ifndef MSW # define MSW # endif #endif /* * to use the zexyconf.h compile-time configurations, you have to set HAVE_CONFIG_H * usually this is done in Make.config by configure */ #ifdef HAVE_CONFIG_H # include "config.h" #else # include "zexyconf.h" #endif /* HAVE_CONFIG_H */ /* these pragmas are only used for MSVC, not MinGW or Cygwin */ #ifdef _MSC_VER # pragma warning( disable : 4018 ) # pragma warning( disable : 4244 ) # pragma warning( disable : 4305 ) # pragma warning( disable : 4996) /* deprecated functions */ #endif #include "m_pd.h" #ifndef VERSION # define VERSION "(unknown version)" #endif #ifndef HEARTSYMBOL # if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION >= 43) # define HEARTSYMBOL "♡" # else # define HEARTSYMBOL "@" # endif #endif #include #ifdef __WIN32__ # define STATIC_INLINE # ifndef sqrtf # define sqrtf sqrt # endif /* sqrtf */ # ifndef fabsf # define fabsf fabs # endif /* fabsf */ #else # define STATIC_INLINE static #endif #ifdef __APPLE__ # include # if defined (MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3 # define sqrtf sqrt # endif /* OSX-10.3 */ #endif /* APPLE */ #ifdef __GNUC__ # define UNUSED(x) ZUNUSED_ ## x __attribute__((__unused__)) # define UNUSED_FUNCTION(x) __attribute__((__unused__)) ZUNUSEDFUN_ ## x #else # define UNUSED(x) ZUNUSED_ ## x # define UNUSED_FUNCTION(x) ZUNUSEDFUN_ ## x #endif #define ZEXY_TYPE_EQUAL(type1, type2) (sizeof(type1) == sizeof(type2)) typedef struct _mypdlist { t_object x_obj; int x_n; t_atom *x_list; } t_mypdlist; #ifndef BUILD_DATE # define BUILD_DATE __DATE__ #endif #ifndef ZEXY_LIBRARY static void zexy_register(char*object) { if(object!=0) { post("[%s] part of zexy-%s (compiled "BUILD_DATE")", object, VERSION); post("\tCopyright (c) 1999-2012 IOhannes m zmölnig, forum::für::umläute & IEM"); } } #else static void zexy_register(char*object) { object=0; } #endif /* ZEXY_LIBRARY */ #if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 38) /* * pd>=0.39 has a verbose() function; older versions don't * btw, this finally makes zexy binary incompatible with older version */ # define z_verbose verbose /* when compiling zexy as library, we also provide now provide a dummy verbose() function, * which will chime in, when pd is lacking one * this should make zexy binary compatible with older pd versions again */ # ifndef __WIN32__ void verbose(int level, const char *fmt, ...); # endif #else /* * on older version we just shut up! */ # define z_verbose #endif #if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 43) # define z_open sys_open # define z_close sys_close # define z_fopen sys_fopen # define z_fclose sys_fclose #else # define z_open open # define z_close close # define z_fopen fopen # define z_fclose fclose #endif #if (defined __x86_64__) && (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION >= 41) # define zarray_t t_word # define zarray_getarray garray_getfloatwords # define zarray_getfloat(pointer, index) (pointer[index].w_float) # define zarray_setfloat(pointer, index, value) ((pointer[index].w_float)=value) #else # define zarray_t t_float # define zarray_getarray garray_getfloatarray # define zarray_getfloat(pointer, index) (pointer[index]) # define zarray_setfloat(pointer, index, value) ((pointer[index])=value) #endif #endif /* INCLUDE_ZEXY_H__ */ zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/zexySIMD.h000066400000000000000000000043721265051730400233350ustar00rootroot00000000000000#include "zexy.h" #ifdef __SSE__ #include #define Z_SIMD_BLOCK 16 /* must be a power of 2 */ #define Z_SIMD_BYTEALIGN (128/8) /* assume 128 bits */ #define Z_SIMD_CHKBLOCKSIZE(n) (!(n&(Z_SIMD_BLOCK-1))) #define Z_SIMD_CHKALIGN(ptr) ( ((unsigned long)(ptr) & (Z_SIMD_BYTEALIGN-1)) == 0 ) typedef union { __m128 vec; t_sample f[4]; } t_sample4; /** * runs a check whether the SSE-optimized perform routine returns the same result as the generic routine * if the results differ, the SSE-code is probably broken, so we should fallback to the generic code */ static int zexy_testSSE(t_perfroutine genericperf, t_perfroutine sseperf, unsigned int numinchannels, unsigned int numoutchannels) { /* this currently only works with single input, single output */ /* LATER make it work truely multichannel */ if(1==numinchannels && 1==numoutchannels) { t_int w1[4], w2[4]; t_sample4 in, in1[4], in2[4], out1[4], out2[4]; int i, j; z_verbose(2, "checking for SSE compatibility"); in.f[0]=0.; in.f[1]=-0.5; in.f[2]=0.5; in.f[1]=5.; for(i=0; i<4; i++) { in1[i].f[0]=in.f[i]; in1[i].f[1]=in.f[i]; in1[i].f[3]=in.f[i]; in1[i].f[2]=in.f[i]; out1[i].f[0]=out1[i].f[1]=out1[i].f[2]=out1[i].f[3]=0.f; in2[i].f[0]=in.f[i]; in2[i].f[1]=in.f[i]; in2[i].f[3]=in.f[i]; in2[i].f[2]=in.f[i]; out2[i].f[0]=out2[i].f[1]=out2[i].f[2]=out2[i].f[3]=0.f; } w1[0]=(t_int)0; w1[1]=(t_int)&in1; w1[2]=(t_int)&out1; w1[3]=(t_int)16; (*genericperf)(w1); w2[0]=(t_int)0; w2[1]=(t_int)&in2; w2[2]=(t_int)&out2; w2[3]=(t_int)16; (*sseperf)(w2); for(i=0; i<4; i++) { for(j=0; j<4; j++) { if(fabsf(out1[i].f[j]-out2[i].f[j])>1e-17) { z_verbose(2, "generic and optimized routines return different results: skipping optimization"); z_verbose(2, "[%d,%d]: ((%f->%f)!=(%f->%f))", i, j, in1[i].f[j], out1[i].f[j], in2[i].f[j], out2[i].f[j] ); return 0; } } } } else { /* no tests yet */ } z_verbose(2, "using SSE optimization"); return 1; } #endif /* __SSE__ */ zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/zexyconf.h000066400000000000000000000012051265051730400235160ustar00rootroot00000000000000#ifndef _ZEXYCONF_H_ #define _ZEXYCONF_H_ /* zexyconf.h: configuration for zexy: * this is only included if no config.h is created * adapt this to your own needs */ /* Define if you have the header file. */ /* #undef HAVE_REGEX_H */ /* Define if you have the header file. */ /* #undef HAVE_ALLOCA_H */ /* define if you want parallelport-support (direct access to the port address) */ /* #undef Z_WANT_LPT */ /* define if you have the header file. * (for parport _device_ support) * you need Z_WANT_LPT for this to have an effect ! */ /* #undef HAVE_LINUX_PPDEV_H */ #endif /* _ZEXYCONF_H_ */ zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/src/z~.c000066400000000000000000000073121265051730400223200ustar00rootroot00000000000000/* * z~: samplewise delay (z^-N) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ /* here we do some sample-wise delay, so you can do your own FIR-filter-designs here are :: "z^(-1)", "z^(-N)" to do :: a "lattice~" section ... 1302:forum::für::umläute:2000 */ #include "zexy.h" /* ----------------------------------------------------- */ static t_class *zNdelay_class; typedef struct _zNdelay { t_object x_obj; t_sample *buf; int bufsize, phase; } t_zNdelay; static void zdel_float(t_zNdelay *x, t_floatarg f) { int i = f+1; if (i<1) { i=1; } if (i==x->bufsize) { return; } freebytes(x->buf, x->bufsize*sizeof(t_sample)); x->bufsize=i; x->buf=(t_sample *)getbytes(x->bufsize*sizeof(t_sample)); x->phase=0; } static t_int *zN_perform(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); t_zNdelay *x = (t_zNdelay *)(w[3]); int n = (int)(w[4]); t_sample *buf = x->buf; int bufsize=x->bufsize, ph=x->phase; if (bufsize==1) { if (in!=out)while(n--) { *out++=*in++; } } else if (bufsize==2) { register t_sample f, last=*buf; while(n--) { f=*in++; *out++=last; last=f; } *buf=last; } else { while (n--) { *(buf+ph++) = *in++; *out++ = buf[ph%=bufsize]; } x->phase=ph; } return (w+5); } static void zNdelay_dsp(t_zNdelay *x, t_signal **sp) { dsp_add(zN_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); } static void *zNdelay_new(t_symbol*s, int argc, t_atom*argv) { t_zNdelay *x = 0; int i = 0; t_sample *b; switch (argc) { case 0: i=1; break; case 1: if (argv->a_type == A_FLOAT) { i=atom_getint(argv); break; } default: error("Bad arguments for [z~]: must be nought or initial delay [in samples]"); return 0; } x=(t_zNdelay *)pd_new(zNdelay_class); if (i<=0) { i=0; } i++; x->bufsize = i; x->buf = (t_sample *)getbytes(sizeof(t_sample) * x->bufsize); b=x->buf; while (i--) { *b++=0; } x->phase = 0; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1")); outlet_new(&x->x_obj, gensym("signal")); return (x); } static void zNdelay_free(t_zNdelay *x) { freebytes(x->buf, sizeof(t_sample) * x->bufsize); } static void zdel_helper(void) { post("\n"HEARTSYMBOL " z~\t:: samplewise delay"); post("creation :: 'z~ []' : creates a -sample delay; default is 1"); } void z_tilde_setup(void) { zNdelay_class = class_new(gensym("z~"), (t_newmethod)zNdelay_new, (t_method)zNdelay_free, sizeof(t_zNdelay), 0, A_GIMME, 0); class_addmethod(zNdelay_class, nullfn, gensym("signal"), 0); class_addmethod(zNdelay_class, (t_method)zNdelay_dsp, gensym("dsp"), 0); class_addfloat(zNdelay_class, zdel_float); class_addmethod(zNdelay_class, (t_method)zdel_float, gensym("ft1"), A_FLOAT, 0); class_addmethod(zNdelay_class, (t_method)zdel_helper, gensym("help"), 0); zexy_register("z~"); } zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/000077500000000000000000000000001265051730400220555ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/Makefile.am000066400000000000000000000052151265051730400241140ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign TESTS_ENVIRONMENT = RUNTESTS_NOLOG=yes TESTDIR=$(srcdir) TESTS=runtests.sh clean-local: -rm -f runtests.txt EXTRA_DIST = \ README.txt \ runtests.sh \ runtests.bat \ runtests_nogui.pd \ runtests.pd \ testunit.pd EXTRA_DIST += \ msgfile/CR.txt \ msgfile/msgfile.txt \ testtests/README.txt \ absgn~/abs.pd \ absgn~/sgn.pd \ abs~/simple.pd \ and~/dualnoise.pd \ and~/singlenoise.pd \ eq~/dualnoise.pd \ eq~/singlenoise.pd \ gt~/dualnoise.pd \ gt~/singlenoise.pd \ help-msg/0x260x260x7e.pd \ help-msg/0x2e.pd \ help-msg/0x3c0x7e.pd \ help-msg/0x3d0x3d0x7e.pd \ help-msg/0x3e0x7e.pd \ help-msg/0x7c0x7c0x7e.pd \ help-msg/a2l.pd \ help-msg/absgn~.pd \ help-msg/abs~.pd \ help-msg/atoi.pd \ help-msg/avg~.pd \ help-msg/blockmirror~.pd \ help-msg/blockswap~.pd \ help-msg/date.pd \ help-msg/demultiplex~.pd \ help-msg/demultiplex.pd \ help-msg/dfreq~.pd \ help-msg/dirac~.pd \ help-msg/drip.pd \ help-msg/envrms~.pd \ help-msg/fifop.pd \ help-msg/glue.pd \ help-msg/index.pd \ help-msg/length.pd \ help-msg/lifop.pd \ help-msg/limiter~.pd \ help-msg/list2int.pd \ help-msg/list2symbol.pd \ help-msg/lister.pd \ help-msg/lpt.pd \ help-msg/makesymbol.pd \ help-msg/mavg.pd \ help-msg/minmax.pd \ help-msg/msgfile.pd \ help-msg/multiline~.pd \ help-msg/multiplex~.pd \ help-msg/multiplex.pd \ help-msg/niagara.pd \ help-msg/noish~.pd \ help-msg/noisi~.pd \ help-msg/operating_system.pd \ help-msg/packel.pd \ help-msg/pack~.pd \ help-msg/pdf~.pd \ help-msg/prime.pd \ help-msg/quantize~.pd \ help-msg/regex.pd \ help-msg/relay.pd \ help-msg/repack.pd \ help-msg/repeat.pd \ help-msg/sfplay.pd \ help-msg/sfrecord.pd \ help-msg/sgn~.pd \ help-msg/sigzero~.pd \ help-msg/sort.pd \ help-msg/step~.pd \ help-msg/strcmp.pd \ help-msg/sum.pd \ help-msg/swap~.pd \ help-msg/symbol2list.pd \ help-msg/tabdump.pd \ help-msg/tabminmax.pd \ help-msg/tabset.pd \ help-msg/tavg~.pd \ help-msg/time.pd \ help-msg/unpack~.pd \ help-msg/urn.pd \ help-msg/wrap.pd \ help-msg/zexy_.pd \ help-msg/z~.pd \ l2s/argument.pd \ l2s/delimiter.pd \ list2lists/negativelength.pd \ lister/inline2.pd \ lister/inline.pd \ lt~/dualnoise.pd \ lt~/singlenoise.pd \ msgfile/add2.pd \ msgfile/empty_at_end.pd \ msgfile/emptyreplace.pd \ msgfile/loadingCR.pd \ msgfile/loading.pd \ msgfile/prev_from_end.pd \ msgfile/reentrant.pd \ or~/dualnoise.pd \ or~/singlenoise.pd \ repeat/noargs.pd \ s2l/numsymbols.pd \ sgn~/simple.pd \ testtests/fail_noresult.pd \ testtests/fail.pd \ testtests/fail_wait0.pd \ testtests/fail_wait10.pd \ testtests/pass.pd \ testtests/pass_wait0.pd \ testtests/pass_wait10.pd zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/README.txt000066400000000000000000000036651265051730400235650ustar00rootroot00000000000000regression test framework ========================= this is a simple framework for regression tests for pd-objects HOW TESTS WORK: --------------- each test is a patch with one (1) inlet and one (1) outlet. a bang is sent to the inlet to start the test. the test has to send "1" to the outlet if the test succeeded. any other result will be considered a failure of the test. the test MUST return a result, else it will halt the entire testrun. (this is needed to allow objects that do not return in zero-time (signal-objects or other timed objects) to be tested with this framework too) example tests of [==]: GOOD test: [inlet] | [10 10( | [==] | [outlet] BAD test (will hang forever): [inlet] | [10 10.1( | [==] | [select 0] | [1( | [outlet] HOW THE FRAMEWORK WORKS ----------------------- all .pd-files in one-level-subdirectories are considered tests. e.g. ./subdir/patch1.pd is tested, while ./patch2.pd and ./sub/dir/patch3.pd are not taken into account this is important if you need abstractions for your test at the beginning of the testrun a file "runtests.txt" is generated which contains all test-patches, one per line and each line terminated by semicolon. then pd is started and "runtests.txt" is read (via [textfile]). for each line in the file, an object is created, a bang is sent to the object and the result is received and compared with "1". a result-message is printed. when all the tests have been run, a summary of how many tests have been run (and how many tests have been run successfully), and pd quits. printout is first done into a logfile "runtests.log". this logfile is printed to the stdout after pd quit. CAVEATS ======= pd-0.40 has problems creating an path-prefixed abstraction when a library of the same name is already loaded. e.g. if the library "zexy" is loaded, then the abstraction ./path/zexy.pd CANNOT be instantiated as object [./path/zexy]; this seems to be fixed in newer versions of pd zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/absgn~/000077500000000000000000000000001265051730400233455ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/absgn~/abs.pd000066400000000000000000000064271265051730400244500ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #X obj 91 138 t b b; #X msg 194 138 bang; #X obj 124 221 switch~ 64; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #X obj 117 145 table \$0-input 64; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 96 227 tabreceive~ \$0-input; #X connect 2 0 1 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 133 tabsend~ \$0-input; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X connect 1 0 0 0; #X restore 119 194 pd generate~; #X connect 2 0 0 0; #X connect 3 0 2 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 229 tabread \$0-input; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 206 t f f; #X connect 1 0 13 0; #X connect 4 0 9 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 17 0; #X connect 7 0 18 1; #X connect 8 0 10 0; #X connect 9 0 11 0; #X connect 10 0 9 0; #X connect 10 1 2 0; #X connect 10 2 15 0; #X connect 11 0 12 0; #X connect 13 0 3 0; #X connect 13 1 5 0; #X connect 14 0 9 1; #X connect 15 0 14 0; #X connect 16 0 5 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 18 0 20 0; #X connect 19 0 18 1; #X connect 20 0 8 0; #X connect 20 1 11 1; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X obj 176 331 t f f; #X msg 210 390 -1; #X obj 91 202 t b b; #X obj 91 162 del 10; #X obj 158 274 absgn~; #X obj 187 303 abs; #X obj 91 254 del 10; #X connect 0 0 2 0; #X connect 2 0 12 0; #X connect 2 1 10 0; #X connect 3 0 12 0; #X connect 5 0 13 0; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 7 1 9 0; #X connect 9 1 14 0; #X connect 10 0 8 0; #X connect 11 0 15 0; #X connect 11 1 4 0; #X connect 12 0 11 0; #X connect 13 0 6 1; #X connect 14 0 7 1; #X connect 15 0 7 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/absgn~/sgn.pd000066400000000000000000000070271265051730400244670ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #X obj 91 138 t b b; #X msg 194 138 bang; #X obj 124 221 switch~ 64; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #X obj 117 145 table \$0-input 64; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 96 227 tabreceive~ \$0-input; #X connect 2 0 1 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 133 tabsend~ \$0-input; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X connect 1 0 0 0; #X restore 119 194 pd generate~; #X connect 2 0 0 0; #X connect 3 0 2 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 229 tabread \$0-input; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 206 t f f; #X connect 1 0 13 0; #X connect 4 0 9 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 17 0; #X connect 7 0 18 1; #X connect 8 0 10 0; #X connect 9 0 11 0; #X connect 10 0 9 0; #X connect 10 1 2 0; #X connect 10 2 15 0; #X connect 11 0 12 0; #X connect 13 0 3 0; #X connect 13 1 5 0; #X connect 14 0 9 1; #X connect 15 0 14 0; #X connect 16 0 5 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 18 0 20 0; #X connect 19 0 18 1; #X connect 20 0 8 0; #X connect 20 1 11 1; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 91 202 t b b; #X obj 91 162 del 10; #X obj 158 274 absgn~; #X obj 261 295 t f; #X obj 261 317 select 0; #X msg 261 339 0; #X obj 314 337 moses 0; #X msg 314 359 -1; #X obj 314 381 t f; #X msg 360 358 1; #X obj 91 254 del 10; #X connect 0 0 2 0; #X connect 2 0 11 0; #X connect 2 1 9 0; #X connect 3 0 11 0; #X connect 5 0 12 0; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 7 1 13 0; #X connect 9 0 8 0; #X connect 10 0 20 0; #X connect 10 1 4 0; #X connect 11 0 10 0; #X connect 12 1 6 1; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 14 1 16 0; #X connect 15 0 18 0; #X connect 16 0 17 0; #X connect 16 1 19 0; #X connect 17 0 18 0; #X connect 18 0 7 1; #X connect 19 0 18 0; #X connect 20 0 7 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/abs~/000077500000000000000000000000001265051730400230205ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/abs~/simple.pd000066400000000000000000000063301265051730400246400ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #X obj 91 138 t b b; #X msg 194 138 bang; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #X obj 117 145 table \$0-input 64; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 96 227 tabreceive~ \$0-input; #X connect 2 0 1 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 133 tabsend~ \$0-input; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X connect 1 0 0 0; #X restore 119 194 pd generate~; #X connect 2 0 0 0; #X connect 3 0 2 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X obj 233 302 pack 0 0 0; #X obj 234 327 print abs~; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 9 1 20 2; #X connect 10 0 13 0; #X connect 10 0 20 0; #X connect 11 0 13 1; #X connect 11 0 20 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 229 tabread \$0-input; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 206 t f f; #X connect 1 0 13 0; #X connect 4 0 9 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 17 0; #X connect 7 0 18 1; #X connect 8 0 10 0; #X connect 9 0 11 0; #X connect 10 0 9 0; #X connect 10 1 2 0; #X connect 10 2 15 0; #X connect 11 0 12 0; #X connect 13 0 3 0; #X connect 13 1 5 0; #X connect 14 0 9 1; #X connect 15 0 14 0; #X connect 16 0 5 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 18 0 20 0; #X connect 19 0 18 1; #X connect 20 0 8 0; #X connect 20 1 11 1; #X restore 91 303 pd reference; #X obj 187 303 abs; #X obj 91 396 outlet result; #X obj 176 331 t f f; #X msg 210 390 -1; #X obj 158 274 abs~; #X obj 91 201 bang~; #X connect 0 0 2 0; #X connect 2 1 10 0; #X connect 4 0 11 0; #X connect 5 0 8 0; #X connect 6 0 5 0; #X connect 6 1 9 0; #X connect 7 0 6 1; #X connect 9 1 7 0; #X connect 10 0 8 0; #X connect 11 0 5 1; #X connect 12 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/and~/000077500000000000000000000000001265051730400230155ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/and~/dualnoise.pd000066400000000000000000000070751265051730400253360ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 112 noise~; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 3 0 4 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 250 303 unpack; #X obj 158 274 &&~; #X obj 250 326 &&; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X connect 0 0 12 0; #X connect 2 0 8 0; #X connect 2 1 8 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 1 7 0; #X connect 6 0 5 0; #X connect 7 0 9 0; #X connect 7 1 9 1; #X connect 8 0 3 1; #X connect 9 0 4 1; #X connect 11 0 4 0; #X connect 12 1 10 0; #X connect 12 2 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/and~/singlenoise.pd000066400000000000000000000070461265051730400256700ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 0 0 3 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 250 303 unpack; #X obj 158 274 &&~; #X obj 250 326 &&; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X connect 0 0 12 0; #X connect 2 0 8 0; #X connect 2 1 8 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 1 7 0; #X connect 6 0 5 0; #X connect 7 0 9 0; #X connect 7 1 9 1; #X connect 8 0 3 1; #X connect 9 0 4 1; #X connect 11 0 4 0; #X connect 12 1 10 0; #X connect 12 2 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/eq~/000077500000000000000000000000001265051730400226605ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/eq~/dualnoise.pd000066400000000000000000000113061265051730400251710ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 238 169 688 300 input 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 0 0 3 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X obj 447 128 r \$0-init; #X obj 447 150 t b b; #X obj 447 172 random 100; #X obj 447 194 / 100; #X msg 447 216 const \$1; #X obj 447 238 s \$0-input1; #X obj 538 172 random 100; #X obj 538 194 / 100; #X msg 538 216 const \$1; #X obj 537 238 s \$0-input2; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 1 12 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X restore 158 243 pd input; #N canvas 0 0 1020 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 398 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 329 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 356 == 0; #X obj 52 144 until; #X obj 108 301 t f f; #X obj 52 197 t f f f; #X obj 342 321 print diff; #X obj 342 293 pack 0 0 0; #X obj 447 128 r \$0-init; #X obj 447 172 random 100; #X obj 447 194 / 100; #X msg 447 216 const \$1; #X obj 447 238 s \$0-result; #X obj 447 150 t b; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 20 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 18 0; #X connect 8 0 4 1; #X connect 9 0 12 0; #X connect 9 0 22 0; #X connect 10 0 12 1; #X connect 10 0 22 1; #X connect 11 0 17 0; #X connect 12 0 13 0; #X connect 13 1 19 0; #X connect 14 0 15 0; #X connect 15 0 11 0; #X connect 15 1 6 0; #X connect 15 2 16 0; #X connect 16 0 11 1; #X connect 17 0 3 0; #X connect 18 0 4 0; #X connect 19 0 11 1; #X connect 20 0 9 0; #X connect 20 1 10 0; #X connect 20 2 22 2; #X connect 23 0 28 0; #X connect 24 0 25 0; #X connect 25 0 26 0; #X connect 26 0 27 0; #X connect 28 0 24 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 128 273 / 100; #X obj 128 251 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X obj 447 128 r \$0-init; #X obj 447 150 t b b; #X obj 447 172 random 100; #X obj 447 194 / 100; #X msg 447 216 const \$1; #X obj 447 238 s \$0-reference; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X connect 24 0 25 0; #X connect 25 0 26 0; #X connect 26 0 27 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 180 367 -1; #X obj 250 303 unpack; #X obj 250 326 ==; #X obj 158 274 ==~; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 148 138 bang; #X connect 0 0 12 0; #X connect 2 0 9 0; #X connect 2 1 9 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 1 7 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 7 1 8 1; #X connect 8 0 4 1; #X connect 9 0 3 1; #X connect 11 0 4 0; #X connect 12 1 10 0; #X connect 12 2 6 0; #X connect 13 0 12 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/eq~/singlenoise.pd000066400000000000000000000104121265051730400255220ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 0 0 1020 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 398 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 329 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 356 == 0; #X obj 52 144 until; #X obj 108 301 t f f; #X obj 52 197 t f f f; #X obj 342 321 print diff; #X obj 342 293 pack 0 0 0; #X obj 447 128 r \$0-init; #X obj 447 172 random 100; #X obj 447 194 / 100; #X msg 447 216 const \$1; #X obj 447 238 s \$0-result; #X obj 447 150 t b; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 20 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 18 0; #X connect 8 0 4 1; #X connect 9 0 12 0; #X connect 9 0 22 0; #X connect 10 0 12 1; #X connect 10 0 22 1; #X connect 11 0 17 0; #X connect 12 0 13 0; #X connect 13 1 19 0; #X connect 14 0 15 0; #X connect 15 0 11 0; #X connect 15 1 6 0; #X connect 15 2 16 0; #X connect 16 0 11 1; #X connect 17 0 3 0; #X connect 18 0 4 0; #X connect 19 0 11 1; #X connect 20 0 9 0; #X connect 20 1 10 0; #X connect 20 2 22 2; #X connect 23 0 28 0; #X connect 24 0 25 0; #X connect 25 0 26 0; #X connect 26 0 27 0; #X connect 28 0 24 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 128 273 / 100; #X obj 128 251 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X obj 447 128 r \$0-init; #X obj 447 150 t b b; #X obj 447 172 random 100; #X obj 447 194 / 100; #X msg 447 216 const \$1; #X obj 447 238 s \$0-reference; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X connect 24 0 25 0; #X connect 25 0 26 0; #X connect 26 0 27 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 180 367 -1; #X obj 250 303 unpack; #X obj 250 326 ==; #X obj 158 274 ==~; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 148 138 bang; #N canvas 238 169 450 300 input1 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 0 0 3 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input1; #X connect 0 0 11 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 3 1 6 0; #X connect 5 0 4 0; #X connect 6 0 7 0; #X connect 6 1 7 1; #X connect 7 0 3 1; #X connect 8 0 2 1; #X connect 10 0 3 0; #X connect 11 1 9 0; #X connect 11 2 5 0; #X connect 12 0 11 0; #X connect 13 0 8 0; #X connect 13 1 8 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/gt~/000077500000000000000000000000001265051730400226655ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/gt~/dualnoise.pd000066400000000000000000000071461265051730400252050ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 112 noise~; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 3 0 4 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 158 274 >~; #X obj 250 326 >; #X obj 250 303 unpack; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 158 138 bang; #X connect 0 0 12 0; #X connect 2 0 7 0; #X connect 2 1 7 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 1 9 0; #X connect 6 0 5 0; #X connect 7 0 3 1; #X connect 8 0 4 1; #X connect 9 0 8 0; #X connect 9 1 8 1; #X connect 11 0 4 0; #X connect 12 1 10 0; #X connect 12 2 6 0; #X connect 13 0 12 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/gt~/singlenoise.pd000066400000000000000000000071221265051730400255330ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 158 274 >~; #X obj 250 326 >; #X obj 250 303 unpack; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 158 138 bang; #N canvas 238 169 450 300 input1 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 0 0 3 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 253 pd input1; #X connect 0 0 11 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 3 1 8 0; #X connect 5 0 4 0; #X connect 6 0 2 1; #X connect 7 0 3 1; #X connect 8 0 7 0; #X connect 8 1 7 1; #X connect 10 0 3 0; #X connect 11 1 9 0; #X connect 11 2 5 0; #X connect 12 0 11 0; #X connect 13 0 6 0; #X connect 13 1 6 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/000077500000000000000000000000001265051730400235715ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/0x260x260x7e.pd000066400000000000000000000005361265051730400257450ustar00rootroot00000000000000#N canvas 341 512 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [0x260x260x7e] crashes when a "help"-message is sent; #X obj 113 214 &&~; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 1 0; #X connect 4 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/0x2e.pd000066400000000000000000000005241265051730400246750ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [0x2e] crashes when a "help"-message is sent; #X obj 113 214 .; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 1 0; #X connect 4 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/0x3c0x7e.pd000066400000000000000000000005311265051730400253760ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [0x3c0x7e] crashes when a "help"-message is sent; #X obj 113 214 >~; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 1 0; #X connect 4 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/0x3d0x3d0x7e.pd000066400000000000000000000005361265051730400261030ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [0x3d0x3d0x7e] crashes when a "help"-message is sent; #X obj 113 214 ==~; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 1 0; #X connect 4 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/0x3e0x7e.pd000066400000000000000000000005311265051730400254000ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [0x3e0x7e] crashes when a "help"-message is sent; #X obj 113 214 <~; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 1 0; #X connect 4 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/0x7c0x7c0x7e.pd000066400000000000000000000005361265051730400261110ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [0x7c0x7c0x7e] crashes when a "help"-message is sent; #X obj 113 214 ||~; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 1 0; #X connect 4 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/a2l.pd000066400000000000000000000005251265051730400245760ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 a2l; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [a2l] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/absgn~.pd000066400000000000000000000005331265051730400254070ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 absgn~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [absgn~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/abs~.pd000066400000000000000000000005271265051730400250650ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 abs~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [abs~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/atoi.pd000066400000000000000000000005271265051730400250560ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 atoi; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [atoi] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/avg~.pd000066400000000000000000000005271265051730400250750ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 avg~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [avg~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/blockmirror~.pd000066400000000000000000000005471265051730400266470ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 blockmirror~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [blockmirror~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/blockswap~.pd000066400000000000000000000005431265051730400263030ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 blockswap~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [blockswap~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/date.pd000066400000000000000000000005271265051730400250370ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 date; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [date] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/demultiplex.pd000066400000000000000000000005451265051730400264560ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 demultiplex; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [demultiplex] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/demultiplex~.pd000066400000000000000000000005471265051730400266560ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 demultiplex~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [demultiplex~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/dfreq~.pd000066400000000000000000000005331265051730400254160ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 dfreq~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [dfreq~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/dirac~.pd000066400000000000000000000005331265051730400253770ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 dirac~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [dirac~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/drip.pd000066400000000000000000000005271265051730400250600ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 drip; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [drip] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/envrms~.pd000066400000000000000000000005351265051730400256310ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 envrms~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [envrms~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/fifop.pd000066400000000000000000000005311265051730400252200ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 fifop; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [fifop] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/glue.pd000066400000000000000000000005271265051730400250560ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 glue; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [glue] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/index.pd000066400000000000000000000005311265051730400252240ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 index; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [index] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/length.pd000066400000000000000000000005331265051730400254000ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 length; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [length] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/lifop.pd000066400000000000000000000005311265051730400252260ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 lifop; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [lifop] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/limiter~.pd000066400000000000000000000005371265051730400257660ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 limiter~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [limiter~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/list2int.pd000066400000000000000000000005371265051730400256730ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 list2int; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [list2int] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/list2symbol.pd000066400000000000000000000005451265051730400264050ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 list2symbol; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [list2symbol] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/lister.pd000066400000000000000000000005331265051730400254210ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 lister; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [lister] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/lpt.pd000066400000000000000000000005251265051730400247170ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 lpt; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [lpt] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/makesymbol.pd000066400000000000000000000005431265051730400262630ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 makesymbol; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [makesymbol] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/mavg.pd000066400000000000000000000005271265051730400250540ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 mavg; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [mavg] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/minmax.pd000066400000000000000000000005331265051730400254100ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 minmax; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [minmax] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/msgfile.pd000066400000000000000000000005351265051730400255470ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 msgfile; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [msgfile] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/multiline~.pd000066400000000000000000000005431265051730400263200ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 multiline~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [multiline~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/multiplex.pd000066400000000000000000000005411265051730400261410ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 multiplex; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [multiplex] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/multiplex~.pd000066400000000000000000000005431265051730400263410ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 multiplex~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [multiplex~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/niagara.pd000066400000000000000000000005351265051730400255230ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 niagara; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [niagara] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/noish~.pd000066400000000000000000000005331265051730400254350ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 noish~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [noish~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/noisi~.pd000066400000000000000000000005331265051730400254360ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 noisi~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [noisi~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/operating_system.pd000066400000000000000000000005571265051730400275210ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 operating_system; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [operating_system] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/packel.pd000066400000000000000000000005331265051730400253560ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 packel; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [packel] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/pack~.pd000066400000000000000000000005311265051730400252310ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 pack~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [pack~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/pdf~.pd000066400000000000000000000005271265051730400250710ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 pdf~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [pdf~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/prime.pd000066400000000000000000000005311265051730400252310ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 prime; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [prime] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/quantize~.pd000066400000000000000000000005411265051730400261540ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 quantize~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [quantize~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/regex.pd000066400000000000000000000005311265051730400252270ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 regex; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [regex] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/relay.pd000066400000000000000000000005311265051730400252310ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 relay; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [relay] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/repack.pd000066400000000000000000000005331265051730400253640ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 repack; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [repack] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/repeat.pd000066400000000000000000000005331265051730400253770ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 repeat; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [repeat] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/sfplay.pd000066400000000000000000000005331265051730400254150ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 sfplay; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [sfplay] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/sfrecord.pd000066400000000000000000000005371265051730400257320ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 sfrecord; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [sfrecord] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/sgn~.pd000066400000000000000000000005271265051730400251070ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 sgn~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [sgn~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/sigzero~.pd000066400000000000000000000005371265051730400260030ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 sigzero~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [sigzero~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/sort.pd000066400000000000000000000005271265051730400251110ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 sort; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [sort] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/step~.pd000066400000000000000000000005311265051730400252660ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 step~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [step~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/strcmp.pd000066400000000000000000000005331265051730400254270ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 strcmp; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [strcmp] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/sum.pd000066400000000000000000000005251265051730400247240ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 sum; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [sum] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/swap~.pd000066400000000000000000000005311265051730400252650ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 swap~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [swap~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/symbol2list.pd000066400000000000000000000005451265051730400264050ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 symbol2list; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [symbol2list] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/tabdump.pd000066400000000000000000000005351265051730400255550ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 tabdump; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [tabdump] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/tabminmax.pd000066400000000000000000000005411265051730400260760ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 tabminmax; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [tabminmax] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/tabset.pd000066400000000000000000000005331265051730400254010ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 tabset; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [tabset] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/tavg~.pd000066400000000000000000000005311265051730400252540ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 tavg~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [tavg~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/time.pd000066400000000000000000000005271265051730400250600ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 time; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [time] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/unpack~.pd000066400000000000000000000005351265051730400256000ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 unpack~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [unpack~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/urn.pd000066400000000000000000000005251265051730400247240ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 urn; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [urn] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/wrap.pd000066400000000000000000000005271265051730400250730ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 wrap; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [wrap] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/zexy_.pd000066400000000000000000000005271265051730400252600ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 zexy; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [zexy] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/help-msg/z~.pd000066400000000000000000000005231265051730400245650ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 113 214 z~; #X obj 91 240 i 1; #X msg 113 183 help; #X text 37 51 tests whether [z~] crashes when a "help"-message is sent; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 4 0 1 0; #X connect 5 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/l2s/000077500000000000000000000000001265051730400225555ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/l2s/argument.pd000066400000000000000000000011541265051730400247250ustar00rootroot00000000000000#N canvas 349 104 581 409 10; #X obj 74 255 outlet; #X obj 74 7 inlet; #X obj 74 28 b; #X text 169 7 the argument is now the delimiter; #X msg 74 50 list 192 168 7 1; #X obj 74 89 t l l b; #X obj 124 126 l2s; #X obj 74 126 l2s .; #X msg 144 106 symbol .; #X obj 74 155 select s; #X msg 74 181 1; #X msg 133 180 0; #X obj 74 214 t f; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 4 0 5 0; #X connect 5 0 7 0; #X connect 5 1 6 0; #X connect 5 2 8 0; #X connect 6 0 9 1; #X connect 7 0 9 0; #X connect 8 0 6 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 12 0; #X connect 11 0 12 0; #X connect 12 0 0 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/l2s/delimiter.pd000066400000000000000000000012171265051730400250610ustar00rootroot00000000000000#N canvas 349 104 581 409 10; #X obj 74 255 outlet; #X obj 74 7 inlet; #X obj 74 28 b; #X msg 74 50 list 192 168 7 1; #X obj 74 130 l2s; #X msg 93 110 symbol .; #X obj 74 155 select s; #X msg 74 181 1; #X msg 133 180 0; #X obj 74 214 t f; #X obj 74 89 t l b b; #X msg 133 135 symbol 192.168.7.1; #X text 21 -14 check whether the generated symbol is what we expect... ; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 10 0; #X connect 4 0 6 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 9 0; #X connect 8 0 9 0; #X connect 9 0 0 0; #X connect 10 0 4 0; #X connect 10 1 5 0; #X connect 10 2 11 0; #X connect 11 0 6 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/list2lists/000077500000000000000000000000001265051730400241715ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/list2lists/negativelength.pd000066400000000000000000000025501265051730400275240ustar00rootroot00000000000000#N canvas 57 57 608 610 10; #X obj 86 213 t b b; #X obj 86 190 inlet run_test; #X obj 86 488 outlet; #X msg 86 420 0; #X obj 86 455 t f; #X obj 134 327 list2lists; #X msg 134 276 1 2 3 4; #X text 73 33 currently [list2lists] does not check for negative list lengths and allows them just fine \, which can easily lead to segfaults (e.g. with a list-length of "-8000"); #X text 76 90 i don't knw exactly how this should be handled; #X text 125 114 i guess it would be best to just issue an error and clamp the list-length to 0; #X msg 201 305 list 2 -2 2; #X text 223 333 the wrong output will be "1 2 \, bang \, 1 2"; #X msg 147 226 bang; #X obj 134 351 route bang; #X obj 134 252 t b b b; #X obj 123 406 repack 100; #X msg 134 376 symbol BANG; #X obj 123 429 unpack 0 0 s 0 0; #X obj 203 476 +; #X obj 206 500 != 0; #X floatatom 128 511 5 0 0 0 - - -; #X obj 203 454 == 3; #X obj 243 450 == 4; #X connect 0 0 3 0; #X connect 0 1 14 0; #X connect 1 0 0 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 4 0 20 0; #X connect 5 0 13 0; #X connect 6 0 5 0; #X connect 10 0 5 1; #X connect 12 0 14 0; #X connect 13 0 16 0; #X connect 13 1 15 0; #X connect 14 0 15 0; #X connect 14 1 6 0; #X connect 14 2 10 0; #X connect 15 0 17 0; #X connect 16 0 15 0; #X connect 17 3 21 0; #X connect 17 4 22 0; #X connect 18 0 19 0; #X connect 19 0 4 0; #X connect 21 0 18 0; #X connect 22 0 18 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/lister/000077500000000000000000000000001265051730400233575ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/lister/inline.pd000066400000000000000000000007371265051730400251710ustar00rootroot00000000000000#N canvas 330 540 450 376 10; #X obj 140 166 t l l; #X obj 210 206 + 1; #X msg 140 118 1; #X msg 210 227 list \$1; #X obj 140 145 lister; #X obj 140 265 f; #X obj 210 188 f; #X obj 140 285 == 1; #X obj 140 47 inlet; #X obj 140 75 t b; #X obj 140 327 outlet; #X connect 0 0 5 0; #X connect 0 1 6 0; #X connect 1 0 3 0; #X connect 2 0 4 0; #X connect 3 0 4 1; #X connect 4 0 0 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 9 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/lister/inline2.pd000066400000000000000000000011461265051730400252460ustar00rootroot00000000000000#N canvas 109 76 453 304 10; #X obj 44 158 l; #X obj 44 215 list split 1; #X msg 69 124 1 2 3 4; #X text 11 32 I expect this to output 1 instead of 2 when first banged... ; #X obj 105 155 list split 1; #X obj 105 182 list prepend; #X obj 44 179 t a a; #X obj 44 100 t b b; #X obj 44 234 f; #X obj 44 257 == 1; #X obj 44 81 inlet; #X obj 44 277 outlet; #X connect 0 0 6 0; #X connect 1 0 8 0; #X connect 2 0 0 1; #X connect 4 0 5 0; #X connect 4 1 5 1; #X connect 5 0 0 1; #X connect 6 0 1 0; #X connect 6 1 4 0; #X connect 7 0 0 0; #X connect 7 1 2 0; #X connect 8 0 9 0; #X connect 9 0 11 0; #X connect 10 0 7 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/lt~/000077500000000000000000000000001265051730400226725ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/lt~/dualnoise.pd000066400000000000000000000071461265051730400252120ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 112 noise~; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 3 0 4 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 250 303 unpack; #X obj 158 274 <~; #X obj 250 326 <; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 158 138 bang; #X connect 0 0 12 0; #X connect 2 0 8 0; #X connect 2 1 8 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 1 7 0; #X connect 6 0 5 0; #X connect 7 0 9 0; #X connect 7 1 9 1; #X connect 8 0 3 1; #X connect 9 0 4 1; #X connect 11 0 4 0; #X connect 12 1 10 0; #X connect 12 2 6 0; #X connect 13 0 12 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/lt~/singlenoise.pd000066400000000000000000000071221265051730400255400ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 250 303 unpack; #X obj 158 274 <~; #X obj 250 326 <; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 158 138 bang; #N canvas 238 169 450 300 input1 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 0 0 3 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input1; #X connect 0 0 11 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 3 1 6 0; #X connect 5 0 4 0; #X connect 6 0 8 0; #X connect 6 1 8 1; #X connect 7 0 2 1; #X connect 8 0 3 1; #X connect 10 0 3 0; #X connect 11 1 9 0; #X connect 11 2 5 0; #X connect 12 0 11 0; #X connect 13 0 7 0; #X connect 13 1 7 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/000077500000000000000000000000001265051730400235035ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/CR.txt000066400000000000000000000000651265051730400245510ustar00rootroot00000000000000cis boom bah bang after the break of dawn appendix zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/add2.pd000066400000000000000000000004631265051730400246450ustar00rootroot00000000000000#N canvas 401 102 550 495 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 110 212 msgfile; #X msg 110 186 add2 1 2 3 4; #X obj 91 240 i 1; #X text 57 56 crasher bug; #X connect 0 0 2 0; #X connect 2 0 5 0; #X connect 2 1 4 0; #X connect 4 0 3 0; #X connect 5 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/empty_at_end.pd000066400000000000000000000012731265051730400265030ustar00rootroot00000000000000#N canvas 57 57 492 370 10; #X obj 86 43 t b b; #X obj 86 20 inlet run_test; #X obj 86 318 outlet; #X obj 182 147 t a a; #X obj 182 176 msgfile; #X msg 228 86 add 1 \, add 2 \, rewind \, bang \, bang; #X msg 182 118 rewind \, bang; #X obj 182 60 t b b b; #X obj 182 201 spigot; #X msg 245 177 1; #X obj 182 228 t b; #X msg 182 250 1; #X msg 86 250 0; #X obj 86 285 t f; #X connect 0 0 12 0; #X connect 0 1 7 0; #X connect 1 0 0 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 3 0; #X connect 6 0 3 0; #X connect 7 0 6 0; #X connect 7 1 9 0; #X connect 7 2 5 0; #X connect 8 0 10 0; #X connect 9 0 8 1; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 13 0; #X connect 13 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/emptyreplace.pd000066400000000000000000000007371265051730400265310ustar00rootroot00000000000000#N canvas 0 0 454 304 10; #X obj 182 147 msgfile; #X msg 207 78 goto 12; #X msg 182 118 replace crash; #X obj 182 60 t b b; #X obj 86 43 t b b; #X obj 86 20 inlet run_test; #X msg 86 190 1; #X obj 86 218 outlet; #X text 128 192 if we survive the test \, we automatically pass it ; #X text 190 37 this is a crash-test!; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 2 0; #X connect 3 1 1 0; #X connect 4 0 6 0; #X connect 4 1 3 0; #X connect 5 0 4 0; #X connect 6 0 7 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/loading.pd000066400000000000000000000015231265051730400254460ustar00rootroot00000000000000#N canvas 57 57 673 398 10; #X obj 86 20 inlet run_test; #X obj 86 348 outlet; #X obj 182 147 t a a; #X obj 182 176 msgfile; #X obj 182 60 t b b b; #X obj 182 201 spigot; #X msg 245 177 1; #X obj 182 228 t b; #X msg 182 250 1; #X msg 229 23 bang; #X msg 182 118 bang; #X obj 86 285 i; #X floatatom 107 317 5 0 0 0 - - -; #X obj 86 43 t b b b; #X msg 132 66 0; #X msg 266 146 print; #X msg 227 86 clear \, read msgfile.txt \, rewind; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 10 0; #X connect 4 1 6 0; #X connect 4 2 16 0; #X connect 5 0 7 0; #X connect 6 0 5 1; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 9 0 13 0; #X connect 10 0 2 0; #X connect 11 0 1 0; #X connect 11 0 12 0; #X connect 13 0 11 0; #X connect 13 1 4 0; #X connect 13 2 14 0; #X connect 14 0 11 1; #X connect 15 0 3 0; #X connect 16 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/loadingCR.pd000066400000000000000000000015211265051730400256710ustar00rootroot00000000000000#N canvas 57 57 673 398 10; #X obj 86 20 inlet run_test; #X obj 86 348 outlet; #X obj 182 147 t a a; #X obj 182 176 msgfile; #X obj 182 60 t b b b; #X obj 182 201 spigot; #X msg 245 177 1; #X obj 182 228 t b; #X msg 182 250 1; #X msg 229 23 bang; #X msg 182 118 bang; #X obj 86 285 i; #X floatatom 107 317 5 0 0 0 - - -; #X obj 86 43 t b b b; #X msg 132 66 0; #X msg 266 146 print; #X msg 227 86 clear \, read CR.txt cr \, rewind; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 10 0; #X connect 4 1 6 0; #X connect 4 2 16 0; #X connect 5 0 7 0; #X connect 6 0 5 1; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 9 0 13 0; #X connect 10 0 2 0; #X connect 11 0 1 0; #X connect 11 0 12 0; #X connect 13 0 11 0; #X connect 13 1 4 0; #X connect 13 2 14 0; #X connect 14 0 11 1; #X connect 15 0 3 0; #X connect 16 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/msgfile.txt000066400000000000000000000000651265051730400256730ustar00rootroot00000000000000cis boom bah bang; after the break of dawn appendix; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/prev_from_end.pd000066400000000000000000000033311265051730400266550ustar00rootroot00000000000000#N canvas 57 57 869 598 10; #X obj 86 240 inlet run_test; #X obj 86 538 outlet; #X obj 182 357 t a a; #X obj 182 427 spigot; #X msg 245 387 1; #X msg 182 490 1; #X msg 106 470 0; #X msg 182 338 prev; #X msg 237 245 bang; #X obj 86 505 i; #X obj 86 263 t b b b; #X obj 182 468 select 2; #X msg 235 491 0; #X msg 273 364 \$1; #X msg 228 306 clear \, add 1 \, add 2 \, rewind \, end \, bang; #X symbolatom 273 345 10 0 0 0 - - -; #X obj 182 406 t a a; #X obj 182 386 msgfile; #X obj 195 523 t f f; #X obj 234 546 print inter; #X msg 257 408 0; #X text 80 104 this test seeks to the end of a msgfile and then beyond this end (which should stay at the end).; #X text 81 134 it then tries to read the "previous" line in the msgfile (that is: the last real line); #X floatatom 150 545 5 0 0 0 - - -; #X obj 182 280 t b b b b; #X obj 349 459 print __; #X obj 182 447 t a a; #X msg 359 362 clear \, add 1 \, add 2 \, rewind \, end; #X msg 320 395 bang; #X text 83 48 bug to detect: when [msgfile] has reached the "end"of its buffer \, it cannot access the previous elements any more; #X text 54 32 BUG:; #X text 55 91 TEST:; #X connect 0 0 10 0; #X connect 2 0 17 0; #X connect 3 0 26 0; #X connect 4 0 3 1; #X connect 5 0 18 0; #X connect 6 0 9 1; #X connect 7 0 2 0; #X connect 8 0 10 0; #X connect 9 0 1 0; #X connect 9 0 23 0; #X connect 10 0 9 0; #X connect 10 1 24 0; #X connect 10 2 6 0; #X connect 11 0 5 0; #X connect 11 1 12 0; #X connect 12 0 18 0; #X connect 13 0 17 0; #X connect 14 0 2 0; #X connect 15 0 13 0; #X connect 16 0 3 0; #X connect 17 0 16 0; #X connect 18 0 9 0; #X connect 20 0 3 1; #X connect 24 0 7 0; #X connect 24 1 4 0; #X connect 24 2 14 0; #X connect 24 3 20 0; #X connect 26 0 11 0; #X connect 27 0 17 0; #X connect 28 0 17 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/msgfile/reentrant.pd000066400000000000000000000020251265051730400260310ustar00rootroot00000000000000#N canvas 400 106 550 495 10; #X obj 91 117 inlet bang; #X obj 91 410 outlet result; #X obj 91 138 t b b b; #X obj 91 380 i; #X text 57 56 when the outlet of [msgfile] is used to trigger the object \, the same line will be output again and again instead of advancing to the next line.; #X obj 109 252 msgfile; #X obj 79 270 t b l; #X msg 109 186 bang; #X msg 157 183 clear \, add line #1 \, add line #2 \, add end-of-the-world \, rewind; #X obj 104 287 route symbol; #X obj 104 304 symbol; #X obj 104 324 select end-of-the-world; #X msg 104 344 1; #X msg 133 344 0; #X obj 171 305 t b; #X obj 104 360 t f; #X obj 109 157 t b b; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 16 0; #X connect 2 2 13 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 5 0; #X connect 6 1 9 0; #X connect 7 0 5 0; #X connect 8 0 5 0; #X connect 9 0 10 0; #X connect 9 1 14 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 15 0; #X connect 13 0 15 0; #X connect 14 0 13 0; #X connect 15 0 3 1; #X connect 16 0 7 0; #X connect 16 1 8 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/or~/000077500000000000000000000000001265051730400226735ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/or~/dualnoise.pd000066400000000000000000000073441265051730400252130ustar00rootroot00000000000000#N canvas 527 170 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 112 noise~; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 3 0 4 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input; #N canvas 363 165 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X obj 195 327 pack 0 0 0; #X obj 195 349 print or~; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 9 1 20 2; #X connect 10 0 13 0; #X connect 10 0 20 0; #X connect 11 0 13 1; #X connect 11 0 20 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 250 303 unpack; #X obj 250 326 ||; #X obj 158 274 ||~; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 158 138 bang; #X connect 0 0 12 0; #X connect 2 0 9 0; #X connect 2 1 9 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 1 7 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 7 1 8 1; #X connect 8 0 4 1; #X connect 9 0 3 1; #X connect 11 0 4 0; #X connect 12 1 10 0; #X connect 12 2 6 0; #X connect 13 0 12 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/or~/singlenoise.pd000066400000000000000000000075721265051730400255520ustar00rootroot00000000000000#N canvas 527 170 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #N canvas 363 165 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X obj 195 327 pack 0 0 0; #X obj 195 349 print or~; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 9 1 20 2; #X connect 10 0 13 0; #X connect 10 0 20 0; #X connect 11 0 13 1; #X connect 11 0 20 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 186 t f f; #X obj 69 208 t f f; #X obj 69 229 tabread \$0-input1; #X obj 199 229 tabread \$0-input2; #X obj 237 348 pack; #X connect 1 0 12 0; #X connect 4 0 8 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 16 0; #X connect 7 0 17 1; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 9 1 23 0; #X connect 9 2 14 0; #X connect 10 0 11 0; #X connect 12 0 3 0; #X connect 12 1 5 0; #X connect 13 0 8 1; #X connect 14 0 13 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 1; #X connect 19 0 20 0; #X connect 19 1 10 1; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 21 0 9 0; #X connect 22 0 23 1; #X connect 23 0 2 0; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 250 303 unpack; #X obj 250 326 ||; #X obj 134 162 s \$0-init; #X obj 91 162 bang~; #X obj 91 138 t b b b; #X msg 158 138 bang; #N canvas 238 169 450 300 input1 0; #X obj 119 243 outlet~; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 258 255 outlet~; #X obj 96 227 tabreceive~ \$0-input1; #X obj 258 227 tabreceive~ \$0-input2; #X connect 3 0 1 0; #X connect 4 0 2 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X obj 120 133 tabsend~ \$0-input1; #X obj 259 134 tabsend~ \$0-input2; #X connect 0 0 2 0; #X connect 0 0 3 0; #X restore 119 194 pd generate~; #X obj 117 145 table \$0-input1 64; #X obj 257 145 table \$0-input2 64; #X obj 178 243 outlet~; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 2 0 1 0; #X restore 158 243 pd input1; #X obj 158 274 ||~; #X text 278 194 the [||~] implementation currently behaves different from [||] when in SSE mode (the default): it uses !=0 for integer conversion rather than abs()>=1; #X connect 0 0 10 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 3 1 6 0; #X connect 5 0 4 0; #X connect 6 0 7 0; #X connect 6 1 7 1; #X connect 7 0 3 1; #X connect 9 0 3 0; #X connect 10 1 8 0; #X connect 10 2 5 0; #X connect 11 0 10 0; #X connect 12 0 13 0; #X connect 12 1 13 1; #X connect 13 0 2 1; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/repeat/000077500000000000000000000000001265051730400233355ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/repeat/noargs.pd000066400000000000000000000007641265051730400251620ustar00rootroot00000000000000#N canvas 179 117 582 310 10; #X obj 91 117 inlet bang; #X obj 91 270 outlet result; #X obj 91 138 t b b b; #X obj 91 240 i; #X msg 107 213 1; #X msg 139 213 0; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #X obj 107 184 repeat; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 7 0; #X connect 2 2 5 0; #X connect 3 0 1 0; #X connect 4 0 3 1; #X connect 5 0 3 1; #X connect 7 0 4 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/runtests.bat000077500000000000000000000003261265051730400244400ustar00rootroot00000000000000@echo off set RUNTESTS_TXT=runtests.txt set RUNTESTS_LOG=runtests.log set LIBFLAGS=-lib ../zexy -path ../abs/ echo %RUNTESTS_LOG% ..\..\..\pd\bin\pd %LIBFLAGS% -nogui runtests_nogui.pd > %RUNTESTS_LOG% 2>&1 zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/runtests.pd000066400000000000000000000013161265051730400242720ustar00rootroot00000000000000#N canvas 687 66 452 500 10; #X obj 177 483 testunit; #X msg 207 261 read runtests.txt \, rewind; #X obj 177 126 bng 40 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 177 351 bang; #X symbolatom 195 458 10 0 0 0 - - -; #X obj 102 314 t b; #X obj 102 342 del 10; #X obj 177 377 textfile; #X obj 177 396 symbol; #X obj 177 421 t s s; #X symbolatom 213 422 0 0 0 0 - - -; #X obj 177 183 t b b b; #X msg 227 212 \; pd dsp 1; #X connect 0 0 5 0; #X connect 1 0 7 0; #X connect 2 0 11 0; #X connect 3 0 7 0; #X connect 4 0 0 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 0 0; #X connect 9 1 10 0; #X connect 11 0 3 0; #X connect 11 1 1 0; #X connect 11 2 12 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/runtests.sh000077500000000000000000000057411265051730400243120ustar00rootroot00000000000000#!/bin/sh ## TODO: ## find zexy (either in ../src or ../) ## if it is not there, assume it is split into externals if [ "x${PD}" = "x" ] then PD=pd fi if which ${PD} > /dev/null then : else echo "Pd is needed to run tests" 1>&2 echo "you can specify the full binary in the PD variable" 1>&2 exit 77 fi echo running tests in ${TESTDIR:=.} SUFFIX=$(date +%y%m%d-%H%M%S) RUNTESTS_FINAL_LOG=runtest-${SUFFIX}.log RUNTESTS_TXT=runtests.txt if which tempfile > /dev/null then RUNTESTS_LOG=$(tempfile) else RUNTESTS_LOG=tmp$$.log fi LIBFLAGS="-path ../src/.libs/:../src/:../ -lib zexy -path ../abs/:${TESTDIR}:." list_tests() { # find . -mindepth 2 -name "*.pd" | sed 's|\.pd$|;|' ls -1 ${TESTDIR}/*/*.pd | sed 's|\.pd$|;|' } debug() { : if [ "x${DEBUG}" = "xyes" ]; then echo $@; fi } evaluate_tests() { local logfile local testfile local numtests testfile=$1 logfile=$2 debug "now evaluating results in ${logfile} (${testfile}" numtests=$(grep -c . ${testfile}) numpass=$(egrep -c "regression-test: (.*/fail.*: failed|.*: OK)$" ${logfile}) numfail=0 failtests="" for t in $(egrep "regression-test: .*: (failed|OK)$" ${logfile} | egrep -v "regression-test: (.*/fail.*: failed|.*: OK)$" | awk '{print $2}') do failtests="${failtests} ${t%:}" let numfail=numfail+1 done debug "number of tests = ${numtests}" echo "regression-test: ======================================" >> ${logfile} echo "regression-test: ${numtests} regression-tests total" >> ${logfile} echo "regression-test: ${numpass} regression-tests passed" >> ${logfile} echo "regression-test: ${numfail} regression-tests failed" >> ${logfile} echo "regression-test: ======================================" >> ${logfile} if [ "x${failtests}" != "x" ]; then echo "regression-test: failed tests: ${failtests}" >> ${logfile} fi debug "show results" cat ${logfile} | egrep "^regression-test: " | sed -e 's/^regression-test: //' } run_nogui() { debug "running test without gui" ${PD} ${LIBFLAGS} -nogui runtests_nogui.pd > ${RUNTESTS_LOG} 2>&1 SUCCESS=$? debug "testing done" evaluate_tests ${RUNTESTS_TXT} ${RUNTESTS_LOG} debug "testing finished" } run_withgui() { debug "running test with gui" ${PD} ${LIBFLAGS} -stderr runtests.pd 2>&1 | tee ${RUNTESTS_LOG} SUCCESS=$? echo "testing completed, no evaluation will be done; see ${RUNTESTS_LOG} for results" } list_tests > ${RUNTESTS_TXT} USEGUI="" DEBUG="" while [ "x$#" != "x0" ] do if test "x$1" = "x-gui"; then USEGUI="yes" fi if test "x$1" = "x-debug"; then DEBUG="yes" fi if test "x$1" = "x-d"; then DEBUG="yes" fi if test "x$1" = "x-nolog"; then RUNTESTS_FINAL_LOG= fi shift done SUCCESS=0 if [ "x${USEGUI}" = "xyes" ]; then run_withgui else run_nogui fi if [ "x${RUNTESTS_NOLOG}" != "x" ]; then RUNTESTS_FINAL_LOG= fi if [ "x${RUNTESTS_FINAL_LOG}" = "x" ]; then : else cat ${RUNTESTS_LOG} >> ${RUNTESTS_FINAL_LOG} fi if [ "x${RUNTESTS_FINAL_LOG}" = "x${RUNTESTS_LOG}" ]; then : else rm -f ${RUNTESTS_LOG} fi exit ${SUCCESS} zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/runtests_nogui.pd000066400000000000000000000023331265051730400254730ustar00rootroot00000000000000#N canvas 338 0 512 588 10; #X obj 86 349 testunit; #X obj 86 270 textfile; #X msg 104 224 read runtests.txt \, rewind; #X obj 86 34 loadbang; #X msg 137 311 \; pd quit; #X obj 86 397 select 0 1; #X obj 111 423 + 1; #X obj 171 423 + 1; #X obj 87 476 i; #X obj 130 476 i; #X obj 130 545 print regression-test; #X msg 130 520 \$1 tests passed; #X msg 87 499 \$1 tests failed; #X obj 87 455 t b b; #X obj 137 290 t b b; #X obj 86 423 i 1; #X obj 146 423 i 1; #X obj 86 136 t b b b; #X msg 137 60 \; pd dsp 1; #X text 182 186 turn on dsp \, just in case an object crashes with dsp enabled...; #X obj 61 375 t b a; #X obj 86 56 t b b; #X obj 86 78 del 10; #X connect 0 0 20 0; #X connect 1 0 0 0; #X connect 1 1 14 0; #X connect 2 0 1 0; #X connect 3 0 21 0; #X connect 5 0 15 0; #X connect 5 1 16 0; #X connect 6 0 15 1; #X connect 7 0 16 1; #X connect 8 0 12 0; #X connect 9 0 11 0; #X connect 11 0 10 0; #X connect 12 0 10 0; #X connect 13 0 8 0; #X connect 13 1 9 0; #X connect 14 0 4 0; #X connect 14 1 13 0; #X connect 15 0 6 0; #X connect 15 0 8 1; #X connect 16 0 7 0; #X connect 16 0 9 1; #X connect 17 0 1 0; #X connect 17 1 2 0; #X connect 20 0 1 0; #X connect 20 1 5 0; #X connect 21 0 22 0; #X connect 21 1 18 0; #X connect 22 0 17 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/s2l/000077500000000000000000000000001265051730400225555ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/s2l/numsymbols.pd000066400000000000000000000022561265051730400253170ustar00rootroot00000000000000#N canvas 349 104 581 409 10; #X msg 74 50 symbol 192.168.7.1:80; #X obj 92 117 s2l :; #X obj 92 218 select 192.168.7.1; #X obj 255 218 select 80; #X msg 255 238 1; #X msg 92 238 1; #X msg 195 238 0; #X msg 304 238 0; #X obj 255 258 t f; #X obj 79 294 f; #X msg 111 98 0; #X obj 79 365 outlet; #X obj 74 7 inlet; #X text 169 7 "192.168.7.1" is a symbol but looks like a number at first glance; #X obj 92 262 t f; #X msg 208 50 symbol 192.168:80; #X obj 92 139 t l l; #X msg 92 172 \$1; #X obj 92 192 symbol; #X msg 255 177 \$2; #X obj 74 78 t b s b; #X obj 79 318 pack 0 0; #X obj 79 342 *; #X obj 74 28 b; #X connect 0 0 20 0; #X connect 1 0 16 0; #X connect 2 0 5 0; #X connect 2 1 6 0; #X connect 3 0 4 0; #X connect 3 1 7 0; #X connect 4 0 8 0; #X connect 5 0 14 0; #X connect 6 0 14 0; #X connect 7 0 8 0; #X connect 8 0 21 1; #X connect 9 0 21 0; #X connect 10 0 8 0; #X connect 10 0 14 0; #X connect 12 0 23 0; #X connect 14 0 9 1; #X connect 15 0 20 0; #X connect 16 0 17 0; #X connect 16 1 19 0; #X connect 17 0 18 0; #X connect 18 0 2 0; #X connect 19 0 3 0; #X connect 20 0 9 0; #X connect 20 1 1 0; #X connect 20 2 10 0; #X connect 21 0 22 0; #X connect 22 0 11 0; #X connect 23 0 0 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/sgn~/000077500000000000000000000000001265051730400230425ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/sgn~/simple.pd000066400000000000000000000065411265051730400246660ustar00rootroot00000000000000#N canvas 217 0 977 584 10; #X obj 91 117 inlet bang; #X text 37 51 may people think that it is a bad idea to not create [repeat] if there is no argument. so this test fails when the object cannot instantiate; #X obj 91 138 t b b; #X msg 194 138 bang; #N canvas 238 169 450 300 input 0; #X obj 119 243 outlet~; #X obj 117 145 table \$0-input 64; #N canvas 0 0 450 300 send 0; #X obj 82 48 inlet~; #X obj 96 255 outlet~; #X obj 96 227 tabreceive~ \$0-input; #X connect 2 0 1 0; #X restore 119 218 pd send; #N canvas 0 0 450 300 generate~ 0; #X obj 120 133 tabsend~ \$0-input; #X obj 120 111 noise~; #X obj 112 182 outlet~; #X connect 1 0 0 0; #X restore 119 194 pd generate~; #X connect 2 0 0 0; #X connect 3 0 2 0; #X restore 158 243 pd input; #N canvas 0 0 631 415 compare 0; #X obj 261 65 inlet~ processed; #X obj 262 94 tabsend~ \$0-output; #X obj 417 92 table \$0-output 64; #X obj 51 378 outlet passed; #X obj 52 169 i; #X obj 83 169 + 1; #X obj 52 103 t b b; #X msg 52 124 64; #X msg 84 123 0; #X obj 52 197 t f f; #X obj 52 229 tabread \$0-output; #X obj 182 229 tabread \$0-reference; #X obj 51 309 f; #X obj 52 257 -; #X obj 52 278 select 0; #X obj 29 44 inlet doit; #X obj 29 71 t b b b; #X msg 127 275 0; #X obj 51 336 == 0; #X obj 52 144 until; #X connect 0 0 1 0; #X connect 4 0 5 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 19 0; #X connect 8 0 4 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 13 0; #X connect 11 0 13 1; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 6 0; #X connect 16 2 17 0; #X connect 17 0 12 1; #X connect 18 0 3 0; #X connect 19 0 4 0; #X restore 91 367 pd compare; #N canvas 1456 193 714 565 reference 0; #X obj 519 101 table \$0-reference 64; #X obj 49 38 inlet doit; #X obj 237 371 outlet in~; #X obj 49 376 outlet done; #X obj 240 86 inlet out~; #X obj 69 92 t b b; #X msg 69 112 64; #X msg 101 112 0; #X obj 69 229 tabread \$0-input; #X obj 69 274 f; #X obj 69 252 t b f b; #X obj 69 300 pack 0 0; #X obj 69 326 tabwrite \$0-reference; #X obj 49 61 t b b; #X obj 129 274 / 100; #X obj 129 252 random 100; #X msg 99 59 bang; #X obj 69 136 until; #X obj 69 162 i; #X obj 99 162 + 1; #X obj 69 206 t f f; #X connect 1 0 13 0; #X connect 4 0 9 1; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 17 0; #X connect 7 0 18 1; #X connect 8 0 10 0; #X connect 9 0 11 0; #X connect 10 0 9 0; #X connect 10 1 2 0; #X connect 10 2 15 0; #X connect 11 0 12 0; #X connect 13 0 3 0; #X connect 13 1 5 0; #X connect 14 0 9 1; #X connect 15 0 14 0; #X connect 16 0 5 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 18 0 20 0; #X connect 19 0 18 1; #X connect 20 0 8 0; #X connect 20 1 11 1; #X restore 91 303 pd reference; #X obj 91 396 outlet result; #X msg 210 390 -1; #X obj 158 274 sgn~; #X obj 261 295 t f; #X obj 261 317 select 0; #X msg 261 339 0; #X obj 314 337 moses 0; #X msg 314 359 -1; #X obj 314 381 t f; #X msg 360 358 1; #X obj 91 201 bang~; #X connect 0 0 2 0; #X connect 2 1 8 0; #X connect 4 0 9 0; #X connect 5 0 7 0; #X connect 6 0 5 0; #X connect 6 1 10 0; #X connect 8 0 7 0; #X connect 9 0 5 1; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 11 1 13 0; #X connect 12 0 15 0; #X connect 13 0 14 0; #X connect 13 1 16 0; #X connect 14 0 15 0; #X connect 15 0 6 1; #X connect 16 0 15 0; #X connect 17 0 6 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/000077500000000000000000000000001265051730400241175ustar00rootroot00000000000000zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/README.txt000066400000000000000000000002301265051730400256100ustar00rootroot00000000000000unit tests for testing the unit-tester some of these tests MUST fail in order to work correctly (to prove that the unit-tester can handle failed tests) zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/fail.pd000066400000000000000000000003271265051730400253610ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 102 t b; #X obj 142 164 outlet result; #X msg 142 118 0; #X text 122 31 always fail; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 3 0 2 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/fail_noresult.pd000066400000000000000000000002511265051730400273100ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 102 t b; #X obj 142 164 outlet result; #X text 122 31 no result (should fail); #X connect 0 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/fail_wait0.pd000066400000000000000000000004551265051730400264670ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 194 outlet result; #X obj 142 102 t b b; #X msg 167 123 -1; #X msg 142 123 0; #X text 122 31 fail (after a period of uncertainty); #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 4 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/fail_wait10.pd000066400000000000000000000005301265051730400265420ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 194 outlet result; #X obj 142 102 t b b; #X msg 167 123 -1; #X text 122 31 fail (after a period of uncertainty); #X msg 142 163 0; #X obj 142 145 del 10; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 5 0 1 0; #X connect 6 0 5 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/pass.pd000066400000000000000000000003271265051730400254140ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 102 t b; #X msg 142 118 1; #X obj 142 164 outlet result; #X text 122 31 always pass; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/pass_wait0.pd000066400000000000000000000004551265051730400265220ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 194 outlet result; #X obj 142 102 t b b; #X msg 167 123 -1; #X text 122 31 pass (after a period of uncertainty); #X msg 142 123 1; #X connect 0 0 2 0; #X connect 2 0 5 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 5 0 1 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testtests/pass_wait10.pd000066400000000000000000000005301265051730400265750ustar00rootroot00000000000000#N canvas 189 139 450 300 10; #X obj 142 51 inlet trigger; #X obj 142 194 outlet result; #X obj 142 102 t b b; #X msg 167 123 -1; #X text 122 31 pass (after a period of uncertainty); #X msg 142 163 1; #X obj 142 145 del 10; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 5 0 1 0; #X connect 6 0 5 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/tests/testunit.pd000066400000000000000000000102551265051730400242640ustar00rootroot00000000000000#N canvas 578 118 585 499 10; #N canvas 456 161 474 559 run-test 0; #X obj 71 136 symbol; #X obj 71 104 inlet test-to-run; #X obj 71 514 outlet result; #X obj 71 440 pack 0 s; #X msg 113 136 bang; #N canvas 396 344 450 300 print 0; #X obj 101 247 print regression-test; #X obj 101 204 pack s s; #X obj 101 117 select 1; #X obj 152 137 b; #X msg 152 160 failed; #X msg 101 138 OK; #X obj 101 185 symbol; #X msg 101 223 \$2: \$1; #X obj 101 52 inlet result; #X obj 101 89 unpack 0 s; #X connect 1 0 7 0; #X connect 2 0 5 0; #X connect 2 1 3 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 0 0; #X connect 8 0 9 0; #X connect 9 0 2 0; #X connect 9 1 1 1; #X restore 96 491 pd print result; #X obj 71 252 t f b; #X text 99 217 start regression test; #X text 105 251 regression test finished; #N canvas 318 184 905 641 get 0; #X obj 105 488 outlet; #X obj 105 26 inlet reset; #X obj 105 71 t b b b; #X obj 162 229 spigot; #X msg 228 229 1; #X msg 258 229 0; #X obj 202 229 t f; #X obj 163 120 s \$0-send; #X text 248 120 <- start the test; #X text 250 168 <- test result; #X obj 162 165 r \$0-receive; #X obj 105 342 spigot; #X obj 228 212 t b b; #X msg 129 45 bang; #X obj 162 260 select -1; #X obj 105 401 t f b; #X msg 162 278 0; #X msg 105 316 0; #X text 136 321 <--------------- fail as default; #X text 228 262 <- "-1" indicates "wait for result"; #X obj 105 430 t b f; #X obj 105 446 del 0; #X obj 105 462 f; #X text 149 450 <--- buffering \, since we have to avoid that the object triggers it's own destruction (stack corruption); #X connect 1 0 2 0; #X connect 2 0 17 0; #X connect 2 1 7 0; #X connect 2 2 12 0; #X connect 3 0 14 0; #X connect 4 0 6 0; #X connect 5 0 6 0; #X connect 6 0 3 1; #X connect 6 0 11 1; #X connect 10 0 3 0; #X connect 11 0 15 0; #X connect 12 0 4 0; #X connect 13 0 2 0; #X connect 14 0 16 0; #X connect 14 1 15 0; #X connect 15 0 20 0; #X connect 15 1 5 0; #X connect 16 0 11 1; #X connect 17 0 11 0; #X connect 20 0 21 0; #X connect 20 1 22 1; #X connect 21 0 22 0; #X connect 22 0 0 0; #X restore 71 232 pd get result; #X text 64 17 the test MUST return a result!; #X text 77 64 cons: the regression test suite will block until the test returns a result (potentially infinitely long)!; #X text 77 33 pros: the test need not be finished in zero-time (good for testing signal-objects or timed objects); #X obj 71 470 t l l; #N canvas 4 49 625 330 create/destroy 0; #X obj 148 53 inlet; #X obj 449 48 inlet clear; #X obj 148 129 pack s \$0; #X msg 173 196 clear; #X obj 449 76 t b; #X obj 148 148 t l b; #X msg 148 165 obj 100 100 r \$2-send \, obj 100 150 \$1 \, obj 100 200 s \$2-receive \, connect 0 0 1 0 \, connect 1 0 2 0; #X obj 148 228 s pd-\$0-regressiontest; #X obj 148 94 t s; #X connect 0 0 8 0; #X connect 1 0 4 0; #X connect 2 0 5 0; #X connect 3 0 7 0; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 5 1 3 0; #X connect 6 0 7 0; #X connect 8 0 2 0; #X restore 146 324 pd create/destroy testpatch; #N canvas 0 0 450 300 restartaudio 0; #X obj 113 77 inlet; #X obj 113 99 t b; #X msg 113 121 dsp 0 \, dsp 1; #X obj 113 143 s pd; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X restore 141 186 pd restartaudio; #X obj 71 214 t b; #X obj 71 186 t b b; #X obj 71 164 t b s s s; #X obj 142 165 print starting; #X connect 0 0 18 0; #X connect 1 0 0 0; #X connect 3 0 13 0; #X connect 4 0 0 0; #X connect 6 0 3 0; #X connect 6 1 14 1; #X connect 9 0 6 0; #X connect 13 0 2 0; #X connect 13 1 5 0; #X connect 16 0 9 0; #X connect 17 0 16 0; #X connect 17 1 15 0; #X connect 18 0 17 0; #X connect 18 1 14 0; #X connect 18 2 3 1; #X connect 18 3 19 0; #X restore 94 218 pd run-test; #X obj 94 243 outlet; #X obj 94 191 inlet; #N canvas 488 403 450 300 \$0-regressiontest 0; #X restore 92 266 pd \$0-regressiontest; #X text 64 17 the test MUST IMMEDIATELY return a result!; #X text 87 39 1: OK (test passed); #X text 87 52 0: KO (test failed); #X text 81 68 -1:; #X text 103 68 WAIT (test takes some time); #X text 64 92 if no result is returned immediately \, the test is considered to be FAILED!; #X text 63 131 note: we could have this be using "0" as the WAIT result \, an no-result as KO \; for legacy reasons we don't; #X connect 0 0 1 0; #X connect 2 0 0 0; zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/z_install.bat000066400000000000000000000032131265051730400234010ustar00rootroot00000000000000@echo off REM ============================================== REM adapt the following to your needs REM ============================================== REM where does PD reside ?? REM if you want spaces in the path, please use quotes ("") set PDPATH="%PROGRAMFILES%\pd" REM which pd-version do we have ? set PDVERSION=0.38 REM ============================================== REM do not edit below this line !!! REM ============================================== echo : echo : installing zexy on your system echo : echo : assuming that PD-version is at least %PDVERSION% echo : assuming that PD is installed at %PDPATH% echo : echo : if this is correct, hit [return] to proceed echo : if this is incorrect, stop this programm ([Ctrl]-C), edit 'z_install.bat' to your needs and rerun echo : pause IF NOT EXIST %PDPATH%\bin\pd.exe goto location_error set BINPATH=extra set REFPATH=extra\zexy if %PDVERSION% LSS 0.37 set REFPATH=doc\5.reference\zexy echo Copying binary... copy zexy.dll %PDPATH%\%BINPATH% > tempInstall.trash echo copying help files mkdir %PDPATH%\%REFPATH% copy reference\* %PDPATH%\%REFPATH% > tempInstall.trash echo copying abstractions copy abs\*.pd %PDPATH%\%BINPATH% > tempInstall.trash echo : done echo : dont forget to load zexy on startup... echo : have fun goto end :location_error echo : echo : i believe i am in the wrong directory echo : i thought that the pd-executable would be %PDPATH%\bin\pd.exe echo : obviously it is not !!! echo : please edit this file and set the PDPATH-variable apropriatly echo : echo : stopping installation echo : :end pause zexy-v2.2.6-fcb634fdede2b6c71b7c5ee2cea43f05622c126b/zexy-meta.pd.in000066400000000000000000000226411265051730400235750ustar00rootroot00000000000000#N canvas 116 44 745 553 10; #X obj 101 83 zexy; #X msg 101 59 help; #N canvas 259 142 708 221 io~ 0; #X obj 41 184 sfplay; #X obj 137 185 sfrecord; #X msg 41 162 help; #X msg 137 163 help; #X text 297 186 harddisk-recording tools; #X text 144 19 input~/output~ objects; #X connect 2 0 0 0; #X connect 3 0 1 0; #X restore 74 187 pd io~; #N canvas 320 195 583 254 generators~ 0; #X obj 125 173 noisi~; #X msg 125 151 help; #X msg 29 149 help; #X msg 125 103 help; #X msg 29 101 help; #X obj 29 171 noish~; #X obj 29 123 dirac~; #X obj 125 125 step~; #X text 296 174 bandlimited noise~ generators; #X text 290 127 scientific test-functions; #X text 152 26 generator~ objects; #X connect 1 0 0 0; #X connect 2 0 5 0; #X connect 3 0 7 0; #X connect 4 0 6 0; #X restore 74 212 pd generators~; #N canvas 362 224 657 505 processing~ 0; #X obj 52 93 limiter~; #X obj 51 143 quantize~; #X obj 52 193 swap~; #X msg 51 121 help; #X msg 52 71 help; #X msg 52 171 help; #X text 280 92 a limiter/compressor module; #X text 121 16 signal~processing objects; #X text 280 131 quantizes signals by various degrees; #X text 281 186 byte-swapps a 16bit signal; #X obj 55 254 z~; #X msg 55 231 help; #X text 245 228 a samplewise delay \, great for designing FIR-filters ; #X text 253 247 (you cannot use it for IIR-filters !); #X obj 62 336 blockswap~; #X msg 62 314 help; #X text 244 339 swap upper and lower part of a signal-block; #X msg 62 374 help; #X obj 62 396 blockmirror~; #X text 244 399 revert a signal-block (play it back reversely); #X connect 3 0 1 0; #X connect 4 0 0 0; #X connect 5 0 2 0; #X connect 11 0 10 0; #X connect 15 0 14 0; #X connect 17 0 18 0; #X restore 74 236 pd processing~; #N canvas 319 68 585 573 analytic~ 0; #X obj 26 173 sigzero~; #X msg 26 151 help; #X text 164 171 detects whether a signal-block is zero throughout or not; #X obj 25 236 pdf~; #X msg 25 213 help; #X text 165 237 get the probability density function of a signal; #X text 130 48 signal~analyzing objectsd; #X obj 27 303 envrms~; #X obj 28 356 avg~; #X obj 29 407 tavg~; #X msg 27 282 help; #X msg 28 335 help; #X msg 29 386 help; #X text 158 300 the same as env~ \, except that this outputs rms instead of dB; #X text 158 356 arithmetic mean of one signal~vector; #X text 161 407 arithmetic mean between two bangs; #X msg 31 448 help; #X obj 31 469 dfreq~; #X text 164 469 frequency detector; #X connect 1 0 0 0; #X connect 4 0 3 0; #X connect 10 0 7 0; #X connect 11 0 8 0; #X connect 12 0 9 0; #X connect 16 0 17 0; #X restore 74 261 pd analytic~; #N canvas 299 114 664 548 others~ 0; #X obj 31 70 nop~; #X msg 31 48 help; #X text 246 63 do_nothing but delay for one-block (useful for synchronising) ; #X text 175 11 miscanellous signal~ objects; #X msg 31 127 help; #X obj 31 149 pack~; #X msg 77 128 help; #X obj 77 150 unpack~; #X text 245 138 convert a signal to (packages of) floats and vice-versa ; #X msg 31 350 help; #X msg 32 394 help; #X obj 31 371 multiplex~; #X obj 32 415 demultiplex~; #X msg 129 350 help; #X msg 130 393 help; #X obj 129 371 mux~; #X obj 130 415 demux~; #X text 245 416 multiplex 1 IN~signal to 1-of-n OUT~signals; #X text 246 369 multiplex 1-of-n IN~signals to 1 OUT~signal; #X msg 31 297 help; #X obj 31 319 multiline~; #X text 239 316 a line~d multiplication for multiple streams; #X connect 1 0 0 0; #X connect 4 0 5 0; #X connect 6 0 7 0; #X connect 9 0 11 0; #X connect 10 0 12 0; #X connect 13 0 15 0; #X connect 14 0 16 0; #X connect 19 0 20 0; #X restore 74 332 pd others~; #X text 289 183 alternative i/o-devices (harddisk \, net \, ...); #X text 288 207 useful signal generators; #X text 291 231 process your own signals; #X text 290 257 and analyze them; #X text 290 328 none of the above; #N canvas 0 0 591 430 sigbinops~ 0; #X obj 81 96 >~; #X obj 81 129 <~; #X obj 81 162 ==~; #X obj 81 244 &&~; #X obj 81 277 ||~; #X text 159 95 greater; #X text 158 131 less; #X text 157 165 equal; #X text 156 246 logical AND; #X text 154 278 logical OR; #X obj 80 347 abs~; #X obj 80 375 sgn~; #X text 158 348 absolute value (I think this is included at GEM too) ; #X text 158 375 sign of a function; #X text 148 32 binary and math operators for signals~; #X restore 74 286 pd sigbinops~; #X text 289 284 some mathematical and logical functions that were missing ; #N canvas 266 0 630 542 basic 0; #X obj 41 28 nop; #X text 222 28 a do nothing - pass through everything; #X obj 41 85 lister; #X obj 98 86 l; #X text 216 87 store a list (like "float" \, "int" \, ...); #X text 83 86 ==; #X obj 40 244 repack; #X text 211 242 (re)packs atoms to packages of a given size; #X obj 40 275 packel; #X text 209 272 the specified element of a list; #X obj 39 316 niagara; #X text 214 315 split 1 package into 2 at a specifique point; #X obj 43 464 segregate; #X text 210 463 segregates the input to various outputs depending on the type; #X text 210 117 convert anythings to lists; #X obj 41 115 any2list; #X text 101 115 ==; #X obj 119 115 a2l; #X obj 39 215 length; #X text 210 214 get the length of a list; #X obj 41 351 glue; #X text 216 345 append a list to another; #X obj 42 409 list2symbol; #X text 123 410 ==; #X obj 140 409 l2s; #X text 207 410 convert a list into a single symbol; #X obj 40 147 repeat 0; #X text 211 148 repeat a message N-times; #X restore 72 446 pd basic control; #N canvas 401 27 602 871 advanced 0; #X obj 28 129 makesymbol; #X msg 28 107 help; #X text 202 129 concatenate lists to formatted symbols; #X msg 28 154 help; #X obj 28 176 date; #X msg 67 154 help; #X obj 67 176 time; #X text 201 173 get the current system date/time; #X obj 28 229 index; #X msg 28 207 help; #X text 202 226 map symbols to indices; #X text 166 384 (no "help"-message available...); #X obj 28 433 demultiplex; #X obj 128 433 demux; #X text 109 434 ==; #X text 199 434 demultiplex the inlet to a specified outlet; #X obj 28 485 drip; #X text 201 484 extract the atoms of a package (opt. scheduled); #X msg 28 278 help; #X obj 28 302 msgfile; #X text 197 300 a powerful "textfile" derivative; #X obj 28 629 lpt; #X text 200 625 write data to the parallel port (line printer); #X text 109 454 ==; #X obj 28 453 multiplex; #X obj 128 453 mux; #X text 200 456 multiplex the specified inlet to the outlet; #X obj 28 672 operating_system; #X text 209 676 get the current operating system; #X obj 31 553 fifop; #X text 195 554 a FIFO (first-in-first-out) with Priorities; #X obj 31 583 lifop; #X text 195 584 a LIFO (last-in-first-out) with Priorities; #X obj 28 350 strcmp; #X text 194 354 compare to symbols with strcmp(); #X connect 1 0 0 0; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 9 0 8 0; #X connect 18 0 19 0; #X restore 73 478 pd advanced control; #X text 285 477 some more complex control objects (systime \, tabread4 \, ...); #X text 282 446 some useful control objects (nop...); #X text 288 567 objects to work with matrices (moved to IEMMATRIX) ; #N canvas 221 222 583 258 matrix 0; #X obj 224 173 iemmatrix; #X text 109 52 zexy>=2.0 no longer has any matrix-objects.; #X text 109 72 instead \, these objects are now in a separate library "iemmatrix" \, dedicated solely to manipulation of 2D-matrices.; #X text 185 171 use; #X restore 73 570 pd matrix; #N canvas 0 0 616 602 numeric 0; #X obj 39 46 list2int; #X text 94 47 ==; #X obj 112 47 l2i; #X obj 41 85 atoi; #X text 207 49 cast each float of a list/anything to an integer; #X text 209 83 ascii to integer; #X obj 42 435 sort; #X text 208 438 shell-sort a package of floats; #X obj 42 303 mavg; #X msg 42 283 help; #X text 214 307 a moving average filter; #X obj 41 346 mean; #X msg 41 327 help; #X msg 40 367 help; #X obj 40 386 minmax; #X text 209 343 get the mean value of a list of floats (==vector); #X text 208 383 get the minimum and the maximum of a vector; #X obj 43 223 .; #X text 209 225 scalar multiplication of 2 vectors; #X obj 43 158 prime; #X text 200 162 check whether a number is prime; #X obj 43 259 sum; #X text 194 252 elementwise sum of a list; #X obj 44 137 wrap; #X text 196 139 wrap a number between an upper and a lower bound; #X obj 50 505 urn; #X text 199 502 Unique-Random-Numbers: get random numbers from an urn ; #X connect 9 0 8 0; #X connect 12 0 11 0; #X connect 13 0 14 0; #X restore 71 378 pd numeric objects; #X text 282 376 objects dealing with numbers; #N canvas 306 127 571 219 tables 0; #X msg 29 16 help; #X obj 29 35 tabdump table; #X text 205 33 dump a table as a list of floats; #X msg 30 55 help; #X obj 30 74 tabset table; #X text 206 72 set a table with a list of floats; #X msg 29 106 help; #X obj 29 125 tabminmax table; #X text 208 128 get minimum and maximum; #X connect 0 0 1 0; #X connect 3 0 4 0; #X connect 6 0 7 0; #X restore 73 508 pd tables; #X text 288 517 objects to work on tables; #N canvas 0 0 701 577 conversions 0; #X obj 65 95 cart2sph; #X obj 65 115 cart2pol; #X obj 65 155 sph2pol; #X obj 65 175 sph2cart; #X obj 65 224 pol2cart; #X obj 65 247 pol2sph; #X text 84 67 coordinate-conversion; #X text 186 168 convert between Cartesian \, polar and spherical corrdinates ; #X obj 72 334 deg2rad; #X obj 72 362 rad2deg; #X text 146 350 convert between degree and radiant; #X restore 72 402 pd conversions; #X text 279 406 numeric conversion (coordinates \, angles \, ...); #X text 430 82 bug-reports: zmoelnig-AT-iem.at; #N canvas 498 232 309 146 META 0; #X text 10 10 NAME zexy; #X text 10 30 VERSION @PACKAGE_VERSION@; #X text 10 50 AUTHOR IOhannes m zmölnig; #X text 10 70 LICENSE GPL-2; #X text 10 90 DESCRIPTION the swiss army knife for Pd; #X restore 23 27 pd META; #X text 228 7 the zexy external; #X text 429 66 (c) forum::für::umläute 1999-2012; #X connect 1 0 0 0;