pax_global_header00006660000000000000000000000064151455777000014525gustar00rootroot0000000000000052 comment=cf549254a4fe740800f15f0c965624d0f3aaf687 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/000077500000000000000000000000001514557770000212225ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/AUTHORS.txt000066400000000000000000000002711514557770000231100ustar00rootroot00000000000000IOhannes m zmoelnig thomas musil franz zotter sourena mosleh hannes pescoller thomas röck iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/GnuGPL.txt000066400000000000000000000431031514557770000230600ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 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 Library 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 How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/LICENSE.txt000066400000000000000000000015261514557770000230510ustar00rootroot00000000000000iemmatrix - pd-objects for simple matrix operations Copyright (C) 2001-2025 IOhannes m zmoelnig (zmoelnig AT iem DOT at) Copyright (C) 2004-2006 thomas musil (musil AT iem DOT at) Copyright (C) 2005-2025 franz zotter (zotter AT iem DOT at) 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 . iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/Makefile000066400000000000000000000161111514557770000226620ustar00rootroot00000000000000# Makefile to build class 'iemmatrix' for Pure Data. # Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build # settings and rules. # library name lib.name = iemmatrix # use 'lib.version' to set the library version from the cmdline #lib.version := $(shell git describe || true) # mtx_*~ and friends make problems... make-lib-executable=yes cflags = ldlibs = ifneq ($(strip $(lib.version)),) cflags += -DVERSION='"$(lib.version)"' endif cflags += -I. -Isrc SHELL := /bin/sh ##################################################################### ## external dependencies (used by STUB LIBRARIES at the end) # set any of these to 'no' to disable the library # typically this is not needed, as # - dependencies are only used if found # - we do "weak" linking (so the external can still be used # if the dependencies are not present on the host systems with-sndfile := yes with-gsl := yes with-fftw := yes # make pkg-config overridable (for cross-building) PKG_CONFIG ?= pkg-config # libsndfile ifneq ($(with-sndfile),no) have-sndfile := $(shell $(PKG_CONFIG) --exists sndfile && echo yes || echo no) endif ifeq ($(have-sndfile),yes) $(info ++++ info: found libsndfile) SNDFILE_CFLAGS = $(shell $(PKG_CONFIG) --cflags sndfile) SNDFILE_LIBS = $(shell $(PKG_CONFIG) --libs sndfile) else $(info ++++ info: missing libsndfile) endif ifneq ($(SNDFILE_LIBS),) SNDFILE_CFLAGS += -DUSE_SNDFILE=1 -DHAVE_SNDFILE_H=1 else have-sndfile=no endif cflags += $(SNDFILE_CFLAGS) # GNU scientific library ifneq ($(with-gsl),no) have-gsl := $(shell $(PKG_CONFIG) --exists gsl && echo yes || echo no) endif ifeq ($(have-gsl),yes) $(info ++++ info: found GSL) GSL_CFLAGS = $(shell $(PKG_CONFIG) --cflags gsl) GSL_LIBS = $(shell $(PKG_CONFIG) --libs gsl) else $(info ++++ info: missing GSL) endif ifneq ($(GSL_LIBS),) have-gsl=yes GSL_CFLAGS += -DHAVE_LIBGSL=1 -DHAVE_GSL_EIGEN_NONSYMM=1 -DHAVE_GSL_BESSEL=1 else have-gsl=no endif cflags += $(GSL_CFLAGS) # afaik, all libm implementations have a bessel function cflags += -DHAVE_MATH_BESSEL=1 # FFTW ifneq ($(with-fftw),no) have-fftw3 := $(shell $(PKG_CONFIG) --exists fftw3 && echo yes || echo no) endif ifeq ($(have-fftw3),yes) $(info ++++ info: found FFTW3) FFTW_CFLAGS = $(shell $(PKG_CONFIG) --cflags fftw3) FFTW_LIBS = $(shell $(PKG_CONFIG) --libs fftw3) FFTWF_CFLAGS = $(shell $(PKG_CONFIG) --cflags fftw3f) FFTWF_LIBS = $(shell $(PKG_CONFIG) --libs fftw3f) else $(info ++++ info: missing FFTW3) endif ifneq ($(FFTW_LIBS),) have-fftw=yes FFTW_CFLAGS += -DHAVE_FFTW=1 else have-fftw=no endif ifneq ($(FFTWF_LIBS),) have-fftwf=yes FFTWF_CFLAGS += -DHAVE_FFTWF=1 else have-fftwf=no endif cflags += $(FFTW_CFLAGS) $(FFTWF_CFLAGS) ## ##################################################################### lib.setup.sources = \ src/iemmatrix.c common.sources = \ src/iemmatrix_utility.c \ src/iemmatrix_binop.c \ src/iemmatrix_binops.c \ src/iemmatrix_unop.c \ src/iemmatrix_stub.c \ src/iemmatrix_fft.c \ $(empty) # input source file (class name == source file basename) class.sources = \ src/matrix.c \ src/mtx_abs.c \ src/mtx_add.c \ src/mtx_and.c \ src/mtx_atan.c \ src/mtx_atan2.c \ src/mtx_bessel.c \ src/mtx_bitand.c \ src/mtx_bitleft.c \ src/mtx_bitor.c \ src/mtx_bitright.c \ src/mtx_bspline.c \ src/mtx_check.c \ src/mtx_cholesky.c \ src/mtx_col.c \ src/mtx_colon.c \ src/mtx_concat.c \ src/mtx_conv.c \ src/mtx_cos.c \ src/mtx_cumprod.c \ src/mtx_cumsum.c \ src/mtx_dbtopow.c \ src/mtx_dbtorms.c \ src/mtx_decay.c \ src/mtx_diag.c \ src/mtx_diegg.c \ src/mtx_diff.c \ src/mtx_dispersive_dline.c \ src/mtx_distance2.c \ src/mtx_div.c \ src/mtx_egg.c \ src/mtx_eig.c \ src/mtx_element.c \ src/mtx_eq.c \ src/mtx_exp.c \ src/mtx_eye.c \ src/mtx_fft.c \ src/mtx_fill.c \ src/mtx_find.c \ src/mtx_gauss.c \ src/mtx_ge.c \ src/mtx_gt.c \ src/mtx_ifft.c \ src/mtx_index.c \ src/mtx_int.c \ src/mtx_inverse.c \ src/mtx_isequal.c \ src/mtx_le.c \ src/mtx_log.c \ src/mtx_lt.c \ src/mtx_max2.c \ src/mtx_mean.c \ src/mtx_min2.c \ src/mtx_minmax.c \ src/mtx_mul.c \ src/mtx_mul~.c \ src/mtx_neq.c \ src/mtx_not.c \ src/mtx_ones.c \ src/mtx_or.c \ src/mtx_pack~.c \ src/mtx_pivot.c \ src/mtx_pow.c \ src/mtx_powtodb.c \ src/mtx_print.c \ src/mtx_prod.c \ src/mtx_qr.c \ src/mtx_rand.c \ src/mtx_repmat.c \ src/mtx_resize.c \ src/mtx_reverse.c \ src/mtx_rfft.c \ src/mtx_rifft.c \ src/mtx_rmstodb.c \ src/mtx_roll.c \ src/mtx_row.c \ src/mtx_scroll.c \ src/mtx_sin.c \ src/mtx_size.c \ src/mtx_slice.c \ src/mtx_sndfileread.c \ src/mtx_sort.c \ src/mtx_sqrt.c \ src/mtx_sub.c \ src/mtx_sum.c \ src/mtx_svd.c \ src/mtx_tan.c \ src/mtx_trace.c \ src/mtx_transpose.c \ src/mtx_unpack~.c \ src/mtx_zeros.c \ $(empty) class.sources += \ src/mtx_qhull.c mtx_qhull.class.sources = \ src/mtx_qhull/list.c \ src/mtx_qhull/vectors.c \ src/mtx_qhull/zhull.c \ $(empty) class.sources += \ src/mtx_spherical_radial.c mtx_spherical_radial.class.sources = \ src/mtx_spherical_harmonics/sph_radial.c \ $(empty) class.sources += \ src/mtx_spherical_harmonics.c \ src/mtx_spherical_harmonics_rotator.c mtx_spherical_harmonics.class.sources = \ src/mtx_spherical_harmonics/chebyshev12.c \ src/mtx_spherical_harmonics/legendre_a.c \ src/mtx_spherical_harmonics/sharmonics.c \ src/mtx_spherical_harmonics/sharmonics_normalization.c \ $(empty) class.sources += \ src/mtx_convolver~.c mtx_convolver~.class.sources = \ src/mtx_convolver/array.c \ src/mtx_convolver/convolver.c \ $(empty) #ifneq ($(make-lib-executable),yes) #class.sources += \ # alias/matrix_mul_line~.c \ # alias/matrix_mul~.c \ # alias/matrix~.c \ # alias/mtx.c \ # alias/mtx_0x21.c \ # alias/mtx_0x210x3d.c \ # alias/mtx_0x26.c \ # alias/mtx_0x260x26.c \ # alias/mtx_0x2a.c \ # alias/mtx_0x2a0x7e.c \ # alias/mtx_0x2b.c \ # alias/mtx_0x2d.c \ # alias/mtx_0x2e0x2a.c \ # alias/mtx_0x2e0x2f.c \ # alias/mtx_0x2e0x5e.c \ # alias/mtx_0x2f.c \ # alias/mtx_0x3a.c \ # alias/mtx_0x3c.c \ # alias/mtx_0x3c0x3c.c \ # alias/mtx_0x3c0x3d.c \ # alias/mtx_0x3d0x3d.c \ # alias/mtx_0x3e.c \ # alias/mtx_0x3e0x3d.c \ # alias/mtx_0x3e0x3e.c \ # alias/mtx_0x7c.c \ # alias/mtx_0x7c0x7c.c \ # alias/mtx_div.c \ # $(empty) #endif # all extra files to be included in binary distribution of the library datafiles = \ AUTHORS.txt \ GnuGPL.txt \ LICENSE.txt \ README.md \ $(empty) datafiles += \ VERSION.txt \ iemmatrix-meta.pd \ $(empty) datafiles += \ $(wildcard abs/*.pd) \ $(wildcard help/*.pd) \ $(empty) datafiles += \ $(wildcard help/*.arr3) \ $(wildcard help/*.mtx) \ $(empty) in.files = $(wildcard *.in) # include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder' PDLIBBUILDER_DIR=pd-lib-builder/ include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder src/iemmatrix.c: iemmatrix_sources.h VERSION.txt iemmatrix-meta.pd iemmatrix_sources.h: $(SHELL) src/makesource.sh $(sort $(class.sources)) >$@ %: %.in sed -e 's|@PACKAGE_NAME@|$(lib.name)|g' -e 's|@PACKAGE_VERSION@|$(lib.version)|g' $< > $@ .PHONY: check check: $(MAKE) -C tests .PHONY: clean.local clean: clean.local clean.local: -rm iemmatrix_sources.h -rm $(in.files:%.in=%) # build stub libraries -include src/stub/Make.stublibs iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/README.md000066400000000000000000000126531514557770000225100ustar00rootroot00000000000000iemmatrix - matrix objects for Pure Data ======================================== Homepage: https://git.iem.at/pd/iemmatrix `iemmatrix` is a collection of objects for Pure Data (Pd) that allow manipulation of simple matrices. ## Found a bug? Miss a feature? Please use our issue-tracker at https://git.iem.at/pd/iemmatrix/-/issues ## Installation instructions ### Simple installation `iemmatrix` is available via deken (Pd's built in package manager): For Pd>=0.56 - Open the `Tools` menu - Select `Find externals...` - Type **`iemmatrix`** and hit `Search` - Select the first entry and click on `Install` For older Pd versions, `Find externals...` can be found in the `Help` menu. ### Compiling iemmatrix If deken does not offer any downloads for your system (e.g. because you are stuck on an old OSX system with a PowerPC processor, or you want to use a not-yet released version), you can locally compile `iemmatrix` instead. #### Dependencies in order to compile iemmatrix, you will need some libraries/applications installed. Some of these dependencies are optional. If they are present during compilation, iemmatrix will have certain functionality enabled, which might be missing otherwise. - Pure Data https://puredata.info/downloads make sure you also have the development files (headers) - GNU scientific library (aka gsl) [optional] https://www.gnu.org/software/gsl/ needed for higher maths, including eigenvalues and singular-value decomposition - FFTW (Fast Fourier Transform) [optional] https://fftw.org fast, high-precision FFTs; if not present, iemmatrix will use Pd's internal FFT - sndfile (reading/writing audio files) [optional] https://libsndfile.github.io/libsndfile/ for reading soundfiles into matrices (many soundfiles are supported) - the `pkg-config` tool (to detect) the optional dependencies - a compiler, linker,... tested with - GCC (the GNU compiler collection) - Clang #### Building iemmatrix uses the [pd-lib-builder](https://github.com/pure-data/pd-lib-builder) build system. just run: ```sh make ``` To get some basic help with the build-system run ```sh make help ``` or read the [online documentation for pd-lib-builder](https://github.com/pure-data/pd-lib-builder). #### Installing The ordinary way to install, is by running the following with the proper privileges (e.g. as root): ```sh make install ``` This will install the entire iemmatrix into `/usr/local/lib/pd-externals/iemmatrix/` On systems that have no standard filesystem layout for Pd-externals (e.g. W32 and macOS), this is not exactly what you want. Instead, you can use the following to collect all installation data into a single directory: ```sh make install DESTDIR=$(pwd) pkglibdir= ``` This will create a new directory `iemmatrix` (in your current directory), containing all binaries and abstractions needed. You can then take this directory, and put it into a place, where Pd will look for it: E.g. | OS | path | example path |---------|----------------------------|------------------------------------------------------ | Linux |`~/.local/lib/pd/extra` | `/home/frodo/.local/lib/pd/extra/iemmatrix` | macOS | `~/Documents/Pd/externals` | `/Users/frodo/Documents/Pd/externals/iemmatrix` | Windows | `%AppData%\Pd` | `C:\Users\frodo\AppData\Roaming\Pd\iemmatrix` A full list of default search paths for externals, can be found at https://puredata.info/docs/faq/how-do-i-install-externals-and-help-files/ ## System-specific instructions ### Linux (Debian-based) `iemmatrix` is available as a Debian package ```sh apt-get install pd-iemmatrix ``` To get all the build-dependencies, use: ```sh apt-get build-dep pd-iemmatrix ``` or manually with: ```sh apt-get install build-essential puredata libfftw3-dev libsndfile1-dev libgsl0-dev ``` ### macOS The additional dependencies are available via [`brew`](https://brew.sh) ``` brew install pkgconf gsl fftw libsndfile ``` Then proceed with the [building instructions](#building) ### Windows You will need the [MSYS2](https://www.msys2.org/) environment with [MinGW](https://www.mingw-w64.org/) installed. Open an MinGW shell (`MSYS2 MinGW 64-bit`; for older 32bit Windows systems use `MSYS Mingw 32-bit`) and install the dependencies with: ```sh pacman -Suy \ ${MINGW_PACKAGE_PREFIX}-gcc \ ${MINGW_PACKAGE_PREFIX}-pkgconf \ ${MINGW_PACKAGE_PREFIX}-ntldd \ ${MINGW_PACKAGE_PREFIX}-libsndfile \ ${MINGW_PACKAGE_PREFIX}-fftw \ ${MINGW_PACKAGE_PREFIX}-gsl ``` Then proceed with the [building instructions](#building) ## 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 . ## Authors `iemmatrix` is being developped at the [Institute of Electronic Music and Acoustics](https://iem.at), which is part of the [University of Music and Performing Arts, Graz/Austria](https://www.kug.ac.at). For a list of developers, see the `AUTHORS.txt` file. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/VERSION.txt.in000066400000000000000000000000221514557770000235070ustar00rootroot00000000000000@PACKAGE_VERSION@ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/000077500000000000000000000000001514557770000217675ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_.cabs2-help.pd000066400000000000000000000023201514557770000251770ustar00rootroot00000000000000#N canvas 88 457 655 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X msg 33 172 matrix 1 2 1 2; #X msg 49 193 matrix 1 2 0 1; #X obj 33 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 33 148 t b b b b; #X obj 33 216 t a a; #X text 441 116 inletA: real part of matrix; #X text 440 135 inletB: imaginary part of matrix; #X text 439 157 outletA: real valued output; #X obj 165 216 mtx_print realA; #X obj 165 195 mtx_print imagA; #X obj 33 280 mtx_print cabs2; #X obj 33 242 mtx_.cabs2; #X text 44 34 [mtx_.cabs2]; #X text 166 69 complex valued element wise matrix absolute value; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION element-wise absolute value of complex-valued matrix, f 67; #X restore 584 327 pd META; #X obj 439 328 declare -lib iemmatrix; #X connect 1 0 5 0; #X connect 2 0 12 1; #X connect 2 0 10 0; #X connect 3 0 4 0; #X connect 4 0 1 0; #X connect 4 1 2 0; #X connect 5 0 12 0; #X connect 5 1 9 0; #X connect 12 0 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_.cabs2.pd000066400000000000000000000010031514557770000242460ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 71 39 inlet realA; #X obj 152 39 inlet imagA; #X obj 71 256 outlet real; #X obj 71 204 mtx_+, f 14; #X obj 71 110 t a a; #X obj 152 110 t a a; #X obj 152 135 mtx_.*; #X obj 71 135 mtx_.*; #X text 175 79 complex squared absolute values; #X obj 235 256 declare -lib iemmatrix; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 3 0 2 0; #X connect 4 0 7 0; #X connect 4 1 7 1; #X connect 5 0 6 0; #X connect 5 1 6 1; #X connect 6 0 3 1; #X connect 7 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_.cdiv-help.pd000066400000000000000000000031161514557770000251360ustar00rootroot00000000000000#N canvas 83 338 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 441 116 inletA: real part of first matrix; #X text 440 135 inletB: imaginary part of first matrix; #X text 441 164 inletC: real part of second matrix; #X text 440 183 inletB: imaginary part of second matrix; #X msg 33 172 matrix 1 2 1 2; #X msg 49 193 matrix 1 2 0 1; #X obj 33 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 33 148 t b b b b; #X obj 236 222 mtx_print realY; #X obj 240 248 mtx_print imagY; #X obj 119 222 mtx_print realX; #X obj 123 248 mtx_print imagX; #X obj 33 216 t a a; #X msg 168 175 matrix 1 2 1 2; #X msg 184 196 matrix 1 2 0 -1; #X text 44 34 [mtx_.cdiv]; #X text 166 69 complex valued element wise matrix division; #X obj 33 242 mtx_.cdiv; #X obj 165 280 mtx_print imagcdiv; #X obj 33 280 mtx_print realcdiv; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION element-wise division of complex-valued matrix, f 67; #X restore 714 327 pd META; #X obj 569 328 declare -lib iemmatrix; #X connect 5 0 13 0; #X connect 6 0 12 0; #X connect 6 0 18 1; #X connect 7 0 8 0; #X connect 8 0 5 0; #X connect 8 1 6 0; #X connect 8 2 14 0; #X connect 8 3 15 0; #X connect 13 0 18 0; #X connect 13 1 11 0; #X connect 14 0 9 0; #X connect 14 0 18 2; #X connect 15 0 10 0; #X connect 15 0 18 3; #X connect 18 0 20 0; #X connect 18 1 19 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_.cdiv.pd000066400000000000000000000015231514557770000242100ustar00rootroot00000000000000#N canvas 184 200 594 332 10; #X declare -lib iemmatrix; #X obj 417 118 t a a; #X obj 335 118 t a a; #X obj 144 257 mtx_./, f 9; #X obj 231 256 mtx_./, f 8; #X obj 144 19 inlet realA; #X obj 226 19 inlet imagA; #X obj 335 19 inlet realB; #X obj 417 19 inlet imagB; #X obj 362 181 mtx_.cabs2; #X obj 417 141 mtx_* -1; #X obj 144 232 mtx_.cmul, f 15; #X obj 144 294 outlet real; #X obj 231 294 outlet imag; #X text 344 234 element wise complex matrix division; #X obj 345 256 declare -lib iemmatrix; #X obj 249 232 t a a; #X connect 0 0 9 0; #X connect 0 1 8 1; #X connect 1 0 10 2; #X connect 1 1 8 0; #X connect 2 0 11 0; #X connect 3 0 12 0; #X connect 4 0 10 0; #X connect 5 0 10 1; #X connect 6 0 1 0; #X connect 7 0 0 0; #X connect 8 0 15 0; #X connect 9 0 10 3; #X connect 10 0 2 0; #X connect 10 1 3 0; #X connect 15 0 2 1; #X connect 15 1 3 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_.cmul-help.pd000066400000000000000000000031321514557770000251470ustar00rootroot00000000000000#N canvas 83 338 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 441 116 inletA: real part of first matrix; #X text 440 135 inletB: imaginary part of first matrix; #X text 441 164 inletC: real part of second matrix; #X text 440 183 inletB: imaginary part of second matrix; #X msg 33 172 matrix 1 2 1 2; #X msg 49 193 matrix 1 2 0 1; #X obj 33 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 33 148 t b b b b; #X obj 236 222 mtx_print realY; #X obj 240 248 mtx_print imagY; #X obj 119 222 mtx_print realX; #X obj 123 248 mtx_print imagX; #X obj 33 216 t a a; #X text 44 34 [mtx_.cmul]; #X msg 168 175 matrix 1 2 1 2; #X msg 184 196 matrix 1 2 0 -1; #X obj 33 242 mtx_.cmul; #X obj 33 280 mtx_print realcmul; #X obj 163 280 mtx_print imagcmul; #X text 166 69 complex valued element wise matrix multiplication; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION element-wise multiplication of complex-valued matrix, f 67; #X restore 674 327 pd META; #X obj 529 328 declare -lib iemmatrix; #X connect 5 0 13 0; #X connect 6 0 17 1; #X connect 6 0 12 0; #X connect 7 0 8 0; #X connect 8 0 5 0; #X connect 8 1 6 0; #X connect 8 2 15 0; #X connect 8 3 16 0; #X connect 13 0 17 0; #X connect 13 1 11 0; #X connect 15 0 9 0; #X connect 15 0 17 2; #X connect 16 0 10 0; #X connect 16 0 17 3; #X connect 17 0 18 0; #X connect 17 1 19 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_.cmul.pd000066400000000000000000000014671514557770000242320ustar00rootroot00000000000000#N canvas 0 0 555 317 10; #X declare -lib iemmatrix; #X obj 129 110 mtx_.*; #X obj 212 108 mtx_.*; #X obj 397 125 mtx_.*; #X obj 349 126 mtx_.*; #X obj 129 136 mtx_-; #X obj 349 149 mtx_+; #X text 184 2 complex matrix multiplication (component wise); #X obj 211 52 t a a; #X obj 129 54 t a a; #X obj 129 30 inlet realA; #X obj 211 30 inlet imagA; #X obj 344 30 inlet realB; #X obj 426 30 inlet imagB; #X obj 129 182 outlet real; #X obj 349 180 outlet imag; #X obj 235 246 declare -lib iemmatrix; #X connect 0 0 4 0; #X connect 1 0 4 1; #X connect 2 0 5 1; #X connect 3 0 5 0; #X connect 4 0 13 0; #X connect 5 0 14 0; #X connect 7 0 1 0; #X connect 7 1 2 0; #X connect 8 0 0 0; #X connect 8 1 3 0; #X connect 9 0 8 0; #X connect 10 0 7 0; #X connect 11 0 2 1; #X connect 11 0 0 1; #X connect 12 0 3 1; #X connect 12 0 1 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_atan2-help.pd000066400000000000000000000022611514557770000251400ustar00rootroot00000000000000#N canvas 426 117 622 300 10; #X declare -lib iemmatrix; #X obj 164 270 mtx_print atan2; #X text 368 248 Franz Zotter 2007; #X text 133 15 arcus tangent with range from -pi...+pi; #X obj 164 108 t a a; #X obj 194 129 mtx_print y; #X obj 383 111 t a a; #X obj 413 132 mtx_print x; #X obj 164 237 mtx_* 0; #X obj 334 200 atan; #X msg 334 181 1; #X msg 334 219 45 \$1; #X obj 334 239 /; #X obj 334 161 loadbang; #X obj 164 182 mtx_atan2; #X msg 383 52 matrix 1 8 1 1 0 -1 -1 -1 0 1; #X msg 164 52 matrix 1 8 0 1 1 1 0 -1 -1 -1; #N canvas 800 302 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION arctangent (atan2) of each element of a matrix, f 67; #X restore 554 17 pd META; #X obj 409 18 declare -lib iemmatrix; #X connect 3 0 13 0; #X connect 3 1 4 0; #X connect 5 0 13 1; #X connect 5 1 6 0; #X connect 7 0 0 0; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 10 0 11 0; #X connect 11 0 7 1; #X connect 12 0 9 0; #X connect 13 0 7 0; #X connect 14 0 5 0; #X connect 15 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_atan2.pd000066400000000000000000000057061514557770000242210ustar00rootroot00000000000000#N canvas 0 0 765 625 10; #X declare -lib iemmatrix; #X obj 142 6 inlet mtx_im/y; #X obj 432 7 inlet mtx_re/x; #X obj 142 598 outlet; #X text 598 442 Franz Zotter 2007; #X obj 226 447 atan2, f 13; #X obj 301 419 mtx; #X obj 142 111 spigot; #X obj 202 153 print mtx_atan2; #X msg 202 132 matrix dimensions do not match!; #X obj 226 417 mtx; #X msg 226 370 element \$1 \$2; #X obj 226 394 t a a; #X obj 142 574 mtx; #X msg 463 522 size \$1 \$2; #X obj 169 345 t l l; #X obj 169 490 pack f f f; #X msg 169 511 element \$1 \$2 \$3; #X obj 142 184 t b b; #X obj 595 476 declare -lib iemmatrix; #X obj 432 30 t a a; #X obj 142 26 t b a a; #N canvas 735 461 450 300 sizecheck 0; #X obj 32 14 inlet mtxA; #X obj 188 14 inlet mtxB; #X obj 32 37 mtx_size; #X obj 188 37 mtx_size; #X obj 32 100 ==; #X obj 77 100 ==; #X obj 32 123 &&; #X obj 32 146 outlet samesize; #X obj 196 123 pack; #X obj 32 69 t f f; #X obj 77 69 t f f; #X obj 196 146 outlet sizeA; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 9 0; #X connect 2 1 10 0; #X connect 3 0 4 1; #X connect 3 1 5 1; #X connect 4 0 6 0; #X connect 5 0 6 1; #X connect 6 0 7 0; #X connect 8 0 11 0; #X connect 9 0 4 0; #X connect 9 1 8 0; #X connect 10 0 5 0; #X connect 10 1 8 1; #X restore 175 57 pd sizecheck; #X f 27; #X obj 334 175 t l l, f 22; #X obj 175 90 t f f; #X obj 202 112 select 0; #N canvas 0 0 450 526 iterate2D 0; #X msg 101 171 0; #X obj 62 171 until; #X obj 62 193 f, f 7; #X obj 62 215 + 1; #X obj 62 260 t b f, f 12; #X obj 62 421 pack, f 12; #X obj 62 303 f, f 15; #X obj 62 281 t b b, f 7; #X msg 101 326 0; #X obj 62 325 until; #X obj 62 347 f, f 7; #X obj 62 370 + 1; #X obj 62 79 swap, f 15; #X obj 62 139 t f b, f 7; #X obj 62 237 t f f, f 7; #X obj 62 393 t a a, f 7; #X obj 62 444 outlet m n; #X obj 62 56 inlet M N; #X connect 0 0 2 1; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 14 0; #X connect 4 0 7 0; #X connect 4 1 5 1; #X connect 5 0 16 0; #X connect 6 0 9 0; #X connect 7 0 6 0; #X connect 7 1 8 0; #X connect 8 0 10 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 15 0; #X connect 12 0 13 0; #X connect 12 1 6 1; #X connect 13 0 1 0; #X connect 13 1 0 0; #X connect 14 0 4 0; #X connect 14 1 2 1; #X connect 15 0 5 0; #X connect 15 1 10 1; #X connect 17 0 12 0; #X restore 169 260 pd iterate2D; #X obj 169 233 list; #X connect 0 0 20 0; #X connect 1 0 19 0; #X connect 4 0 15 2; #X connect 5 0 4 1; #X connect 6 0 17 0; #X connect 8 0 7 0; #X connect 9 0 4 0; #X connect 10 0 11 0; #X connect 11 0 9 0; #X connect 11 1 5 0; #X connect 12 0 2 0; #X connect 13 0 12 0; #X connect 14 0 15 0; #X connect 14 1 10 0; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 17 0 12 0; #X connect 17 1 26 0; #X connect 19 0 21 1; #X connect 19 1 5 1; #X connect 20 0 6 0; #X connect 20 1 21 0; #X connect 20 2 9 1; #X connect 21 0 23 0; #X connect 21 1 22 0; #X connect 22 0 26 1; #X connect 22 1 13 0; #X connect 23 0 6 1; #X connect 23 1 24 0; #X connect 24 0 8 0; #X connect 25 0 14 0; #X connect 26 0 25 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cabs2-help.pd000066400000000000000000000022671514557770000251330ustar00rootroot00000000000000#N canvas 88 457 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X obj 33 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 33 148 t b b b b; #X obj 33 216 t a a; #X text 441 116 inletA: real part of matrix; #X text 440 135 inletB: imaginary part of matrix; #X text 439 157 outletA: real valued output; #X obj 165 216 mtx_print realA; #X obj 165 195 mtx_print imagA; #X obj 33 280 mtx_print cabs2; #X text 44 34 [mtx_cabs2]; #X text 166 69 complex valued matrix absolute value; #X obj 33 242 mtx_cabs2; #X msg 33 172 matrix 2 1 1 2; #X msg 49 193 matrix 2 1 0 1; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION absolute value of complex-valued matrix, f 67; #X restore 704 297 pd META; #X obj 559 298 declare -lib iemmatrix; #X connect 1 0 2 0; #X connect 2 0 13 0; #X connect 2 1 14 0; #X connect 3 0 12 0; #X connect 3 1 7 0; #X connect 12 0 9 0; #X connect 13 0 3 0; #X connect 14 0 8 0; #X connect 14 0 12 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cabs2.pd000066400000000000000000000012151514557770000241750ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 71 135 mtx_*; #X obj 71 39 inlet realA; #X obj 152 39 inlet imagA; #X obj 71 256 outlet real; #X obj 71 204 mtx_+; #X obj 71 82 t a a; #X obj 152 83 t a a; #X text 175 66 complex squared absolute value; #X obj 71 109 mtx_transpose; #X obj 152 131 mtx_transpose; #X obj 152 155 mtx_* -1; #X obj 152 175 mtx_*; #X obj 235 256 declare -lib iemmatrix; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 2 0 6 0; #X connect 4 0 3 0; #X connect 5 0 8 0; #X connect 5 1 0 1; #X connect 6 0 9 0; #X connect 6 1 11 1; #X connect 8 0 0 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cart2sph-help.pd000066400000000000000000000017631514557770000256670ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 69 114 mtx 3 1; #X text 126 70 2 ey; #X text 144 94 3 ez; #X text 264 202 Franz Zotter \, 2009; #X text 19 11 converting cartersian to spherical coordinates; #X msg 26 49 1 0 0; #X text 81 47 1 ex; #X obj 69 147 mtx_cart2sph; #X msg 69 71 0 2 0; #X msg 97 91 0 0 3; #X text 219 62 input matrices have the shape 3xL; #X text 221 76 and may contain L points; #X text 219 93 [ x \; y \; z ]; #X obj 69 191 mtx_print rphitheta; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION convert a matrix of cartesian vectors into spherical coordinates, f 77; #X restore 354 257 pd META; #X obj 209 258 declare -lib iemmatrix; #X connect 0 0 7 0; #X connect 5 0 0 0; #X connect 7 0 13 0; #X connect 8 0 0 0; #X connect 9 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cart2sph.pd000066400000000000000000000026101514557770000247310ustar00rootroot00000000000000#N canvas 612 222 475 514 10; #X declare -lib iemmatrix; #X obj 101 377 mtx_concat; #X obj 205 141 mtx_slice 1 1 1 end; #X obj 44 398 mtx_concat; #X text 229 451 Franz Zotter \, 2009; #X text 231 428 [iemmatrix]; #X obj 44 280 mtx_+; #X obj 44 261 mtx_.^ 2; #X obj 178 261 mtx_+; #X obj 178 212 mtx_.^ 2; #X obj 205 239 mtx_.^ 2; #X text 188 306 rxy; #X obj 178 350 mtx_atan2; #X obj 151 173 mtx_slice 2 1 2 end; #X obj 333 140 mtx_slice 3 1 3 end; #X obj 44 239 mtx; #X obj 44 93 t b a a a; #X obj 44 299 mtx_.^ 0.5; #X obj 151 192 t a a; #X text 229 309 z; #X obj 101 350 mtx_atan2; #X obj 192 388 mtx_size; #X floatatom 192 409 5 0 0 0 - - - 0; #X floatatom 241 410 5 0 0 0 - - - 0; #X obj 178 328 mtx_.^ 0.5; #X obj 313 471 declare -lib iemmatrix; #X obj 44 17 inlet [x \, y \, z]; #X obj 44 467 outlet [r phi theta]; #X connect 0 0 2 1; #X connect 1 0 9 0; #X connect 1 0 19 1; #X connect 2 0 26 0; #X connect 5 0 16 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 7 0 23 0; #X connect 8 0 7 0; #X connect 9 0 7 1; #X connect 11 0 0 1; #X connect 11 0 20 0; #X connect 12 0 17 0; #X connect 13 0 14 1; #X connect 13 0 11 1; #X connect 14 0 6 0; #X connect 15 0 14 0; #X connect 15 1 12 0; #X connect 15 2 1 0; #X connect 15 3 13 0; #X connect 16 0 2 0; #X connect 17 0 19 0; #X connect 17 1 8 0; #X connect 19 0 0 0; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 23 0 11 0; #X connect 25 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cinverse-help.pd000066400000000000000000000030411514557770000257460ustar00rootroot00000000000000#N canvas 210 487 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X obj 36 61 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 153 mtx_print realX; #X obj 186 154 mtx_print imagX; #X obj 36 153 t a a; #X text 44 34 [mtx_cinverse]; #X text 166 69 complex valued matrix inverse; #X text 441 116 inletA: real part of matrix; #X text 440 135 inletB: imaginary part of matrix; #X obj 36 179 mtx_cinverse; #X obj 36 218 mtx_print realcinv; #X obj 167 218 mtx_print imagcinv; #X obj 36 85 t b b; #X obj 300 217 print instability_detected; #X obj 139 276 mtx_cmul; #X msg 37 104 2 2; #X msg 66 104 2 2; #X obj 36 129 mtx_rand; #X obj 96 129 mtx_rand; #X obj 139 296 mtx_print eye_re; #X obj 256 296 mtx_print eye_im; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION matrix inverse of complex-valued matrix, f 67; #X restore 624 327 pd META; #X obj 479 328 declare -lib iemmatrix; #X connect 1 0 12 0; #X connect 4 0 9 0; #X connect 4 1 3 0; #X connect 4 1 14 2; #X connect 9 0 10 0; #X connect 9 0 14 0; #X connect 9 1 11 0; #X connect 9 1 14 1; #X connect 9 2 13 0; #X connect 12 0 15 0; #X connect 12 1 16 0; #X connect 14 0 19 0; #X connect 14 1 20 0; #X connect 15 0 17 0; #X connect 16 0 18 0; #X connect 17 0 4 0; #X connect 18 0 2 0; #X connect 18 0 9 1; #X connect 18 0 14 3; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cinverse.pd000066400000000000000000000051011514557770000250170ustar00rootroot00000000000000#N canvas 544 483 588 201 10; #X declare -lib iemmatrix; #X obj 83 28 inlet realA; #X obj 168 28 inlet imagA; #X obj 83 93 mtx_inverse; #X obj 369 164 outlet instability_detection; #X obj 83 165 outlet real; #X obj 281 164 outlet imag; #N canvas 0 0 652 418 mtx_cplx_to_real_hermitian 0; #X obj 351 32 inlet imag; #X obj 87 35 inlet real; #X obj 101 364 outlet; #X obj 351 52 t a a; #X obj 418 52 mtx_size; #X obj 418 72 * 2; #X obj 469 72 * 2; #X obj 418 92 pack; #X obj 418 113 mtx_zeros; #X obj 117 318 mtx_fill; #X obj 87 55 t b a; #X msg 175 141 matrix 1 1; #X obj 117 119 t a b a b; #X obj 136 189 pack 1 f f; #X msg 136 209 matrix \$2 \$3; #X obj 101 344 mtx; #X obj 480 52 + 1; #X obj 391 52 + 1; #X obj 269 147 t a b a b; #X obj 327 168 f; #X obj 288 189 f; #X msg 327 189 matrix \$1 1; #X msg 288 209 matrix 1 \$1; #X obj 226 209 mtx_* -1; #X connect 0 0 3 0; #X connect 1 0 10 0; #X connect 3 0 18 0; #X connect 3 1 4 0; #X connect 4 0 5 0; #X connect 4 0 17 0; #X connect 4 1 6 0; #X connect 4 1 16 0; #X connect 5 0 7 0; #X connect 6 0 7 1; #X connect 7 0 8 0; #X connect 8 0 9 1; #X connect 9 0 15 1; #X connect 10 0 15 0; #X connect 10 1 12 0; #X connect 11 0 9 2; #X connect 12 0 9 0; #X connect 12 1 13 0; #X connect 12 2 9 0; #X connect 12 3 11 0; #X connect 13 0 14 0; #X connect 14 0 9 2; #X connect 15 0 2 0; #X connect 16 0 13 2; #X connect 16 0 19 1; #X connect 17 0 13 1; #X connect 17 0 20 1; #X connect 18 0 23 0; #X connect 18 1 20 0; #X connect 18 2 9 0; #X connect 18 3 19 0; #X connect 19 0 21 0; #X connect 20 0 22 0; #X connect 21 0 9 2; #X connect 22 0 9 2; #X connect 23 0 9 0; #X restore 83 59 pd mtx_cplx_to_real_hermitian; #N canvas 0 0 450 300 mtx_real_hermitian_to_cplx 0; #X obj 170 18 inlet; #X obj 170 272 outlet real; #X obj 253 272 outlet imag; #X obj 226 47 mtx_size; #X obj 277 68 / 2; #X obj 226 69 / 2; #X obj 254 112 + 1; #X obj 254 132 pack; #X msg 254 163 \$1 1 end \$2; #X obj 253 191 mtx_slice; #X obj 170 47 t a a a; #X obj 170 189 mtx_slice; #X msg 176 163 1 1 \$1 \$2; #X obj 176 142 pack; #X connect 0 0 10 0; #X connect 3 0 5 0; #X connect 3 1 4 0; #X connect 4 0 7 1; #X connect 4 0 13 1; #X connect 5 0 6 0; #X connect 5 0 13 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 1; #X connect 9 0 2 0; #X connect 10 0 11 0; #X connect 10 1 9 0; #X connect 10 2 3 0; #X connect 11 0 1 0; #X connect 12 0 11 1; #X connect 13 0 12 0; #X restore 83 122 pd mtx_real_hermitian_to_cplx; #X obj 405 26 declare -lib iemmatrix; #X connect 0 0 6 0; #X connect 1 0 6 1; #X connect 2 0 7 0; #X connect 2 1 3 0; #X connect 6 0 2 0; #X connect 7 0 4 0; #X connect 7 1 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cmul-help.pd000066400000000000000000000030771514557770000251010ustar00rootroot00000000000000#N canvas 83 338 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 44 34 [mtx_cmul]; #X text 166 69 complex valued matrix multiplication; #X text 441 116 inletA: real part of first matrix; #X text 440 135 inletB: imaginary part of first matrix; #X text 441 164 inletC: real part of second matrix; #X text 440 183 inletB: imaginary part of second matrix; #X obj 33 242 mtx_cmul; #X msg 33 172 matrix 1 2 1 2; #X msg 49 193 matrix 1 2 0 1; #X obj 33 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 33 148 t b b b b; #X obj 236 222 mtx_print realY; #X obj 240 248 mtx_print imagY; #X obj 119 222 mtx_print realX; #X obj 123 248 mtx_print imagX; #X msg 168 175 matrix 2 1 1 2; #X msg 184 196 matrix 2 1 0 -1; #X obj 33 216 t a a; #X obj 33 281 mtx_print realcmul; #X obj 164 281 mtx_print imagcmul; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION multiplication of complex-valued matrix, f 67; #X restore 614 327 pd META; #X obj 469 328 declare -lib iemmatrix; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 8 0 18 0; #X connect 9 0 7 1; #X connect 9 0 14 0; #X connect 10 0 11 0; #X connect 11 0 8 0; #X connect 11 1 9 0; #X connect 11 2 16 0; #X connect 11 3 17 0; #X connect 16 0 12 0; #X connect 16 0 7 2; #X connect 17 0 13 0; #X connect 17 0 7 3; #X connect 18 0 7 0; #X connect 18 1 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_cmul.pd000066400000000000000000000013631514557770000241470ustar00rootroot00000000000000#N canvas 429 314 450 314 10; #X declare -lib iemmatrix; #X obj 71 135 mtx_*; #X obj 152 135 mtx_*; #X obj 71 81 t a a; #X obj 235 137 mtx_*; #X obj 235 215 mtx_+; #X obj 298 137 mtx_*; #X obj 152 81 t a a; #X obj 71 204 mtx_-; #X obj 71 39 inlet realA; #X obj 152 39 inlet imagA; #X obj 236 39 inlet realB; #X obj 318 39 inlet imagB; #X obj 71 256 outlet real; #X obj 235 256 outlet imag; #X obj 125 286 declare -lib iemmatrix; #X connect 0 0 7 0; #X connect 1 0 7 1; #X connect 2 0 0 0; #X connect 2 1 3 0; #X connect 3 0 4 0; #X connect 4 0 13 0; #X connect 5 0 4 1; #X connect 6 0 1 0; #X connect 6 1 5 0; #X connect 7 0 12 0; #X connect 8 0 2 0; #X connect 9 0 6 0; #X connect 10 0 0 1; #X connect 10 0 5 1; #X connect 11 0 1 1; #X connect 11 0 3 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_distance-help.pd000066400000000000000000000027561514557770000257360ustar00rootroot00000000000000#N canvas 83 338 841 379 10; #X declare -lib iemmatrix; #X obj 33 267 mtx_print distances; #X obj 119 179 t a a; #X obj 157 198 mtx_print B; #X obj 33 179 t a a; #X obj 63 198 mtx_print A; #X obj 33 106 t b b; #X msg 33 85 bang; #X obj 33 132 mtx_rand 4 3; #X obj 119 154 mtx_rand 2 3; #X text 482 28 part of iemmatrix; #X text 268 138 inletA: a matrix defining vectors of dimension ; #X text 268 158 inletB: a matrix defining vectors of dimension ; #X obj 33 242 mtx_distance; #X text 166 69 calculate the euclidean distance between two sets of vectors.; #X text 267 179 outlet: distance matrix (i \, j) \, where each element Y(i \, j)=sqrt((A(i)-B(i)).(A(i)-B(i)))=|A(i)-B(i)|; #X text 269 240 there is also a faster version of this object [mtx_distance2] which does not calculate the square-root of the in-product \; use that one if possible; #X text 44 34 [mtx_distance]; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION calculate euclidean distance matrix between two sets of vectors, f 77; #X restore 614 327 pd META; #X obj 469 328 declare -lib iemmatrix; #X connect 1 0 12 1; #X connect 1 1 2 0; #X connect 3 0 12 0; #X connect 3 1 4 0; #X connect 5 0 7 0; #X connect 5 1 8 0; #X connect 6 0 5 0; #X connect 7 0 3 0; #X connect 8 0 1 0; #X connect 12 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_distance.pd000066400000000000000000000012651514557770000250020ustar00rootroot00000000000000#N canvas 323 233 549 392 10; #X declare -lib iemmatrix; #X text 72 316 (c) 2005 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X text 72 333 for license-details see LICENSE.txt that should come with iemmatrix.; #X obj 115 164 mtx_distance2; #X obj 115 78 inlet matrix1; #X obj 264 78 inlet matrix2; #X obj 115 209 mtx_.^ 0.5; #X text 73 41 calculate the euclidean distance between to sets of vectors; #X text 229 162 for performance reasons this does not calculate the square-root; #X text 229 206 so here we do the square-root; #X obj 115 240 outlet distance-matrix; #X obj 235 366 declare -lib iemmatrix; #X connect 2 0 5 0; #X connect 3 0 2 0; #X connect 4 0 2 1; #X connect 5 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_col_grid-help.pd000066400000000000000000000026621514557770000267300ustar00rootroot00000000000000#N canvas 162 457 841 379 10; #X declare -lib iemmatrix; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X obj 33 85 t b b b; #X text 43 34 [mtx_fill_col_grid]; #X text 166 69 fills values into to the col indices of given matrix.; #X text 424 184 inletA: matrix/vector values for fill; #X text 424 197 inletB: matrix/vector to fill values into; #X text 424 211 inletC: matrix/vector indices for filling; #X text 422 231 outleA: matrix containing the inserted values; #X msg 193 111 3 4; #X obj 193 133 mtx_zeros; #X msg 33 112 matrix 1 6 1 2 3 4 5 6; #X msg 310 107 matrix 1 2 4 2; #X obj 75 133 mtx_print A_fill; #X obj 33 232 mtx_print output; #X obj 193 158 mtx_print B_orig; #X obj 310 158 mtx_print C_col; #X obj 33 194 mtx_fill_col_grid; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION fill values into the column indices of a matrix, f 67; #X restore 584 327 pd META; #X obj 439 328 declare -lib iemmatrix; #X connect 0 0 3 0; #X connect 2 0 18 0; #X connect 2 1 14 0; #X connect 3 0 12 0; #X connect 3 1 10 0; #X connect 3 2 13 0; #X connect 10 0 11 0; #X connect 11 0 16 0; #X connect 11 0 18 1; #X connect 12 0 2 0; #X connect 13 0 17 0; #X connect 13 0 18 2; #X connect 18 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_col_grid.pd000066400000000000000000000027721514557770000260040ustar00rootroot00000000000000#N canvas 175 67 466 602 10; #X declare -lib iemmatrix; #X obj 80 70 inlet; #X obj 80 91 t a a; #X obj 194 197 mtx_size, f 20; #X obj 181 70 inlet; #X text 78 54 matrix; #X obj 181 90 mtx_:; #X obj 194 296 mtx; #X obj 194 316 mtx_repmat; #X obj 194 339 t a a; #X obj 221 361 mtx_size, f 10; #X obj 221 402 mtx_:; #X obj 221 482 mtx_repmat; #X obj 194 511 mtx_+; #X obj 25 568 outlet; #X text 175 55 col_idcs; #X obj 221 422 mtx_transpose; #X obj 221 442 mtx_- 1; #X obj 221 462 mtx_* 1, f 16; #X msg 278 391 1 \$1; #X msg 251 294 \$1 1; #X msg 221 382 1 \$1; #X obj 25 69 inlet; #X text 28 54 matrix; #X text 85 40 orig; #X text 23 41 fill; #X obj 25 544 mtx_fill; #X obj 149 240 spigot 0; #X obj 181 110 t a a; #X obj 214 240 > 0; #X obj 135 566 declare -lib iemmatrix; #X text 316 107 fills in elements into the given columns of a matrix, f 19; #X obj 194 217 t b f f; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 1 1 25 1; #X connect 2 0 31 0; #X connect 2 1 17 1; #X connect 3 0 5 0; #X connect 5 0 27 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 12 0; #X connect 8 1 9 0; #X connect 9 0 20 0; #X connect 9 1 18 0; #X connect 10 0 15 0; #X connect 11 0 12 1; #X connect 12 0 25 2; #X connect 15 0 16 0; #X connect 16 0 17 0; #X connect 17 0 11 0; #X connect 18 0 11 1; #X connect 19 0 7 1; #X connect 20 0 10 0; #X connect 21 0 25 0; #X connect 25 0 13 0; #X connect 26 0 6 0; #X connect 27 0 26 0; #X connect 27 1 6 1; #X connect 28 0 26 1; #X connect 31 0 6 0; #X connect 31 1 28 0; #X connect 31 2 19 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_row_grid-help.pd000066400000000000000000000026541514557770000267630ustar00rootroot00000000000000#N canvas 377 497 841 379 10; #X declare -lib iemmatrix; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X obj 33 85 t b b b; #X text 424 184 inletA: matrix/vector values for fill; #X text 424 197 inletB: matrix/vector to fill values into; #X text 424 211 inletC: matrix/vector indices for filling; #X text 422 231 outleA: matrix containing the inserted values; #X msg 224 112 3 4; #X obj 224 134 mtx_zeros; #X obj 75 133 mtx_print A_fill; #X obj 33 232 mtx_print output; #X obj 224 159 mtx_print B_orig; #X text 43 34 [mtx_fill_row_grid]; #X text 166 69 fills values into to the row indices of given matrix.; #X obj 341 159 mtx_print C_row; #X obj 33 201 mtx_fill_row_grid; #X msg 341 108 matrix 1 2 3 1; #X msg 33 112 matrix 1 8 1 2 3 4 5 6 7 8; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION fill values into the row indices of matrix, f 67; #X restore 584 327 pd META; #X obj 439 328 declare -lib iemmatrix; #X connect 0 0 3 0; #X connect 2 0 16 0; #X connect 2 1 10 0; #X connect 3 0 18 0; #X connect 3 1 8 0; #X connect 3 2 17 0; #X connect 8 0 9 0; #X connect 9 0 12 0; #X connect 9 0 16 1; #X connect 16 0 11 0; #X connect 17 0 15 0; #X connect 17 0 16 2; #X connect 18 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_row_grid.pd000066400000000000000000000030341514557770000260260ustar00rootroot00000000000000#N canvas 191 265 467 512 10; #X declare -lib iemmatrix; #X obj 80 40 inlet; #X obj 80 81 t a a; #X obj 107 102 mtx_size; #X obj 210 40 inlet; #X text 256 40 row_idcs; #X obj 210 60 mtx_:; #X obj 210 102 mtx_- 1; #X obj 194 211 mtx; #X obj 194 231 mtx_* 1; #X obj 194 251 mtx_repmat; #X msg 281 229 1 \$1; #X obj 210 81 mtx_transpose; #X obj 194 273 t a a; #X obj 221 294 mtx_size; #X obj 221 355 mtx_:; #X obj 221 375 mtx_repmat; #X obj 221 335 pack 1 f; #X obj 221 315 t b f; #X msg 278 315 \$1 1; #X obj 194 397 mtx_+; #X obj 19 439 outlet; #X obj 19 39 inlet; #X obj 19 415 mtx_fill; #X obj 194 181 spigot 0; #X obj 249 181 > 0; #X obj 194 158 t a a; #X obj 205 436 declare -lib iemmatrix; #X text 308 160 fills in elements into given rows of a matrix, f 18; #X text 18 10 fill matrix, f 6; #X text 83 11 orig matrix, f 6; #X obj 152 123 t b f f f, f 22; #X connect 0 0 1 0; #X connect 1 0 22 1; #X connect 1 1 2 0; #X connect 2 1 30 0; #X connect 3 0 5 0; #X connect 5 0 11 0; #X connect 6 0 25 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 12 0; #X connect 10 0 9 1; #X connect 11 0 6 0; #X connect 12 0 19 0; #X connect 12 1 13 0; #X connect 13 0 17 0; #X connect 13 1 16 1; #X connect 14 0 15 0; #X connect 15 0 19 1; #X connect 16 0 14 0; #X connect 17 0 16 0; #X connect 17 1 18 0; #X connect 18 0 15 1; #X connect 19 0 22 2; #X connect 21 0 22 0; #X connect 22 0 20 0; #X connect 23 0 7 0; #X connect 24 0 23 1; #X connect 25 0 23 0; #X connect 25 1 7 1; #X connect 30 0 7 0; #X connect 30 1 8 1; #X connect 30 2 24 0; #X connect 30 3 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_rowcol-help.pd000066400000000000000000000031301514557770000264420ustar00rootroot00000000000000#N canvas 133 130 841 379 10; #X declare -lib iemmatrix; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X obj 33 232 mtx_print output; #X msg 323 112 matrix 1 4 1 2 2 2; #X msg 464 112 matrix 1 4 2 3 1 2 3; #X text 43 34 [mtx_fill_rowcol]; #X text 481 186 inletA: matrix/vector with fill values; #X text 479 247 outleA: matrix containing the fill values; #X text 481 199 inletB: matrix/vector to be filled; #X text 481 213 inletC: row matrix/vector; #X text 481 227 inletD: col matrix/vector; #X obj 33 194 mtx_fill_rowcol; #X obj 456 134 mtx_print D_col; #X obj 297 139 mtx_print C_row; #X obj 33 83 t b b b b; #X msg 198 112 2 3; #X obj 199 133 mtx_zeros; #X obj 165 155 mtx_print B_orig; #X obj 75 133 mtx_print A_fill; #X msg 33 112 matrix 1 4 1 2 3 4; #N canvas 585 339 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION fill values into the given row/col indices of a matrix, f 67; #X restore 724 327 pd META; #X obj 579 328 declare -lib iemmatrix; #X text 166 69 fills values into to the given row/col indices of a given matrix.; #X connect 0 0 15 0; #X connect 2 0 12 0; #X connect 2 1 19 0; #X connect 4 0 14 0; #X connect 4 0 12 2; #X connect 5 0 13 0; #X connect 5 0 12 3; #X connect 12 0 3 0; #X connect 15 0 20 0; #X connect 15 1 16 0; #X connect 15 2 4 0; #X connect 15 3 5 0; #X connect 16 0 17 0; #X connect 17 0 12 1; #X connect 17 0 18 0; #X connect 20 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_rowcol.pd000066400000000000000000000013651514557770000255240ustar00rootroot00000000000000#N canvas 344 107 433 256 10; #X declare -lib iemmatrix; #X obj 103 36 inlet; #X text 255 19 row idcs; #X text 356 19 col idcs; #X text 258 4 from mtx_find_rowcol:; #X obj 258 37 inlet; #X obj 361 37 inlet; #X obj 144 168 mtx_rowcol2index; #X obj 144 146 mtx; #X obj 103 57 t a a; #X obj 144 105 mtx_size; #X obj 144 126 t b f, f 16; #X obj 63 220 outlet; #X obj 63 35 inlet; #X obj 63 200 mtx_fill, f 14; #X obj 193 220 declare -lib iemmatrix; #X text 105 7 orig matrix, f 6; #X text 57 5 fill matrix, f 6; #X connect 0 0 8 0; #X connect 4 0 7 1; #X connect 5 0 6 1; #X connect 6 0 13 2; #X connect 7 0 6 0; #X connect 8 0 13 1; #X connect 8 1 9 0; #X connect 9 1 10 0; #X connect 10 0 7 0; #X connect 10 1 6 2; #X connect 12 0 13 0; #X connect 13 0 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_rowcol_grid-help.pd000066400000000000000000000032121514557770000274500ustar00rootroot00000000000000#N canvas 377 497 841 379 10; #X declare -lib iemmatrix; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X text 424 206 inletA: matrix/vector values for fill; #X text 424 219 inletB: matrix/vector to fill values into; #X text 424 233 inletC: matrix/vector indices for filling; #X text 422 278 outleA: matrix containing the inserted values; #X obj 224 134 mtx_zeros; #X obj 75 133 mtx_print A_fill; #X obj 33 232 mtx_print output; #X obj 224 159 mtx_print B_orig; #X obj 341 159 mtx_print C_row; #X msg 33 112 matrix 1 8 1 2 3 4 5 6 7 8; #X text 31 31 [mtx_fill_rowcol_grid]; #X obj 33 201 mtx_fill_rowcol_grid; #X text 425 247 inletD: matrix/vector indices for filling; #X text 166 69 fills values into to the row and col grid indices of given matrix.; #X msg 450 108 matrix 1 2 2 4; #X obj 33 85 t b b b b; #X obj 450 159 mtx_print D_col; #X msg 224 113 6 5; #X msg 341 108 matrix 1 2 2 5; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION fill values into the row/col grid indices of matrix, f 67; #X restore 584 317 pd META; #X obj 439 318 declare -lib iemmatrix; #X connect 0 0 18 0; #X connect 2 0 14 0; #X connect 2 1 8 0; #X connect 7 0 10 0; #X connect 7 0 14 1; #X connect 12 0 2 0; #X connect 14 0 9 0; #X connect 17 0 19 0; #X connect 17 0 14 3; #X connect 18 0 12 0; #X connect 18 1 20 0; #X connect 18 2 21 0; #X connect 18 3 17 0; #X connect 20 0 7 0; #X connect 21 0 11 0; #X connect 21 0 14 2; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_fill_rowcol_grid.pd000066400000000000000000000026541514557770000265330ustar00rootroot00000000000000#N canvas 200 516 575 378 10; #X declare -lib iemmatrix; #X text 92 2 matrix; #X obj 35 335 outlet; #X text 381 153 at the given row and col; #X text 381 179 grid indices; #X obj 35 311 mtx_fill; #X obj 35 21 inlet; #X text 29 1 matrix; #X text 31 -10 fill; #X text 89 -10 orig; #X text 383 98 fills in elements; #X text 384 124 into a matrix; #X obj 274 20 inlet; #X text 320 20 row_idcs; #X obj 274 40 mtx_:; #X obj 274 78 mtx_- 1; #X obj 258 159 mtx; #X obj 258 179 mtx_* 1; #X obj 258 199 mtx_repmat; #X msg 323 177 1 \$1; #X obj 274 59 mtx_transpose; #X obj 400 20 inlet; #X obj 400 40 mtx_:; #X obj 145 182 mtx; #X obj 145 203 mtx_repmat; #X msg 210 180 \$1 1; #X obj 87 20 inlet; #X obj 145 283 mtx_+; #X obj 400 63 mtx_size; #X obj 274 99 mtx_size; #X obj 87 63 t a a; #X obj 117 89 mtx_size; #X obj 168 110 t b b f; #X obj 235 356 declare -lib iemmatrix; #X connect 4 0 1 0; #X connect 5 0 4 0; #X connect 11 0 13 0; #X connect 13 0 19 0; #X connect 14 0 28 0; #X connect 14 0 15 1; #X connect 15 0 16 0; #X connect 16 0 17 0; #X connect 17 0 26 1; #X connect 18 0 17 1; #X connect 19 0 14 0; #X connect 20 0 21 0; #X connect 21 0 22 1; #X connect 21 0 27 0; #X connect 22 0 23 0; #X connect 23 0 26 0; #X connect 24 0 23 1; #X connect 25 0 29 0; #X connect 26 0 4 2; #X connect 27 0 18 0; #X connect 28 0 24 0; #X connect 29 0 4 1; #X connect 29 1 30 0; #X connect 30 1 31 0; #X connect 31 0 22 0; #X connect 31 1 15 0; #X connect 31 2 16 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_find_rowcol-help.pd000066400000000000000000000021121514557770000264330ustar00rootroot00000000000000#N canvas 83 338 650 379 10; #X declare -lib iemmatrix; #X obj 111 142 mtx_print A; #X msg 33 88 bang; #X text 482 28 part of iemmatrix; #X text 267 190 outleA: matrix containing row indices; #X text 269 209 outletB: matrix containing col indices; #X obj 33 132 t a a; #X obj 33 201 mtx_print row; #X obj 140 200 mtx_print col; #X obj 33 163 mtx_find_rowcol; #X text 265 149 inletA: matrix/vector; #X text 166 69 calculates the row/col indices of the nonzero elements in a matrix; #X msg 33 112 matrix 2 3 1 0 1 0 1 1; #X text 43 34 [mtx_find_rowcol]; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION calculates the row/col indices of nonzero elements in a matrix, f 77; #X restore 584 327 pd META; #X obj 439 328 declare -lib iemmatrix; #X connect 1 0 11 0; #X connect 5 0 8 0; #X connect 5 1 0 0; #X connect 8 0 6 0; #X connect 8 1 7 0; #X connect 11 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_find_rowcol.pd000066400000000000000000000010311514557770000255040ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 141 13 inlet; #X obj 141 212 outlet; #X obj 141 35 t a a; #X obj 171 56 mtx_size; #X obj 248 212 outlet; #X text 280 74 comment; #X text 256 27 finds the non-zero; #X text 260 58 column and row indices; #X text 308 89 of a matrix; #X obj 141 111 mtx_index2rowcol; #X obj 141 76 mtx_find \$1 \$2; #X obj 235 266 declare -lib iemmatrix; #X connect 0 0 2 0; #X connect 2 0 10 0; #X connect 2 1 3 0; #X connect 3 1 9 1; #X connect 9 0 1 0; #X connect 9 1 4 0; #X connect 10 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index2rowcol-help.pd000066400000000000000000000027751514557770000265640ustar00rootroot00000000000000#N canvas 83 338 655 379 10; #X declare -lib iemmatrix; #X obj 152 214 mtx_print A; #X msg 33 88 bang; #X text 482 28 part of iemmatrix; #X text 43 34 [mtx_index2rowcol]; #X text 166 69 calculate the row and column indices w.r.t. the linear matrix indices used by the standard objects (e.g. mtx_find \, mtx_index \, mtx_fill \, ...); #X text 268 138 inletA: matrix/vector containing linear indices of a matrix; #X text 268 158 inletB: integer describing the number of columns of the indexed matrix; #X text 267 190 outleA: matrix containing row indices; #X text 269 209 outletB: matrix containing col indices; #X obj 33 242 mtx_index2rowcol; #X msg 33 112 matrix 2 3 1 1 1 1 1 1; #X obj 33 163 mtx_find; #X obj 156 160 print B; #X obj 90 133 mtx_size; #X obj 33 132 t a a; #X obj 33 184 t a a; #X obj 33 267 mtx_print row; #X obj 140 266 mtx_print col; #N canvas 460 154 587 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix glue; #X text 12 44 DESCRIPTION calculate row/column indices from linear indices used by other matrix objects, f 93; #X restore 584 327 pd META; #X obj 439 328 declare -lib iemmatrix; #X connect 1 0 10 0; #X connect 9 0 16 0; #X connect 9 1 17 0; #X connect 10 0 14 0; #X connect 11 0 15 0; #X connect 13 1 12 0; #X connect 13 1 9 1; #X connect 14 0 11 0; #X connect 14 1 13 0; #X connect 15 0 9 0; #X connect 15 1 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index2rowcol.pd000066400000000000000000000016111514557770000256220ustar00rootroot00000000000000#N canvas 304 424 484 300 10; #X declare -lib iemmatrix; #X obj 87 17 inlet; #X obj 87 247 outlet; #X obj 141 122 t a a; #X obj 141 167 mtx_int; #X obj 208 242 outlet; #X obj 208 216 mtx_+ 1; #X obj 141 100 mtx_- 1; #X text 260 58 column and row indices; #X obj 242 11 inlet; #X text 285 10 columns; #X text 255 40 calculates; #X text 280 76 for a given index vector; #X text 308 93 and given column size; #X obj 208 146 mtx_mod \$1; #X obj 141 146 mtx_./ \$1; #X obj 87 213 mtx_.*; #X obj 141 189 mtx_+ 1; #X obj 87 40 t a a; #X obj 87 100 mtx_> 0; #X obj 315 246 declare -lib iemmatrix; #X connect 0 0 17 0; #X connect 2 0 14 0; #X connect 2 1 13 0; #X connect 3 0 16 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 8 0 14 1; #X connect 8 0 13 1; #X connect 13 0 5 0; #X connect 14 0 3 0; #X connect 15 0 1 0; #X connect 16 0 15 1; #X connect 17 0 18 0; #X connect 17 1 6 0; #X connect 18 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_col_grid-help.pd000066400000000000000000000022701514557770000271040ustar00rootroot00000000000000#N canvas 133 130 683 293 10; #X declare -lib iemmatrix; #X obj 75 133 mtx_print A; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X text 384 152 inletA: matrix/vector; #X obj 33 232 mtx_print output; #X obj 33 83 t b b b; #X obj 242 135 mtx_print B_row; #X msg 241 110 matrix 1 2 3 1; #X text 43 34 [mtx_index_col_grid]; #X text 166 69 finds the values to the col grid indices in a given matrix.; #X text 384 165 inletB: col matrix/vector; #X text 382 199 outleA: matrix containing the indexed cols; #X obj 33 194 mtx_index_col_grid; #X msg 33 112 matrix 3 3 1 2 3 1 2 3 1 2 3; #N canvas 426 373 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION find the values to the column grid indices in a matrix, f 67; #X restore 584 237 pd META; #X obj 439 238 declare -lib iemmatrix; #X connect 1 0 6 0; #X connect 3 0 13 0; #X connect 3 1 0 0; #X connect 6 0 14 0; #X connect 6 1 8 0; #X connect 8 0 7 0; #X connect 8 0 13 1; #X connect 13 0 5 0; #X connect 14 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_col_grid.pd000066400000000000000000000023271514557770000261610ustar00rootroot00000000000000#N canvas 597 0 483 363 10; #X declare -lib iemmatrix; #X obj 70 20 inlet; #X obj 70 41 t a a; #X obj 100 61 mtx_size; #X obj 199 20 inlet; #X text 68 4 matrix; #X obj 199 40 mtx_:; #X obj 184 86 mtx; #X obj 184 106 mtx_repmat; #X obj 184 129 t a a; #X obj 223 129 mtx_size; #X obj 223 170 mtx_:; #X obj 223 250 mtx_repmat; #X obj 184 271 mtx_+; #X obj 70 329 outlet; #X text 246 20 col_idcs; #X obj 100 81 t b f; #X obj 223 190 mtx_transpose; #X obj 223 210 mtx_- 1; #X obj 223 230 mtx_* 1; #X msg 274 149 1 \$1; #X msg 249 84 \$1 1; #X msg 223 150 1 \$1; #X obj 70 305 mtx_index; #X obj 155 326 declare -lib iemmatrix; #X text 317 75 slices out given columns of a matrix writing them into a new matrix, f 20; #X connect 0 0 1 0; #X connect 1 0 22 0; #X connect 1 1 2 0; #X connect 2 0 15 0; #X connect 2 1 18 1; #X connect 3 0 5 0; #X connect 5 0 6 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 12 0; #X connect 8 1 9 0; #X connect 9 0 21 0; #X connect 9 1 19 0; #X connect 10 0 16 0; #X connect 11 0 12 1; #X connect 12 0 22 1; #X connect 15 0 6 0; #X connect 15 1 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 1; #X connect 20 0 7 1; #X connect 21 0 10 0; #X connect 22 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_row_grid-help.pd000066400000000000000000000022701514557770000271360ustar00rootroot00000000000000#N canvas 133 130 841 379 10; #X declare -lib iemmatrix; #X obj 75 133 mtx_print A; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X text 384 152 inletA: matrix/vector; #X text 384 165 inletB: row matrix/vector; #X obj 33 232 mtx_print output; #X obj 33 83 t b b b; #X obj 242 135 mtx_print B_row; #X text 43 34 [mtx_index_row_grid]; #X text 166 69 finds the values to the row grid indices in a given matrix.; #X obj 33 194 mtx_index_row_grid; #X text 382 199 outleA: matrix containing the indexed rows; #X msg 33 112 matrix 3 3 1 1 1 2 2 2 3 3 3; #X msg 241 110 matrix 1 2 3 1; #N canvas 399 315 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION find the values to the row grid indices in a matrix, f 67; #X restore 584 227 pd META; #X obj 439 228 declare -lib iemmatrix; #X connect 1 0 7 0; #X connect 3 0 11 0; #X connect 3 1 0 0; #X connect 7 0 13 0; #X connect 7 1 14 0; #X connect 11 0 6 0; #X connect 13 0 3 0; #X connect 14 0 8 0; #X connect 14 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_row_grid.pd000066400000000000000000000025521514557770000262130ustar00rootroot00000000000000#N canvas 116 0 450 388 10; #X declare -lib iemmatrix; #X obj 70 20 inlet; #X obj 70 41 t a a; #X obj 97 61 mtx_size; #X obj 196 20 inlet; #X text 242 20 row_idcs; #X text 113 21 matrix; #X obj 196 41 mtx_:; #X obj 196 83 mtx_- 1; #X obj 145 112 mtx, f 9; #X obj 145 133 mtx_* 1; #X obj 145 154 mtx_repmat; #X msg 202 133 1 \$1; #X obj 196 62 mtx_transpose; #X obj 145 175 t a a, f 7; #X obj 184 197 mtx_size; #X obj 184 258 mtx_:; #X obj 184 278 mtx_repmat; #X obj 184 238 pack 1 f; #X obj 184 218 t b f, f 10; #X msg 241 251 \$1 1; #X obj 145 304 mtx_+, f 7; #X obj 70 326 mtx_index, f 13; #X obj 70 350 outlet; #X text 287 100 slices out given; #X text 296 122 rows of a matrix; #X text 304 144 writing them into; #X text 315 167 a new matrix; #X obj 235 336 declare -lib iemmatrix; #X obj 145 83 t b f f; #X connect 0 0 1 0; #X connect 1 0 21 0; #X connect 1 1 2 0; #X connect 2 1 28 0; #X connect 3 0 6 0; #X connect 6 0 12 0; #X connect 7 0 8 1; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 13 0; #X connect 11 0 10 1; #X connect 12 0 7 0; #X connect 13 0 20 0; #X connect 13 1 14 0; #X connect 14 0 18 0; #X connect 14 1 17 1; #X connect 15 0 16 0; #X connect 16 0 20 1; #X connect 17 0 15 0; #X connect 18 0 17 0; #X connect 18 1 19 0; #X connect 19 0 16 1; #X connect 20 0 21 1; #X connect 21 0 22 0; #X connect 28 0 8 0; #X connect 28 1 9 1; #X connect 28 2 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_rowcol-help.pd000066400000000000000000000025671514557770000266400ustar00rootroot00000000000000#N canvas 133 130 765 286 10; #X declare -lib iemmatrix; #X obj 75 133 mtx_print A; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X text 481 154 inletA: matrix/vector; #X text 481 167 inletB: row matrix/vector; #X text 481 180 inletC: col matrix/vector; #X text 479 201 outleA: matrix containing the indexed values; #X obj 33 232 mtx_print output; #X text 43 34 [mtx_index_rowcol]; #X text 166 69 finds the values to the given row/col indices in a given matrix.; #X obj 33 194 mtx_index_rowcol; #X msg 33 112 matrix 2 3 1 2 3 4 5 6; #X obj 33 83 t b b b; #X msg 205 111 matrix 1 4 1 2 2 2; #X msg 381 108 matrix 1 4 2 3 1 2 3; #X obj 373 130 mtx_print C_col; #X obj 179 138 mtx_print B_row; #N canvas 493 444 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION find the values to the given row/column indices in a matrix, f 77; #X restore 584 237 pd META; #X obj 439 238 declare -lib iemmatrix; #X connect 1 0 13 0; #X connect 3 0 11 0; #X connect 3 1 0 0; #X connect 11 0 8 0; #X connect 12 0 3 0; #X connect 13 0 12 0; #X connect 13 1 14 0; #X connect 13 2 15 0; #X connect 14 0 11 1; #X connect 14 0 17 0; #X connect 15 0 11 2; #X connect 15 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_rowcol.pd000066400000000000000000000012241514557770000256770ustar00rootroot00000000000000#N canvas 344 107 450 193 10; #X declare -lib iemmatrix; #X obj 63 36 inlet; #X text 65 15 matrix; #X text 230 19 row idcs; #X text 331 19 col idcs; #X text 233 4 from mtx_find_rowcol:; #X obj 233 37 inlet; #X obj 336 37 inlet; #X obj 121 118 mtx_rowcol2index; #X obj 164 93 mtx; #X obj 63 55 t a a; #X obj 103 55 mtx_size; #X obj 164 55 t b f; #X obj 63 140 mtx_index; #X obj 63 160 outlet; #X obj 195 156 declare -lib iemmatrix; #X connect 0 0 9 0; #X connect 5 0 8 1; #X connect 6 0 7 1; #X connect 7 0 12 1; #X connect 8 0 7 0; #X connect 9 0 12 0; #X connect 9 1 10 0; #X connect 10 1 11 0; #X connect 11 0 8 0; #X connect 11 1 7 2; #X connect 12 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_rowcol_grid-help.pd000066400000000000000000000026131514557770000276350ustar00rootroot00000000000000#N canvas 91 491 751 277 10; #X declare -lib iemmatrix; #X obj 75 133 mtx_print A; #X msg 33 59 bang; #X text 482 28 part of iemmatrix; #X obj 33 132 t a a; #X text 384 169 inletA: matrix/vector; #X obj 33 232 mtx_print output; #X obj 33 83 t b b b; #X obj 305 136 mtx_print B_row; #X msg 304 111 matrix 1 2 3 1; #X text 43 34 [mtx_index_rowcol_grid]; #X text 166 69 finds the values to the row and col grid indices in a given matrix.; #X text 383 195 inletB: col matrix/vector; #X text 384 181 inletB: row matrix/vector; #X msg 33 112 matrix 3 3 11 12 13 21 22 23 31 32 33; #X obj 33 194 mtx_index_rowcol_grid; #X msg 416 111 matrix 1 2 2 1; #X obj 417 137 mtx_print B_col; #X text 382 216 outleA: matrix containing the grid-indexed rows and cols; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION find the values to the row/column grid indices in a matrix, f 72; #X restore 584 237 pd META; #X obj 439 238 declare -lib iemmatrix; #X connect 1 0 6 0; #X connect 3 0 14 0; #X connect 3 1 0 0; #X connect 6 0 13 0; #X connect 6 1 8 0; #X connect 6 2 15 0; #X connect 8 0 7 0; #X connect 8 0 14 1; #X connect 13 0 3 0; #X connect 14 0 5 0; #X connect 15 0 14 2; #X connect 15 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_index_rowcol_grid.pd000066400000000000000000000026631514557770000267140ustar00rootroot00000000000000#N canvas -44 0 568 374 10; #X declare -lib iemmatrix; #X obj 265 20 inlet; #X text 261 0 row_idcs; #X obj 265 40 mtx_:; #X obj 265 103 mtx_- 1; #X obj 277 209 mtx; #X obj 277 229 mtx_* 1; #X obj 277 249 mtx_repmat; #X msg 342 227 1 \$1; #X obj 265 79 mtx_transpose; #X obj 356 20 inlet; #X obj 356 90 mtx_:; #X obj 142 202 mtx; #X obj 142 223 mtx_repmat; #X text 342 0 col_idcs; #X msg 207 200 \$1 1; #X obj 70 20 inlet; #X text 68 4 matrix; #X obj 142 283 mtx_+, f 23; #X obj 70 329 outlet; #X obj 70 305 mtx_index; #X obj 383 143 mtx_size; #X obj 207 176 mtx_size; #X obj 70 83 t a a; #X obj 97 109 mtx_size; #X obj 295 326 declare -lib iemmatrix; #X obj 265 126 t a a; #X obj 356 110 t a a; #X text 396 168 slices out matrix rows and columns at the given row and col grid indices, f 17; #X obj 277 183 t b f, f 7; #X obj 142 142 t b f; #X connect 0 0 2 0; #X connect 2 0 8 0; #X connect 3 0 25 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 17 1; #X connect 7 0 6 1; #X connect 8 0 3 0; #X connect 9 0 10 0; #X connect 10 0 26 0; #X connect 11 0 12 0; #X connect 12 0 17 0; #X connect 14 0 12 1; #X connect 15 0 22 0; #X connect 17 0 19 1; #X connect 19 0 18 0; #X connect 20 0 7 0; #X connect 21 0 14 0; #X connect 22 0 19 0; #X connect 22 1 23 0; #X connect 23 1 29 0; #X connect 25 0 21 0; #X connect 25 1 4 1; #X connect 26 0 11 1; #X connect 26 1 20 0; #X connect 28 0 4 0; #X connect 28 1 5 1; #X connect 29 0 11 0; #X connect 29 1 28 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_interpol.pd000066400000000000000000000014601514557770000250410ustar00rootroot00000000000000#N canvas 441 152 383 449 10; #X declare -lib iemmatrix; #X obj 264 225 inlet mtx2; #X obj 167 393 outlet mtx; #X obj 182 216 inlet mtx1; #X obj 167 364 mtx_+; #X obj 67 33 inlet alpha beta; #X obj 67 53 t l f; #X obj 67 113 pack; #X msg 94 72 1 \$1; #X obj 94 92 -; #X obj 67 133 unpack; #X obj 67 153 t b b f; #X obj 167 284 mtx_.* 1; #X obj 264 284 mtx_.* 0; #X obj 264 245 mtx; #X obj 167 244 mtx; #X obj 209 32 declare -lib iemmatrix; #X connect 0 0 13 0; #X connect 2 0 14 1; #X connect 3 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 9 0; #X connect 7 0 8 0; #X connect 8 0 6 1; #X connect 9 0 10 0; #X connect 9 1 12 1; #X connect 10 0 14 0; #X connect 10 1 13 0; #X connect 10 2 11 1; #X connect 11 0 3 0; #X connect 12 0 3 1; #X connect 13 0 12 0; #X connect 14 0 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_ispeak-help.pd000066400000000000000000000046411514557770000254130ustar00rootroot00000000000000#N canvas 553 163 646 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 43 34 [mtx_ispeak]; #X text 166 69 searches for peaks in the rows of a matrix. peak locations are set to 1 \, others to 0; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X obj 220 107 change; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 1 7 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X restore 33 284 pd convert2tablemsg; #X obj 33 306 s view_peaks; #N canvas 0 0 450 300 (subpatch) 0; #X array view_peaks 20 float 1; #A 0 0 1 1 0 1 1 1 0 1 1 0 0 1 0 1 1 1 0 0 1; #X coords 0 1 19 0 200 20 1; #X restore 327 192 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array view_landscape 20 float 1; #A 0 0 0 0 0 2 2 2 0 0 0 0 2 3 1 3 3 3 0 0 3; #X coords 0 3 19 0 200 50 1; #X restore 326 228 graph; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X obj 220 107 change; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 7 0; #X connect 4 1 6 0; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X restore 172 284 pd convert2tablemsg; #X obj 33 165 mtx_rand; #X obj 172 306 s view_landscape; #X text 268 138 inletA: matrix/vector containing values (landscape); #X text 268 157 outletB: matrix/vector logical 1 at peaks; #X obj 33 205 mtx_int; #X obj 33 185 mtx_* 4; #X msg 33 143 1 20; #X obj 33 242 mtx_ispeak; #X obj 535 325 mtx_ispeakb; #X text 304 306 (note: bad performance at borders and larger peaks); #X text 308 326 for improved version see also:; #N canvas 356 452 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 11 44 DESCRIPTION search for peaks in the rows of a matrix, f 67; #X restore 584 358 pd META; #X obj 439 358 declare -lib iemmatrix; #X connect 3 0 4 0; #X connect 7 0 9 0; #X connect 8 0 13 0; #X connect 12 0 7 0; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 14 0 8 0; #X connect 15 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_ispeak.pd000066400000000000000000000011331514557770000244560ustar00rootroot00000000000000#N canvas 0 0 540 300 10; #X declare -lib iemmatrix; #X obj 162 43 inlet; #X obj 162 218 outlet; #X obj 162 119 t a a; #X obj 162 160 mtx_&&; #X obj 222 140 mtx_<= 0; #X obj 162 140 mtx_>= 0; #X obj 162 98 mtx_diff row -1; #X obj 222 121 mtx_roll 1; #X text 319 77 searches; #X text 312 102 matrix rows; #X text 310 128 for peaks; #X text 290 163 returns 1 at peak location; #X text 339 185 0 elsewhere; #X obj 295 246 declare -lib iemmatrix; #X connect 0 0 6 0; #X connect 2 0 5 0; #X connect 2 1 7 0; #X connect 3 0 1 0; #X connect 4 0 3 1; #X connect 5 0 3 0; #X connect 6 0 2 0; #X connect 7 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_ispeakb-help.pd000066400000000000000000000046441514557770000255600ustar00rootroot00000000000000#N canvas 83 338 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 166 69 searches for peaks in the rows of a matrix. peak locations are set to 1 \, others to 0; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X obj 220 107 change; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 1 7 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X restore 33 284 pd convert2tablemsg; #X obj 33 306 s view_peaks; #N canvas 0 0 450 300 (subpatch) 0; #X array view_peaks 20 float 1; #A 0 0 1 1 0 1 1 1 0 1 1 0 0 1 0 1 1 1 0 0 1; #X coords 0 1 19 0 200 20 1; #X restore 327 192 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array view_landscape 20 float 1; #A 0 0 0 0 0 2 2 2 0 0 0 0 2 3 1 3 3 3 0 0 3; #X coords 0 3 19 0 200 50 1; #X restore 326 228 graph; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X obj 220 107 change; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 7 0; #X connect 4 1 6 0; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X restore 172 284 pd convert2tablemsg; #X obj 33 165 mtx_rand; #X obj 172 306 s view_landscape; #X text 268 138 inletA: matrix/vector containing values (landscape); #X text 268 157 outletB: matrix/vector logical 1 at peaks; #X obj 33 205 mtx_int; #X obj 33 185 mtx_* 4; #X msg 33 143 1 20; #X text 43 34 [mtx_ispeakb]; #X text 301 307 (note: this is the improved version to [mtx_ispeak]); #X obj 33 242 mtx_ispeakb; #X text 300 325 (better performance at the borders of the array); #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION search for peaks in the rows of a matrix (improved), f 67; #X restore 584 357 pd META; #X obj 439 358 declare -lib iemmatrix; #X connect 2 0 3 0; #X connect 6 0 8 0; #X connect 7 0 12 0; #X connect 11 0 6 0; #X connect 11 0 16 0; #X connect 12 0 11 0; #X connect 13 0 7 0; #X connect 16 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_ispeakb.pd000066400000000000000000000024551514557770000246300ustar00rootroot00000000000000#N canvas 639 183 450 611 10; #X declare -lib iemmatrix; #X obj 120 32 inlet; #X obj 120 566 outlet; #X obj 120 301 t a a; #X obj 120 342 mtx_&&; #X obj 180 322 mtx_<= 0; #X obj 120 322 mtx_>= 0; #X obj 120 280 mtx_diff row -1; #X obj 180 303 mtx_roll 1; #X text 277 252 searches; #X text 270 277 matrix rows; #X text 268 303 for peaks; #X text 248 338 returns 1 at peak location; #X text 297 360 0 elsewhere; #X obj 120 75 t a a a a; #X obj 188 75 mtx_size; #X obj 249 75 - 1; #X obj 232 123 mtx_slice; #X msg 249 95 1 \$1 end \$1; #X obj 139 147 mtx_concat row; #X obj 120 174 mtx_slice 1 2 end 2; #X obj 120 197 mtx_concat row; #X obj 120 414 t a a; #X obj 149 436 mtx_size; #X obj 120 509 mtx_slice; #X msg 200 477 1 2 end \$1; #X obj 200 457 - 1; #X obj 295 576 declare -lib iemmatrix; #X connect 0 0 13 0; #X connect 2 0 5 0; #X connect 2 1 7 0; #X connect 3 0 21 0; #X connect 4 0 3 1; #X connect 5 0 3 0; #X connect 6 0 2 0; #X connect 7 0 4 0; #X connect 13 0 19 0; #X connect 13 1 18 0; #X connect 13 2 16 0; #X connect 13 3 14 0; #X connect 14 1 15 0; #X connect 15 0 17 0; #X connect 16 0 18 1; #X connect 17 0 16 1; #X connect 18 0 20 1; #X connect 19 0 20 0; #X connect 20 0 6 0; #X connect 21 0 23 0; #X connect 21 1 22 0; #X connect 22 1 25 0; #X connect 23 0 1 0; #X connect 24 0 23 1; #X connect 25 0 24 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_linspace-help.pd000066400000000000000000000016071514557770000257340ustar00rootroot00000000000000#N canvas 439 163 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 43 34 [mtx_linspace]; #X text 166 69 creates a linearly spaced vector from a startvalue to a stopvalue with n entries; #X text 268 138 inlet: [startval stopval n(; #X text 268 157 outlet: matrix/vector; #X text 465 324 see also:; #X obj 535 325 mtx_logspace; #X obj 33 165 mtx_linspace; #X obj 33 187 mtx_print; #X msg 33 143 1 4 10; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION create a linearly spaced matrix vector using start stop and numsteps, f 81; #X restore 584 358 pd META; #X obj 439 358 declare -lib iemmatrix; #X connect 7 0 8 0; #X connect 9 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_linspace.pd000066400000000000000000000021441514557770000250030ustar00rootroot00000000000000#N canvas 657 125 463 447 10; #X declare -lib iemmatrix; #X obj 88 95 inlet; #X obj 88 370 outlet; #X text 85 50 linspace creates a linear scale between the start and end point with N points; #X text 239 128 arg1: startval; #X text 236 144 arg2: stopval; #X text 232 159 arg3: N; #X obj 188 168 - 1; #X obj 140 251 /; #X obj 140 231 pack f f; #X obj 88 292 mtx_* 0; #X obj 88 230 f; #X obj 126 188 f; #X obj 126 208 -; #X msg 88 249 0 \$1; #X obj 88 270 mtx_:; #X obj 88 167 t b b f; #X obj 88 313 mtx_+ \$1; #X obj 88 126 pack \$1 \$2 \$3; #X obj 88 147 unpack f f f; #X text 169 92 inlet is a 3 argument list; #X text 201 112 optional creation arguments:; #X obj 235 366 declare -lib iemmatrix; #X connect 0 0 17 0; #X connect 6 0 8 1; #X connect 6 0 10 1; #X connect 7 0 9 1; #X connect 8 0 7 0; #X connect 9 0 16 0; #X connect 10 0 13 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 13 0 14 0; #X connect 14 0 9 0; #X connect 15 0 10 0; #X connect 15 1 11 0; #X connect 15 2 12 1; #X connect 15 2 16 1; #X connect 16 0 1 0; #X connect 17 0 18 0; #X connect 18 0 15 0; #X connect 18 1 11 1; #X connect 18 2 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_linsweep-help.pd000066400000000000000000000064361514557770000257710ustar00rootroot00000000000000#N canvas 439 163 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X obj 220 107 change; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 1 7 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X restore 33 284 pd convert2tablemsg; #N canvas 0 0 450 300 (subpatch) 0; #X array view_sweep 200 float 1; #A 0 0 1.32248e-06 0.0157889 0.0473469 0.094585 0.15722 0.234604 0.325494 0.427787 0.538234 0.652155 0.763227 0.86339 0.942954 0.991013 0.996231 0.948081 0.838516 0.664015 0.427757 0.141581 -0.172809 -0.483988 -0.752941 -0.937585 -0.999719 -0.913747 -0.675729 -0.310488 0.125992 0.55149 0.871257 0.99972 0.886284 0.538192 0.0315308 -0.497753 -0.88632 -0.994736 -0.763191 -0.249872 0.369925 0.855333 0.992993 0.698652 0.0788055 -0.590375 -0.977385 -0.863358 -0.280308 0.470134 0.957668 0.871215 0.234547 -0.564605 -0.993005 -0.731736 0.0631605 0.82094 0.952972 0.325434 -0.577567 -0.999968 -0.551413 0.399083 0.988783 0.640052 -0.340429 -0.986303 -0.615477 0.413512 0.999224 0.470037 -0.603052 -0.9739 -0.172722 0.847058 0.802436 -0.280414 -0.998477 -0.369825 0.773364 0.829785 -0.310579 -0.99847 -0.188251 0.913786 0.590284 -0.675799 -0.84699 0.384568 0.970194 -0.110352 -0.999969 -0.110213 0.980607 0.265104 -0.94811 -0.355108 0.926156 0.384445 -0.926154 -0.355112 0.948106 0.265106 -0.980605 -0.110221 0.999969 -0.110347 -0.970195 0.384566 0.84699 -0.675802 -0.590286 0.913785 0.18825 -0.99847 0.310578 0.829785 -0.773365 -0.369826 0.998478 -0.280408 -0.802439 0.847054 0.172725 -0.973901 0.603052 0.470039 -0.999224 0.413512 0.615466 -0.986302 0.340433 0.640048 -0.988782 0.399086 0.551423 -0.999968 0.577561 0.325436 -0.952975 0.820944 -0.0631564 -0.73173 0.993005 -0.564609 -0.234557 0.87121 -0.957665 0.470142 0.280307 -0.863358 0.977386 -0.590374 -0.0788057 0.698658 -0.992993 0.85533 -0.36993 -0.249882 0.763194 -0.994736 0.886318 -0.497746 -0.031524 0.538195 -0.88628 0.99972 -0.871259 0.551493 -0.126001 -0.310483 0.675724 -0.913747 0.999719 -0.937586 0.752949 -0.483987 0.172799 0.141593 -0.427737 0.664025 -0.838515 0.948078 -0.996231 0.991012 -0.942955 0.863391 -0.763242 0.652158 -0.538239 0.427787 -0.325507 0.234592 -0.157235 0.0945857 -0.0473552 0.0157955 3.02766e-06; #X coords 0 1 199 -1 200 50 1; #X restore 326 228 graph; #X obj 33 306 s view_sweep; #X text 268 138 list inlet: [omega_start omega_stop n_samples(; #X text 268 157 outletA: vector containing sweep; #X text 43 34 [mtx_linsweep]; #X obj 33 165 mtx_linsweep; #X text 166 69 creates an n sample linear sweep starting and stopping specified (digital) frequencies.; #X msg 33 143 0 3.14159 200; #N canvas 415 570 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION create a linear sweep matrix using start stop and numsamples, f 81; #X restore 584 358 pd META; #X obj 439 358 declare -lib iemmatrix; #X connect 1 0 3 0; #X connect 7 0 1 0; #X connect 9 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_linsweep.pd000066400000000000000000000032741514557770000250400ustar00rootroot00000000000000#N canvas 724 186 552 485 10; #X declare -lib iemmatrix; #X obj 94 57 inlet; #X obj 143 57 inlet; #X obj 190 57 inlet; #X obj 231 56 loadbang; #X obj 94 228 mtx_cumsum; #X text 187 209 instantaneous frequency; #X text 188 229 time dependent phase-angle argument; #X text 191 316 sweeped cos-oscillation; #N canvas 0 0 596 444 smooth_switches 0; #X obj 165 30 inlet; #X obj 165 368 outlet; #X obj 248 315 mtx_linspace; #X obj 248 294 pack f f f; #X obj 277 158 mtx_size; #X obj 276 183 t f f; #X obj 276 235 mtx; #X obj 248 124 mtx; #X obj 248 79 t b a a a; #X obj 165 50 t a a; #X obj 165 341 mtx_-; #X msg 276 210 element 1 \$1; #X msg 248 101 element 1 1; #X obj 276 263 expr -int($f1/3.14159265)*3.14159265+$f1; #X text 465 247 modulo pi; #X connect 0 0 9 0; #X connect 2 0 10 1; #X connect 3 0 2 0; #X connect 4 1 5 0; #X connect 5 0 11 0; #X connect 5 1 3 2; #X connect 6 0 13 0; #X connect 7 0 3 0; #X connect 8 0 12 0; #X connect 8 1 7 1; #X connect 8 2 4 0; #X connect 8 3 6 1; #X connect 9 0 10 0; #X connect 9 1 8 0; #X connect 10 0 1 0; #X connect 11 0 6 0; #X connect 12 0 7 0; #X connect 13 0 3 1; #X restore 94 284 pd smooth_switches (on and off zero-phase); #X text 189 261 force zero-crossing at start and end; #X obj 94 441 outlet; #X text 103 422 sweep vector; #X text 185 396 forming matrix with blocksize columns for playback; #X text 102 38 wstart; #X text 147 36 wstop; #X text 195 35 len; #X obj 94 117 pack \$1 \$2 \$3; #X obj 94 315 mtx_sin; #X obj 94 208 mtx_linspace; #X obj 275 446 declare -lib iemmatrix; #X connect 0 0 16 0; #X connect 1 0 16 1; #X connect 2 0 16 2; #X connect 3 0 16 0; #X connect 4 0 8 0; #X connect 8 0 17 0; #X connect 16 0 18 0; #X connect 17 0 10 0; #X connect 18 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_logspace-help.pd000066400000000000000000000016301514557770000257270ustar00rootroot00000000000000#N canvas 439 163 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 268 138 inlet: [startval stopval n(; #X text 268 157 outlet: matrix/vector; #X text 465 324 see also:; #X obj 33 187 mtx_print; #X text 43 34 [mtx_logspace]; #X text 166 69 creates a logarithmically spaced vector from a startvalue to a stopvalue with n entries; #X obj 33 165 mtx_logspace; #X msg 33 142 1 10000 9; #X obj 535 325 mtx_linspace; #N canvas 477 377 585 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION create a logarithmically spaced matrix vector using start stop and numsteps, f 89; #X restore 584 358 pd META; #X obj 439 358 declare -lib iemmatrix; #X connect 7 0 4 0; #X connect 8 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_logspace.pd000066400000000000000000000014311514557770000250000ustar00rootroot00000000000000#N canvas 0 0 657 300 10; #X declare -lib iemmatrix; #X obj 147 50 inlet; #X obj 147 217 outlet; #X obj 147 104 unpack f f f; #X obj 147 128 log; #X obj 181 128 log; #X obj 147 151 pack f f f, f 12; #X obj 147 172 mtx_linspace; #X obj 147 194 mtx_exp; #X text 125 1 logspace creates a logarithmic scale between start and end point with N points; #X obj 147 80 pack \$1 \$2 \$3; #X text 385 104 arg1: startval; #X text 382 120 arg2: stopval; #X text 378 135 arg3: N; #X text 315 68 inlet is a 3 argument list; #X text 347 88 optional creation arguments:; #X obj 345 186 declare -lib iemmatrix; #X connect 0 0 9 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 2 2 5 2; #X connect 3 0 5 0; #X connect 4 0 5 1; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 9 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_logsweep-help.pd000066400000000000000000001146271514557770000257720ustar00rootroot00000000000000#N canvas 439 163 841 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X obj 220 107 change; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 1 7 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X restore 33 284 pd convert2tablemsg; #N canvas 0 0 450 300 (subpatch) 0; #X array view_sweep 4000 float 1; #A 0 0 0.00940563 0.0188248 0.0282568 0.0377007 0.0471557 0.0566209 0.0660955 0.0755787 0.0850695 0.0945671 0.104071 0.113579 0.123092 0.132608 0.142126 0.151646 0.161166 0.170686 0.180204 0.18972 0.199233 0.208741 0.218245 0.227742 0.237232 0.246714 0.256186 0.265649 0.2751 0.28454 0.293966 0.303378 0.312775 0.322155 0.331519 0.340864 0.350189 0.359495 0.368778 0.37804 0.387277 0.39649 0.405677 0.414837 0.42397 0.433073 0.442146 0.451187 0.460197 0.469173 0.478114 0.487019 0.495888 0.504718 0.51351 0.522261 0.53097 0.539637 0.548261 0.556839 0.565371 0.573857 0.582293 0.590681 0.599017 0.607302 0.615533 0.623711 0.631833 0.639898 0.647906 0.655854 0.663743 0.67157 0.679335 0.687036 0.694672 0.702243 0.709745 0.71718 0.724545 0.731839 0.739061 0.74621 0.753285 0.760284 0.767206 0.77405 0.780816 0.787501 0.794104 0.800625 0.807063 0.813415 0.819681 0.82586 0.83195 0.837951 0.843861 0.849679 0.855404 0.861035 0.866571 0.87201 0.877352 0.882595 0.887738 0.89278 0.89772 0.902557 0.90729 0.911917 0.916438 0.920852 0.925157 0.929353 0.933438 0.937411 0.941272 0.945019 0.948651 0.952168 0.955567 0.958849 0.962013 0.965057 0.96798 0.970782 0.973461 0.976016 0.978448 0.980754 0.982934 0.984988 0.986913 0.98871 0.990377 0.991914 0.99332 0.994594 0.995735 0.996743 0.997616 0.998355 0.998958 0.999424 0.999754 0.999946 0.999999 0.999913 0.999688 0.999323 0.998816 0.998169 0.997379 0.996447 0.995372 0.994153 0.992791 0.991284 0.989632 0.987836 0.985893 0.983804 0.98157 0.979188 0.976659 0.973984 0.97116 0.968189 0.96507 0.961803 0.958387 0.954823 0.951111 0.947249 0.943239 0.93908 0.934772 0.930315 0.92571 0.920955 0.916052 0.911001 0.9058 0.900452 0.894955 0.889311 0.883519 0.877579 0.871492 0.865259 0.858879 0.852353 0.845681 0.838865 0.831903 0.824797 0.817548 0.810155 0.802619 0.794942 0.787124 0.779164 0.771065 0.762827 0.75445 0.745935 0.737284 0.728497 0.719574 0.710518 0.701328 0.692006 0.682553 0.672971 0.663259 0.653419 0.643452 0.63336 0.623143 0.612804 0.602342 0.591761 0.581059 0.570241 0.559306 0.548256 0.537092 0.525817 0.514432 0.502937 0.491336 0.479629 0.467818 0.455905 0.443892 0.43178 0.419571 0.407268 0.394872 0.382384 0.369807 0.357143 0.344394 0.331562 0.318648 0.305656 0.292587 0.279443 0.266227 0.252941 0.239586 0.226166 0.212683 0.199138 0.185536 0.171877 0.158164 0.1444 0.130587 0.116728 0.102826 0.088882 0.0749002 0.0608825 0.0468313 0.0327501 0.0186413 0.00450744 -0.0096485 -0.0238235 -0.0380151 -0.0522207 -0.0664365 -0.0806604 -0.0948893 -0.10912 -0.12335 -0.137575 -0.151794 -0.166002 -0.180198 -0.194377 -0.208536 -0.222674 -0.236786 -0.250868 -0.264919 -0.278935 -0.292913 -0.306849 -0.320741 -0.334584 -0.348376 -0.362114 -0.375794 -0.389413 -0.402967 -0.416454 -0.429869 -0.443211 -0.456474 -0.469657 -0.482755 -0.495765 -0.508685 -0.521509 -0.534237 -0.546862 -0.559384 -0.571797 -0.584099 -0.596287 -0.608357 -0.620305 -0.632128 -0.643823 -0.655388 -0.666817 -0.678109 -0.689259 -0.700265 -0.711122 -0.721829 -0.732381 -0.742776 -0.753009 -0.763079 -0.772981 -0.782714 -0.792272 -0.801653 -0.810855 -0.819874 -0.828707 -0.837351 -0.845803 -0.85406 -0.862119 -0.869977 -0.877632 -0.88508 -0.892319 -0.899345 -0.906157 -0.912751 -0.919125 -0.925275 -0.931201 -0.936898 -0.942365 -0.947598 -0.952597 -0.957357 -0.961878 -0.966156 -0.970189 -0.973976 -0.977514 -0.980801 -0.983835 -0.986614 -0.989136 -0.9914 -0.993403 -0.995144 -0.996622 -0.997834 -0.998779 -0.999456 -0.999864 -1 -0.999864 -0.999455 -0.998771 -0.997811 -0.996575 -0.995062 -0.99327 -0.991199 -0.988849 -0.986218 -0.983306 -0.980114 -0.976639 -0.972883 -0.968845 -0.964525 -0.959923 -0.955039 -0.949873 -0.944426 -0.938697 -0.932687 -0.926397 -0.919828 -0.912979 -0.905852 -0.898448 -0.890768 -0.882812 -0.874582 -0.866079 -0.857305 -0.848261 -0.838949 -0.829369 -0.819525 -0.809417 -0.799048 -0.78842 -0.777535 -0.766394 -0.755002 -0.743359 -0.731468 -0.719333 -0.706956 -0.694339 -0.681486 -0.6684 -0.655083 -0.641539 -0.627772 -0.613784 -0.599581 -0.585163 -0.570537 -0.555705 -0.540672 -0.525441 -0.510018 -0.494405 -0.478607 -0.462629 -0.446475 -0.43015 -0.413658 -0.397005 -0.380195 -0.363233 -0.346124 -0.328874 -0.311487 -0.29397 -0.276327 -0.258563 -0.240685 -0.222699 -0.20461 -0.186423 -0.168145 -0.149782 -0.131339 -0.112824 -0.0942411 -0.0755984 -0.056901 -0.0381557 -0.0193696 -0.000548665 0.0183006 0.0371711 0.0560568 0.0749501 0.0938446 0.112734 0.131609 0.150466 0.169296 0.188091 0.206847 0.225553 0.244205 0.262795 0.281314 0.299757 0.318116 0.336382 0.35455 0.372612 0.39056 0.408388 0.426087 0.44365 0.46107 0.47834 0.495451 0.512398 0.529172 0.545766 0.562173 0.578386 0.594396 0.610198 0.625784 0.641146 0.656277 0.671171 0.685821 0.700219 0.714357 0.728231 0.741833 0.755155 0.768192 0.780936 0.793381 0.805521 0.817349 0.828859 0.840045 0.8509 0.861419 0.871596 0.881424 0.890899 0.900015 0.908765 0.917145 0.92515 0.932774 0.940013 0.946861 0.953315 0.959368 0.965018 0.970259 0.975088 0.9795 0.983492 0.987061 0.990202 0.992913 0.99519 0.99703 0.998431 0.99939 0.999905 0.999973 0.999592 0.998761 0.997478 0.995742 0.993551 0.990904 0.987801 0.98424 0.980222 0.975747 0.970814 0.965423 0.959576 0.953273 0.946514 0.939301 0.931636 0.92352 0.914955 0.905943 0.896487 0.886588 0.87625 0.865476 0.85427 0.842634 0.830572 0.818089 0.805188 0.791875 0.778155 0.764031 0.749509 0.734596 0.719295 0.703613 0.687559 0.671136 0.654351 0.637213 0.619726 0.601902 0.583744 0.565262 0.546463 0.527358 0.507952 0.488257 0.46828 0.44803 0.427517 0.406751 0.385742 0.364499 0.343033 0.321353 0.299472 0.277399 0.255148 0.232725 0.210145 0.187419 0.164559 0.141576 0.118482 0.0952894 0.0720106 0.0486582 0.0252449 0.00178335 -0.0217144 -0.0452345 -0.0687648 -0.092291 -0.115801 -0.13928 -0.162716 -0.186094 -0.209403 -0.232627 -0.255752 -0.278766 -0.301655 -0.324405 -0.347001 -0.369431 -0.39168 -0.413735 -0.435581 -0.457206 -0.478595 -0.499735 -0.52061 -0.54121 -0.56152 -0.581526 -0.601216 -0.620573 -0.639589 -0.658248 -0.676538 -0.694446 -0.71196 -0.729065 -0.745751 -0.762006 -0.777818 -0.793173 -0.808062 -0.822473 -0.836394 -0.849815 -0.862726 -0.875114 -0.886971 -0.898287 -0.909052 -0.919257 -0.928892 -0.93795 -0.94642 -0.954297 -0.961572 -0.968237 -0.974285 -0.97971 -0.984505 -0.988665 -0.992183 -0.995056 -0.997277 -0.998843 -0.99975 -0.999994 -0.999572 -0.998481 -0.99672 -0.994286 -0.991178 -0.987395 -0.982937 -0.977804 -0.971997 -0.965516 -0.958362 -0.950539 -0.942048 -0.932892 -0.923075 -0.912601 -0.901474 -0.889699 -0.877282 -0.864229 -0.850545 -0.836239 -0.821317 -0.805787 -0.789658 -0.77294 -0.755641 -0.737771 -0.719342 -0.700363 -0.680846 -0.660805 -0.640249 -0.619193 -0.59765 -0.575635 -0.553161 -0.530242 -0.506895 -0.483134 -0.458977 -0.434439 -0.409538 -0.38429 -0.358713 -0.332826 -0.306648 -0.280196 -0.25349 -0.22655 -0.199395 -0.172046 -0.144524 -0.116848 -0.0890406 -0.0611226 -0.0331147 -0.00504075 0.0230791 0.0512217 0.0793645 0.107487 0.135563 0.163573 0.191492 0.219297 0.246966 0.274475 0.301803 0.328923 0.355812 0.382451 0.408813 0.434877 0.460619 0.486016 0.511044 0.535684 0.55991 0.583701 0.607036 0.62989 0.652245 0.674079 0.695369 0.716096 0.736238 0.755776 0.774691 0.792964 0.810575 0.827506 0.843739 0.859258 0.874044 0.888082 0.901357 0.913852 0.925553 0.936446 0.946519 0.955757 0.96415 0.971686 0.978354 0.984144 0.989047 0.993055 0.996161 0.998356 0.999636 0.999994 0.999427 0.997932 0.995504 0.992144 0.987848 0.982619 0.976455 0.96936 0.961336 0.952385 0.942514 0.931727 0.92003 0.907431 0.893939 0.879561 0.864309 0.848193 0.831226 0.81342 0.79479 0.775349 0.755114 0.734102 0.712329 0.689816 0.666579 0.64264 0.61802 0.592742 0.566827 0.540299 0.513183 0.485504 0.457286 0.428559 0.399348 0.369684 0.339592 0.309104 0.278251 0.24706 0.215566 0.183799 0.15179 0.119576 0.0871878 0.0546596 0.0220246 -0.0106807 -0.043424 -0.0761664 -0.108876 -0.141517 -0.17405 -0.206443 -0.238657 -0.270657 -0.302407 -0.333873 -0.365014 -0.395797 -0.426184 -0.456143 -0.485636 -0.514628 -0.543085 -0.570971 -0.598252 -0.624896 -0.650868 -0.676137 -0.70067 -0.724432 -0.747399 -0.769537 -0.790817 -0.81121 -0.83069 -0.849228 -0.8668 -0.88338 -0.898944 -0.913469 -0.926933 -0.939317 -0.9506 -0.960763 -0.96979 -0.977666 -0.984374 -0.989902 -0.994238 -0.997372 -0.999294 -0.999997 -0.999474 -0.997721 -0.994734 -0.990512 -0.985055 -0.978364 -0.970441 -0.961292 -0.950923 -0.939341 -0.926556 -0.912578 -0.897421 -0.881098 -0.863625 -0.845019 -0.8253 -0.804489 -0.782608 -0.759678 -0.735727 -0.710783 -0.684874 -0.658027 -0.630274 -0.601648 -0.572186 -0.54192 -0.510889 -0.479129 -0.446683 -0.41359 -0.37989 -0.345629 -0.310849 -0.275595 -0.239914 -0.203855 -0.16746 -0.130785 -0.0938747 -0.0567798 -0.0195528 0.0177546 0.0550907 0.0924069 0.129648 0.166761 0.203692 0.24039 0.2768 0.312868 0.348543 0.38377 0.418498 0.452673 0.486244 0.51916 0.55137 0.582823 0.613469 0.643262 0.672152 0.700095 0.727041 0.75295 0.777776 0.801475 0.824012 0.845346 0.865438 0.884253 0.901757 0.917918 0.932704 0.946087 0.958041 0.968541 0.977563 0.985089 0.991099 0.995577 0.998511 0.999887 0.999698 0.997936 0.994599 0.989683 0.98319 0.975123 0.96549 0.954296 0.941555 0.92728 0.911487 0.894195 0.875426 0.855204 0.833555 0.810511 0.786101 0.76036 0.733324 0.705034 0.675531 0.644859 0.613063 0.580195 0.5463 0.511437 0.475657 0.439017 0.40158 0.3634 0.324543 0.285073; #A 1000 0.245053 0.204554 0.163639 0.122381 0.0808506 0.0391179 -0.00274409 -0.0446604 -0.0865609 -0.128369 -0.170013 -0.211414 -0.252499 -0.293191 -0.333418 -0.373104 -0.412175 -0.450557 -0.488175 -0.524964 -0.560846 -0.595755 -0.629622 -0.66238 -0.693962 -0.724303 -0.753346 -0.781028 -0.807291 -0.83208 -0.855342 -0.877026 -0.897084 -0.915472 -0.932147 -0.947069 -0.960202 -0.971512 -0.980972 -0.988552 -0.994232 -0.997991 -0.999814 -0.999689 -0.997608 -0.993565 -0.98756 -0.979597 -0.969683 -0.957829 -0.944051 -0.928366 -0.9108 -0.891378 -0.87013 -0.847095 -0.822309 -0.795815 -0.76766 -0.737895 -0.706574 -0.673753 -0.639497 -0.603867 -0.566932 -0.528764 -0.489438 -0.449029 -0.407619 -0.36529 -0.322131 -0.278225 -0.233665 -0.18854 -0.14295 -0.0969879 -0.0507473 -0.00433088 0.0421616 0.0886313 0.134975 0.181092 0.226882 0.272241 0.317066 0.361258 0.404713 0.447336 0.489025 0.529684 0.569219 0.607531 0.644534 0.680133 0.714247 0.746788 0.777675 0.80683 0.834182 0.859657 0.883188 0.904714 0.924174 0.941515 0.956686 0.969643 0.980346 0.98876 0.994854 0.998604 0.999992 0.999002 0.995628 0.989867 0.981722 0.971203 0.958324 0.943107 0.925578 0.90577 0.883722 0.859477 0.833086 0.804604 0.774093 0.74162 0.707257 0.67108 0.633175 0.593626 0.552529 0.509979 0.466076 0.420927 0.374643 0.327336 0.279121 0.230121 0.180458 0.130255 0.0796446 0.0287531 -0.0222875 -0.0733442 -0.124283 -0.174969 -0.22527 -0.275047 -0.324169 -0.372501 -0.419911 -0.466268 -0.511442 -0.555305 -0.597738 -0.638615 -0.677821 -0.715241 -0.750763 -0.784285 -0.815703 -0.844922 -0.871853 -0.896411 -0.918515 -0.938096 -0.955087 -0.969429 -0.981069 -0.989963 -0.996075 -0.999374 -0.999839 -0.997456 -0.99222 -0.984133 -0.973207 -0.959459 -0.942917 -0.923618 -0.901605 -0.876931 -0.849658 -0.819852 -0.787591 -0.752959 -0.716051 -0.676964 -0.635805 -0.592688 -0.547736 -0.501073 -0.452833 -0.403156 -0.352186 -0.300074 -0.24697 -0.193035 -0.138434 -0.0833236 -0.0278767 0.0277364 0.0833434 0.138771 0.19385 0.248401 0.302252 0.355232 0.407168 0.457891 0.507236 0.555037 0.601139 0.645383 0.687621 0.727702 0.765496 0.800868 0.833686 0.863842 0.891218 0.915716 0.93724 0.955707 0.971044 0.983187 0.992078 0.997675 0.999946 0.998869 0.99443 0.986633 0.975487 0.961017 0.943255 0.922253 0.898061 0.870756 0.840415 0.807126 0.770998 0.732137 0.690675 0.646739 0.600477 0.552034 0.501582 0.44928 0.395316 0.339864 0.28312 0.225288 0.166557 0.107148 0.0472629 -0.0128769 -0.0730614 -0.133064 -0.192672 -0.251658 -0.309807 -0.366903 -0.422725 -0.477066 -0.529715 -0.580471 -0.62913 -0.675507 -0.719411 -0.760675 -0.799124 -0.8346 -0.866963 -0.896065 -0.921789 -0.944016 -0.96265 -0.9776 -0.988792 -0.996169 -0.999683 -0.999305 -0.995018 -0.986823 -0.974736 -0.958785 -0.93902 -0.915499 -0.888302 -0.857518 -0.823261 -0.785649 -0.744819 -0.700926 -0.654127 -0.604607 -0.552552 -0.498164 -0.441656 -0.383255 -0.323186 -0.261695 -0.199033 -0.13545 -0.0712134 -0.00658402 0.0581643 0.122767 0.186939 0.250419 0.312926 0.374196 0.433956 0.491947 0.547907 0.601598 0.652764 0.701179 0.746626 0.788883 0.827761 0.863068 0.894638 0.922311 0.945952 0.965436 0.980659 0.991535 0.997996 0.999993 0.997499 0.990505 0.979022 0.963085 0.942744 0.918074 0.889173 0.856147 0.819138 0.778296 0.733791 0.685819 0.634585 0.580316 0.523248 0.463644 0.401768 0.337909 0.272355 0.205416 0.137399 0.0686245 -0.000573579 -0.0698716 -0.138932 -0.207427 -0.275006 -0.341356 -0.406133 -0.469019 -0.529694 -0.587854 -0.643201 -0.695443 -0.744316 -0.789554 -0.830921 -0.868186 -0.90115 -0.929627 -0.953453 -0.972485 -0.98661 -0.995731 -0.999781 -0.998717 -0.992522 -0.981204 -0.964803 -0.943378 -0.917023 -0.885848 -0.85 -0.809645 -0.764976 -0.71621 -0.663583 -0.607364 -0.547832 -0.485294 -0.42007 -0.352497 -0.28293 -0.211738 -0.139291 -0.0659894 0.00777693 0.0816112 0.155105 0.227857 0.299452 0.369503 0.437608 0.50338 0.566443 0.626437 0.683002 0.735815 0.784559 0.828936 0.868682 0.903546 0.93331 0.957781 0.976796 0.99022 0.997954 0.999927 0.996102 0.986476 0.971081 0.949982 0.923277 0.891099 0.853616 0.811024 0.763558 0.711473 0.655067 0.594658 0.530586 0.46323 0.392972 0.320238 0.245448 0.16906 0.0915197 0.0133128 -0.06509 -0.143206 -0.22055 -0.296638 -0.370989 -0.443137 -0.512618 -0.578983 -0.641802 -0.700662 -0.755174 -0.804976 -0.849722 -0.889111 -0.922866 -0.950745 -0.972544 -0.988093 -0.997267 -0.999978 -0.996178 -0.985867 -0.969082 -0.945905 -0.916464 -0.88092 -0.83949 -0.792418 -0.739998 -0.682553 -0.620448 -0.554082 -0.483884 -0.410309 -0.333849 -0.255009 -0.174309 -0.0923048 -0.00954283 0.0733988 0.155956 0.237554 0.317622 0.395589 0.470911 0.543046 0.611465 0.675683 0.735219 0.789633 0.838516 0.881495 0.918237 0.948453 0.971895 0.988366 0.997715 0.999845 0.994709 0.982312 0.962712 0.936025 0.902413 0.862096 0.815343 0.762471 0.703851 0.639894 0.571054 0.497828 0.420752 0.340384 0.257323 0.172189 0.0856239 -0.00172692 -0.0891861 -0.176089 -0.261757 -0.345531 -0.426745 -0.504761 -0.578958 -0.648734 -0.713528 -0.772803 -0.826074 -0.872887 -0.912847 -0.945603 -0.970866 -0.988398 -0.998026 -0.999638 -0.993186 -0.978687 -0.956225 -0.925946 -0.888066 -0.842859 -0.79067 -0.731892 -0.666986 -0.596463 -0.520884 -0.440858 -0.357029 -0.27009 -0.180756 -0.0897722 0.00210585 0.0940952 0.185421 0.275295 0.362944 0.447615 0.528551 0.605051 0.676425 0.742036 0.801285 0.85363 0.898579 0.93571 0.964659 0.985135 0.996922 0.999875 0.99393 0.979103 0.955486 0.923254 0.88266 0.834036 0.777783 0.714387 0.644389 0.5684 0.487095 0.401192 0.311471 0.218736 0.123844 0.0276592 -0.0689165 -0.164992 -0.259656 -0.352012 -0.441188 -0.526312 -0.60657 -0.681168 -0.749379 -0.810511 -0.863956 -0.909157 -0.94565 -0.973039 -0.991019 -0.999375 -0.997983 -0.986813 -0.965935 -0.935511 -0.895801 -0.847156 -0.790024 -0.724936 -0.652511 -0.573435 -0.488486 -0.398488 -0.304331 -0.206953 -0.107326 -0.00646698 0.0946104 0.194854 0.293247 0.388751 0.480378 0.567141 0.64813 0.722473 0.78936 0.848058 0.897911 0.938354 0.968922 0.98924 0.999052 0.998207 0.986668 0.964511 0.931929 0.889231 0.836838 0.775265 0.705161 0.627246 0.542343 0.451346 0.355254 0.255088 0.151947 0.0469758 -0.0586861 -0.163836 -0.267291 -0.367894 -0.464497 -0.555975 -0.641279 -0.719399 -0.789424 -0.850515 -0.901927 -0.943023 -0.973291 -0.992331 -0.999871 -0.995775 -0.98004 -0.952796 -0.91432 -0.865017 -0.805418 -0.736186 -0.658096 -0.572057 -0.479053 -0.380176 -0.276569 -0.169491 -0.0602076 0.0499646 0.159696 0.267623 0.372439 0.472835 0.567557 0.655411 0.735279 0.806134 0.867059 0.917245 0.956015 0.982837 0.997321 0.999229 0.988483 0.965164 0.929514 0.881938 0.822989 0.753381 0.673966 0.585723 0.489757 0.38729 0.279624 0.168151 0.0543109 -0.0604174 -0.174501 -0.286449 -0.394753 -0.497968 -0.594682 -0.683578 -0.763424 -0.833116 -0.891666 -0.938226 -0.972114 -0.992818 -0.999996 -0.993489 -0.97333 -0.939735 -0.893109 -0.834048 -0.763311 -0.68184 -0.590726 -0.491192 -0.384615 -0.272473 -0.156308 -0.0377563 0.0814908 0.199751 0.315327 0.426549 0.531792 0.629517 0.718277 0.796745 0.863734 0.918213 0.959333 0.986435 0.999056 0.996947 0.980077 0.948632 0.903016 0.843849 0.77196 0.688374 0.594302 0.491111 0.380335 0.263622 0.142721 0.0194599 -0.104266 -0.226571 -0.345562 -0.459373 -0.566241 -0.664448 -0.752437 -0.828784 -0.89225 -0.941767 -0.976497 -0.995833 -0.999396 -0.987061 -0.958959 -0.91547 -0.857222 -0.785092 -0.700189 -0.603824 -0.497524 -0.382957 -0.26198 -0.13654 -0.00867176 0.119521 0.245928 0.368432 0.484996 0.593648 0.692533 0.779956 0.854392 0.91453 0.959297 0.987866 0.999677 0.994459 0.972226 0.933283 0.878233 0.807957 0.723598 0.626563 0.518491 0.40121 0.276747 0.14724 0.0149567 -0.11778 -0.24862 -0.37524 -0.495357 -0.606799 -0.707532 -0.795705 -0.869669 -0.928031 -0.969661 -0.993734 -0.999732 -0.98747 -0.95709 -0.909077 -0.844239 -0.763692 -0.668878 -0.561491 -0.443478 -0.317001 -0.184389 -0.0481328 0.0892343 0.22511 0.356917 0.482113 0.598288 0.703179 0.794734 0.871112 0.93079 0.972531 0.99545 0.99902 0.983085 0.947875 0.893997 0.82243 0.734515 0.631921 0.516622 0.390868 0.25712 0.118027 -0.0236403 -0.165027 -0.303289 -0.435601 -0.559238 -0.67165 -0.770498 -0.853675 -0.919417 -0.966286 -0.993233 -0.999613 -0.985203 -0.950214 -0.895291 -0.821495 -0.730307 -0.62357 -0.503477 -0.372525 -0.233452 -0.0891984 0.0571742 0.202531 0.343742 0.477718 0.601537 0.712467 0.808036 0.886085 0.944823 0.98288 0.999328 0.99371 0.966054 0.91688 0.847193 0.758459 0.65259 0.531894 0.399024 0.256941 0.108814 -0.041989 -0.192053 -0.337934 -0.476277 -0.603852 -0.717673 -0.81504 -0.893631 -0.951525 -0.987286 -0.999979 -0.989208 -0.955122 -0.898425 -0.820369 -0.722714 -0.607691 -0.47799 -0.336651 -0.187015 -0.0326605 0.122717 0.27533 0.421466 0.557539 0.680182 0.786313 0.87326 0.938796 0.981206 0.999335 0.99263 0.961151 0.905578 0.827197 0.727892 0.610074 0.476648 0.330925 0.176571 0.0174892 -0.142266 -0.298601 -0.447468 -0.584989 -0.707559 -0.811922 -0.89529 -0.955381 -0.990528 -0.999698 -0.982534 -0.939381 -0.871268 -0.779898 -0.667607 -0.537306 -0.392413 -0.236761 -0.0745029 0.0900094 0.252307 0.407973 0.552737 0.682591 0.793895 0.883517 0.948885 0.988088 0.999924 0.983943 0.940472 0.870611 0.776207 0.659811 0.524621 0.374374 0.213285 0.0458833 -0.123061 -0.288722 -0.446324 -0.591303 -0.71939 -0.826818 -0.910368 -0.967505 -0.996442 -0.996209 -0.966688 -0.908624 -0.823603 -0.714044 -0.583091 -0.434564 -0.272811 -0.102655 0.0708333 0.242426 0.406937 0.559341 0.694927 0.809504 0.899466 0.961948 0.994904 0.997189 0.968603 0.909896; #A 2000 0.822771 0.709826 0.574491 0.420915 0.25385 0.0785384 -0.0995222 -0.274662 -0.441315 -0.594089 -0.728047 -0.83879 -0.922653 -0.976811 -0.999373 -0.989474 -0.947294 -0.874071 -0.77208 -0.644552 -0.495577 -0.32999 -0.153223 0.028899 0.210304 0.384942 0.546911 0.690698 0.811378 0.90476 0.967566 0.997513 0.993444 0.955351 0.884394 0.782875 0.65417 0.502623 0.333401 0.152309 -0.0343525 -0.220073 -0.39833 -0.562805 -0.707618 -0.827558 -0.918247 -0.976332 -0.999592 -0.987044 -0.938982 -0.856993 -0.743883 -0.603639 -0.441233 -0.2625 -0.0739018 0.117667 0.305185 0.481698 0.640647 0.776046 0.88274 0.956643 0.994835 0.995728 0.959133 0.886265 0.779735 0.643434 0.482436 0.302775 0.111251 -0.0848122 -0.277878 -0.460488 -0.625518 -0.766466 -0.877745 -0.954871 -0.994682 -0.995443 -0.956957 -0.880585 -0.769179 -0.627035 -0.459669 -0.273691 -0.0764707 0.124122 0.319993 0.503181 0.666213 0.802377 0.90598 0.972659 0.999508 0.985253 0.930302 0.836756 0.708347 0.550256 0.368953 0.171945 -0.0325581 -0.23599 -0.429736 -0.605559 -0.755899 -0.874251 -0.95541 -0.995744 -0.993343 -0.948121 -0.861862 -0.738111 -0.58209 -0.400477 -0.201108 0.00738045 0.215828 0.41507 0.596224 0.751191 0.872963 0.955969 0.996316 0.992018 0.943076 0.851501 0.721267 0.558103 0.369305 0.163369 -0.0503217 -0.262001 -0.461928 -0.640804 -0.790267 -0.903234 -0.974292 -0.999944 -0.978788 -0.911618 -0.801398 -0.653159 -0.473767 -0.271602 -0.0562012 0.162196 0.373118 0.56642 0.732678 0.863741 0.953119 0.996272 0.990904 0.937062 0.837187 0.695991 0.520249 0.318533 0.100729 -0.12241 -0.33974 -0.540389 -0.714198 -0.852305 -0.947592 -0.995041 -0.992041 -0.938527 -0.837024 -0.692503 -0.512231 -0.305317 -0.0823343 0.145237 0.365577 0.567176 0.739434 0.873196 0.961259 0.998794 0.983597 0.916245 0.800093 0.641134 0.447661 0.229925 -0.000482313 -0.23119 -0.449723 -0.644176 -0.803869 -0.919948 -0.985865 -0.99779 -0.954839 -0.859145 -0.715781 -0.532487 -0.319303 -0.0880026 0.148575 0.377126 0.584778 0.759703 0.891861 0.973572 0.999961 0.969283 0.883044 0.745965 0.56572 0.352549 0.11865 -0.122461 -0.356794 -0.570599 -0.751282 -0.888066 -0.972699 -0.999954 -0.967977 -0.878407 -0.736351 -0.550061 -0.330528 -0.0908116 0.154746 0.391258 0.604384 0.781054 0.910317 0.984078 0.997569 0.949699 0.843157 0.684281 0.48273 0.250833 0.00296105 -0.245436 -0.478795 -0.68233 -0.843074 -0.950669 -0.998037 -0.981917 -0.903065 -0.766255 -0.580043 -0.356191 -0.109028 0.145561 0.39105 0.611401 0.792107 0.921163 0.989853 0.9934 0.931289 0.807351 0.629569 0.40954 0.161835 -0.0970624 -0.349805 -0.579318 -0.769965 -0.908659 -0.985738 -0.995683 -0.937518 -0.814949 -0.636131 -0.413176 -0.161299 0.102112 0.358802 0.590796 0.781772 0.918132 0.990043 0.992152 0.924013 0.790168 0.599856 0.366439 0.106453 -0.16157 -0.41831 -0.645187 -0.825647 -0.946375 -0.998312 -0.977371 -0.884777 -0.727027 -0.515453 -0.265502 0.00448399 0.274519 0.524469 0.735558 0.89179 0.981177 0.996701 0.93686 0.805878 0.613416 0.373893 0.105433 -0.171503 -0.435615 -0.666508 -0.846134 -0.96036 -0.999997 -0.961641 -0.847963 -0.667559 -0.434358 -0.166533 0.114859 0.387515 0.629713 0.821952 0.948628 0.999299 0.96955 0.861444 0.683394 0.449584 0.178803 -0.106952 -0.384356 -0.630549 -0.825133 -0.951792 -0.999741 -0.964656 -0.849108 -0.662406 -0.41991 -0.141775 0.148711 0.427021 0.669514 0.855401 0.968596 0.999103 0.943943 0.807508 0.601217 0.34262 0.0539322 -0.239853 -0.513119 -0.741862 -0.905814 -0.990272 -0.98743 -0.897177 -0.727148 -0.492144 -0.212876 0.0858373 0.37727 0.635154 0.836015 0.961437 0.999711 0.946974 0.807659 0.594156 0.325777 0.0269903 -0.274711 -0.551364 -0.777167 -0.930849 -0.997754 -0.971231 -0.853373 -0.654905 -0.394249 -0.0958376 0.212099 0.500224 0.740927 0.910917 0.99353 0.980436 0.872495 0.67976 0.420631 0.120099 -0.192593 -0.486815 -0.733563 -0.908258 -0.993316 -0.979911 -0.868964 -0.671112 -0.405811 -0.0994189 0.217422 0.512751 0.756574 0.923914 0.997409 0.969142 0.841584 0.627419 0.348326 0.0328724 -0.286432 -0.576431 -0.806769 -0.953134 -0.99984 -0.941541 -0.78394 -0.543283 -0.244699 0.0802948 0.397197 0.672068 0.875277 0.984679 0.988058 0.884617 0.685109 0.410815 0.0913572 -0.238545 -0.542736 -0.787662 -0.946045 -0.999991 -0.943072 -0.781155 -0.531869 -0.22271 0.111857 0.434304 0.708198 0.902301 0.994272 0.973202 0.841012 0.612365 0.313101 -0.0226211 -0.356193 -0.649006 -0.866837 -0.984038 -0.98648 -0.873395 -0.657569 -0.363997 -0.0270169 0.31362 0.617489 0.848199 0.977885 0.990584 0.884272 0.671258 0.376829 0.0363112 -0.309076 -0.617279 -0.850451 -0.979687 -0.988671 -0.875776 -0.654457 -0.351684 -0.00475503 0.343239 0.648795 0.873399 0.988471 0.979024 0.845732 0.604976 0.286941 -0.0681533 -0.415032 -0.709112 -0.912368 -0.998173 -0.954932 -0.787709 -0.517731 -0.179825 0.182092 0.520614 0.791063 0.957452 0.997317 0.90483 0.691742 0.386007 0.0281621 -0.33396 -0.65162 -0.881701 -0.992678 -0.968983 -0.813265 -0.546254 -0.204036 0.166679 0.514938 0.792546 0.960705 0.995602 0.891816 0.663262 0.341437 -0.0288243 -0.395522 -0.706799 -0.918347 -0.999622 -0.938512 -0.743153 -0.440932 -0.0749438 0.30235 0.636467 0.878722 0.993536 0.963602 0.792712 0.505316 0.143176 -0.240545 -0.589228 -0.85097 -0.986469 -0.97498 -0.817599 -0.537336 -0.175793 0.212763 0.569612 0.840539 0.983887 0.977271 0.821058 0.538615 0.172869 -0.220071 -0.579461 -0.849405 -0.987444 -0.971507 -0.803416 -0.508949 -0.133931 0.262751 0.618388 0.876266 0.994922 0.954831 0.761734 0.446007 0.0580302 -0.339874 -0.683254 -0.916101 -0.999982 -0.920581 -0.690239 -0.34615 0.0554735 0.448438 0.767635 0.959685 0.992022 0.858569 0.581032 0.205437 -0.205316 -0.5819 -0.860347 -0.992883 -0.956308 -0.756172 -0.426072 -0.0222982 0.385904 0.7279 0.944136 0.996436 0.875003 0.600346 0.220001 -0.199536 -0.584468 -0.866498 -0.995193 -0.946985 -0.729757 -0.381645 0.0354191 0.446669 0.777865 0.968746 0.984063 0.820303 0.506608 0.0997439 -0.325968 -0.692265 -0.931247 -0.998149 -0.879836 -0.597539 -0.203332 0.229516 0.619834 0.893954 0.999649 0.916185 0.658611 0.275248 -0.161181 -0.567333 -0.865065 -0.996567 -0.935742 -0.693581 -0.316339 0.12301 0.538945 0.849827 0.994174 0.942825 0.705113 0.327368 -0.115929 -0.53674 -0.850827 -0.994845 -0.939114 -0.694052 -0.30835 0.140331 0.561132 0.868094 0.998003 0.923508 0.659067 0.25839 -0.196225 -0.610776 -0.898897 -0.999973 -0.892105 -0.597031 -0.176013 0.282689 0.682201 0.937583 0.993916 0.838333 0.503227 0.059764 -0.397142 -0.769018 -0.975035 -0.969815 -0.753621 -0.372744 0.090172 0.533942 0.860841 0.998226 0.914941 0.628548 0.201908 -0.270368 -0.682734 -0.942483 -0.99045 -0.814975 -0.454808 0.00901356 0.471435 0.826871 0.993509 0.932335 0.656475 0.228741 -0.252535 -0.675804 -0.942336 -0.989224 -0.804599 -0.430824 0.0448746 0.51063 0.85607 0.998711 0.903746 0.59286 0.139611 -0.34775 -0.752034 -0.975249 -0.962581 -0.716123 -0.294968 0.198817 0.644543 0.932546 0.991259 0.805217 0.419447 -0.0709797 -0.544378 -0.882423 -0.999868 -0.866305 -0.514324 -0.0319431 0.459137 0.834243 0.997293 0.905772 0.582064 0.108386 -0.393833 -0.79497 -0.990633 -0.929165 -0.625467 -0.157975 0.351566 0.769354 0.984966 0.94057 0.646861 0.180854 -0.333944 -0.760177 -0.983239 -0.942336 -0.647413 -0.177122 0.341793 0.768487 0.986268 0.934742 0.626921 0.146397 -0.375132 -0.793638 -0.99268 -0.916049 -0.583962 -0.0881769 0.432938 0.833042 0.99882 0.882438 0.515735 0.00191786 -0.5131 -0.882098 -0.99866 -0.828245 -0.418793 0.112264 0.611442 0.933511 0.983798 0.746497 0.290001 -0.252361 -0.72101 -0.977054 -0.94372 -0.629712 -0.12752 0.413422 0.831132 0.999423 0.866545 0.471443 -0.0671285 -0.585996 -0.9268 -0.98463 -0.740581 -0.268438 0.28706 0.75453 0.988574 0.915485 0.556791 0.0234992 -0.517853 -0.897017 -0.993772 -0.776347 -0.312394 0.251488 0.735884 0.985543 0.919423 0.557512 0.0153348 -0.532515 -0.90834 -0.989207 -0.747531 -0.261076 0.311669 0.782598 0.996021 0.880276 0.472418 -0.0930985 -0.628291 -0.953998 -0.960138 -0.643354 -0.109176 0.462611 0.878218 0.995644 0.773618 0.286701 -0.299141 -0.782861 -0.997171 -0.866856 -0.435692 0.147529 0.680051 0.975389 0.928978 0.555768 -0.013923 -0.579422 -0.940115 -0.9669 -0.648871 -0.0983656 0.48812 0.899773 0.987441 0.718095 0.187967 -0.411192 -0.861121 -0.996697 -0.766915 -0.254756 0.351978 0.82928 0.99966 0.798477 0.299284 -0.31247 -0.807801 -0.999977 -0.815305 -0.322075 0.293896 0.798865 0.999849 0.818749 0.323482 -0.296791 -0.803418 -0.999986 -0.809064 -0.303304 0.321323 0.821112 0.99956 0.785243 0.261052 -0.366999 -0.850318 -0.996173 -0.745071 -0.195783 0.432663 0.88796 0.985845 0.685333 0.106604 -0.516162 -0.929276 -0.963052 -0.602105 0.00675818 0.613613 0.967567 0.920925 0.491465 -0.143356 -0.719041 -0.994081 -0.851686 -0.350202 0.299909 0.823712 0.998113 0.747398 0.177 -0.469953 -0.915745 -0.967504 -0.601296 0.0258645 0.642583 0.980069 0.889795 0.409586 -0.251125 -0.802015 -0.999291 -0.754133 -0.173699 0.484805 0.927576 0.9554 0.554137 -0.0971821 -0.705391 -0.994886 -0.832913 -0.29143 0.383778 0.884054 0.979008 0.623288 -0.0206614 -0.655801 -0.987233 -0.859437 -0.330249 0.354184 0.873164 0.981729 0.627014 -0.0249201 -0.665801 -0.990551 -0.842936 -0.291717 0.40015 0.900284 0.966559 0.565195 -0.110894 -0.733815 -0.999454 -0.776417 -0.172186 0.517478 0.952657 0.917099 0.426581 -0.276702 -0.842801 -0.98804 -0.6379 0.0334448 0.688732 0.996494 0.799322 0.195497 -0.508726 -0.95368 -0.910204 -0.398761 0.318849 0.872499 0.9745 0.570101 -0.131908 -0.7658 -0.999095 -0.70762 -0.0429161 0.645237 0.992306; #A 3000 0.812559 0.199681 -0.520583 -0.962797 -0.888329 -0.335299 0.399477 0.918754 0.939653 0.448824 -0.287632 -0.86745 -0.971656 -0.541013 0.188815 0.814955 0.989412 0.613319 -0.105539 -0.766148 -0.997531 -0.667786 0.0391454 0.72477 0.999921 0.706475 0.00966368 -0.693501 -0.999626 -0.731117 -0.0405886 0.674182 0.998781 0.742908 0.0535657 -0.667899 -0.998581 -0.742576 -0.0484975 0.675006 0.999233 0.729932 0.0253115 -0.69524 -0.999976 -0.704237 0.0161369 0.727576 0.999041 0.66396 -0.0759487 -0.770257 -0.993641 -0.607066 0.153727 0.820451 0.97997 0.531296 -0.248636 -0.874193 -0.953336 -0.434263 0.358706 0.926153 0.908254 0.314103 -0.480557 -0.969502 -0.83888 -0.170051 0.608857 0.996001 0.73953 0.00327029 -0.735897 -0.996159 -0.605567 0.182358 0.851305 0.959967 0.434443 -0.379508 -0.942211 -0.877852 -0.227016 0.576545 0.993782 0.742253 -0.0107422 -0.757275 -0.990501 -0.549714 0.266759 0.901533 0.918314 0.303179 -0.521807 -0.986635 -0.767526 -0.0143158 0.749709 0.990218 0.536624 -0.294785 -0.919251 -0.894475 -0.235633 0.591402 0.997815 0.691628 -0.110424 -0.834002 -0.957532 -0.389552 0.461168 0.977875 0.78307 0.0162852 -0.76319 -0.983258 -0.479837 0.378243 0.957309 0.826643 0.0808161 -0.72607 -0.990689 -0.512566 0.351495 0.951412 0.832631 0.0825016 -0.731099 -0.988327 -0.490533 0.383637 0.96396 0.802234 0.0206866 -0.777735 -0.972927 -0.410741 0.472673 0.98698 0.727085 -0.105294 -0.855434 -0.929466 -0.266192 0.609545 0.999941 0.591039 -0.29222 -0.941388 -0.832325 -0.0503463 0.773178 0.969246 0.375742 -0.525272 -0.99695 -0.650226 0.232299 0.923906 0.85128 0.0718853 -0.76806 -0.967873 -0.358003 0.552846 0.999495 0.603577 -0.303167 -0.953731 -0.794011 0.0427514 0.843793 0.922454 0.208553 -0.685683 -0.988493 -0.435419 0.496311 0.996786 0.627501 -0.291429 -0.955451 -0.779333 0.084569 0.874472 0.889463 0.11344 -0.764498 -0.95973 -0.294836 0.635669 0.994212 0.454781 -0.497145 -0.998399 -0.590833 0.356588 0.978443 0.702694 -0.220045 -0.940569 -0.791539 0.0919179 0.890673 0.85956 0.024701 -0.834082 -0.909671 -0.128041 0.775288 0.944954 0.217215 -0.718051 -0.968509 -0.292026 0.665385 0.983286 0.352669 -0.61972 -0.991844 -0.399705 0.582669 0.996309 0.43376 -0.555578 -0.99835 -0.455238 0.539241 0.999099 0.464606 -0.53415 -0.999163 -0.461893 0.540541 0.998595 0.447098 -0.558244 -0.996903 -0.41981 0.586871 0.99302 0.379411 -0.625508 -0.985338 -0.32532 0.672934 0.971713 0.256836 -0.727321 -0.949456 -0.173348 0.786158 0.915457 0.0746623 -0.846141 -0.86636 0.0387317 0.903075 0.798618 -0.165548 -0.951848 -0.708917 0.303198 0.986393 0.594601 -0.447474 -0.99999 -0.454094 0.592513 0.985511 0.287541 -0.730212 -0.935976 -0.097403 0.850858 0.845381 -0.110781 -0.942803 -0.70974 0.327862 0.993734 0.528127 -0.540976 -0.991505 -0.304231 0.733694 0.925869 0.0471416 -0.886903 -0.790442 0.227512 0.980349 0.585115 -0.497725 -0.995219 -0.31806 0.736078 0.917475 0.00745057 -0.912148 -0.741636 0.31811 0.996295 0.474425 -0.620983 -0.965052 -0.137601 0.857953 0.807145 -0.231256 -0.986747 -0.529287 0.581064 0.973966 0.160267 -0.853069 -0.804708 0.248465 0.99133 0.490682 -0.627605 -0.955102 -0.0751097 0.900689 0.732507 -0.369076 -0.99996 -0.350801 0.749147 0.885658 -0.120415 -0.971409 -0.56327 0.57739 0.966295 0.092946 -0.902714 -0.713633 0.415039 0.996676 0.260022 -0.821969 -0.8117 0.280629 0.998589 0.379154 -0.749915 -0.869936 0.184226 0.989738 0.45314 -0.700032 -0.899486 0.130304 0.982189 0.485459 -0.680036 -0.907482 0.120755 0.982077 0.478063 -0.692787 -0.896002 0.156072 0.989526 0.430094 -0.736777 -0.861655 0.235788 0.998521 0.338168 -0.805865 -0.795918 0.357177 0.996636 0.197945 -0.887578 -0.686249 0.513041 0.965128 0.00710446 -0.961814 -0.518886 0.688121 0.880266 -0.229675 -0.99958 -0.28394 0.855203 0.71734 -0.49484 -0.964732 0.016926 0.973537 0.458322 -0.751928 -0.820092 0.36102 0.991381 0.104438 -0.943189 -0.540362 0.695882 0.857029 -0.309764 -0.995911 -0.131623 0.938484 0.540648 -0.705309 -0.842903 0.347944 0.989577 0.0643084 -0.963435 -0.458359 0.778109 0.770822 -0.472067 -0.956931 0.0993282 0.995621 0.280943 -0.889786 -0.613945 0.662814 0.856983 -0.352519 -0.983652 0.00394682 0.985378 0.337606 -0.870041 -0.63239 0.658672 0.850418 -0.381054 -0.973682 0.0708177 0.996296 0.238677 -0.923422 -0.518219 0.768971 0.744877 -0.552812 -0.903427 0.297889 0.986593 -0.0274611 -0.994288 -0.236974 0.932488 0.477482 -0.811618 -0.680145 0.6449 0.835935 -0.446786 -0.940223 0.231743 0.992523 -0.0129302 -0.995551 -0.198263 0.954544 0.392747 -0.876387 -0.564003 0.768766 0.70778 -0.639661 -0.822009 0.496663 0.906545 -0.346641 -0.96262 0.195502 0.992648 -0.0480785 -0.999737 -0.0917794 0.987437 0.221398 -0.959487 -0.339062 0.919488 0.44388 -0.870966 -0.535534 0.81709 0.61445 -0.76057 -0.681235 0.703866 0.736781 -0.648985 -0.78238 0.597664 0.819047 -0.551122 -0.847951 0.510481 0.870234 -0.476518 -0.886726 0.449915 0.898281 -0.430964 -0.905448 0.419925 0.908681 -0.41705 -0.908116 0.422487 0.903667 -0.435946 -0.895127 0.457468 0.882025 -0.486744 -0.863624 0.523306 0.838981 -0.566496 -0.807186 0.615426 0.766936 -0.669014 -0.716979 0.725743 0.656153 -0.783639 -0.583117 0.840545 0.496997 -0.893678 -0.397058 0.939764 0.283158 -0.97524 -0.155823 0.996154 0.0165585 -0.998373 0.132473 0.977772 -0.287684 -0.930573 0.444194 0.853544 -0.5958 -0.744644 0.73507 0.603379 -0.853571 -0.431196 0.942354 0.232125 -0.992212 -0.0130608 0.994884 -0.216184 -0.943775 0.442616 0.835134 -0.650991 -0.66919 0.824337 0.451187 -0.945438 -0.192104 0.998639 -0.0913658 -0.971931 0.376426 0.859277 -0.636837 -0.662685 0.844082 0.394067 -0.970957 -0.0756261 0.995712 -0.260504 -0.906021 0.575257 0.702858 -0.826185 -0.403207 0.973899 0.0403645 -0.988671 0.337516 0.857478 -0.673594 -0.589498 0.910338 0.218614 -0.999935 0.198694 0.915511 -0.58961 -0.660119 0.877921 0.271473 -0.998849 0.180511 0.915644 -0.603842 -0.632809 0.90248 0.201358 -0.999107 0.286012 0.857549 -0.712634 -0.498555 0.96542 0.00287943 -0.966248 0.502658 0.699946 -0.875679 -0.227884 0.998903 -0.3205 -0.820652 0.778904 0.380671 -0.994956 0.191069 0.883429 -0.707367 -0.46554 0.983705 -0.125055 -0.907145 0.678615 0.488688 -0.981325 0.125808 0.901083 -0.698811 -0.452152 0.990426 -0.193544 -0.862322 0.76422 0.351721 -0.999887 0.325941 0.776322 -0.859622 -0.17981 0.984312 -0.512705 -0.620055 0.954675 -0.0669863 -0.90513 0.727035 0.370096 -0.999999 0.375272 0.717266 -0.916741 -0.0192215 0.930393 -0.698127 -0.38734 0.999986 -0.399732 -0.68228 0.943004 -0.0752332 -0.881132 0.791242 0.232705 -0.981806 0.580943 0.496242 -0.996416 0.34554 0.701621 -0.944598 0.11139 0.846871 -0.848228 -0.103143 0.93784 -0.727821 -0.287896 0.984809 -0.600313 -0.439002 0.999782 -0.478666 -0.556638 0.994366 -0.371839 -0.643981 0.978725 -0.285429 -0.704923 0.960957 -0.222768 -0.743444 0.946941 -0.185624 -0.762467 0.940365 -0.174955 -0.763639 0.942797 -0.190934 -0.747071 0.95368 -0.233415 -0.711067 0.970435 -0.301635 -0.652623 0.988067 -0.393735 -0.567611 0.999276 -0.506125 -0.451505 0.994347 -0.632106 -0.300857 0.961464 -0.761537 -0.114526 0.887636 -0.879614 0.103803 0.760538 -0.966856 0.343681 0.571043 -0.999972 0.585808 0.317729 -0.954914 0.801238 0.0103274 -0.811646 0.952521 -0.325219 -0.56113 0.998694 -0.645271 -0.214416 0.904579 -0.891298 0.191187 0.653563 -0.999082 0.588957 0.262026 -0.915535 0.889484 -0.209529 -0.621753 0.999776 -0.656735 -0.155073 0.854564 -0.94939 0.379145 0.453109 -0.970205 0.820901 -0.113507 -0.668497 0.999992 -0.664943 -0.10842 0.808304 -0.980081 0.51827 0.274237 -0.889954 0.941925 -0.403722 -0.383641 0.931907 -0.908363 0.333531 0.44022 -0.948452 0.893061 -0.312995 -0.447525 0.946727 -0.901478 0.343803 0.405663 -0.925773 0.930788 -0.424264 -0.311572 0.876502 -0.969916 0.548144 0.160363 -0.782683 0.998045 -0.701454 0.0500068 0.624087 -0.984485 0.857375 -0.31139 -0.383348 0.89113 -0.973202 0.596645 0.0565692 -0.680977 0.991202 -0.851125 0.329949 0.335338 -0.850408 0.993138 -0.707434 0.121507 0.51313 -0.93051 0.961486 -0.599268 -0.00364501 0.602266 -0.95954 0.939395 -0.555456 -0.0392438 0.616176 -0.959393 0.945566 -0.585657 0.0155907 0.557063 -0.929753 0.975446 -0.684042 0.1608 0.413912 -0.847475 0.999775 -0.826332 0.388576 0.169781 -0.671802 0.963292 -0.959155 0.666182 -0.177001 -0.361071 0.791408 -0.993086 0.913664 -0.580829 0.0909432 0.420344 -0.816346 0.995173 -0.914967 0.601734 -0.139123 -0.354833 0.758665 -0.976995 0.962175 -0.722785 0.318889 0.154187 -0.589453 0.892192 -1 0.894607 -0.603079 0.189785 0.258473 -0.651864 0.914687 -0.999694 0.895339 -0.625752 0.244404 0.177435 -0.564341 0.85059 -0.990199 0.963927 -0.78068 0.474176 -0.0960618 -0.293207 0.634579 -0.878847 0.993348 -0.965741 0.804164 -0.534809 0.196906 0.162998 -0.498399 0.7681 -0.941089 1 -0.941747 0.777012 -0.527733 0.224183 0.0995271 -0.409094 0.673697 -0.868869 0.978379 -0.995291 0.921608 -0.767525 0.549399 -0.288434 0.00756567 0.270037 -0.52282 0.733088 -0.887272 0.977002 -0.998971 0.954904 -0.850741 0.69576 -0.501935 0.282444 -0.0510985 -0.1791 0.395848 -0.588951 0.750129 -0.873626 0.955891 -0.995753 0.994016 -0.953257 0.877493 -0.771869 0.642085 -0.493892 0.333999 -0.167638 0.000961432 0.161888 -0.316019 0.458717 -0.586663 0.698403 -0.792563 0.868757 -0.926775 0.967431 -0.991377 0.999939 -0.994529 0.976717 -0.948166 0.910562 -0.865557 0.814596 -0.759433 0.701144 -0.641493 0.580866 -0.520793 0.461922 -0.404963 0.350504 -0.299261 0.25116 -0.20697 0.166448 -0.130485 0.0984809 -0.0712456 0.0481029 -0.0295714 0.0151798 -0.00566775 0.000549731 -7.03592e-05; #X coords 0 1 3999 -1 200 50 1; #X restore 326 228 graph; #X text 43 34 [mtx_logsweep]; #X obj 33 306 s view_sweep; #X obj 33 165 mtx_logsweep; #X msg 33 143 0.01 3.14159 4000; #X text 166 69 creates an n sample logarithmic sweep starting and stopping specified (digital) frequencies - note that "0" does _not_ work \, since log(0)=-inf.; #X text 268 138 list inlet: [omega_start omega_stop n_samples(; #X text 268 157 outletA: vector containing sweep; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION create a logarithmic sweep matrix using start stop and numsteps, f 81; #X restore 584 358 pd META; #X obj 439 358 declare -lib iemmatrix; #X connect 1 0 4 0; #X connect 5 0 1 0; #X connect 6 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_logsweep.pd000066400000000000000000000032741514557770000250370ustar00rootroot00000000000000#N canvas 724 186 552 538 10; #X declare -lib iemmatrix; #X obj 94 57 inlet; #X obj 143 57 inlet; #X obj 190 57 inlet; #X obj 231 56 loadbang; #X obj 94 228 mtx_cumsum; #X text 187 209 instantaneous frequency; #X text 188 229 time dependent phase-angle argument; #X text 191 316 sweeped cos-oscillation; #N canvas 0 0 661 488 smooth_switches 0; #X obj 165 30 inlet; #X obj 165 368 outlet; #X obj 248 275 mtx_linspace; #X obj 248 254 pack f f f; #X obj 317 101 mtx_size; #X obj 283 123 t f f; #X obj 283 175 mtx; #X obj 235 174 mtx; #X obj 272 79 t b a a a; #X obj 165 50 t a a; #X obj 165 301 mtx_-; #X msg 283 150 element 1 \$1; #X msg 235 101 element 1 1; #X obj 283 213 expr -int($f1/3.14159265)*3.14159265+$f1; #X text 397 192 modulo pi; #X connect 0 0 9 0; #X connect 2 0 10 1; #X connect 3 0 2 0; #X connect 4 1 5 0; #X connect 5 0 11 0; #X connect 5 1 3 2; #X connect 6 0 13 0; #X connect 7 0 3 0; #X connect 8 0 12 0; #X connect 8 1 4 0; #X connect 8 2 7 1; #X connect 8 3 6 1; #X connect 9 0 10 0; #X connect 9 1 8 0; #X connect 10 0 1 0; #X connect 11 0 6 0; #X connect 12 0 7 0; #X connect 13 0 3 1; #X restore 94 284 pd smooth_switches (on and off zero-phase); #X text 189 261 force zero-crossing at start and end; #X obj 94 441 outlet; #X text 103 422 sweep vector; #X text 185 396 forming matrix with blocksize columns for playback; #X text 102 38 wstart; #X text 147 36 wstop; #X text 195 35 len; #X obj 94 117 pack \$1 \$2 \$3; #X obj 94 315 mtx_sin; #X obj 94 208 mtx_logspace; #X obj 235 506 declare -lib iemmatrix; #X connect 0 0 16 0; #X connect 1 0 16 1; #X connect 2 0 16 2; #X connect 3 0 16 0; #X connect 4 0 8 0; #X connect 8 0 17 0; #X connect 16 0 18 0; #X connect 17 0 10 0; #X connect 18 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_matcher-help.pd000066400000000000000000000032531514557770000255600ustar00rootroot00000000000000#N canvas 272 187 518 434 10; #X declare -lib iemmatrix; #X obj 201 210 mtx_matcher, f 13; #X obj 276 133 loadbang; #X msg 174 136 bang; #X obj 228 267 mtx_print matched; #X obj 276 241 mtx_print permutator; #X obj 174 302 mtx_-; #X obj 174 324 mtx_.^ 2; #X floatatom 174 387 0 0 0 3 error_unmatched - - 0; #X obj 174 180 t a a; #X obj 276 181 t a a a; #X obj 282 302 mtx_-, f 6; #X obj 282 324 mtx_.^ 2; #X floatatom 282 387 0 0 0 3 error_matched - - 0; #X obj 201 243 t a a; #X obj 174 347 mtx_sum; #X obj 174 367 mtx_sum; #X obj 282 347 mtx_sum; #X obj 282 367 mtx_sum; #X msg 87 134 bang; #X obj 87 155 mtx_rand 5; #X obj 174 157 mtx_eye 5; #X obj 276 157 mtx_egg 5; #X text 68 9 mtx_matcher:: match 2 sets of vectors; #X text 22 45 mtx_matcher tries to match 2 sets of vectors. The vector-sets are expressed as matrices; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION match two sets of vectors (in a matrix), f 81; #X restore 454 8 pd META; #X obj 309 8 declare -lib iemmatrix; #X connect 0 0 13 0; #X connect 0 1 4 0; #X connect 1 0 21 0; #X connect 2 0 20 0; #X connect 5 0 6 0; #X connect 6 0 14 0; #X connect 8 0 5 0; #X connect 8 1 0 0; #X connect 9 0 0 1; #X connect 9 1 5 1; #X connect 9 2 10 1; #X connect 10 0 11 0; #X connect 11 0 16 0; #X connect 13 0 10 0; #X connect 13 1 3 0; #X connect 14 0 15 0; #X connect 15 0 7 0; #X connect 16 0 17 0; #X connect 17 0 12 0; #X connect 18 0 19 0; #X connect 19 0 8 0; #X connect 20 0 8 0; #X connect 21 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_matcher.pd000066400000000000000000000036251514557770000246350ustar00rootroot00000000000000#N canvas 411 75 588 453 10; #X declare -lib iemmatrix; #X obj 61 190 mtx_distance2; #X obj 61 166 t a a; #X obj 61 234 t a a; #X obj 61 269 mtx_*; #X obj 61 315 outlet matched; #X obj 171 315 outlet matcher; #X obj 147 167 inlet dest; #X obj 61 139 inlet source; #X text 235 131 both "source" and "dest" must have the same number of columns (dimension in feature-space); #N canvas 0 0 618 479 mtx_rowpermutate 0; #X obj 150 214 t b a; #X obj 150 235 mtx; #X obj 150 256 mtx_*; #X obj 111 192 mtx_pivot -1; #X text 17 19 this unfortunately does not guarantee to give as a minimum trace of the result!; #X obj 150 309 outlet rowpermutator; #X obj 111 141 inlet permutans; #X connect 0 0 1 0; #X connect 0 1 2 1; #X connect 1 0 2 0; #X connect 2 0 5 0; #X connect 3 1 0 0; #X connect 3 2 1 1; #X connect 6 0 3 0; #X restore 61 211 pd mtx_rowpermutate; #X text 220 224 this algorithm is _far_ from being perfect! the [mtx_rowpermutate] does not really guarantee that the trace of the result is a global minimum \; if it is not \, than the match will be sub-optimal! this will be even worse \, if there are several _equal_ (sub)minima in the distance-matrix.; #X text 158 184 greater distances have an extra penalty (^2) \; is this ok?; #X text 120 346 (c) 2005 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X text 120 363 for license-details see LICENSE.txt that should come with iemmatrix.; #X text 57 12 mtx_matcher:: match 2 sets of vectors; #X text 46 42 2 vectors are matching if their euclidean distance is a minimum. each "source" vector is assigned to a "dest" vector in order to get a maximum matching. the output is a permutation "matched" of the "source" vector-field \, and a permutation matrix "matcher".; #X obj 265 386 declare -lib iemmatrix; #X connect 0 0 9 0; #X connect 1 0 0 0; #X connect 1 1 3 1; #X connect 2 0 3 0; #X connect 2 1 5 0; #X connect 3 0 4 0; #X connect 6 0 0 1; #X connect 7 0 1 0; #X connect 9 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_max.pd000066400000000000000000000004021514557770000237650ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 164 115 inlet; #X obj 164 169 mtx_minmax \$1; #X obj 250 233 outlet; #X text 122 82 get the maxim[um \, a] of a matrix; #X obj 65 256 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 1 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_meshgrid-help.pd000066400000000000000000000020771514557770000257420ustar00rootroot00000000000000#N canvas 439 163 634 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X obj 65 227 mtx_print x; #X obj 150 227 mtx_print y; #X obj 28 207 t a a; #X msg 28 186 matrix 1 3 -1 -2 -3; #X msg 150 207 matrix 1 3 0.1 0.2 0.3; #X obj 28 287 mtx_print X; #X obj 112 287 mtx_print Y; #X obj 28 260 mtx_meshgrid; #X text 43 34 [mtx_meshgrid]; #X text 166 69 creates an [X \, Y] grid on the ticks given by the x and y vector; #X text 268 138 inlet1 \, 2: row vectors x \, y; #X text 268 157 outlet: matrices X \, Y containing all (x \, y) value-pairs; #N canvas 75 584 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION create a X/Y grid matrix, f 81; #X restore 544 278 pd META; #X obj 399 278 declare -lib iemmatrix; #X connect 3 0 8 0; #X connect 3 1 1 0; #X connect 4 0 3 0; #X connect 5 0 2 0; #X connect 5 0 8 1; #X connect 8 0 6 0; #X connect 8 1 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_meshgrid.pd000066400000000000000000000015461514557770000250140ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 80 229 mtx_repmat; #X obj 173 232 mtx_repmat; #X msg 272 212 1 \$1; #X msg 137 208 \$1 1; #X obj 128 120 mtx_size; #X obj 233 121 mtx_size; #X obj 173 168 mtx, f 6; #X obj 80 98 t a a; #X obj 173 147 t b f, f 17; #X obj 80 259 outlet X; #X obj 173 258 outlet Y; #X obj 206 69 mtx_:; #X obj 80 69 mtx_:; #X obj 80 42 inlet x; #X obj 206 42 inlet y; #X obj 173 188 mtx_transpose; #X obj 206 92 t a a; #X obj 255 256 declare -lib iemmatrix; #X connect 0 0 9 0; #X connect 1 0 10 0; #X connect 2 0 1 1; #X connect 3 0 0 1; #X connect 4 1 8 0; #X connect 5 1 3 0; #X connect 6 0 15 0; #X connect 7 0 0 0; #X connect 7 1 4 0; #X connect 8 0 6 0; #X connect 8 1 2 0; #X connect 11 0 16 0; #X connect 12 0 7 0; #X connect 13 0 12 0; #X connect 14 0 11 0; #X connect 15 0 1 0; #X connect 16 0 6 1; #X connect 16 1 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_min.pd000066400000000000000000000004031514557770000237640ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 164 115 inlet; #X obj 164 169 mtx_minmax \$1; #X obj 164 233 outlet; #X text 122 82 get the minim[um \, a] of a matrix; #X obj 265 233 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_mod.pd000066400000000000000000000007441514557770000237700ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 162 18 inlet; #X obj 162 217 outlet; #X obj 240 18 inlet; #X obj 162 69 mtx_./ \$1; #X obj 162 93 t a a; #X obj 200 115 mtx_int; #X obj 162 141 mtx_-; #X obj 162 164 mtx_* \$1; #X text 48 9 matrix modulo; #X obj 235 216 declare -lib iemmatrix; #X connect 0 0 3 0; #X connect 2 0 3 1; #X connect 2 0 7 1; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 6 1; #X connect 6 0 7 0; #X connect 7 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_phon_curve-help.pd000066400000000000000000000043741514557770000263120ustar00rootroot00000000000000#N canvas 263 0 849 390 10; #X declare -lib iemmatrix; #N canvas 0 0 450 300 (subpatch) 0; #X array phon_curve 31 float 1; #A 0 91.9955 79.14 68.4519 59.5683 52.1864 46.0531 40.9579 36.7252 33.2091 30.2881 27.861 25.8434 24.1648 22.7658 21.5949 20.6057 19.7503 18.9676 18.1564 17.1207 15.5152 13.0798 10.9486 12.4363 16.429 18.3084 20.63 26.6031 41.7807 80.0491 176.294; #X coords 0 120 30 0 200 140 1; #X restore 36 187 graph; #N canvas 0 0 450 300 mtx2tablemsg 0; #X obj 155 57 inlet; #X obj 220 253 outlet; #X obj 157 79 list split 3; #X obj 198 98 t l l; #X obj 232 141 change; #X msg 235 164 resize \$1; #X obj 198 218 list prepend 0; #X obj 230 119 list length; #X connect 0 0 2 0; #X connect 2 1 3 0; #X connect 3 0 6 0; #X connect 3 1 7 0; #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 7 0 4 0; #X restore 247 230 pd mtx2tablemsg; #X obj 365 208 loadbang; #X obj 247 125 mtx_logspace; #X text 30 331 20; #X text 70 331 80; #X text 105 331 340; #X msg 247 103 20 20000 31; #X text 144 331 1360; #X text 186 331 5440; #X text 226 331 21760; #X msg 365 228 bounds 0 120 30 0 \, xticks 0 1 3 \, yticks 0 20 1 \, ylabel 0 0 20 40 60 80 100 120; #X floatatom 246 48 5 0 0 0 - - - 0; #X obj 247 66 t b f f; #X text 290 47 dial Phon-curve; #X obj 247 275 s phon_curve; #X text 482 26 part of iemmatrix; #X text 469 113 inletA: row/col frequency vector; #X text 469 131 inletB: phon value; #X text 391 263 note: the "0" phon curve corresponds to the absolute threshold of hearing; #X text 44 32 [mtx_phon_curve]; #X text 480 345 Franz Zotter \, 2007; #X obj 247 145 mtx_phon_curve 0; #X text 470 155 outletA: row/col vector with phone curve at specified frequencies in dB; #N canvas 477 377 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 105 AUTHOR Franz Zotter; #X text 11 44 DESCRIPTION calculate the phone curve matrix at the given frequencies, f 81; #X restore 584 368 pd META; #X obj 439 368 declare -lib iemmatrix; #X connect 1 0 15 0; #X connect 2 0 11 0; #X connect 3 0 22 0; #X connect 7 0 3 0; #X connect 11 0 15 0; #X connect 12 0 13 0; #X connect 13 0 7 0; #X connect 13 1 22 1; #X connect 22 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_phon_curve.pd000066400000000000000000000041411514557770000253540ustar00rootroot00000000000000#N canvas 537 0 739 692 10; #X declare -lib iemmatrix; #X obj 78 35 inlet; #X obj 422 345 mtx_exp; #X obj 422 281 mtx_- 3.3; #X obj 78 553 mtx_+; #X obj 78 646 outlet; #X obj 296 284 mtx_.^ -0.8; #X obj 504 281 mtx_.^ 4; #X obj 296 390 mtx_* 3.64; #X obj 422 301 mtx_.^ 2; #X obj 422 321 mtx_* -0.6; #X obj 422 375 mtx_* -6.5; #X obj 422 402 mtx_+; #X text 94 53 freq; #X obj 78 104 mtx_* 0.001; #X obj 504 311 mtx_* 0.001; #X obj 78 133 t a a a a; #X obj 78 518 mtx_+; #X obj 78 448 mtx_* 0; #X obj 168 447 mtx_* 1; #X obj 180 355 / 100; #X obj 182 37 inlet; #X text 189 59 phon; #X obj 207 410 expr 1-$f1; #X obj 78 290 mtx_.^ -0.9; #X obj 78 388 mtx_* 1.183; #X obj 232 63 loadbang; #X obj 78 76 mtx_max2 0.1; #X text 344 135 3.64*f^(-.8) - 6.5* exp(-.6*(f-3.3)^2)+10^(-3)*f^4; #X text 343 101 0 phon curve; #X text 343 118 absolute threshold of hearing; #X text 178 321 fade between; #X text 558 252 high freq. skirt; #X text 404 253 ear channel dip; #X text 277 250 low freq. skirt; #X text 307 266 0 phon; #X text 57 249 low freq. skirt; #X text 87 265 100 phon; #X obj 78 584 mtx_+ 0; #X obj 180 376 t f f; #X text 321 85 3 rightmost paths:; #X text 321 169 1 leftmost path: lower skirt of 100 phon curve; #X text 246 30 calculates the contours of equal loudness for an arbitrary frequency vector/matrix in dB; #X text 362 567 Franz Zotter \, 2007; #X obj 395 636 declare -lib iemmatrix; #X obj 182 113 t a a; #X obj 182 90 f \$1; #X connect 0 0 26 0; #X connect 1 0 10 0; #X connect 2 0 8 0; #X connect 3 0 37 0; #X connect 5 0 7 0; #X connect 6 0 14 0; #X connect 7 0 18 0; #X connect 8 0 9 0; #X connect 9 0 1 0; #X connect 10 0 11 0; #X connect 11 0 3 1; #X connect 13 0 15 0; #X connect 14 0 11 1; #X connect 15 0 23 0; #X connect 15 1 5 0; #X connect 15 2 2 0; #X connect 15 3 6 0; #X connect 16 0 3 0; #X connect 17 0 16 0; #X connect 18 0 16 1; #X connect 19 0 38 0; #X connect 20 0 45 0; #X connect 22 0 18 1; #X connect 23 0 24 0; #X connect 24 0 17 0; #X connect 25 0 45 0; #X connect 26 0 13 0; #X connect 37 0 4 0; #X connect 38 0 17 1; #X connect 38 1 22 0; #X connect 44 0 37 1; #X connect 44 1 19 0; #X connect 45 0 44 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_pinverse-help.pd000066400000000000000000000040411514557770000257640ustar00rootroot00000000000000#N canvas 366 49 705 646 10; #X declare -lib iemmatrix; #X text 347 472 updated for; #X obj 435 472 iemmatrix 0.2; #X obj 484 498 matrix; #X text 354 497 see also help for; #X text 243 142 singular; #X text 245 107 regular; #X text 246 158 regular; #X text 247 168 but badly conditioned; #X text 154 533 A*inv(A)=inv(A)*A=I; #X text 248 221 pseudoinverse: P1=inv(A'*A)*A'; #X text 247 269 pseudoinverse: P2=A'*inv(A*A'); #X text 245 553 P1*A=I; #X text 245 573 A*P2=I; #X obj 92 199 mtx 3; #X msg 112 164 1 2 3 2 4 4 3 4 5; #X msg 92 108 1 2 4 2 3 4 3 4 5; #X obj 92 472 mtx_print inverse; #X obj 92 300 t a a; #X obj 134 300 mtx_print original; #X obj 153 219 mtx_rand 4 3; #X msg 153 198 bang; #X msg 153 248 bang; #X obj 153 269 mtx_rand 3 4; #X obj 182 348 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 199 359 instability detected!; #X obj 92 348 mtx_pinverse; #X text 45 16 mtx_pinverse:: get the inverse of a matrix (with pivoting); #X text 44 49 mtx_pinverse calculates the inverse of a square-matrix. For inverting rectangle matrices \, use [mtx_inverse] or [mtx_pseudoinverse]; #X msg 103 140 1 2 3 2 3 4 0 0 0; #X text 194 385 due to pivoting \, [mtx_pinverse] will handle badly conditioned matrices better than [mtx_inverse] \, however it will also detect less (real) instabilities than [mtx_inverse]; #X obj 485 524 mtx_inverse; #X obj 485 548 mtx_pseudoinverse; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION calculate the inverse of a matrix (with pivoting), f 81; #X restore 584 618 pd META; #X obj 439 618 declare -lib iemmatrix; #X connect 13 0 17 0; #X connect 14 0 13 0; #X connect 15 0 13 0; #X connect 17 0 25 0; #X connect 17 1 18 0; #X connect 19 0 17 0; #X connect 20 0 19 0; #X connect 21 0 22 0; #X connect 22 0 17 0; #X connect 25 0 16 0; #X connect 25 1 23 0; #X connect 28 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_pinverse.pd000066400000000000000000000016241514557770000250420ustar00rootroot00000000000000#N canvas 0 0 630 350 10; #X declare -lib iemmatrix; #X obj 44 102 inlet; #X obj 44 132 mtx_pivot; #X obj 44 154 mtx_inverse; #X obj 74 200 mtx_*; #X obj 44 221 mtx_*; #X obj 44 198 mtx; #X obj 44 176 t b a; #X obj 44 264 outlet; #X obj 116 264 outlet; #X text 109 22 matrix inversion with pivoting; #X text 107 56 pivoting makes the inversion of badly conditioned matrices more stable.; #X text 158 105 it also stabilizes the inversion of singular matrices (not so good) and is more expensive; #X text 188 202 for license-details see LICENSE.txt that should come with iemmatrix.; #X text 188 181 (c) 2006 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X obj 285 256 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 1 1 3 1; #X connect 1 2 5 1; #X connect 2 0 6 0; #X connect 2 1 8 0; #X connect 3 0 4 1; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 6 1 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_plot-help.pd000066400000000000000000000076151514557770000251210ustar00rootroot00000000000000#N struct mtx_vis-plot float x float y array mtx_vis-array mtx_vis-element 1; #N struct mtx_vis-element float x float y float c float dx float dy; #N canvas 128 118 666 696 10; #X declare -lib iemmatrix; #X obj 475 599 matrix; #X text 345 598 see also help for; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X text 12 44 DESCRIPTION plot a matrix; #X restore 481 16 pd META; #X obj 82 234 mtx_plot; #X obj 101 100 mtx_rand; #X obj 48 564 mtx_plot 200 50; #X obj 101 33 loadbang; #X msg 101 73 10; #X text 136 10 plot a matrix; #X text 214 56 [mtx_plot] will display the values of a matrix \, clipped between 0 (black) and 1 (white); #X obj 475 619 mtx_print; #X msg 48 74 5; #X text 186 497 you can give the size of the matrix plot \, either as a single value (for square plots) or as a pair (for rectangle plots).; #X text 273 255 [mtx_plot] is rather slow \, so don't display too big matrices!, f 62; #X obj 169 129 mtx_diag; #X msg 169 106 2 1 0.5 0 -0.5 -1; #X obj 48 100 mtx_egg; #N canvas 0 0 879 403 colormaps 0; #X obj 283 307 array set \$0.colormap; #X obj 264 17 inlet; #X obj 264 40 symbol; #X obj 449 307 list length; #X obj 449 330 array size \$0.colormap; #X obj 264 280 t b l l; #X obj 264 353 outlet; #X obj 264 63 t b s; #X msg 264 100 gnuplot2 0 1 2 4 5 7 8 9 109 309 409 508 617 717 826 935 935 944 953 962 962 971 980 990 999 \, magma 0 0 1 2 103 203 204 304 314 414 414 514 614 624 723 723 833 833 843 843 853 864 864 875 886 \, grey 0 111 222 333 444 555 666 777 888 999 \, rainbow 409 308 318 228 238 148 58 58 68 78 177 287 287 387 386 486 586 585 685 684 774 874 863 953 952 942 931 921 910 900 \, gist_ncar 4 12 21 21 14 7 19 39 69 79 89 88 86 85 84 82 80 180 270 370 480 480 590 591 691 791 890 980 980 970 970 960 950 940 920 910 910 900 903 906 809 709 518 628 738 848 858 868 878 878, f 93; #X text 441 35 colormaps are tables that map input values [0 \, 1] to Pd's data-structure colors (000..999), f 48; #X obj 264 259 route unknown; #X obj 135 18 loadbang; #X msg 135 41 gnuplot2; #X text 389 198 the values (and names) found here \, are taken from matplotlib; #X connect 1 0 2 0; #X connect 2 0 7 0; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 5 1 0 0; #X connect 5 2 3 0; #X connect 7 0 8 0; #X connect 7 1 10 1; #X connect 8 0 10 0; #X connect 10 0 5 0; #X connect 11 0 12 0; #X connect 12 0 2 0; #X restore 302 373 pd colormaps; #X msg 302 447 colormap \$1; #X obj 302 426 symbol \$0.colormap; #X msg 307 106 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14; #X obj 307 129 mtx_diegg; #X obj 307 152 mtx_./ 14; #X obj 453 426 array define \$0.colormap; #X msg 302 309 gnuplot2; #X obj 302 400 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X msg 319 329 grey; #X obj 65 418 mtx_plot 100; #X msg 371 309 magma; #X msg 371 331 rainbow; #X msg 371 353 gist_ncar; #X text 457 329 colorise the plot by encoding value->colors in a table, f 30; #X text 457 366 (the coloring takes effect when the next data arrives), f 31; #X msg 137 73 5 20; #X obj 141 203 mtx_print; #X obj 48 181 t a a a a; #X obj 99 203 spigot; #X obj 132 182 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 60 660 NOTE: [mtx_plot] requires Pd>=0.56; #X connect 4 0 35 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 11 0 16 0; #X connect 14 0 35 0; #X connect 15 0 14 0; #X connect 16 0 35 0; #X connect 17 0 25 0; #X connect 18 0 27 0; #X connect 19 0 18 0; #X connect 20 0 21 0; #X connect 21 0 22 0; #X connect 22 0 35 0; #X connect 24 0 17 0; #X connect 25 0 19 0; #X connect 26 0 17 0; #X connect 28 0 17 0; #X connect 29 0 17 0; #X connect 30 0 17 0; #X connect 33 0 4 0; #X connect 35 0 5 0; #X connect 35 1 27 0; #X connect 35 2 3 0; #X connect 35 3 36 0; #X connect 36 0 34 0; #X connect 37 0 36 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_plot.pd000066400000000000000000000211041514557770000241600ustar00rootroot00000000000000#N canvas 2654 698 450 300 12; #X declare -lib iemmatrix; #N struct mtx_vis-plot float x float y array mtx_vis-array mtx_vis-element; #N struct mtx_vis-element float x float y float c float dx float dy; #X obj 48 33 inlet; #N canvas 2021 240 750 300 guts 0; #X obj 37 37 inlet; #N canvas 2710 219 598 399 create-array-if-lost 0; #X obj 327 183 pointer; #X msg 169 170 0 0; #X obj 169 23 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 307 110 \; \$1 clear; #X msg 327 159 traverse \$1 \, bang; #X obj 169 112 t b s s; #X obj 169 66 symbol pd-\$0-show; #X obj 169 209 append mtx_vis-plot x y; #X obj 208 29 inlet; #X connect 0 0 7 2; #X connect 1 0 7 0; #X connect 2 0 6 0; #X connect 4 0 0 0; #X connect 5 0 1 0; #X connect 5 1 4 0; #X connect 5 2 3 0; #X connect 6 0 5 0; #X connect 8 0 6 0; #X restore 353 113 pd create-array-if-lost; #N canvas 2046 499 470 116 mtx_vis-plot 0; #X obj 29 33 struct mtx_vis-plot float x float y array mtx_vis-array mtx_vis-element; #X obj 29 71 plot -e x -e y mtx_vis-array 0 0 0 0 0; #X restore 121 15 pd mtx_vis-plot; #N canvas 2077 71 450 111 mtx_vis-element 0; #X obj 18 34 struct mtx_vis-element float x float y float c float dx float dy; #X obj 18 80 filledpolygon -x c c 0 0 0 dx 0 dx dy 0 dy; #X restore 120 37 pd mtx_vis-element; #X obj 216 162 pointer; #N canvas 2499 102 732 662 makepcolorplot 0; #X obj 21 17 inlet; #X obj 21 66 mtx_size; #X obj 576 26 inlet; #X msg 324 466 0; #X obj 306 517 f; #X obj 334 517 + 1; #X obj 306 568 element mtx_vis-plot mtx_vis-array; #X obj 135 601 set mtx_vis-element c y x dy dx; #X obj 135 557 pack f f f \$1 \$1; #X obj 188 228 t f f; #X obj 238 228 t f f; #X obj 306 542 t f f; #N canvas 2641 340 258 467 iterate2d 0; #X obj 47 37 inlet w h; #X obj 47 433 outlet; #X obj 47 62 unpack, f 18; #X obj 47 87 t f b; #X obj 47 112 until; #X obj 47 137 i; #X obj 47 163 t f f; #X obj 77 137 + 1; #X msg 89 113 0; #X obj 47 247 t f b; #X obj 47 272 until; #X obj 47 297 i; #X obj 47 323 t f f; #X obj 77 297 + 1; #X msg 89 273 0; #X obj 47 219 f, f 18; #X obj 47 188 t b f, f 14; #X obj 47 348 pack, f 14; #X msg 47 373 \$2 \$1; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 15 1; #X connect 3 0 4 0; #X connect 3 1 8 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 16 0; #X connect 6 1 7 0; #X connect 7 0 5 1; #X connect 8 0 5 1; #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 17 0; #X connect 12 1 13 0; #X connect 13 0 11 1; #X connect 14 0 11 1; #X connect 15 0 9 0; #X connect 16 0 15 0; #X connect 16 1 17 1; #X connect 17 0 18 0; #X connect 18 0 1 0; #X restore 21 142 pd iterate2d; #X obj 585 391 print 2d; #X obj 135 579 t a a; #X obj 21 91 pack 0 0; #X obj 21 116 t l l; #X obj 21 257 + 1; #X obj 21 282 pack; #X msg 21 307 element \$1 \$2; #X obj 60 257 + 1; #X obj 21 192 unpack; #X obj 21 332 mtx; #X obj 325 110 r \$0-dimen; #X obj 188 163 unpack 0 0 0 0; #X obj 188 188 /; #X obj 238 188 /; #X obj 167 301 * 1; #X obj 228 298 * 1; #X obj 21 225 t f f; #X obj 60 225 t f f; #X obj 21 167 t l b; #X obj 188 138 list prepend 100 100; #N canvas 2655 474 450 300 color2grey 0; #X obj 61 44 inlet; #X obj 61 92 + 0.5; #X obj 61 115 i; #X obj 61 185 * 111; #X obj 61 139 max 0; #X obj 61 69 * 10; #X obj 61 163 min 9; #X obj 61 210 outlet; #X connect 0 0 5 0; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 3 0 7 0; #X connect 4 0 6 0; #X connect 5 0 1 0; #X connect 6 0 3 0; #X restore 21 471 pd color2grey; #X msg 21 382 \$2 \$1; #X obj 21 407 route 0 1; #X obj 21 357 pack 0 0; #N canvas 2655 474 450 300 colormap 0; #X obj 31 10 inlet; #X obj 214 46 r \$0-colormap; #X msg 214 71 set \$1; #X obj 31 130 int; #X obj 31 155 clip 0 999; #X obj 31 180 outlet; #X obj 61 35 r \$0-colormap.size; #X obj 31 35 t f; #X obj 31 59 *; #X obj 31 105 tabread; #X connect 0 0 7 0; #X connect 1 0 2 0; #X connect 2 0 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 3 0; #X restore 59 444 pd colormap; #X obj 21 504 t a; #X obj 86 332 r \$0-colormap; #X msg 86 357 1; #X obj 21 42 t a a b b, f 33; #N canvas 2655 474 450 300 colormapInit 0; #X obj 41 7 inlet; #X obj 59 67 r \$0-colormap; #X msg 59 122 1; #X obj 41 32 t b; #X obj 41 173 select 1; #X obj 41 148 i 0; #X obj 41 198 array size; #X obj 59 95 t b s; #X obj 41 223 s \$0-colormap.size; #X connect 0 0 3 0; #X connect 1 0 7 0; #X connect 2 0 5 1; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 4 0; #X connect 6 0 8 0; #X connect 7 0 2 0; #X connect 7 1 6 1; #X restore 249 66 pd colormapInit; #X connect 0 0 41 0; #X connect 1 0 15 0; #X connect 1 1 15 1; #X connect 2 0 6 1; #X connect 3 0 4 1; #X connect 4 0 11 0; #X connect 5 0 4 1; #X connect 6 0 7 5; #X connect 8 0 14 0; #X connect 9 0 8 3; #X connect 9 1 27 1; #X connect 10 0 28 1; #X connect 10 1 8 4; #X connect 11 0 6 0; #X connect 11 1 5 0; #X connect 12 0 31 0; #X connect 14 0 7 0; #X connect 15 0 16 0; #X connect 16 0 12 0; #X connect 16 1 32 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 19 0 22 0; #X connect 20 0 18 1; #X connect 21 0 29 0; #X connect 21 1 30 0; #X connect 22 0 36 0; #X connect 23 0 32 1; #X connect 24 0 25 0; #X connect 24 1 26 0; #X connect 24 2 25 1; #X connect 24 3 26 1; #X connect 25 0 9 0; #X connect 26 0 10 0; #X connect 27 0 8 1; #X connect 28 0 8 2; #X connect 29 0 17 0; #X connect 29 1 27 0; #X connect 30 0 20 0; #X connect 30 1 28 0; #X connect 31 0 21 0; #X connect 31 1 4 0; #X connect 32 0 24 0; #X connect 33 0 38 0; #X connect 34 0 35 0; #X connect 35 0 33 0; #X connect 35 1 37 0; #X connect 36 0 34 0; #X connect 37 0 38 0; #X connect 38 0 8 0; #X connect 39 0 40 0; #X connect 40 0 36 1; #X connect 41 0 1 0; #X connect 41 1 22 1; #X connect 41 2 3 0; #X connect 41 3 42 0; #X restore 37 246 pd makepcolorplot; #X f 26; #X obj 216 65 loadbang; #X msg 216 139 traverse \$1 \, next; #X obj 216 112 symbol pd-\$0-show; #X obj 216 187 t a a; #N canvas 2498 416 450 300 resize-array 0; #X obj 49 35 inlet; #X obj 49 83 t a a, f 10; #X obj 116 123 mtx_size; #X obj 116 153 *; #X obj 351 71 inlet; #X obj 49 187 outlet; #X obj 116 176 setsize mtx_vis-plot mtx_vis-array; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 1 1 2 0; #X connect 2 0 3 0; #X connect 2 1 3 1; #X connect 3 0 6 0; #X connect 4 0 6 1; #X restore 37 221 pd resize-array; #X f 31; #X msg 301 61 bang; #X msg 364 86 bang; #X obj 216 89 t b b b; #X msg 47 192 matrix 1 1 1; #N canvas 2655 474 450 300 dispatch 0; #X obj 37 37 inlet; #X obj 37 95 list prepend matrix; #X obj 37 120 list trim; #X obj 37 145 outlet matrix; #X obj 37 69 route matrix colormap; #X obj 149 126 symbol; #X obj 149 151 s \$0-colormap; #X connect 0 0 4 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 4 0 1 0; #X connect 4 1 5 0; #X connect 5 0 6 0; #X restore 37 62 pd dispatch; #X obj 250 248 declare -lib iemmatrix; #X connect 0 0 15 0; #X connect 4 0 9 0; #X connect 6 0 13 0; #X connect 7 0 4 0; #X connect 8 0 7 0; #X connect 9 0 5 1; #X connect 9 1 10 1; #X connect 10 0 5 0; #X connect 11 0 8 0; #X connect 12 0 1 0; #X connect 13 0 14 0; #X connect 13 1 8 0; #X connect 13 2 1 0; #X connect 14 0 10 0; #X connect 15 0 10 0; #X restore 48 58 pd guts; #N canvas 3041 462 837 585 resize 0; #X obj 69 55 loadbang; #X obj 69 256 pack; #X obj 69 80 t b b; #X obj 137 110 int \$1; #X obj 69 110 int \$2; #X obj 137 158 select 0; #X obj 137 133 max 0; #X obj 69 135 max 0; #X obj 69 160 select 0; #X obj 69 185 f; #X obj 137 208 t f f; #X msg 69 281 \$2 \$1; #X obj 161 438 s pd-\$0-self; #X obj 69 306 t l l; #X msg 149 53 bang; #X obj 161 321 unpack; #X obj 161 368 pack; #X msg 73 488 donecanvasdialog 1 1 3 0 0 100 100 \$1 \$2 100 100 1 1 1 \, dirty 0; #X obj 73 531 s pd-\$0-show; #X obj 137 183 f 150; #X msg 161 395 donecanvasdialog 1 1 1 0 0 1 1 \$1 \$2 100 100 1 1 1 \, dirty 0; #X obj 161 345 + 2; #X obj 200 346 + 21; #X connect 0 0 2 0; #X connect 1 0 11 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 0 6 0; #X connect 4 0 7 0; #X connect 5 0 19 0; #X connect 5 1 19 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 8 1 9 0; #X connect 9 0 1 0; #X connect 10 0 9 1; #X connect 10 1 1 1; #X connect 11 0 13 0; #X connect 13 0 17 0; #X connect 13 1 15 0; #X connect 14 0 2 0; #X connect 15 0 21 0; #X connect 15 1 22 0; #X connect 16 0 20 0; #X connect 17 0 18 0; #X connect 19 0 10 0; #X connect 20 0 12 0; #X connect 21 0 16 0; #X connect 22 0 16 1; #X restore 302 41 pd resize; #X obj 131 29 namecanvas pd-\$0-self; #N canvas 2500 172 804 556 \$0-show 0; #X scalar mtx_vis-plot 0 0 \; 0 0 0 0 0 \; \;; #X coords 0 0 100 100 150 150 2 100 100; #X restore 101 120 pd \$0-show; #X connect 0 0 1 0; #X coords 0 0 1 1 152 171 1 100 100; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_polyval-help.pd000066400000000000000000000015401514557770000256200ustar00rootroot00000000000000#N canvas 0 0 514 300 10; #X declare -lib iemmatrix; #X obj 47 142 mtx_polyval; #X msg 122 100 matrix 1 5 1 -2 3 2 1; #X msg 43 73 matrix 1 3 0 1 2; #X obj 47 174 mtx_print; #X text 185 152 evaluate polynomial; #X text 181 178 1*x^4 -2*x^3 +3*x^2 +2*x^1 +1*x^0; #X text 45 13 [mtx_polyval] evaluates polynomial with given coefficients; #X text 94 33 at given values for x; #X text 252 241 Franz Zotter \, 2010; #N canvas 477 377 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 105 AUTHOR Franz Zotter; #X text 12 44 DESCRIPTION evaluate polynomials with coefficients, f 81; #X restore 394 268 pd META; #X obj 249 268 declare -lib iemmatrix; #X connect 0 0 3 0; #X connect 1 0 0 1; #X connect 2 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_polyval.pd000066400000000000000000000031141514557770000246710ustar00rootroot00000000000000#N canvas 0 326 645 532 10; #X declare -lib iemmatrix; #X obj 50 32 inlet; #X obj 310 34 inlet; #X text 354 32 coeffs; #X text 94 32 values; #X obj 50 60 mtx_:; #X obj 310 56 t a a; #X obj 342 78 mtx_size; #X obj 82 160 mtx_repmat 1 1; #X obj 82 135 spigot; #X obj 121 113 > 1; #X obj 50 115 t a a; #X obj 177 117 - 1; #X obj 50 184 mtx_size; #X obj 50 227 mtx_ones; #X obj 106 261 spigot; #X obj 50 261 spigot; #X obj 116 226 == 1; #X obj 50 389 mtx_*; #X msg 50 205 \$1 1; #X msg 177 137 1 \$1; #X obj 50 87 mtx_transpose; #X obj 106 280 mtx_concat row; #X obj 310 156 mtx_transpose; #X obj 50 427 outlet; #X text 181 319 powers of x:; #X text 192 335 [x1^0 x1^1 x1^2 ...; #X text 197 350 x2^0 x2^1 x2^2 ...; #X text 199 365 x3^0 x3^1 x3^2 ...; #X text 320 198 coefficients of polynomials; #X text 315 240 a1 b1 c1 d1 ...; #X text 309 223 [a0 b0 c0 d0 ...; #X text 315 255 a2 b3 c3 d3 ...; #X obj 50 319 mtx_cumprod row; #X obj 310 128 mtx_reverse col; #X obj 365 436 declare -lib iemmatrix; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 4 0 20 0; #X connect 5 0 33 0; #X connect 5 1 6 0; #X connect 6 1 9 0; #X connect 6 1 11 0; #X connect 6 1 16 0; #X connect 7 0 21 1; #X connect 8 0 7 0; #X connect 9 0 8 1; #X connect 9 0 14 1; #X connect 10 0 12 0; #X connect 10 1 8 0; #X connect 11 0 19 0; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 13 0 15 0; #X connect 14 0 21 0; #X connect 15 0 32 0; #X connect 16 0 15 1; #X connect 17 0 23 0; #X connect 18 0 13 0; #X connect 19 0 7 1; #X connect 20 0 10 0; #X connect 21 0 32 0; #X connect 22 0 17 1; #X connect 32 0 17 0; #X connect 33 0 22 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_pseudoinverse.pd000066400000000000000000000061541514557770000261050ustar00rootroot00000000000000#N canvas 727 0 495 641 10; #X declare -lib iemmatrix; #X obj 66 34 inlet; #X obj 66 73 mtx_svd; #X obj 342 47 inlet; #X obj 255 339 mtx_slice; #X obj 66 337 mtx_slice; #X obj 66 317 mtx; #X obj 255 361 mtx_transpose; #X obj 155 337 mtx_slice; #X obj 155 358 mtx_.^ -1; #X obj 172 427 mtx_diag; #X obj 155 380 list split 3; #X obj 172 455 mtx_*; #X obj 128 495 mtx_*; #X obj 171 403 list; #X obj 66 240 t b b a; #X obj 128 555 outlet; #X text 386 48 regularization; #N canvas 0 0 595 552 regularize 0; #X obj 159 56 inlet; #X obj 202 173 mtx_minmax; #X obj 266 196 * \$1; #X obj 159 244 mtx_> 0; #X obj 159 265 mtx_transpose; #X obj 160 286 mtx_sum; #X msg 160 307 1 1 end \$1; #X obj 289 56 inlet; #X obj 160 357 outlet; #X obj 159 152 t a a; #X obj 337 238 pack; #X msg 336 260 \$2 \$1; #X obj 336 360 outlet; #X obj 336 327 /; #X connect 0 0 9 0; #X connect 1 0 10 0; #X connect 1 1 2 0; #X connect 1 1 10 1; #X connect 2 0 3 1; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 8 0; #X connect 7 0 2 1; #X connect 9 0 3 0; #X connect 9 1 1 0; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 13 0 12 0; #X restore 256 266 pd regularize; #X obj 226 219 t a a; #N canvas 0 0 450 300 list2mtx 0; #X obj 140 28 inlet; #X obj 140 229 outlet; #X obj 140 178 mtx; #X obj 140 106 t l l; #X msg 182 129 size 1 \$1; #X obj 182 106 list length; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 3 1 5 0; #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 226 196 pd list2mtx; #N canvas 0 0 450 300 autotranspose 0; #X obj 31 16 inlet; #X obj 31 274 outlet; #X obj 317 269 outlet; #X obj 31 39 t a a; #X obj 186 82 mtx_size; #X obj 148 216 mtx_transpose; #X obj 31 191 spigot; #X obj 72 172 == 0; #X obj 149 196 spigot; #X obj 186 110 <; #X connect 0 0 3 0; #X connect 3 0 6 0; #X connect 3 0 8 0; #X connect 3 1 4 0; #X connect 4 0 9 0; #X connect 4 1 9 1; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 7 0 6 1; #X connect 8 0 5 0; #X connect 9 0 2 0; #X connect 9 0 7 0; #X connect 9 0 8 1; #X restore 66 54 pd autotranspose; #N canvas 0 0 450 300 autotranspose 0; #X obj 31 274 outlet; #X obj 148 216 mtx_transpose; #X obj 31 191 spigot; #X obj 72 172 == 0; #X obj 149 196 spigot; #X obj 186 39 inlet; #X obj 31 39 inlet; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 2 1; #X connect 4 0 1 0; #X connect 5 0 3 0; #X connect 5 0 4 1; #X connect 6 0 2 0; #X connect 6 0 4 0; #X restore 128 530 pd autotranspose; #X obj 342 562 outlet; #X text 355 519 condition number; #X obj 15 616 declare -lib iemmatrix; #X connect 0 0 20 0; #X connect 1 0 14 0; #X connect 1 1 19 0; #X connect 1 2 5 1; #X connect 2 0 17 1; #X connect 3 0 6 0; #X connect 4 0 12 0; #X connect 5 0 4 0; #X connect 6 0 11 1; #X connect 7 0 8 0; #X connect 8 0 10 0; #X connect 9 0 11 0; #X connect 10 1 13 1; #X connect 11 0 12 1; #X connect 12 0 21 0; #X connect 13 0 9 0; #X connect 14 0 5 0; #X connect 14 1 13 0; #X connect 14 2 3 0; #X connect 17 0 3 1; #X connect 17 0 7 1; #X connect 17 0 4 1; #X connect 17 1 22 0; #X connect 18 0 7 0; #X connect 18 1 17 0; #X connect 19 0 18 0; #X connect 20 0 1 0; #X connect 20 1 21 1; #X connect 21 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_randperm-help.pd000066400000000000000000000012141514557770000257400ustar00rootroot00000000000000#N canvas 773 206 450 300 10; #X declare -lib iemmatrix; #X obj 54 114 mtx_randperm; #X msg 54 79 4; #X text 82 36 random permutation matrix; #X text 230 221 Franz Zotter \, 2012; #X text 232 241 iemmatrix; #X obj 54 182 mtx_print; #N canvas 477 377 494 171 META 0; #X text 12 86 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 105 AUTHOR Franz Zotter; #X text 12 44 DESCRIPTION random permutation matrix, f 81; #X restore 324 278 pd META; #X obj 179 278 declare -lib iemmatrix; #X connect 0 0 5 0; #X connect 1 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_randperm.pd000066400000000000000000000044701514557770000250210ustar00rootroot00000000000000#N canvas 151 48 580 681 10; #X declare -lib iemmatrix; #X obj 175 32 inlet; #X obj 260 121 *; #X obj 260 189 random; #X obj 311 189 random; #X obj 260 143 until; #X obj 260 163 t b b; #X obj 311 211 + 1; #X obj 260 211 + 1; #X obj 175 467 mtx; #X obj 260 234 pack; #X obj 260 256 mtx 1 2; #X obj 260 279 t a a; #X obj 260 306 mtx_reverse; #X obj 260 329 list split 3; #X obj 323 361 list split 3; #X obj 363 384 unpack; #X obj 201 363 unpack, f 9; #X obj 402 407 t f b; #X msg 447 407 2; #X obj 321 408 t f b; #X msg 366 408 1; #X obj 194 572 list trim; #X msg 220 413 0; #X obj 252 389 t b f; #X obj 194 549 list prepend; #X obj 175 643 outlet; #X msg 443 129 \$1; #X obj 443 281 mtx_eye; #X msg 271 523 row \$1; #X msg 321 430 row \$1; #N canvas 735 459 450 300 demux 0; #X obj 62 53 inlet data; #X obj 143 53 inlet #out; #X obj 62 194 outlet #0; #X obj 132 194 outlet #1; #X obj 202 194 outlet #2; #X obj 62 76 list prepend 0; #X obj 62 99 route 0 1 2; #X connect 0 0 5 0; #X connect 1 0 5 1; #X connect 5 0 6 0; #X connect 6 0 2 0; #X connect 6 1 3 0; #X connect 6 2 4 0; #X restore 175 490 pd demux; #X obj 194 524 list; #X obj 231 524 list; #X obj 365 646 declare -lib iemmatrix; #X obj 260 96 t f f f f; #X obj 175 53 t b f f, f 29; #X obj 201 389 t b b f; #X connect 0 0 35 0; #X connect 1 0 4 0; #X connect 2 0 7 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 5 0 2 0; #X connect 5 1 3 0; #X connect 6 0 9 1; #X connect 7 0 9 0; #X connect 8 0 30 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 11 1 14 0; #X connect 12 0 13 0; #X connect 13 1 16 0; #X connect 14 1 15 0; #X connect 15 0 19 0; #X connect 15 1 17 0; #X connect 16 0 36 0; #X connect 16 1 23 0; #X connect 17 0 29 0; #X connect 17 1 18 0; #X connect 18 0 30 1; #X connect 19 0 29 0; #X connect 19 1 20 0; #X connect 20 0 30 1; #X connect 21 0 8 0; #X connect 22 0 30 1; #X connect 23 0 32 0; #X connect 23 1 28 0; #X connect 24 0 21 0; #X connect 26 0 27 0; #X connect 27 0 8 1; #X connect 28 0 24 1; #X connect 29 0 8 0; #X connect 30 0 25 0; #X connect 30 1 31 1; #X connect 30 2 32 1; #X connect 31 0 24 0; #X connect 32 0 24 0; #X connect 34 0 1 0; #X connect 34 1 1 1; #X connect 34 2 2 1; #X connect 34 3 3 1; #X connect 35 0 8 0; #X connect 35 1 34 0; #X connect 35 2 26 0; #X connect 36 0 31 0; #X connect 36 1 22 0; #X connect 36 2 28 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_roots-help.pd000066400000000000000000000016051514557770000253020ustar00rootroot00000000000000#N canvas 774 102 578 400 10; #X declare -lib iemmatrix; #X obj 100 212 mtx_roots; #X text 29 22 [mtx_roots] uses [mtx_eig] to solve polynomials (see MATLAB-help for 'roots'); #X text 73 60 [mtx_eig] requires iemmatrix to be compiled with gsl; #X text 339 350 Franz Zotter \, 2010; #X text 60 127 (x-3i)(x+3i)(x-1)(x+2)(x-3)=; #X text 77 144 x^5-2x^4+4x^3-12x^2-45x+54; #X msg 100 185 1 -2 4 -12 -45 54; #X obj 82 268 print re; #X obj 160 267 print im; #N canvas 182 448 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 105 AUTHOR Franz Zotter; #X text 12 44 DESCRIPTION solve polyomials with eigenvalues, f 81; #X restore 444 368 pd META; #X obj 299 368 declare -lib iemmatrix; #X connect 0 0 7 0; #X connect 0 1 8 0; #X connect 6 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_roots.pd000066400000000000000000000030031514557770000243460ustar00rootroot00000000000000#N canvas 0 0 298 308 10; #X declare -lib iemmatrix; #N canvas 296 357 512 426 companion_matrix 0; #X obj 308 276 mtx_eye; #X obj 131 219 mtx; #X obj 377 66 list length; #X obj 308 254 f; #X obj 389 232 f; #X obj 219 21 inlet; #X obj 131 401 outlet; #X obj 389 274 mtx_zeros; #X obj 131 262 mtx_* -1; #X obj 403 158 - 2; #X obj 130 178 - 1; #X obj 377 89 moses 3; #X obj 33 177 list split 1; #X obj 131 240 mtx_./ 1; #X obj 131 364 mtx_concat col; #X msg 131 198 size 1 \$1; #X msg 389 253 \$1 1; #X obj 308 301 mtx_concat row; #X obj 323 204 t f f, f 14; #X obj 308 158 t b b, f 14; #X obj 67 83 t l f; #X obj 308 66 t b l; #X obj 219 44 t l l; #X obj 376 112 t a a; #X connect 0 0 17 0; #X connect 1 0 13 0; #X connect 2 0 11 0; #X connect 3 0 0 0; #X connect 4 0 16 0; #X connect 5 0 22 0; #X connect 7 0 17 1; #X connect 8 0 14 0; #X connect 9 0 18 0; #X connect 10 0 15 0; #X connect 11 1 23 0; #X connect 12 1 1 0; #X connect 13 0 8 0; #X connect 14 0 6 0; #X connect 15 0 1 0; #X connect 16 0 7 0; #X connect 17 0 14 1; #X connect 18 0 3 1; #X connect 18 1 4 1; #X connect 19 0 3 0; #X connect 19 1 4 0; #X connect 20 0 12 0; #X connect 20 1 13 1; #X connect 21 0 19 0; #X connect 21 1 2 0; #X connect 22 0 20 0; #X connect 22 1 21 0; #X connect 23 0 10 0; #X connect 23 1 9 0; #X restore 100 135 pd companion_matrix; #X obj 100 47 inlet; #X obj 100 159 mtx_eig; #X obj 182 223 outlet im; #X obj 76 221 outlet re; #X obj 85 266 declare -lib iemmatrix; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 4 0; #X connect 2 1 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rot-help.pd000066400000000000000000000021051514557770000247340ustar00rootroot00000000000000#N canvas 541 188 450 300 10; #X declare -lib iemmatrix; #X obj 72 78 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 69 98 5 0 0 0 - - - 0; #X obj 69 115 *; #X obj 225 105 atan; #X msg 225 85 1; #X obj 225 65 loadbang; #X obj 225 124 / 45; #X obj 69 136 mtx_rot; #X obj 69 173 mtx_print R; #X text 58 23 2 dimensional cartesian rotation matrix; #X msg 33 51 0; #X msg 64 51 90; #X msg 94 51 180; #X msg 126 51 270; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION 2d cartesian rotation matrix, f 81; #X restore 174 278 pd META; #X obj 29 278 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 7 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 6 0 2 1; #X connect 7 0 8 0; #X connect 10 0 1 0; #X connect 11 0 1 0; #X connect 12 0 1 0; #X connect 13 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rot.pd000066400000000000000000000011671514557770000240150ustar00rootroot00000000000000#N canvas 570 39 286 303 10; #X declare -lib iemmatrix; #X obj 94 26 inlet; #X obj 94 237 outlet; #X obj 151 97 sin; #X obj 94 95 cos; #X obj 151 119 t f f; #X obj 151 140 * -1; #X obj 94 182 mtx_diag; #X obj 94 207 mtx_+, f 10; #X obj 151 161 pack f f; #X obj 94 54 t f f, f 10; #X obj 151 182 mtx_diegg; #X msg 94 161 \$1 \$1; #X obj 95 276 declare -lib iemmatrix; #X connect 0 0 9 0; #X connect 2 0 4 0; #X connect 3 0 11 0; #X connect 4 0 5 0; #X connect 4 1 8 1; #X connect 5 0 8 0; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 8 0 10 0; #X connect 9 0 3 0; #X connect 9 1 2 0; #X connect 10 0 7 1; #X connect 11 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rotx-help.pd000066400000000000000000000021501514557770000251240ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 72 108 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 69 128 5 0 0 0 - - - 0; #X obj 69 145 *; #X obj 225 135 atan; #X msg 225 115 1; #X obj 225 95 loadbang; #X obj 225 154 / 45; #X obj 69 203 mtx_print Rx; #X msg 12 66 0; #X msg 43 66 90; #X msg 73 66 180; #X msg 105 66 270; #X obj 69 165 mtx_rotx; #X text 58 23 3 dimensional cartesian rotation matrix \, rotating around x-axis; #N canvas 477 377 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION 3d cartesian rotation matrix around X-axis, f 81; #X text 12 105 AUTHOR Franz Zotter; #X restore 364 258 pd META; #X obj 219 258 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 12 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 6 0 2 1; #X connect 8 0 1 0; #X connect 9 0 1 0; #X connect 10 0 1 0; #X connect 11 0 1 0; #X connect 12 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rotx.pd000066400000000000000000000010001514557770000241670ustar00rootroot00000000000000#N canvas 570 39 450 307 10; #X declare -lib iemmatrix; #X obj 94 26 inlet; #X obj 94 187 outlet; #X obj 94 48 mtx_rot; #X obj 194 25 loadbang; #X obj 194 65 mtx_diag; #X obj 94 70 mtx_resize 3 3; #X obj 94 108 mtx_+; #X obj 94 133 mtx_roll 1; #X obj 94 154 mtx_scroll 1; #X msg 194 46 0 0 1; #X obj 105 246 declare -lib iemmatrix; #X connect 0 0 2 0; #X connect 2 0 5 0; #X connect 3 0 9 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 1 0; #X connect 9 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rotxyz.pd000066400000000000000000000012561514557770000245670ustar00rootroot00000000000000#N canvas 98 59 450 317 10; #X declare -lib iemmatrix; #X obj 244 21 inlet beta_y; #X obj 327 21 inlet gamma_z; #X obj 72 278 outlet; #X obj 72 104 pack f f f; #X obj 107 231 mtx_*; #X obj 72 252 mtx_*; #X obj 72 125 unpack f f f; #X text 211 179 3x3 rotation matrix; #X obj 106 187 mtx_roty; #X obj 141 159 mtx_rotz; #X obj 72 208 mtx_rotx; #X obj 229 278 declare -lib iemmatrix; #X obj 72 21 inlet alpha_z \; [alpha_x \, beta_y \, gamma_z]; #X connect 0 0 3 1; #X connect 1 0 3 2; #X connect 3 0 6 0; #X connect 4 0 5 1; #X connect 5 0 2 0; #X connect 6 0 10 0; #X connect 6 1 8 0; #X connect 6 2 9 0; #X connect 8 0 4 0; #X connect 9 0 4 1; #X connect 10 0 5 0; #X connect 12 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_roty-help.pd000066400000000000000000000021521514557770000251270ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 72 108 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 69 128 5 0 0 0 - - - 0; #X obj 69 145 *; #X obj 225 135 atan; #X msg 225 115 1; #X obj 225 95 loadbang; #X obj 225 154 / 45; #X msg 12 66 0; #X msg 43 66 90; #X msg 73 66 180; #X msg 105 66 270; #X text 58 23 3 dimensional cartesian rotation matrix \, rotating around y-axis; #X obj 69 165 mtx_roty; #X obj 69 203 mtx_print Ry; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION 3d cartesian rotation matrix (Y-axis), f 81; #X restore 354 258 pd META; #X obj 209 258 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 12 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 6 0 2 1; #X connect 7 0 1 0; #X connect 8 0 1 0; #X connect 9 0 1 0; #X connect 10 0 1 0; #X connect 12 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_roty.pd000066400000000000000000000010531514557770000242000ustar00rootroot00000000000000#N canvas 570 39 345 225 10; #X declare -lib iemmatrix; #X obj 94 26 inlet; #X obj 94 187 outlet; #X obj 94 68 mtx_rot; #X obj 194 25 loadbang; #X obj 194 68 mtx_diag; #X obj 94 90 mtx_resize 3 3; #X obj 94 112 mtx_+; #X msg 194 46 0 0 1; #X obj 94 137 mtx_roll -1; #X obj 94 157 mtx_scroll -1; #X obj 94 47 * -1; #X obj 185 186 declare -lib iemmatrix; #X connect 0 0 10 0; #X connect 2 0 5 0; #X connect 3 0 7 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 8 0; #X connect 7 0 4 0; #X connect 8 0 9 0; #X connect 9 0 1 0; #X connect 10 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rotz-help.pd000066400000000000000000000021521514557770000251300ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X declare -lib iemmatrix; #X obj 72 108 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 69 128 5 0 0 0 - - - 0; #X obj 69 145 *; #X obj 225 135 atan; #X msg 225 115 1; #X obj 225 95 loadbang; #X obj 225 154 / 45; #X msg 12 66 0; #X msg 43 66 90; #X msg 73 66 180; #X msg 105 66 270; #X text 58 23 3 dimensional cartesian rotation matrix \, rotating around z-axis; #X obj 69 203 mtx_print Rz; #X obj 69 165 mtx_rotz; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION 3d cartesian rotation matrix (Z-axis), f 81; #X restore 314 258 pd META; #X obj 169 258 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 13 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 6 0 2 1; #X connect 7 0 1 0; #X connect 8 0 1 0; #X connect 9 0 1 0; #X connect 10 0 1 0; #X connect 13 0 12 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rotz.pd000066400000000000000000000007111514557770000242010ustar00rootroot00000000000000#N canvas 570 39 338 244 10; #X declare -lib iemmatrix; #X obj 94 26 inlet; #X obj 94 187 outlet; #X obj 94 64 mtx_rot; #X obj 194 25 loadbang; #X obj 194 65 mtx_diag; #X obj 94 86 mtx_resize 3 3; #X obj 94 108 mtx_+; #X msg 194 46 0 0 1; #X obj 94 45 * -1; #X obj 165 186 declare -lib iemmatrix; #X connect 0 0 8 0; #X connect 2 0 5 0; #X connect 3 0 7 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 4 0; #X connect 8 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rotzyz.pd000066400000000000000000000012571514557770000245720ustar00rootroot00000000000000#N canvas 98 59 450 317 10; #X declare -lib iemmatrix; #X obj 244 21 inlet beta_y; #X obj 327 21 inlet gamma_z; #X obj 72 278 outlet; #X obj 72 104 pack f f f; #X obj 72 21 inlet alpha_z \; [alpha_z \, beta_y \, gamma_y(; #X obj 107 231 mtx_*; #X obj 72 252 mtx_*; #X obj 72 125 unpack f f f; #X text 211 179 3x3 rotation matrix; #X obj 106 187 mtx_roty; #X obj 141 159 mtx_rotz; #X obj 72 208 mtx_rotz; #X obj 235 286 declare -lib iemmatrix; #X connect 0 0 3 1; #X connect 1 0 3 2; #X connect 3 0 7 0; #X connect 4 0 3 0; #X connect 5 0 6 1; #X connect 6 0 2 0; #X connect 7 0 11 0; #X connect 7 1 9 0; #X connect 7 2 10 0; #X connect 9 0 5 0; #X connect 10 0 5 1; #X connect 11 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rowcol2index.pd000066400000000000000000000011071514557770000256220ustar00rootroot00000000000000#N canvas 12 28 450 263 10; #X declare -lib iemmatrix; #X obj 77 12 inlet; #X obj 350 11 inlet; #X text 293 10 columns; #X text 118 13 row; #X obj 152 13 inlet; #X text 193 14 col; #X obj 77 168 outlet; #X obj 77 103 mtx_- 1; #X obj 77 125 mtx_.* \$1; #X obj 77 146 mtx_+, f 13; #X text 270 98 calculates; #X text 216 121 linear matrix indices; #X text 223 145 from row and col indices; #X text 232 169 and the column size; #X obj 235 216 declare -lib iemmatrix; #X connect 0 0 7 0; #X connect 1 0 8 1; #X connect 4 0 9 1; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rowrfft.pd000066400000000000000000000007421514557770000247000ustar00rootroot00000000000000#N canvas 0 0 657 300 12; #X declare -lib iemmatrix; #X obj 91 150 mtx_rfft; #X obj 91 60 inlet; #X obj 91 202 outlet; #X obj 160 203 outlet; #X obj 269 88 loadbang; #X msg 269 120 mtx_rowrfft: use [mtx_rfft] in the future!; #X obj 269 150 print; #X text 291 202 changed name mtx_rowrfft to mtx_rfft Jul \, 22nd; #X text 291 222 Franz Zotter; #X obj 435 236 declare -lib iemmatrix; #X connect 0 0 2 0; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 4 0 5 0; #X connect 5 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_rowrifft.pd000066400000000000000000000007451514557770000250540ustar00rootroot00000000000000#N canvas 0 0 895 300 12; #X declare -lib iemmatrix; #X obj 91 60 inlet; #X obj 91 202 outlet; #X obj 269 88 loadbang; #X obj 269 150 print; #X text 291 222 Franz Zotter; #X obj 91 150 mtx_rifft; #X obj 169 60 inlet; #X msg 269 120 mtx_rowrifft: use [mtx_rifft] in the future!; #X text 291 202 changed name mtx_rowrifft to mtx_rifft Jul \, 22nd; #X obj 285 246 declare -lib iemmatrix; #X connect 0 0 5 0; #X connect 2 0 7 0; #X connect 5 0 1 0; #X connect 6 0 5 1; #X connect 7 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_sfread-help.pd000066400000000000000000000016511514557770000254010ustar00rootroot00000000000000#N canvas 439 256 621 360 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X obj 33 116 mtx_rand; #X msg 32 207 bang; #X obj 32 249 mtx_print file; #X obj 32 228 mtx_sfread 10 ./test_mtx_sfwrite.wav; #X obj 33 146 mtx_sfwrite ./test_mtx_sfwrite.wav; #X msg 33 94 10 3; #X obj 94 116 mtx_print original; #X text 43 34 [mtx_sfread][mtx_sfwrite]; #X text 165 69 reads the rows of a matrix from a multichannel sound file; #N canvas 584 572 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION read multichannel soundfiles into matrix, f 81; #X restore 554 308 pd META; #X obj 409 308 declare -lib iemmatrix; #X connect 1 0 5 0; #X connect 1 0 7 0; #X connect 2 0 4 0; #X connect 4 0 3 0; #X connect 6 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_sfread.pd000066400000000000000000000073241514557770000244560ustar00rootroot00000000000000#N canvas 308 65 872 844 10; #X declare -lib iemmatrix; #X msg 128 128 clear; #X obj 73 149 until 3; #X obj 98 168 + 1; #X obj 113 187 * 20; #X obj 145 187 + 80; #X obj 73 87 \$1; #X obj 73 107 clip 0 64; #X obj 73 207 makefilename \$0-track%d; #X obj 73 228 t a a; #X obj 73 249 pack s 1; #X obj 51 362 soundfiler; #X obj 51 24 inlet; #X msg 305 249 read -resize \$1; #X obj 266 249 t a b; #X obj 305 270 t l; #X obj 51 323 list; #X obj 51 342 list trim; #X obj 217 270 list prepend; #X obj 51 46 symbol \$2; #X msg 73 269 obj 100 \$2 table \$1; #X obj 73 128 t f b b; #X obj 267 470 until 3; #X obj 292 489 + 1; #X obj 267 413 \$1; #X obj 267 432 clip 0 64; #X obj 287 529 makefilename \$0-track%d; #X msg 152 427 clear; #X obj 122 405 t b b; #X obj 267 451 t f b; #X obj 267 758 mtx; #X text 571 87 pd >=0.39-2; #X msg 267 633 row \$1; #X obj 267 652 list append; #X obj 349 652 spigot; #X obj 388 632 == 1; #X obj 267 508 t f f f; #X obj 287 594 t l l; #X obj 349 730 mtx_zeros; #X obj 349 691 t b f; #X obj 349 711 pack \$1 0; #X obj 267 780 outlet; #X obj 267 671 list trim; #X obj 51 382 != 0; #X obj 83 382 sel 1; #N canvas 569 312 599 627 \$0-subpatch 0; #X obj 100 100 table 1036-track1; #X obj 100 120 table 1036-track2; #X obj 100 140 table 1036-track3; #X obj 100 160 table 1036-track4; #X obj 100 180 table 1036-track5; #X obj 100 200 table 1036-track6; #X obj 100 220 table 1036-track7; #X obj 100 240 table 1036-track8; #X obj 100 260 table 1036-track9; #X obj 100 280 table 1036-track10; #X restore 157 315 pd \$0-subpatch; #X obj 152 447 s \$0-tosubpatch; #X text 601 115 \$1 ... nchan \$2 ... filename; #X text 474 73 requires iemlib \, iemmatrix; #X obj 73 187 t f f; #X obj 51 67 t b b a; #X obj 122 382 t b b; #X msg 127 149 1; #X obj 73 168 i; #X text 162 166 dynamic patching; #X text 376 229 gathering command for soundfiler; #X text 127 362 loading tracks into subpatch-tables; #X msg 321 470 1; #X obj 267 489 i; #X text 421 632 initialize matrix with zeros; #X text 329 506 stepping through the subpatch-tables; #X text 92 20 name/bang; #X text 286 30 reading multichannel audiofiles into matrix rows; #X obj 349 671 list length; #X obj 73 290 s pd-\$0-subpatch; #X obj 287 574 array get; #X obj 287 549 t b s; #X obj 595 326 declare -lib iemmatrix; #X connect 0 0 63 0; #X connect 1 0 52 0; #X connect 2 0 52 1; #X connect 3 0 4 0; #X connect 4 0 9 1; #X connect 5 0 6 0; #X connect 6 0 20 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 8 1 17 0; #X connect 9 0 19 0; #X connect 10 0 42 0; #X connect 11 0 18 0; #X connect 12 0 17 1; #X connect 13 0 12 0; #X connect 13 1 17 1; #X connect 14 0 17 1; #X connect 15 0 16 0; #X connect 16 0 10 0; #X connect 17 0 14 0; #X connect 17 0 15 1; #X connect 18 0 49 0; #X connect 19 0 63 0; #X connect 20 0 1 0; #X connect 20 1 51 0; #X connect 20 2 0 0; #X connect 21 0 57 0; #X connect 22 0 57 1; #X connect 23 0 24 0; #X connect 24 0 28 0; #X connect 25 0 65 0; #X connect 26 0 45 0; #X connect 27 0 29 0; #X connect 27 1 26 0; #X connect 28 0 21 0; #X connect 28 1 56 0; #X connect 29 0 40 0; #X connect 31 0 32 0; #X connect 32 0 41 0; #X connect 33 0 62 0; #X connect 34 0 33 1; #X connect 35 0 31 0; #X connect 35 1 25 0; #X connect 35 2 34 0; #X connect 36 0 32 1; #X connect 36 1 33 0; #X connect 37 0 29 1; #X connect 38 0 39 0; #X connect 38 1 39 1; #X connect 39 0 37 0; #X connect 41 0 29 0; #X connect 42 0 43 0; #X connect 43 0 50 0; #X connect 48 0 7 0; #X connect 48 1 3 0; #X connect 49 0 15 0; #X connect 49 1 5 0; #X connect 49 2 13 0; #X connect 50 0 27 0; #X connect 50 1 23 0; #X connect 51 0 52 1; #X connect 52 0 2 0; #X connect 52 0 48 0; #X connect 56 0 57 1; #X connect 57 0 22 0; #X connect 57 0 35 0; #X connect 62 0 38 0; #X connect 64 0 36 0; #X connect 65 0 64 0; #X connect 65 1 64 2; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_sfwrite-help.pd000066400000000000000000000016521514557770000256210ustar00rootroot00000000000000#N canvas 439 256 635 379 10; #X declare -lib iemmatrix; #X text 482 28 part of iemmatrix; #X text 166 69 writes the rows of a matrix into a multichannel sound file; #X obj 33 116 mtx_rand; #X msg 32 207 bang; #X obj 32 249 mtx_print file; #X obj 32 228 mtx_sfread 10 ./test_mtx_sfwrite.wav; #X obj 33 146 mtx_sfwrite ./test_mtx_sfwrite.wav; #X text 43 34 [mtx_sfwrite][mtx_sfread]; #X msg 33 97 10 4; #X obj 95 116 mtx_print original; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION write multichannel soundfile from matrix, f 81; #X restore 574 308 pd META; #X obj 429 308 declare -lib iemmatrix; #X connect 2 0 6 0; #X connect 2 0 9 0; #X connect 3 0 5 0; #X connect 5 0 4 0; #X connect 8 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_sfwrite.pd000066400000000000000000000057421514557770000246770ustar00rootroot00000000000000#N canvas 429 353 838 383 10; #X declare -lib iemmatrix; #X obj 53 121 until 3; #X obj 78 146 + 1; #X text 425 51 reading multichannel soundfiles via soundfiler and dynamically created table arrays into multichannel matrix; #X obj 239 325 soundfiler; #X obj 290 50 inlet; #X obj 239 305 list trim; #X obj 311 285 list prepend; #X text 399 30 pd >=0.39-2; #N canvas 569 312 599 627 \$0-subpatch 0; #X obj 100 100 table 1037-track1 3; #X obj 100 120 table 1037-track2 3; #X obj 100 140 table 1037-track3 3; #X obj 100 160 table 1037-track4 3; #X obj 100 180 table 1037-track5 3; #X obj 100 200 table 1037-track6 3; #X obj 100 220 table 1037-track7 3; #X obj 100 240 table 1037-track8 3; #X obj 100 260 table 1037-track9 3; #X obj 100 280 table 1037-track10 3; #X restore 430 315 pd \$0-subpatch; #X obj 34 23 inlet; #X text 35 4 matrix; #X obj 53 62 mtx_size; #X text 228 50 filename; #X obj 53 82 clip 1 64; #X obj 53 270 mtx; #X msg 53 250 row \$1; #X obj 53 290 list prepend 0; #X obj 53 310 list trim; #X msg 533 211 clear; #X obj 430 142 until 3; #X obj 469 211 * 20; #X obj 501 211 + 80; #X obj 430 231 makefilename \$0-track%d; #X obj 430 122 t f b b; #X obj 53 190 t f f; #X obj 53 101 t f b f; #X text 427 78 dynamic table subpatch on dimension change; #X obj 430 251 pack s 1 1; #X msg 430 271 obj 100 \$2 table \$1 \$3; #X msg 239 265 write -wave -bytes 4 \$1; #X obj 239 285 list append; #X obj 34 42 t b a a b; #X msg 106 121 1; #X obj 53 146 i; #X msg 483 142 1; #X obj 455 162 + 1; #X obj 430 162 i; #X obj 430 211 t f f; #X text 102 5 writing matrix rows into multichannel; #X text 102 22 audio files; #X obj 239 245 symbol \$1; #X text 535 28 \$1 ... filename; #X obj 80 210 makefilename \$0-track%d; #X obj 53 334 send; #X obj 80 230 t s s; #X obj 430 294 send pd-\$0-subpatch; #X obj 430 185 t a a; #X obj 53 168 t f f; #X obj 311 305 t l l; #X text 396 15 requires iemmatrix; #X obj 595 316 declare -lib iemmatrix; #X connect 0 0 33 0; #X connect 1 0 33 1; #X connect 4 0 40 1; #X connect 5 0 3 0; #X connect 6 0 48 0; #X connect 9 0 31 0; #X connect 11 0 13 0; #X connect 11 1 27 2; #X connect 13 0 25 0; #X connect 14 0 16 0; #X connect 15 0 14 0; #X connect 16 0 17 0; #X connect 17 0 43 0; #X connect 18 0 45 0; #X connect 19 0 36 0; #X connect 20 0 21 0; #X connect 21 0 27 1; #X connect 22 0 27 0; #X connect 23 0 19 0; #X connect 23 1 34 0; #X connect 23 2 18 0; #X connect 24 0 15 0; #X connect 24 1 42 0; #X connect 25 0 0 0; #X connect 25 1 32 0; #X connect 25 2 23 0; #X connect 27 0 28 0; #X connect 28 0 45 0; #X connect 29 0 30 0; #X connect 30 0 5 0; #X connect 31 0 40 0; #X connect 31 1 11 0; #X connect 31 2 14 1; #X connect 31 3 6 1; #X connect 32 0 33 1; #X connect 33 0 47 0; #X connect 34 0 36 1; #X connect 35 0 36 1; #X connect 36 0 46 0; #X connect 37 0 22 0; #X connect 37 1 20 0; #X connect 40 0 29 0; #X connect 42 0 44 0; #X connect 44 0 43 1; #X connect 44 1 6 0; #X connect 46 0 37 0; #X connect 46 1 35 0; #X connect 47 0 24 0; #X connect 47 1 1 0; #X connect 48 0 30 1; #X connect 48 1 6 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_show-help.pd000066400000000000000000000023221514557770000251110ustar00rootroot00000000000000#N canvas 293 248 761 520 12; #X declare -lib iemmatrix; #X text 53 27 show a matrix; #X msg 35 228 5; #X obj 35 253 mtx_eye; #X obj 35 353 mtx_show; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X text 12 44 DESCRIPTION show a matrix; #X restore 656 9 pd META; #X msg 100 227 8 4; #X obj 100 252 mtx_ones; #X msg 176 227 4 7; #X obj 176 252 mtx_rand; #X obj 140 84 mtx_show 4; #X obj 251 83 mtx_show 2 8; #X text 286 288 the size of [mtx_show] adjusts automatically according to the dimensions of the input matrix (and the required digits).; #X text 366 370 NOTE: this object is rather slow.; #X text 410 393 it's a nice interface for debugging \, but it probably shouldn't be used in production., f 36; #X text 52 62 arguments specify the initial size.; #X obj 54 85 mtx_show; #X obj 35 498 mtx_print show; #X text 282 260 displayed values are clamped to 3 decimals.; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 16 0; #X connect 5 0 6 0; #X connect 6 0 3 0; #X connect 7 0 8 0; #X connect 8 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_show.pd000066400000000000000000000216351514557770000241730ustar00rootroot00000000000000#N canvas 371 58 761 295 12; #X declare -lib iemmatrix; #X obj 415 11 inlet matrix; #X obj 82 39 namecanvas pd-\$0-self; #N canvas 735 461 450 300 \$0-data 0; #X coords 0 0 3 3 63 45 2 0 0; #X restore 100 120 pd \$0-data; #N canvas 1187 96 450 168 template 0; #X obj 41 60 s \$0-interaction; #X obj 41 35 struct \$0-element float x float y float v float c; #X obj 42 100 drawnumber v 0 0 c; #X connect 1 0 0 0; #X restore 247 39 pd template; #X obj 567 11 outlet; #N canvas 405 639 450 300 code 0; #N canvas 899 428 955 636 resize 0; #X obj 170 16 inlet matrix; #X obj 170 41 mtx_size; #X obj 389 455 s pd-\$0-self; #X obj 389 267 * 49; #X obj 442 242 t f f; #X obj 442 265 * 15; #X obj 389 332 pack 0 0 0 0 0; #X obj 389 242 t f f; #X obj 442 288 t f f; #X obj 482 310 + 20; #X text 502 339 w dx h dy h0; #X msg 389 431 goprect 100 100 \$1 \$5; #X obj 421 405 s pd-\$0-data; #N canvas 0 0 292 264 sizechange 0; #X obj 48 87 t a a b; #X obj 81 146 change; #X msg 81 171 1; #X obj 134 146 change; #X msg 184 147 0; #X obj 48 202 spigot 1; #X obj 81 121 unpack; #X obj 48 227 outlet; #X obj 48 62 inlet; #X connect 0 0 5 0; #X connect 0 1 6 0; #X connect 0 2 4 0; #X connect 1 0 2 0; #X connect 2 0 5 1; #X connect 3 0 2 0; #X connect 4 0 5 1; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 6 1 3 0; #X connect 8 0 0 0; #X restore 202 114 pd sizechange; #X obj 170 64 pack 0 0; #N canvas 0 0 450 512 count2d 0; #X obj 43 27 inlet N M; #X obj 43 52 t a b; #X obj 43 102 until; #X obj 43 127 i; #X obj 43 152 t f f; #X obj 43 177 t b f; #X obj 43 202 f; #X obj 43 257 until; #X obj 43 282 i; #X obj 43 307 t f f; #X obj 43 332 pack 0 0; #X obj 75 282 + 1; #X obj 75 127 + 1; #X msg 101 54 0; #X obj 43 230 t f b; #X msg 96 254 0; #X msg 43 357 \$2 \$1; #X obj 43 77 unpack; #X obj 43 382 outlet n m; #X connect 0 0 1 0; #X connect 1 0 17 0; #X connect 1 1 13 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 12 0; #X connect 5 0 6 0; #X connect 5 1 10 1; #X connect 6 0 14 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 16 0; #X connect 11 0 8 1; #X connect 12 0 3 1; #X connect 13 0 3 1; #X connect 14 0 7 0; #X connect 14 1 15 0; #X connect 15 0 8 1; #X connect 16 0 18 0; #X connect 17 0 2 0; #X connect 17 1 6 1; #X restore 202 433 pd count2d; #X obj 202 316 t a b; #X obj 234 342 symbol pd-\$0-data; #X msg 234 367 traverse \$1 \, bang; #X obj 234 392 pointer; #X obj 389 209 swap; #X obj 65 217 outlet; #X obj 170 87 t a a; #X obj 504 214 * 7; #X msg 574 73 3; #X msg 513 404 clear; #X msg 421 381 goprect 0 0 \$1 \$3 \, bounds 0 0 \$2 \$4; #X obj 202 139 t a a b b, f 35; #N canvas 688 426 450 300 maxchange 0; #X obj 32 43 inlet; #X obj 32 165 outlet; #X obj 104 36 inlet; #X obj 32 68 max; #X obj 32 93 t f f; #X obj 32 118 change; #X obj 104 61 t f f; #X msg 136 85 set \$1; #X connect 0 0 3 0; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 3 1; #X connect 5 0 1 0; #X connect 6 0 3 1; #X connect 6 1 7 0; #X connect 7 0 5 0; #X restore 472 104 pd maxchange; #X obj 472 72 t f; #X obj 472 129 t b f; #X obj 574 98 t f f; #X obj 389 357 t a a; #X obj 472 47 r \$0.maxchars; #X obj 202 583 append \$0-element y x c; #X obj 202 458 t l l; #X obj 202 559 pack 0 0 0; #X obj 269 478 unpack; #X obj 308 511 % 2; #X obj 308 533 * 222; #X obj 202 489 unpack; #X obj 241 524 + 0.1; #X connect 0 0 1 0; #X connect 1 0 14 0; #X connect 1 1 14 1; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 4 1 6 3; #X connect 5 0 8 0; #X connect 6 0 32 0; #X connect 7 0 3 0; #X connect 7 1 6 1; #X connect 8 0 6 2; #X connect 8 1 9 0; #X connect 9 0 6 4; #X connect 11 0 2 0; #X connect 13 0 27 0; #X connect 14 0 22 0; #X connect 15 0 35 0; #X connect 16 0 15 0; #X connect 16 1 17 0; #X connect 17 0 18 0; #X connect 18 0 19 0; #X connect 19 0 34 3; #X connect 20 0 7 0; #X connect 20 1 4 0; #X connect 22 0 21 0; #X connect 22 1 13 0; #X connect 23 0 3 1; #X connect 24 0 31 0; #X connect 25 0 12 0; #X connect 26 0 12 0; #X connect 27 0 16 0; #X connect 27 1 20 0; #X connect 27 2 24 0; #X connect 27 3 25 0; #X connect 28 0 30 0; #X connect 29 0 28 0; #X connect 30 0 3 0; #X connect 30 1 23 0; #X connect 31 0 28 1; #X connect 31 1 23 0; #X connect 32 0 11 0; #X connect 32 1 26 0; #X connect 33 0 29 0; #X connect 35 0 40 0; #X connect 35 1 37 0; #X connect 36 0 34 0; #X connect 37 1 38 0; #X connect 38 0 39 0; #X connect 39 0 36 2; #X connect 40 0 36 0; #X connect 40 1 41 0; #X connect 41 0 36 1; #X restore 75 103 pd resize; #N canvas 553 111 884 812 values 0; #N canvas 0 0 450 512 count2d 0; #X obj 43 27 inlet N M; #X obj 43 52 t a b; #X obj 43 102 until; #X obj 43 127 i; #X obj 43 152 t f f; #X obj 43 177 t b f; #X obj 43 202 f; #X obj 43 257 until; #X obj 43 282 i; #X obj 43 307 t f f; #X obj 43 332 pack 0 0; #X obj 75 282 + 1; #X obj 75 127 + 1; #X msg 101 54 0; #X obj 43 230 t f b; #X msg 96 254 0; #X msg 43 357 \$2 \$1; #X obj 43 77 unpack; #X obj 43 382 outlet n m; #X connect 0 0 1 0; #X connect 1 0 17 0; #X connect 1 1 13 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 12 0; #X connect 5 0 6 0; #X connect 5 1 10 1; #X connect 6 0 14 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 16 0; #X connect 11 0 8 1; #X connect 12 0 3 1; #X connect 13 0 3 1; #X connect 14 0 7 0; #X connect 14 1 15 0; #X connect 15 0 8 1; #X connect 16 0 18 0; #X connect 17 0 2 0; #X connect 17 1 6 1; #X restore 386 207 pd count2d; #X obj 481 86 symbol pd-\$0-data; #X obj 481 361 pointer; #X msg 386 312 element \$1 \$2; #X obj 386 337 matrix; #X obj 363 41 inlet size; #X obj 622 45 inlet matrix; #X obj 386 232 unpack; #X obj 386 257 + 1; #X obj 386 282 pack; #X obj 425 257 + 1; #X obj 654 135 mtx_int; #X obj 654 160 mtx_./ 1000; #X obj 654 110 mtx_.* 1000; #X obj 654 185 t a a; #X obj 686 210 mtx_minmax; #X obj 686 235 abs; #X obj 686 260 max; #X obj 753 237 abs; #X obj 363 526 list fromsymbol; #X msg 363 496 symbol -\$1; #X obj 363 551 list length; #X obj 363 605 i; #X msg 442 361 next; #X obj 386 362 t f b; #X obj 363 60 t b a b; #X msg 481 111 traverse \$1; #X obj 386 387 set \$0-element v; #X obj 161 282 r \$0-interaction; #X obj 161 307 route change; #X obj 161 387 pack f f f; #X obj 622 78 t a a; #X obj 161 360 + 1; #X obj 212 360 + 1; #X msg 161 412 element \$1 \$2 \$3 \, bang; #X obj 363 632 s \$0.maxchars; #X obj 161 514 outlet; #X obj 161 489 matrix; #X obj 161 332 get \$0-element y x v; #X obj 298 360 t f f; #X obj 363 463 f; #X obj 330 385 * 1000; #X obj 330 410 int; #X obj 330 435 / 1000; #X obj 762 46 inlet matrix(cold); #X obj 762 71 t a a; #X connect 0 0 7 0; #X connect 1 0 26 0; #X connect 2 0 27 1; #X connect 3 0 4 0; #X connect 4 0 24 0; #X connect 5 0 25 0; #X connect 6 0 31 0; #X connect 7 0 8 0; #X connect 7 1 10 0; #X connect 8 0 9 0; #X connect 9 0 3 0; #X connect 10 0 9 1; #X connect 11 0 12 0; #X connect 12 0 14 0; #X connect 13 0 11 0; #X connect 14 0 4 1; #X connect 14 1 15 0; #X connect 15 0 16 0; #X connect 15 1 18 0; #X connect 16 0 17 0; #X connect 17 0 40 1; #X connect 18 0 17 1; #X connect 19 0 21 0; #X connect 20 0 19 0; #X connect 21 0 22 0; #X connect 22 0 35 0; #X connect 23 0 2 0; #X connect 24 0 27 0; #X connect 24 1 23 0; #X connect 25 0 40 0; #X connect 25 1 0 0; #X connect 25 2 1 0; #X connect 26 0 2 0; #X connect 28 0 29 0; #X connect 29 0 38 0; #X connect 30 0 34 0; #X connect 31 0 37 0; #X connect 31 1 13 0; #X connect 32 0 30 0; #X connect 33 0 30 1; #X connect 34 0 37 0; #X connect 37 0 36 0; #X connect 38 0 32 0; #X connect 38 1 33 0; #X connect 38 2 39 0; #X connect 39 0 30 2; #X connect 39 1 41 0; #X connect 40 0 20 0; #X connect 41 0 42 0; #X connect 42 0 43 0; #X connect 43 0 40 0; #X connect 44 0 45 0; #X connect 45 0 37 1; #X connect 45 1 13 0; #X restore 76 129 pd values; #X obj 75 71 t a a; #X obj 128 22 loadbang; #N canvas 756 302 450 300 init 0; #X obj 122 21 inlet; #X obj 122 274 outlet; #X msg 154 90 args; #X obj 154 115 pdcontrol; #X obj 154 140 route bang float; #X obj 122 67 t b b; #X obj 122 195 pack 0 3 3; #X obj 155 165 t f f; #X obj 195 165 unpack 0 0; #X msg 122 220 \$2 \$3; #X obj 122 245 mtx_zeros; #X obj 122 44 t b b; #X msg 239 48 clear; #X obj 239 73 s pd-\$0-data; #X connect 0 0 11 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 1 7 0; #X connect 4 2 8 0; #X connect 5 0 6 0; #X connect 5 1 2 0; #X connect 6 0 9 0; #X connect 7 0 6 1; #X connect 7 1 6 2; #X connect 8 0 6 1; #X connect 8 1 6 2; #X connect 9 0 10 0; #X connect 10 0 1 0; #X connect 11 0 5 0; #X connect 11 1 12 0; #X connect 12 0 13 0; #X restore 128 46 pd init; #X obj 28 19 inlet; #X obj 76 154 outlet; #X msg 239 48 clear; #X obj 239 73 s pd-\$0-data; #X obj 128 71 t a a; #X obj 190 168 declare -lib iemmatrix; #X connect 0 0 1 0; #X connect 1 0 6 0; #X connect 2 0 0 0; #X connect 2 1 1 1; #X connect 3 0 4 0; #X connect 4 0 9 0; #X connect 5 0 2 0; #X connect 7 0 8 0; #X connect 9 0 0 0; #X connect 9 1 1 2; #X restore 507 11 pd code; #X connect 0 0 5 0; #X connect 5 0 4 0; #X coords 0 -1 1 1 63 65 1 100 100; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_sph2cart-help.pd000066400000000000000000000022351514557770000256620ustar00rootroot00000000000000#N canvas 537 0 450 300 10; #X declare -lib iemmatrix; #X obj 69 114 mtx 3 1; #X text 169 70 2 ey; #X msg 26 49 1 0 1.5708; #X obj 69 147 mtx_sph2cart; #X msg 69 71 2 1.5708 1.5708; #X msg 97 91 3 0 0; #X text 144 94 3 ez; #X obj 69 191 mtx_print xyz; #X text 19 11 converting spherical to carteisan coordinates; #X text 264 202 Franz Zotter \, 2009; #X text 99 49 1 ex; #X text 219 62 input matrices have the shape 3xL; #X text 221 76 and may contain L points; #X text 219 93 [ r \; phi \; theta ]; #X text 215 143 r... radius; #X text 215 156 phi... azimuth angle; #X text 215 169 theta.. zenith angle; #X text 239 243 see also; #X obj 298 243 mtx_cart2sph; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION convert spherical to cartesian coordinates (matrix version), f 81; #X restore 324 278 pd META; #X obj 179 278 declare -lib iemmatrix; #X connect 0 0 3 0; #X connect 2 0 0 0; #X connect 3 0 7 0; #X connect 4 0 0 0; #X connect 5 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_sph2cart.pd000066400000000000000000000023001514557770000247250ustar00rootroot00000000000000#N canvas 683 47 450 551 10; #X declare -lib iemmatrix; #X obj 44 279 t a a; #X obj 101 377 mtx_concat; #X obj 44 378 mtx_.*; #X obj 296 139 mtx_slice 1 1 1 end; #X obj 196 209 mtx_cos; #X obj 169 253 mtx_sin; #X obj 169 183 t a a; #X obj 101 329 mtx_.*; #X obj 169 282 mtx_.*; #X obj 196 230 mtx_.*; #X obj 44 408 mtx_concat; #X obj 44 93 t a a a; #X text 229 451 Franz Zotter \, 2009; #X text 231 428 [iemmatrix]; #X obj 44 255 mtx_slice 2 1 2 end; #X obj 169 159 mtx_slice 3 1 3 end; #X obj 44 356 mtx_cos; #X obj 101 307 mtx_sin; #X obj 235 506 declare -lib iemmatrix; #X obj 44 17 inlet [r \, phi \, theta]; #X obj 44 467 outlet [x \, y \, z]; #X obj 169 305 t a a; #X obj 296 162 t a a; #X connect 0 0 16 0; #X connect 0 1 17 0; #X connect 1 0 10 1; #X connect 2 0 10 0; #X connect 3 0 22 0; #X connect 4 0 9 0; #X connect 5 0 8 0; #X connect 6 0 5 0; #X connect 6 1 4 0; #X connect 7 0 1 0; #X connect 8 0 21 0; #X connect 9 0 1 1; #X connect 10 0 20 0; #X connect 11 0 14 0; #X connect 11 1 15 0; #X connect 11 2 3 0; #X connect 14 0 0 0; #X connect 15 0 6 0; #X connect 16 0 2 0; #X connect 17 0 7 0; #X connect 19 0 11 0; #X connect 21 0 7 1; #X connect 21 1 2 1; #X connect 22 0 9 1; #X connect 22 1 8 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_spivot-help.pd000066400000000000000000000063311514557770000254610ustar00rootroot00000000000000#N canvas 0 35 759 714 10; #X declare -lib iemmatrix; #N canvas 352 114 190 367 rand-matrix 0; #X obj 74 163 inlet; #X obj 74 280 outlet; #X obj 74 195 mtx_rand; #X obj 74 215 mtx_* 10; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X restore 53 369 pd rand-matrix; #X msg 53 347 4 3; #X obj 139 215 mtx_print pre; #X obj 53 255 mtx_print pivot; #X text 269 171 the first outlet is the pivot-transformed matrix.; #X obj 53 121 t a a; #X obj 83 140 mtx_print original; #X obj 53 98 mtx 3 3; #X msg 53 78 1 2 3 6 5 4 8 7 9; #X obj 53 532 mtx_print pivot; #X obj 97 421 mtx_print original; #X obj 53 398 t a a a; #X obj 139 475 mtx_*; #X obj 167 532 mtx_print pivot2; #N canvas 352 114 190 367 rand-matrix 0; #X obj 74 163 inlet; #X obj 74 240 outlet; #X obj 74 195 mtx_rand; #X obj 74 215 mtx_* 10; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X restore 381 338 pd rand-matrix; #X obj 411 461 mtx_print pivot; #X obj 381 500 mtx_*; #X obj 411 560 mtx_print depivot; #X obj 381 437 t a a; #X obj 381 480 mtx_transpose; #X obj 381 520 mtx_transpose; #X text 456 22 part of [iemmatrix]; #X obj 403 383 mtx_print original; #X text 39 326 B=pivot(A)=pre*A; #X text 377 288 A=depivot(B)=(B'*pre)'; #X text 49 59 pivot-transform the rows of a matrix; #X text 270 122 this will transform (permutate) the rows \, so that the result will have all maximum (or minimum) values in the diagonal. however \, the diagonal will be unsorted.; #X text 268 197 the second outlet gives the permutation-matrix that have to be pre-multiplied to the original matrix to get the semi-pivot-transformation. this is useful for de-pivoting.; #X obj 70 494 mtx_-; #X obj 70 513 mtx_print diff; #X obj 381 582 mtx_-; #X obj 381 601 mtx_print diff; #X obj 381 540 t a a; #X obj 381 362 t a a a; #X msg 381 316 3 4; #X obj 521 461 mtx_print pivoteer; #X obj 453 434 t a a; #X obj 53 194 mtx_spivot; #X obj 53 450 mtx_spivot; #X obj 381 413 mtx_spivot; #X text 52 19 mtx_spivot:: semi-pivot transform a matrix; #X text 88 639 (c) 2005 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X text 88 656 for license-details see LICENSE.txt that should come with iemmatrix.; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 11 43 DESCRIPTION semi-pivot transform a matrix, f 81; #X restore 584 48 pd META; #X obj 439 48 declare -lib iemmatrix; #X connect 0 0 11 0; #X connect 1 0 0 0; #X connect 5 0 37 0; #X connect 5 1 6 0; #X connect 7 0 5 0; #X connect 8 0 7 0; #X connect 11 0 38 0; #X connect 11 1 12 1; #X connect 11 2 10 0; #X connect 12 0 13 0; #X connect 12 0 28 1; #X connect 14 0 33 0; #X connect 16 0 20 0; #X connect 18 0 19 0; #X connect 18 1 15 0; #X connect 19 0 16 0; #X connect 20 0 32 0; #X connect 28 0 29 0; #X connect 30 0 31 0; #X connect 32 0 30 0; #X connect 32 1 17 0; #X connect 33 0 39 0; #X connect 33 1 22 0; #X connect 33 2 30 1; #X connect 34 0 14 0; #X connect 36 0 16 1; #X connect 36 1 35 0; #X connect 37 0 3 0; #X connect 37 1 2 0; #X connect 38 0 9 0; #X connect 38 0 28 0; #X connect 38 1 12 0; #X connect 39 0 18 0; #X connect 39 1 36 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_spivot.pd000066400000000000000000000036571514557770000245430ustar00rootroot00000000000000#N canvas 835 313 564 462 10; #X declare -lib iemmatrix; #X obj 154 166 mtx; #X obj 154 208 mtx_*; #X obj 115 78 inlet; #X obj 115 99 t a a; #X obj 154 248 mtx_*; #X obj 154 228 t a a; #X obj 115 119 mtx_pivot \$1; #X obj 154 270 outlet pivoted; #X obj 260 271 outlet pivoter; #X obj 154 139 t b a a; #N canvas 118 188 669 439 resizer 0; #X obj 322 204 mtx_size; #X obj 236 283 mtx_eye; #X obj 366 303 mtx_eye; #X obj 322 225 pack; #X obj 206 231 t a a; #X obj 206 263 mtx_resize; #X obj 236 323 mtx_-; #X obj 236 303 mtx_resize; #X obj 322 246 t l l l; #X text 138 30 what's going on here ?; #X obj 206 182 inlet A; #X obj 322 182 inlet B; #X obj 206 379 outlet C; #X text 153 52 a matrix A should be resized to the same size as a reference matrix B. the missing elements should be taken from the identity-matrix rather than from the zeros-matrix.; #X text 153 100 what we do is: resize A (with zeros) \, calculate the missing identity matrix (by subtracting a (zero-padded) resized I-matrix from a big I-matrix) and add them together; #X text 159 150 C=A+I(B)-I(A); #X obj 206 350 mtx_-; #X connect 0 0 3 0; #X connect 0 1 3 1; #X connect 1 0 7 0; #X connect 2 0 6 1; #X connect 3 0 8 0; #X connect 4 0 5 0; #X connect 4 1 1 0; #X connect 5 0 16 0; #X connect 6 0 16 1; #X connect 7 0 6 0; #X connect 8 0 5 1; #X connect 8 1 7 1; #X connect 8 2 2 0; #X connect 10 0 4 0; #X connect 11 0 0 0; #X connect 16 0 12 0; #X restore 154 187 pd resizer; #X text 72 316 (c) 2005 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X text 72 333 for license-details see LICENSE.txt that should come with iemmatrix.; #X text 62 38 semi-pivotize a matrix; #X obj 235 366 declare -lib iemmatrix; #X connect 0 0 10 0; #X connect 1 0 5 0; #X connect 2 0 3 0; #X connect 3 0 6 0; #X connect 3 1 4 1; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 5 1 8 0; #X connect 6 1 9 0; #X connect 6 2 0 1; #X connect 9 0 0 0; #X connect 9 1 1 1; #X connect 9 2 10 1; #X connect 10 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_symasym-help.pd000066400000000000000000000024701514557770000256370ustar00rootroot00000000000000#N canvas 302 270 518 410 10; #X declare -lib iemmatrix; #X msg 174 116 bang; #X obj 174 160 t a a; #X msg 87 114 bang; #X obj 87 135 mtx_rand 5; #X obj 174 137 mtx_eye 5; #X obj 264 137 mtx_egg 5; #X obj 174 240 mtx_symasym; #X obj 246 271 mtx_print asymmetric; #X obj 174 297 mtx_print symmetric; #X obj 204 205 mtx_print original; #X msg 264 114 bang; #X text 26 12 mtx_symasym:: decompose a matrix into symmetric & asymmetric parts; #X text 22 45 each square matrix can be decomposed into a symmetric and an asymmetric part \, with; #X text 205 79 M=S+A; #X text 70 336 (c) 2005 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X text 70 353 for license-details see LICENSE.txt that should come with iemmatrix.; #N canvas 477 377 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION decompose a matrix into symmetric and asymmetric parts, f 81; #X restore 394 388 pd META; #X obj 249 388 declare -lib iemmatrix; #X connect 0 0 4 0; #X connect 1 0 6 0; #X connect 1 1 9 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 8 0; #X connect 6 1 7 0; #X connect 10 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_symasym.pd000066400000000000000000000015371514557770000247140ustar00rootroot00000000000000#N canvas 0 0 493 363 10; #X declare -lib iemmatrix; #X obj 61 66 inlet matrix; #X obj 61 255 outlet symmetric; #X obj 105 229 outlet asymmetric; #X obj 105 136 mtx_transpose; #X obj 61 93 mtx_* 0.5; #X obj 61 229 mtx_+; #X obj 105 203 mtx_-; #X obj 61 115 t a a a; #X obj 105 158 t a a; #X text 23 19 mtx_symasym:: decompose a square matrix into a symmetric and an assymtric part; #X text 240 101 S=0.5*(M+M'); #X text 240 120 A=0.5*(M-M'); #X text 240 76 M=S+A; #X text 38 289 (c) 2005 by IOhannes m zmoelnig \, IEM KUG \, graz austria; #X text 38 306 for license-details see LICENSE.txt that should come with iemmatrix.; #X obj 235 336 declare -lib iemmatrix; #X connect 0 0 4 0; #X connect 3 0 8 0; #X connect 4 0 7 0; #X connect 5 0 1 0; #X connect 6 0 2 0; #X connect 7 0 5 0; #X connect 7 1 6 0; #X connect 7 2 3 0; #X connect 8 0 5 1; #X connect 8 1 6 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_tab-help.pd000066400000000000000000000034051514557770000247020ustar00rootroot00000000000000#N canvas 145 446 668 361 10; #X declare -lib iemmatrix; #X obj 133 198 mtx_tab \$0-table; #X obj 435 97 table \$0-table; #X obj 131 120 mtx_rand; #X obj 133 141 t a a; #X obj 173 141 mtx_print orig; #X obj 133 289 mtx_print outlet; #X obj 311 125 mtx_zeros; #X msg 311 105 3 4; #X obj 264 101 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X msg 131 99 2 3; #X msg 86 122 row 1; #X obj 258 243 print outlet; #X msg -1 122 row 1 1 2 3; #X text 478 4 part of iemmatrix; #X text 27 7 [mtx_tab]; #X text 92 28 is a matrix using a table for local/global storage of its data. for the full palette of matrix commands refer to the "mtx" help; #X text 487 158 see also:; #X obj 558 158 mtx; #X text 433 81 local table; #X obj 383 215 mtx_tab \$0-table; #X obj 383 260 mtx_print other; #X obj 383 237 mtx_+ 1; #X obj 383 193 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X msg 423 191 ones 1 3; #X obj 133 223 route matrix; #X obj 133 244 list prepend matrix; #X obj 133 267 list trim; #N canvas 793 461 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 13 44 DESCRIPTION matrix with a table to store its data, f 81; #X restore 594 28 pd META; #X obj 449 28 declare -lib iemmatrix; #X connect 0 0 24 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 3 1 4 0; #X connect 6 0 0 1; #X connect 7 0 6 0; #X connect 8 0 0 0; #X connect 9 0 2 0; #X connect 10 0 0 0; #X connect 12 0 0 0; #X connect 19 0 21 0; #X connect 21 0 20 0; #X connect 22 0 19 0; #X connect 23 0 19 0; #X connect 24 0 25 0; #X connect 24 1 11 0; #X connect 25 0 26 0; #X connect 26 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_tab.pd000066400000000000000000000052671514557770000237640ustar00rootroot00000000000000#N canvas 60 0 500 421 10; #X declare -lib iemmatrix; #X obj 33 154 inlet; #X obj 108 154 inlet; #X obj 33 358 outlet; #X text 345 160 part of iemmatrix.; #X text 348 215 see also:; #X obj 431 213 mtx; #X text 105 56 mtx_tab behaves just like a "mtx" object that stores its internal matrix in a table. So this matrix can be seen as a local/global variable of the workspace.; #X text 349 282 Franz Zotter 2006; #X text 105 6 [mtx_tab]; #N canvas 0 0 657 677 mtx_tab 0; #X obj 33 34 inlet; #X obj 287 86 inlet; #X obj 287 601 list prepend 0; #X obj 287 506 t a a; #X obj 412 561 *; #X msg 412 600 resize \$1; #X obj 33 438 outlet; #X obj 156 343 mtx; #X obj 156 75 t a b; #X obj 191 176 list prepend matrix; #X obj 191 196 list trim; #X obj 156 306 spigot; #X msg 218 305 0; #X msg 218 285 1; #X obj 412 581 + 2; #X text 329 625 send to table; #X text 298 159 get from table; #X obj 156 363 t b a; #X obj 191 411 spigot; #X msg 234 364 0; #X msg 263 364 1; #X obj 191 384 t a a; #N canvas 0 0 450 300 bang 0; #X obj 103 28 inlet; #X obj 103 59 route bang; #X obj 103 119 outlet; #X obj 103 92 b; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 1 1 2 0; #X connect 3 0 2 0; #X restore 197 255 pd bang; #X obj 156 217 t b b a b b; #X text 301 485 ...; #X obj 287 467 route matrix; #X msg 412 542 \$1 \$2; #X obj 33 94 list prepend matrix; #X obj 33 114 list trim; #X obj 33 75 t a a; #X obj 33 56 route matrix set; #X text 170 238 if no output: send to table anyway; #X obj 287 624 s; #X obj 201 105 symbol \$1; #X obj 447 464 loadbang; #X obj 447 484 symbol \$1; #X obj 191 156 array get \$1; #X obj 201 128 t s s; #X connect 0 0 30 0; #X connect 1 0 25 0; #X connect 2 0 32 0; #X connect 3 0 2 0; #X connect 3 1 26 0; #X connect 4 0 14 0; #X connect 5 0 32 0; #X connect 7 0 17 0; #X connect 8 0 23 0; #X connect 8 1 36 0; #X connect 9 0 10 0; #X connect 10 0 7 1; #X connect 11 0 7 0; #X connect 12 0 11 1; #X connect 13 0 11 1; #X connect 14 0 5 0; #X connect 17 0 12 0; #X connect 17 1 21 0; #X connect 18 0 6 0; #X connect 19 0 18 1; #X connect 20 0 18 1; #X connect 21 0 18 0; #X connect 21 1 25 0; #X connect 22 0 7 0; #X connect 23 0 11 0; #X connect 23 1 19 0; #X connect 23 2 22 0; #X connect 23 3 13 0; #X connect 23 4 20 0; #X connect 25 0 3 0; #X connect 26 0 4 0; #X connect 27 0 28 0; #X connect 28 0 6 0; #X connect 29 0 27 0; #X connect 29 1 3 0; #X connect 30 0 29 0; #X connect 30 1 33 0; #X connect 30 2 8 0; #X connect 33 0 37 0; #X connect 34 0 35 0; #X connect 35 0 32 1; #X connect 36 0 9 0; #X connect 37 0 32 1; #X connect 37 1 36 2; #X restore 33 327 pd mtx_tab; #X text 105 38 arguments: \$1 ... table name; #X obj 235 346 declare -lib iemmatrix; #X connect 0 0 9 0; #X connect 1 0 9 1; #X connect 9 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_win_besseli0.pd000066400000000000000000000071351514557770000255750ustar00rootroot00000000000000#N canvas 442 0 671 506 12; #X declare -lib iemmatrix; #X obj 181 110 mtx_< 2.5; #X obj 373 107 mtx_>= 2.5; #X obj 373 130 mtx_find; #X obj 181 132 mtx_find; #X obj 299 288 mtx_index; #X obj 100 286 mtx_index; #X obj 100 383 mtx_fill, f 44; #X obj 80 427 mtx; #X obj 80 41 t b a a a; #X obj 567 258 mtx_zeros; #X obj 567 101 mtx_size; #X obj 567 125 pack; #N canvas 0 0 897 561 smallx 0; #X obj 240 -115 mtx_.^ 2; #X obj 240 -73 mtx_+ 8.92003e-06; #X obj 240 -93 mtx_* 0.249877; #X obj 240 277 mtx_+; #X obj 272 -48 mtx_.^ 4; #X obj 304 1 mtx_.^ 6; #X obj 338 47 mtx_.^ 8; #X obj 370 98 mtx_.^ 10; #X obj 402 144 mtx_.^ 12; #X obj 272 -26 mtx_* -0.0153664; #X obj 304 23 mtx_* 0.00152453; #X obj 338 69 mtx_* -0.000134196; #X obj 370 120 mtx_* 7.76875e-06; #X obj 402 166 mtx_* -2.04329e-07; #X obj 272 256 mtx_+; #X obj 304 236 mtx_+; #X obj 338 217 mtx_+; #X obj 370 196 mtx_+; #X obj 240 -158 t a a a a a a; #X obj 240 302 mtx_exp; #X obj 241 -181 inlet; #X obj 240 333 outlet; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 0 19 0; #X connect 4 0 9 0; #X connect 5 0 10 0; #X connect 6 0 11 0; #X connect 7 0 12 0; #X connect 8 0 13 0; #X connect 9 0 14 0; #X connect 10 0 15 0; #X connect 11 0 16 0; #X connect 12 0 17 0; #X connect 13 0 17 1; #X connect 14 0 3 1; #X connect 15 0 14 1; #X connect 16 0 15 1; #X connect 17 0 16 1; #X connect 18 0 0 0; #X connect 18 1 4 0; #X connect 18 2 5 0; #X connect 18 3 6 0; #X connect 18 4 7 0; #X connect 18 5 8 0; #X connect 19 0 21 0; #X connect 20 0 18 0; #X restore 100 310 pd smallx; #X obj 299 82 t a a; #X obj 100 82 t a a; #N canvas 295 16 806 381 bigx 0; #X obj 227 -132 inlet; #X obj 226 132 outlet; #X text 391 -110 exp(x)./sqrt(2*pi*x).*(1+1./(8*x)); #X obj 277 23 mtx_.^ 0.5; #X obj 226 46 mtx_./; #X obj 226 -25 mtx_exp; #X obj 455 20 mtx_+ 1; #X obj 455 -2 mtx_.^ -1; #X obj 455 -24 mtx_* 8; #X obj 226 80 mtx_.*; #X obj 226 -49 t a a; #X obj 337 -47 atan; #X obj 337 -24 * 8; #X obj 337 -93 loadbang; #X obj 277 -1 mtx_* 1; #X obj 226 -109 t a a; #X msg 337 -70 1; #X connect 0 0 15 0; #X connect 3 0 4 1; #X connect 4 0 9 0; #X connect 5 0 4 0; #X connect 6 0 9 1; #X connect 7 0 6 0; #X connect 8 0 7 0; #X connect 9 0 1 0; #X connect 10 0 5 0; #X connect 10 1 14 0; #X connect 11 0 12 0; #X connect 12 0 14 1; #X connect 13 0 16 0; #X connect 14 0 3 0; #X connect 15 0 10 0; #X connect 15 1 8 0; #X connect 16 0 11 0; #X restore 299 312 pd bigx; #X obj 80 18 inlet; #X obj 80 456 outlet; #X obj 405 180 mtx_size; #X obj 299 242 spigot; #X obj 213 180 mtx_size; #X obj 100 234 spigot; #X obj 181 157 t a a; #X obj 181 235 spigot; #X obj 373 238 spigot; #X obj 205 456 declare -lib iemmatrix; #X obj 139 205 t a a, f 12; #X obj 181 260 t a a; #X obj 373 155 t a a; #X obj 338 207 t a a, f 11; #X obj 373 263 t a a; #X connect 0 0 3 0; #X connect 1 0 2 0; #X connect 2 0 28 0; #X connect 3 0 22 0; #X connect 4 0 15 0; #X connect 5 0 12 0; #X connect 6 0 7 1; #X connect 7 0 17 0; #X connect 8 0 7 0; #X connect 8 1 14 0; #X connect 8 2 13 0; #X connect 8 3 10 0; #X connect 9 0 6 1; #X connect 10 0 11 0; #X connect 10 1 11 1; #X connect 11 0 9 0; #X connect 12 0 6 0; #X connect 13 0 19 0; #X connect 13 1 1 0; #X connect 14 0 21 0; #X connect 14 1 0 0; #X connect 15 0 6 0; #X connect 16 0 8 0; #X connect 18 1 29 0; #X connect 19 0 4 0; #X connect 20 1 26 0; #X connect 21 0 5 0; #X connect 22 0 23 0; #X connect 22 1 20 0; #X connect 23 0 27 0; #X connect 24 0 30 0; #X connect 26 0 21 1; #X connect 26 1 23 1; #X connect 27 0 5 1; #X connect 27 1 6 2; #X connect 28 0 24 0; #X connect 28 1 18 0; #X connect 29 0 19 1; #X connect 29 1 24 1; #X connect 30 0 4 1; #X connect 30 1 6 2; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_window-help.pd000066400000000000000000000306111514557770000254420ustar00rootroot00000000000000#N canvas 187 140 841 379 10; #X declare -lib iemmatrix; #X text 483 27 part of iemmatrix; #N canvas 0 0 450 300 convert2tablemsg 0; #X obj 130 35 inlet; #X obj 169 216 outlet; #X obj 130 60 t a a; #X obj 160 82 mtx_size; #X obj 130 107 list split 3; #X obj 220 107 change; #X msg 220 129 resize \$1; #X obj 169 154 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 1 7 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X restore 33 284 pd convert2tablemsg; #N canvas 0 0 450 300 (subpatch) 0; #X array view_window 101 float 1; #A 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1; #X coords 0 1.1 100 0 101 80 1; #X restore 326 212 graph; #X text 43 34 [mtx_window]; #X text 166 69 creates a row vector with windows of different specifications.; #X text 271 157 outletB: window vector; #X obj 33 306 s view_window; #X text 268 138 inletA: ; #X msg 33 68 rectangular 101; #X msg 42 87 bartlett 101; #X msg 50 106 sine 101; #X msg 54 126 hamming 101; #X msg 60 147 hanning 101; #X msg 63 169 blackman 101; #X msg 71 189 gauss 101 -77; #X text 227 315 note: the third parameter for gaussian windows describes the attenuation at the borders; #X text 480 241 use this e.g. for:; #X msg 80 216 kaiser 101 \$1; #X obj 33 242 mtx_window; #X msg 174 187 0; #X msg 296 188 10; #X msg 266 188 8; #X msg 235 188 5; #X msg 204 188 2; #N canvas 625 163 842 574 fft_analysis 0; #X msg 507 110 sine 64; #X msg 507 152 hanning 64; #X msg 505 69 rectangular 64; #X obj 491 270 s array1; #N canvas 0 0 450 300 mtx2arraysend 0; #X obj 150 16 inlet; #X obj 148 254 outlet; #X obj 170 64 t a a; #X obj 204 85 mtx_size; #X msg 205 129 resize \$1; #X obj 205 108 change; #X obj 172 149 list split 3; #X obj 170 169 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 0 1 0; #X connect 5 0 4 0; #X connect 6 1 7 0; #X connect 7 0 1 0; #X restore 491 247 pd mtx2arraysend; #X obj 415 360 mtx_.*; #X obj 415 386 mtx_rowrfft; #X obj 415 408 mtx_.^ 2; #X obj 487 409 mtx_.^ 2; #X obj 415 430 mtx_+; #X obj 415 493 mtx_powtodb; #N canvas 0 0 450 300 mtx2arraysend 0; #X obj 150 16 inlet; #X obj 148 254 outlet; #X obj 170 64 t a a; #X obj 204 85 mtx_size; #X msg 205 129 resize \$1; #X obj 205 108 change; #X obj 172 149 list split 3; #X obj 170 169 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 0 1 0; #X connect 5 0 4 0; #X connect 6 1 7 0; #X connect 7 0 1 0; #X restore 415 514 pd mtx2arraysend; #N canvas 51 277 419 406 normalize 0; #X obj 107 27 inlet; #X obj 107 360 outlet; #X obj 227 117 mtx_sum; #X obj 227 96 mtx_transpose; #X obj 129 97 mtx_transpose; #X obj 129 118 mtx_.^ 2; #X obj 128 139 mtx_sum; #X obj 128 160 sqrt; #X obj 340 20 inlet; #X obj 129 226 f; #X obj 107 66 t a a a; #X obj 107 295 mtx; #X obj 107 328 mtx_./ 1; #X obj 119 199 t b b b f; #N canvas 735 459 450 300 mux 0; #X obj 51 40 inlet #0; #X obj 51 63 list prepend 0; #X obj 151 40 inlet #1; #X obj 151 63 list prepend 1; #X obj 51 126 route 0; #X obj 51 149 outlet data; #X obj 266 40 inlet #in; #X connect 0 0 1 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 6 0 4 1; #X restore 152 295 pd mux; #X obj 227 227 f; #X connect 0 0 10 0; #X connect 2 0 15 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 9 0; #X connect 8 0 13 0; #X connect 9 0 14 0; #X connect 10 0 11 0; #X connect 10 1 4 0; #X connect 10 2 3 0; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 11 0; #X connect 13 1 9 0; #X connect 13 2 15 0; #X connect 13 3 14 2; #X connect 14 0 12 1; #X connect 15 0 14 1; #X restore 424 340 pd normalize; #X msg 506 90 bartlett 64; #X msg 507 131 hamming 64; #X msg 507 173 blackman 64; #X obj 415 472 mtx_+; #X obj 504 320 tgl 15 1 empty empty broad/narrow 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X obj 67 463 dbtorms; #X obj 71 427 hsl 128 15 0 127 0 1 empty empty ampl -2 -6 0 12 #fcfcfc #000000 #000000 0 1; #X floatatom 68 446 5 0 0 0 - - - 0; #X obj 109 307 dbtorms; #X obj 113 271 hsl 128 15 0 127 0 1 empty empty ampl -2 -6 0 10 #fcfcfc #000000 #000000 9900 1; #X floatatom 110 290 5 0 0 0 - - - 0; #N canvas 0 0 450 300 (subpatch) 0; #X array spectrum 129 float 1; #A 0 56.377 77.3304 80.1692 76.3056 66.8052 80.5651 82.465 74.9327 82.4891 91.8709 96.2977 98.4686 99.0234 98.1252 95.6622 91.1155 82.4891 66.9537 78.6591 77.4688 68.019 67.7708 73.5005 71.7182 60.2204 65.3425 69.9818 67.9057 54.6513 63.1717 67.3292 65.0647 50.2597 61.3407 65.221 62.8226 46.6091 59.7915 63.4904 60.9916 43.4733 58.4672 62.0381 59.4612 40.7174 57.3238 60.7997 58.1604 38.2504 56.3288 59.7315 57.0415 36.0149 55.4562 58.8013 56.0695 33.9678 54.6867 57.9852 55.2182 32.0684 54.0057 57.2658 54.4691 30.298 53.4006 56.6287 53.8066 28.6325 52.8621 56.063 53.2186 27.0424 52.3832 55.5605 52.6966 25.5223 51.9567 55.1137 52.2326 24.0564 51.5776 54.7167 51.8203 22.6263 51.2422 54.3654 51.4551 21.2226 50.9464 54.0553 51.1324 19.8274 50.6876 53.7836 50.849 18.4236 50.4638 53.5478 50.6023 16.9878 50.2726 53.3455 50.3899 15.5157 50.1124 53.175 50.2099 14.0048 49.9819 53.0348 50.0604 12.4079 49.8806 52.9241 49.9408 10.7623 49.8072 52.8418 49.8498 9.20872 49.7614 52.7872 49.7866 7.94681 49.7429 52.7602 49.7513 7.39902; #X array sineamp 129 float 1; #A 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99; #X array noiseamp 129 float 1; #A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; #X coords 0 100 128 0 200 140 1; #X restore 81 59 graph; #X obj 163 308 s sineamp; #X msg 163 288 const \$1; #X msg 121 443 const \$1; #X obj 121 463 s noiseamp; #X obj 415 452 mtx_* 0.1; #X obj 492 451 mtx_* 0.9; #X obj 532 491 loadbang; #X msg 532 513 ylabel -2 0 20 40 60 80 100 \, yticks 0 10 2; #X msg 562 452 xlabel -10 narrowband_dB; #X msg 626 429 xlabel -10 broadband_dB; #X obj 562 429 sel 1 0; #X text 25 243 1 choose sine/frequency+amplitude; #N canvas 61 0 443 338 mtx_oscillator 0; #X obj 84 12 inlet; #X obj 68 308 outlet; #X obj 68 131 f; #X obj 14 29 bang~; #X obj 183 27 loadbang; #X obj 183 69 mtx_:; #X obj 298 6 loadbang; #X msg 298 26 1; #X obj 297 46 atan; #X obj 68 245 mtx_* 1; #X obj 68 266 mtx_cos; #X obj 297 67 * 8; #X msg 183 49 0 63; #X obj 120 69 /; #X obj 68 201 mtx_* 1; #X obj 68 179 mtx; #N canvas 576 37 450 300 accumulate_modulo 0; #X obj 148 33 inlet; #X obj 148 232 outlet; #X obj 148 107 mtx_mod 1; #X obj 148 129 t a a; #X obj 249 33 inlet df; #X obj 188 129 mtx_slice 1 end 1 end; #X msg 339 129 \$3; #X obj 192 65 +; #X obj 148 86 mtx_+ 0; #X connect 0 0 8 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 3 1 5 0; #X connect 4 0 7 1; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 8 1; #X connect 8 0 2 0; #X restore 68 223 pd accumulate_modulo; #X obj 68 155 t b f f; #X msg 121 50 1 64; #X obj 121 31 loadbang; #X obj 84 108 *; #X obj 68 288 mtx_* 2; #X connect 0 0 20 0; #X connect 2 0 17 0; #X connect 3 0 2 0; #X connect 4 0 12 0; #X connect 5 0 15 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 9 0 10 0; #X connect 10 0 21 0; #X connect 11 0 9 1; #X connect 12 0 5 0; #X connect 13 0 20 1; #X connect 14 0 16 0; #X connect 15 0 14 0; #X connect 16 0 9 0; #X connect 17 0 15 0; #X connect 17 1 14 1; #X connect 17 2 16 1; #X connect 18 0 13 0; #X connect 19 0 18 0; #X connect 20 0 2 1; #X connect 21 0 1 0; #X restore 22 329 pd mtx_oscillator; #X obj 22 349 mtx_* 0; #X obj 415 313 mtx_+; #X text 23 378 2 choose sine/frequency+amplitude; #X obj 23 486 mtx_* 0; #N canvas 0 0 450 300 mtx_noise~ 0; #X obj 180 137 mtx_* 2; #X obj 180 158 mtx_- 1; #X obj 323 116 loadbang; #X msg 323 140 3; #X obj 323 162 sqrt; #X obj 180 204 mtx_* 1; #X obj 180 235 outlet; #X obj 180 85 bang~; #X obj 180 106 mtx_rand 1 64; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 1; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 8 0 0 0; #X restore 23 396 pd mtx_noise~; #X text 373 71 3 choose window; #X text 373 290 4 choose broadband/narrow band normalization; #N canvas 0 0 450 300 mtx2arraysend 0; #X obj 150 16 inlet; #X obj 148 254 outlet; #X obj 170 64 t a a; #X obj 204 85 mtx_size; #X msg 205 129 resize \$1; #X obj 205 108 change; #X obj 172 149 list split 3; #X obj 170 169 list prepend 0; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 2 1 3 0; #X connect 3 1 5 0; #X connect 4 0 1 0; #X connect 5 0 4 0; #X connect 6 1 7 0; #X connect 7 0 1 0; #X restore 499 365 pd mtx2arraysend; #X floatatom 59 273 6 0 0 0 freq - - 0; #N canvas 0 0 450 300 (subpatch) 0; #X array signal 64 float 1; #A 0 0.332393 -0.190103 -0.696238 -1.14245 -1.49035 -1.70998 -1.78244 -1.70151 -1.47414 -1.1199 -0.669277 -0.161057 0.361022 0.852032 1.26971 1.57812 1.75071 1.77263 1.642 1.37004 0.980184 0.505969 -0.0117945 -0.528541 -0.999799 -1.38501 -1.65103 -1.77496 -1.74612 -1.56702 -1.25305 -0.831239 -0.337892 0.184535 0.69108 1.13815 1.48727 1.70839 1.78248 1.70317 1.47728 1.12425 0.674464 0.166635 -0.355539 -0.847111 -1.26578 -1.57551 -1.74965 -1.77321 -1.64417 -1.37362 -0.984858 -0.511333 0.00619539 0.52319 0.995158 1.38148 1.64891 1.77443 1.74724 1.56968 1.25702 0.836189; #X coords 0 2 63 -2 200 140 1; #X restore 619 44 graph; #X obj 415 537 s spectrum; #X obj 499 388 s signal; #X msg 562 388 ylabel -2 0 -2 -1 0 1 2 \, yticks 0 0.5 2; #X obj 618 364 loadbang; #X obj 146 347 loadbang; #X obj 504 47 loadbang; #X msg 147 328 2.999; #X obj 241 463 mtx_resize 0 256; #X msg 502 197 gauss 64 -85; #X obj 491 223 mtx_window; #X msg 680 240 kaiser 64 \$1; #X msg 679 206 0; #X msg 773 206 8; #X msg 743 206 5; #X msg 807 205 10; #X msg 712 206 2; #X obj 311 120 tgl 18 0 empty \$0-dsp_tgl empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X msg 311 143 \; pd dsp 1; #X connect 0 0 57 0; #X connect 1 0 57 0; #X connect 2 0 57 0; #X connect 4 0 3 0; #X connect 5 0 55 0; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 9 0; #X connect 8 0 9 1; #X connect 9 0 29 0; #X connect 10 0 11 0; #X connect 11 0 48 0; #X connect 12 0 5 1; #X connect 13 0 57 0; #X connect 14 0 57 0; #X connect 15 0 57 0; #X connect 16 0 10 0; #X connect 16 0 30 0; #X connect 17 0 12 1; #X connect 17 0 35 0; #X connect 18 0 41 1; #X connect 19 0 20 0; #X connect 20 0 18 0; #X connect 20 0 27 0; #X connect 21 0 38 1; #X connect 22 0 23 0; #X connect 23 0 21 0; #X connect 23 0 26 0; #X connect 26 0 25 0; #X connect 27 0 28 0; #X connect 29 0 16 0; #X connect 30 0 16 1; #X connect 31 0 32 0; #X connect 32 0 48 0; #X connect 33 0 48 0; #X connect 34 0 48 0; #X connect 35 0 33 0; #X connect 35 1 34 0; #X connect 37 0 38 0; #X connect 38 0 39 0; #X connect 39 0 5 0; #X connect 39 0 45 0; #X connect 41 0 39 1; #X connect 42 0 41 0; #X connect 45 0 49 0; #X connect 46 0 37 0; #X connect 50 0 49 0; #X connect 51 0 50 0; #X connect 52 0 54 0; #X connect 53 0 2 0; #X connect 54 0 46 0; #X connect 55 0 6 0; #X connect 56 0 57 0; #X connect 57 0 4 0; #X connect 57 0 12 0; #X connect 58 0 57 0; #X connect 59 0 58 0; #X connect 60 0 58 0; #X connect 61 0 58 0; #X connect 62 0 58 0; #X connect 63 0 58 0; #X connect 64 0 65 0; #X restore 616 242 pd fft_analysis; #N canvas 477 377 550 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 11 43 DESCRIPTION create a row vector with window functions of different specifications, f 82; #X restore 574 358 pd META; #X obj 369 358 declare -lib iemmatrix; #X connect 1 0 6 0; #X connect 8 0 18 0; #X connect 9 0 18 0; #X connect 10 0 18 0; #X connect 11 0 18 0; #X connect 12 0 18 0; #X connect 13 0 18 0; #X connect 14 0 18 0; #X connect 17 0 18 0; #X connect 18 0 1 0; #X connect 19 0 17 0; #X connect 20 0 17 0; #X connect 21 0 17 0; #X connect 22 0 17 0; #X connect 23 0 17 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/abs/mtx_window.pd000066400000000000000000000144451514557770000245230ustar00rootroot00000000000000#N canvas 400 0 1130 500 10; #X declare -lib iemmatrix; #X obj 41 9 inlet; #N canvas 404 130 450 300 scale_-1...1 0; #X obj 126 -4 inlet; #X obj 129 274 outlet; #X obj 157 50 t f f; #X obj 157 228 mtx_linspace; #X msg 157 89 1 \$1; #X obj 157 108 /; #X msg 157 128 1 \$1; #X obj 157 148 -; #X obj 157 168 t f f; #X obj 157 187 * -1; #X obj 157 207 pack f f f; #X obj 157 70 << 1; #X msg 64 50 matrix 1 1 0; #X obj 126 21 moses 2; #X connect 0 0 13 0; #X connect 2 0 11 0; #X connect 2 1 10 2; #X connect 3 0 1 0; #X connect 4 0 5 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 8 1 10 1; #X connect 9 0 10 0; #X connect 10 0 3 0; #X connect 11 0 4 0; #X connect 12 0 1 0; #X connect 13 0 12 0; #X connect 13 1 2 0; #X restore 48 88 pd scale_-1...1; #X obj 48 262 mtx_* 1; #N canvas 0 0 450 300 pi 0; #X obj 217 64 inlet; #X msg 217 84 1; #X obj 217 106 atan; #X obj 217 127 * 4; #X obj 217 148 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 92 220 pd pi; #X obj 92 240 / 2; #X obj 92 200 loadbang; #X obj 48 286 mtx_cos; #X obj 48 309 mtx_.^ 2; #X obj 48 65 t f b; #X msg 90 110 0; #X obj 112 262 mtx_* 1; #N canvas 0 0 450 300 pi 0; #X obj 217 64 inlet; #X msg 217 84 1; #X obj 217 106 atan; #X obj 217 127 * 4; #X obj 217 148 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 156 220 pd pi; #X obj 156 240 / 2; #X obj 156 200 loadbang; #X obj 112 286 mtx_cos; #X obj 87 65 t f b; #X msg 119 110 1; #X msg 151 110 2; #X obj 127 65 t f b a; #X obj 198 285 mtx_* 1; #X obj 259 265 *; #X obj 298 206 loadbang; #X msg 298 226 10; #X obj 298 246 log; #X obj 198 307 mtx_exp; #X msg 259 227 \$2; #X obj 259 246 / 20; #X obj 127 337 mtx_ones; #X msg 127 317 1 \$1; #X obj 198 261 mtx_.^ 2; #X obj 112 448 outlet; #X obj 181 65 t f b; #X msg 183 109 3; #X obj 356 265 mtx_abs; #X obj 356 285 mtx_* -1; #X obj 356 306 mtx_+ 1; #X obj 419 260 mtx_* 1; #N canvas 0 0 450 300 pi 0; #X obj 217 64 inlet; #X msg 217 84 1; #X obj 217 106 atan; #X obj 217 127 * 4; #X obj 217 148 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 463 218 pd pi; #X obj 463 238 / 2; #X obj 463 198 loadbang; #X obj 419 284 mtx_cos; #X obj 419 307 mtx_.^ 2; #X obj 221 65 t f b; #X msg 223 109 4; #X obj 419 350 mtx_./ 1.08; #X obj 419 328 mtx_+ 0.08; #X obj 260 65 t f b; #X msg 264 109 5; #X text 24 147 hanning; #X text 62 162 sine; #X text 131 160 rect; #X text 173 161 hamming; #X obj 579 235 mtx_* 1; #N canvas 0 0 450 300 pi 0; #X obj 217 64 inlet; #X msg 217 84 1; #X obj 217 106 atan; #X obj 217 127 * 4; #X obj 217 148 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 623 213 pd pi; #X obj 623 193 loadbang; #X obj 609 296 mtx_cos; #X text 188 150 blackman; #X obj 541 359 mtx_+ 0.42; #X obj 579 257 t a a; #X obj 609 277 mtx_* 2; #X obj 541 297 mtx_cos; #X obj 609 317 mtx_* 0.08; #X obj 541 317 mtx_* 0.5; #X obj 541 338 mtx_+; #X text 625 46 part of iemmatrix; #X text 549 412 Franz Zotter 2006; #X text 93 149 gauss; #X obj 48 32 route hanning sine gauss rectangular bartlett hamming blackman kaiser; #X obj 303 67 t f b a; #X msg 301 109 6; #N canvas 1059 432 430 404 kaiser 0; #X obj 43 41 inlet; #X obj 232 44 inlet; #X obj 43 362 outlet; #X obj 43 248 mtx_win_besseli0; #X obj 43 327 mtx_./ 1; #X obj 43 159 mtx_* 1; #X obj 43 74 mtx_.^ 2; #X obj 43 95 mtx_* -1; #X obj 43 116 mtx_+ 1; #X obj 43 137 mtx_.^ 0.5; #X msg 232 227 \$3; #X msg 232 65 \$2; #X msg 232 180 matrix 1 1 \$1; #X obj 232 204 mtx_win_besseli0; #X connect 0 0 6 0; #X connect 1 0 11 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 5 0 3 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 5 0; #X connect 10 0 4 1; #X connect 11 0 5 1; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 10 0; #X restore 704 317 pd kaiser; #N canvas 735 459 558 300 demux 0; #X obj 62 53 inlet data; #X obj 143 53 inlet #out; #X obj 62 76 list prepend 0; #X obj 62 99 route 0 1 2 3 4 5 6; #X obj 62 194 outlet #0; #X obj 132 194 outlet #1; #X obj 202 194 outlet #2; #X obj 272 194 outlet #3; #X obj 342 194 outlet #4; #X obj 412 194 outlet #5; #X obj 482 194 outlet #6; #X connect 0 0 2 0; #X connect 1 0 2 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 1 5 0; #X connect 3 2 6 0; #X connect 3 3 7 0; #X connect 3 4 8 0; #X connect 3 5 9 0; #X connect 3 6 10 0; #X restore 48 131 pd demux; #X f 19; #X obj 545 446 declare -lib iemmatrix; #X connect 0 0 67 0; #X connect 1 0 71 0; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 4 0 2 1; #X connect 5 0 3 0; #X connect 6 0 7 0; #X connect 7 0 30 0; #X connect 8 0 1 0; #X connect 8 1 9 0; #X connect 9 0 71 1; #X connect 10 0 14 0; #X connect 11 0 12 0; #X connect 12 0 10 1; #X connect 13 0 11 0; #X connect 14 0 30 0; #X connect 15 0 1 0; #X connect 15 1 16 0; #X connect 16 0 71 1; #X connect 17 0 71 1; #X connect 18 0 1 0; #X connect 18 1 17 0; #X connect 18 2 25 0; #X connect 19 0 24 0; #X connect 20 0 19 1; #X connect 21 0 22 0; #X connect 22 0 23 0; #X connect 23 0 20 1; #X connect 24 0 30 0; #X connect 25 0 26 0; #X connect 26 0 20 0; #X connect 27 0 30 0; #X connect 28 0 27 0; #X connect 29 0 19 0; #X connect 31 0 1 0; #X connect 31 1 32 0; #X connect 32 0 71 1; #X connect 33 0 34 0; #X connect 34 0 35 0; #X connect 35 0 30 0; #X connect 36 0 40 0; #X connect 37 0 38 0; #X connect 38 0 36 1; #X connect 39 0 37 0; #X connect 40 0 41 0; #X connect 41 0 45 0; #X connect 42 0 1 0; #X connect 42 1 43 0; #X connect 43 0 71 1; #X connect 44 0 30 0; #X connect 45 0 44 0; #X connect 46 0 1 0; #X connect 46 1 47 0; #X connect 47 0 71 1; #X connect 52 0 58 0; #X connect 53 0 52 1; #X connect 54 0 53 0; #X connect 55 0 61 0; #X connect 57 0 30 0; #X connect 58 0 60 0; #X connect 58 1 59 0; #X connect 59 0 55 0; #X connect 60 0 62 0; #X connect 61 0 63 1; #X connect 62 0 63 0; #X connect 63 0 57 0; #X connect 67 0 8 0; #X connect 67 1 15 0; #X connect 67 2 18 0; #X connect 67 3 28 0; #X connect 67 4 31 0; #X connect 67 5 42 0; #X connect 67 6 46 0; #X connect 67 7 68 0; #X connect 68 0 1 0; #X connect 68 1 69 0; #X connect 68 2 70 1; #X connect 69 0 71 1; #X connect 70 0 30 0; #X connect 71 0 2 0; #X connect 71 1 10 0; #X connect 71 2 29 0; #X connect 71 3 33 0; #X connect 71 4 36 0; #X connect 71 5 52 0; #X connect 71 6 70 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/000077500000000000000000000000001514557770000223135ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/README000066400000000000000000000001711514557770000231720ustar00rootroot00000000000000 G.Holzmann: I made this alias directory for Pd-extended, so that the aliases for the single file externals will work ! iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/matrix_mul_line~.c000066400000000000000000000001351514557770000260440ustar00rootroot00000000000000#include "../src/mtx_mul~.c" void matrix_mul_line_tilde_setup() { mtx_mul_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/matrix_mul~.c000066400000000000000000000001301514557770000250300ustar00rootroot00000000000000#include "../src/mtx_mul~.c" void matrix_mul_tilde_setup() { mtx_mul_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/matrix~.c000066400000000000000000000001241514557770000241560ustar00rootroot00000000000000#include "../src/mtx_mul~.c" void matrix_tilde_setup() { mtx_mul_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx.c000066400000000000000000000001021514557770000232600ustar00rootroot00000000000000#include "../src/matrix.c" void mtx_setup() { matrix_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x21.c000066400000000000000000000001361514557770000240410ustar00rootroot00000000000000// alias for [mtx_!] #include "../src/mtx_not.c" void mtx_0x21_setup() { mtx_not_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x210x3d.c000066400000000000000000000001431514557770000245360ustar00rootroot00000000000000// alias for [mtx_!=] #include "../src/mtx_neq.c" void mtx_0x210x3d_setup() { mtx_neq_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x26.c000066400000000000000000000001441514557770000240450ustar00rootroot00000000000000// alias for [mtx_&] #include "../src/mtx_bitand.c" void mtx_0x26_setup() { mtx_bitand_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x260x26.c000066400000000000000000000001431514557770000244640ustar00rootroot00000000000000// alias for [mtx_&&] #include "../src/mtx_and.c" void mtx_0x260x26_setup() { mtx_and_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2a.c000066400000000000000000000001361514557770000241210ustar00rootroot00000000000000// alias for [mtx_*] #include "../src/mtx_mul.c" void mtx_0x2a_setup() { mtx_mul_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2a0x7e.c000066400000000000000000000001521514557770000246230ustar00rootroot00000000000000// alias for [mtx_*~] #include "../src/mtx_mul~.c" void mtx_0x2a0x7e_setup() { mtx_mul_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2b.c000066400000000000000000000001361514557770000241220ustar00rootroot00000000000000// alias for [mtx_+] #include "../src/mtx_add.c" void mtx_0x2b_setup() { mtx_add_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2d.c000066400000000000000000000001361514557770000241240ustar00rootroot00000000000000// alias for [mtx_-] #include "../src/mtx_sub.c" void mtx_0x2d_setup() { mtx_sub_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2e0x2a.c000066400000000000000000000001431514557770000246160ustar00rootroot00000000000000// alias for [mtx_.*] #include "../src/mtx_mul.c" void mtx_0x2e0x2a_setup() { mtx_mul_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2e0x2f.c000066400000000000000000000001151514557770000246220ustar00rootroot00000000000000#include "../src/mtx_mul.c" void mtx_0x2e0x2f_setup() { mtx_div_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2e0x5e.c000066400000000000000000000001421514557770000246240ustar00rootroot00000000000000// alias for [mtx.^] #include "../src/mtx_pow.c" void mtx_0x2e0x5e_setup() { mtx_pow_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x2f.c000066400000000000000000000001111514557770000241170ustar00rootroot00000000000000#include "../src/mtx_mul.c" void mtx_0x2f_setup() { mtx_div_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3a.c000066400000000000000000000001421514557770000241170ustar00rootroot00000000000000// alias for [mtx_:] #include "../src/mtx_colon.c" void mtx_0x3a_setup() { mtx_colon_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3c.c000066400000000000000000000001341514557770000241220ustar00rootroot00000000000000// alias for [mtx_<] #include "../src/mtx_lt.c" void mtx_0x3c_setup() { mtx_lt_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3c0x3c.c000066400000000000000000000001531514557770000246210ustar00rootroot00000000000000// alias for [mtx_<<] #include "../src/mtx_bitleft.c" void mtx_0x3c0x3c_setup() { mtx_bitleft_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3c0x3d.c000066400000000000000000000001411514557770000246170ustar00rootroot00000000000000// alias for [mtx_<=] #include "../src/mtx_le.c" void mtx_0x3c0x3d_setup() { mtx_le_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3d0x3d.c000066400000000000000000000001411514557770000246200ustar00rootroot00000000000000// alias for [mtx_==] #include "../src/mtx_eq.c" void mtx_0x3d0x3d_setup() { mtx_eq_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3e.c000066400000000000000000000001341514557770000241240ustar00rootroot00000000000000// alias for [mtx_>] #include "../src/mtx_gt.c" void mtx_0x3e_setup() { mtx_gt_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3e0x3d.c000066400000000000000000000001411514557770000246210ustar00rootroot00000000000000// alias for [mtx_>=] #include "../src/mtx_ge.c" void mtx_0x3e0x3d_setup() { mtx_ge_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x3e0x3e.c000066400000000000000000000001551514557770000246270ustar00rootroot00000000000000// alias for [mtx_>>] #include "../src/mtx_bitright.c" void mtx_0x3e0x3e_setup() { mtx_bitright_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x7c.c000066400000000000000000000001421514557770000241250ustar00rootroot00000000000000// alias for [mtx_|] #include "../src/mtx_bitor.c" void mtx_0x7c_setup() { mtx_bitor_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_0x7c0x7c.c000066400000000000000000000001411514557770000246260ustar00rootroot00000000000000// alias for [mtx_||] #include "../src/mtx_or.c" void mtx_0x7c0x7c_setup() { mtx_or_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/alias/mtx_div.c000066400000000000000000000000341514557770000241260ustar00rootroot00000000000000#include "../src/mtx_mul.c" iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/000077500000000000000000000000001514557770000240735ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/_index.md000066400000000000000000000026641514557770000256730ustar00rootroot00000000000000--- title: "iemmatrix" draft: false --- # iemmatrix `iemmatrix` is a collection of objects for [Pure Data (Pd)](https://puredata.info) for manipulation of simple (two dimensional, real valued) matrices. Objects names are modelled after functions found in math toolboxes like [GNU Octave ](https://octave.org/), [Matlab](https://www.mathworks.com/products/matlab.html) or [NumPy](https://numpy.org/), using Pd's patching pardigm. ![example iemmatrix patch](example.pd.svg) ## Documentation - [List of objects](/objects) - [Tutorials](/tutorials) ## Installation `iemmatrix` is available on [deken](https://deken.puredata.info/library/iemmatrix) (Pd's built-in package manager). 1. Open the **Find externals...** menu 2. Type `iemmatrix` and press return 3. Select the best (e.g. topmost) installation candidate and click **Install**. Linux users on Debian (or derivatives, like Ubuntu) can also install it via ```sh apt-get install pd-iemmatrix ``` ## Reporting Bugs & Requesting Features Please use our [bug tracker](https://git.iem.at/pd/iemmatrix/-/issues) if things go awry. For general questions, please use the [Pure Data mailinglist](https://lists.iem.at/postorius/lists/pd-list.lists.iem.at/). ## Code The source code for `iemmatrix` is hosted on https://git.iem.at/pd/iemmatrix/ ## License `iemmatrix` is licensed under the [GNU General Public License (version 2, or later)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/example.pd000066400000000000000000000006101514557770000260500ustar00rootroot00000000000000#N struct 1004-element float x float y float v float c; #N canvas 2442 253 243 270 12; #X msg 7 10 bang; #X obj 7 35 mtx_rand 5 5; #X obj 7 115 mtx_inverse; #X obj 7 140 mtx_*, f 14; #X obj 7 85 t a a, f 14; #X obj 7 59 mtx_+ 1; #X obj 7 165 mtx_show; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 2 0 3 0; #X connect 3 0 6 0; #X connect 4 0 2 0; #X connect 4 1 3 1; #X connect 5 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/example.pd.svg000066400000000000000000000324741514557770000266630ustar00rootroot00000000000000 bang mtx_rand 5 5 mtx_inverse mtx_+ 1 mtx_show 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 mtx_* t a a iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/000077500000000000000000000000001514557770000255245ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/_index.md000066400000000000000000000004771514557770000273240ustar00rootroot00000000000000--- title: "List of objects" shorttitle: object reference pdcategories: - General - Matrix Creation - Matrix Transformation - Matrix Math - Element Math - Digital Fourier Transformation - Coordinates - Spherical Harmonics - Misc - Audio Math - Obsolete draft: false --- The following is a list of `iemmatrix` objects. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/matrix.md000066400000000000000000000051371514557770000273600ustar00rootroot00000000000000--- title: matrix description: store/create/manipulate a 2d matrix categories: - object pdcategory: General aliases: - mtx see_also: - mtx_ones - mtx_zeros - mtx_diag - mtx_diegg - mtx_eye - mtx_egg - mtx_col - mtx_element - mtx_row inlets: 1st: - type: matrix description: store and output the matrix - type: bang description: output the stored matrix 2nd: - type: matrix description: store the matrix outlets: 1st: - type: matrix description: the stored matrix # FIXXME: arguments is not a second argument but an alternative # we need a better way to express this arguments: - type: description: number of rows & number of columns - type: description: file name to read matrix from --- ## matrix store {{< pdobj mtx >}} stores a single matrix, just like {{< pdobj float >}} stores a single number. You can also save the stored matrix to a file via the message {{< pdmsg write "" >}} to the matrix, or load a matrix via {{< pdmsg read "" >}} from a file. ## matrix creation It can also be used to create special matrices using the following messages: | message | result | related object | |---------|--------------------------|--------------------------| | `zeros` | all zeros | {{< pdobj mtx_zeros >}} | | `ones` | all ones | {{< pdobj mtx_ones >}} | | `eye` | identity matrix | {{< pdobj mtx_eye >}} | | `egg` | backward identity matrix | {{< pdobj mtx_egg >}} | | `diag` | diagonal matrix | {{< pdobj mtx_diag >}} | | `diegg` | backward diagonal matrix | {{< pdobj mtx_diegg >}} | | `size` | silently resize matrix | {{< pdobj mtx_resize >}} | ## matrix manipulation Finally you can query and change the contents of a matrix: | message | result | related object | |-----------|-------------------------|---------------------------| | `row` | get/set *n*th row | {{< pdobj mtx_row >}} | | `col` | get/set *m*th column | {{< pdobj mtx_col >}} | | `element` | get/set element *(n,m)* | {{< pdobj mtx_element >}} | # the {{}} message The {{< pdobj matrix >}} object understands (and emits) {{}} messages. This message describes a 2d matrix and has the form > {{" "" "" "..." >}} The *entries* are a list of \\(rows * columns\\) float atoms in row-major order. E.g. $$ \texttt{[matrix\quad 3 2\quad 10 20 \thinspace 30 40 \thinspace 50 60(} \to \begin{pmatrix} 10 & 20 \cr 30 & 40 \cr 50 & 60 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/matrix~.md000066400000000000000000000010241514557770000275450ustar00rootroot00000000000000--- title: matrix~ description: matrix multiplication of signals (with interpolation) categories: - object pdcategory: Obsolete see_also: - mtx_*~ inlets: 0..M-1: - type: signal description: input signals M: - type: matrix description: matrix to multiply input signals with M+1: - type: float description: interpolation time outlets: 0..N-1: - type: signal description: output signals --- This object is obsolete. It shouldn't be used in new code anymore. Please use {{< pdobj "mtx_*~" >}} instead. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_.cabs2.md000066400000000000000000000010761514557770000300120ustar00rootroot00000000000000--- title: mtx_.cabs2 description: element-wise absolute value of complex-valued matrix categories: - object pdcategory: Element Math see_also: - mtx_.cdiv - mtx_.cmul - mtx_cabs2 - mtx_cinverse - mtx_cmul inlets: 1st: - type: matrix description: real part of input matrix (A) 2nd: - type: matrix description: imaginary part of input matrix (B) outlets: 1st: - type: matrix description: absolute values of A+jB --- $$C_{m\times n} = (A_{m\times n}+jB_{m\times n})^{|\circ|} \quad \equiv \quad c_{hi} = |a_{hi}+j{b_{hi}}| = \sqrt{a^2_{hi}+b^2_{hi}}$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_.cdiv.md000066400000000000000000000015731514557770000277470ustar00rootroot00000000000000--- title: mtx_.cdiv description: element-wise division of complex-valued matrix categories: - object pdcategory: Element Math see_also: - mtx_.cabs2 - mtx_.cmul - mtx_cabs2 - mtx_cinverse - mtx_cmul - mtx_./ inlets: 1st: - type: matrix description: real part of 1st input matrix (A) 2nd: - type: matrix description: imaginary part of 1st input matrix (B) 3rd: - type: matrix description: real part of 2nd input matrix (C) 4th: - type: matrix description: imaginary part of 2nd input matrix (D) outlets: 1st: - type: matrix description: real part of element-wise division of (A+jB)./(C+jD) 2nd: - type: matrix description: imaginary part of element-wise division of (A+jB)./(C+jD) --- $$X_{m\times n} = (A_{m\times n}+jB_{m\times n}) \oslash (C_{m\times n}+jD_{m\times n}) \quad \equiv \quad x_{hi} = (a_{hi}+j{b_{hi}})/(c_{hi}+j{d_{hi}})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_.cmul.md000066400000000000000000000017401514557770000277560ustar00rootroot00000000000000--- title: mtx_.cmul description: element-wise multiplication of complex-valued matrix categories: - object pdcategory: Element Math see_also: - mtx_.cabs2 - mtx_.cdiv - mtx_cabs2 - mtx_cinverse - mtx_cmul inlets: 1st: - type: matrix description: real part of 1st input matrix (A) 2nd: - type: matrix description: imaginary part of 1st input matrix (B) 3rd: - type: matrix description: real part of 2nd input matrix (C) 4th: - type: matrix description: imaginary part of 2nd input matrix (D) outlets: 1st: - type: matrix description: X - real part of element-wise multiplication of (A+jB).*(C+jD) 2nd: - type: matrix description: Y - imaginary part of element-wise multiplication of (A+jB).*(C+jD) --- $$ Z_{m\times n} = (A_{m\times n}+jB_{m\times n}) \odot (C_{m\times n}+jD_{m\times n}) \quad \equiv \quad x_{hi} = (a_{hi}+j{b_{hi}})(c_{hi}+j{d_{hi}}) \\\\ X_{m\times n} = \Re ({Z_{m\times n}}) \\\\ Y_{m\times n} = \Im ({Z_{m\times n}}) $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_abs.md000066400000000000000000000006141514557770000275040ustar00rootroot00000000000000--- title: mtx_abs description: calculate absolute values of matrix elements categories: - object pdcategory: Element Math see_also: - abs inlets: 1st: - type: matrix description: input value to given function. outlets: 1st: - type: matrix description: the result of the operation. draft: false --- $$C_{m\times n} = A_{m\times n}^{|\circ|} \quad \equiv \quad c_{ij} = |a_{ij}|$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_add.md000066400000000000000000000011251514557770000274650ustar00rootroot00000000000000--- title: mtx_+ description: matrix addition categories: - object pdcategory: Element Math aliases: - mtx_add see_also: - matrix - mtx_+ - mtx_- - mtx_.* - mtx_./ - mtx_.^ - mtx_* inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = A_{m\times n} + B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} + b_{ij} $$ $$C_{m\times n} = A_{m\times n} + b \quad \equiv \quad c_{ij} = a_{ij} + b $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_and.md000066400000000000000000000011711514557770000275000ustar00rootroot00000000000000--- title: mtx_&& description: matrix logic AND aliases: - mtx_and categories: - object pdcategory: Element Math see_also: - mtx_|| - mtx_& inlets: 1st: - type: matrix description: input matrix A 2nd: - type: matrix description: input matrix B outlets: 1st: - type: matrix description: boolean output matrix (A.&&B) --- Each element of the input matrices is converted to boolean value, and afterwards the corresponding values are multiplied. The output is a boolean matrix (only ones and zeros). $$C_{m\times n} = A_{m\times n} \land ^{\circ} B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} \land b_{ij}$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_atan.md000066400000000000000000000006221514557770000276610ustar00rootroot00000000000000--- title: mtx_atan description: arctangent (atan) of matrix elements categories: - object pdcategory: Element Math see_also: - mtx_sin - mtx_cos - mtx_tan - mtx_atan2 inlets: 1st: - type: matrix description: input outlets: 1st: - type: matrix description: output --- $$B_{m\times n} = \operatorname{atan^\circ} (A_{m\times n}) \quad \equiv \quad b_{ij} = \operatorname{atan}(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_atan2.md000066400000000000000000000010221514557770000277360ustar00rootroot00000000000000--- title: mtx_atan2 description: arctangent (atan) of matrix elements (four-quadrant version) categories: - object pdcategory: Element Math see_also: - mtx_sin - mtx_cos - mtx_tan - mtx_atan inlets: 1st: - type: matrix description: right hand operand 2nd: - type: matrix description: right hand operand outlets: 1st: - type: matrix description: output --- $$C_{m\times n} = \operatorname{atan^\circ} (A_{m\times n} \oslash B_{m\times n}) \quad \equiv \quad c_{ij} = \operatorname{atan}(a_{ij} / b_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_bessel.md000066400000000000000000000004431514557770000302140ustar00rootroot00000000000000--- title: mtx_bessel description: calculate bessel functions of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... 1: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_bitand.md000066400000000000000000000012021514557770000301720ustar00rootroot00000000000000--- title: mtx_& description: matrix bitwise AND aliases: - mtx_bitand categories: - object pdcategory: Element Math see_also: - mtx_&& - mtx_| inlets: 1st: - type: matrix description: input matrix A 2nd: - type: matrix description: input matrix B outlets: 1st: - type: matrix description: output matrix (A.&B) --- Each element of the input matrices is converted to integer and interpreted as a bitfield. Afterwards an "and" is performed on the corresponding bits within the corresponding matrix elements. $$C_{m\times n} = A_{m\times n} \And ^{\circ} B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} \And b_{ij}$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_bitleft.md000066400000000000000000000010661514557770000303720ustar00rootroot00000000000000--- title: mtx_<< description: matrix logic bitwise leftshift alias: - mtx_bitleft categories: - object pdcategory: Element Math see_also: - mtx_>> inlets: 1st: - type: matrix description: input matrix A 2nd: - type: matrix description: input matrix B outlets: 1st: - type: matrix description: boolean output matrix (A.<> description: matrix logic bitwise rightshift alias: - mtx_bitright categories: - object pdcategory: Element Math see_also: - mtx_>> inlets: 1st: - type: matrix description: input matrix A 2nd: - type: matrix description: input matrix B outlets: 1st: - type: matrix description: boolean output matrix (A.>>B) --- Each element of the input matrices is converted to an integer value. Afterwards right signed bit shift is performed on the elements of matrix A. The shift amount is read from the corresponding elements in matrix B. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cabs2.md000066400000000000000000000003701514557770000277300ustar00rootroot00000000000000--- title: mtx_cabs2 description: absolute value of complex-valued matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cart2sph.md000066400000000000000000000007751514557770000304750ustar00rootroot00000000000000--- title: mtx_cart2sph description: convert cartesian to spherical coordinates (matrix version) categories: - object pdcategory: Coordinates see_also: - mtx_sph2cart inlets: 1st: - type: matrix description: \(3\times L\) matrix containing x (row 1), y (row 2), z (row 3) of the \(L\) cartesian coordinates to convert outlets: 1st: - type: matrix description: \(3\times L\) matrix containing radius (row 1), azimuth (row 2), zenith (row 3) for the resulting \(L\) coordinates draft: false --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_check.md000066400000000000000000000003661514557770000300200ustar00rootroot00000000000000--- title: mtx_check description: check (and fix) a matrix for validity categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cholesky.md000066400000000000000000000004011514557770000305520ustar00rootroot00000000000000--- title: mtx_cholesky description: decompose a matrix using cholesky's algorithm categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cinverse.md000066400000000000000000000011241514557770000305520ustar00rootroot00000000000000--- title: mtx_cinverse description: matrix inverse of complex-valued matrix categories: - object pdcategory: Matrix Math see_also: - mtx_inverse inlets: 1st: - type: matrix description: real part of \(n\times n\) input matrix 2nd: - type: matrix description: imaginary part of \(n\times n\) input matrix outlets: 1st: - type: matrix description: real part of \(n\times n\) output matrix 2nd: - type: matrix description: imaginary part of \(n\times n\) output matrix --- Calculates the inverse of a complex-valued matrix: $$ Y_{n\times n} = X_{n\times n}^{-1} $$ mtx_circular_harmonics.md000066400000000000000000000012371514557770000325310ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_circular_harmonics description: evaluate the circular harmonics as matrix categories: - object pdcategory: Spherical Harmonics see_also: - mtx_spherical_harmonics inlets: 1st: - type: matrix description: \(1\times L\) matrix with azimuth angles in radians for all \(L\) directions to evaluate outlets: 1st: - type: matrix description: \(L\times (2N+1)\) matrix with the circular harmonics evaluated from zeroth to \(N^\mathrm{th}\) order using the numerical creation argument \(N\) of the object draft: false --- Useful for 2D Ambisonic encoding and decoding. The object permits several different normalizations N2D (default), N2D2PI, SN2D iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cmul.md000066400000000000000000000015101514557770000276730ustar00rootroot00000000000000--- title: mtx_cmul description: multiplication of complex-valued matrix categories: - object pdcategory: Matrix Math see_also: - mtx_* - mtx_.cmul inlets: 1st: - type: matrix description: real part of 1st input matrix (A) 2nd: - type: matrix description: imaginary part of 1st input matrix (B) 3rd: - type: matrix description: real part of 2nd input matrix (C) 4th: - type: matrix description: imaginary part of 2nd input matrix (D) outlets: 1st: - type: matrix description: X - real part of multiplication of (A+jB)(C+jD) 2nd: - type: matrix description: Y - imaginary part of multiplication of (A+jB)(C+jD) --- $$ Z_{m\times n} = (A_{m\times n}+jB_{m\times n}) \cdot (C_{m\times n}+jD_{m\times n}) \\\\ X_{m\times n} = \Re ({Z_{m\times n}}) \\\\ Y_{m\times n} = \Im ({Z_{m\times n}}) $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_col.md000066400000000000000000000022321514557770000275120ustar00rootroot00000000000000--- title: mtx_col description: set columns of a matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_element - mtx_row inlets: 1st: - type: list description: new values for selected matrix column(s) - type: matrix description: new values for all matrix elements of an \(A_{n\times m}\) matrix 2nd: - type: float description: column index outlets: 1st: - type: matrix description: modified matrix arguments: - type: float float [float] description: "initial matrix dimensions; optional: initial column index" --- This object allows you to change a specific column of a matrix. The column to change is selected by its index to the 2nd outlet. Indices are *`1`-based*, so the index {{}} refers to the 2nd column. You can use `0` as a wildcard index, so the index {{}} refers to all columns in the matrix. If the length of the list of new values exceeds the matrix height, the additional values are discarded. If the length of this list is exactly `1`, all elements of the column are set to this value. Otherwise, the length of this list must not be \\(\lt n\\) (less than the matrix height). iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_colon.md000066400000000000000000000003461514557770000300530ustar00rootroot00000000000000--- title: mtx_colon description: matrix colon operator categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_concat.md000066400000000000000000000003741514557770000302110ustar00rootroot00000000000000--- title: mtx_concat description: concatenate two matrices into a new matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_conv.md000066400000000000000000000003451514557770000277050ustar00rootroot00000000000000--- title: mtx_conv description: 2d matrix convolution categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_convolver~.md000066400000000000000000000076721514557770000311650ustar00rootroot00000000000000--- Title: mtx_convolver~ description: MIMO convolution # matrix, uniform partitions, time-varying, fftw3 categories: - object pdcategory: Audio Math see_also: inlets: 1st: - type: array3 description: contains the \(n\times m\times len\) impulse responses of filters connecting every of the \(m\) inputs to every of the \(n\) outputs m: - type: signal description: multiple input signals that are to be convolved using uniformly partitioned overlap save with the FFT size \(2L\), where the partition length \(L\) that subdivides the total impulse response length \(len\) is controlled by the subpatch [block~] setting in Pd. The object permits amplitude-complementary or power-complementary time-varying updates within an L samples output crossfade outlets: n: - type: signal description: multiple output signals of which each is obtained by filtering and summing with the m filters for every input of length L, for the respective output arguments: - type: description: "`-m` option to switch to multichannel input and output connections replacing the individual INs and OUTs" - type: description: "`pow` option to switch from amplitude-complementary to power-complementary crossfades during time-varying updates" - type: description: file name to read array3 impulse response configuration from draft: false --- ## array3 The array3 message is {{" "" "" "" >}}, with the linear index $$s+i\times len+o\times m\times len, \qquad \text{indices: } s\dots\text{sample, } i\dots\text{input, } o\dots\text{output}$$ to shape the impulse response (ir) sample sequence. ## time-varying MIMO convolver The input signal \\(x_i[s]\\) of the input index \\(i\\) and sample index \\(s\\) is divided by Pd (or its local {{">}} object's setting) into blocks \\(x_b[s]=x[bL+s]\\) of the length \\(L\\) with the local sample index \\(s=0\dots L\\). Together with the previous block, it is being \\(2L\\) fast Fourier transformed for real-valued signals, at every DSP cycle indexed by \\(b\\): $$ X_{i,b}[k]=\operatorname{rFFT_{2L}}\{[x_{b-1}[0]\dots x_{b-1}[L-1]], [x_{b}[0]\dots x_{b}[L-1]] \}. $$ The impulse responses \\(h_{i,o,c}[s]\\) for the inlet \\(i=0\dots m-1\\), outlet \\(o=0\dots n-1\\) and current/old \\(c=0,1\\) crossfade index are partitioned by {{}} into blocks of also \\(L\\), using the partition index \\(p=0\dots P-1\\) with \\(P=\lceil\mathrm{len}/L\rceil\\) and Fourier transformed after zero-padding to the size \\(2L\\), and the frequency bin index \\(k=0\dots L\\) is relevant for real-valued signals: $$ H_{i,o,p,c}[k]=\operatorname{rFFT_{2L}}\{[h_{i,o,c}[pL],\dots h_{i,o,c}[pL+L-1]], [0,\dots,0]\}. $$ Cyclic convolution for the output \\(o\\) is obtained via complex-valued multiply accumulate for the relevant frequency bins \\(k=0\dots L\\) across the inputs \\(i=0\dots m-1\\) and partitions \\(p=0\dots P-1\\) for a current/old response set \\(c=0,1\\) $$ Y_{o,c}[k]= \sum_{i=0}^{m-1} \sum_{p=0}^{P-1} X_{i,b-p}[k] H_{i,o,p,c}[k]. $$ For every output and current/old, the inverse fast Fourier transform for real-valued signals delivers $$ y_{o,c}[s]=\operatorname{riFFT_{2L}} \{Y_{o,c}[k]\}, $$ which, when there is an update, delivers for every output \\(o\\) the linear-convolution output of the length \\(L\\) from crossfading with an \\(L\\) point fade-out window \\(w[n]\\), which starts from the rIFFT sample \\(L\\) $$ y_{o}[s] = w[s]\thinspace y_{o,c}[s+L]+(1-w[s])\thinspace y_{o,(c+1)\%2}[s+L], $$ or with the option `pow` for power-complementary output crossfade: $$ y_{o}[s]=\sqrt{w[s]}\thinspace y_{o,c}[s+L]+\sqrt{1-w[s]}\thinspace y_{o,(c+1)\%2}[s+L], $$ or if there is no update and \\(c\\) is the index for the current impulse response set, for \\(s=0\dots L\\), $$ y_{o}[s]=\thinspace y_{o,c}[s+L]. $$ The window \\(w[s]\\) is implemented as a Hann window of the length \\(L\\). iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cos.md000066400000000000000000000005701514557770000275240ustar00rootroot00000000000000--- title: mtx_cos description: cosine (cos) of each element of a matrix categories: - object pdcategory: Element Math see_also: - mtx_sin - mtx_tan - mtx_atan - mtx_atan2 inlets: 1st: - type: matrix description: input outlets: 1st: - type: matrix description: output --- $$B_{m\times n} = \cos^\circ (A_{m\times n}) \quad \equiv \quad b_{ij} = \cos(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cumprod.md000066400000000000000000000003611514557770000304070ustar00rootroot00000000000000--- title: mtx_cumprod description: cumulative product of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_cumsum.md000066400000000000000000000003541514557770000302510ustar00rootroot00000000000000--- title: mtx_cumsum description: cumulative sum of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_dbtopow.md000066400000000000000000000005751514557770000304230ustar00rootroot00000000000000--- title: mtx_dbtopow description: calculate power value from dB for each matrix element categories: - object pdcategory: Element Math see_also: - mtx_dbtorms - mtx_powtodb - mtx_rmstodb inlets: 1st: - type: matrix description: NxM input matrix outlets: 1st: - type: matrix description: NxM output matrix --- Applies {{< pdobj dbtopow >}} to each matrix element. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_dbtorms.md000066400000000000000000000005761514557770000304200ustar00rootroot00000000000000--- title: mtx_dbtorms description: calculate linear value from dB for each matrix element categories: - object pdcategory: Element Math see_also: - mtx_dbtopow - mtx_powtodb - mtx_rmstodb inlets: 1st: - type: matrix description: NxM input matrix outlets: 1st: - type: matrix description: NxM output matrix --- Applies {{< pdobj dbtorms >}} to each matrix element. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_diag.md000066400000000000000000000015221514557770000276420ustar00rootroot00000000000000--- title: mtx_diag description: extract diagonal from matrix & create diagonal matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_eye - mtx_diegg inlets: 1st: - type: matrix description: extract diagonal from matrix - type: list description: create a square diagonal matrix with elements as provided in list outlets: 1st: - type: list description: diagonal from input matrix as list - type: matrix description: diagonal matrix created from input list --- $$ \begin{pmatrix} 1 & 2 & 3 & 4 \cr 5 & 6 & 7 & 8 \cr 9 & 10 & 11 & 12 \cr 13 & 14 & 15 & 16 \end{pmatrix} \to \begin{bmatrix} 1\cr 6\cr 11\cr 16\cr \end{bmatrix} $$ $$ \begin{bmatrix} 1\cr 2\cr 4\cr 3\cr \end{bmatrix} \to \begin{pmatrix} 1 & 0 & 0 & 0 \cr 0 & 2 & 0 & 0 \cr 0 & 0 & 4 & 0 \cr 0 & 0 & 0 & 3 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_diegg.md000066400000000000000000000015601514557770000300170ustar00rootroot00000000000000--- title: mtx_diegg description: extract anti diagonal from matrix & create anti diagonal matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_egg - mtx_diag inlets: 1st: - type: matrix description: extract anti diagonal from matrix - type: list description: create a square anti diagonal matrix with elements as provided in list outlets: 1st: - type: list description: anti diagonal from input matrix as list - type: matrix description: anti diagonal matrix created from input list --- $$ \begin{pmatrix} 1 & 2 & 3 & 4 \cr 5 & 6 & 7 & 8 \cr 9 & 10 & 11 & 12 \cr 13 & 14 & 15 & 16 \end{pmatrix} \to \begin{bmatrix} 4\cr 7\cr 10\cr 13\cr \end{bmatrix} $$ $$ \begin{bmatrix} 1\cr 2\cr 4\cr 3\cr \end{bmatrix} \to \begin{pmatrix} 0 & 0 & 0 & 1 \cr 0 & 0 & 2 & 0 \cr 0 & 4 & 0 & 0 \cr 3 & 0 & 0 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_diff.md000066400000000000000000000004011514557770000276410ustar00rootroot00000000000000--- title: mtx_diff description: calculate the differences between matrix elements categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_distance/000077500000000000000000000000001514557770000302065ustar00rootroot00000000000000index.md000066400000000000000000000043361514557770000315660ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_distance--- title: mtx_distance description: calculate euclidean distance matrix between two sets of vectors categories: - object pdcategory: Misc see_also: - mtx_distance2 inlets: 1st: - type: matrix description: LxN matrix 2nd: - type: matrix description: MxN matrix outlets: 1st: - type: matrix description: LxM matrix --- {{< pdobj mtx_distance >}} gets all the euclidean distances between two sets of vectors. The euclidean distance between two vectors (of equal dimensions \\(N\\)) \\(a\\) and \\(b\\) is: $$ \| \vec a -\vec b \| = \sqrt{\textstyle\sum_{n=1}^N (a_n-b_n)^2} = \sqrt{(a_1-b_1)^2 + (a_2-b_2)^2 + \dots} $$ Assuming \\(A_{L\times N}\\) consists of \\(L\\) vectors of dimension \\(N\\) and \\(B_{M\times N}\\) consists of \\(M\\) vectors of dimension \\(N\\), then {{< pdobj mtx_distance >}} returns a matrix \\(C_{L\times M}\\), where each row vector \\(\vec c_l = C_{l,\*}\\) corresponds to the euclidean distances between the same-index row vector \\(\vec a_l = A_{l,\*}\\) and all the row vectors in \\(B\\): $$ C = \begin{pmatrix} \| \vec a_1 - \vec b_1 \| & \| \vec a_1 - \vec b_2 \| & \| \vec a_1 - \vec b_3 \| & \dots \\ \| \vec a_2 - \vec b_1 \| & \| \vec a_2 - \vec b_2 \| & \| \vec a_2 - \vec b_3 \| & \dots \\ \vdots & \vdots & \vdots & \ddots \end{pmatrix} $$ ## Example ![distance between two matrices](mtx_distance.pd.svg) The first row of the output matrix shows the distances between the reference vector \\(\begin{pmatrix}0 & 0 & 0\end{pmatrix}\\) and the three vectors \\(\begin{pmatrix}1 & 0 & 0\end{pmatrix}\\), \\(\begin{pmatrix}0 & 1 & 0\end{pmatrix}\\), and \\(\begin{pmatrix}0 & 0 & 1\end{pmatrix}\\) resp. The distance is \\(1\\) in all cases. The second row of the output matrix uses \\(\begin{pmatrix}1 & 2 & 3\end{pmatrix}\\) as the reference vector, leading to the results \\(\sqrt{0^2+2^2+3^2} = \sqrt{13} = 3.605\\), \\(\sqrt{1^2+1^2+3^2} = \sqrt{11} = 3.316\\), and \\(\sqrt{1^2+2^2+2^2} = \sqrt{9} = 3\\) resp. ## Performance considerations If you are mainly interested in sorting distances between points, you might consider using {{< pdobj mtx_distance2 >}} instead, which gives you the *squares* of each distance (the \\(\sqrt{\dots}\\) operation is typically considered rather costly). mtx_distance.pd.svg000066400000000000000000000222421514557770000337360ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_distance mtx_distance mtx_show 0 0 0 1 2 3 mtx_show 1 1 1 3.605 3.316 3 mtx_show 1 0 0 0 1 0 0 0 1 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_distance2.md000066400000000000000000000011471514557770000306150ustar00rootroot00000000000000--- title: mtx_distance2 description: calculate the matrix of squared euclidean distances between two sets of vectors categories: - object pdcategory: Misc see_also: - mtx_distance inlets: 1st: - type: matrix description: LxN matrix 2nd: - type: matrix description: MxN matrix outlets: 1st: - type: matrix description: LxM matrix --- {{< pdobj mtx_distance2 >}} gets all the *squared* euclidean distances between two sets of vectors. It behaves identical to the {{< pdobj mtx_distance >}} object, but does not perform the final \\(\sqrt{\dots}\\) operation, so it is a bit more efficient. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_dotdiv.md000066400000000000000000000011371514557770000302310ustar00rootroot00000000000000--- title: mtx_./ description: element-wise matrix division categories: - object pdcategory: Element Math aliases: - mtx_div see_also: - matrix - mtx_+ - mtx_- - mtx_.* - mtx_.^ inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = A_{m\times n} \oslash B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} / b_{ij} $$ $$C_{m\times n} = A_{m\times n} \oslash b \quad \equiv \quad c_{ij} = a_{ij} / b $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_dotmul.md000066400000000000000000000011511514557770000302400ustar00rootroot00000000000000--- title: mtx_.* description: element-wise matrix multiplication categories: - object pdcategory: Element Math aliases: - mtx_mul see_also: - matrix - mtx_+ - mtx_- - mtx_* - mtx_./ - mtx_.^ inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = A_{m\times n} \odot B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} * b_{ij} $$ $$C_{m\times n} = A_{m\times n} \odot b \quad \equiv \quad c_{ij} = a_{ij} * b $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_dotpow.md000066400000000000000000000011701514557770000302510ustar00rootroot00000000000000--- title: mtx_.^ description: calculate element-wise raising to the power of x categories: - object pdcategory: Element Math aliases: - mtx_pow see_also: - matrix - mtx_+ - mtx_- - mtx_.* - mtx_./ - mtx_* inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = A_{m\times n}^{\circ B_{m\times n}} \quad \equiv \quad c_{ij} = a_{ij}^{b_{ij}} $$ $$C_{m\times n} = A_{m\times n}^{\circ b} \quad \equiv \quad c_{ij} = a_{ij}^b $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_egg.md000066400000000000000000000011571514557770000275040ustar00rootroot00000000000000--- title: mtx_egg description: create an exchange matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_egg - mtx_diegg inlets: 1st: - type: matrix description: create an equally-sized matrix - type: float description: create a square matrix with the given dimensions - type: float float description: create a matrix with the given dimensions outlets: 1st: - type: matrix description: backward identity matrix --- $$ I_{m\times n} = \begin{pmatrix} 0 & \dots & 0 & 1\cr 0 & \dots & 1 & 0 \cr \vdots & \vdots & \ddots & \vdots \cr 1 & 0 & \dots & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_eig.md000066400000000000000000000016261514557770000275070ustar00rootroot00000000000000--- title: mtx_eig description: eigenvalue decomposition of a matrix categories: - object pdcategory: Matrix Transformation see_also: - mtx_svd inlets: 1st: - type: matrix description: \(n\times n\) matrix \(\boldsymbol A\) to decompose outlets: 1st: - type: list description: list of real parts of the \(n\) eigenvalues \(\boldsymbol \sigma\) 2nd: - type: list description: list of imaginary parts of the \(n\) eigenvalues \(\boldsymbol \sigma\) 3: - type: matrix description: \(n\times n\) real part of the eigenvector matrix \(\boldsymbol V\) 4: - type: matrix description: \(n\times n\) imaginary part of the eigenvector matrix \(\boldsymbol V\) draft: false --- This object depends on the GNU Scientific Library. The matrices lists involved have the properties: $$ \boldsymbol A = \boldsymbol V \operatorname{diag}\lbrace \boldsymbol \sigma\rbrace \boldsymbol V^{-1} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_element.md000066400000000000000000000016421514557770000303720ustar00rootroot00000000000000--- title: mtx_element description: set elements of a matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_row - mtx_col inlets: 1st: - type: float description: new value for selected matrix element(s) - type: matrix description: new values for all matrix elements 2nd: - type: float float description: element 2d position outlets: 1st: - type: matrix description: modified matrix arguments: - type: float float [float float] description: "initial matrix dimensions; optional: initial element position" --- This object allows you to change specific elements of a matrix. The element to change is selected by its 2D index to the 2nd outlet. Indices are *`1`-based*, so the position {{}} refers to the element at the 1st column in the 1st row. You can use `0` as a wildcard index, so the position {{}} refers to all elements in the 2nd row. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_eq.md000066400000000000000000000016021514557770000273420ustar00rootroot00000000000000--- title: mtx_== description: element-wise comparison for equality of two matrices categories: - object pdcategory: Element Math aliases: - mtx_eq see_also: - mtx_isequal - "mtx_!=" - "mtx_>" - "mtx_>=" - "mtx_<" - "mtx_<=" inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = (A_{m\times n} \stackrel{?}{=}^\circ B_{m\times n}) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{=} b_{ij})$$ $$C_{m\times n} = (A_{m\times n} \stackrel{?}{=}^\circ b) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{=} b)$$ ## Examples $$ [\begin{pmatrix} 1 & 0 \cr 0 & 2 \end{pmatrix} \stackrel{?}{=}^\circ \begin{pmatrix} 1 & 0 \cr 2 & 2 \end{pmatrix}] = \begin{pmatrix} 1 & 1 \cr 0 & 1 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_exp.md000066400000000000000000000005521514557770000275340ustar00rootroot00000000000000--- title: mtx_exp description: base-e exponential of matrix elements categories: - object pdcategory: Element Math see_also: - mtx_log - mtx_.^ inlets: 1st: - type: matrix description: input matrix outlets: 1st: - type: matrix description: output matrix --- $$B_{m\times n} = e^{\circ (A_{m\times n})} \quad \equiv \quad b_{ij} = e^{a_{ij}}$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_eye.md000066400000000000000000000011501514557770000275150ustar00rootroot00000000000000--- title: mtx_eye description: create an identity matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_egg - mtx_diag inlets: 1st: - type: matrix description: create an equally-sized matrix - type: float description: create a square matrix with the given dimensions - type: float float description: create a matrix with the given dimensions outlets: 1st: - type: matrix description: identity matrix --- $$ I_{m\times n} = \begin{pmatrix} 1 & 0 & \dots & 0 \cr 0 & 1 & \dots & 0 \cr \vdots & \vdots & \ddots & \vdots \cr 0 & 0 & \dots & 1 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_fft.md000066400000000000000000000004551514557770000275210ustar00rootroot00000000000000--- title: mtx_fft description: complex-valued FFT of each matrix row categories: - object pdcategory: Digital Fourier Transformation see_also: - mtx_ifft - mtx_rfft - mtx_rifft inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_fill.md000066400000000000000000000004231514557770000276630ustar00rootroot00000000000000--- title: mtx_fill description: fill elements of a matrix into specific positions of another matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_fill_col_grid.md000066400000000000000000000004101514557770000315210ustar00rootroot00000000000000--- title: mtx_fill_col_grid description: fill values into the column indices of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_fill_row_grid.md000066400000000000000000000004031514557770000315550ustar00rootroot00000000000000--- title: mtx_fill_row_grid description: fill values into the row indices of matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_fill_rowcol.md000066400000000000000000000004151514557770000312510ustar00rootroot00000000000000--- title: mtx_fill_rowcol description: fill values into the given row/col indices of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- mtx_fill_rowcol_grid.md000066400000000000000000000004171514557770000322010ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_fill_rowcol_grid description: fill values into the row/col grid indices of matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_find.md000066400000000000000000000003701514557770000276560ustar00rootroot00000000000000--- title: mtx_find description: find indices of non-zero matrix elements categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_find_rowcol.md000066400000000000000000000004251514557770000312440ustar00rootroot00000000000000--- title: mtx_find_rowcol description: calculates the row/col indices of nonzero elements in a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_gauss.md000066400000000000000000000003651514557770000300640ustar00rootroot00000000000000--- title: mtx_gauss description: matrix gauss eleminitation algorithm categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_ge.md000066400000000000000000000020121514557770000273240ustar00rootroot00000000000000--- title: mtx_>= description: element-wise comparison for greater-or-equalness of two matrices categories: - object pdcategory: Element Math aliases: - mtx_ge see_also: - mtx_isequal - "mtx_==" - "mtx_!=" - "mtx_>" - "mtx_<" - "mtx_<=" inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- Returns `1` for each element of \\(A\\) that is *greater than or equal to* the corresponding element in \\(B\\). $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\ge}^\circ B_{m\times n}) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\ge} b_{ij})$$ $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\ge}^\circ b) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\ge} b)$$ ## Examples $$ [\begin{pmatrix} 1 & 1 \cr 0 & 2 \end{pmatrix} \stackrel{?}{\ge}^\circ \begin{pmatrix} 1 & 0 \cr 2 & 2 \end{pmatrix}] = \begin{pmatrix} 1 & 1 \cr 0 & 1 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_gt.md000066400000000000000000000017721514557770000273570ustar00rootroot00000000000000--- title: mtx_> description: element-wise comparison for strict superiority of two matrices categories: - object pdcategory: Element Math aliases: - mtx_gt see_also: - mtx_isequal - "mtx_==" - "mtx_!=" - "mtx_>=" - "mtx_<" - "mtx_<=" inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- Returns `1` for each element of \\(A\\) that is greater than the corresponding element in \\(B\\). $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\gt}^\circ B_{m\times n}) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\gt} b_{ij})$$ $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\gt}^\circ b) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\gt} b)$$ ## Examples $$ [\begin{pmatrix} 1 & 1 \cr 0 & 2 \end{pmatrix} \stackrel{?}{\gt}^\circ \begin{pmatrix} 1 & 0 \cr 2 & 2 \end{pmatrix}] = \begin{pmatrix} 0 & 1 \cr 0 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_ifft.md000066400000000000000000000004651514557770000276730ustar00rootroot00000000000000--- title: mtx_ifft description: complex-valued inverse FFT of each matrix row categories: - object pdcategory: Digital Fourier Transformation see_also: - mtx_fft - mtx_rfft - mtx_rifft inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_index.md000066400000000000000000000003711514557770000300460ustar00rootroot00000000000000--- title: mtx_index description: address matrix elements by their indices categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_index2rowcol.md000066400000000000000000000004451514557770000313600ustar00rootroot00000000000000--- title: mtx_index2rowcol description: calculate row/column indices from linear indices used by other matrix objects categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- mtx_index_col_grid.md000066400000000000000000000004201514557770000316240ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_index_col_grid description: find the values to the column grid indices in a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- mtx_index_row_grid.md000066400000000000000000000004151514557770000316620ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_index_row_grid description: find the values to the row grid indices in a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_index_rowcol.md000066400000000000000000000004231514557770000314310ustar00rootroot00000000000000--- title: mtx_index_rowcol description: find the values to the given row/column indices in a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- mtx_index_rowcol_grid.md000066400000000000000000000004271514557770000323630ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_index_rowcol_grid description: find the values to the row/column grid indices in a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_int.md000066400000000000000000000007051514557770000275320ustar00rootroot00000000000000--- title: mtx_int description: compute integer value of each matrix element categories: - object pdcategory: Element Math see_also: inlets: 1st: - type: matrix description: input matrix outlets: 1st: - type: matrix description: output matrix --- Truncates any decimals of the matrix elements, so we only have integers. $$B_{m\times n} = \operatorname{int^\circ} (A_{m\times n}) \quad \equiv \quad b_{ij} = \operatorname{int}(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_inverse.md000066400000000000000000000014331514557770000304120ustar00rootroot00000000000000--- title: mtx_inverse description: inverse (or pseudo-inverse) of a matrix categories: - object pdcategory: Matrix Math see_also: inlets: 1st: - type: matrix description: \(n\times n\) input matrix outlets: 1st: - type: matrix description: \(n\times n\) output matrix --- Calculates the inverse of a matrix: $$ Y_{n\times n} = X_{n\times n}^{-1} $$ so that \\(Y_{n\times n} * X_{n\times n} = I\\). If the input matrix \\(X_{n\times m}\\) is not square (that is: \\(n \neq m\\)), {{}} will automatically calculate the *pseudo-inverse* instead: $$ \begin{cases} Y_{m\times n} = (X^\mathsf{T} \cdot X)^{-1} \cdot X^\mathsf{T} , & \text{if $n > m$} \cr Y_{m\times n} = X^\mathsf{T} \cdot (X \cdot X^\mathsf{T})^{-1} , & \text{if $n < m$} \end{cases} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_isequal.md000066400000000000000000000022471514557770000304060ustar00rootroot00000000000000--- title: mtx_isequal description: compare a matrix for equality with another (scalar result) categories: - object pdcategory: Misc see_also: - "mtx_==" - "mtx_!=" - "mtx_>" - "mtx_>=" - "mtx_<" inlets: 1st: - type: matrix description: left-hand operand \(A_{m\times n}\) 2nd: - type: matrix description: right-hand operand \(B_{m_n}\) - type: float description: right-hand operand \(b\) outlets: 1st: - type: matrix description: result --- Returns `1` if all elements of the input matrix \\(A_{m\times n}\\) are equal to the corresponding elements of \\(B_{m\times n}\\) (resp. \\(b\\)), and otherwise `0`. $$ c = (A_{m\times n} \stackrel{?}{=} B_{m\times n}) = \begin{cases} 1 & \text{if } a_{ij} = b_{ij} \forall i,j, \cr 0 & \text{otherwise.} \end{cases} $$ $$ c = (A_{m\times n} \stackrel{?}{=} b) = \begin{cases} 1 & \text{if } a_{ij} = b \forall i,j, \cr 0 & \text{otherwise.} \end{cases} $$ ## Examples $$ [\begin{pmatrix} 1 & 0 \cr 0 & 2 \end{pmatrix} \stackrel{?}{=} \begin{pmatrix} 1 & 0 \cr 0 & 2 \end{pmatrix}] = 1 $$ $$ [\begin{pmatrix} 1 & 0 \cr 0 & 2 \end{pmatrix} \stackrel{?}{=} \begin{pmatrix} 1 & 1 \cr 2 & 2 \end{pmatrix}] = 0 $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_ispeak.md000066400000000000000000000003721514557770000302140ustar00rootroot00000000000000--- title: mtx_ispeak description: search for peaks in the rows of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_ispeakb.md000066400000000000000000000004061514557770000303540ustar00rootroot00000000000000--- title: mtx_ispeakb description: search for peaks in the rows of a matrix (improved) categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_le.md000066400000000000000000000020041514557770000273320ustar00rootroot00000000000000--- title: mtx_<= description: element-wise comparison for less-or-equalness of two matrices categories: - object pdcategory: Element Math aliases: - mtx_le see_also: - mtx_isequal - "mtx_==" - "mtx_!=" - "mtx_>" - "mtx_>=" - "mtx_<" inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- Returns `1` for each element of \\(A\\) that is *less than or equal to* the corresponding element in \\(B\\). $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\le}^\circ B_{m\times n}) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\le} b_{ij})$$ $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\le}^\circ b) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\le} b)$$ ## Examples $$ [\begin{pmatrix} 1 & 1 \cr 0 & 2 \end{pmatrix} \stackrel{?}{\le}^\circ \begin{pmatrix} 1 & 0 \cr 2 & 2 \end{pmatrix}] = \begin{pmatrix} 1 & 0 \cr 1 & 1 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_linspace.md000066400000000000000000000004401514557770000305320ustar00rootroot00000000000000--- title: mtx_linspace description: create a linearly spaced matrix vector using start stop and numsteps categories: - object pdcategory: Matrix Creation see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_linsweep.md000066400000000000000000000004301514557770000305610ustar00rootroot00000000000000--- title: mtx_linsweep description: create a linear sweep matrix using start stop and numsamples categories: - object pdcategory: Matrix Creation see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_log.md000066400000000000000000000005761514557770000275270ustar00rootroot00000000000000--- title: mtx_log description: compute the natural logarithm of each element of a matrix categories: - object pdcategory: Element Math see_also: - mtx_exp - mtx_.^ inlets: 1st: - type: matrix description: input matrix outlets: 1st: - type: matrix description: output matrix --- $$B_{m\times n} = \ln^\circ (A_{m\times n}) \quad \equiv \quad b_{ij} = \ln(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_logspace.md000066400000000000000000000004471514557770000305400ustar00rootroot00000000000000--- title: mtx_logspace description: create a logarithmically spaced matrix vector using start stop and numsteps categories: - object pdcategory: Matrix Creation see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_logsweep.md000066400000000000000000000004331514557770000305630ustar00rootroot00000000000000--- title: mtx_logsweep description: create a logarithmic sweep matrix using start stop and numsteps categories: - object pdcategory: Matrix Creation see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_lt.md000066400000000000000000000017641514557770000273650ustar00rootroot00000000000000--- title: "mtx_<" description: element-wise comparison for inferiority of two matrices categories: - object pdcategory: Element Math aliases: - mtx_le see_also: - mtx_isequal - "mtx_==" - "mtx_!=" - "mtx_>" - "mtx_>=" - "mtx_<=" inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- Returns `1` for each element of \\(A\\) that is *less than* the corresponding element in \\(B\\). $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\lt}^\circ B_{m\times n}) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\lt} b_{ij})$$ $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\lt}^\circ b) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\lt} b)$$ ## Examples $$ [\begin{pmatrix} 1 & 1 \cr 0 & 2 \end{pmatrix} \stackrel{?}{\lt}^\circ \begin{pmatrix} 1 & 0 \cr 2 & 2 \end{pmatrix}] = \begin{pmatrix} 0 & 0 \cr 1 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_matcher.md000066400000000000000000000027001514557770000303600ustar00rootroot00000000000000--- title: mtx_matcher description: match two sets of feature vectors categories: - object pdcategory: Misc see_also: inlets: 1st: - type: matrix description: set of vectors to match \(A_{n\times m}\) 2nd: - type: matrix description: reference set of vectors \(B_{n\times m}\) outlets: 1st: - type: matrix description: permutated matrix \(A'_{n\times m}\) 2nd: - type: matrix description: permutation matrix \(T_{n\times n}\) --- Given two sets of feature vectors arranged as a matrix (each matrix row is a feature vector). {{}} will attempt to permutate the input set of vectors \(A\) in such a way, that the euclidean distance between the permutated matrix \(A'\) and the reference set of vectors \(B\) becomes minimal. It can be used to for simple tracking algorithms, where features vectors (e.g. coordinates) are retrieved out-of-order (e.g. they are sorted by some arbitrary feature, like the x-Axis). Matching the current set of feature vectors with a prediction of the feature vectors will give sort the current set in such a way that it's row indices match the prediction. (A very simply prediction algorithm for slowly-changing features is to just use the previous set.) The permutation matrix can be used to transform the input set of vectors into the output set of vectors: $$ A' = T \cdot A $$ The result is ***not* guaranteed** to have an absolute minimum distance to the reference set of features. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_max2.md000066400000000000000000000007071514557770000276110ustar00rootroot00000000000000--- title: mtx_max2 description: get element-wise maxima of two matrices categories: - object pdcategory: Element Math see_also: - mtx_min2 - mtx_minmax inlets: 1st: - type: matrix description: right hand operand 2nd: - type: matrix description: right hand operand outlets: 1st: - type: matrix description: output --- $$C_{m\times n} = {\max}^\circ (A_{m\times n}, B_{m\times n}) \quad \equiv \quad c_{ij} = \max(a_{ij}, b_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_mean.md000066400000000000000000000003721514557770000276600ustar00rootroot00000000000000--- title: mtx_mean description: get mean values of each column of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_meshgrid.md000066400000000000000000000003641514557770000305430ustar00rootroot00000000000000--- title: mtx_meshgrid description: create a X/Y grid matrix categories: - object pdcategory: Matrix Creation see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_min2.md000066400000000000000000000007071514557770000276070ustar00rootroot00000000000000--- title: mtx_min2 description: get element-wise minima of two matrices categories: - object pdcategory: Element Math see_also: - mtx_max2 - mtx_minmax inlets: 1st: - type: matrix description: right hand operand 2nd: - type: matrix description: right hand operand outlets: 1st: - type: matrix description: output --- $$C_{m\times n} = {\min}^\circ (A_{m\times n}, B_{m\times n}) \quad \equiv \quad c_{ij} = \min(a_{ij}, b_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_minmax.md000066400000000000000000000004441514557770000302310ustar00rootroot00000000000000--- title: mtx_minmax description: get minimum and maximum value of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: float description: ... 1: - type: float description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_mul.md000066400000000000000000000010611514557770000275310ustar00rootroot00000000000000--- title: mtx_* description: matrix multiplication categories: - object pdcategory: Matrix Math aliases: - mtx_mul see_also: - matrix - mtx_+ - mtx_- - mtx_.* - mtx_./ - mtx_.^ inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times p} = A_{m\times n} \cdot B_{n\times p}$$ $$C_{m\times n} = A_{m\times n} \cdot b \quad \equiv \quad c_{ij} = a_{ij} \cdot b $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_mul~.md000066400000000000000000000020241514557770000277270ustar00rootroot00000000000000--- title: mtx_*~ aliases: - mtx_mul~ description: multiply signals with a matrix categories: - object pdcategory: Audio Math see_also: inlets: 1st: - type: matrix description: vector or matrix to multiply input signals with m: - type: signal description: multiple input signals that are understood as column vector per time sampling instant last: - type: float description: interpolation time in ms to ramp from old matrix entries to new ones without crackling outlets: 1st, n: - type: signal description: output signals that are understood as output column vector per sample arguments: - type: description: number of outputs and number of inputs and interpolation time in ms - type: description: \(-\mathrm{m}\) option to switch to multichannel input and output connections replacing the individual ins and outs draft: false --- $$ \begin{pmatrix} y_1[i]\cr \vdots\cr y_n[i] \end{pmatrix}= \boldsymbol{A} \begin{pmatrix} x_1[i]\cr \vdots\cr x_m[i] \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_neq.md000066400000000000000000000016371514557770000275300ustar00rootroot00000000000000--- title: mtx_!= description: element-wise comparison for non-equality of two matrices categories: - object pdcategory: Element Math aliases: - mtx_neq see_also: - mtx_isequal - "mtx_==" - "mtx_>" - "mtx_>=" - "mtx_<" - "mtx_<=" inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\not =}^\circ B_{m\times n}) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\not =}^\circ b_{ij})$$ $$C_{m\times n} = (A_{m\times n} \stackrel{?}{\not =}^\circ b) \quad \equiv \quad c_{ij} = (a_{ij} \stackrel{?}{\not =}^\circ b)$$ $$ [\begin{pmatrix} 1 & 0 \cr 0 & 2 \end{pmatrix} \stackrel{?}{\not =}^\circ \begin{pmatrix} 1 & 0 \cr 2 & 2 \end{pmatrix}] = \begin{pmatrix} 0 & 0 \cr 1 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_not.md000066400000000000000000000010011514557770000275260ustar00rootroot00000000000000--- title: mtx_! description: matrix logic NOT aliases: - mtx_not categories: - object pdcategory: Element Math see_also: - mtx_|| - mtx_&& inlets: 1st: - type: matrix description: input matrix outlets: 1st: - type: matrix description: boolean output matrix (.!A) --- Each element of the input matrix is converted to a boolean value, and afterwards inverted. The output is a boolean matrix (only ones and zeros). $$B_{m\times n} = \lnot A_{m\times n} \quad \equiv \quad b_{ij} = \lnot a_{ij}$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_ones.md000066400000000000000000000011751514557770000277060ustar00rootroot00000000000000--- title: mtx_ones description: create a matrix with all elements set to 1 categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_zeros inlets: 1st: - type: matrix description: create an equally-sized matrix - type: float description: create a square matrix with the given dimensions - type: float float description: create a matrix with the given dimensions outlets: 1st: - type: matrix description: matrix with all elements 1 --- $$ J_{m\times n} = \begin{pmatrix} 1 & 1 & \dots & 1 \cr 1 & 1 & \dots & 1 \cr \vdots & \vdots & \ddots & \vdots \cr 1 & 1 & \dots & 1 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_or.md000066400000000000000000000011601514557770000273540ustar00rootroot00000000000000--- title: mtx_|| description: matrix logic OR aliases: - mtx_or categories: - object pdcategory: Element Math see_also: - mtx_| - mtx_&& inlets: 1st: - type: matrix description: input matrix A 2nd: - type: matrix description: input matrix B outlets: 1st: - type: matrix description: boolean output matrix (A.||B) --- Each element of the input matrices is converted to boolean value, and afterwards the corresponding values are added. The output is a boolean matrix (only ones and zeros). $$C_{m\times n} = A_{m\times n} \lor ^{\circ} B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} \lor b_{ij}$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_pack~.md000066400000000000000000000020171514557770000300520ustar00rootroot00000000000000--- title: mtx_pack~ description: pack signal vectors into a matrix categories: - object pdcategory: Audio Math see_also: - mtx_unpack~ arguments: - type: float description: number of signal inlets inlets: n: - type: signal description: input signals (possibly multichannel) outlets: 1st: - type: matrix description: signal vectors 2nd: - type: channels description: number of discrete input channels (number of rows in the output matrix) - type: blocksize description: blocksize of the input signals (number of columns in the output matrix) - type: dimen description: number of channels and blocksize in a single message --- Takes the current block of all discrete input signals and outputs them as a {{}} message (making it possible to apply matrix math on the signals). Converting the matrix back to a signal can be done with {{}}. Note that converting a signal to a message and back again will introduce one block delay. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_phon_curve.md000066400000000000000000000004171514557770000311100ustar00rootroot00000000000000--- title: mtx_phon_curve description: calculate the phone curve matrix at the given frequencies categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_pinverse.md000066400000000000000000000004051514557770000305700ustar00rootroot00000000000000--- title: mtx_pinverse description: calculate the inverse of a matrix (with pivoting) categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_pivot.md000066400000000000000000000030011514557770000300710ustar00rootroot00000000000000--- title: mtx_pivot description: pivot transform a matrix categories: - object pdcategory: Matrix Transformation see_also: inlets: 1st: - type: matrix description: \(n\times m\) input matrix outlets: 1st: - type: matrix description: \(n\times m\) output matrix 2nd: - type: matrix description: \(n\times n\) pre-multiplication matrix 3rd: - type: matrix description: \(m\times m\) post-multiplication matrix --- This will transform the columns and rows of the input matrix \\(X\\), so that the result \\(Y\\) will have "all" maximum values in the diagonal. The maximum of the matrix will be located at the upper-left corner. The first outlet is the pivot-transformed matrix. The other outlets are the elementary matrices \\(A\\) and \\(B\\) that have to be pre-multiplied (row-transform) resp. post-multiplied (column-tranform) with the original matrix to get the pivot-tranformation. $$ Y_{n\times m} = A_{n\times n} \cdot X_{n\times m} \cdot B_{m\times m} $$ This is useful for things like de-pivoting. ## Example $$ X_{m\times n} = \begin{pmatrix} 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 8 & 9 \cr 10 & 11 & 12 \end{pmatrix} $$ $$ Y_{m\times n} = \begin{pmatrix} 12 & 11 & 10 \cr 9 & 8 & 7 \cr 6 & 5 & 4 \cr 3 & 2 & 1 \end{pmatrix} = \begin{pmatrix} 0 & 0 & 0 & 1 \cr 0 & 0 & 1 & 0 \cr 0 & 1 & 0 & 0 \cr 1 & 0 & 0 & 0 \end{pmatrix} \cdot \begin{pmatrix} 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 8 & 9 \cr 10 & 11 & 12 \end{pmatrix} \cdot \begin{pmatrix} 0 & 0 & 1 \cr 0 & 1 & 0 \cr 1 & 0 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_plot.md000066400000000000000000000007061514557770000277170ustar00rootroot00000000000000--- title: mtx_plot description: plot a matrix categories: - object pdcategory: General see_also: - mtx_print - mtx_show inlets: 1st: - type: matrix description: matrix to display --- {{}} displays a matrix as a 2D image. Values are silently clamped to the \\([0, +1]\\) range. The default greyscale display can be colorised via a mapping table. Note, that this object is very slow and should only be used for small matrices. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_polyval.md000066400000000000000000000003711514557770000304250ustar00rootroot00000000000000--- title: mtx_polyval description: evaluate polynomials with coefficients categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_powtodb.md000066400000000000000000000006001514557770000304100ustar00rootroot00000000000000--- title: mtx_powtodb description: convert a power value to dB for each element of a matrix categories: - object pdcategory: Element Math see_also: - mtx_dbtopow - mtx_dbtorms - mtx_rmstodb inlets: 1st: - type: matrix description: NxM input matrix outlets: 1st: - type: matrix description: NxM output matrix --- Applies {{< pdobj powtodb >}} to each matrix element. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_print.md000066400000000000000000000004451514557770000300750ustar00rootroot00000000000000--- title: mtx_print description: print a matrix to the console categories: - object pdcategory: General see_also: - mtx_show - mtx_plot inlets: 1st: - type: matrix description: matrix to print to the console --- {{}} outputs the matrix to the console, row by row. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_prod.md000066400000000000000000000003731514557770000277050ustar00rootroot00000000000000--- title: mtx_prod description: compute the column-wise product of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_qr.md000066400000000000000000000013451514557770000273630ustar00rootroot00000000000000--- title: mtx_qr description: calculate QR decomposition of a matrix categories: - object pdcategory: Matrix Transformation see_also: - mtx_svd inlets: 1st: - type: matrix description: \(n\times m\) matrix \(\boldsymbol A\) to decompose outlets: 1st: - type: matrix description: \(n\times n\) matrix \(\boldsymbol Q\) 2nd: - type: matrix description: \(n\times m\) matrix \(\boldsymbol R\) draft: false --- This object depends on the GNU Scientific Library. The matrices lists involved have the properties: $$ \boldsymbol A_{n\times m} = \boldsymbol Q \boldsymbol R $$ $$ \boldsymbol Q^\intercal\boldsymbol Q=\boldsymbol Q\boldsymbol Q^\intercal =\bm I $$ $$ \boldsymbol R = \mathrm{triu}_{n\times m}\{\dots\} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rand.md000066400000000000000000000011651514557770000276650ustar00rootroot00000000000000--- title: mtx_rand description: create a matrix with random values categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_ones inlets: 1st: - type: matrix description: create an equally-sized matrix - type: float description: create a square matrix with the given dimensions - type: float float description: create a matrix with the given dimensions - type: seed description: set the seed for the pseudo random generator outlets: 1st: - type: matrix description: matrix with random elements --- Generated pseudo random values are in the range of \\(\left[ 0, 1 \right) \\). iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_randperm.md000066400000000000000000000003551514557770000305510ustar00rootroot00000000000000--- title: mtx_randperm description: random permutation matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_repmat.md000066400000000000000000000003641514557770000302310ustar00rootroot00000000000000--- title: mtx_repmat description: repeat a matrix into a meta matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_resize.md000066400000000000000000000003411514557770000302350ustar00rootroot00000000000000--- title: mtx_resize description: resize a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_reverse.md000066400000000000000000000004051514557770000304100ustar00rootroot00000000000000--- title: mtx_reverse description: reverse order of rows/columns/elements of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rfft.md000066400000000000000000000006521514557770000277020ustar00rootroot00000000000000--- title: mtx_rfft description: real-valued FFT for each matrix row categories: - object pdcategory: Digital Fourier Transformation see_also: - mtx_fft - mtx_ifft - mtx_rifft inlets: 1st: - type: matrix description: input matrix with nfft=\(2^l\) columns for \(l=2,3,\dots\) outlets: 1st: - type: matrix description: output matrix with nfft/2+1 columns for the bins \(k=0\dots\text{nfft}/2\) draft: false --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rifft.md000066400000000000000000000006751514557770000300600ustar00rootroot00000000000000--- title: mtx_rifft description: real-valued inverse FFT for each matrix row categories: - object pdcategory: Digital Fourier Transformation see_also: - mtx_fft - mtx_ifft - mtx_rfft inlets: 1st: - type: matrix description: input matrix with nfft/2+1 columns for the bins \(k=0\dots\text{nfft}/2\) outlets: 1st: - type: matrix description: output matrix with nfft columns, and nfft=\(2^l\) for \(l=2,3,\dots\) draft: false --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rmstodb.md000066400000000000000000000006031514557770000304070ustar00rootroot00000000000000--- title: mtx_rmstodb description: convert a linear value into dB for each element of a matrix categories: - object pdcategory: Element Math see_also: - mtx_dbtopow - mtx_dbtorms - mtx_powtodb inlets: 1st: - type: matrix description: NxM input matrix outlets: 1st: - type: matrix description: NxM output matrix --- Applies {{< pdobj rmstodb >}} to each matrix element. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_roll.md000066400000000000000000000013711514557770000277100ustar00rootroot00000000000000--- title: mtx_roll description: shift columns of a matrix categories: - object pdcategory: Matrix Transformation see_also: - mtx_scroll inlets: 1st: - type: matrix description: input matrix 2nd: - type: float description: shift amount outlets: 1st: - type: matrix description: output matrix --- Shifts matrix columns by *shift amount* to the right, wrapping around. If *shift amount* is negative, columns are shifted to the left. $$ \operatorname{roll}(\begin{pmatrix} 1 & 0 & 0 & 0 & 0 \cr 0 & 2 & 0 & 0 & 0 \cr 0 & 0 & 3 & 0 & 0 \cr 0 & 0 & 0 & 4 & 0 \cr 0 & 0 & 0 & 0 & 5 \end{pmatrix}, 2) = \begin{pmatrix} 0 & 0 & 1 & 0 & 0 \cr 0 & 0 & 0 & 2 & 0 \cr 0 & 0 & 0 & 0 & 3 \cr 4 & 0 & 0 & 0 & 0 \cr 0 & 5 & 0 & 0 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_roots.md000066400000000000000000000003621514557770000301050ustar00rootroot00000000000000--- title: mtx_roots description: solve polyomials with eigenvalues categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rot.md000066400000000000000000000006411514557770000275430ustar00rootroot00000000000000--- title: mtx_rot description: 2d cartesian rotation matrix categories: - object pdcategory: Coordinates see_also: - mtx_rotx - mtx_roty - mtx_rotz - mtx_rotxyz inlets: 1st: - type: float description: rotation angle \(\theta\) (in radian) outlets: 1st: - type: matrix description: 2D rotation matrix --- $$R = \begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rotx.md000066400000000000000000000007061514557770000277350ustar00rootroot00000000000000--- title: mtx_rotx description: 3d cartesian rotation matrix around X-axis categories: - object pdcategory: Coordinates see_also: - mtx_rot - mtx_roty - mtx_rotz - mtx_rotxyz inlets: 1st: - type: float description: rotation angle \(\theta\) (in radian) outlets: 1st: - type: matrix description: 3D rotation matrix --- $$R_x = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_roty.md000066400000000000000000000007071514557770000277370ustar00rootroot00000000000000--- title: mtx_roty description: 3d cartesian rotation matrix around Y-axis categories: - object pdcategory: Coordinates see_also: - mtx_rot - mtx_rotx - mtx_rotz - mtx_rotxyz inlets: 1st: - type: matrix description: rotation angle \(\theta\) (in radian) outlets: 1st: - type: matrix description: 3D rotation matrix --- $$R_y = \begin{pmatrix} \cos \theta & 0 & -\sin \theta \\ 0 & 1 & 0 \\ \sin \theta & 0 & \cos \theta \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_rotz.md000066400000000000000000000007061514557770000277370ustar00rootroot00000000000000--- title: mtx_rotz description: 3d cartesian rotation matrix around Z-axis categories: - object pdcategory: Coordinates see_also: - mtx_rot - mtx_rotx - mtx_roty - mtx_rotxyz inlets: 1st: - type: float description: rotation angle \(\theta\) (in radian) outlets: 1st: - type: matrix description: 3D rotation matrix --- $$R_z = \begin{pmatrix} \cos \theta & \sin \theta & 0 \\ -\sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_row.md000066400000000000000000000021751514557770000275520ustar00rootroot00000000000000--- title: mtx_row description: set rows of a matrix categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_element - mtx_col inlets: 1st: - type: list description: new values for selected matrix row(s) - type: matrix description: new values for all matrix elements of an \(A_{n\times m}\) matrix 2nd: - type: float description: row index outlets: 1st: - type: matrix description: modified matrix arguments: - type: float float [float] description: "initial matrix dimensions; optional: initial row index" --- This object allows you to change a specific row of a matrix. The row to change is selected by its index to the 2nd outlet. Indices are *`1`-based*, so the index {{}} refers to the 2nd row. You can use `0` as a wildcard index, so the index {{}} refers to all rows in the matrix. If the length of the list of new values exceeds the matrix width, the additional values are discarded. If the length of this list is exactly `1`, all elements of the row are set to this value. Otherwise, the length of this list must not be \\(\lt m\\) (less than the matrix width). iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_scroll.md000066400000000000000000000013621514557770000302360ustar00rootroot00000000000000--- title: mtx_scroll description: shift rows of a matrix categories: - object pdcategory: Matrix Transformation see_also: - mtx_roll inlets: 1st: - type: matrix description: input matrix 2nd: - type: float description: shift amount outlets: 1st: - type: matrix description: output matrix --- Shifts matrix rows by *shift amount* to the bottom, wrapping around. If *shift amount* is negative, rows are shifted to the top. $$ \operatorname{scroll}(\begin{pmatrix} 1 & 0 & 0 & 0 & 0 \cr 0 & 2 & 0 & 0 & 0 \cr 0 & 0 & 3 & 0 & 0 \cr 0 & 0 & 0 & 4 & 0 \cr 0 & 0 & 0 & 0 & 5 \end{pmatrix}, 2) = \begin{pmatrix} 0 & 0 & 0 & 4 & 0 \cr 0 & 0 & 0 & 0 & 5 \cr 1 & 0 & 0 & 0 & 0 \cr 0 & 2 & 0 & 0 & 0 \cr 0 & 0 & 3 & 0 & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sfread.md000066400000000000000000000003721514557770000302040ustar00rootroot00000000000000--- title: mtx_sfread description: read multichannel soundfiles into matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sfwrite.md000066400000000000000000000003731514557770000304240ustar00rootroot00000000000000--- title: mtx_sfwrite description: write multichannel soundfile from matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_show.md000066400000000000000000000007251514557770000277220ustar00rootroot00000000000000--- title: mtx_show description: display a matrix categories: - object pdcategory: General see_also: - mtx_print - mtx_plot inlets: 1st: - type: matrix description: matrix to print to the console outlets: 1st: - type: matrix description: changed matrix --- {{}} displays a matrix within the patch. Elements can be edited via double click or by dragging. Note, that this object is very slow and should only be used for small matrices. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sin.md000066400000000000000000000005671514557770000275370ustar00rootroot00000000000000--- title: mtx_sin description: sine (sin) of each element of a matrix categories: - object pdcategory: Element Math see_also: - mtx_cos - mtx_tan - mtx_atan - mtx_atan2 inlets: 1st: - type: matrix description: input outlets: 1st: - type: matrix description: output --- $$B_{m\times n} = \sin^\circ (A_{m\times n}) \quad \equiv \quad b_{ij} = \sin(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_size.md000066400000000000000000000005751514557770000277170ustar00rootroot00000000000000--- title: mtx_size description: get size of a matrix categories: - object pdcategory: General see_also: inlets: 1st: - type: matrix description: \(n\times m\) input matrix outlets: 1st: - type: float description: number of rows \(n\) 2nd: - type: float description: number of columns \(m\) --- Gets the dimension (number of rows and columns) of a matrix. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_slice.md000066400000000000000000000003541514557770000300370ustar00rootroot00000000000000--- title: mtx_slice description: slice parts out of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sndfileread.md000066400000000000000000000004141514557770000312150ustar00rootroot00000000000000--- title: mtx_sndfileread description: read multichannel data from a soundfile into a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sph2cart.md000066400000000000000000000007751514557770000304750ustar00rootroot00000000000000--- title: mtx_sph2cart description: convert spherical to cartesian coordinates (matrix version) categories: - object pdcategory: Coordinates see_also: - mtx_cart2sph inlets: 1st: - type: matrix description: \(3\times L\) matrix containing radius (row 1), azimuth (row 2), zenith (row 3) for the \(L\) coordinates to convert outlets: 1st: - type: matrix description: \(3\times L\) matrix containing x (row 1), y (row 2), z (row 3) of the resulting \(L\) cartesian coordinates draft: false --- mtx_spherical_harmonics.md000066400000000000000000000013521514557770000326750ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_spherical_harmonics description: evaluate the spherical harmonics as matrix categories: - object pdcategory: Spherical Harmonics see_also: - mtx_circular_harmonics - mtx_spherical_harmonics_rotator inlets: 1st: - type: matrix description: \(2\times L\) matrix with azimuth angles (row 1) and zenith angles (row 2) in radians for all \(L\) directions to evaluate outlets: 1st: - type: matrix description: \(L\times (N+1)^2\) matrix with the spherical harmonics evaluated from zeroth to \(N^\mathrm{th}\) order using the numerical creation argument \(N\) of the object draft: false --- Useful for Ambisonic encoding and decoding. The object permits several different normalizations N3D (default), N3D4PI, SN3D, SN3D mtx_spherical_harmonics_rotator.md000066400000000000000000000012621514557770000344470ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_spherical_harmonics_rotator description: create a rotation matrix for spherical harmonics categories: - object pdcategory: Spherical Harmonics see_also: - mtx_spherical_harmonics arguments: - type: float description: order \(n\) of the spherical hamronics inlets: 1st: - type: list description: Euler angles \(\alpha\), \(\beta\) & \(\gamma\) (in radian) for ZYZ rotation outlets: 1st: - type: matrix description: \(R_{{(n+1)^2}\times{(n+1)^2}}\) rotation matrix for spherical harmonics of order \(n\) --- Creates a 3D rotation matrix for spherical harmonics of order \(n\). Useful for manipulating Ambisonic encoded soundfields. mtx_spherical_radial.md000066400000000000000000000004221514557770000321430ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects--- title: mtx_spherical_radial description: calculate spherical radials of a matrix of coordinates categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_spivot.md000066400000000000000000000003571514557770000302670ustar00rootroot00000000000000--- title: mtx_spivot description: semi-pivot transform a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sqrt.md000066400000000000000000000005511514557770000277300ustar00rootroot00000000000000--- title: mtx_sqrt description: calculate the square root of each element of a matrix categories: - object pdcategory: Element Math see_also: - mtx_pow inlets: 1st: - type: matrix description: input outlets: 1st: - type: matrix description: output --- $$B_{m\times n} = \sqrt[\circ] {A_{m\times n}} \quad \equiv \quad b_{ij} = \sqrt(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sub.md000066400000000000000000000011201514557770000275210ustar00rootroot00000000000000--- title: mtx_- description: matrix subtraction categories: - object pdcategory: Element Math aliases: - mtx_sub see_also: - matrix - mtx_+ - mtx_.* - mtx_./ - mtx_.^ - mtx_* inlets: 1st: - type: matrix description: left-hand operand 2nd: - type: matrix description: right-hand operand - type: float description: right-hand operand outlets: 1st: - type: matrix description: result --- $$C_{m\times n} = A_{m\times n} - B_{m\times n} \quad \equiv \quad c_{ij} = a_{ij} - b_{ij} $$ $$C_{m\times n} = A_{m\times n} - b \quad \equiv \quad c_{ij} = a_{ij} - b $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_sum.md000066400000000000000000000003501514557770000275400ustar00rootroot00000000000000--- title: mtx_sum description: column-wise sum of a matrix categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: list description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_svd.md000066400000000000000000000021371514557770000275350ustar00rootroot00000000000000--- title: mtx_svd description: singular value decomposition of a matrix categories: - object pdcategory: Matrix Transformation see_also: - mtx_qr inlets: 1st: - type: matrix description: \(n\times m\) matrix \(\boldsymbol A\) to decompose outlets: 1st: - type: matrix description: \(n\times n\) matrix of left-singular vectors \(\boldsymbol U\) 1: - type: list description: list of singular values \(\boldsymbol s\) 2: - type: matrix description: \(m\times m\) matrix of right-singular vectors \(\boldsymbol V\) draft: false --- This object depends on the GNU Scientific Library. The matrices lists involved have the properties: $$ \boldsymbol A_{n\times m} = \boldsymbol U \mathrm{diag}_{n\times m}\\{\boldsymbol s\\} \boldsymbol{V}^\intercal $$ $$ \boldsymbol U\boldsymbol U^\intercal=\boldsymbol U^\intercal\boldsymbol U=\boldsymbol I_{n\times n} $$ $$ \boldsymbol V\boldsymbol V^\intercal=\boldsymbol V^\intercal\boldsymbol V=\boldsymbol I_{m\times m} $$ $$ \boldsymbol s_{\mathrm{min}\\{n,m\\}\times 1}=[s_1,s_2,\dots]^\intercal $$ with $$ s_1\geq s_2\geq s_3 \dots \geq 0 $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_symasym.md000066400000000000000000000004111514557770000304340ustar00rootroot00000000000000--- title: mtx_symasym description: decompose a matrix into symmetric and asymmetric parts categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_tab.md000066400000000000000000000003641514557770000275070ustar00rootroot00000000000000--- title: mtx_tab description: matrix with a table to store its data categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_tan.md000066400000000000000000000005601514557770000275210ustar00rootroot00000000000000--- title: mtx_tan description: tangent (tan) of matrix elements categories: - object pdcategory: Element Math see_also: - mtx_sin - mtx_cos - mtx_atan - mtx_atan2 inlets: 1st: - type: matrix description: input outlets: 1st: - type: matrix description: output --- $$B_{m\times n} = \tan^\circ (A_{m\times n}) \quad \equiv \quad b_{ij} = \tan(a_{ij})$$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_trace.md000066400000000000000000000004051514557770000300330ustar00rootroot00000000000000--- title: mtx_trace description: get the trace of a matrix (sum of diagonal elements) categories: - object pdcategory: Generic see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_transpose.md000066400000000000000000000005101514557770000307500ustar00rootroot00000000000000--- title: mtx_transpose description: transpose a matrix categories: - object pdcategory: Matrix Transformation see_also: inlets: 1st: - type: matrix description: \(n\times m\) input matrix outlets: 1st: - type: matrix description: \(m\times n\) output matrix --- $$ Y_{m\times n} = X_{n\times m}^\mathsf{T} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_unpack~.md000066400000000000000000000020411514557770000304120ustar00rootroot00000000000000--- title: mtx_unpack~ description: unpack a matrix into signal vectors categories: - object pdcategory: Audio Math see_also: - mtx_pack~ arguments: - type: float description: number of signal inlets - type: description: "`-m` option to enable multichannel mode" inlets: 1st: - type: matrix description: signal vectors outlets: n: - type: signal description: output signal; in multichannel mode, there's only a single outlet --- Takes a matrix with signal vectors with *rows* channels and a blocksize of *columns* (as created by {{}}), and turns it into proper signals. In non-multichannel mode, the number of output channels is determined by the argument. In multichannel mode (`-m`), there is only a single outlet for a multichannel signal. The number of channels in the multichannel signal depends on number of rows in the input matrix. Due to the way Pd works, the number of channels in a multichannel signal cannot change once the DSP is turned on. If you need to change it, restart the DSP. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_window.md000066400000000000000000000004371514557770000302510ustar00rootroot00000000000000--- title: mtx_window description: create a row vector with window functions of different specifications categories: - object pdcategory: Matrix Creation see_also: inlets: 1st: - type: matrix description: ... outlets: 1st: - type: matrix description: ... draft: true --- iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/mtx_zeros.md000066400000000000000000000011731514557770000301020ustar00rootroot00000000000000--- title: mtx_zeros description: create a matrix with all elements set to 0 categories: - object pdcategory: Matrix Creation see_also: - matrix - mtx_ones inlets: 1st: - type: matrix description: create an equally-sized matrix - type: float description: create a square matrix with the given dimensions - type: float float description: create a matrix with the given dimensions outlets: 1st: - type: matrix description: matrix with all elements 0 --- $$ 0_{m\times n} = \begin{pmatrix} 0 & 0 & \dots & 0 \cr 0 & 0 & \dots & 0 \cr \vdots & \vdots & \ddots & \vdots \cr 0 & 0 & \dots & 0 \end{pmatrix} $$ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/objects/pd2md.sh000077500000000000000000000020651514557770000270740ustar00rootroot00000000000000#!/bin/sh helppatch="$1" if ! test -e "${helppatch}"; then echo "'${helppatch}' does not exist!" 1>&2 exit 1 fi title="${helppatch%.pd}" title="${title%-help}" title="${title##*/}" description="$(grep -h DESCRIPTION "${helppatch}" | sed -e 's|^#X text [0-9]* [0-9]* DESCRIPTION \(.*\)|\1|' -e 's|\(, f [1-9][0-9]*\)*;||' -e 's| \\, |, |g')" cat < pd blip-blop *~ dbtorms $1 10 line~ gain *~ pd cross-reverb pd convolve-long-2x2-ir-efficiently-using-block~ metro 700 0.2 0.9 long xreverb short xreverb 0.9 loadbang dac~ 1 2 example_2x2_crossfeed_makeIRs.svg000066400000000000000000001061451514557770000364050ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/convolver inlet mtx_* 2 mtx_- 1 1 $1 22050 mtx_logspace mtx_.* mtx_* 1 / 22050 sqrt list split 3 list prepend array3 2 2 22050 list trim outlet t b f mtx_rand 2 22050 mtx_linspace mtx_* t b a matrix 2 1 60 45 mtx_cos mtx_.* t a a mtx_.* create 2 independent reverb tails combine both mtx zeros 2 22050, element 1 1 1, element 2 2 1, bang create 2 clean unit impulses (no delay, unity gain) mtx_scroll -1 t b f b 2nd row/2->1 crossfeed contains first beating reverb 3rd row/1->2 crossfeed contains second beating reverb 0 1 22050 mtx_concat col create 2 differently beating envelopes make convolver config by serializing and prepending"array3 2 2 22050" 4th row/2->2 row should contain impulse 1st row/1->1 row should contain impulse iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/convolver/index.md000066400000000000000000000114601514557770000315710ustar00rootroot00000000000000--- title: "MIMO convolution" # the lower the weight, the earlier it is sorted weight: 10 draft: false toc: true --- {{}} provides functionality for MIMO (*M*ultiple *I*nputs *M*ultiple *O*utputs) signal processing, using uniformly partitioned block convolution for efficient FIR filtering. ## Basics The {{}} object simply multiplies a matrix \\(A\\) with the the current multi-channel input \\(\vec{x}\\) to obtain the multi-channel output \\(\vec{y}\\); $$ \vec{y} = A \cdot \vec{x} $$ which is $$ y_i[n]=\sum_{j=1}^J a_{ij}x_j[n] $$ Rather than applying a single weight \\(a_{ij}\\) to each input channel, the {{}} applies a convolution at each node: $$ y_i[n] = \sum_{j=1}^J \mathit{IR}_{ij} * x_j[n] $$ ### the `array3` message The complete set of (equal length) impulse responses (IRs) can be seen as a three-dimensional matrix \\(\mathit{IR}_{ijk}\\). Since iemmatrix's {{}} message is defined as a two-dimensional matrix, a new message {{}} is used. The format is {{< pdmsg array3 "" "" "" "" >}} with `outs` and `ins` being the number of output channels (matrix rows) resp. input channels (matrix columns), and `len` being the length of each impulse-response (in samples). The following `data` is the actual impulse responses as a list of floats (in row-major order). E.g. {{< pdmsg array3 3 2 4 " " 1 0 0 0 " " 2 2 2 2 " " 3 0 0 3 " " 1.1 1.2 1.3 1.4 " " 2.1 2.2 2.3 2.4 " " 3.1 -3.2 3.3 -3.4 >}} This describes a \\(3*2\\) matrix with 6 impulse responses (\\(4\\) samples each): | IR | values | |-----|-----------| | \\(\mathit{IR}_{1,1}\\) | \\((1, 0, 0, 0)\\) | | \\(\mathit{IR}_{1,2}\\) | \\((2, 2, 2, 2)\\) | | \\(\mathit{IR}_{1,3}\\) | \\((3, 0, 0, 3)\\) | | \\(\mathit{IR}_{2,1}\\) | \\((1.1, 1.2, 1.3, 1.4)\\) | | \\(\mathit{IR}_{2,2}\\) | \\((2.1, 2.2, 2.3, 2.4)\\) | | \\(\mathit{IR}_{2,3}\\) | \\((3.1,-3.2, 3.3,-3.4)\\) | ### partition size The partition size for the partitioned convolution can be controlled via Pd's block size, using the built-in {{}} object. When changing the impulse response matrix, {{}} will interpolate between the new and the old IR within a single DSP block (so the interpolation time is `blocksize` (in samples)). ## special basic cases With special convolution matrices we can use {{}} to mimic the behaviour of {{}} resp. {{}}. ### SISO convolution The traditional object in Pd for SISO (*S*ingle *I*nput *S*ingle *O*utput) convolution is {{}} from the [bsaylor](https://deken.puredata.info/library/bsaylor) library: ![SISO convolution with [partconv~]](simple_partconv~.svg) Using a \\(1 * 1 * J \\) convolution matrix, we can achieve the same result with {{}}. ![SISO convolution with [mtx_convolver~]](simple_mtx_convolver~.svg) The main differences are: - we pass the impulse response via a `matrix` rather than a table - the partition size is set via {{}} rather than an argument ### matrix multiplication Using IRs of length `1`, we can mimic the {{}} (with a fixed interpolation time): ![matrix multiplication](simple_multiplication.svg) Note that because the multiplication is done as convolution, {{}} is much slower than {{}}. ## Examples ### 2x2 cross-feed reverb ![2x2 cross-feed reverb: overall structure](example_2x2_crossfeed.svg) This patch implements a dynamic 2×2 cross-feed reverb where the impulse responses are generated and updated in real-time during playback. A synthesizer subpatch ({{< pdobj pd blip-blop >}}) generates a short stereo test tone. This signal is fed into a subpatch containing {{< pdobj "mtx_convolver~" >}} with a the 2×2 convolution matrix. The subpatch is configured with a large block size ({{< pdobj "block~" 4096 >}}) (for efficiency reasons). The matrix uses four impulse responses: two short IRs for the direct paths and two longer, modulated IRs for the cross-feed paths. These IRs are synthesized within the {{< pdobj pd cross-reverb >}} subpatch and sent to the convolver as a list message. When the user modifies the reverb parameters, the IRs are regenerated and swapped. ![2x2 cross-feed reverb: dynamically create IRs](example_2x2_crossfeed_makeIRs.svg) The right-hand side of the patch creates two unit impulses (so the left and right input channel will pass through unaltered on their resp. channel). For the cross-over, two more IRs are generated (on the right-hand side), by using a random burst with an exponential decay curve, based on the input parameter (middle) that is modulated with a cosine wave (far right). The modulation of the right resp. left IRs use different period lengths. simple_mtx_convolver~.svg000066400000000000000000000271471514557770000352670ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/convolver mtx_convolver~ 1 1 list trim block~ 2048 mtx_sndfileread open testIR.wav, 1e+06 list split 3 t a a array3 1 1 $1 mtx_size list prepend array3 1 1 N simple_multiplication.svg000066400000000000000000000607421514557770000352170ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/convolver mtx_*~ 3 2 bang mtx_rand 3 2 t a a env~ 99.92 env~ 99.83 env~ 98.12 sig~ 1 sig~ 2 env~ 99.92 env~ 99.83 env~ 98.12 mtx_convolver~ 3 2 list prepend array3 3 2 1 list trim list split 3 simple_partconv~.svg000066400000000000000000000100021514557770000341740ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/convolver table IR partconv~ IR 2048 read -resize testIR.wav IR soundfiler iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/000077500000000000000000000000001514557770000272545ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/1.pd.svg000066400000000000000000000233711514557770000305450ustar00rootroot00000000000000 mtx matrix 2 3 1 2 3 4 5 6 mtx_print A matrix 1 2 0 5 mtx_print B mtx mtx_print B matrix 2 2 0.1 0.2 0.5 -2.18 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/2.pd.svg000066400000000000000000000223311514557770000305410ustar00rootroot00000000000000 mtx mtx_print A zeros 3 4 ones 1 2 eye 3 4 egg 3 4 diag 1 2 3 diegg 3 4 5 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/2a.pd.svg000066400000000000000000000160651514557770000307110ustar00rootroot00000000000000 mtx_zeros mtx_rand mtx_diag mtx_diegg mtx_ones mtx_eye mtx_egg iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/3.pd.svg000066400000000000000000000343311514557770000305450ustar00rootroot00000000000000 mtx_print A mtx_* mtx_print B mtx_print B mtx_+ mtx_&& t a a a t a a a mtx 2 2 1 1.2 0.1 1 mtx 2 2 0.1 1.3 1.5 0.7 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/3a.pd.svg000066400000000000000000000424431514557770000307110ustar00rootroot00000000000000 mtx_+ mtx_- mtx_* mtx_./ mtx_.* mtx_.^ mtx_< mtx_> mtx_<= mtx_>= mtx_== mtx_!= mtx_! mtx_&& mtx_|| mtx_| mtx_& iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/4.pd.svg000066400000000000000000000363721514557770000305550ustar00rootroot00000000000000 matrix 2 2 0.1 1.3 1.5 0.7 mtx_print A mtx_print B mtx element 2 2 10000, bang row 1 0.5 0.5, bang col 2 -5 -5, bang mtx print row 1 col 2 element 2 2 t a a t a a iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/5.pd.svg000066400000000000000000000364411514557770000305530ustar00rootroot00000000000000 mtx_index mtx 1 3 mtx_print idcs 1 5 7 t a a mtx_print A mtx_print C mtx_rand 4 4 mtx_slice mtx_index mtx_fill mtx_fill_rowcol mtx_find_rowcol iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/6.pd.svg000066400000000000000000000645511514557770000305570ustar00rootroot00000000000000 4 4 mtx_minmax mtx_print A 0 mtx_fill mtx_== 0 mtx_find mtx_print C pd rand_integermtx -777 mtx_print C mtx_ones mtx_fill t b b l pack 0 0 t b f mtx_zeros 3 3 matrix $1 $2 10 20 t b a a a a iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/7.pd.svg000066400000000000000000000543651514557770000305620ustar00rootroot00000000000000 mtx_: mtx_cumsum mtx_sin list split 3 t l l list prepend 0 resize $1 list length s sweep tabplay~ sweep dac~ 1 0.05 5e-05 0.25 *~ 0.1 digital frequency sweep iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/8.pd.svg000066400000000000000000001170371514557770000305570ustar00rootroot00000000000000 readsf~ pd downsample dac~ 1 open song.wav, start pd mtx_windowing mtx_.cabs2 mtx_rowrfft s fft pd mtx2tablemsg mtx_powtodb *~ 0.3 mtx_.* pd mtx2tablemsg s peaks mtx_index t a a amplitudes pd mtx_find mtx_find peak_indices t a a a a t a a peaks fft iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/documentation/tutorials/intro/index.md000066400000000000000000000037361514557770000307160ustar00rootroot00000000000000--- title: "A quick introduction to iemmatrix" # the lower the weight, the earlier it is sorted weight: 1 draft: false --- ## hello world A *matrix* is a two-dimensional array of numbers. *iemmatrix* uses a special {{}} message to send matrices from one object to another. This message consists of the selector `matrix` followed by the number of *rows* and *columns*, and finally the data in row-major order: $$ \texttt{[matrix 2 3 10 20 30 40 50 60(} \to \begin{pmatrix} 10 & 20 & 30 \cr 40 & 50 & 60 \end{pmatrix} $$ ![first patch](1.pd.svg) The actual message format usually does not need to concern the user, as matrices are created and processed by specialized objects. ## creating special matrices The {{< pdobj mtx >}} object understands messages to create some special matrices: ![create special matrices](2.pd.svg) There's also a number of specialized objects to create these matrices, e.g. {{< pdobj mtx_ones >}}, {{< pdobj mtx_zeros >}}, {{< pdobj mtx_eye >}}, {{< pdobj mtx_egg >}}, {{< pdobj mtx_diag >}}, {{< pdobj mtx_diegg >}} and {{< pdobj mtx_rand >}}. ## binary operators ![binops](3.pd.svg) The {{< pdobj "mtx_+" >}}, {{< pdobj "mtx_-" >}}, {{< pdobj "mtx_.*" >}}, {{< pdobj "mtx_./" >}}, {{< pdobj "mtx_.^" >}}, {{< pdobj "mtx_>" >}}, {{< pdobj "mtx_>=" >}}, {{< pdobj "mtx_<" >}}, {{< pdobj "mtx_<=" >}}, {{< pdobj "mtx_==" >}} & {{< pdobj "mtx_!=" >}} {{< pdobj "mtx_&&" >}} and {{< pdobj "mtx_||" >}}, {{< pdobj "mtx_&" >}} and {{< pdobj "mtx_|" >}} objects all perform element-wise operations. The operations are the same as their Pd-vanilla non-matrix counterparts. For proper matrix multiplication use {{< pdobj "mtx_*" >}}. ## basic manipulation ![basic manipulation](4.pd.svg) ## advanced manipulation ![advanced manipulation](5.pd.svg) ## Examples ### finding the maximum, replacing it with -777 ![finding the maximum](6.pd.svg) ### lin-swept sine ![lin-swept sine](7.pd.svg) ### simple peak picker ![simple peak picker](8.pd.svg) iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/000077500000000000000000000000001514557770000221525ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/CH3-HRIR.arr3000066400000000000000000000410211514557770000240600ustar00rootroot00000000000000array3 2 7 118 -0.266262 0.17845 0.0227687 0.0811925 0.761925 0.300911 -0.171053 0.946852 1.13141 0.340039 0.807727 0.534805 -0.98742 -1.15788 -1.01817 -1.32577 -0.565258 -0.267245 -0.907484 -0.271772 0.445893 -0.0861147 -0.167268 0.205861 0.211851 0.334938 0.304397 0.135807 0.355797 0.42315 0.332757 0.442587 0.305613 0.149934 0.25234 0.158701 0.0759018 0.114499 -0.0749032 -0.159032 -0.070869 -0.138512 -0.151021 -0.143731 -0.241301 -0.172509 -0.0919354 -0.140144 -0.0941268 -0.0757536 -0.108616 -0.0338714 -0.00527908 -0.00563218 0.0443372 0.020575 0.0295617 0.088078 0.0591025 0.0616861 0.0749282 0.0275166 0.0575542 0.068204 0.00618399 0.0251001 0.0197154 -0.0288991 0.00312414 -0.00459319 -0.038457 -0.00950762 -0.0259437 -0.0367617 -0.00488197 -0.0278458 -0.020244 0.0100857 -0.0179462 0.0024418 0.0236424 -0.015541 0.00516153 0.0211186 -0.00563851 0.0238185 0.0244781 -0.00524356 0.0185861 0.00523805 -0.0166104 0.00959554 -0.00726437 -0.0180336 0.00168349 -0.0230366 -0.0197852 0.00220473 -0.0214008 -0.0108494 0.00222618 -0.0193055 0.00336277 0.0131288 -0.00569187 0.0167384 0.0141508 -0.000689959 0.0237404 0.0126334 0.00085422 0.0203788 0.00154459 -0.0027229 0.0139388 -0.00932709 -0.00764689 0.00383522 0.165011 0.0896604 -0.432786 -0.366747 0.0825781 -0.0500738 0.211778 0.459787 -0.247679 -0.131102 0.753801 0.460233 -0.458942 -1.29906 -1.48418 -0.0466172 0.925919 0.348109 0.635398 1.04507 -0.0278099 -0.460767 -0.00636438 -0.106543 0.013589 0.154956 -0.26494 -0.149796 0.174751 0.0105377 0.0206221 -0.0278751 -0.235705 -0.0408309 0.0294999 -0.0653431 0.117189 0.0334115 -0.143964 0.0468212 0.0665862 -0.00495874 0.0920589 -0.0052281 -0.0444216 0.092017 0.0381827 0.034843 0.104848 0.00366229 -0.00170508 0.0355079 -0.0382929 0.00111454 0.0074016 -0.0793452 -0.0274004 -0.00318851 -0.0384004 0.00579433 -0.0215319 -0.0492979 0.00038845 -0.0284534 -0.0259264 0.0161089 -0.0322548 -0.0193223 0.0147026 -0.0290797 0.00487904 0.0282684 -0.0214985 0.0068192 0.0130143 -0.0183071 0.0219071 0.0105663 -0.0188299 0.0145499 -0.00583986 -0.0108114 0.026874 -0.00521337 -0.00581976 0.0209858 -0.0106386 0.0092624 0.0293307 -0.0110755 0.00635805 0.013032 -0.0166801 0.0143856 0.0115761 -0.0163155 0.0114817 -0.000218435 -0.0120728 0.0184702 -0.00466009 -0.0116032 0.0135692 -0.011777 -0.00441974 0.0161152 -0.0131419 0.000137814 0.012052 -0.0141129 0.00740917 0.00968042 -0.0145469 0.00966978 0.00364056 -0.0129215 0.0130307 -0.00147827 -0.142956 0.539293 0.219027 -0.348682 -1.25425 -0.895826 2.01295 1.69955 -1.72294 0.105656 1.86883 -4.23031 -7.11171 -1.47506 0.946118 -1.39497 -1.08924 0.262797 -0.133905 -0.450628 -0.289579 0.030302 0.436069 0.400135 0.302147 0.374442 0.498047 0.725693 0.416281 -0.0694288 0.296325 0.67307 0.503388 0.489728 0.509605 0.45184 0.519405 0.476002 0.498615 0.568579 0.359883 0.315497 0.456377 0.386052 0.404348 0.430403 0.285584 0.365884 0.435912 0.252017 0.203402 0.213877 0.162436 0.167528 0.0921985 0.0757416 0.147371 0.0308093 -0.0051448 0.0906717 -0.00355272 -0.0260833 0.0510894 -0.042659 -0.0537535 0.00684944 -0.0637871 -0.0552074 -0.0127855 -0.040358 -0.00705082 -0.0200637 -0.0499077 0.00685456 -0.0178099 -0.0284808 0.0303426 -0.0362441 -0.0634749 -0.00587222 -0.0479392 -0.0252405 0.0397465 -0.017349 -0.018822 0.00458063 -0.0409438 -0.0105216 0.00508801 -0.027721 0.0122677 0.00266974 -0.0254539 0.0210849 -0.000747577 -0.0157328 0.0306928 -0.00336024 -0.00657823 0.0359846 -0.00275454 0.00243143 0.0266546 -0.0176977 0.00235897 0.0196294 -0.0195492 0.0073978 0.00803774 -0.0237723 0.0130841 0.00409011 -0.0185593 0.0173274 -0.00389722 -0.0133628 0.0227285 -0.00636252 0.364848 -0.138795 -0.136125 0.58642 1.82749 1.69505 -1.12924 -1.29389 1.42695 -1.55466 -4.75195 2.05723 7.10497 1.80383 -0.665748 2.88678 2.49067 -0.0347177 0.456575 1.1183 0.659459 0.249924 -0.0842324 0.0785861 0.339549 0.176553 0.0855896 -0.0550552 0.041807 0.51295 0.240688 -0.242846 0.0732088 0.220165 0.0180239 0.132031 0.217546 0.198645 0.192874 0.107316 0.228786 0.339033 0.206796 0.248329 0.289717 0.189175 0.265248 0.221465 0.0637136 0.187565 0.249616 0.151134 0.181503 0.192666 0.177638 0.169506 0.0900166 0.134029 0.160069 0.0243932 0.0546293 0.0997947 -0.0123683 0.0297957 0.0716426 -0.0136215 0.0427143 0.0792693 0.00658973 0.0177765 0.0121155 0.00342622 0.0488469 0.0194243 0.0255705 0.0618171 0.0105857 0.0489849 0.100144 0.0353746 0.0576521 0.0716255 -0.00425162 0.0354337 0.0623079 0.0130707 0.0493777 0.0445225 0.00238909 0.0381361 0.0196506 0.000820759 0.0391454 0.00752328 0.00555434 0.0407407 0.00155944 0.0128768 0.0370532 -0.00759114 0.0148651 0.0312443 -0.0062471 0.0241886 0.0220966 -0.0133755 0.0210026 0.00793029 -0.0163928 0.0176405 -0.00841864 -0.0208572 0.0131105 -0.0174553 -0.0161458 0.0113655 -0.0227853 -0.00761777 -0.0271673 -0.156677 0.466117 0.408631 -0.474368 0.279143 0.488671 -1.24871 -0.676453 0.847098 -0.691649 -1.23679 1.14239 1.82875 0.639918 0.135014 -0.0836072 -0.39426 -0.745407 -0.890145 -0.141488 0.480361 0.262483 0.0457052 -0.264164 -0.357355 0.217246 0.157075 -0.366359 -0.130854 0.0426016 -0.0657164 0.15603 0.0927414 -0.117161 0.00479914 -0.044532 -0.0398295 0.15683 0.0280492 -0.0390808 0.0653032 -0.0362301 0.0253582 0.131649 -0.0246006 -0.00284179 0.0597849 -0.0485454 0.0274952 0.0813444 0.00166429 0.054285 0.0374265 0.00336581 0.0997266 0.0374908 -0.0281887 0.0395989 -0.0183553 -0.0247482 0.0472678 -0.0323197 -0.0386496 0.0145804 -0.046461 -0.0218289 0.00987642 -0.0460356 -0.0132057 -0.0127705 -0.0497799 0.0144414 0.00609562 -0.0253512 0.026352 -0.00541865 -0.0167128 0.0401464 0.000396574 -0.00129796 0.0369251 -0.0127933 0.000536271 0.02644 -0.0236669 -0.000183442 0.00952735 -0.0316147 0.00651662 0.00365034 -0.0282816 0.0141255 -0.00273223 -0.0226087 0.0210263 -0.00532737 -0.0126289 0.0243953 -0.0101963 -0.00442929 0.0242578 -0.0134259 0.0032472 0.0191319 -0.019147 0.0062737 0.0109389 -0.0213546 0.00977774 0.00193644 -0.0218055 0.012948 -0.00379997 -0.0165622 0.0166042 -0.00805983 -0.00930572 0.383608 0.4532 0.101903 -0.0687502 -0.72943 -0.19804 1.30522 0.331991 -1.13034 -0.664683 -1.54202 -3.02261 -1.82113 -0.0995168 0.798726 1.39663 0.516053 -0.123018 0.866423 0.793034 0.0621204 0.65599 1.02472 0.752166 0.764607 0.651553 0.737997 0.87637 0.323506 0.0683255 0.257325 0.0981971 0.136345 0.192642 -0.145508 -0.132892 -0.0567734 -0.264117 -0.168893 -0.170925 -0.426839 -0.364056 -0.331525 -0.384801 -0.239523 -0.30864 -0.401174 -0.24103 -0.250754 -0.262842 -0.141993 -0.180354 -0.130577 -0.00603331 -0.0420663 0.0285281 0.0988928 0.0315423 0.100017 0.137321 0.0820206 0.144546 0.114116 0.0409297 0.103675 0.0689562 0.0253171 0.0744923 0.0159029 -0.0035323 0.0347927 -0.0365791 -0.033593 -0.00121819 -0.0557925 -0.0151463 0.00182303 -0.0639902 -0.0261368 -0.0283694 -0.0656163 0.00849715 0.00661593 -0.0282654 0.0159808 -0.0219577 -0.0409647 0.00969933 -0.0265686 -0.0231525 0.0143926 -0.0346986 -0.0201083 0.00659868 -0.0350356 -0.0015397 0.00943985 -0.0318554 0.0102225 0.0118585 -0.0160219 0.027043 0.00667645 -0.0153104 0.0278602 0.000895623 -0.00673042 0.0271319 -0.0118817 -0.00695178 0.0215054 -0.0175085 -0.00183081 0.0123259 -0.0256215 0.00252862 0.00793897 -0.0233372 0.0733859 -0.0816975 -0.302332 -0.0520776 0.0737524 0.296332 0.414799 -0.391405 -0.490438 0.306023 0.00346413 0.0509253 0.72514 -0.567685 -1.3222 0.468523 0.75727 -0.379539 0.263187 0.698354 -0.152899 -0.182518 0.0561097 -0.168576 -0.0243267 0.0524879 -0.0942852 0.0125578 0.0182664 0.00654439 0.0913243 -0.0591562 -0.0743217 0.0487595 -0.0832071 -0.0662814 0.0790213 -0.0162535 -0.0393784 0.0134345 -0.0351456 0.00696767 0.0137833 -0.0536584 -0.0116051 -0.0208431 -0.0465586 0.0238674 -0.00069696 -0.02619 0.0251371 -0.0113417 -0.0129968 0.0384582 0.00549371 0.00829509 0.0246231 -0.00400191 0.0326961 0.0338841 -0.00651076 0.0320406 0.0171608 -0.0179024 0.0327396 0.0159981 -0.0174433 0.0170095 -0.00986249 -0.0267379 0.00921096 -0.00984782 -0.0119207 0.00271183 -0.0217906 -0.00275414 0.00588926 -0.0211885 0.00243884 -0.00184208 -0.0205348 0.0184802 0.00646437 -0.015031 0.0188586 -0.000487239 -0.0125957 0.022066 0.00219694 -0.00289199 0.0175397 -0.0103342 -0.0051835 0.0116647 -0.0121896 0.00188208 0.00721451 -0.0161898 0.0061098 0.00646422 -0.0118168 0.0108769 0.000262644 -0.012735 0.0125176 -0.000633226 -0.0052062 0.0152237 -0.00503275 -0.00322893 0.013193 -0.00752589 0.00162511 0.0102394 -0.0121951 0.00223614 0.00580855 -0.0119856 0.086132 0.13892 -0.0245091 -0.319826 -0.40491 -0.292564 0.0163026 -0.361707 -1.29525 -0.903445 -0.0823649 -0.55499 -0.316773 1.24327 1.69487 1.10066 0.642918 0.283367 0.456833 0.61179 -0.0694549 -0.326631 0.0321736 -0.0823995 -0.171276 -0.126489 -0.414521 -0.350899 -0.137703 -0.380262 -0.395529 -0.265562 -0.434566 -0.315214 -0.0700016 -0.144422 -0.0944314 0.00968982 -0.0407596 0.0916849 0.219884 0.152714 0.160519 0.167334 0.133866 0.191875 0.18155 0.113598 0.102074 0.0486219 0.0223359 0.0673318 0.0448454 -0.0122698 -0.0498231 -0.0753372 -0.0543083 -0.0453531 -0.0620665 -0.0588582 -0.0819169 -0.0861156 -0.0367062 -0.026098 -0.0277753 -0.0133726 -0.0237436 -0.00518332 0.0248182 0.0218375 0.0363232 0.0263925 -0.00454845 0.0254342 0.0393483 0.0179189 0.0264954 0.00518853 -0.0201485 0.00453782 0.00270117 -0.00371978 0.00750105 -0.0202162 -0.0233989 -6.55048e-05 -0.0170842 -0.0104192 0.00639398 -0.0151235 -0.00371366 0.0130162 -0.00145987 0.0132096 0.0177579 1.94962e-06 0.0145387 0.0153724 0.00468175 0.0175665 0.00663475 -0.00446039 0.00597785 -0.00621631 -0.0075921 0.00149749 -0.0168481 -0.0158915 -0.00615334 -0.0170208 -0.00676919 -0.00141187 -0.014138 -0.00260499 0.000782035 -0.00426651 0.0114169 0.00785433 -0.14962 -0.145979 0.228394 0.393957 -0.0486286 0.283868 0.315365 -1.1912 -0.499844 1.66283 -0.344766 -2.44682 0.726806 2.72624 0.50505 -0.274907 0.295371 -0.519566 -0.921966 -0.595207 -0.415207 0.148473 0.284136 -0.0914697 0.057213 -0.000715983 -0.221694 0.157224 0.146361 -0.240973 -0.074828 0.0646633 0.0151214 0.152675 0.0928586 -0.0387309 -0.00921803 -0.064025 -0.00515535 0.107658 -0.00525574 -0.0405346 -0.000422582 -0.0445106 0.0109888 0.0257172 -0.0326253 0.000546556 -0.0668426 -0.110409 0.0362928 0.0447695 -0.0195963 0.0247825 -0.000780035 0.0106596 0.0739116 0.0107933 0.012177 0.0518395 -0.0260383 -0.00139252 0.0598436 4.66929e-05 0.00926805 0.0329684 -0.0137067 0.00546524 0.0128344 -0.00646834 0.0230535 -0.00941401 -0.035341 0.0122442 -0.00662271 -0.0162693 0.0262201 -0.00267747 -0.0213677 0.000895731 -0.00532458 0.0136986 0.0128431 -0.0208982 0.00315274 0.00550455 -0.0179948 0.0103364 0.000593695 -0.0221801 0.00560475 -0.00367352 -0.00892857 0.0161175 -0.00723771 -0.0108499 0.00875788 -0.0110689 0.00242548 0.0160927 -0.0132532 -0.000719992 0.00665335 -0.0136276 0.00910922 0.00891992 -0.012335 0.00580349 -0.0025887 -0.0112805 0.013219 -0.00135528 -0.00923695 0.00781727 -0.00877032 -0.00319823 0.0130345 -0.00740429 0.401012 -0.747668 -0.832499 1.33838 1.66064 -0.439507 -1.60356 -0.617479 0.671369 -0.55015 -1.48525 2.95062 6.73811 2.94212 -0.947816 0.655127 1.62559 0.21022 0.0994419 0.596691 0.444879 0.242521 -0.21499 -0.497547 -0.317821 -0.421051 -0.545295 -0.487361 -0.593068 -0.430298 -0.176733 -0.418735 -0.625818 -0.577341 -0.631262 -0.613711 -0.503774 -0.496191 -0.506897 -0.546099 -0.55236 -0.402942 -0.303387 -0.367746 -0.435407 -0.40899 -0.343089 -0.345717 -0.3405 -0.239743 -0.207016 -0.242416 -0.1906 -0.109239 -0.0576318 -0.0639975 -0.122112 -0.0750076 0.0046439 -0.0207913 0.00445593 0.0372866 -0.0301106 -0.00488442 0.072305 0.0518431 0.0484755 0.0499201 0.0216398 0.0425868 0.0327346 0.014931 0.0583268 0.0221274 -0.0298169 0.0240116 0.0344471 0.00940584 0.0398198 0.0400353 0.0258219 0.0250554 -0.00137425 0.00608505 0.0231678 0.00711857 0.0266472 0.0342241 0.00424556 0.0139757 0.0148262 -0.00225326 0.0151981 0.00945286 -0.0046582 0.00760504 -0.00733678 -0.0114207 0.00500932 -0.0128788 -0.0129592 4.3236e-05 -0.0151748 -0.0039655 0.00658614 -0.00904495 0.00494282 0.00685064 -0.009954 0.00730356 0.00740829 -0.00445102 0.00989298 0.000277388 -0.00780981 0.007863 -0.00348384 -0.00612008 0.437251 -0.437613 -0.543218 1.41474 1.8746 0.579306 -0.26209 -0.319224 0.174661 -1.31527 -3.71928 -0.0153004 5.89786 3.75803 -0.551959 1.4365 3.24643 1.03389 0.0728411 0.955763 1.13551 0.674764 -0.0267842 -0.124408 0.442416 0.281292 -0.074496 0.165822 0.118462 0.00234596 0.252726 0.168987 -0.0605947 0.00300872 0.0372378 0.074662 0.184089 0.197895 0.196587 0.162049 0.131211 0.248421 0.320751 0.263301 0.227031 0.223749 0.234251 0.187989 0.113486 0.172439 0.204433 0.111346 0.119965 0.181736 0.172154 0.14735 0.0808079 0.0656943 0.130221 0.0802275 0.0250176 0.0638615 0.0190028 -0.0141052 0.0464488 0.0424407 0.0272805 0.0382225 0.0125428 0.0265732 0.0307917 -0.00624346 0.0266821 0.0323714 -0.0105696 0.0347951 0.0621235 0.0294788 0.0499172 0.0605081 0.043397 0.0462907 0.0284234 0.029646 0.04664 0.024709 0.0370416 0.0569234 0.0223743 0.0187302 0.0281533 0.0115531 0.0260848 0.0278829 0.00986109 0.0222035 0.0131378 0.00451985 0.0264867 0.0129179 0.00432737 0.0195568 0.00178947 0.00574959 0.0248558 0.00410262 0.00409725 0.00996154 -0.00882018 0.00355687 0.00686242 -0.0118471 0.000723535 -0.00439886 -0.0181535 0.00193879 -0.00325023 -0.0118708 -0.052789 -0.0147274 0.229575 0.327672 -0.276874 0.498998 0.947942 -1.70733 -1.55583 2.0644 0.169949 -3.25377 0.487125 3.59673 0.71906 -0.732466 0.337843 0.090267 -0.520372 -0.924603 -0.780024 0.476288 0.58547 -0.230583 0.0406995 -0.00604029 -0.452662 0.0536224 0.154551 -0.284565 -0.100775 -0.0306979 -0.0835753 0.177133 0.0651457 -0.112708 -0.0174974 -0.104155 -0.0232638 0.174837 0.0147424 -0.0502323 0.0289363 -0.0186186 0.0445326 0.061068 -0.00861444 0.0570499 -0.0157442 -0.095184 0.0645472 0.0781317 0.000950604 0.0407524 0.00668564 0.025325 0.0781828 -0.0108599 0.00858632 0.0491091 -0.0571074 -0.0227688 0.0405879 -0.0307818 -0.0161603 -0.00351061 -0.0420511 -0.00478067 -0.0222181 -0.0320779 0.025312 -0.0342515 -0.0552057 0.0245057 -0.00584462 -0.0130544 0.0340605 -0.00941672 -0.00874733 0.017515 -0.00717479 0.0280989 0.0238381 -0.0249017 0.0170157 0.0109118 -0.025163 0.0184422 -0.00250865 -0.0299423 0.0133669 -0.00830956 -0.0150922 0.0181242 -0.0173839 -0.0104704 0.0175654 -0.017684 0.00413206 0.0210791 -0.018232 0.00722397 0.0122369 -0.0177505 0.0167172 0.00943308 -0.0172381 0.0138426 -0.00363166 -0.0153481 0.0174227 -0.0084912 -0.0123923 0.0131154 -0.0160601 -0.00540967 0.0159949 -0.0142874 -0.0833929 0.629043 0.588826 -0.570699 -0.939489 0.343117 1.45131 0.179721 -1.27628 -0.227258 -0.505002 -3.49398 -3.1294 0.43753 1.25686 0.381274 0.664601 0.597679 0.191478 0.350038 0.407637 0.647943 0.920565 0.643781 0.735711 0.998034 0.685054 0.652254 0.717579 0.24282 0.0786991 0.19096 0.0312837 0.0587479 0.0941787 -0.148886 -0.196519 -0.184983 -0.287634 -0.240754 -0.272781 -0.423103 -0.402344 -0.357574 -0.349227 -0.297465 -0.294287 -0.281314 -0.263613 -0.282235 -0.189582 -0.0826724 -0.0841945 -0.0607525 -0.0245594 0.0153118 0.0973653 0.103018 0.0915771 0.130955 0.0996869 0.0893625 0.144017 0.112242 0.0671156 0.0629222 0.0335581 0.0422263 0.0532321 0.017774 0.0111591 -0.0193884 -0.0590303 -0.0169117 -0.00361935 -0.0328454 -0.0204717 -0.0329749 -0.0506585 -0.031859 -0.0325445 -0.0147428 0.00372877 -0.0237224 -0.01118 0.00339836 -0.0303302 -0.0186601 -0.00466246 -0.0255276 -0.00956026 -0.0102423 -0.0279579 -0.00602118 -0.0125836 -0.0224665 0.00350373 -0.00717486 -0.00956078 0.0144875 -0.00236397 0.000684041 0.0209969 0.000638911 0.00529277 0.0159365 -0.00371492 0.00795851 0.0104496 -0.00888599 0.00700214 0.00238099 -0.0145416 0.00424524 -0.00357357 -0.0140311 0.00445105 -0.0074893 -0.0654957 0.0478472 -0.0948563 -0.119802 -0.0565611 0.0239028 0.405926 0.194502 -0.755698 -0.524192 0.657999 0.522724 -0.338922 -0.261414 -0.109507 -0.379287 0.0412287 0.6524 0.293356 -0.108364 0.2075 0.239348 -0.184734 -0.192499 0.0599332 0.0652671 -0.0364592 -0.106963 -0.0544659 0.0951306 0.0387577 -0.088658 -0.0346776 -0.0512635 -0.11598 -0.021025 0.00659108 -0.0496043 -0.013164 -0.0124432 -0.0258664 0.0241722 -6.57573e-05 -0.0239526 0.0152627 -0.0155793 -0.0263815 0.0302628 0.0198876 0.00168236 0.0160324 0.000638441 0.00770794 0.020165 0.00587587 0.022382 0.0174547 -0.0121601 0.0137567 0.0263609 0.0041006 0.00952158 0.00601805 0.00204524 0.0145139 -0.00281266 -0.00313468 0.0170132 -0.00525413 -0.0117485 0.005062 -0.0101012 -0.0072047 0.00807449 -0.0068775 -0.00814641 -0.00596917 -0.0155749 -0.000845384 0.00266499 -0.0128428 -0.00471351 5.89101e-05 -0.0027628 0.00553782 -0.000676691 -0.00592649 0.00294797 0.00186973 0.00484064 0.00803708 -0.00206202 0.000573394 0.00418023 -0.00286924 0.00177105 0.00295349 -0.000767589 0.00421936 -0.00175293 -0.0040893 0.00623266 0.00112399 -0.00125255 0.00403257 -0.00442853 -0.00153383 0.00641179 -0.00191573 0.000965221 0.0039948 -0.00531779 0.000768528 0.00351853 -0.00359794 0.0029187 0.00015187 -0.00687216 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/matrix-help.pd000066400000000000000000000077601514557770000247430ustar00rootroot00000000000000#N canvas 94 0 1118 745 10; #X declare -lib iemmatrix; #X obj 258 -23 matrix; #X obj 61 187 mtx_check; #X obj 61 216 mtx_print; #X obj 544 -21 mtx; #X obj 30 535 mtx_print; #X obj 30 513 matrix; #X msg 42 372 zeros 5; #X msg 30 353 eye 3; #X msg 49 390 ones 4; #X msg 55 411 diag 1 2 3 4; #X obj 369 531 matrix; #X obj 471 496 loadbang; #X obj 471 516 mtx_diag 4 3 1 2; #X obj 369 553 print; #X msg 369 364 row; #X msg 539 497 bang; #X msg 379 404 row \$1; #X floatatom 379 385 4 0 0 0 - - - 0; #X floatatom 391 424 4 0 0 0 - - - 0; #X msg 391 443 row \$1 1 2 3 4; #X floatatom 498 382 4 0 0 0 - - - 0; #X floatatom 510 421 4 0 0 0 - - - 0; #X msg 488 362 col; #X msg 498 401 col \$1; #X msg 510 440 col \$1 1 2 3 4; #X msg 592 364 element; #X msg 623 406 element \$1; #X floatatom 643 428 4 0 0 0 - - - 0; #X msg 643 447 element 3 \$1; #X floatatom 623 386 4 0 0 0 - - - 0; #X msg 61 162 matrix 3 3 1 2 3 4 5 6 7; #X msg 39 136 matrix 3 3 1 2 3 4 5 6 7; #X text 43 79 this is \, how a matrix really looks...; #X text 216 134 an "illegal" matrix; #X text 122 187 make the "illegal" matrix consistent; #X text 216 103 a "legal" matrix; #X msg 40 103 matrix 3 3 1 2 3 1 2 4 7 6 5; #X obj 590 218 mtx_print; #X obj 590 196 matrix; #X obj 655 174 mtx_ones 10; #X msg 655 154 bang; #X text 121 218 print to stderr (like "print"); #X msg 590 64 bang; #X floatatom 615 103 4 0 0 0 - - - 0; #X msg 604 85 matrix 2 3 10 10 30 20 -5 8; #X msg 627 126 1 2 3 1 2 3 10 20 30; #X text 758 118 a list of elements; #X text 759 132 has to fit the size of the "current" matrix; #X text 651 104 set all elements of the current matrix to a value; #X text 366 345 get/set rows; #X text 479 344 get/set columns; #X text 5 564 create various matrices; #X text 356 -21 matrix operations; #X text 636 197 ==; #X obj 660 197 mtx; #X msg 335 398 bang; #X text 586 344 get/set elements; #X msg 654 486 element \$1 2 10; #X floatatom 654 468 4 0 0 0 - - - 0; #X msg 702 406 element \$1 \$1; #X text 687 406 ==; #X obj 161 479 matrix 3 2; #X obj 161 525 mtx_print; #X msg 161 357 bang; #X text 143 542 an "empty" [3 \, 2] matrix; #X msg 73 433 egg 4; #X msg 75 455 diegg 3 2 1; #X obj 126 671 mtx_element; #X obj 225 646 mtx_size; #X obj 225 669 mtx_transpose; #X obj 427 650 mtx_mean; #X obj 427 669 mtx_rand; #X obj 338 670 mtx_inverse; #X obj 126 646 mtx_eye; #X obj 338 645 mtx_+; #X text 127 620 see also help for:; #X msg 912 383 write /tmp/my_matrix.mtx; #X msg 912 406 read /tmp/my_matrix.mtx; #X obj 810 412 mtx_rand; #X msg 810 390 4 5; #X msg 858 389 bang; #X obj 858 464 mtx_print; #X text 848 351 load and save matrices; #X obj 858 440 matrix test.mtx; #N canvas 460 154 494 171 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 65 INLET_0 message (matrix description); #X text 12 45 DESCRIPTION create and store a 2d matrix; #X obj 13 150 declare -lib iemmatrix; #X restore 971 676 pd META; #X connect 1 0 2 0; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 7 0 5 0; #X connect 8 0 5 0; #X connect 9 0 5 0; #X connect 10 0 13 0; #X connect 11 0 12 0; #X connect 12 0 10 1; #X connect 14 0 10 0; #X connect 15 0 12 0; #X connect 16 0 10 0; #X connect 17 0 16 0; #X connect 18 0 19 0; #X connect 19 0 10 0; #X connect 20 0 23 0; #X connect 21 0 24 0; #X connect 22 0 10 0; #X connect 23 0 10 0; #X connect 24 0 10 0; #X connect 25 0 10 0; #X connect 26 0 10 0; #X connect 27 0 28 0; #X connect 28 0 10 0; #X connect 29 0 26 0; #X connect 30 0 1 0; #X connect 31 0 2 0; #X connect 36 0 2 0; #X connect 38 0 37 0; #X connect 39 0 38 1; #X connect 40 0 39 0; #X connect 42 0 38 0; #X connect 43 0 38 0; #X connect 44 0 38 0; #X connect 45 0 38 0; #X connect 55 0 10 0; #X connect 57 0 10 0; #X connect 58 0 57 0; #X connect 61 0 62 0; #X connect 63 0 61 0; #X connect 65 0 5 0; #X connect 66 0 5 0; #X connect 76 0 83 0; #X connect 77 0 83 0; #X connect 78 0 83 0; #X connect 79 0 78 0; #X connect 80 0 83 0; #X connect 83 0 81 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/matrix~-help.pd000066400000000000000000000112511514557770000251270ustar00rootroot00000000000000#N canvas 59 -12 889 598 12; #X declare -lib iemmatrix; #X obj 68 271 osc~ 100; #X obj 68 297 *~ 0.2; #X obj 112 320 osc~ 1000; #X obj 112 346 *~ 1.5; #X obj 157 295 osc~ 432; #X obj 68 411 env~; #X floatatom 68 435 4 0 0 0 - - - 0; #X obj 127 410 env~; #X floatatom 127 434 4 0 0 0 - - - 0; #X obj 187 410 env~; #X floatatom 187 434 4 0 0 0 - - - 0; #X obj 247 409 env~; #X floatatom 247 433 4 0 0 0 - - - 0; #X floatatom 284 350 4 0 0 0 - - - 0; #X text 332 353 fade time in [ms]; #X msg 265 100 bang; #X obj 265 127 mtx_eye 3 4; #X msg 362 100 bang; #X obj 362 127 mtx_egg 3 4; #X msg 261 179 bang; #X msg 362 178 bang; #X obj 261 206 mtx_ones 3 4; #X obj 362 205 mtx_zeros 3 4; #X obj 68 371 matrix~ 3 4 100 .......; #X obj 158 32 matrix~; #X text 236 31 matrix-multiply m IN~signals to n OUT~signals; #X text 174 60 matrices are interpolated a la line~; #X text 473 91 the one-before-last inlet eats; #X text 476 104 matrix-messages to control the gains; #X text 475 117 of the matrix~; #X text 484 333 the last inlet gets the fade-time between two matrix-messages.; #X obj 78 505 matrix~; #X text 154 503 creation: "matrix~ [ [ []]]; #N canvas 460 154 493 221 META 0; #X text 12 135 AUTHOR IOhannes m zmoelnig; #X text 12 155 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 5 KEYWORDS signal matrix; #X text 12 25 LICENSE GPL-2+; #X text 12 45 DESCRIPTION matrix multiplication of signals (with interpolation), f 67; #X text 12 64 INLET_0..R-1 input signal; #X text 12 80 INLET_R matrix; #X text 12 97 INLET_R+1 interpolation time; #X text 12 115 OUTLET_0 output signals; #X obj 13 180 declare -lib iemmatrix; #X restore 821 556 pd META; #X text 604 26 OBSOLETE; #X text 604 46 OBSOLETE; #X text 64 26 OBSOLETE; #X text 64 46 OBSOLETE; #X text 64 36 DEPRECATED; #X text 604 36 DEPRECATED-->; #X obj 698 16 cnv 20 100 60 empty empty empty 20 12 0 12 #ff8300 #404040 0; #N canvas 34 69 743 638 LEGACY 0; #X obj 50 163 sig~; #X floatatom 180 166 5 0 0 0 - - - 0; #X text 286 127 this object \, accepted the signals at the first inputs \, then the matrix (and finally the fade-time); #X text 295 163 OUT~^[n] = IN~^[m] * B[m*x]; #X obj 147 317 sig~; #X msg 97 283 time 100; #X obj 84 163 sig~; #X obj 50 188 matrix~ 2 3 100; #X obj 118 135 mtx 2 3; #X obj 25 346 matrix_mul_line~ 2 3 100; #X obj 190 317 sig~; #X text 288 262 this object \, accepted the signals at the inlets \; all! messages went to the 1st inlet; #X obj 25 284 mtx 3 2; #X text 297 298 OUT~^[n] = B[n*m] * IN~^[m]; #X text 288 183 this is a _very_ unusual way to notate signal matrix multiplications; #X text 290 318 this conforms to the way how signal matrix multiplications is usually notated \, however \, we didn't like that the incoming matrix had different dimensions than the object ([mtx N M] vs [matrix_mul_line~ M N]) \; and the 1st inlet was a bit overloaded.; #X text 69 37 [matrix~] and [matrix_mul_line~] are 2 predecessors of a shiny new [mtx_*~].; #X text 84 78 we believe that the old objects had some design flaws:; #X text 226 471 - it has a clean interface; #X text 226 491 - it uses standard matrix notation: OUT~[1*n]^ = A[n*m] * IN~^[m*1], f 67; #X text 225 512 - it supports multichannel connections (and dynamic number channels, f 67; #X text 206 446 conversely \, the new [mtx_*~] should be used in any new project:, f 64; #X text 208 548 for compatibility's sake we probably will not completely remove the old and deprecated versions \, but you will get annoying warnings whenever you use them.; #X obj 34 465 sig~; #X obj 75 465 sig~; #X floatatom 115 500 5 0 0 0 - - - 0; #X obj 2 435 mtx 3 2; #X obj 2 499 mtx_*~ 3 2 100; #X obj 2 524 env~; #X obj 49 524 env~; #X obj 97 524 env~; #X obj 26 371 env~; #X obj 107 371 env~; #X obj 190 371 env~; #X obj 50 214 env~; #X obj 101 214 env~; #X obj 152 214 env~; #X connect 0 0 7 0; #X connect 1 0 7 3; #X connect 4 0 9 0; #X connect 5 0 9 0; #X connect 6 0 7 1; #X connect 7 0 34 0; #X connect 7 1 35 0; #X connect 7 2 36 0; #X connect 8 0 7 2; #X connect 9 0 31 0; #X connect 9 1 32 0; #X connect 9 2 33 0; #X connect 10 0 9 1; #X connect 12 0 9 0; #X connect 23 0 27 1; #X connect 24 0 27 2; #X connect 25 0 27 3; #X connect 26 0 27 0; #X connect 27 0 28 0; #X connect 27 1 29 0; #X connect 27 2 30 0; #X restore 714 36 pd LEGACY; #X connect 0 0 1 0; #X connect 1 0 23 0; #X connect 2 0 3 0; #X connect 3 0 23 1; #X connect 4 0 23 2; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 13 0 23 4; #X connect 15 0 16 0; #X connect 16 0 23 3; #X connect 17 0 18 0; #X connect 18 0 23 3; #X connect 19 0 21 0; #X connect 20 0 22 0; #X connect 21 0 23 3; #X connect 22 0 23 3; #X connect 23 0 5 0; #X connect 23 1 7 0; #X connect 23 2 9 0; #X connect 23 3 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_abs-help.pd000066400000000000000000000016221514557770000250630ustar00rootroot00000000000000#N canvas 128 118 725 254 10; #X declare -lib iemmatrix; #X text 136 10 absolute value of matrix elements; #X obj 595 43 matrix; #X text 465 42 see also help for; #X obj 48 100 mtx 3 3; #X text 45 42 compute the absolute value of each element of a matrix; #X obj 595 63 abs; #X obj 48 164 mtx_abs; #X obj 48 192 mtx_print abs; #X obj 48 131 t a a; #X obj 91 132 mtx_print org; #X msg 48 80 0 1 -2 -3 -4 5 -6 7 8; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 45 DESCRIPTION calculate absolute values of matrix elements; #X text 12 65 INLET_0 message; #X obj 16 147 declare -lib iemmatrix; #X restore 601 206 pd META; #X connect 3 0 8 0; #X connect 6 0 7 0; #X connect 8 0 6 0; #X connect 8 1 9 0; #X connect 10 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_add-help.pd000066400000000000000000000024321514557770000250460ustar00rootroot00000000000000#N canvas 363 101 510 313 10; #X declare -lib iemmatrix; #X obj 392 26 matrix; #X text 262 25 see also help for; #X text 8 42 matrix arithmetic: adding; #X obj 46 176 mtx_add; #X obj 125 177 mtx_+; #X obj 123 147 mtx_diag 1 2 3 4 5; #X obj 46 147 mtx_ones 5; #X obj 46 124 t b b; #X obj 46 198 mtx_print; #X msg 46 105 bang; #X text 100 178 ==; #X obj 263 147 mtx_eye 4; #X obj 263 172 mtx_add 10; #X msg 263 120 bang; #X obj 263 199 mtx_print; #X floatatom 332 103 4 0 0 0 - - - 0; #X obj 332 122 t b f; #X obj 360 172 mtx_+ 10; #X text 339 173 ==; #X text 38 227 add 2 matrices; #X text 232 231 add an offset to a matrix; #X obj 17 23 mtx_add; #X obj 81 23 mtx_+; #X obj 392 47 +; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 message; #X text 12 45 DESCRIPTION matrix addition; #X obj 16 147 declare -lib iemmatrix; #X restore 371 276 pd META; #X connect 3 0 8 0; #X connect 5 0 3 1; #X connect 6 0 3 0; #X connect 7 0 6 0; #X connect 7 1 5 0; #X connect 9 0 7 0; #X connect 11 0 12 0; #X connect 12 0 14 0; #X connect 13 0 11 0; #X connect 15 0 16 0; #X connect 16 0 11 0; #X connect 16 1 12 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_and-help.pd000066400000000000000000000024331514557770000250610ustar00rootroot00000000000000#N canvas 224 247 501 334 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 100 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 339 193 ==; #X obj 17 23 mtx_and; #X obj 81 23 mtx_&&; #X obj 392 77 &&; #X obj 46 196 mtx_and; #X obj 125 197 mtx_&&; #X obj 263 192 mtx_and 0; #X obj 360 192 mtx_&& 0; #X text 8 42 matrix logic: logical AND; #X text 38 247 AND 2 matrices; #X text 246 251 AND a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 message; #X text 12 45 DESCRIPTION matrix logic AND; #X obj 16 147 declare -lib iemmatrix; #X restore 444 9 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_atan-help.pd000066400000000000000000000016251514557770000252440ustar00rootroot00000000000000#N canvas 262 127 680 254 10; #X declare -lib iemmatrix; #X obj 595 73 matrix; #X text 465 72 see also help for; #X obj 48 100 mtx 3 3; #X obj 48 192 mtx_print atan; #X obj 48 131 t a a; #X obj 91 132 mtx_print org; #X msg 48 80 0 1 -2 -3 -4 5 -6 7 8; #X obj 48 164 mtx_atan; #X obj 595 93 atan; #X text 136 10 arc tangent value of matrix elements; #X text 45 42 compute the arc tangent of each element of a matrix; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 message; #X text 12 45 DESCRIPTION calculate arctangent (atan) of matrix elements; #X obj 16 147 declare -lib iemmatrix; #X restore 621 16 pd META; #X connect 2 0 4 0; #X connect 4 0 7 0; #X connect 4 1 5 0; #X connect 6 0 2 0; #X connect 7 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_bessel-help.pd000066400000000000000000000065651514557770000256060ustar00rootroot00000000000000#N canvas 259 0 594 852 10; #X declare -lib iemmatrix; #N canvas 0 0 450 300 (subpatch) 0; #X array j0 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 219 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y0 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 218 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array j1 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 379 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y1 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 378 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array j2 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 549 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y2 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 548 graph; #N canvas 0 0 450 300 plot 0; #X obj 60 19 inlet; #X obj 44 198 mtx; #X obj 58 42 t a a; #X obj 39 70 mtx_size; #X obj 39 112 until; #X obj 39 92 t f b; #X obj 68 131 + 1; #X obj 39 131 i; #X msg 82 93 1; #X obj 43 152 t f f; #X obj 152 243 outlet; #X obj 44 222 list prepend 0; #X obj 45 243 outlet; #X obj 152 219 - 1; #X msg 44 175 col \$1; #X connect 0 0 2 0; #X connect 1 0 11 0; #X connect 2 0 3 0; #X connect 2 1 1 1; #X connect 3 1 5 0; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 5 1 8 0; #X connect 6 0 7 1; #X connect 7 0 6 0; #X connect 7 0 9 0; #X connect 8 0 7 1; #X connect 9 0 14 0; #X connect 9 1 13 0; #X connect 11 0 12 0; #X connect 13 0 10 0; #X connect 14 0 1 0; #X restore 124 112 pd plot; #X obj 124 160 s; #X msg 162 135 symbol j\$1; #N canvas 0 0 450 300 plot 0; #X obj 60 19 inlet; #X obj 44 198 mtx; #X obj 58 42 t a a; #X obj 39 70 mtx_size; #X obj 39 112 until; #X obj 39 92 t f b; #X obj 68 131 + 1; #X obj 39 131 i; #X msg 82 93 1; #X obj 43 152 t f f; #X obj 152 243 outlet; #X obj 44 222 list prepend 0; #X obj 45 243 outlet; #X obj 152 219 - 1; #X msg 44 175 col \$1; #X connect 0 0 2 0; #X connect 1 0 11 0; #X connect 2 0 3 0; #X connect 2 1 1 1; #X connect 3 1 5 0; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 5 1 8 0; #X connect 6 0 7 1; #X connect 7 0 6 0; #X connect 7 0 9 0; #X connect 8 0 7 1; #X connect 9 0 14 0; #X connect 9 1 13 0; #X connect 11 0 12 0; #X connect 13 0 10 0; #X connect 14 0 1 0; #X restore 245 114 pd plot; #X obj 245 162 s; #X msg 283 137 symbol y\$1; #N canvas 0 0 450 300 (subpatch) 0; #X array j3 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 709 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y3 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 708 graph; #X obj 127 21 hsl 128 15 1 300 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X msg 124 42 0.1 \$1 100; #X obj 125 63 mtx_linspace; #X obj 125 87 mtx_bessel H 3; #N canvas 460 154 494 195 META 0; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 145 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 45 DESCRIPTION calculate bessel functions of a matrix; #X text 12 65 INLET_0 matrix; #X text 12 102 OUTLET_1 matrix; #X obj 13 170 declare -lib iemmatrix; #X restore 513 91 pd META; #X obj 377 53 mtx_bessel J; #X obj 377 73 mtx_bessel H; #X obj 377 93 mtx_bessel Y; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 8 0 7 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 11 0 10 1; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 17 0; #X connect 17 0 6 0; #X connect 17 1 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_binops-help.pd000066400000000000000000000113231514557770000256070ustar00rootroot00000000000000#N canvas 186 302 976 685 10; #X declare -lib iemmatrix; #X obj 87 360 mtx_mul; #X obj 157 360 mtx_*; #X obj 88 163 mtx_add; #X obj 167 166 mtx_+; #X obj 155 134 mtx_diag 1 2 3 4 5; #X obj 88 134 mtx_ones 5; #X obj 88 111 t b b; #X obj 88 185 mtx_print; #X msg 88 92 bang; #X text 142 165 ==; #X obj 305 134 mtx_eye 4; #X obj 305 159 mtx_add 10; #X msg 305 107 bang; #X obj 305 186 mtx_print; #X floatatom 374 101 4 0 0 0 - - - 0; #X obj 374 119 t b f; #X obj 392 160 mtx_+ 10; #X text 371 161 ==; #X obj 87 394 mtx_print; #X msg 87 270 bang; #X obj 133 332 mtx_diag 1 2; #X obj 87 297 t b b; #X obj 87 332 mtx_+ 3; #X text 137 361 ==; #X obj 87 314 mtx_eye 3 2; #X obj 249 399 mtx_print; #X obj 249 292 t b f; #X floatatom 249 274 4 0 0 0 - - - 0; #X msg 249 315 4 2 1 3; #X obj 249 335 mtx_diag; #X obj 249 363 mtx_mul 2; #X obj 328 363 mtx_* 2; #X obj 393 363 mtx_.* 2; #X text 310 363 ==; #X text 376 364 ==; #X obj 522 366 mtx_.*; #X obj 522 401 mtx_print; #X obj 522 304 mtx_diag 1 2 3; #X obj 553 322 mtx_ones 3; #X obj 522 283 t b b; #X msg 522 264 bang; #X obj 553 341 mtx_* 2; #X text 80 214 add 2 matrices; #X text 274 218 add an offset to a matrix; #X text 70 423 multiply 2 matrices; #X text 245 422 multiply a matrix with a scalar; #X text 506 425 multiply 2 matrices element by element; #X text 50 24 matrix arithmetic; #X obj 88 599 mtx_print; #X obj 88 492 t b f; #X floatatom 88 474 4 0 0 0 - - - 0; #X msg 88 515 4 2 1 3; #X obj 88 535 mtx_diag; #X obj 323 600 mtx_print; #X obj 323 503 mtx_diag 1 2 3; #X obj 354 521 mtx_ones 3; #X obj 354 540 mtx_* 2; #X text 44 622 divide a matrix by a scalar; #X obj 88 563 mtx_./ 2; #X obj 323 565 mtx_./; #X text 267 624 divide 2 matrices element by element; #X obj 323 482 t b b f; #X floatatom 323 463 4 0 0 0 - - - 0; #X obj 550 141 mtx_diag 1 2 3 4 5; #X obj 483 141 mtx_ones 5; #X obj 483 118 t b b; #X obj 483 192 mtx_print; #X msg 483 99 bang; #X text 537 172 ==; #X obj 700 141 mtx_eye 4; #X msg 700 114 bang; #X obj 700 193 mtx_print; #X floatatom 769 108 4 0 0 0 - - - 0; #X obj 769 126 t b f; #X text 762 168 ==; #X obj 483 170 mtx_sub; #X obj 562 173 mtx_-; #X obj 779 169 mtx_sub 10; #X obj 700 166 mtx_- 10; #X text 481 221 subtract 2 matrices; #X text 669 225 subtract an offset from a matrix; #X obj 568 609 mtx_print; #X obj 568 502 t b f; #X floatatom 568 484 4 0 0 0 - - - 0; #X msg 568 525 4 2 1 3; #X obj 568 545 mtx_diag; #X obj 763 610 mtx_print; #X obj 763 513 mtx_diag 1 2 3; #X obj 794 531 mtx_ones 3; #X obj 794 550 mtx_* 2; #X obj 763 492 t b b f; #X floatatom 763 473 4 0 0 0 - - - 0; #X obj 568 573 mtx_.^ 2; #X obj 763 575 mtx_.^; #X text 546 638 matrix-elements^f; #X text 720 636 elementA(i \, j)^elementB(i \, j); #N canvas 899 135 537 225 META 0; #X text 12 140 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 120 OUTLET_0 matrix; #X text 12 160 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 11 86 INLET_0 matrix; #X text 11 102 INLET_1 matrix; #X text 12 42 DESCRIPTION binary matrix arithmetic: addition \, subtraction \, multiplication \, division \, element-wise multipliciation \, element-wise division \, elementwise power; #X obj 13 190 declare -lib iemmatrix; #X restore 901 26 pd META; #X connect 0 0 18 0; #X connect 2 0 7 0; #X connect 4 0 2 1; #X connect 5 0 2 0; #X connect 6 0 5 0; #X connect 6 1 4 0; #X connect 8 0 6 0; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 10 0; #X connect 14 0 15 0; #X connect 15 0 10 0; #X connect 15 1 11 1; #X connect 19 0 21 0; #X connect 20 0 0 1; #X connect 21 0 24 0; #X connect 21 1 20 0; #X connect 22 0 0 0; #X connect 24 0 22 0; #X connect 26 0 28 0; #X connect 26 1 30 1; #X connect 27 0 26 0; #X connect 28 0 29 0; #X connect 29 0 30 0; #X connect 30 0 25 0; #X connect 35 0 36 0; #X connect 37 0 35 0; #X connect 38 0 41 0; #X connect 39 0 37 0; #X connect 39 1 38 0; #X connect 40 0 39 0; #X connect 41 0 35 1; #X connect 49 0 51 0; #X connect 49 1 58 1; #X connect 50 0 49 0; #X connect 51 0 52 0; #X connect 52 0 58 0; #X connect 54 0 59 0; #X connect 55 0 56 0; #X connect 56 0 59 1; #X connect 58 0 48 0; #X connect 59 0 53 0; #X connect 61 0 54 0; #X connect 61 1 55 0; #X connect 61 2 56 1; #X connect 62 0 61 0; #X connect 63 0 75 1; #X connect 64 0 75 0; #X connect 65 0 64 0; #X connect 65 1 63 0; #X connect 67 0 65 0; #X connect 69 0 78 0; #X connect 70 0 69 0; #X connect 72 0 73 0; #X connect 73 0 69 0; #X connect 73 1 78 1; #X connect 75 0 66 0; #X connect 78 0 71 0; #X connect 82 0 84 0; #X connect 82 1 92 1; #X connect 83 0 82 0; #X connect 84 0 85 0; #X connect 85 0 92 0; #X connect 87 0 93 0; #X connect 88 0 89 0; #X connect 89 0 93 1; #X connect 90 0 87 0; #X connect 90 1 88 0; #X connect 90 2 89 1; #X connect 91 0 90 0; #X connect 92 0 81 0; #X connect 93 0 86 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_bitand-help.pd000066400000000000000000000024601514557770000255600ustar00rootroot00000000000000#N canvas 224 247 513 340 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 120 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 349 193 ==; #X obj 17 23 mtx_bitand; #X obj 101 23 mtx_&; #X obj 392 77 &; #X obj 46 196 mtx_bitand; #X obj 145 197 mtx_&; #X obj 263 192 mtx_bitand 0; #X obj 370 192 mtx_& 0; #X text 38 247 AND 2 matrices; #X text 246 251 AND a matrix with a scalar; #X text 9 42 matrix logic: bitwise AND; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 message; #X text 12 5 KEYWORDS control matrix logic; #X text 12 45 DESCRIPTION matrix logic bitwise AND; #X obj 16 147 declare -lib iemmatrix; #X restore 456 15 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_bitleft-help.pd000066400000000000000000000026351514557770000257540ustar00rootroot00000000000000#N canvas 224 247 481 313 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 130 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 359 193 ==; #X obj 17 23 mtx_bitleft; #X obj 111 23 mtx_<<; #X obj 392 77 <<; #X obj 46 196 mtx_bitleft; #X obj 155 196 mtx_<<; #X obj 263 192 mtx_bitleft 0; #X obj 380 192 mtx_<< 0; #X text 8 42 matrix logic: bitwise leftshift; #X text 38 247 shift left matrix; #X text 38 260 (amount for each element; #X text 39 275 specified in right matrix); #X text 257 251 shift matrix as given by scalar; #N canvas 348 246 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 5 KEYWORDS control matrix logic; #X text 12 45 DESCRIPTION matrix logic bitwise leftshift; #X text 12 65 INLET_0 matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 420 6 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_bitor-help.pd000066400000000000000000000024461514557770000254420ustar00rootroot00000000000000#N canvas 224 247 456 302 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 120 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 349 193 ==; #X obj 17 23 mtx_bitor; #X obj 91 23 mtx_|; #X obj 392 77 |; #X obj 46 196 mtx_bitor; #X obj 145 197 mtx_|; #X obj 263 192 mtx_bitor 0; #X obj 370 192 mtx_| 0; #X text 8 42 matrix logic: bitwise OR; #X text 38 247 OR 2 matrices; #X text 245 251 OR a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 5 KEYWORDS control matrix logic; #X text 12 65 INLET_0 matrix; #X text 12 45 DESCRIPTION matrix logic bitwise OR; #X obj 16 147 declare -lib iemmatrix; #X restore 371 6 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_bitright-help.pd000066400000000000000000000026421514557770000261350ustar00rootroot00000000000000#N canvas 224 247 462 302 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 125 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 140 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 366 193 ==; #X text 38 247 shift left matrix; #X text 38 260 (amount for each element; #X text 39 275 specified in right matrix); #X text 254 249 shift matrix as given by scalar; #X obj 17 23 mtx_bitright; #X obj 111 23 mtx_>>; #X text 8 42 matrix logic: bitwise rightshift; #X obj 165 196 mtx_>>; #X obj 387 192 mtx_>> 0; #X obj 392 77 >>; #X obj 263 192 mtx_bitright 0; #X obj 46 196 mtx_bitright; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 5 KEYWORDS control matrix logic; #X text 12 65 INLET_0 matrix; #X text 12 45 DESCRIPTION matrix logic bitwise rightshift; #X obj 16 147 declare -lib iemmatrix; #X restore 371 6 pd META; #X connect 2 0 25 1; #X connect 3 0 25 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 24 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 24 1; #X connect 24 0 10 0; #X connect 25 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_check-help.pd000066400000000000000000000031421514557770000253720ustar00rootroot00000000000000#N canvas 161 60 833 321 10; #X declare -lib iemmatrix; #X obj 715 44 matrix; #X text 585 43 see also help for; #X obj 86 294 mtx_print; #X obj 121 23 mtx_check; #X text 223 24 check (and fix) a matrix for validity; #X obj 86 242 mtx_check; #X text 83 107 check a matrix-message; #X msg 133 169 matrix 3 3 2; #X obj 488 254 mtx_int; #X msg 86 131 matrix 2 2 0 1 2 3; #X text 221 132 legal matrix message: [2x2] matrix with elements "0 1 \, 2 3"; #X text 233 163 this message is illegal: [3x3] matrix \, the only element of which is "2"; #X obj 638 273 mtx_int; #X obj 638 251 mtx_check; #X obj 488 279 mtx_print illegal; #X obj 638 297 mtx_print legalizeIt; #X msg 488 228 matrix 3 3 2; #X msg 638 227 matrix 3 3 2; #X text 65 44 illegal matrix-message are fixed by zero-padding (if too few elements are given) \, or truncation (if too many elements are given); #X msg 132 201 matrix 2 2 0 1 2 3 4 5 6; #X text 308 201 illegal too: too many elements are given; #X obj 86 267 t a a; #X obj 126 267 print fixed; #N canvas 403 254 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION check (and fix) a matrix for validity; #X obj 16 147 declare -lib iemmatrix; #X restore 771 16 pd META; #X connect 5 0 21 0; #X connect 7 0 5 0; #X connect 8 0 14 0; #X connect 9 0 5 0; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 16 0 8 0; #X connect 17 0 13 0; #X connect 19 0 5 0; #X connect 21 0 2 0; #X connect 21 1 22 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_cholesky-help.pd000066400000000000000000000020501514557770000261330ustar00rootroot00000000000000#N canvas 16 0 491 405 10; #X declare -lib iemmatrix; #X obj 203 351 matrix; #X text 73 350 see also help for; #X obj 203 371 mtx_gauss; #X text 26 12 mtx_cholesky:: decompose a matrix using cholesky's algorithm; #X msg 176 54 bang; #X obj 176 98 t a a; #X obj 176 75 mtx_eye 5; #X obj 266 75 mtx_egg 5; #X obj 176 235 mtx_print symmetric; #X obj 206 143 mtx_print original; #X msg 266 52 bang; #X obj 176 178 mtx_cholesky; #X msg 53 53 bang; #X obj 53 74 mtx_diag 1 2 3 5; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 11 45 DESCRIPTION decompose a matrix using cholesky's algorithm; #X obj 16 147 declare -lib iemmatrix; #X restore 431 16 pd META; #X connect 4 0 6 0; #X connect 5 0 11 0; #X connect 5 1 9 0; #X connect 6 0 5 0; #X connect 7 0 5 0; #X connect 10 0 7 0; #X connect 11 0 8 0; #X connect 12 0 13 0; #X connect 13 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_circular_harmonics-help.pd000066400000000000000000000072371514557770000301750ustar00rootroot00000000000000#N canvas 549 113 921 503 10; #X declare -lib iemmatrix; #X text 620 234 for m>=0; #X text 619 250 for m< 0; #X text 288 118 [mtx_circular_harmonics] requires a numerical creation argument specifyiing the maximum order 0<=n<=nmax.; #X text 74 54 [mtx_circular_harmonics] circular harmonics evaluated at a set of points given in phi coordinates.; #X text 284 160 for an L points 2xL input matrix \, [mtx_spherical_harmonics] evaluates the (2*nmax+2) circular harmonics at L points and delivers an Lx(2*nmax+2) output matrix.; #X text 167 235 PHI_m(phi) = sqrt((2-delta_m) / (2*pi)) * cos(m*phi); #X text 126 284 The order of the harmonics in the output columns is specified by the linear index k=nmax+m+1.; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic1 100 float 0; #X coords 0 1 99 -1 200 50 1; #X restore 720 14 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic2 100 float 0; #X coords 0 1 99 -1 200 50 1; #X restore 718 80 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic3 100 float 0; #X coords 0 1 99 -1 200 50 1; #X restore 719 146 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic4 100 float 0; #X coords 0 1.05 99 -1 200 50 1 0 0; #X restore 718 217 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic5 100 float 0; #X coords 0 1 99 -1 200 50 1; #X restore 718 286 graph; #X obj 75 109 loadbang; #N canvas 624 434 600 460 send_to_tables 0; #X obj 21 14 inlet; #X obj 72 211 mtx; #X obj 21 36 t a a; #X obj 21 59 mtx_size; #X obj 74 105 until; #X obj 74 82 t f b; #X msg 117 82 0; #X obj 101 124 + 1; #X obj 74 124 f; #X obj 73 147 t f f; #X obj 72 249 s; #X msg 105 168 symbol circularharmonic\$1; #X obj 72 230 list prepend 0; #X msg 73 192 column \$1; #X connect 0 0 2 0; #X connect 1 0 12 0; #X connect 2 0 3 0; #X connect 2 1 1 1; #X connect 3 1 5 0; #X connect 4 0 8 0; #X connect 5 0 4 0; #X connect 5 1 6 0; #X connect 6 0 8 1; #X connect 7 0 8 1; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 13 0; #X connect 9 1 11 0; #X connect 11 0 10 1; #X connect 12 0 10 0; #X connect 13 0 1 0; #X restore 75 179 pd send_to_tables; #X obj 75 133 mtx_linspace 0 6.29 100; #X obj 159 114 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic6 100 float 0; #X coords 0 1 99 -1 200 50 1; #X restore 715 356 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array circularharmonic7 100 float 0; #X coords 0 1 99 -1 200 50 1; #X restore 716 422 graph; #N canvas 307 302 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 5 KEYWORDS control matrix logic; #X text 12 65 INLET_0 matrix; #X text 11 105 AUTHOR Franz Zotter; #X text 12 45 DESCRIPTION calculate circular harmonics for matrix; #X obj 13 150 declare -lib iemmatrix; #X restore 585 455 pd META; #X text 167 251 PHI_m(phi) = 1/sqrt(pi) * sin(|m|*phi); #X text 399 452 Franz Zotter \, 2009 \, 2023; #X text 231 317 Default: N2D; #X obj 75 157 mtx_circular_harmonics 3 SN2D; #X text 129 219 for -n<=m<=n: (default N2D); #X obj 76 318 mtx_circular_harmonics 1; #X obj 52 334 mtx_circular_harmonics 1 N2D; #X obj 34 350 mtx_circular_harmonics 1 N2D2PI; #X text 231 332 uses sqrt(2-delta_m)/sqrt(2pi) altogether to normalize; #X text 231 350 uses sqrt(2-delta_m) \, omitting 1/sqrt(2pi) to normalize; #X obj 46 366 mtx_circular_harmonics 1 SN2D; #X text 231 366 uses 1 \, so no nromalization; #X text 74 388 Typical 2D Ambisonic encoding choice is SN2D; #X text 75 400 Typical mathematical integral orthonormalization choice: N2D; #X connect 12 0 14 0; #X connect 14 0 22 0; #X connect 15 0 14 0; #X connect 22 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_col-help.pd000066400000000000000000000020201514557770000250640ustar00rootroot00000000000000#N canvas 136 41 505 373 10; #X declare -lib iemmatrix; #X obj 413 74 matrix; #X text 283 73 see also help for; #X obj 89 32 mtx_col; #X obj 53 259 mtx_print; #X obj 64 217 mtx_ones 5 3; #X msg 64 198 bang; #X obj 53 240 mtx_col 4 3; #X msg 182 195 0; #X msg 174 173 2; #X msg 53 146 -1 2 3 4 5; #X text 133 242 creation: mtx_col [ []]; #X obj 413 96 mtx_element; #X text 19 9 set columns of a matrix; #X text 55 129 set matrix columns; #X text 214 170 set column [2]; #X text 213 195 set all columns; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION set columns of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 441 16 pd META; #X obj 413 116 mtx_row; #X connect 4 0 6 0; #X connect 5 0 4 0; #X connect 6 0 3 0; #X connect 7 0 6 1; #X connect 8 0 6 1; #X connect 9 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_colon-help.pd000066400000000000000000000034721514557770000254350ustar00rootroot00000000000000#N canvas 419 109 670 565 10; #X declare -lib iemmatrix; #X obj 595 53 matrix; #X text 465 52 see also help for; #X msg 12 124 bang; #X text 90 15 [mtx_colon]; #X text 47 34 colon operator: reading as row-vector / creating ascending number arrays; #X text 153 122 1 sequences; #X obj 12 277 mtx_print mtx_colon-sequence; #X obj 313 275 mtx_print mtx_colon-readout; #X obj 313 186 t a a; #X obj 432 231 mtx_print orig; #X obj 313 240 mtx_:; #X msg 85 141 bang; #X obj 12 233 mtx_:; #X msg 85 161 0 3; #X msg 12 145 2 1.5 7; #X text 422 120 2 linear read-out; #X text 8 60 you can create sequences (matrix vectors) with start- \, stop- and increment values. similar to octave you can also read out matrices linearly as vectors.; #X obj 301 411 mtx_print orig; #X obj 257 499 mtx_:; #X obj 257 434 mtx_transpose; #X obj 257 411 t a a; #X obj 257 456 mtx_repmat 1 3; #X obj 257 520 mtx_print sample-hold; #X msg 313 141 matrix 2 2 1 3 2 4; #X msg 257 358 matrix 1 4 1 2 3 4; #X obj 342 498 mtx_print repeated-orig; #X obj 257 477 t a a; #X text 251 324 this is e.g. useful when repeating values via sample+hold; #N canvas 1058 313 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION matrix colon operator; #X obj 16 147 declare -lib iemmatrix; #X restore 611 6 pd META; #X connect 2 0 14 0; #X connect 8 0 10 0; #X connect 8 1 9 0; #X connect 10 0 7 0; #X connect 11 0 13 0; #X connect 12 0 6 0; #X connect 13 0 12 0; #X connect 14 0 12 0; #X connect 18 0 22 0; #X connect 19 0 21 0; #X connect 20 0 19 0; #X connect 20 1 17 0; #X connect 21 0 26 0; #X connect 23 0 8 0; #X connect 24 0 20 0; #X connect 26 0 18 0; #X connect 26 1 25 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_concat-help.pd000066400000000000000000000047651514557770000256000ustar00rootroot00000000000000#N canvas 27 49 670 558 10; #X declare -lib iemmatrix; #X obj 591 524 matrix; #X text 461 523 see also help for; #X obj 12 219 t a a; #X msg 12 154 bang; #X msg 265 420 mode row; #X msg 265 394 mode column; #X msg 352 393 mode col; #X msg 418 393 mode :; #X obj 263 446 t a; #X text 90 15 [mtx_concat]; #X text 47 34 concatenate 2 matrices; #X obj 12 196 mtx_ones 3 4; #X obj 12 176 t b b; #X obj 20 241 mtx_print left; #X text 471 393 concat columns (default); #X text 476 419 concat rows; #X obj 12 279 mtx_concat; #X obj 12 307 mtx_print col-concat; #X obj 123 221 t a a; #X obj 123 198 mtx_zeros 5 4; #X obj 131 243 mtx_print right; #X obj 313 220 t a a; #X msg 313 155 bang; #X obj 313 177 t b b; #X obj 321 242 mtx_print left; #X obj 424 222 t a a; #X obj 432 244 mtx_print right; #X obj 313 280 mtx_concat row; #X obj 313 197 mtx_ones 2 2; #X obj 424 199 mtx_zeros 2 3; #X obj 17 409 t a a; #X msg 17 348 bang; #X obj 17 370 t b b; #X obj 25 426 mtx_print left; #X obj 17 473 mtx_concat; #X obj 128 409 t a a; #X obj 136 426 mtx_print right; #X obj 17 511 mtx_print concat; #X obj 313 308 mtx_print row-concat; #X obj 17 390 mtx_ones 2 2; #X obj 128 390 mtx_zeros 2 2; #X text 8 60 you can concatenate 2 matrices either row-wise or column-wise \; if you concatenate them in "column"-mode (default) \, the 2 matrices must have the same number of columns and vice versa in "row"-mode., f 68; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION concatenate two matrices into a new matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 591 6 pd META; #X connect 2 0 16 0; #X connect 2 1 13 0; #X connect 3 0 12 0; #X connect 4 0 8 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 34 0; #X connect 11 0 2 0; #X connect 12 0 11 0; #X connect 12 1 19 0; #X connect 16 0 17 0; #X connect 18 0 16 1; #X connect 18 1 20 0; #X connect 19 0 18 0; #X connect 21 0 27 0; #X connect 21 1 24 0; #X connect 22 0 23 0; #X connect 23 0 28 0; #X connect 23 1 29 0; #X connect 25 0 27 1; #X connect 25 1 26 0; #X connect 27 0 38 0; #X connect 28 0 21 0; #X connect 29 0 25 0; #X connect 30 0 34 0; #X connect 30 1 33 0; #X connect 31 0 32 0; #X connect 32 0 39 0; #X connect 32 1 40 0; #X connect 34 0 37 0; #X connect 35 0 34 1; #X connect 35 1 36 0; #X connect 39 0 30 0; #X connect 40 0 35 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_conv-help.pd000066400000000000000000000024361514557770000252670ustar00rootroot00000000000000#N canvas 166 141 531 383 10; #X declare -lib iemmatrix; #X obj 444 311 matrix; #X text 314 310 see also help for; #X text 90 15 [mtx_conv]; #X text 47 34 2-dimensional convolution; #X text 18 63 you can calculate the convolution of a matrix with a filter matrix kernel (2 dimensional FIR filtering). Of course \, it can also be used for 1-dimensional FIR convolutions.; #X msg 42 127 bang; #X obj 42 151 t b b b; #X obj 64 215 t a a; #X obj 94 248 mtx_print orig; #X obj 64 274 mtx_conv; #X obj 173 197 t a a; #X obj 200 217 mtx_print filter_kernel; #X obj 64 304 mtx_print result; #X msg 173 174 matrix 2 3 1 1 1 1 1 1 1; #X msg 64 176 element 4 4 1; #X obj 63 196 matrix 5 5; #N canvas 460 154 337 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION 2d matrix convolution; #X obj 16 147 declare -lib iemmatrix; #X restore 442 8 pd META; #X connect 5 0 6 0; #X connect 6 0 15 0; #X connect 6 1 14 0; #X connect 6 2 13 0; #X connect 7 0 9 0; #X connect 7 1 8 0; #X connect 9 0 12 0; #X connect 10 0 9 1; #X connect 10 1 11 0; #X connect 13 0 10 0; #X connect 14 0 15 0; #X connect 15 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_convolver~-help.pd000066400000000000000000000403251514557770000265340ustar00rootroot00000000000000#N canvas 319 185 839 528 12; #X declare -lib iemmatrix; #X text 672 35 part of iemmatrix; #X text 416 278 n < num_samples; #X text 76 224 IR data sequence is indexed by:; #X text 215 4 matrix convolver \, uniformly partitioned \, output cross-fading; #X obj 72 136 mtx_convolver~ -m; #X obj 622 135 snake~; #X text 216 137 multi-channel input and output audio-cable version see:; #X obj 72 6 mtx_convolver~ 3 4; #X text 213 102 convolution blocksize is adjusted by:; #X obj 498 102 block~; #X text 214 24 args: ; #X text 213 44 inlet1: array3 MIMO IR configuration; #X text 213 64 inlet<2>...: in<1>...in signals; #X text 213 83 outlet<1>...: out signals; #X text 74 201 [array3 IR data...(; #X text 350 223 i = l*num_inputs*num_samples + m*num_samples + n; #X text 381 241 l < num_outputs; #X text 404 260 m < num_inputs; #N canvas 525 274 724 376 mtx_convolver~-example1: 0; #X obj 72 178 osc~ 100; #X obj 72 201 *~ 0.2; #X obj 111 225 osc~ 1000; #X obj 111 248 *~ 1.5; #X obj 148 201 osc~ 432; #X obj 34 316 env~; #X floatatom 34 340 4 0 0 0 - - - 0; #X obj 93 315 env~; #X floatatom 93 339 4 0 0 0 - - - 0; #X obj 153 315 env~; #X floatatom 153 339 4 0 0 0 - - - 0; #X floatatom 252 247 4 0 0 0 - - - 0; #X obj 35 276 mtx_*~ 4 3 100 .......; #X obj 219 316 env~; #X floatatom 219 340 4 0 0 0 - - - 0; #X obj 35 62 mtx_eye 4 3; #X obj 126 62 mtx_egg 4 3; #X obj 310 62 mtx_zeros 4 3; #X obj 213 62 mtx_ones 4 3; #X obj 35 38 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 126 39 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 213 39 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 308 40 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X text 403 35 (but has a fixed output cross-fade length); #X text 28 15 if num_samples=1 \, [mtx_convolver~] is similar to [mtx_*~]; #X obj 487 185 osc~ 100; #X obj 487 208 *~ 0.2; #X obj 516 232 osc~ 1000; #X obj 516 255 *~ 1.5; #X obj 569 255 osc~ 432; #X obj 446 318 env~; #X floatatom 446 342 4 0 0 0 - - - 0; #X obj 507 318 env~; #X floatatom 507 342 4 0 0 0 - - - 0; #X obj 568 318 env~; #X floatatom 568 342 4 0 0 0 - - - 0; #X obj 628 319 env~; #X floatatom 628 343 4 0 0 0 - - - 0; #X text 593 286 ; #N canvas 290 226 534 300 convert2array3 0; #X obj 58 46 inlet; #X obj 58 72 list split 1; #X obj 98 171 list prepend array3; #X obj 98 120 list append 1; #X obj 98 195 list trim; #X text 158 70 strip "matrix"; #X obj 98 146 list; #X text 155 145 join to ; #X text 194 94 separate from ; #X text 201 120 append 1: 1; #X text 120 22 make from [matrix (; #X text 190 40 [array3 1 (; #X obj 98 219 outlet; #X text 247 171 prepend array3; #X text 179 194 strip "symbol" selector; #X obj 98 96 list split 2; #X connect 0 0 1 0; #X connect 1 1 15 0; #X connect 2 0 4 0; #X connect 3 0 6 0; #X connect 4 0 12 0; #X connect 6 0 2 0; #X connect 15 0 3 0; #X connect 15 1 6 1; #X restore 392 157 pd convert2array3; #X obj 424 203 print; #X obj 446 289 mtx_convolver~ 4 3; #X obj 151 113 mtx_print; #X obj 35 93 t a a a; #X obj 93 119 print; #X obj 35 124 t a a; #X obj 392 180 t a a; #X connect 0 0 1 0; #X connect 1 0 12 1; #X connect 2 0 3 0; #X connect 3 0 12 2; #X connect 4 0 12 3; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 9 0 10 0; #X connect 11 0 12 4; #X connect 12 0 5 0; #X connect 12 1 7 0; #X connect 12 2 9 0; #X connect 12 3 13 0; #X connect 13 0 14 0; #X connect 15 0 43 0; #X connect 16 0 43 0; #X connect 17 0 43 0; #X connect 18 0 43 0; #X connect 19 0 15 0; #X connect 20 0 16 0; #X connect 21 0 18 0; #X connect 22 0 17 0; #X connect 25 0 26 0; #X connect 26 0 41 1; #X connect 27 0 28 0; #X connect 28 0 41 2; #X connect 29 0 41 3; #X connect 30 0 31 0; #X connect 32 0 33 0; #X connect 34 0 35 0; #X connect 36 0 37 0; #X connect 39 0 46 0; #X connect 41 0 30 0; #X connect 41 1 32 0; #X connect 41 2 34 0; #X connect 41 3 36 0; #X connect 43 0 45 0; #X connect 43 1 44 0; #X connect 43 2 42 0; #X connect 45 0 12 0; #X connect 45 1 39 0; #X connect 46 0 41 0; #X connect 46 1 40 0; #X restore 61 321 pd mtx_convolver~-example1: num_samples=1: similar to mtx_*~; #N canvas 525 274 724 462 mtx_convolver~-example1-m: 0; #X obj 83 164 osc~ 100; #X obj 83 187 *~ 0.2; #X obj 122 211 osc~ 1000; #X obj 122 234 *~ 1.5; #X obj 158 187 osc~ 432; #X obj 28 336 env~; #X floatatom 28 360 4 0 0 0 - - - 0; #X obj 87 335 env~; #X floatatom 87 359 4 0 0 0 - - - 0; #X obj 147 335 env~; #X floatatom 147 359 4 0 0 0 - - - 0; #X obj 213 336 env~; #X floatatom 213 360 4 0 0 0 - - - 0; #X text 546 286 ; #X obj 28 284 mtx_*~ -m 4 3 100; #X obj 84 256 snake~ in 3; #X obj 28 308 snake~ out 4; #X obj 514 169 osc~ 100; #X obj 514 192 *~ 0.2; #X obj 553 216 osc~ 1000; #X obj 553 239 *~ 1.5; #X obj 589 192 osc~ 432; #X obj 399 341 env~; #X floatatom 399 365 4 0 0 0 - - - 0; #X obj 458 340 env~; #X floatatom 458 364 4 0 0 0 - - - 0; #X obj 518 340 env~; #X floatatom 518 364 4 0 0 0 - - - 0; #X obj 584 341 env~; #X floatatom 584 365 4 0 0 0 - - - 0; #X obj 515 261 snake~ in 3; #X obj 399 313 snake~ out 4; #X obj 399 289 mtx_convolver~ -m; #X obj 29 62 mtx_eye 4 3; #X obj 120 62 mtx_egg 4 3; #X obj 304 62 mtx_zeros 4 3; #X obj 207 62 mtx_ones 4 3; #X obj 29 38 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 120 39 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 207 39 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 302 40 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X text 397 35 (but has a fixed output cross-fade length); #X text 22 15 if num_samples=1 \, [mtx_convolver~] is similar to [mtx_*~]; #N canvas 654 171 534 300 convert2array3 0; #X obj 59 46 inlet; #X obj 58 72 list split 1; #X obj 99 171 list prepend array3; #X obj 98 120 list append 1; #X obj 99 195 list trim; #X text 158 70 strip "matrix"; #X obj 98 146 list; #X text 155 145 join to ; #X text 194 94 separate from ; #X text 201 120 append 1: 1; #X text 120 22 make from [matrix (; #X text 190 40 [array3 1 (; #X obj 99 219 outlet; #X text 247 171 prepend array3; #X text 179 194 strip "symbol" selector; #X obj 98 96 list split 2; #X connect 0 0 1 0; #X connect 1 1 15 0; #X connect 2 0 4 0; #X connect 3 0 6 0; #X connect 4 0 12 0; #X connect 6 0 2 0; #X connect 15 0 3 0; #X connect 15 1 6 1; #X restore 236 167 pd convert2array3; #X obj 236 192 print; #X obj 145 118 mtx_print; #X obj 29 93 t a a a; #X obj 87 119 print; #X text 350 101 multichannel version; #X connect 0 0 1 0; #X connect 1 0 15 0; #X connect 2 0 3 0; #X connect 3 0 15 1; #X connect 4 0 15 2; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 14 0 16 0; #X connect 15 0 14 1; #X connect 16 0 5 0; #X connect 16 1 7 0; #X connect 16 2 9 0; #X connect 16 3 11 0; #X connect 17 0 18 0; #X connect 18 0 30 0; #X connect 19 0 20 0; #X connect 20 0 30 1; #X connect 21 0 30 2; #X connect 22 0 23 0; #X connect 24 0 25 0; #X connect 26 0 27 0; #X connect 28 0 29 0; #X connect 30 0 32 1; #X connect 31 0 22 0; #X connect 31 1 24 0; #X connect 31 2 26 0; #X connect 31 3 28 0; #X connect 32 0 31 0; #X connect 33 0 46 0; #X connect 34 0 46 0; #X connect 35 0 46 0; #X connect 36 0 46 0; #X connect 37 0 33 0; #X connect 38 0 34 0; #X connect 39 0 36 0; #X connect 40 0 35 0; #X connect 43 0 44 0; #X connect 43 0 32 0; #X connect 46 0 43 0; #X connect 46 0 14 0; #X connect 46 1 47 0; #X connect 46 2 45 0; #X restore 526 321 pd mtx_convolver~-example1-m: -m version; #N canvas 458 201 638 452 mtx_convolver~-example2: 0; #X obj 79 63 hsl 361 16 -180 180 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X obj 76 105 mtx 1 1; #X obj 76 8 loadbang; #X obj 76 151 mtx_transpose; #X obj 76 128 mtx_circular_harmonics 3; #X obj 253 397 *~; #X obj 490 215 vsl 16 101 0 100 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 490 324 dbtorms; #X msg 330 344 \$1 10; #X obj 330 367 line~; #X obj 378 161 noise~; #X text 156 40 Panning direction; #X text 512 281 gain; #X text 251 127 2D Ambisonics \, 3rd order; #X text 26 188 7ch Ambisonics encoded multich.; #X text 27 235 binaural Ambisonic 2x7 decoding; #X obj 284 186 mtx_*~ 7 1 10, f 27; #X obj 253 257 mtx_convolver~ 2 7 CH3-HRIR.arr3; #X obj 456 397 *~; #X obj 253 420 dac~ 1 2, f 32; #N canvas 0 0 518 362 deg2rad 0; #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 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; #X restore 76 82 pd deg2rad; #X msg 76 33 0; #X text 26 296 convolution data is read from file; #X text 28 263 MIMO convolver with filters for 2 out \, 7 in, f 28; #X connect 0 0 20 0; #X connect 1 0 4 0; #X connect 2 0 21 0; #X connect 3 0 16 0; #X connect 4 0 3 0; #X connect 5 0 19 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 5 1; #X connect 9 0 18 0; #X connect 10 0 16 1; #X connect 16 0 17 1; #X connect 16 1 17 2; #X connect 16 2 17 3; #X connect 16 3 17 4; #X connect 16 4 17 5; #X connect 16 5 17 6; #X connect 16 6 17 7; #X connect 17 0 5 0; #X connect 17 1 18 1; #X connect 18 0 19 1; #X connect 20 0 1 0; #X connect 21 0 0 0; #X restore 61 346 pd mtx_convolver~-example2: binaural ambisonic decoding; #X text 58 295 Examples:; #N canvas 458 201 584 390 mtx_convolver~-example2.m: 0; #X obj 79 60 hsl 361 16 -180 180 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X obj 76 105 mtx 1 1; #X obj 284 186 mtx_*~ -m; #X obj 76 8 loadbang; #X obj 76 147 mtx_transpose; #X obj 71 330 dac~ 1; #X obj 76 126 mtx_circular_harmonics 3; #X obj 71 307 *~; #X obj 429 93 vsl 16 101 0 100 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 429 202 dbtorms; #X msg 429 223 \$1 10; #X obj 429 244 line~; #X obj 314 161 noise~; #X text 156 40 Panning direction; #X text 452 179 gain; #X text 251 125 2D Ambisonics \, 3rd order; #X text 81 247 mimo convolver with filters for 2 out \, 7 in; #X text 79 262 read from file; #X text 121 331 multichannel output 1 2; #X text 26 188 7ch Ambisonics encoded multich.; #X text 27 205 binaural Ambisonic 2x7 decoding; #X text 306 227 (multichannel); #X obj 71 227 mtx_convolver~ -m CH3-HRIR.arr3; #N canvas 0 0 518 362 deg2rad 0; #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 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; #X restore 76 81 pd deg2rad; #X msg 76 33 0; #X connect 0 0 23 0; #X connect 1 0 6 0; #X connect 2 0 22 1; #X connect 3 0 24 0; #X connect 4 0 2 0; #X connect 6 0 4 0; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 7 1; #X connect 12 0 2 1; #X connect 22 0 7 0; #X connect 23 0 1 0; #X connect 24 0 0 0; #X restore 526 346 pd mtx_convolver~-example2.m: -m version; #N canvas 458 201 498 337 mtx_convolver~-example3: 0; #X obj 254 67 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #N canvas 92 129 450 300 blip-blop 0; #X obj 65 40 inlet; #X obj 37 188 osc~ 300; #X obj 187 191 osc~ 400; #X obj 38 240 *~; #X obj 65 64 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X obj 65 88 sel 0 1; #X obj 188 240 *~; #X obj 38 274 outlet~; #X obj 189 272 outlet~; #X msg 56 155 1 10 \, 0 100 10; #X obj 56 216 vline~; #X obj 206 216 vline~; #X msg 206 154 1 10 \, 0 100 10; #X connect 0 0 4 0; #X connect 1 0 3 0; #X connect 2 0 6 0; #X connect 3 0 7 0; #X connect 4 0 5 0; #X connect 5 0 9 0; #X connect 5 1 12 0; #X connect 6 0 8 0; #X connect 9 0 10 0; #X connect 10 0 3 1; #X connect 11 0 6 1; #X connect 12 0 11 0; #X restore 254 118 pd blip-blop; #X obj 30 281 *~; #X obj 429 96 vsl 16 101 0 100 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 429 205 dbtorms; #X msg 171 225 \$1 10; #X obj 171 248 line~; #X text 452 182 gain; #X obj 345 281 *~; #X obj 31 306 dac~ 1 2, f 45; #N canvas 473 292 872 655 cross-reverb 0; #X obj 89 34 inlet; #X obj 395 249 mtx_* 2; #X obj 395 273 mtx_- 1; #X msg 519 199 1 \$1 22050; #X obj 519 224 mtx_logspace; #X obj 395 297 mtx_.*; #X obj 395 321 mtx_* 1; #X obj 559 266 / 22050; #X obj 559 290 sqrt; #X obj 89 452 list split 3; #X obj 89 486 list prepend array3 2 2 22050; #X obj 89 510 list trim; #X obj 89 534 outlet; #X obj 395 136 t b f; #X obj 395 224 mtx_rand 2 22050; #X obj 702 171 mtx_linspace; #X obj 702 245 mtx_*; #X obj 702 195 t b a; #X msg 702 220 matrix 2 1 60 45; #X obj 702 269 mtx_cos; #X obj 702 323 mtx_.*; #X obj 702 293 t a a; #X obj 395 375 mtx_.*; #X text 374 116 create 2 independent reverb tails; #X text 450 376 combine both; #X obj 89 205 mtx; #X msg 89 182 zeros 2 22050 \, element 1 1 1 \, element 2 2 1 \, bang; #X text 84 160 create 2 clean unit impulses (no delay \, unity gain); #X obj 89 427 mtx_scroll -1; #X obj 89 58 t b f b, f 88; #X text 286 420 2nd row/2->1 crossfeed contains first beating reverb, f 53; #X text 285 439 3rd row/1->2 crossfeed contains second beating reverb; #X msg 702 146 0 1 22050; #X obj 89 403 mtx_concat col; #X text 559 88 create 2 differently beating envelopes; #X floatatom 170 17 5 0 0 0 - - - 0; #X text 328 488 make convolver config by serializing and prepending "array3 2 2 22050", f 52; #X text 285 458 4th row/2->2 row should contain impulse; #X text 285 401 1st row/1->1 row should contain impulse; #X connect 0 0 29 0; #X connect 1 0 2 0; #X connect 2 0 5 0; #X connect 3 0 4 0; #X connect 4 0 5 1; #X connect 5 0 6 0; #X connect 6 0 22 0; #X connect 7 0 8 0; #X connect 8 0 6 1; #X connect 9 1 10 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 13 0 14 0; #X connect 13 1 3 0; #X connect 13 1 7 0; #X connect 14 0 1 0; #X connect 15 0 17 0; #X connect 16 0 19 0; #X connect 17 0 18 0; #X connect 17 1 16 1; #X connect 18 0 16 0; #X connect 19 0 21 0; #X connect 20 0 22 1; #X connect 21 0 20 0; #X connect 21 1 20 1; #X connect 22 0 33 1; #X connect 25 0 33 0; #X connect 26 0 25 0; #X connect 28 0 9 0; #X connect 29 0 26 0; #X connect 29 1 13 0; #X connect 29 2 32 0; #X connect 32 0 15 0; #X connect 33 0 28 0; #X connect 35 0 29 0; #X restore 31 137 pd cross-reverb; #N canvas 208 245 450 300 convolve-long-2x2-ir-efficiently-using-block~ 0; #X obj 323 73 block~ 4096; #X obj 43 106 mtx_convolver~ 2 2; #X obj 104 66 inlet~; #X obj 166 66 inlet~; #X obj 43 66 inlet; #X obj 43 143 outlet~; #X obj 166 143 outlet~; #X text 236 104 block controls block size; #X text 237 120 of uniformly partitioned; #X text 237 136 overlap-save convolver; #X text 240 172 use >=256 for efficiency; #X connect 1 0 5 0; #X connect 1 1 6 0; #X connect 2 0 1 1; #X connect 3 0 1 2; #X connect 4 0 1 0; #X restore 31 196 pd convolve-long-2x2-ir-efficiently-using-block~; #X obj 254 92 metro 700; #X msg 45 66 0.2; #X msg 31 43 0.9; #X text 64 44 long xreverb; #X text 77 67 short xreverb; #X floatatom 31 101 5 0 1 0 - - - 0; #X obj 31 18 loadbang; #X connect 0 0 12 0; #X connect 1 0 11 1; #X connect 1 1 11 2; #X connect 2 0 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 2 1; #X connect 6 0 8 0; #X connect 8 0 9 1; #X connect 10 0 11 0; #X connect 11 0 2 0; #X connect 11 1 8 1; #X connect 12 0 1 0; #X connect 13 0 17 0; #X connect 14 0 17 0; #X connect 17 0 10 0; #X connect 18 0 14 0; #X restore 61 371 pd mtx_convolver~-example3: cross-feed reverb; #N canvas 812 458 494 217 META 0; #X text 12 125 AUTHOR IOhannes m zmoelnig; #X text 12 25 LICENSE GPL-2+; #X obj 16 167 declare -lib iemmatrix; #X text 12 5 KEYWORDS signal matrix convolution; #X text 12 44 DESCRIPTION signal multiplication with a convolution matrix; #X text 12 65 INLET_0 array3; #X text 12 145 HELP_PATCH_AUTHORS Franz Zotter; #X text 12 105 OUTLET_0..m signal; #X text 12 85 INLET_1..n signal; #X restore 741 6 pd META; #X text 74 179 IR Configuration is a message:; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_cos-help.pd000066400000000000000000000015531514557770000251050ustar00rootroot00000000000000#N canvas 128 118 651 254 10; #X declare -lib iemmatrix; #X obj 595 43 matrix; #X text 465 42 see also help for; #X obj 595 63 cos; #X obj 48 164 mtx_cos; #X obj 48 192 mtx_print cos; #X obj 48 131 t a a; #X obj 91 132 mtx_print org; #X text 136 10 cosine of matrix elements; #X text 45 42 compute the cosine of each element of a matrix; #X obj 48 100 mtx 2 2; #X msg 48 80 0 3.14159 1 90; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION cosine of matrix elements; #X obj 16 147 declare -lib iemmatrix; #X restore 588 12 pd META; #X connect 3 0 4 0; #X connect 5 0 3 0; #X connect 5 1 6 0; #X connect 9 0 5 0; #X connect 10 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_cumprod-help.pd000066400000000000000000000036751514557770000260010ustar00rootroot00000000000000#N canvas 27 49 609 511 10; #X declare -lib iemmatrix; #X obj 525 43 matrix; #X text 395 42 see also help for; #X obj 12 189 t a a; #X msg 12 124 bang; #X msg 265 390 mode row; #X msg 265 364 mode column; #X msg 352 363 mode col; #X msg 418 363 mode :; #X obj 263 416 t a; #X obj 12 147 mtx_ones 3 4; #X obj 17 379 t a a; #X msg 17 305 bang; #X obj 17 331 mtx_ones 2 2; #X obj 20 211 mtx_print original; #X obj 46 400 mtx_print original; #X text 410 444 see also:; #X msg 298 336 direction -1; #X obj 12 235 t a a a; #X obj 409 466 mtx_cumsum; #X text 90 15 [mtx_cumprod]; #X text 47 34 cumulative product in row/col direction; #X text 18 63 you can calculate factorials or geometric series \; you can also do this into the reverse direction; #X obj 12 168 mtx_* 2; #X obj 17 357 mtx_* 2; #X obj 12 257 mtx_cumprod row; #X obj 138 258 mtx_cumprod col; #X obj 269 258 mtx_cumprod row -1; #X obj 17 442 mtx_cumprod row; #X obj 17 471 mtx_print cumprod; #X obj 12 285 mtx_print cumprod-row; #X obj 169 285 mtx_print cumprod-col; #X obj 330 285 mtx_print cumprod-col-reverse; #X text 377 484 Franz Zotter \, 2010; #N canvas 460 154 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION cumulative product of a matrix; #X text 12 105 AUTHOR Franz Zotter; #X obj 16 147 declare -lib iemmatrix; #X restore 541 6 pd META; #X connect 2 0 17 0; #X connect 2 1 13 0; #X connect 3 0 9 0; #X connect 4 0 8 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 27 0; #X connect 9 0 22 0; #X connect 10 0 27 0; #X connect 10 1 14 0; #X connect 11 0 12 0; #X connect 12 0 23 0; #X connect 16 0 8 0; #X connect 17 0 24 0; #X connect 17 1 25 0; #X connect 17 2 26 0; #X connect 22 0 2 0; #X connect 23 0 10 0; #X connect 24 0 29 0; #X connect 25 0 30 0; #X connect 26 0 31 0; #X connect 27 0 28 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_cumsum-help.pd000066400000000000000000000035151514557770000256320ustar00rootroot00000000000000#N canvas 27 49 670 511 10; #X declare -lib iemmatrix; #X obj 595 43 matrix; #X text 465 42 see also help for; #X obj 12 189 t a a; #X msg 12 124 bang; #X msg 265 390 mode row; #X msg 265 364 mode column; #X msg 352 363 mode col; #X msg 418 363 mode :; #X obj 263 416 t a; #X obj 12 166 mtx_ones 3 4; #X obj 17 379 t a a; #X msg 17 335 bang; #X obj 17 360 mtx_ones 2 2; #X text 90 15 [mtx_cumsum]; #X text 47 34 cumulative sum in row/col direction; #X obj 20 211 mtx_print original; #X obj 12 257 mtx_cumsum row; #X obj 12 285 mtx_print cumsum-row; #X obj 46 400 mtx_print original; #X obj 17 472 mtx_print cumsum; #X obj 117 257 mtx_cumsum col; #X obj 159 285 mtx_print cumsum-col; #X obj 410 466 mtx_diff; #X text 410 444 see also:; #X msg 298 336 direction -1; #X obj 17 443 mtx_cumsum row; #X obj 12 235 t a a a; #X obj 248 258 mtx_cumsum row -1; #X obj 310 285 mtx_print cumsum-col-reverse; #X text 18 63 you can calculate numerical integrals or ascending sequences of numbers with cumsum \; you can also do this into the reverse direction; #N canvas 460 154 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION cumulative sum of a matrix; #X text 12 105 AUTHOR Franz Zotter; #X obj 16 147 declare -lib iemmatrix; #X restore 591 6 pd META; #X connect 2 0 26 0; #X connect 2 1 15 0; #X connect 3 0 9 0; #X connect 4 0 8 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 25 0; #X connect 9 0 2 0; #X connect 10 0 25 0; #X connect 10 1 18 0; #X connect 11 0 12 0; #X connect 12 0 10 0; #X connect 16 0 17 0; #X connect 20 0 21 0; #X connect 24 0 8 0; #X connect 25 0 19 0; #X connect 26 0 16 0; #X connect 26 1 20 0; #X connect 26 2 27 0; #X connect 27 0 28 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_dbtopow-help.pd000066400000000000000000000030611514557770000257730ustar00rootroot00000000000000#N canvas 50 103 687 471 10; #X declare -lib iemmatrix; #X obj 181 100 mtx_eye; #X obj 64 285 mtx_rand 4 2; #X msg 64 263 bang; #X obj 64 307 t a a; #X obj 105 307 mtx_print org; #X obj 64 357 t a a; #X msg 181 79 3 3; #X obj 181 121 mtx_* 100; #X obj 48 162 mtx_print dbtorms; #X obj 105 357 mtx_print db; #X obj 64 407 mtx_print db; #X obj 48 100 mtx 2 2; #X text 290 305 note: dB(pd):=dB(techn)+100; #X text 307 337 this means: 100dB(pd)==unity gain (==1); #X text 404 375 0dB(pd)==zero gain (==0); #X text 391 354 106dB(pd)~=double gain (==2); #X obj 599 43 matrix; #X text 485 42 see also help for; #X text 44 34 convert dB(pd) to a power value for each element of a matrix; #X obj 48 134 mtx_dbtopow; #X obj 64 330 mtx_powtodb; #X obj 64 380 mtx_dbtopow; #X obj 599 91 dbtopow; #X obj 599 71 mtx_powtodb; #X text 188 7 convert dB(pd) to power; #X msg 48 80 0 100 97 103; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION calculate power value from dB for each matrix element, f 72; #X obj 16 147 declare -lib iemmatrix; #X restore 601 6 pd META; #X connect 0 0 7 0; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 0 20 0; #X connect 3 1 4 0; #X connect 5 0 21 0; #X connect 5 1 9 0; #X connect 6 0 0 0; #X connect 7 0 19 0; #X connect 11 0 19 0; #X connect 19 0 8 0; #X connect 20 0 5 0; #X connect 21 0 10 0; #X connect 25 0 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_dbtorms-help.pd000066400000000000000000000030541514557770000257710ustar00rootroot00000000000000#N canvas 337 124 687 471 10; #X declare -lib iemmatrix; #X text 188 7 convert dB(pd) to rms; #X obj 181 100 mtx_eye; #X obj 64 285 mtx_rand 4 2; #X msg 64 263 bang; #X obj 64 307 t a a; #X obj 105 307 mtx_print org; #X obj 64 357 t a a; #X msg 181 79 3 3; #X obj 48 134 mtx_dbtorms; #X obj 64 380 mtx_dbtorms; #X obj 599 71 mtx_rmstodb; #X obj 599 91 dbtorms; #X obj 181 121 mtx_* 100; #X obj 48 162 mtx_print dbtorms; #X obj 64 330 mtx_rmstodb; #X obj 105 357 mtx_print db; #X obj 64 407 mtx_print db; #X obj 48 100 mtx 2 2; #X text 44 34 convert dB(pd) to a linear value for each element of a matrix; #X text 290 305 note: dB(pd):=dB(techn)+100; #X text 307 337 this means: 100dB(pd)==unity gain (==1); #X text 404 375 0dB(pd)==zero gain (==0); #X msg 48 80 0 100 97 106; #X text 391 354 106dB(pd)~=double gain (==2); #X obj 599 43 matrix; #X text 465 42 see also help for; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION calculate linear value from dB for each matrix element, f 79; #X obj 16 147 declare -lib iemmatrix; #X restore 601 6 pd META; #X connect 1 0 12 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 14 0; #X connect 4 1 5 0; #X connect 6 0 9 0; #X connect 6 1 15 0; #X connect 7 0 1 0; #X connect 8 0 13 0; #X connect 9 0 16 0; #X connect 12 0 8 0; #X connect 14 0 6 0; #X connect 17 0 8 0; #X connect 22 0 17 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_diag-help.pd000066400000000000000000000021141514557770000252170ustar00rootroot00000000000000#N canvas 61 0 531 283 10; #X declare -lib iemmatrix; #X obj 422 49 matrix; #X text 292 48 see also help for; #X obj 103 227 mtx_print; #X msg 103 130 bang; #X text 129 20 [mtx_diag]; #X msg 136 157 1 2 3 4 5; #X text 93 252 diagonal-matrix; #X obj 103 201 mtx_diag 7 9 8; #X text 30 89 create a diagonal matrix; #X obj 300 130 mtx_rand 4; #X msg 300 108 bang; #X obj 300 197 mtx_diag; #X obj 300 231 print diagonal; #X obj 300 158 t a a; #X obj 347 159 mtx_print org; #X text 294 258 diagonal of the matrix; #X text 276 88 get the diagonal of a matrix; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION create a diagonal matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 451 13 pd META; #X connect 3 0 7 0; #X connect 5 0 7 0; #X connect 7 0 2 0; #X connect 9 0 13 0; #X connect 10 0 9 0; #X connect 11 0 12 0; #X connect 13 0 11 0; #X connect 13 1 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_diegg-help.pd000066400000000000000000000025261514557770000254010ustar00rootroot00000000000000#N canvas 310 132 566 428 10; #X declare -lib iemmatrix; #X obj 462 336 matrix; #X text 332 335 see also help for; #X text 129 20 [mtx_diegg]; #X obj 103 227 mtx_print; #X msg 103 130 bang; #X msg 136 157 1 2 3 4 5; #X obj 300 130 mtx_rand 4; #X msg 300 108 bang; #X obj 300 158 t a a; #X obj 347 159 mtx_print org; #X text 294 258 diagonal of the matrix; #X text 276 88 get the turned diagonal of a matrix; #X obj 300 231 print dieggonal; #X text 93 252 turned diagonal-matrix; #X text 30 89 create a turned diagonal matrix; #X obj 300 197 mtx_diegg; #X obj 103 201 mtx_diegg 7 9 8; #X text 58 299 "turned" means rotated by -90deg:; #X text 90 339 1 0 0; #X text 90 353 0 2 0; #X text 90 366 0 0 3; #X text 200 353 0 2 0; #X text 200 339 0 0 1; #X text 200 366 3 0 0; #X text 148 353 ==>; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION create a turned diagonal matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 511 10 pd META; #X obj 462 366 mtx_diag; #X connect 4 0 16 0; #X connect 5 0 16 0; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 8 0 15 0; #X connect 8 1 9 0; #X connect 15 0 12 0; #X connect 16 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_diff-help.pd000066400000000000000000000035561514557770000252360ustar00rootroot00000000000000#N canvas 628 70 670 511 10; #X declare -lib iemmatrix; #X obj 595 43 matrix; #X text 465 42 see also help for; #X obj 12 189 t a a; #X msg 12 124 bang; #X msg 265 390 mode row; #X msg 265 364 mode column; #X msg 352 363 mode col; #X msg 418 363 mode :; #X obj 263 416 t a; #X obj 12 166 mtx_ones 3 4; #X obj 17 379 t a a; #X msg 17 335 bang; #X obj 17 360 mtx_ones 2 2; #X obj 39 211 mtx_print original; #X obj 12 285 mtx_print cumsum-row; #X obj 46 400 mtx_print original; #X obj 17 472 mtx_print cumsum; #X obj 159 285 mtx_print cumsum-col; #X text 410 444 see also:; #X text 90 15 [mtx_diff]; #X obj 117 257 mtx_diff col; #X obj 17 443 mtx_diff; #X obj 410 466 mtx_cumsum; #X obj 12 257 mtx_diff row; #X text 47 34 first forward/backward difference; #X text 18 63 you can calculate the differences between matrix elements forwards/backwards \; this is useful for the numerical derivative of vectors/matrices.; #X obj 12 235 t a a a; #X obj 307 284 mtx_print cumsum-row-reverse; #X obj 265 256 mtx_diff col -1; #X msg 425 385 direction -1; #N canvas 261 282 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION calculate the differences between matrix elements, f 67; #X obj 16 147 declare -lib iemmatrix; #X restore 599 6 pd META; #X connect 2 0 26 0; #X connect 2 1 13 0; #X connect 3 0 9 0; #X connect 4 0 8 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 21 0; #X connect 9 0 2 0; #X connect 10 0 21 0; #X connect 10 1 15 0; #X connect 11 0 12 0; #X connect 12 0 10 0; #X connect 20 0 17 0; #X connect 21 0 16 0; #X connect 23 0 14 0; #X connect 26 0 23 0; #X connect 26 1 20 0; #X connect 26 2 28 0; #X connect 28 0 27 0; #X connect 29 0 8 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_distance2-help.pd000066400000000000000000000027261514557770000262000ustar00rootroot00000000000000#N canvas 83 338 696 369 10; #X declare -lib iemmatrix; #X obj 33 242 mtx_distance2; #X obj 33 267 mtx_print distances; #X obj 119 179 t a a; #X obj 149 198 mtx_print B; #X obj 33 179 t a a; #X obj 63 198 mtx_print A; #X obj 33 106 t b b; #X msg 33 85 bang; #X obj 33 132 mtx_rand 4 3; #X obj 119 154 mtx_rand 2 3; #X text 44 34 [mtx_distance2]; #X text 482 28 part of iemmatrix; #X text 268 138 inletA: a matrix defining vectors of dimension ; #X text 268 158 inletB: a matrix defining vectors of dimension ; #X text 267 179 outlet: distance matrix (i \, j) \, where each element Y(i \, j)=(A(i)-B(i)).(A(i)-B(i))=|A(i)-B(i)|^2; #X text 166 69 calculate the (square of the) euclidean distance between two sets of vectors.; #X text 233 274 note: if you want the real-distance (non-squared) \, calculate the square-root with [mtx_.^ 0.5]; #N canvas 460 154 564 203 META 0; #X text 12 115 AUTHOR IOhannes m zmoelnig; #X text 12 95 OUTLET_0 matrix; #X text 12 135 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 75 INLET_0 matrix; #X text 13 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION calculate the matrix of squared euclidean distances between a set of vectors, f 91; #X obj 13 160 declare -lib iemmatrix; #X restore 551 326 pd META; #X connect 0 0 1 0; #X connect 2 0 0 1; #X connect 2 1 3 0; #X connect 4 0 0 0; #X connect 4 1 5 0; #X connect 6 0 8 0; #X connect 6 1 9 0; #X connect 7 0 6 0; #X connect 8 0 4 0; #X connect 9 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_egg-help.pd000066400000000000000000000014701514557770000250610ustar00rootroot00000000000000#N canvas 61 0 491 290 10; #X declare -lib iemmatrix; #X obj 402 126 matrix; #X text 272 125 see also help for; #X obj 103 201 mtx_egg 5; #X obj 103 227 mtx_print; #X msg 103 130 bang; #X msg 133 174 3 5; #X msg 119 150 10; #X text 129 20 [mtx_egg]; #X text 30 89 create an exchange (turned identity) matrix; #X text 79 246 exchange matrix; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 11 45 DESCRIPTION create an exchange matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 431 16 pd META; #X obj 402 148 mtx_eye; #X connect 2 0 3 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_eig-help.pd000066400000000000000000000024031514557770000250600ustar00rootroot00000000000000#N canvas 15 52 710 371 10; #X declare -lib iemmatrix; #X obj 82 143 mtx_eig; #X obj 82 116 mtx_rand; #X obj 82 196 print l_re; #X obj 128 174 print l_im; #X msg 82 88 3; #X obj 221 111 mtx_rand; #X msg 221 83 3; #X obj 230 169 mtx_eig v; #X obj 230 242 print l_re; #X obj 250 221 print l_im; #X obj 314 243 mtx_print Q_re; #X obj 335 221 mtx_print Q_im; #X obj 230 148 t a a; #X obj 375 173 mtx_print A; #X msg 350 106 matrix 2 2 1 1 -1 2; #X text 61 17 [mtx_eig] computes (complex valued) eigenvalues \, and if desired eigenvectors of a matrix.; #X text 425 71 requires GSL; #X text 212 326 Franz Zotter \, 2009; #N canvas 460 154 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 105 AUTHOR Franz Zotter; #X text 12 45 DESCRIPTION compute eigenvalues and eigenvectors of a matrix; #X obj 13 150 declare -lib iemmatrix; #X restore 581 76 pd META; #X connect 0 0 2 0; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 4 0 1 0; #X connect 5 0 12 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 7 2 10 0; #X connect 7 3 11 0; #X connect 12 0 7 0; #X connect 12 1 13 0; #X connect 14 0 12 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_element-help.pd000066400000000000000000000023731514557770000257530ustar00rootroot00000000000000#N canvas 136 41 544 373 10; #X declare -lib iemmatrix; #X obj 413 54 matrix; #X text 283 53 see also help for; #X obj 413 76 mtx_row; #X obj 413 96 mtx_col; #X obj 53 302 mtx_print; #X obj 53 283 mtx_element 4 3; #X obj 64 260 mtx_ones 5 3; #X msg 64 241 bang; #X floatatom 53 191 4 0 0 0 - - - 0; #X msg 164 176 3 2; #X msg 164 197 2 0; #X msg 164 218 0 1; #X msg 165 238 0 0; #X text 199 177 set element [3 \, 2]; #X text 199 197 set all elements in row [2]; #X text 199 217 set all elements in column [1]; #X text 163 284 creation: mtx_element [ [ ]]; #X obj 89 32 mtx_element; #X text 52 133 set matrix elements; #X text 200 237 set all elements of matrix (default!); #X text 19 9 set elements of a matrix; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 45 DESCRIPTION set elements of a matrix; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 481 6 pd META; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 7 0 6 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 5 1; #X connect 11 0 5 1; #X connect 12 0 5 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_eq-help.pd000066400000000000000000000025031514557770000247220ustar00rootroot00000000000000#N canvas 224 247 450 300 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 100 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 339 193 ==; #X obj 17 23 mtx_eq; #X obj 81 23 mtx_==; #X obj 392 77 ==; #X obj 46 196 mtx_eq; #X obj 125 197 mtx_==; #X obj 263 192 mtx_eq 0; #X obj 360 192 mtx_== 0; #X text 8 42 matrix logic: comparison; #X text 38 247 compare 2 matrices; #X text 246 251 compare a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION compare a matrix for equality with another; #X text 12 5 KEYWORDS control matrix comparison; #X obj 16 147 declare -lib iemmatrix; #X restore 381 6 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_exp-help.pd000066400000000000000000000024521514557770000251140ustar00rootroot00000000000000#N canvas 128 113 545 476 10; #X declare -lib iemmatrix; #X msg 48 59 3 5; #X obj 445 336 exp; #X obj 48 134 mtx_exp; #X obj 48 81 mtx_eye; #X obj 125 100 mtx 3 3; #X msg 125 80 0 1 2 3 4 5 6 7 8; #X obj 445 356 mtx_log; #X obj 48 162 mtx_print exponential; #X obj 64 285 mtx_rand 4 2; #X msg 64 263 bang; #X obj 64 307 t a a; #X obj 105 307 mtx_print org; #X obj 64 330 mtx_exp; #X obj 64 357 t a a; #X obj 105 357 mtx_print exp; #X obj 64 380 mtx_log; #X obj 64 407 mtx_print log; #X obj 445 313 matrix; #X text 315 312 see also help for; #X text 45 42 compute the exponentials of matrix elements; #X text 188 7 exponentials of matrix elements; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 45 DESCRIPTION compute the exponentials of matrix elements; #X obj 16 147 declare -lib iemmatrix; #X restore 459 17 pd META; #X connect 0 0 3 0; #X connect 2 0 7 0; #X connect 3 0 2 0; #X connect 4 0 2 0; #X connect 5 0 4 0; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 10 0 12 0; #X connect 10 1 11 0; #X connect 12 0 13 0; #X connect 13 0 15 0; #X connect 13 1 14 0; #X connect 15 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_eye-help.pd000066400000000000000000000014441514557770000251020ustar00rootroot00000000000000#N canvas 61 0 491 290 10; #X declare -lib iemmatrix; #X text 30 89 create an identity matrix; #X obj 432 76 matrix; #X text 302 75 see also help for; #X obj 103 201 mtx_eye 5; #X obj 103 227 mtx_print; #X msg 103 130 bang; #X msg 133 174 3 5; #X msg 119 150 10; #X text 79 246 identity matrix; #X text 129 20 [mtx_eye]; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION create an identity matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 431 16 pd META; #X obj 432 104 mtx_egg; #X connect 3 0 4 0; #X connect 5 0 3 0; #X connect 6 0 3 0; #X connect 7 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_fft-help.pd000066400000000000000000000046541514557770000251050ustar00rootroot00000000000000#N struct mtx_vis-plot float x float y array mtx_vis-array mtx_vis-element 1; #N struct mtx_vis-element float x float y float c float dx float dy; #N canvas 790 257 463 717 10; #X declare -lib iemmatrix; #X obj 366 124 matrix; #X msg 11 124 bang; #X obj 11 191 mtx_cumsum; #X msg 11 147 1 16; #X obj 11 169 mtx_ones; #X obj 11 213 mtx_- 1; #X obj 49 255 mtx_* 0; #X floatatom 140 210 5 0 0 0 - - - 0; #X text 184 208 <-- scroll here to select frequency; #X obj 172 255 / 8; #X obj 49 326 t a a; #X text 298 124 see also:; #X obj 49 300 mtx_cos; #X obj 103 255 * 3.14159; #X text 109 300 cosine wave; #X obj 208 472 mtx_int; #X obj 49 463 mtx_int; #X obj 208 423 mtx_+ 0.5; #X obj 49 423 mtx_+ 0.5; #X obj 140 231 t b f; #N canvas 450 271 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X obj 16 147 declare -lib iemmatrix; #X text 12 44 DESCRIPTION complex-valued FFT of each matrix row; #X restore 381 16 pd META; #X obj 366 170 mtx_rfft; #X obj 49 380 mtx_fft, f 27; #X obj 208 326 t a a; #X obj 208 300 mtx_sin; #X obj 49 484 mtx_print fft.re; #X obj 208 492 mtx_print fft.im; #X obj 235 351 mtx_print orig.im; #X obj 76 351 mtx_print orig.re; #X text 268 300 sine wave; #X obj 49 278 t a a, f 27; #X obj 46 512 mtx_plot 200 50; #X obj 256 512 mtx_plot 200 50; #X obj 208 448 t a a; #X obj 208 402 mtx_./ 16; #X obj 49 401 mtx_./ 16; #X obj 49 443 t a a; #X text 89 15 [mtx_fft]; #X text 46 34 forward complex FFT of each matrix row; #X text 7 60 you can calculate the FFTs in column direction \; matrix has to have 2^k columns \; the result is a matrix with the same dimensions.; #X obj 366 147 mtx_ifft; #X connect 1 0 3 0; #X connect 2 0 5 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 30 0; #X connect 7 0 19 0; #X connect 9 0 13 0; #X connect 10 0 22 0; #X connect 10 1 28 0; #X connect 12 0 10 0; #X connect 13 0 6 1; #X connect 15 0 26 0; #X connect 16 0 25 0; #X connect 17 0 33 0; #X connect 18 0 36 0; #X connect 19 0 1 0; #X connect 19 1 9 0; #X connect 22 0 35 0; #X connect 22 1 34 0; #X connect 23 0 22 1; #X connect 23 1 27 0; #X connect 24 0 23 0; #X connect 30 0 12 0; #X connect 30 1 24 0; #X connect 33 0 15 0; #X connect 33 1 32 0; #X connect 34 0 17 0; #X connect 35 0 18 0; #X connect 36 0 16 0; #X connect 36 1 31 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_fill-help.pd000066400000000000000000000042471514557770000252520ustar00rootroot00000000000000#N canvas 333 84 670 511 10; #X declare -lib iemmatrix; #X obj 595 43 matrix; #X text 475 42 see also help for; #X obj 62 208 mtx_fill; #X text 87 15 [mtx_fill]; #X text 47 34 filling elements of a data matrix into specific positions of an other matrix; #X obj 136 117 mtx_zeros; #X obj 62 231 mtx_print; #X floatatom 232 110 5 0 0 0 - - - 0; #X obj 136 75 loadbang; #X msg 136 95 10 10; #X text 238 198 <-- if empty matrix: filling sub-matrix at start position; #X floatatom 281 110 5 0 0 0 - - - 0; #X text 234 92 row; #X text 289 93 col; #X msg 145 197 matrix \$1 \$2; #X obj 247 127 t b f; #X obj 245 147 pack 1 1; #X obj 245 167 t b l; #X msg 61 127 3 3; #X obj 62 148 mtx_rand; #X obj 62 166 mtx_* 10; #X obj 62 183 mtx_int; #X obj 84 438 mtx_fill; #X obj 149 333 mtx_zeros; #X obj 84 461 mtx_print; #X obj 149 291 loadbang; #X msg 149 311 10 10; #X text 25 76 1 submatrix; #X text 19 275 2 any positions; #X obj 246 333 mtx_rand; #X obj 246 374 mtx_find; #X obj 71 401 mtx_ones; #X msg 246 310 10 10; #X obj 70 340 mtx_size; #X obj 71 360 *; #X obj 246 395 t a a; #X msg 71 379 1 \$1; #X obj 246 354 mtx_> 0.8; #N canvas 719 387 517 200 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 45 DESCRIPTION fill elements of a matrix into specific positions of another matrix, f 79; #X obj 16 147 declare -lib iemmatrix; #X restore 611 6 pd META; #X connect 2 0 6 0; #X connect 5 0 2 1; #X connect 7 0 16 0; #X connect 8 0 9 0; #X connect 9 0 5 0; #X connect 11 0 15 0; #X connect 14 0 2 2; #X connect 15 0 16 0; #X connect 15 1 16 1; #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 17 1 14 0; #X connect 18 0 19 0; #X connect 19 0 20 0; #X connect 20 0 21 0; #X connect 21 0 2 0; #X connect 22 0 24 0; #X connect 23 0 22 1; #X connect 25 0 26 0; #X connect 26 0 23 0; #X connect 29 0 37 0; #X connect 30 0 35 0; #X connect 31 0 22 0; #X connect 32 0 29 0; #X connect 33 0 34 0; #X connect 33 1 34 1; #X connect 34 0 36 0; #X connect 35 0 33 0; #X connect 35 1 22 2; #X connect 36 0 31 0; #X connect 37 0 30 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_find-help.pd000066400000000000000000000037111514557770000252370ustar00rootroot00000000000000#N canvas 237 76 670 511 10; #X declare -lib iemmatrix; #X obj 595 43 matrix; #X text 465 42 see also help for; #X obj 41 208 t a a; #X text 504 412 see also:; #X text 89 15 [mtx_find]; #X text 47 34 finding indices to nonzero matrix elements; #X obj 504 431 mtx_index; #X msg 41 181 matrix 1 5 0 1 0 1 0 0; #X obj 83 209 mtx_print original; #X obj 41 232 mtx_find; #X obj 41 258 mtx_print nonzero; #X text 33 60 you can use this e.g. in combination with logical conditions \; the result is a matrix \, if non-existent an empty matrix.; #X text 36 112 the matrix result is important when trying to find the first/last nonzero element in column or row direction \, it enables flexible use with [mtx_index].; #X msg 205 182 matrix 1 3 0 0 0; #X msg 281 206 2 3; #X obj 220 207 mtx_ones; #X obj 120 345 mtx_find col -1; #X obj 233 345 mtx_find col; #X obj 324 345 mtx_find row -1; #X obj 439 345 mtx_find row; #X obj 204 276 mtx_rand; #X msg 204 256 3 4; #X obj 204 315 t a a a a a; #X obj 288 314 mtx_print orig; #X obj 120 430 mtx_print last-in-col; #X obj 233 411 mtx_print first-in-col; #X obj 439 370 mtx_print first-in-col; #X obj 324 391 mtx_print last-in-row; #X obj 205 295 mtx_> 0.5; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 45 DESCRIPTION find indices of non-zero matrix elements; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 601 6 pd META; #X connect 2 0 9 0; #X connect 2 1 8 0; #X connect 7 0 2 0; #X connect 9 0 10 0; #X connect 13 0 2 0; #X connect 14 0 15 0; #X connect 15 0 2 0; #X connect 16 0 24 0; #X connect 17 0 25 0; #X connect 18 0 27 0; #X connect 19 0 26 0; #X connect 20 0 28 0; #X connect 21 0 20 0; #X connect 22 0 16 0; #X connect 22 1 17 0; #X connect 22 2 18 0; #X connect 22 3 19 0; #X connect 22 4 23 0; #X connect 28 0 22 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_gauss-help.pd000066400000000000000000000021521514557770000254370ustar00rootroot00000000000000#N canvas 66 122 657 401 10; #X declare -lib iemmatrix; #X text 465 252 see also help for; #X text 26 12 mtx_gauss:: gauss elimination algorithm; #X text 71 62 apply row- & column-transformation to a matrix to shape it into an upper-triangle matrix; #X obj 595 253 matrix; #X obj 595 273 abs; #X msg 174 146 bang; #X obj 174 190 t a a; #X msg 87 144 bang; #X obj 87 165 mtx_rand 5; #X obj 174 167 mtx_eye 5; #X obj 264 167 mtx_egg 5; #X obj 204 235 mtx_print original; #X msg 264 144 bang; #X obj 174 270 mtx_gauss; #X obj 174 327 mtx_print gauss; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 45 DESCRIPTION matrix gauss eleminitation algorithm; #X text 12 4 KEYWORDS control matrix math; #X obj 16 147 declare -lib iemmatrix; #X restore 591 16 pd META; #X connect 5 0 9 0; #X connect 6 0 13 0; #X connect 6 1 11 0; #X connect 7 0 8 0; #X connect 8 0 6 0; #X connect 9 0 6 0; #X connect 10 0 6 0; #X connect 12 0 10 0; #X connect 13 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_ge-help.pd000066400000000000000000000025111514557770000247070ustar00rootroot00000000000000#N canvas 224 247 450 300 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 100 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 339 193 ==; #X obj 17 23 mtx_ge; #X obj 81 23 mtx_>=; #X obj 392 77 >=; #X obj 46 196 mtx_ge; #X obj 125 197 mtx_>=; #X obj 263 192 mtx_ge 0; #X obj 360 192 mtx_>= 0; #X text 8 42 matrix logic: comparison; #X obj 123 167 mtx_diag 1 2 -3 4 5; #X text 38 247 compare 2 matrices; #X text 246 251 compare a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION compare a matrix with another for greater-than; #X text 12 5 KEYWORDS control matrix comparison; #X obj 16 147 declare -lib iemmatrix; #X restore 382 6 pd META; #X connect 2 0 16 0; #X connect 3 0 2 0; #X connect 3 1 21 0; #X connect 5 0 3 0; #X connect 7 0 18 0; #X connect 8 0 7 0; #X connect 10 0 11 0; #X connect 11 0 7 0; #X connect 11 1 18 1; #X connect 16 0 4 0; #X connect 18 0 9 0; #X connect 21 0 16 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_gt-help.pd000066400000000000000000000024761514557770000247400ustar00rootroot00000000000000#N canvas 224 247 450 300 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 100 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 339 193 ==; #X obj 17 23 mtx_gt; #X obj 81 23 mtx_>; #X obj 392 77 >; #X obj 46 196 mtx_gt; #X obj 125 197 mtx_>; #X obj 263 192 mtx_gt 0; #X obj 360 192 mtx_> 0; #X text 8 42 matrix logic: comparison; #X text 38 247 compare 2 matrices; #X text 246 251 compare a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix comparison; #X text 12 44 DESCRIPTION compare a matrix with another for greater; #X obj 16 147 declare -lib iemmatrix; #X restore 382 6 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_ifft-help.pd000066400000000000000000000030461514557770000252500ustar00rootroot00000000000000#N canvas 317 110 463 489 10; #X declare -lib iemmatrix; #X obj 334 139 matrix; #X obj 49 216 t a a; #X text 266 139 see also:; #N canvas 450 271 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X obj 16 147 declare -lib iemmatrix; #X text 12 44 DESCRIPTION complex-valued inverse FFT of each matrix row; #X restore 381 16 pd META; #X obj 208 216 t a a; #X obj 235 241 mtx_print orig.im; #X obj 76 241 mtx_print orig.re; #X obj 49 188 t a a, f 27; #X text 89 15 [mtx_ifft]; #X obj 334 185 mtx_rifft; #X obj 49 166 matrix 1 16; #X msg 49 144 element 1 2 1 \, bang; #X obj 49 290 mtx_ifft, f 27; #X obj 49 337 t a a; #X obj 208 337 t a a; #X obj 49 404 mtx_fft, f 27; #X obj 49 427 mtx_print back.re; #X obj 208 427 mtx_print back.im; #X obj 334 162 mtx_fft; #X text 46 34 complex inverse FFT of each matrix row; #X text 7 60 you can calculate the inverse FFTs in column direction \; matrix has to have 2^k columns \; the result is a matrix with the same dimensions.; #X obj 76 364 mtx_print ifft.re; #X obj 235 364 mtx_print ifft.im; #X connect 1 0 12 0; #X connect 1 1 6 0; #X connect 4 0 12 1; #X connect 4 1 5 0; #X connect 7 0 1 0; #X connect 7 1 4 0; #X connect 10 0 7 0; #X connect 11 0 10 0; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 13 0 15 0; #X connect 13 1 21 0; #X connect 14 0 15 1; #X connect 14 1 22 0; #X connect 15 0 16 0; #X connect 15 1 17 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_index-help.pd000066400000000000000000000035051514557770000254270ustar00rootroot00000000000000#N canvas 0 0 646 521 10; #X declare -lib iemmatrix; #X obj 585 63 matrix; #X text 465 62 see also help for; #X obj 81 170 t a a; #X text 89 15 [mtx_index]; #X msg 81 135 matrix 1 5 -1 -2 -3 -4 -5; #X obj 275 168 t a a; #X obj 305 191 mtx_print right-indices; #X obj 111 193 mtx_print left-values; #X obj 81 237 mtx_print addressed-values; #X obj 81 214 mtx_index nan; #X text 185 215 <- invalid indices; #X msg 275 148 matrix 2 2 0 5 2 4; #X text 8 60 you can simultaneously address matrix elements you know the indices of \; the outlet matrix carries the shape of the indexing matrix \; 0 is not allowed as index \, so you can give an alternative value as creation argument (here nan).; #X obj 585 88 mtx_find; #X text 44 282 the indexing matrix can e.g. be the outlet of mtx_find based on logical conditions:; #X obj 89 325 mtx_rand; #X obj 89 347 t a a; #X obj 119 369 mtx_> 0.5; #X msg 51 323 2 3; #X obj 134 347 mtx_print random values; #X obj 119 391 mtx_find col; #X obj 89 413 mtx_index nan; #X obj 89 442 mtx_print result; #X text 200 411 finding the first nonzero entry in column; #X text 47 34 addressing matrix elements by their indices; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 11 44 DESCRIPTION address matrix elements by their indices; #X text 11 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 591 6 pd META; #X connect 2 0 9 0; #X connect 2 1 7 0; #X connect 4 0 2 0; #X connect 5 0 9 1; #X connect 5 1 6 0; #X connect 9 0 8 0; #X connect 11 0 5 0; #X connect 15 0 16 0; #X connect 16 0 21 0; #X connect 16 1 17 0; #X connect 16 1 19 0; #X connect 17 0 20 0; #X connect 18 0 15 0; #X connect 20 0 21 1; #X connect 21 0 22 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_int-help.pd000066400000000000000000000016221514557770000251100ustar00rootroot00000000000000#N canvas 128 118 596 254 10; #X declare -lib iemmatrix; #X obj 505 133 matrix; #X text 385 132 see also help for; #X obj 505 153 int; #X obj 48 164 mtx_int; #X obj 48 192 mtx_print int; #X obj 48 131 t a a; #X obj 91 132 mtx_print org; #X text 136 10 integer value of matrix elements; #X text 45 42 compute the integer value of each element of a matrix; #X obj 48 100 mtx 3 2; #X msg 48 80 0 1 -2 0.9 -0.9 -999.1; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION compute integer value of each matrix element; #X obj 16 147 declare -lib iemmatrix; #X restore 521 16 pd META; #X connect 3 0 4 0; #X connect 5 0 3 0; #X connect 5 1 6 0; #X connect 9 0 5 0; #X connect 10 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_inverse-help.pd000066400000000000000000000033701514557770000257730ustar00rootroot00000000000000#N canvas 366 49 604 572 10; #X declare -lib iemmatrix; #X obj 484 418 matrix; #X text 354 417 see also help for; #X text 243 142 singular; #X text 245 107 regular; #X text 246 158 regular; #X text 247 168 but badly conditioned; #X text 45 16 mtx_inverse:: get the inverse of a matrix; #X text 44 49 mtx_inverse calculates the inverse of a square-matrix; #X text 43 67 if the input is a non-square matrix (rows!=cols) \, the pseudo-inverse will be calculated.; #X text 154 453 A*inv(A)=inv(A)*A=I; #X text 248 221 pseudoinverse: P1=inv(A'*A)*A'; #X text 247 269 pseudoinverse: P2=A'*inv(A*A'); #X text 245 473 P1*A=I; #X text 245 493 A*P2=I; #X obj 92 358 mtx_inverse; #X obj 92 199 mtx 3; #X msg 112 164 1 2 3 2 4 4 3 4 5; #X msg 103 140 1 2 3 2 3 4 3 4 5; #X msg 92 108 1 2 4 2 3 4 3 4 5; #X obj 92 392 mtx_print inverse; #X obj 92 300 t a a; #X obj 134 300 mtx_print original; #X obj 153 219 mtx_rand 4 3; #X msg 153 198 bang; #X msg 153 248 bang; #X obj 153 269 mtx_rand 3 4; #X obj 181 358 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 199 359 instability detected!; #N canvas 543 408 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 11 4 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION calculate the inverse (or pseudo-inverse) of a matrix, f 72; #X obj 16 147 declare -lib iemmatrix; #X restore 541 16 pd META; #X connect 14 0 19 0; #X connect 14 1 26 0; #X connect 15 0 20 0; #X connect 16 0 15 0; #X connect 17 0 15 0; #X connect 18 0 15 0; #X connect 20 0 14 0; #X connect 20 1 21 0; #X connect 22 0 20 0; #X connect 23 0 22 0; #X connect 24 0 25 0; #X connect 25 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_isequal-help.pd000066400000000000000000000043621514557770000257650ustar00rootroot00000000000000#N canvas 224 247 1011 346 10; #X declare -lib iemmatrix; #X obj 900 128 matrix; #X text 770 127 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X msg 46 123 bang; #X floatatom 433 122 4 0 0 0 - - - 0; #X obj 900 149 ==; #X text 38 247 compare 2 matrices; #X text 296 251 compare a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix comparison; #X obj 16 147 declare -lib iemmatrix; #X text 12 44 DESCRIPTION compare a matrix for equality with another (scalar result), f 72; #X text 12 85 OUTLET_0 float; #X restore 864 25 pd META; #X obj 46 196 mtx_isequal; #X floatatom 46 219 5 0 0 0 - - - 0; #X obj 496 167 mtx_ones 4; #X floatatom 433 215 5 0 0 0 - - - 0; #X obj 900 170 mtx_==; #X msg 596 155 bang; #X obj 596 178 mtx_ones 4; #X obj 596 201 mtx_.* 1e-05; #X obj 596 224 mtx_isequal 0, f 14; #X floatatom 596 247 5 0 0 0 - - - 0; #X floatatom 650 112 5 0 0 0 - - - 0; #X obj 650 134 t b f; #X msg 677 201 eps \$1; #X msg 650 43 2e-05; #X msg 670 83 0; #X msg 660 63 1e-05; #X msg 640 23 0.001; #X text 583 265 less strict comparison (the difference between values must be [<#in> [] [<...>]]; #X text 302 154 the first inlet eats; #X text 316 314 the 2nd...one-before-last inlets get the signals to be multiplied.; #X text 328 487 Output signals; #X text 207 68 OUT~^ = A * IN~^; #X obj 48 167 mtx_eye 4 3; #X obj 170 167 mtx_egg 4 3; #X obj 190 245 mtx_zeros 4 3; #X obj 69 246 mtx_ones 4 3; #X msg 699 33 \; pd dsp 1; #X text 127 96 or \, with dimensions: OUT~^[1*n] = A[n*m] * IN~^[m*1]; #N canvas 34 69 925 425 LEGACY 0; #X obj 51 160 sig~; #X floatatom 180 166 5 0 0 0 - - - 0; #X text 286 127 this object \, accepted the signals at the first inputs \, then the matrix (and finally the fade-time); #X text 295 163 OUT~^[n] = IN~^[m] * B[m*x]; #X obj 192 307 sig~; #X msg 97 303 time 100; #X obj 93 160 sig~; #X obj 50 188 matrix~ 2 3 100; #X obj 136 138 mtx 2 3; #X obj 25 346 matrix_mul_line~ 2 3 100; #X obj 235 307 sig~; #X text 288 262 this object \, accepted the signals at the inlets \; all! messages went to the 1st inlet; #X obj 25 304 mtx 3 2; #X text 297 298 OUT~^[n] = B[n*m] * IN~^[m]; #X text 288 183 this is a _very_ unusual way to notate signal matrix multiplications; #X text 290 318 this conforms to the way how signal matrix multiplications is usually notated \, however \, we didn't like that the incoming matrix had different dimensions than the object ([mtx N M] vs [matrix_mul_line~ M N]) \; and the 1st inlet was a bit overloaded.; #X text 84 18 [mtx_*~] is the successor of 2 similar objects \, which we believe to have had some design flaws:; #X connect 0 0 7 0; #X connect 1 0 7 3; #X connect 4 0 9 0; #X connect 5 0 9 0; #X connect 6 0 7 1; #X connect 8 0 7 2; #X connect 10 0 9 1; #X connect 12 0 9 0; #X restore 65 587 pd LEGACY; #N canvas 468 154 486 187 META 0; #X text 12 135 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 11 4 KEYWORDS signal matrix; #X text 11 43 DESCRIPTION multiply signals with a matrix; #X text 12 65 INLET_0 matrix; #X text 12 82 INLET_n signal; #X text 12 97 OUTLET_m signal; #X obj 13 160 declare -lib iemmatrix; #X text 12 116 AUTHOR IOhannes m zmölnig; #X restore 731 586 pd META; #N canvas 112 13 1011 803 multichannel 0; #X text 39 17 With recent versions of Pd (>=0.54) \, you can use multichannel connections.; #X text 38 56 To do so \, give '0' as the number of rows (outlets) and/or columns (inlets); #X obj 427 268 mtx_*~ 0 0 100; #X obj 474 234 snake~ in 2; #X obj 474 209 sig~ 1; #X obj 427 318 snapshot~; #X floatatom 427 343 5 0 0 0 - - - 0; #X obj 507 318 snapshot~; #X floatatom 507 343 5 0 0 0 - - - 0; #X obj 376 298 r .\$0; #X msg 99 200 eye 2; #X obj 774 62 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X msg 774 87 \; pd dsp \$1; #X obj 547 209 sig~ 2; #X obj 99 273 mtx_print; #X obj 427 293 snake~ out 3; #X obj 587 318 snapshot~; #X floatatom 587 343 5 0 0 0 - - - 0; #X msg 56 126 ones 3 2; #X text 43 368 With multichannel signals \, the number of input/output channels is variable.; #X text 37 411 The following limitations apply:; #X text 61 441 - while the DSP is running \, the number of I/O-channels cannot be changed., f 58; #X text 62 478 - the number of input channels is dictated by the incoming connection.; #X text 64 519 - if the number of I/O-channels changes (during a DSP restart) \, the multiplication matrix is resized accordingly; #X obj 204 745 mtx_*~ 4 0 100; #X obj 679 715 mtx_*~ 0 4 100; #X obj 679 740 snake~ out 7; #X obj 251 721 snake~ in 2; #X text 90 619 it's possible to select multichannel and/or discrete channels per direction, f 76; #X text 97 696 multichannel input \, discrete outputs:; #X text 136 645 the dimension of the matrix must match the discrete channels; #X msg 91 749 eye 5 7; #X obj 91 774 mtx; #X msg 91 725 eye 4 3; #X text 33 728 good; #X text 36 750 BAD; #X obj 601 764 mtx; #X text 543 718 good; #X text 546 740 BAD; #X msg 600 715 eye 3 4; #X msg 601 739 eye 4 5; #X text 577 693 discrete inputs \, multichannel output:; #X text 533 437 (however \, you can turn off the DSP \, send a new NxK matrix and the number of outputs will be N \, once the DSP is started again); #X text 530 482 (while you can send a NxK matrix \, if you also connect a [snake~ in 7] object to [mtx_*~] \, the number of input channels will be 7 \, regardless of the value of K); #X obj 56 102 loadbang; #X text 125 106 initialize before the DSP starts; #X text 127 127 (here: 3 output and 2 input channels); #X msg 159 200 egg 3; #N canvas 905 436 444 359 restart 0; #X obj 105 54 inlet; #X obj 105 79 t b a b; #X obj 128 178 outlet; #X obj 256 81 r pd-dsp-stopped; #X obj 223 56 r pd-dsp-started; #X msg 223 81 1; #X msg 256 106 0; #X obj 105 252 select 1; #X obj 205 191 t f f; #X obj 237 252 select 1; #X msg 237 277 0; #X msg 237 306 \; pd dsp \$1; #X msg 105 277 1; #X obj 205 166 i 0; #X obj 105 222 i; #X text 78 17 restart the DSP (iff it's already running); #X obj 223 139 t f f; #X obj 355 139 metro 50; #X obj 355 164 s .\$0; #X text 352 119 snapshot tick; #X connect 0 0 1 0; #X connect 1 0 14 0; #X connect 1 1 2 0; #X connect 1 2 13 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 5 0 16 0; #X connect 6 0 16 0; #X connect 7 0 12 0; #X connect 8 0 14 1; #X connect 8 1 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 12 0 11 0; #X connect 13 0 8 0; #X connect 14 0 7 0; #X connect 16 0 13 1; #X connect 16 1 17 0; #X connect 17 0 18 0; #X restore 262 222 pd restart DSP; #X msg 262 197 eye 2; #X msg 322 197 egg 3; #X obj 99 225 matrix; #X obj 736 268 mtx_*~ -m 3; #X text 722 194 force multichannel-mode with the '-m' flag. the optional dimensions are tentative and can change while the DSP is stopped., f 32; #X obj 737 318 snapshot~; #X floatatom 737 343 5 0 0 0 - - - 0; #X obj 817 318 snapshot~; #X floatatom 817 343 5 0 0 0 - - - 0; #X obj 737 293 snake~ out 3; #X obj 897 318 snapshot~; #X floatatom 897 343 5 0 0 0 - - - 0; #X obj 99 248 t a a a; #X connect 2 0 15 0; #X connect 3 0 2 1; #X connect 3 0 52 1; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 9 0 5 0; #X connect 9 0 7 0; #X connect 9 0 16 0; #X connect 9 0 54 0; #X connect 9 0 59 0; #X connect 9 0 56 0; #X connect 10 0 51 0; #X connect 11 0 12 0; #X connect 13 0 3 1; #X connect 15 0 5 0; #X connect 15 1 7 0; #X connect 15 2 16 0; #X connect 16 0 17 0; #X connect 18 0 51 0; #X connect 25 0 26 0; #X connect 27 0 24 1; #X connect 31 0 32 0; #X connect 32 0 24 0; #X connect 33 0 32 0; #X connect 36 0 25 0; #X connect 39 0 36 0; #X connect 40 0 36 0; #X connect 44 0 18 0; #X connect 47 0 51 0; #X connect 48 0 51 0; #X connect 49 0 48 0; #X connect 50 0 48 0; #X connect 51 0 61 0; #X connect 52 0 58 0; #X connect 54 0 55 0; #X connect 56 0 57 0; #X connect 58 0 54 0; #X connect 58 1 56 0; #X connect 58 2 59 0; #X connect 59 0 60 0; #X connect 61 0 14 0; #X connect 61 1 2 0; #X connect 61 2 52 0; #X restore 673 264 pd multichannel; #X text 142 589 <-- DEPRECATED uses; #X connect 0 0 1 0; #X connect 1 0 23 1; #X connect 2 0 3 0; #X connect 3 0 23 2; #X connect 4 0 23 3; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 9 0 10 0; #X connect 11 0 23 4; #X connect 13 0 33 0; #X connect 14 0 34 0; #X connect 15 0 36 0; #X connect 16 0 35 0; #X connect 23 0 5 0; #X connect 23 1 7 0; #X connect 23 2 9 0; #X connect 23 3 24 0; #X connect 24 0 25 0; #X connect 26 0 23 0; #X connect 33 0 26 0; #X connect 34 0 26 0; #X connect 35 0 26 0; #X connect 36 0 26 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_neq-help.pd000066400000000000000000000025121514557770000251000ustar00rootroot00000000000000#N canvas 224 247 450 300 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 167 mtx_ones 5; #X obj 46 144 t b b; #X obj 46 218 mtx_print; #X msg 46 125 bang; #X text 100 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 339 193 ==; #X obj 17 23 mtx_neq; #X obj 81 23 mtx_!=; #X obj 392 77 !=; #X obj 46 196 mtx_neq; #X obj 125 197 mtx_!=; #X obj 263 192 mtx_neq 0; #X obj 360 192 mtx_!= 0; #X text 8 42 matrix logic: comparison; #X text 38 247 compare 2 matrices; #X text 246 251 compare a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix comparison; #X text 12 44 DESCRIPTION compare a matrix with another for not-equality; #X obj 16 147 declare -lib iemmatrix; #X restore 381 6 pd META; #X connect 2 0 17 1; #X connect 3 0 17 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 4 0; #X connect 8 0 19 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 8 0; #X connect 12 1 19 1; #X connect 17 0 5 0; #X connect 19 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_not-help.pd000066400000000000000000000015031514557770000251140ustar00rootroot00000000000000#N canvas 128 118 424 254 10; #X declare -lib iemmatrix; #X obj 355 43 matrix; #X text 225 42 see also help for; #X obj 48 131 t a a; #X obj 91 132 mtx_print org; #X obj 16 23 mtx_not; #X obj 111 23 mtx_!; #X text 8 42 matrix logic: inversion; #X obj 48 164 mtx_!; #X obj 48 100 mtx 2 2; #X msg 48 80 0 1 12 0; #X obj 48 192 mtx_print not; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix logic; #X text 12 44 DESCRIPTION element-wise inversion of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 351 16 pd META; #X connect 2 0 7 0; #X connect 2 1 3 0; #X connect 7 0 10 0; #X connect 8 0 2 0; #X connect 9 0 8 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_ones-help.pd000066400000000000000000000014571514557770000252700ustar00rootroot00000000000000#N canvas 61 0 491 290 10; #X declare -lib iemmatrix; #X obj 432 246 matrix; #X text 302 245 see also help for; #X obj 103 201 mtx_ones 5; #X obj 103 227 mtx_print; #X msg 103 130 bang; #X msg 133 174 3 5; #X msg 119 150 10; #X text 129 20 [mtx_ones]; #X text 30 89 create a matrix with all elements := 1; #X text 74 248 all matrix elements=1; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION create a matrix with all elements := 1; #X obj 16 147 declare -lib iemmatrix; #X restore 421 6 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; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_or-help.pd000066400000000000000000000024521514557770000247400ustar00rootroot00000000000000#N canvas 224 247 450 300 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 272 55 see also help for; #X obj 123 167 mtx_diag 1 2 3 4 5; #X obj 46 114 t b b; #X obj 46 218 mtx_print; #X msg 46 95 bang; #X text 100 198 ==; #X obj 263 167 mtx_eye 4; #X msg 263 140 bang; #X obj 263 219 mtx_print; #X floatatom 332 124 4 0 0 0 - - - 0; #X obj 332 142 t b f; #X text 339 193 ==; #X obj 17 23 mtx_or; #X obj 81 23 mtx_||; #X obj 392 77 ||; #X obj 46 196 mtx_or; #X obj 125 197 mtx_||; #X obj 263 192 mtx_or 0; #X obj 360 192 mtx_|| 0; #X text 8 42 matrix logic: logical OR; #X text 38 247 OR 2 matrices; #X text 246 251 OR a matrix with a scalar; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix logic; #X text 12 44 DESCRIPTION matrix logic logical OR; #X obj 16 147 declare -lib iemmatrix; #X restore 381 6 pd META; #X obj 46 137 mtx_diegg 1 2 3 4 5; #X connect 2 0 16 1; #X connect 3 0 24 0; #X connect 3 1 2 0; #X connect 5 0 3 0; #X connect 7 0 18 0; #X connect 8 0 7 0; #X connect 10 0 11 0; #X connect 11 0 7 0; #X connect 11 1 18 1; #X connect 16 0 4 0; #X connect 18 0 9 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_pack~-help.pd000066400000000000000000000100501514557770000254250ustar00rootroot00000000000000#N canvas 347 191 514 431 12; #X declare -lib iemmatrix; #X obj 107 120 mtx_pack~ 3; #X obj 106 85 sig~ 1; #X obj 169 85 sig~ 2; #X obj 230 85 sig~ 3; #X obj 139 200 mtx_size; #X floatatom 182 225 5 0 0 0 - - - 0; #X floatatom 139 226 5 0 0 0 - - - 0; #X obj 68 290 mtx_print; #X text 43 29 packing signal vectors (usually 64 samples); #X text 42 52 of multiple inputs into a matrix; #X obj 396 404 mtx_unpack~; #N canvas 460 154 494 184 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 106 AUTHOR Franz Zotter; #X text 12 65 INLET_n signal; #X text 11 43 DESCRIPTION pack signal vectors into a matrix; #X text 12 5 KEYWORDS signal matrix; #X obj 13 150 declare -lib iemmatrix; #X restore 381 6 pd META; #X msg 390 84 \; pd dsp \$1; #X obj 390 56 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X text 323 404 see also; #N canvas 391 376 717 517 multichannel 0; #X text 38 22 With Pd>=0.54 \, [mtx_pack~] has multichannel support.; #X obj 545 114 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X obj 88 333 cnv 20 50 40 empty empty empty 20 12 0 12 #dfdfdf #404040 0; #X obj 88 373 cnv 20 50 20 empty empty empty 20 12 0 12 #bbbbbb #404040 0; #X obj 88 394 cnv 20 50 60 empty empty empty 20 12 0 12 #9f9f9f #404040 0; #X text 103 333 ch#1; #X text 103 434 ch#6; #X text 103 373 ch#3; #X text 103 393 ch#4; #X obj 139 313 mtx_plot 512 120; #X obj 131 243 cnv 20 20 20 empty empty 1-2 0 12 0 12 #dfdfdf #404040 0; #X obj 170 243 cnv 20 20 20 empty empty 3 8 12 0 12 #bbbbbb #404040 0; #X obj 208 243 cnv 20 20 20 empty empty 4-6 0 12 0 12 #9f9f9f #404040 0; #X obj 139 207 snake~ in 2; #X obj 302 197 snake~ in 3; #X obj 302 97 osc~ 689.062; #X obj 377 145 noise~; #X obj 376 171 abs~; #X obj 302 140 +~ 1; #X obj 302 169 /~ 2; #X obj 139 263 mtx_pack~ 3; #X obj 140 165 sig~ 0.5; #X obj 340 122 sig~ 1; #X floatatom 473 263 5 0 0 0 channels - - 0; #X floatatom 473 285 5 0 0 0 blocksize - - 0; #X obj 473 238 route channels blocksize; #X text 41 56 the output matrix contains all channels from all input signals; #X obj 545 137 switch~ 128; #X obj 213 165 phasor~ 750; #X connect 1 0 27 0; #X connect 13 0 20 0; #X connect 14 0 20 2; #X connect 15 0 18 0; #X connect 16 0 17 0; #X connect 17 0 14 2; #X connect 18 0 19 0; #X connect 19 0 14 0; #X connect 20 0 9 0; #X connect 20 1 25 0; #X connect 21 0 13 0; #X connect 22 0 14 1; #X connect 25 0 23 0; #X connect 25 1 24 0; #X connect 28 0 13 1; #X restore 69 392 pd multichannel; #X obj 251 175 route dimen channels blocksize; #X obj 251 200 unpack; #X floatatom 251 225 5 0 0 0 - - - 0; #X floatatom 290 225 5 0 0 0 - - - 0; #X floatatom 407 203 5 0 0 0 channels: - - 0; #X floatatom 407 223 5 0 0 0 blocksize: - - 0; #X text 222 226 ==>; #X obj 107 165 t a a; #X obj 68 235 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 68 267 matrix; #X text 336 376 part of iemmatrix; #N canvas 0 0 450 376 compatibility 0; #X text 107 14 COMPAT NOTE; #X text 16 75 Older versions of iemmatrix (up to v0.4.2) output the matrices within the DSP-tick.; #X text 15 117 While this allowed for zero-latency matrix processing of signals \, it broke all kinds of assumptions that Pd makes about how messages and signals get along.; #X text 19 185 Starting with iemmatrix >= v0.4.3 \, the object will now only output data in the message phase of the next cycle.; #X text 19 240 As an additional service to our legacy users \, Pd << v0.56 will not be affected by this change.; #X text 12 296 If you rely on this behaviour \, you should change your patches. Most likely \, Pd's recent multichannel addition makes the old behaviour obsolete anyhow.; #X restore 69 352 pd compatibility note; #X connect 0 0 23 0; #X connect 0 1 16 0; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 0 2; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 13 0 12 0; #X connect 16 0 17 0; #X connect 16 1 20 0; #X connect 16 2 21 0; #X connect 17 0 18 0; #X connect 17 1 19 0; #X connect 23 0 25 1; #X connect 23 1 4 0; #X connect 24 0 25 0; #X connect 25 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_pivot-help.pd000066400000000000000000000034551514557770000254650ustar00rootroot00000000000000#N canvas -35 125 680 290 10; #X declare -lib iemmatrix; #X obj 595 63 matrix; #X text 465 62 see also help for; #X text 198 15 [mtx_pivot]; #X text 59 79 pivot-transform a matrix; #X obj 63 164 mtx_pivot; #N canvas 352 114 190 367 rand-matrix 0; #X obj 74 163 inlet; #X obj 74 270 outlet; #X obj 74 195 mtx_rand; #X obj 74 215 mtx_* 10; #X obj 74 237 mtx_int; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 1 0; #X restore 63 118 pd rand-matrix; #X msg 63 96 4 3; #X obj 112 185 mtx_print post; #X obj 87 205 mtx_print pre; #X obj 63 245 mtx_print pivot; #X text 290 184 the first outlet is the pivot-transformed matrix.; #X text 289 210 the other outlets are the 1/0-matrices that have to be pre-multiplied (row-transform) and post-multiplied (column-tranform) to the original matrix to get the pivot-tranformation. this is useful for de-pivoting.; #X obj 63 141 t a a; #X obj 103 141 mtx_print original; #X msg 175 99 matrix 4 3 1 2 3 4 5 6 7 8 9 10 11 12; #X text 194 36 pivot-transform matrices; #X text 290 131 this will transform the columns and rows \, so that the result will have "all" maximum values in the diagonal. the maximum of the matrix will be located at the upper-left corner.; #N canvas 460 154 494 218 META 0; #X text 12 135 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 155 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION pivot transform a matrix; #X text 12 95 OUTLET_1 matrix; #X text 12 105 OUTLET_2 matrix; #X obj 16 187 declare -lib iemmatrix; #X restore 591 16 pd META; #X connect 4 0 9 0; #X connect 4 1 8 0; #X connect 4 2 7 0; #X connect 5 0 12 0; #X connect 6 0 5 0; #X connect 12 0 4 0; #X connect 12 1 13 0; #X connect 14 0 12 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_pow-help.pd000066400000000000000000000024721514557770000251270ustar00rootroot00000000000000#N canvas 142 124 450 321 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 56 251 mtx_print; #X obj 56 144 t b f; #X floatatom 56 126 4 0 0 0 - - - 0; #X msg 56 167 4 2 1 3; #X obj 56 187 mtx_diag; #X obj 251 252 mtx_print; #X obj 251 155 mtx_diag 1 2 3; #X obj 282 173 mtx_ones 3; #X obj 282 192 mtx_* 2; #X obj 251 134 t b b f; #X floatatom 251 115 4 0 0 0 - - - 0; #X obj 56 215 mtx_.^ 2; #X obj 251 217 mtx_.^; #X text 34 280 matrix-elements^f; #X text 208 278 elementA(i \, j)^elementB(i \, j); #X text 8 42 matrix arithmetic: power; #X obj 392 77 pow; #X obj 17 23 mtx_.^; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION calculate the power function of each element of a matrix, f 75; #X obj 16 147 declare -lib iemmatrix; #X restore 381 6 pd META; #X connect 3 0 5 0; #X connect 3 1 13 1; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 6 0 13 0; #X connect 8 0 14 0; #X connect 9 0 10 0; #X connect 10 0 14 1; #X connect 11 0 8 0; #X connect 11 1 9 0; #X connect 11 2 10 1; #X connect 12 0 11 0; #X connect 13 0 2 0; #X connect 14 0 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_powtodb-help.pd000066400000000000000000000031401514557770000257710ustar00rootroot00000000000000#N canvas 228 145 687 471 10; #X declare -lib iemmatrix; #X obj 181 90 mtx_eye; #X obj 64 258 mtx_rand 4 2; #X msg 64 233 bang; #X obj 64 307 t a a; #X obj 105 307 mtx_print org; #X obj 64 357 t a a; #X msg 181 71 3 3; #X obj 181 110 mtx_* 100; #X obj 48 100 mtx 2 2; #X text 290 305 note: dB(pd):=dB(techn)+100; #X text 307 337 this means: 100dB(pd)==unity gain (==1); #X text 404 375 0dB(pd)==zero gain (==0); #X text 391 354 106dB(pd)~=double gain (==2); #X obj 105 357 mtx_print rms; #X obj 64 407 mtx_print db; #X msg 48 80 0 1 0.1 2; #X obj 64 277 mtx_* 100; #X obj 595 43 matrix; #X text 465 42 see also help for; #X text 188 7 convert power to dB(pd); #X text 44 34 convert a power value to dB(pd) to for each element of a matrix; #X obj 48 134 mtx_powtodb; #X obj 48 162 mtx_print powtodb; #X obj 64 330 mtx_dbtopow; #X obj 64 380 mtx_powtodb; #X obj 599 71 mtx_dbtopow; #X obj 599 91 powtodb; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION convert a power value to dB for each element of a matrix, f 73; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 631 16 pd META; #X connect 0 0 7 0; #X connect 1 0 16 0; #X connect 2 0 1 0; #X connect 3 0 23 0; #X connect 3 1 4 0; #X connect 5 0 24 0; #X connect 5 1 13 0; #X connect 6 0 0 0; #X connect 7 0 21 0; #X connect 8 0 21 0; #X connect 15 0 8 0; #X connect 16 0 3 0; #X connect 21 0 22 0; #X connect 23 0 5 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_print-help.pd000066400000000000000000000016261514557770000254560ustar00rootroot00000000000000#N canvas 128 118 552 254 10; #X declare -lib iemmatrix; #X obj 425 203 matrix; #X text 295 202 see also help for; #X text 136 10 print a matrix to the console; #X obj 425 223 print; #X msg 48 80 bang; #X obj 48 100 mtx_ones 5; #X obj 48 141 t a a a; #X obj 92 164 mtx_print; #X obj 48 228 print oops; #X obj 70 194 mtx_print label; #X text 211 116 [mtx_print] will print the matrix in a formatted way; #X text 216 143 you can give labels \, just like with [print]; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION print a matrix to the console; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 481 16 pd META; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 8 0; #X connect 6 1 9 0; #X connect 6 2 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_prod-help.pd000066400000000000000000000021451514557770000252630ustar00rootroot00000000000000#N canvas 128 118 680 254 10; #X declare -lib iemmatrix; #X obj 596 195 matrix; #X text 466 194 see also help for; #X obj 48 100 mtx 3 3; #X obj 48 131 t a a; #X obj 91 132 mtx_print; #X floatatom 262 178 5 0 0 0 - - - 0; #X obj 48 186 print sum; #X text 136 10 Product of columns of matrix; #X text 45 42 compute the column-wise product of a matrix (result is a list of products), f 75; #X obj 48 164 mtx_prod; #X obj 262 151 mtx_prod; #X text 262 107 can also be used for multiplying up lists; #X msg 48 80 0 1 -2 -3 -4 5 -6 7 -8; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION compute the column-wise product of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 611 16 pd META; #X msg 262 129 1 2 3; #X obj 596 220 mtx_sum; #X connect 2 0 3 0; #X connect 3 0 9 0; #X connect 3 1 4 0; #X connect 9 0 6 0; #X connect 10 0 5 0; #X connect 12 0 2 0; #X connect 14 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_qr-help.pd000066400000000000000000000025461514557770000247460ustar00rootroot00000000000000#N canvas 727 38 452 449 10; #X declare -lib iemmatrix; #X obj 93 166 mtx_qr; #X obj 93 108 mtx_rand; #X obj 199 131 mtx_print A; #X msg 93 55 4 3; #X obj 163 211 mtx_print R; #X obj 120 235 mtx_print Q; #X text 353 153 A = Q * R; #X text 64 24 [mtx_qr] qr decomposition using gsl; #N canvas 460 154 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION calculate QR decomposition of a matrix; #X text 12 105 AUTHOR Franz Zotter; #X obj 16 147 declare -lib iemmatrix; #X restore 371 16 pd META; #X obj 93 264 mtx_*; #X obj 93 285 mtx_-, f 8; #X obj 93 368 mtx_print residual; #X obj 93 327 mtx_int; #X obj 93 306 mtx_* 1e+06; #X obj 93 348 mtx_./ 1e+06; #X text 266 358 Franz Zotter \, 2009 \, 2023; #X msg 116 77 3 4; #X text 146 78 <-slower gsl algorithm for rows []]; #X msg 243 146 0 4; #X text 285 145 resize to 4 columns \, leave column-length unchanged; #X msg 242 199 8; #X text 274 199 resize to [8 \, 8]; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION resize a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 691 16 pd META; #X connect 5 0 7 0; #X connect 6 0 5 0; #X connect 7 0 4 0; #X connect 9 0 7 1; #X connect 10 0 7 1; #X connect 11 0 7 1; #X connect 16 0 7 1; #X connect 18 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_reverse-help.pd000066400000000000000000000026251514557770000257750ustar00rootroot00000000000000#N canvas 54 132 670 392 10; #X declare -lib iemmatrix; #X obj 595 53 matrix; #X text 465 52 see also help for; #X obj 42 139 t a a; #X obj 84 140 mtx_print org; #X obj 42 229 mtx_reverse; #X obj 42 116 mtx_rand 3 4; #X msg 42 94 bang; #X text 108 35 revert order of rows/columns/elements; #X obj 42 257 mtx_print reversed; #X msg 244 172 mode row; #X msg 244 146 mode column; #X msg 331 145 mode col; #X msg 397 145 mode :; #X obj 155 196 t a; #X text 39 77 revert a matrix; #X msg 244 196 mode element; #X msg 338 197 mode .; #X text 450 145 revert columns (default); #X text 454 175 revert rows; #X text 456 198 revert elements; #X text 82 310 You can also set the mode via the argument to the object:; #X obj 491 310 mtx_reverse row; #X text 90 15 [mtx_reverse]; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION reverse order of rows/columns/elements of a matrix, f 68; #X obj 16 147 declare -lib iemmatrix; #X restore 582 17 pd META; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 4 0 8 0; #X connect 5 0 2 0; #X connect 6 0 5 0; #X connect 9 0 13 0; #X connect 10 0 13 0; #X connect 11 0 13 0; #X connect 12 0 13 0; #X connect 13 0 4 0; #X connect 15 0 13 0; #X connect 16 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_rfft-help.pd000066400000000000000000000076201514557770000252630ustar00rootroot00000000000000#N canvas 316 110 592 515 10; #X declare -lib iemmatrix; #X obj 389 427 matrix; #X msg 11 124 bang; #X text 46 34 real fft in each matrix row; #X text 7 60 you can calculate real ffts in column direction \; matrix has to have 2^k columns \; a N/2+1 columns matrix is the result \;; #X obj 11 191 mtx_cumsum; #X msg 11 147 1 16; #X obj 11 169 mtx_ones; #X obj 11 213 mtx_- 1; #X obj 49 255 mtx_* 0; #X floatatom 90 120 5 0 0 0 - - - 0; #X text 134 118 <-- scroll here to select frequency; #X obj 117 165 / 8; #X obj 49 326 t a a; #X obj 92 326 mtx_print original; #X text 321 427 see also:; #X obj 49 280 mtx_cos; #X obj 117 255 * 3.14159; #X text 109 280 cosine wave; #X text 89 15 [mtx_rfft]; #X obj 49 350 mtx_rfft, f 19; #X obj 389 450 mtx_rifft; #X obj 90 141 t b f; #N canvas 450 271 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION real-valued FFT for each matrix row; #X obj 16 147 declare -lib iemmatrix; #X restore 381 16 pd META; #X obj 49 404 mtx_print rfft.re; #X obj 160 404 mtx_print rfft.im; #N canvas 205 83 207 172 pi 0; #X obj 38 16 loadbang; #X msg 38 39 1 1; #X obj 38 62 atan2; #X obj 38 85 * 4; #X obj 38 108 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 181 255 pd pi; #X obj 389 474 rfft~; #N canvas 0 0 545 402 ~ 0; #X obj 74 80 inlet mtx; #X obj 343 208 array define \$0.orig~; #N canvas 1067 375 450 300 mtx2table 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 115 170 array set \$0.orig~; #X obj 221 76 array size \$0.orig~; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 220 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 163 76 t f f f; #X obj 236 132 + 1; #X obj 236 109 >> 1; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 13 0; #X connect 3 0 4 0; #X connect 4 0 7 0; #X connect 4 1 5 0; #X connect 7 0 9 0; #X connect 8 0 1 0; #X connect 12 0 11 0; #X connect 12 1 10 0; #X connect 13 0 3 1; #X connect 13 1 15 0; #X connect 13 2 6 0; #X connect 14 0 12 0; #X connect 15 0 14 0; #X restore 74 139 pd mtx2table; #X obj 112 212 tabreceive~ \$0.orig~; #X obj 112 235 rfft~; #X obj 112 258 tabsend~ \$0.re~; #X obj 222 258 tabsend~ \$0.im~; #X obj 343 240 array define \$0.re~; #X obj 343 260 array define \$0.im~; #X msg 74 160 set \$1 \, bang; #X obj 74 184 switch~; #X obj 61 342 array get \$0.re~; #X obj 61 292 bang~; #X obj 61 315 t b b; #X obj 182 341 array get \$0.im~; #X obj 61 365 print rfft~re; #X obj 182 365 print rfft~im; #N canvas 735 461 450 300 DSP? 0; #X obj 83 102 inlet; #X obj 83 125 spigot; #X obj 83 148 outlet; #X obj 134 113 r pd; #X obj 134 136 route dsp; #X text 86 64 only calculate if DSP is on...; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 4 0 1 1; #X restore 74 110 pd DSP?; #X text 75 25 calculate the rFFT using Pd's built-in [rfft~] object; #X text 74 50 (this patch only works if DSP is *on*); #X connect 0 0 17 0; #X connect 2 0 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 9 0 10 0; #X connect 11 0 15 0; #X connect 12 0 13 0; #X connect 13 0 11 0; #X connect 13 1 14 0; #X connect 14 0 16 0; #X connect 17 0 2 0; #X restore 336 321 pd ~; #X obj 49 303 t a a; #X text 375 323 <- using [rfft~]; #X connect 1 0 5 0; #X connect 4 0 7 0; #X connect 5 0 6 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 8 0 15 0; #X connect 9 0 21 0; #X connect 11 0 16 0; #X connect 12 0 19 0; #X connect 12 1 13 0; #X connect 15 0 28 0; #X connect 16 0 8 1; #X connect 19 0 23 0; #X connect 19 1 24 0; #X connect 21 0 1 0; #X connect 21 1 11 0; #X connect 25 0 16 1; #X connect 28 0 12 0; #X connect 28 1 27 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_rifft-help.pd000066400000000000000000000030761514557770000254350ustar00rootroot00000000000000#N canvas 439 122 445 515 10; #X declare -lib iemmatrix; #X obj 330 441 matrix; #X msg 11 124 bang; #X obj 11 191 mtx_cumsum; #X obj 11 169 mtx_ones; #X obj 11 213 mtx_- 1; #X obj 49 255 mtx_* 0; #X floatatom 155 202 5 0 0 0 - - - 0; #X obj 187 255 / 8; #X obj 49 278 t a a; #X text 266 443 see also:; #X text 46 34 real ifft in each matrix row; #X text 7 60 you can calculate real inverse ffts in column direction \; matrix has to have 2^(k-1)+1 columns \; a 2^k columns matrix is the result \;; #X msg 11 147 1 9; #X obj 49 307 mtx_cos; #X obj 104 307 mtx_sin; #X text 199 203 <-- scroll here to select delay; #X obj 49 411 mtx_print rifft; #X obj 49 389 mtx_int; #X obj 103 255 * -3.14159; #X text 89 15 [mtx_rifft]; #X obj 330 465 mtx_rfft; #X obj 49 336 mtx_rifft; #X obj 49 362 mtx_+ 0.5; #X obj 155 223 t b f; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION real-valued inverse FFT for each matrix row; #X obj 16 147 declare -lib iemmatrix; #X restore 352 11 pd META; #X connect 1 0 12 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 6 0 23 0; #X connect 7 0 18 0; #X connect 8 0 13 0; #X connect 8 1 14 0; #X connect 12 0 3 0; #X connect 13 0 21 0; #X connect 14 0 21 1; #X connect 17 0 16 0; #X connect 18 0 5 1; #X connect 21 0 22 0; #X connect 22 0 17 0; #X connect 23 0 1 0; #X connect 23 1 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_rmstodb-help.pd000066400000000000000000000031541514557770000257720ustar00rootroot00000000000000#N canvas 337 118 649 477 10; #X declare -lib iemmatrix; #X text 188 7 convert rms to dB(pd); #X obj 181 90 mtx_eye; #X obj 64 258 mtx_rand 4 2; #X msg 64 233 bang; #X obj 64 307 t a a; #X obj 105 307 mtx_print org; #X obj 64 357 t a a; #X msg 181 71 3 3; #X obj 181 110 mtx_* 100; #X obj 48 162 mtx_print dbtorms; #X obj 48 100 mtx 2 2; #X text 290 305 note: dB(pd):=dB(techn)+100; #X text 307 337 this means: 100dB(pd)==unity gain (==1); #X text 404 375 0dB(pd)==zero gain (==0); #X text 391 354 106dB(pd)~=double gain (==2); #X text 44 34 convert a linear value to dB(pd) to for each element of a matrix; #X obj 48 134 mtx_rmstodb; #X obj 64 330 mtx_dbtorms; #X obj 64 380 mtx_rmstodb; #X obj 105 357 mtx_print rms; #X obj 64 407 mtx_print db; #X msg 48 80 0 1 0.1 2; #X obj 64 277 mtx_* 100; #X obj 535 113 matrix; #X text 405 112 see also help for; #X obj 539 141 mtx_dbtorms; #X obj 539 161 rmstodb; #N canvas 493 302 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 13 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION convert a linear value into dB for each element of a matrix, f 75; #X obj 16 147 declare -lib iemmatrix; #X restore 547 16 pd META; #X connect 1 0 8 0; #X connect 2 0 22 0; #X connect 3 0 2 0; #X connect 4 0 17 0; #X connect 4 1 5 0; #X connect 6 0 18 0; #X connect 6 1 19 0; #X connect 7 0 1 0; #X connect 8 0 16 0; #X connect 10 0 16 0; #X connect 16 0 9 0; #X connect 17 0 6 0; #X connect 18 0 20 0; #X connect 21 0 10 0; #X connect 22 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_roll-help.pd000066400000000000000000000020051514557770000252620ustar00rootroot00000000000000#N canvas 79 113 670 283 10; #X declare -lib iemmatrix; #X obj 585 83 matrix; #X text 455 82 see also help for; #X text 194 36 transpose matrices; #X text 198 15 [mtx_roll]; #X obj 194 162 t a a; #X obj 236 163 mtx_print org; #X obj 194 220 mtx_print rolled; #X msg 194 120 1 2 3 4 5; #X obj 194 142 mtx_diag; #X text 190 103 shift columns of a matrix; #X floatatom 289 196 4 0 5 1 shift - - 0; #X text 374 182 (0=no-shift \; 1=1-column-right \; -2=2-columns-left \; ...); #X obj 194 192 mtx_roll 1; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION shift columns of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 591 6 pd META; #X obj 585 104 mtx_scroll; #X connect 4 0 12 0; #X connect 4 1 5 0; #X connect 7 0 8 0; #X connect 8 0 4 0; #X connect 10 0 12 1; #X connect 12 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_row-help.pd000066400000000000000000000020031514557770000251170ustar00rootroot00000000000000#N canvas 136 41 544 373 10; #X declare -lib iemmatrix; #X obj 413 74 matrix; #X text 283 73 see also help for; #X obj 413 116 mtx_col; #X obj 89 32 mtx_row; #X text 19 9 set rows of a matrix; #X obj 53 259 mtx_print; #X obj 64 217 mtx_ones 5 3; #X msg 64 198 bang; #X obj 53 240 mtx_row 4 3; #X msg 182 195 0; #X text 213 195 set all rows; #X msg 174 173 2; #X text 214 170 set row [2]; #X msg 53 146 -1 2 3 4 5; #X text 133 242 creation: mtx_row [ []]; #X text 55 129 set matrix rows; #X obj 413 96 mtx_element; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION set rows of a matrix; #X text 11 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 451 28 pd META; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 8 0 5 0; #X connect 9 0 8 1; #X connect 11 0 8 1; #X connect 13 0 8 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_scroll-help.pd000066400000000000000000000017671514557770000256260ustar00rootroot00000000000000#N canvas 83 78 622 283 10; #X declare -lib iemmatrix; #X obj 545 63 matrix; #X text 415 62 see also help for; #X text 194 36 transpose matrices; #X text 198 15 [mtx_scroll]; #X obj 194 162 t a a; #X obj 236 163 mtx_print org; #X obj 194 220 mtx_print scrolled; #X obj 194 192 mtx_scroll 1; #X msg 194 116 1 2 3 4 5; #X text 190 99 shift rows of a matrix; #X floatatom 301 191 4 0 6 1 shift - - 0; #X obj 194 138 mtx_diag; #X text 380 179 (0=no-shift \; 1=1-row-down \; -2=2-rows-up \; ...); #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION shift rows of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 541 16 pd META; #X obj 545 86 mtx_roll; #X connect 4 0 7 0; #X connect 4 1 5 0; #X connect 7 0 6 0; #X connect 8 0 11 0; #X connect 10 0 7 1; #X connect 11 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_sin-help.pd000066400000000000000000000015701514557770000251110ustar00rootroot00000000000000#N canvas 128 118 680 254 10; #X declare -lib iemmatrix; #X obj 595 83 matrix; #X text 465 82 see also help for; #X obj 48 131 t a a; #X obj 91 132 mtx_print org; #X obj 48 100 mtx 2 2; #X msg 48 80 0 3.14159 1 90; #X text 136 11 sine of matrix elements; #X text 45 42 compute the sine of each element of a matrix; #X obj 48 192 mtx_print sin; #X obj 48 164 mtx_sin; #X obj 595 103 sin; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 11 44 DESCRIPTION calculate sine of each element of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 601 16 pd META; #X connect 2 0 9 0; #X connect 2 1 3 0; #X connect 4 0 2 0; #X connect 5 0 4 0; #X connect 9 0 8 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_size-help.pd000066400000000000000000000016071514557770000252730ustar00rootroot00000000000000#N canvas 161 60 453 283 10; #X declare -lib iemmatrix; #X obj 245 239 matrix; #X text 115 238 see also help for; #X floatatom 151 178 4 0 0 0 - - - 0; #X text 148 68 get the size of a matrix; #X obj 151 140 mtx_size; #X msg 185 91 3 2; #X msg 151 91 7; #X obj 151 115 mtx_ones; #X floatatom 194 178 4 0 0 0 - - - 0; #X text 192 194 columns; #X text 152 195 rows; #X obj 150 22 mtx_size; #X text 223 24 get the size of a matrix; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION get size of a matrix; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 401 16 pd META; #X connect 4 0 2 0; #X connect 4 1 8 0; #X connect 5 0 7 0; #X connect 6 0 7 0; #X connect 7 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_slice-help.pd000066400000000000000000000021361514557770000254160ustar00rootroot00000000000000#N canvas 333 84 525 429 10; #X declare -lib iemmatrix; #X obj 301 357 matrix; #X text 89 15 [mtx_slice]; #X text 47 34 slicing parts out of a matrix; #X text 33 60 you can use this to partition matrices; #X obj 46 264 mtx_slice; #X obj 46 127 mtx_ones; #X obj 46 147 mtx_cumsum :; #X obj 46 167 t a a; #X msg 46 107 3 4; #X obj 94 192 mtx_print left; #X obj 46 290 mtx_print slice; #X text 228 241 [list idx1_row idx1_col idx2_row idx2_col(; #X msg 104 241 list 2 2 end end; #X msg 83 222 list 2 2 3 4; #X text 203 263 the keyword 'end' is allowed; #X obj 301 381 mtx_fill; #N canvas 447 371 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION slice parts out of a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 461 6 pd META; #X connect 4 0 10 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 9 0; #X connect 8 0 5 0; #X connect 12 0 4 1; #X connect 13 0 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_sndfileread-help.pd000066400000000000000000000032341514557770000265770ustar00rootroot00000000000000#N canvas 0 169 604 484 10; #X declare -lib iemmatrix; #X msg 276 196 open \$1; #X obj 276 88 openpanel; #X obj 276 66 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 113 112 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 302 261 print DONE; #X obj 200 347 mtx_print; #X msg 114 165 20; #X obj 243 289 mtx_size; #X floatatom 244 311 0 0 0 0 - - - 0; #X floatatom 299 311 0 0 0 0 - - - 0; #X msg 113 186 100; #X msg 112 204 100000; #X msg 115 146 4; #X msg 287 153 symbol x.wav; #X msg 303 172 symbol x.mat; #X floatatom 153 148 5 0 0 0 - - - 0; #X msg 335 196 close; #X text 309 64 open audiofile (multichannel); #X text 75 90 read number of samples; #X text 137 111 read 1; #X text 391 370 Franz Zotter 2008; #X text 356 389 [iemmatrix]; #X text 79 24 reading multichannel data from soundfile; #X obj 200 239 mtx_sndfileread; #N canvas 460 154 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 105 AUTHOR Franz Zotter; #X text 12 44 DESCRIPTION read multichannel data from a soundfile into a matrix, f 70; #X text 12 5 KEYWORDS control matrix; #X obj 13 150 declare -lib iemmatrix; #X restore 531 16 pd META; #X obj 200 262 t a a; #X connect 0 0 23 0; #X connect 1 0 0 0; #X connect 2 0 1 0; #X connect 3 0 23 0; #X connect 6 0 23 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 10 0 23 0; #X connect 11 0 23 0; #X connect 12 0 23 0; #X connect 13 0 0 0; #X connect 14 0 0 0; #X connect 15 0 23 0; #X connect 16 0 23 0; #X connect 23 0 25 0; #X connect 23 1 4 0; #X connect 25 0 5 0; #X connect 25 1 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_spherical_harmonics-help.pd000066400000000000000000000050001514557770000303250ustar00rootroot00000000000000#N canvas 409 263 921 503 10; #X declare -lib iemmatrix; #X obj 223 97 mtx_rand; #X msg 226 75 2 10; #X obj 28 218 mtx_print; #X text 150 226 for -n<=m<=n:; #X text 641 241 for m>=0; #X text 640 257 for m< 0; #X text 146 277 The order of the harmonics in the output columns is specified by the linear index k=n^2+n+m+1.; #X text 305 160 for an L points 2xL input matrix \, [mtx_spherical_harmonics] evaluates the (nmax+2)^2 spherical harmonics at L points and delivers an Lx(nmax+2)^2 output matrix.; #X text 309 118 [mtx_spherical_harmonics] requires a numerical creation argument specifyiing the maximum order 0<=n<=nmax.; #N canvas 429 253 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 105 AUTHOR Franz Zotter; #X text 12 44 DESCRIPTION calculate spherical harmonics of a matrix; #X text 12 6 KEYWORDS control matrix math; #X obj 13 150 declare -lib iemmatrix; #X restore 711 56 pd META; #X text 536 410 Franz Zotter \, 2009 \, 2023; #X obj 76 318 mtx_spherical_harmonics 1; #X text 102 27 [mtx_spherical_harmonics] spherical harmonics evaluated at a set of points given in azimuth and zenith coordinates.; #X text 188 258 Y_n^m(phi \, theta) = N_n^m * sin(|m|*azi) * P_n^m(cos(zen)); #X text 188 242 Y_n^m(phi \, theta) = N_n^m * cos(|m|*azi) * P_n^m(cos(zen)); #X text 231 332 N_n^m=; #X text 278 332 (-1)^m sqrt((2n+1)(n-|m|)!(2-delta_m))/sqrt(4pi(n+|m|)!); #X text 618 317 (because of sin(m*azi) instead of sin(|m|*azi)); #X text 235 306 Default/LEGACY \; N3D \, but with azi=-azi reversed \, before 2023; #X obj 52 334 mtx_spherical_harmonics 1 N3D; #X obj 34 350 mtx_spherical_harmonics 1 N3D4PI; #X obj 46 366 mtx_spherical_harmonics 1 SN3D; #X text 231 349 N_n^m=; #X text 231 365 N_n^m=; #X text 278 365 (-1)^m sqrt( (n-|m|)!(2-delta_m))/sqrt( (n+|m|)!); #X text 278 349 (-1)^m sqrt((2n+1)(n-|m|)!(2-delta_m))/sqrt( (n+|m|)!); #X text 74 388 Typical 3D Ambisonic encoding choice is SN3D as ambiX does; #X text 75 400 Typical mathematical integral orthonormalization choice: N3D; #X msg 29 9 1; #X obj 29 30 atan; #X msg 29 71 matrix 2 3 0 \$1 0 \$1 \$1 0; #X obj 28 156 mtx_* 1e+06; #X obj 28 177 mtx_int; #X obj 28 198 mtx_./ 1e+06; #X obj 29 51 * 2; #X obj 28 135 mtx_spherical_harmonics 1 SN3D; #X connect 0 0 35 0; #X connect 1 0 0 0; #X connect 28 0 29 0; #X connect 29 0 34 0; #X connect 30 0 35 0; #X connect 31 0 32 0; #X connect 32 0 33 0; #X connect 33 0 2 0; #X connect 34 0 30 0; #X connect 35 0 31 0; mtx_spherical_harmonics_rotator-help.pd000066400000000000000000000067741514557770000320430ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help#N canvas 32 75 1166 633 12; #X declare -lib iemmatrix; #X obj 317 398 mtx_plot 400 200; #X obj 317 251 mtx_meshgrid; #X obj 413 226 mtx_linspace; #X obj 317 227 mtx_linspace; #X obj 315 128 loadbang; #X obj 412 274 mtx_:; #X obj 317 274 mtx_:; #X obj 318 298 mtx_concat col; #X obj 318 322 mtx_./ 57.3; #X obj 555 298 mtx_size; #X obj 555 322 pack; #X obj 76 510 mtx; #X msg 555 347 size \$1 \$2; #X obj 76 539 mtx_abs; #X obj 36 409 mtx_*; #X obj 318 370 mtx_transpose; #X obj 36 479 list split 3; #X obj 36 153 mtx_transpose; #X obj 36 349 mtx; #X obj 107 265 mtx_size; #X obj 107 287 pack; #X msg 107 309 size 1 \$2; #X obj 36 251 mtx_sum; #X obj 36 225 t a a; #X obj 36 306 list; #X obj 36 443 mtx_./ 1; #X floatatom 672 136 5 0 0 0 - - - 0; #X obj 672 160 / 57.2958; #X obj 672 185 pack f f f; #X floatatom 776 160 5 0 0 0 - - - 0; #X obj 776 184 / 57.2958; #X obj 776 209 t b f; #X floatatom 884 186 5 0 0 0 - - - 0; #X obj 884 210 / 57.2958; #X obj 884 235 t b f; #X obj 36 379 mtx_*; #X msg 36 129 matrix 3 2 0 90 90 90 0 0; #X obj 36 177 mtx_./ 57.2958; #X obj 317 178 t b b; #X obj 315 153 t b b; #X msg 317 203 -180 180 60; #X msg 413 202 0 180 30; #X text 774 139 beta (Rotation around y-Axis); #X obj 672 306 t b a; #X obj 36 201 mtx_spherical_harmonics 7 N3D4PI; #X obj 318 346 mtx_spherical_harmonics 7 N3D4PI; #X obj 672 264 mtx_spherical_harmonics_rotator 7; #X obj 219 268 mtx_eye 64; #X text 671 112 alpha (First rotation around z-Axis); #X text 882 163 gamma (Second rotation around z-Axis); #X text 533 160 conversion deg->rad; #X text 34 25 Computes Wigner-D matrix to rotate spherical harmonics. The function receives a list containing the alpha \, beta \, and gamma parameters (in rad) for a ZYZ rotation around the Euler angles., f 129; #X text 34 104 Initialize Cartesian Base (X \, Y \, Z); #X text 312 105 Zylindrical grid for plotting; #X text 866 79 Rotation parameters; #X text 763 330 Initial rotation sequence: R_0 = R_z(alpha)R_y(beta)R_z(gamma); #N canvas 429 253 494 171 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 6 KEYWORDS control matrix math; #X obj 13 150 declare -lib iemmatrix; #X text 12 44 DESCRIPTION compute rotation matrix for spherical harmonics; #X text 12 105 AUTHOR Thomas Röck; #X restore 1051 16 pd META; #X connect 1 0 6 0; #X connect 1 1 5 0; #X connect 1 1 9 0; #X connect 2 0 1 1; #X connect 3 0 1 0; #X connect 4 0 39 0; #X connect 5 0 7 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 45 0; #X connect 9 0 10 0; #X connect 9 1 10 1; #X connect 10 0 12 0; #X connect 11 0 13 0; #X connect 12 0 11 0; #X connect 13 0 0 0; #X connect 14 0 25 0; #X connect 15 0 14 1; #X connect 16 1 11 0; #X connect 17 0 37 0; #X connect 18 0 35 0; #X connect 19 0 20 0; #X connect 19 1 20 1; #X connect 19 1 25 1; #X connect 20 0 21 0; #X connect 21 0 18 0; #X connect 22 0 24 0; #X connect 23 0 22 0; #X connect 23 1 19 0; #X connect 24 0 18 0; #X connect 25 0 16 0; #X connect 26 0 27 0; #X connect 27 0 28 0; #X connect 28 0 46 0; #X connect 29 0 30 0; #X connect 30 0 31 0; #X connect 31 0 28 0; #X connect 31 1 28 1; #X connect 32 0 33 0; #X connect 33 0 34 0; #X connect 34 0 28 0; #X connect 34 1 28 2; #X connect 35 0 14 0; #X connect 36 0 17 0; #X connect 37 0 44 0; #X connect 38 0 40 0; #X connect 38 1 41 0; #X connect 39 0 36 0; #X connect 39 1 38 0; #X connect 39 1 47 0; #X connect 40 0 3 0; #X connect 41 0 2 0; #X connect 43 0 36 0; #X connect 43 1 35 1; #X connect 44 0 23 0; #X connect 45 0 15 0; #X connect 46 0 43 0; #X connect 47 0 35 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_spherical_radial-help.pd000066400000000000000000000064471514557770000276160ustar00rootroot00000000000000#N canvas 180 25 525 851 10; #X declare -lib iemmatrix; #N canvas 0 0 450 300 (subpatch) 0; #X array j0 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 219 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y0 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 218 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array j1 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 379 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y1 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 378 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array j2 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 549 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y2 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 548 graph; #N canvas 0 0 450 300 plot 0; #X obj 60 19 inlet; #X obj 44 198 mtx; #X obj 58 42 t a a; #X obj 39 70 mtx_size; #X obj 39 112 until; #X obj 39 92 t f b; #X obj 68 131 + 1; #X obj 39 131 i; #X msg 82 93 1; #X obj 43 152 t f f; #X obj 152 243 outlet; #X obj 44 222 list prepend 0; #X obj 45 243 outlet; #X obj 152 219 - 1; #X msg 44 175 col \$1; #X connect 0 0 2 0; #X connect 1 0 11 0; #X connect 2 0 3 0; #X connect 2 1 1 1; #X connect 3 1 5 0; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 5 1 8 0; #X connect 6 0 7 1; #X connect 7 0 6 0; #X connect 7 0 9 0; #X connect 8 0 7 1; #X connect 9 0 14 0; #X connect 9 1 13 0; #X connect 11 0 12 0; #X connect 13 0 10 0; #X connect 14 0 1 0; #X restore 124 112 pd plot; #X obj 124 160 s; #X msg 162 135 symbol j\$1; #N canvas 0 0 450 300 plot 0; #X obj 60 19 inlet; #X obj 44 198 mtx; #X obj 58 42 t a a; #X obj 39 70 mtx_size; #X obj 39 112 until; #X obj 39 92 t f b; #X obj 68 131 + 1; #X obj 39 131 i; #X msg 82 93 1; #X obj 43 152 t f f; #X obj 152 243 outlet; #X obj 44 222 list prepend 0; #X obj 45 243 outlet; #X obj 152 219 - 1; #X msg 44 175 col \$1; #X connect 0 0 2 0; #X connect 1 0 11 0; #X connect 2 0 3 0; #X connect 2 1 1 1; #X connect 3 1 5 0; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 5 1 8 0; #X connect 6 0 7 1; #X connect 7 0 6 0; #X connect 7 0 9 0; #X connect 8 0 7 1; #X connect 9 0 14 0; #X connect 9 1 13 0; #X connect 11 0 12 0; #X connect 13 0 10 0; #X connect 14 0 1 0; #X restore 245 114 pd plot; #X obj 245 162 s; #X msg 283 137 symbol y\$1; #N canvas 0 0 450 300 (subpatch) 0; #X array j3 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 69 709 graph; #N canvas 0 0 450 300 (subpatch) 0; #X array y3 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 273 708 graph; #X obj 127 20 hsl 128 15 1 300 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X msg 124 42 0.1 \$1 100; #X obj 125 87 mtx_spherical_radial h 3; #X obj 125 63 mtx_linspace; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION calculate spherical radials of a matrix of coordinates, f 67; #X obj 13 150 declare -lib iemmatrix; #X restore 421 16 pd META; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 8 0 7 1; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 11 0 10 1; #X connect 14 0 15 0; #X connect 15 0 17 0; #X connect 16 0 6 0; #X connect 16 1 9 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_sqrt-help.pd000066400000000000000000000024641514557770000253140ustar00rootroot00000000000000#N canvas 142 124 480 329 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 357 271 mtx_print; #X msg 357 157 4 2 1 3; #X obj 357 177 mtx_diag; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X obj 16 147 declare -lib iemmatrix; #X text 12 44 DESCRIPTION calculate the square root of each element of a matrix, f 75; #X restore 381 6 pd META; #X obj 17 23 mtx_sqrt; #X text 8 42 matrix arithmetic: square root; #X obj 392 100 sqrt; #X obj 392 77 mtx_.^; #X obj 357 238 mtx_sqrt; #X obj 357 200 mtx_.^ 2; #X msg 40 150 1 2 4 8; #X obj 40 173 matrix 2 2; #X obj 40 216 mtx_sqrt; #X obj 40 259 mtx_print sqrt; #X text 34 280 sqrt(matrix-elements); #X msg 210 180 1 2 4 8; #X obj 210 203 matrix 2 2; #X obj 210 249 mtx_print sqrt; #X obj 210 226 mtx_.^ 0.5; #X text 173 161 much the same as; #X text 418 202 square; #X text 420 239 root; #X connect 3 0 4 0; #X connect 4 0 11 0; #X connect 9 0 8 0; #X connect 10 0 2 0; #X connect 11 0 10 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 17 0 18 0; #X connect 18 0 20 0; #X connect 20 0 19 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_sub-help.pd000066400000000000000000000024661514557770000251160ustar00rootroot00000000000000#N canvas 363 101 481 299 10; #X declare -lib iemmatrix; #X obj 392 56 matrix; #X text 262 55 see also help for; #X obj 46 176 mtx_sub; #X obj 125 177 mtx_-; #X obj 123 147 mtx_diag 1 2 3 4 5; #X obj 46 147 mtx_ones 5; #X obj 46 124 t b b; #X obj 46 198 mtx_print; #X msg 46 105 bang; #X text 100 178 ==; #X obj 263 147 mtx_eye 4; #X obj 263 172 mtx_sub 10; #X msg 263 120 bang; #X obj 263 199 mtx_print; #X floatatom 332 104 4 0 0 0 - - - 0; #X obj 332 122 t b f; #X obj 360 172 mtx_- 10; #X text 339 173 ==; #X text 38 227 sub 2 matrices; #X obj 17 23 mtx_sub; #X obj 81 23 mtx_-; #X text 8 42 matrix arithmetic: subtraction; #X obj 393 77 -; #X text 232 231 subtract an offset from a matrix; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION matrix arithmetic subtraction; #X obj 16 147 declare -lib iemmatrix; #X restore 381 6 pd META; #X connect 2 0 7 0; #X connect 4 0 2 1; #X connect 5 0 2 0; #X connect 6 0 5 0; #X connect 6 1 4 0; #X connect 8 0 6 0; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 10 0; #X connect 14 0 15 0; #X connect 15 0 10 0; #X connect 15 1 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_sum-help.pd000066400000000000000000000020671514557770000251260ustar00rootroot00000000000000#N canvas 128 118 680 254 10; #X declare -lib iemmatrix; #X obj 596 165 matrix; #X text 466 164 see also help for; #X obj 48 100 mtx 3 3; #X obj 48 131 t a a; #X msg 48 80 0 1 -2 -3 -4 5 -6 7 8; #X obj 48 164 mtx_sum; #X obj 91 132 mtx_print; #X text 136 10 sum columns of matrix; #X text 45 42 compute the column-wise sum of a matrix (result is a list of sums); #X obj 262 151 mtx_sum; #X msg 262 129 1 1 2; #X floatatom 262 178 5 0 0 0 - - - 0; #X obj 48 186 print sum; #X text 262 107 can also be used for summing up lists; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 11 44 DESCRIPTION column-wise sum of a matrix; #X text 12 85 OUTLET_0 list; #X text 11 4 KEYWORDS control matrix math; #X obj 16 147 declare -lib iemmatrix; #X restore 601 16 pd META; #X obj 596 187 mtx_prod; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 3 1 6 0; #X connect 4 0 2 0; #X connect 5 0 12 0; #X connect 9 0 11 0; #X connect 10 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_svd-help.pd000066400000000000000000000030271514557770000251130ustar00rootroot00000000000000#N canvas 348 184 717 423 12; #X declare -lib iemmatrix; #X obj 93 216 mtx_svd; #X obj 93 108 mtx_rand; #X obj 309 275 mtx_transpose; #X obj 201 273 mtx_diag; #X obj 93 131 t a a; #X text 64 24 [mtx_svd] singular value decomposition using gsl; #X text 353 153 A = U * S * V^T; #X obj 93 298 mtx_print U; #X obj 201 299 mtx_print S; #X obj 309 298 mtx_print V^T; #X obj 169 155 mtx_print A; #X msg 93 46 4 3; #N canvas 460 154 494 201 META 0; #X text 12 85 OUTLET_0 matrix; #X text 12 145 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION singular value decomposition of a matrix; #X text 11 5 KEYWORDS control matrix math; #X text 12 125 AUTHOR Franz Zotter; #X text 12 95 OUTLET_1 list; #X text 12 105 OUTLET_2 matrix; #X obj 13 170 declare -lib iemmatrix; #X restore 501 16 pd META; #X obj 544 212 mtx_*; #X obj 512 236 mtx_*; #X obj 512 259 mtx_-; #X obj 513 345 mtx_print residual; #X obj 513 302 mtx_int; #X obj 513 281 mtx_* 1e+06; #X obj 513 323 mtx_./ 1e+06; #X text 242 334 Franz Zotter \, 2009 \, 2023; #X msg 152 77 3 4; #X text 189 78 <-not supported; #X connect 0 0 7 0; #X connect 0 0 14 0; #X connect 0 1 3 0; #X connect 0 2 2 0; #X connect 1 0 4 0; #X connect 2 0 9 0; #X connect 2 0 13 1; #X connect 3 0 8 0; #X connect 3 0 13 0; #X connect 4 0 0 0; #X connect 4 1 10 0; #X connect 4 1 15 1; #X connect 11 0 1 0; #X connect 13 0 14 1; #X connect 14 0 15 0; #X connect 15 0 18 0; #X connect 17 0 19 0; #X connect 18 0 17 0; #X connect 19 0 16 0; #X connect 21 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_tan-help.pd000066400000000000000000000023671514557770000251070ustar00rootroot00000000000000#N canvas 262 127 659 257 10; #X declare -lib iemmatrix; #X obj 595 73 matrix; #X text 465 72 see also help for; #X obj 48 100 mtx 3 3; #X obj 48 181 t a a; #X obj 91 182 mtx_print org; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 5 KEYWORDS control matrix; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 message; #X obj 16 147 declare -lib iemmatrix; #X text 12 45 DESCRIPTION calculate tangent (tan) of matrix elements; #X restore 591 16 pd META; #X obj 595 93 tan; #X text 136 10 tangent value of matrix elements; #X msg 48 80 0 45 90 135 180 225 270 315 360; #X obj 48 204 mtx_tan; #N canvas 735 461 450 300 PI 0; #X obj 85 23 loadbang; #X msg 85 46 1; #X obj 85 69 atan; #X obj 85 92 * 4; #X obj 85 115 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 129 126 pd PI; #X obj 48 126 mtx_./ 180; #X obj 48 151 mtx_.* 3.14159; #X obj 48 228 mtx_print tan; #X text 45 42 compute the tangent of each element of a matrix; #X connect 2 0 11 0; #X connect 3 0 9 0; #X connect 3 1 4 0; #X connect 8 0 2 0; #X connect 9 0 13 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_trace-help.pd000066400000000000000000000015171514557770000254170ustar00rootroot00000000000000#N canvas 108 140 615 247 10; #X declare -lib iemmatrix; #X text 83 25 get the trace of a matrix; #X obj 84 106 mtx_ones 7; #X msg 84 83 bang; #X obj 84 147 mtx_trace; #X floatatom 84 189 4 0 0 0 - - - 0; #X text 86 68 get trace of a matrix; #X text 81 204 trace = sum(diagonal elements); #X obj 497 90 matrix; #X text 367 89 see also help for; #X obj 498 114 mtx_diag; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix math; #X text 12 44 DESCRIPTION get the trace of a matrix (sum of diagonal elements), f 66; #X obj 16 147 declare -lib iemmatrix; #X restore 551 16 pd META; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_transpose-help.pd000066400000000000000000000015131514557770000263330ustar00rootroot00000000000000#N canvas 168 0 438 283 10; #X declare -lib iemmatrix; #X obj 64 162 mtx_transpose; #X msg 64 87 3 5; #X text 61 70 transpose a matrix; #X obj 189 257 matrix; #X text 59 256 see also help for; #X text 194 36 transpose matrices; #X text 198 15 [mtx_transpose]; #X obj 64 109 mtx_eye; #X obj 64 132 t a a; #X obj 106 133 mtx_print org; #X obj 64 190 mtx_print transposed; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS control matrix; #X text 12 44 DESCRIPTION transpose a matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 373 12 pd META; #X connect 0 0 10 0; #X connect 1 0 7 0; #X connect 7 0 8 0; #X connect 8 0 0 0; #X connect 8 1 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_unpack~-help.pd000066400000000000000000000126331514557770000260010ustar00rootroot00000000000000#N canvas 423 17 468 485 12; #X declare -lib iemmatrix; #X obj 122 138 mtx_print; #X text 43 29 packing signal vectors (usually 64 samples); #X text 42 52 of multiple inputs into a matrix; #X obj 77 162 mtx_unpack~ 3; #X obj 47 115 mtx_rand; #X obj 47 138 t b a a; #X obj 292 87 block~ 8; #X msg 47 93 3 8; #X obj 5 162 t b b b; #X obj 192 220 print~ C; #X obj 133 244 print~ B; #X obj 77 267 print~ A; #X obj 19 96 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 126 115 mtx_ones; #X msg 126 93 3 8; #N canvas 460 154 494 183 META 0; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 106 AUTHOR Franz Zotter; #X text 11 43 DESCRIPTION unpack a matrix into signal vectors; #X text 12 85 OUTLET_n signal; #X text 12 65 INLET_0 matrix; #X text 12 5 KEYWORDS signal matrix; #X obj 13 150 declare -lib iemmatrix; #X restore 381 6 pd META; #X obj 310 179 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X msg 310 204 \; pd dsp \$1; #N canvas 607 308 574 445 multichannel 0; #X text 98 22 With Pd>=0.54 \, [mtx_unpack~] has multichannel support \, if requested explicitly with the '-m' flag.; #X obj 182 120 mtx_print; #X obj 103 95 mtx_rand; #X msg 103 73 3 8; #X obj 242 250 print~ C; #X obj 183 274 print~ B; #X obj 127 297 print~ A; #X obj 126 160 mtx_unpack~ -m 3; #X obj 127 192 snake~ out 4; #X obj 252 220 print~ D; #X obj 103 234 t b b b b; #X obj 432 63 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X obj 103 120 t b a a; #X msg 432 88 \; pd dsp \$1; #X text 256 160 <-- multi-channel \, 3 channels default; #N canvas 332 112 1090 795 "dynamically" 0; #X text 23 68 the number of output channels is determined by the number of rows in the incoming matrix \, and can be changed dynamically by restarting the DSP.; #X text 24 116 the (optional) channel argument specifies the number of channels even if no matrix has been sent yet.; #X text 26 158 due to the way Pd works \, it is not possible to change the number of signals while DSP is running. If you send a matrix with a different number of rows \, the channels will change as soon as you restart the DSP (which can happen for a number of reasons \, like saving a patch or connecting a signal object); #X obj 243 415 mtx_rand; #X msg 280 390 3 8; #X obj 329 527 mtx_unpack~ -m 3; #X obj 75 527 mtx_unpack~ 3; #X text 62 496 single-channel; #X text 285 473 multi-channel; #X obj 330 559 snake~ out 4; #X msg 325 390 4 8; #X msg 243 390 2 8; #X obj 204 464 t a a; #X obj 75 613 env~; #X floatatom 75 638 5 0 0 0 - - - 0; #X obj 118 613 env~; #X floatatom 118 638 5 0 0 0 - - - 0; #X obj 162 613 env~; #X floatatom 162 638 5 0 0 0 - - - 0; #X obj 329 613 env~; #X floatatom 329 638 5 0 0 0 - - - 0; #X obj 369 613 env~; #X floatatom 369 638 5 0 0 0 - - - 0; #X obj 409 613 env~; #X floatatom 409 638 5 0 0 0 - - - 0; #X obj 449 613 env~; #X floatatom 449 638 5 0 0 0 - - - 0; #X obj 204 439 matrix; #X obj 204 415 bang~; #X msg 727 107 \; pd dsp 0 \; pd dsp 1; #X msg 867 60 3; #X msg 309 438 \$1 8; #X text 588 61 #1 initialize the number of channels to; #X text 587 105 #2 restart the DSP; #X msg 867 210 2; #X text 588 211 #3 set the number of channels to: 2; #X msg 727 307 \; pd dsp 0 \; pd dsp 1; #X text 587 305 #4 restart the DSP; #X msg 727 547 \; pd dsp 0 \; pd dsp 1; #X text 587 545 #6 restart the DSP; #X text 588 431 #5 set the number of channels to: 4; #X msg 867 430 4; #X text 617 450 notice that the single-channel variant has payload on all three channels (discarding the 4th) \, whereas the multi-channel variant is still in 2-channel mode, f 35; #X text 615 159 both variants have payload on the first 3 channels, f 35; #X text 617 230 notice that both variants output 2 channels of actual data (the rest is muted), f 35; #X text 615 359 (it looks the same \, but the multi-channel variant is now really in 2-channel mode), f 35; #X text 617 607 the multi-channel variant is now in 4-channel mode., f 34; #X obj 867 85 s \$0.channels; #X obj 867 235 s \$0.channels; #X obj 867 455 s \$0.channels; #X obj 309 415 r \$0.channels; #X connect 3 0 27 1; #X connect 4 0 3 0; #X connect 5 0 9 0; #X connect 6 0 13 0; #X connect 6 1 15 0; #X connect 6 2 17 0; #X connect 9 0 19 0; #X connect 9 1 21 0; #X connect 9 2 23 0; #X connect 9 3 25 0; #X connect 10 0 3 0; #X connect 11 0 3 0; #X connect 12 0 6 0; #X connect 12 1 5 0; #X connect 13 0 14 0; #X connect 15 0 16 0; #X connect 17 0 18 0; #X connect 19 0 20 0; #X connect 21 0 22 0; #X connect 23 0 24 0; #X connect 25 0 26 0; #X connect 27 0 12 0; #X connect 28 0 27 0; #X connect 30 0 47 0; #X connect 31 0 3 0; #X connect 34 0 48 0; #X connect 41 0 49 0; #X connect 50 0 31 0; #X restore 98 355 pd "dynamically" changing the number of channels; #X connect 2 0 12 0; #X connect 3 0 2 0; #X connect 7 0 8 0; #X connect 8 0 6 0; #X connect 8 1 5 0; #X connect 8 2 4 0; #X connect 8 3 9 0; #X connect 10 0 6 0; #X connect 10 1 5 0; #X connect 10 2 4 0; #X connect 10 3 9 0; #X connect 11 0 13 0; #X connect 12 0 10 0; #X connect 12 1 7 0; #X connect 12 2 1 0; #X restore 69 352 pd multichannel; #X text 238 398 part of iemmatrix; #X obj 308 428 mtx_pack~; #X text 232 427 see also:; #X connect 3 0 11 0; #X connect 3 1 10 0; #X connect 3 2 9 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 5 1 3 0; #X connect 5 2 0 0; #X connect 7 0 4 0; #X connect 8 0 11 0; #X connect 8 1 10 0; #X connect 8 2 9 0; #X connect 12 0 4 0; #X connect 13 0 5 0; #X connect 14 0 13 0; #X connect 16 0 17 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/mtx_zeros-help.pd000066400000000000000000000015101514557770000254540ustar00rootroot00000000000000#N canvas 61 0 361 290 10; #X declare -lib iemmatrix; #X obj 164 245 matrix; #X text 34 244 see also help for; #X obj 103 161 mtx_zeros 5; #X obj 103 187 mtx_print; #X msg 103 90 bang; #X msg 133 134 3 5; #X msg 119 110 10; #X text 129 20 [mtx_zeros]; #X text 30 49 create a matrix with all elements := 0; #X text 74 208 all matrix elements=0; #N canvas 460 154 494 171 META 0; #X text 12 105 AUTHOR IOhannes m zmoelnig; #X text 12 85 OUTLET_0 matrix; #X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig; #X text 12 25 LICENSE GPL-2+; #X text 12 65 INLET_0 matrix; #X text 12 44 DESCRIPTION create a matrix with all elements := 0; #X text 12 5 KEYWORDS control matrix; #X obj 16 147 declare -lib iemmatrix; #X restore 287 9 pd META; #X obj 164 268 mtx_ones; #X connect 2 0 3 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/help/test.mtx000066400000000000000000000004561514557770000236700ustar00rootroot00000000000000#matrix 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/iemmatrix-meta.pd.in000066400000000000000000000005071514557770000251010ustar00rootroot00000000000000#N canvas 10 10 200 200 10; #N canvas 20 20 420 300 META 0; #X text 10 10 META this is a prototype of a libdir meta file; #X text 10 30 NAME @PACKAGE_NAME@; #X text 10 50 AUTHOR IOhannes m zmoelnig \, Thomas Musil \, Franz Zotter; #X text 10 70 LICENSE GPL-2; #X text 10 90 VERSION @PACKAGE_VERSION@; #X restore 10 10 pd META; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/pd-lib-builder/000077500000000000000000000000001514557770000240155ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/pd-lib-builder/CHANGELOG.txt000066400000000000000000000074011514557770000260470ustar00rootroot00000000000000Changelog for Makefile.pdlibbuilder. v0.7.0, dated 2023-07-06 - build double-precision externals with the 'floatsize' variable - allow building multiple flavours of an external side-by-side (#78) - facilitate multiple platform co-installation of shared lib (#58) - fix use of shared.ldflags with helper-library (#64) - fix broken armv6l platform detection (#71) - improve documentation v0.6.0, dated 2019-12-21 - detect target platform (OS and architecture) rather than build platform (#55) - introduce optional user variable 'PLATFORM' for cross compilation - no longer build OSX/MacOS fat binaries by default (#21, #50) - do build fat binaries when 'extension=d_fat' is specified for OSX/MacOS - fix bug where minimum OSX/MacOS version wasn't defined, and set it to 10.6 v0.5.1, dated 2018-03-15 Fixes and improvements for Windows builds: - properly evaluate variables 'PDDIR' and 'PDBINDIR' to find pd.dll - define default path of 32 bit Pd on 64 bit Windows - link C++ externals with standard C libs on Windows, they don't load otherwise - strip installed Windows binaries by default (issues #34, #39, #41, #42 respectively) Warning for all platforms: variable 'PD_PATH' is no longer supported, use the equivalent 'PDDIR'. v0.5.0, dated 2018-01-23 Implement target architecture detection for Windows builds, and set appropriate options for 32 and 64 bit (used to be for 32 bit only). (feature, issue #37 #38, merge commit 215bf3e) v0.4.4, dated 2016-11-22 Use variable 'system' when evaluating 'for{Linux,Darwin,Windows}' (bugfix, issue #31, commit 2c14110) v0.4.3, dated 2016-11-02 Replace flags '-fpic' by 'fPIC'. (bugfix, issue #29, commit 426b38b) v0.4.2, dated 2016-10-30 Fix issue where incorrect message about m_pd.h is given. (bugfix, commit 2e13d8f) v0.4.1, dated 2016-10-27 Respect cflag for minimum OSX version when defined by lib makefile. (bugfix, pull request #22, commit 48c4127) v0.4.0, dated 2016-10-14 Introduced path variables PDDIR, PDINCLUDEDIR, PDBINDIR, PDLIBDIR which can also be defined in environment. (feature, issue #27, commit b0dab72) v0.3.1, dated 2016-10-13 Fix bug where pd.dll wouldn't be found. (bugfix, commit a0c87be) v0.3.0, dated 2016-10-09 Variable 'PD_PATH' introduced for pd-extended / pd-l2ork compatibility. (feature, issue #26, commit 41e9743) v0.2.8, dated 2016-10-09 Allow installed files to contain weird characters (notably '$'). (bugfix, pull request #20, commit 5b920b1) v0.2.7, dated 2016-10-04 Remove all default pd search paths except vanilla's. (discussion, issue #25, commit a6a89dc) v0.2.6, dated 2016-09-20 Redefined dependency checking so it won't stall rebuilds on OSX. (bugfix, issue #16, commit 9fd1795) v0.2.5, dated 2016-06-26 Fixed dependency checking for object files in other directories. (bugfix, commit f06e550) v0.2.4, dated 2016-06-25 Fixed regression bug that disabled all dependency checking. (bugfix, commit 1d7bb5e) v0.2.3, dated 2016-03-29 Disabled dependency checking for OSX <= 10.5 because it stalled rebuilds. (bugfix, issue #16, commit eb614fd) v0.2.2, dated 2016-03-28 Removed target 'pre' because it forced rebuild of everything in 'all'. (bugfix, issue #17, commit c989c8e) v0.2.1, dated 2015-12-27 Implement / respect 'CPPFLAGS','CFLAGS'and 'LDFLAGS'. (bugfix, issue #5, commit 98f3582) v0.2.0, dated 2015-12-19 Added per-platform multiline defines 'forLinux', 'forDarwin', 'forWindows'. (feature, pull request #9, commit 3946ea5) v0.1.0, dated 2015-12-08 Added targets 'pre' and 'post' to automatically run before and after 'all'. (feature, pull request #4, commit a5678ac) v0.0.2, dated 2015-12-06 Improved methods for searching pd paths. (bugfix, commit ed37e6b) v0.0.1, dated 2015-10-31 Fixed expansion of variable 'lib.version'. (bugfix, issue #1, commit 974b617) v0.0.0, dated 2015-06-24 Initial version. (commit 16517a2) iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/pd-lib-builder/Makefile.pdlibbuilder000066400000000000000000001314521514557770000301230ustar00rootroot00000000000000# Makefile.pdlibbuilder dated 2019-12-21 version = 0.7.0 # Helper makefile for Pure Data external libraries. # Written by Katja Vetter March-June 2015 for the public domain. No warranties. # Inspired by Hans Christoph Steiner's Makefile Template and Stephan Beal's # ShakeNMake. # # Grab the newest version of Makefile.pdlibbuilder from # https://github.com/pure-data/pd-lib-builder/ # # GNU make version >= 3.81 required. # # #=== characteristics =========================================================== # # # - defines build settings based on autodetected OS and architecture # - defines rules to build Pd class- or lib executables from C or C++ sources # - defines rules for libdir installation # - defines convenience targets for developer and user # - evaluates implicit dependencies for non-clean builds # # #=== basic usage =============================================================== # # # In your Makefile, define your Pd lib name and class files, and include # Makefile.pdlibbuilder at the end of the Makefile. Like so: # # ________________________________________________________________________ # # # Makefile for mylib # # lib.name = mylib # # class.sources = myclass1.c myclass2.c # # datafiles = myclass1-help.pd myclass2-help.pd README.txt LICENSE.txt # # include Makefile.pdlibbuilder # ________________________________________________________________________ # # # For files in class.sources it is assumed that class basename == source file # basename. The default target builds all classes as individual executables # with Pd's default extension for the platform. For anything more than the # most basic usage, continue reading. # # #=== list of Makefile.pdlibbuilder API variables =============================== # # # Variables available for definition in your library Makefile: # # - lib.name # - lib.setup.sources # - class.sources # - common.sources # - shared.sources # - .class.sources # - .class.ldflags # - .class.ldlibs # - cflags # - ldflags # - ldlibs # - datafiles # - datadirs # - makefiles # - makefiledirs # - externalsdir # # Optional multiline defines evaluated per operating system: # # - forLinux # - forDarwin # - forWindows # # Variables available for your makefile or make command line: # # - make-lib-executable # - suppress-wunused # # Path variables for make command line or environment: # # - PDDIR # - PDINCLUDEDIR # - PDBINDIR # - PDLIBDIR # # Standard make variables for make command line or environment: # # - CPPFLAGS # - CFLAGS # - LDFLAGS # - CC # - CXX # - INSTALL # - STRIP # - DESTDIR # # Optional user variables for make command line or environment: # # - PLATFORM # - extension # - floatsize # # Deprecated path variables: # # - pdincludepath # - pdbinpath # - objectsdir # # #=== descriptions of Makefile.pdlibbuilder API variables ======================= # # # lib.name: # Name of the library directory as it will be installed / distributed. Also the # name of the lib executable in the case where all classes are linked into # a single binary. # # lib.setup.sources: # Source file(s) (C or C++) which must be compiled only when linking all classes # into a single lib binary. # # class.sources: # All sources files (C or C++) for which the condition holds that # class name == source file basename. # # .class.sources: # Source file(s) (C or C++) specific to class . Use this for # multiple-source classes or when class name != source file basename. # # common.sources: # Source file(s) which must be statically linked to each class in the library. # # shared.sources: # Source file(s) (C or C++) to build a shared dynamic link lib, to be linked # with all class executables. # # cflags, ldflags, ldlibs: # Define cflags (preprocessor&compiler), ldflags (linker) and ldlibs (dynamic # link libs) for the whole library. These flags are added to platform-specific # flags defined by Makefile.pdlibbuilder. # # .class.ldflags and .class.ldlibs: # Define ldflags resp. ldlibs specific to class . These flags are # added to platform-specific flags defined by Makefile.pdlibbuilder, and flags # defined in your Makefile for the whole library. Note: cflags can not be # defined per class in the current implementation. # # datafiles and datadirs: # All extra files you want to include in binary distributions of the # library: abstractions and help patches, example patches, meta patch, readme # and license texts, manuals, sound files, etcetera. Use 'datafiles' for all # files that should go into your lib rootdir and 'datadirs' for complete # directories you want to copy from source to distribution. # # forLinux, forDarwin, forWindows: # Shorthand for 'variable definitions for Linux only' etc. Use like: # define forLinux # cflags += -DLINUX # class.sources += linuxthing.c # endef # # makefiles and makefiledirs: # Extra makefiles or directories with makefiles that should be made in sub-make # processes. # # make-lib-executable: # When this variable is defined 'yes' in your makefile or as command argument, # Makefile.pdlibbuilder will try to build all classes into a single library # executable (but it will force exit if lib.setup.sources is undefined). # If your makefile defines 'make-lib-executable=yes' as the library default, # this can still be overridden with 'make-lib-executable=no' as command argument # to build individual class executables (the Makefile.pdlibbuilder default.) # # suppress-wunused: # When this variable is defined ('yes' or any other value), -Wunused-variable, # -Wunused-parameter, -Wunused-value and -Wunused-function are suppressed, # but the other warnings from -Wall are retained. # # PDDIR: # Root directory of 'portable' pd package. When defined, PDINCLUDEDIR and # PDBINDIR will be evaluated as $(PDDIR)/src and $(PDDIR)/bin. # # PDINCLUDEDIR: # Directory where Pd API m_pd.h should be found, and other Pd header files. # Overrides the default search path. # # PDBINDIR: # Directory where pd.dll should be found for linking (Windows only). Overrides # the default search path. # # PDLIBDIR: # Root directory for installation of Pd library directories. Overrides the # default install location. # # DESTDIR: # Prepended path component for staged install. # # PLATFORM: # Target platform for cross compilation in the form of GNU triplet: # cpu-vendor-os. Example: x86_64-w64-mingw32. This specifies the tool chain that # pdlibbuilder will use, if installed and locatable. System and architecture # will then be autodefined accordingly. In most cases no other variables need to # be overridden. # # extension: # Extension for the external to use. Example: m_amd64 # A sane default is picked, but it is useful if you want to provide # co-installable externals for multiple platforms (for the same operating # systems) # # floatsize: # the size of the t_float in bits. Example: 32 # t_float are usually single precision (32bit), which is the default. # For double precision use floatsize=64 # When building double precision externals, you will want to set the extension # as well, e.g. extension=windows-amd64-64.dll (--.) # # CPPFLAGS: # Preprocessor flags which are not strictly required for building. # # CFLAGS: # Compiler flags which are not strictly required for building. Compiler flags # defined by Makefile.pdlibbuilder for warning, optimization and architecture # specification are overriden by CFLAGS. # # LDFLAGS: # Linker flags which are not strictly required for building. Linker flags # defined by Makefile.pdlibbuilder for architecture specification are overriden # by LDFLAGS. # # CC and CXX: # C and C++ compiler programs as defined in your build environment. # # INSTALL # Definition of install program. # # STRIP # Name of strip program. Default 'strip' can be overridden in cross compilation # environments. # # objectsdir: # Root directory for installation of Pd library directories, like PDLIBDIR but # not overridable by environment. Supported for compatibility with pd-extended # central makefile, but deprecated otherwise. # # pdincludepath, pdbinpath: # As PDINCLUDEDIR and PDBINDIR but not overridable by environment. Deprecated # as user variables. # # #=== paths ===================================================================== # # # Source files in directories other than current working directory must be # prefixed with their relative path. Do not rely on VPATH or vpath. # Object (.o) files are built in the directory of their source files. # Executables are built in current working directory. # # Default search path for m_pd.h and other API header files is platform # dependent, and overridable by PDINCLUDEDIR: # # Linux: /usr/include/pd # # OSX: /Applications/Pd*.app/Contents/Resources/src # # Windows: %PROGRAMFILES%/Pd/src # %PROGRAMFILES(X86)%/Pd/src (32 bit builds on 64 bit Windows) # # Default search path for binary pd.dll (Windows), overridable by PDBINDIR # # %PROGRAMFILES%/Pd/bin # %PROGRAMFILES(X86)%/Pd/bin (32 bit builds on 64 bit Windows) # # Default location to install pd libraries is platform dependent, and # overridable by PDLIBDIR: # # Linux: /usr/local/lib/pd-externals # OSX: ~/Library/Pd # Windows: %APPDATA%/Pd # # https://puredata.info/docs/faq/how-do-i-install-externals-and-help-files # The rationale for not installing to ~/pd-externals by default on Linux # is that some people share the home dir between 32 and 64 bit installations. # # #=== targets =================================================================== # # # all: build $(executables) plus optional post target # post: target to build after $(executables) # alldebug: build all with -g option turned on for debug symbols # : force clean build of an individual class # .pre: make preprocessor output file in current working directory # .lst: make asm/source output file in current working directory # # install: install executables and data files # clean: remove build products from source tree # # help: print help text # vars: print makefile variables # allvars: print all variables # depend: print generated prerequisites # dumpmachine: print compiler output of option '-dumpmachine' # coffee: dummy target # # Variable $(executables) expands to class executables plus optional shared lib, # or alternatively to single lib executable when make-lib-executable=true. # Targets pre and post can be defined by library makefile. Make sure to include # Makefile.pdlibbuilder first so default target all will not be redefined. # # #=== Pd-extended libdir concept ================================================ # # # For libdir layout as conceived by Hans-Christoph Steiner, see: # # https://puredata.info/docs/developer/Libdir # # Files README.txt, LICENSE.txt and -meta.pd are part of the libdir # convention. Help patches for each class and abstraction are supposed to be # available. Makefile.pdlibbuilder does not force the presence of these files # however. It does not automatically include such files in libdir installations. # Data files you want to include in distributions must be defined explicitly in # your Makefile. # # #=== Makefile.pdlibbuilder syntax conventions ================================== # # # Makefile.pdlibbuilder variable names are lower case. Default make variables, # environment variables, and standard user variables (CC, CXX, CFLAGS, DESTDIR) # are upper case. Use target 'allvars' to print all variables and their values. # # 'Fields' in data variables are separated by dots, like in 'foo.class.sources'. # Words in variables expressing a function or command are separated by dashes, # like in 'make-lib-executable'. # # #=== useful make options ======================================================= # # # Use 'make -d ' to print debug details of the make process. # Use 'make -p ' to print make's database. # # #=== TODO ====================================================================== # # # - decide whether to use -static-libgcc or shared dll in MinGW # - cygwin support # - android support # - figure out how to handle '$' in filenames # - add makefile template targets dpkg-source dist libdir distclean tags? # # #=== end of documentation sections ============================================= # # ################################################################################ ################################################################################ ################################################################################ # GNU make version 3.81 (2006) or higher is required because of the following: # - function 'info' # - variable '.DEFAULT_GOAL' # force exit when make version is < 3.81 ifneq ($(firstword $(sort 3.81 $(MAKE_VERSION))), 3.81) $(error GNU make version 3.81 or higher is required) endif # Relative path to externals root dir in multi-lib source tree like # pd-extended SVN. Default is parent of current working directory. May be # defined differently in including makefile. externalsdir ?= .. # variable you can use to check if Makefile.pdlibbuilder is already included Makefile.pdlibbuilder = true ################################################################################ ### target platform detection ################################################## ################################################################################ #=== target platform =========================================================== # PLATFORM: optional user variable to define target platform for cross # compilation. Redefine build tools accordingly. PLATFORM should match # the exact target prefix of tools present in $PATH, like x86_64-w64-mingw32, # x86_64-apple-darwin12 etc. Tool definitions are exported to ensure submakes # will get the same. ifneq ($(PLATFORM),) ifneq ($(findstring darwin, $(PLATFORM)),) export CC = $(PLATFORM)-cc export CXX = $(PLATFORM)-c++ export CPP = $(PLATFORM)-cc else export CC = $(PLATFORM)-gcc export CXX = $(PLATFORM)-g++ export CPP = $(PLATFORM)-cpp endif STRIP = $(PLATFORM)-strip endif # Let (native or cross-) compiler report target triplet and isolate individual # words therein to facilitate later processing. target.triplet := $(subst -, ,$(shell $(CC) -dumpmachine)) #=== operating system ========================================================== # The following systems are defined: Linux, Darwin, Windows. GNU and # GNU/kFreeBSD are treated as Linux to get the same options. ifneq ($(filter linux gnu% kfreebsd, $(target.triplet)),) system = Linux endif ifneq ($(filter darwin%, $(target.triplet)),) system = Darwin endif ifneq ($(filter mingw% cygwin%, $(target.triplet)),) system = Windows endif # evaluate possible system-specific multiline defines from library makefile $(eval $(for$(system))) # TODO: Cygwin, Android #=== architecture ============================================================== # The following CPU names can be processed by pdlibbuilder: # i*86 Intel 32 bit # x86_64 Intel 64 bit # arm ARM 32 bit # aarch64 ARM 64 bit target.arch := $(firstword $(target.triplet)) ################################################################################ ### variables per platform ##################################################### ################################################################################ #=== flags per floatsize == ==================================================== floatsize = 32 ifneq ($(filter-out 32,$(floatsize)),) floatsize.flags = -DPD_FLOATSIZE=$(floatsize) else floatsize.flags = endif #=== flags per architecture ==================================================== # Set architecture-dependent cflags, mainly for Linux. For Mac and Windows, # arch.c.flags are overriden below. To see gcc's default architecture flags: # $ gcc -Q --help=target # ARMv6: Raspberry Pi 1st gen, not detectable from target.arch ifeq ($(shell uname -m), armv6l) arch.c.flags = -march=armv6 -mfpu=vfp -mfloat-abi=hard # ARMv7: Beagle, Udoo, RPi2 etc. else ifeq ($(target.arch), arm) arch.c.flags = -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard # ARMv8 64 bit, not tested yet else ifeq ($(target.arch), aarch64) arch.c.flags = -mcpu=cortex-a53 # Intel 32 bit, build with SSE and SSE2 instructions else ifneq ($(filter i%86, $(target.arch)),) arch.c.flags = -march=pentium4 -mfpmath=sse -msse -msse2 # Intel/AMD 64 bit, build with SSE, SSE2 and SSE3 instructions else ifeq ($(target.arch), x86_64) arch.c.flags = -march=core2 -mfpmath=sse -msse -msse2 -msse3 # if none of the above architectures detected else arch.c.flags = endif #=== flags and paths for Linux ================================================= ifeq ($(system), Linux) prefix = /usr/local libdir := $(prefix)/lib pkglibdir = $(libdir)/pd-externals pdincludepath := $(wildcard /usr/include/pd) extension = pd_linux cpp.flags := -DUNIX c.flags := -fPIC c.ldflags := -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags c.ldlibs := -lc -lm cxx.flags := -fPIC -fcheck-new cxx.ldflags := -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags cxx.ldlibs := -lc -lm -lstdc++ shared.extension = so shared.ldflags = -rdynamic -fPIC -shared -Wl,-soname,$(shared.lib) endif #=== flags and paths for Darwin ================================================ # LLVM-clang doesn't support -fcheck-new, therefore this flag is only used when # compiling with g++. ifeq ($(system), Darwin) pkglibdir = $(HOME)/Library/Pd pdincludepath := $(firstword $(wildcard \ /Applications/Pd*.app/Contents/Resources/src)) extension = pd_darwin cpp.flags := -DUNIX -DMACOSX -I /sw/include c.flags := c.ldflags := -undefined suppress -flat_namespace -bundle c.ldlibs := -lc cxx.ldflags := -undefined suppress -flat_namespace -bundle cxx.ldlibs := -lc shared.extension = dylib shared.ldflags = -dynamiclib -undefined dynamic_lookup \ -install_name @loader_path/$(shared.lib) \ -compatibility_version 1 -current_version 1.0 ifneq ($(filter %g++, $(CXX)),) cxx.flags := -fcheck-new endif ifeq ($(extension), d_fat) arch := i386 x86_64 else arch := $(target.arch) endif ifneq ($(filter -mmacosx-version-min=%, $(cflags)),) version.flag := $(filter -mmacosx-version-min=%, $(cflags)) else version.flag = -mmacosx-version-min=10.6 endif arch.c.flags := $(addprefix -arch , $(arch)) $(version.flag) arch.ld.flags := $(arch.c.flags) endif #=== flags and paths for Windows =============================================== # Standard paths on Windows contain spaces, and GNU make functions treat such # paths as lists, with unintended effects. Therefore we must use shell function # ls instead of make's wildcard when probing for a path, and use double quotes # when specifying a path in a command argument. # Default paths in Mingw / Mingw-w64 environments. 'PROGRAMFILES' is standard # location for builds with native architecture, 'ProgramFiles(x86)' for i686 # builds on x86_64 Windows (detection method by Lucas Cordiviola). Curly braces # required because of parentheses in variable name. ifeq ($(system), Windows) pkglibdir := $(APPDATA)/Pd ifeq ($(target.arch), i686) programfiles := ${ProgramFiles(x86)} else programfiles := $(PROGRAMFILES) endif pdbinpath := $(programfiles)/Pd/bin pdincludepath := $(programfiles)/Pd/src endif # Store default path to pd.dll in PDBINDIR if the latter is not user-defined. # For include path this is done in the platform-independent paths section below, # but for PDBINDIR it is done here so ld flags can be evaluated as immediate # variables. ifeq ($(system), Windows) ifdef PDDIR PDBINDIR := $(PDDIR)/bin endif PDBINDIR ?= $(pdbinpath) endif # TODO: decide whether -mms-bitfields should be specified. ifeq ($(system), Windows) cpp.flags := -DMSW -DNT ifeq ($(target.arch), i686) arch.c.flags := -march=pentium4 -msse -msse2 -mfpmath=sse else ifeq ($(target.arch), x86_64) cpp.flags := -DMSW -DNT -DPD_LONGINTTYPE=__int64 arch.c.flags := -march=core2 -msse -msse2 -msse3 -mfpmath=sse else arch.c.flags = endif extension = dll c.flags := c.ldflags := -static-libgcc -shared \ -Wl,--enable-auto-import "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll" c.ldlibs := cxx.flags := -fcheck-new cxx.ldflags := -static-libgcc -static-libstdc++ -shared \ -Wl,--enable-auto-import "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll" cxx.ldlibs := shared.extension = dll shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll" stripflags = --strip-all endif #=== paths ===================================================================== # Platform-dependent default paths are specified above, but overridable. # Path variables in upper case can be defined as make command argument or in the # environment. Variable 'objectsdir' is supported for compatibility with # the build system that pd-l2ork has inherited from pd-extended. PDINCLUDEDIR ?= $(pdincludepath) PDLIBDIR ?= $(firstword $(objectsdir) $(pkglibdir)) ifdef PDDIR PDINCLUDEDIR := $(wildcard $(PDDIR)/src) endif # base path where all components of the lib will be installed by default installpath := $(DESTDIR)$(PDLIBDIR)/$(lib.name) # check if include path contains spaces (as is often the case on Windows) # if so, store the path so we can later do checks with it pdincludepathwithspaces := $(if $(word 2, $(PDINCLUDEDIR)), $(PDINCLUDEDIR)) #=== accumulated build flags =================================================== # From GNU make docs: 'Users expect to be able to specify CFLAGS freely # themselves.' So we use CFLAGS to define options which are not strictly # required for compilation: optimizations, architecture specifications, and # warnings. CFLAGS can be safely overriden using a make command argument. # Variables cflags, ldflags and ldlibs may be defined in including makefile. optimization.flags = -O3 -ffast-math -funroll-loops -fomit-frame-pointer warn.flags = -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing # suppress -Wunused-variable & Co if you don't want to clutter a build log ifdef suppress-wunused warn.flags += $(addprefix -Wno-unused-, function parameter value variable) endif CFLAGS = $(warn.flags) $(optimization.flags) $(arch.c.flags) # preprocessor flags cpp.flags := -DPD -I "$(PDINCLUDEDIR)" $(floatsize.flags) $(cpp.flags) $(CPPFLAGS) # flags for dependency checking (cflags from makefile may define -I options) depcheck.flags := $(cpp.flags) $(cflags) # architecture specifications for linker are overridable by LDFLAGS LDFLAGS := $(arch.ld.flags) # now add the same ld flags to shared dynamic lib shared.ldflags += $(LDFLAGS) # accumulated flags for C compiler / linker c.flags := $(cpp.flags) $(c.flags) $(cflags) $(CFLAGS) c.ldflags := $(c.ldflags) $(ldflags) $(LDFLAGS) c.ldlibs := $(c.ldlibs) $(ldlibs) # accumulated flags for C++ compiler / linker cxx.flags := $(cpp.flags) $(cxx.flags) $(cflags) $(CFLAGS) cxx.ldflags := $(cxx.ldflags) $(ldflags) $(LDFLAGS) cxx.ldlibs := $(cxx.ldlibs) $(ldlibs) ################################################################################ ### variables: library name and version ######################################## ################################################################################ # strip possibles spaces from lib.name, they mess up calculated file names lib.name := $(strip $(lib.name)) # if meta file exists, check library version metafile := $(wildcard $(lib.name)-meta.pd) ifdef metafile lib.version := $(shell sed -n \ 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' \ $(metafile)) endif ################################################################################ ### variables: files ########################################################### ################################################################################ object.extension = $(extension).o #=== sources =================================================================== # (re)define .class.sources using file names in class.sources define add-class-source $(notdir $(basename $v)).class.sources += $v endef $(foreach v, $(class.sources), $(eval $(add-class-source))) # derive class names from .class.sources variables sourcevariables := $(filter %.class.sources, $(.VARIABLES)) classes := $(basename $(basename $(sourcevariables))) # accumulate all source files specified in makefile classes.sources := $(sort $(foreach v, $(sourcevariables), $($v))) all.sources := $(classes.sources) $(lib.setup.sources) \ $(shared.sources) $(common.sources) #=== object files ============================================================== # construct object filenames from all C and C++ source file names classes.objects := $(addsuffix .$(object.extension), $(basename $(classes.sources))) common.objects := $(addsuffix .$(object.extension), $(basename $(common.sources))) shared.objects := $(addsuffix .$(object.extension), $(basename $(shared.sources))) lib.setup.objects := $(addsuffix .$(object.extension), $(basename $(lib.setup.sources))) all.objects = $(classes.objects) $(common.objects) $(shared.objects) \ $(lib.setup.objects) #=== executables =============================================================== # construct class executable names from class names classes.executables := $(addsuffix .$(extension), $(classes)) # Construct shared lib executable name if shared sources are defined. # If extension does not end with shared extension, use both to facilitate co- # installation for different platforms, like .m_i386.dll and .linux-amd64-32.so ifdef shared.sources ifneq ($(filter %.$(shared.extension), .$(extension)), ) # $(extension) already ends with $(shared.extension), no need to duplicate it shared.lib = lib$(lib.name).$(extension) else shared.lib = lib$(lib.name).$(extension).$(shared.extension) endif else shared.lib := endif ################################################################################ ### variables: tools ########################################################### ################################################################################ # aliases so we can later define 'compile-$1' and set 'c' or 'cxx' as argument compile-c := $(CC) compile-cxx := $(CXX) ################################################################################ ### checks ##################################################################### ################################################################################ # At this point most variables are defined. Now do some checks and info's # before rules begin. # print Makefile.pdlibbuilder version before possible termination $(info ++++ info: using Makefile.pdlibbuilder version $(version)) # Terminate if target triplet remained empty, to avoid all sorts of confusing # scenarios and spurious bugs. ifeq ($(target.triplet),) $(error Command "$(CC) -dumpmachine" did not return a target triplet, \ needed for a build. \ Is compiler "$(CC)" installed in your PATH? ($(PATH)). \ Does compiler "$(CC)" support option "-dumpmachine"?) endif # 'forward declaration' of default target, needed to do checks all: # To avoid unpredictable results, make sure the default target is not redefined # by including makefile. ifneq ($(.DEFAULT_GOAL), all) $(error Default target must be 'all'.) endif # find out which target(s) will be made ifdef MAKECMDGOALS goals := $(MAKECMDGOALS) else goals := all endif # store path to Pd API m_pd.h if it is found ifdef PDINCLUDEDIR mpdh := $(shell ls "$(PDINCLUDEDIR)/m_pd.h") endif # store path to pd.dll; if not found, ls will give a useful error ifeq ($(system), Windows) pddll := $(shell ls "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll") endif # when making target all, check if m_pd.h is found and print info about it ifeq ($(goals), all) $(if $(mpdh), \ $(info ++++ info: using Pd API $(mpdh)), \ $(warning Where is Pd API m_pd.h? Do 'make help' for info.)) endif # print target info $(info ++++ info: making target $(goals) $(if $(lib.name),in lib $(lib.name))) # when installing, print installpath info $(if $(filter install install-lib, $(goals)), $(info ++++ info: \ installpath is '$(installpath)')) #=== define executables ======================================================== # By default we build class executables, and optionally a shared dynamic link # lib. When make-lib-executable=yes we build all classes into a single lib # executable, on the condition that variable lib.setup.sources is defined. ifeq ($(make-lib-executable),yes) $(if $(lib.setup.sources), ,\ $(error Can not build library blob because lib.setup.sources is undefined)) executables := $(lib.name).$(extension) else executables := $(classes.executables) $(shared.lib) endif ################################################################################ ### rules: special targets ##################################################### ################################################################################ # Disable built-in rules. If some target can't be built with the specified # rules, it should not be built at all. MAKEFLAGS += --no-builtin-rules .PRECIOUS: .SUFFIXES: .PHONY: all post build-lib \ $(classes) $(makefiledirs) $(makefiles) \ install install-executables install-datafiles install-datadirs \ force clean vars allvars depend help ################################################################################ ### rules: build targets ####################################################### ################################################################################ # Target all forces the build of targets [$(executables) post] in # deterministic order. Target $(executables) builds class executables plus # optional shared lib or alternatively a single lib executable when # make-lib-executable=true. Target post is optionally defined by # library makefile. all: post post: $(executables) all: $(info ++++info: target all in lib $(lib.name) completed) # build all with -g option turned on for debug symbols alldebug: c.flags += -g alldebug: cxx.flags += -g alldebug: all #=== class executable ========================================================== # recipe for linking objects in class executable # argument $1 = compiler type (c or cxx) # argument $2 = class basename define link-class $(compile-$1) \ $($1.ldflags) $($2.class.ldflags) \ -o $2.$(extension) \ $(addsuffix .$(object.extension), $(basename $($2.class.sources))) \ $(addsuffix .$(object.extension), $(basename $(common.sources))) \ $($1.ldlibs) $($2.class.ldlibs) $(shared.lib) endef # general rule for linking object files in class executable %.$(extension): $(shared.lib) $(info ++++ info: linking objects in $@ for lib $(lib.name)) $(if $(filter %.cc %.cpp, $($*.class.sources)), \ $(call link-class,cxx,$*), \ $(call link-class,c,$*)) #=== library blob ============================================================== # build all classes into single executable build-lib: $(lib.name).$(extension) $(info ++++ info: library blob $(lib.name).$(extension) completed) # recipe for linking objects in lib executable # argument $1 = compiler type (c or cxx) define link-lib $(compile-$1) \ $($1.ldflags) $(lib.ldflags) \ -o $(lib.name).$(extension) $(all.objects) \ $($1.ldlibs) $(lib.ldlibs) endef # rule for linking objects in lib executable # declared conditionally to avoid name clashes ifeq ($(make-lib-executable),yes) $(lib.name).$(extension): $(all.objects) $(if $(filter %.cc %.cpp, $(all.sources)), \ $(call link-lib,cxx), \ $(call link-lib,c)) endif #=== shared dynamic lib ======================================================== # recipe for linking objects in shared executable # argument $1 = compiler type (c or cxx) define link-shared $(compile-$1) \ $(shared.ldflags) \ -o $(shared.lib) $(shared.objects) \ $($1.ldlibs) $(shared.ldlibs) endef # rule for linking objects in shared executable # build recipe is in macro 'link-shared' $(shared.lib): $(shared.objects) $(info ++++ info: linking objects in shared lib $@) $(if $(filter %.cc %.cpp, $(shared.sources)), \ $(call link-shared,cxx), \ $(call link-shared,c)) #=== object files ============================================================== # recipe to make .o file from source # argument $1 is compiler type (c or cxx) define make-object-file $(info ++++ info: making $@ in lib $(lib.name)) $(compile-$1) \ $($1.flags) \ -o $@ -c $< endef # Three rules to create .o files. These are double colon 'terminal' rules, # meaning they are the last in a rules chain. %.$(object.extension):: %.c $(call make-object-file,c) %.$(object.extension):: %.cc $(call make-object-file,cxx) %.$(object.extension):: %.cpp $(call make-object-file,cxx) #=== explicit prerequisites for class executables ============================== # For class executables, prerequisite rules are declared in run time. Target # 'depend' prints these rules for debugging purposes. # declare explicit prerequisites rule like 'class: class.extension' # argument $v is class basename define declare-class-target $v: $v.$(extension) endef # declare explicit prerequisites rule like 'class.extension: object1.o object2.o' # argument $v is class basename define declare-class-executable-target $v.$(extension): $(addsuffix .$(object.extension), $(basename $($v.class.sources))) \ $(addsuffix .$(object.extension), $(basename $(common.sources))) endef # evaluate explicit prerequisite rules for all classes $(foreach v, $(classes), $(eval $(declare-class-target))) $(foreach v, $(classes), $(eval $(declare-class-executable-target))) #=== implicit prerequisites for class executables ============================== # Evaluating implicit prerequisites (header files) with help from the # preprocessor is 'expensive' so this is done conditionally and selectively. # Note that it is also possible to trigger a build via install targets, in # which case implicit prerequisites are not checked. # When the Pd include path contains spaces it will mess up the implicit # prerequisites rules. disable-dependency-tracking := $(strip $(pdincludepathwithspaces)) ifndef disable-dependency-tracking must-build-everything := $(filter all, $(goals)) must-build-class := $(filter $(classes), $(goals)) must-build-sources := $(foreach v, $(must-build-class), $($v.class.sources)) endif # declare implicit prerequisites rule like 'object.o: header1.h header2.h ...' # argument $1 is input source file(s) # dir is explicitly added because option -MM strips it by default define declare-object-target $(dir $1)$(patsubst %.o:,%.$(object.extension):,$(filter %.o: %.h, $(shell $(CPP) $(depcheck.flags) -MM $1))) $(MAKEFILE_LIST) endef # evaluate implicit prerequisite rules when rebuilding everything ifdef must-build-everything $(if $(wildcard $(all.objects)), \ $(info ++++ info: evaluating implicit prerequisites in lib $(lib.name).....) \ $(foreach v, $(all.sources), $(eval $(call declare-object-target, $v)))) endif # evaluate implicit prerequisite rules when selectively building classes ifdef must-build-class $(foreach v, $(must-build-sources), \ $(eval $(call declare-object-target, $v))) $(foreach v, $(shared.sources), \ $(eval $(call declare-object-target, $v))) endif ################################################################################ ### rules: preprocessor and assembly files ##################################### ################################################################################ # Preprocessor and assembly output files for bug tracing etc. They are not part # of the build processes for executables. By default these files are created in # the current working directory. Dependency tracking is not performed, the build # is forced instead to make sure it's up to date. force: #=== preprocessor file ========================================================= # make preprocessor output file with extension .pre # argument $1 = compiler type (c or cxx) define make-preprocessor-file $(info ++++ info: making preprocessor output file $(notdir $*.pre) \ in current working directory) $(compile-$1) -E $< $(c.flags) $($1.flags) -o $(notdir $*.pre) endef %.pre:: %.c force $(call make-preprocessor-file,c) %.pre:: %.cc force $(call make-preprocessor-file,cxx) %.pre:: %.cpp force $(call make-preprocessor-file,cxx) #=== assembly file ============================================================= # make C / assembly interleaved output file with extension .lst # argument $1 = compiler type (c or cxx) define make-assembly-file $(info ++++ info: making assembly output file $(notdir $*.lst) \ in current working directory) $(compile-$1) \ -c -Wa,-a,-ad -fverbose-asm \ $($1.flags) \ $< > $(notdir $*.lst) endef %.lst:: %.c force $(call make-assembly-file,c) %.lst:: %.cc force $(call make-assembly-file,cxx) %.lst:: %.cpp force $(call make-assembly-file,cxx) ################################################################################ ### rules: installation targets ################################################ ################################################################################ #=== strip ===================================================================== # Stripping of installed binaries will only be done when variable 'stripflags' # is defined non-empty. No default definition is provided except for Windows # where the unstripped binaries are large, especially in the case of Mingw-w64. # Note: while stripping all symbols ('-s' or '--strip-all') is possible for # Linux and Windows, in the case of OSX only non-global symbols can be stripped # (option '-x' or '--discard-all'). # Make definition of strip command overridable so it can be defined in an # environment for cross-compilation. STRIP ?= strip # Commands in 'strip-executables' will be executed conditionally in the rule for # target 'install-executables'. strip-executables = cd "$(installpath)" && \ $(foreach v, $(executables), $(STRIP) $(stripflags) '$v';) #=== install =================================================================== # Install targets depend on successful exit status of target all because nothing # must be installed in case of a build error. # -p = preserve time stamps # -m = set permission mode (as in chmod) # -d = create all components of specified directories INSTALL = install INSTALL_PROGRAM := $(INSTALL) -p -m 644 INSTALL_DATA := $(INSTALL) -p -m 644 INSTALL_DIR := $(INSTALL) -m 755 -d # strip spaces from file names executables := $(strip $(executables)) datafiles := $(strip $(datafiles)) datadirs := $(strip $(datadirs)) # Do not make any install sub-target with empty variable definition because the # install program would exit with an error. install: $(if $(executables), install-executables) install: $(if $(datafiles), install-datafiles) install: $(if $(datadirs), install-datadirs) install-executables: all $(INSTALL_DIR) -v "$(installpath)" $(foreach v, $(executables), \ $(INSTALL_PROGRAM) '$v' "$(installpath)";) $(info ++++ info: executables of lib $(lib.name) installed \ from $(CURDIR) to $(installpath)) $(if $(stripflags), $(strip-executables),) install-datafiles: all $(INSTALL_DIR) -v "$(installpath)" $(foreach v, $(datafiles), \ $(INSTALL_DATA) '$(v)' "$(installpath)";) $(info ++++ info: data files of lib $(lib.name) installed \ from $(CURDIR) to $(installpath)) install-datadirs: all $(foreach v, $(datadirs), $(INSTALL_DIR) "$(installpath)/$v";) $(foreach v, $(datadirs), \ $(INSTALL_DATA) $(wildcard $v/*) "$(installpath)/$v";) $(info ++++ info: data directories of lib $(lib.name) installed \ from $(CURDIR) to $(installpath)) ################################################################################ ### rules: distribution targets ################################################ ################################################################################ # TODO # These targets are implemented in Makefile Template, but I have to figure out # how to do it under the not-so-strict conditions of Makefile.pdlibbuilder. # make source package dist: @echo "target dist not yet implemented" # make Debian source package dpkg-source: @echo "target dpkg-source not yet implemented" $(ORIGDIR): $(DISTDIR): ################################################################################ ### rules: clean targets ####################################################### ################################################################################ # delete build products from build tree clean: rm -f $(all.objects) rm -f $(classes.executables) $(lib.name).$(extension) $(shared.lib) rm -f *.pre *.lst # remove distribution directories and tarballs from build tree distclean: clean @echo "target distclean not yet implemented" ################################################################################ ### rules: submake targets ##################################################### ################################################################################ # Iterate over sub-makefiles or makefiles in other directories. # When 'continue-make=yes' is set, sub-makes will report 'true' to the parent # process regardless of their real exit status. This prevents the parent make # from being aborted by a sub-make error. Useful when you want to quickly find # out which sub-makes from a large set will succeed. ifeq ($(continue-make),yes) continue = || true endif # These targets will trigger sub-make processes for entries in 'makefiledirs' # and 'makefiles'. all alldebug install clean distclean dist dkpg-source: \ $(makefiledirs) $(makefiles) # this expands to identical rules for each entry in 'makefiledirs' $(makefiledirs): $(MAKE) --directory=$@ $(MAKECMDGOALS) $(continue) # this expands to identical rules for each entry in 'makefiles' $(makefiles): $(MAKE) --directory=$(dir $@) --makefile=$(notdir $@) $(MAKECMDGOALS) $(continue) ################################################################################ ### rules: convenience targets ################################################# ################################################################################ #=== show variables ============================================================ # Several 'function' macro's cause errors when expanded within a rule or without # proper arguments. Variables which are set with the define directive are only # shown by name for that reason. functions = \ add-class-source \ declare-class-target \ declare-class-executable-target \ declare-object-target \ link-class \ link-lib \ link-shared \ make-object-file \ make-preprocessor-file \ make-assembly-file # show variables from makefiles vars: $(info ++++ info: showing makefile variables:) $(foreach v,\ $(sort $(filter-out $(functions) functions, $(.VARIABLES))),\ $(if $(filter file, $(origin $v)),\ $(info variable $v = $($v)))) $(foreach v, $(functions), $(info 'function' name: $v)) @echo # show all variables allvars: $(info ++++ info: showing default, automatic and makefile variables:) $(foreach v, \ $(sort $(filter-out $(functions) functions, $(.VARIABLES))), \ $(info variable ($(origin $v)) $v = $($v))) $(foreach v, $(functions), $(info 'function' name: $v)) @echo #=== show dependencies ========================================================= # show generated prerequisites rules depend: $(info ++++ info: generated prerequisite rules) $(foreach v, $(classes), $(info $(declare-class-target))) $(foreach v, $(classes), $(info $(declare-class-executable-target))) $(foreach v, $(all.sources), $(info $(call declare-object-target, $v))) @echo #=== show help text ============================================================ # brief info about targets and paths ifdef mpdh mpdhinfo := $(mpdh) else mpdhinfo := m_pd.h was not found. Is Pd installed? endif help: @echo @echo " Main targets:" @echo " all: build executables (default target)" @echo " install: install all components of the library" @echo " vars: print makefile variables for troubleshooting" @echo " allvars: print all variables for troubleshooting" @echo " help: print this help text" @echo @echo " Pd API m_pd.h:" @echo " $(mpdhinfo)" @echo " You may specify your preferred Pd include directory as argument" @echo " to the make command, like 'PDINCLUDEDIR=path/to/pd/src'." @echo @echo " Path for installation of your libdir(s):" @echo " $(PDLIBDIR)" @echo " Alternatively you may specify your path for installation as argument" @echo " to the make command, like 'PDLIBDIR=path/to/pd-externals'." @echo @echo " Default paths are listed in the doc sections in Makefile.pdlibbuilder." @echo #=== platform test ============================================================= # This target can be used to test if the compiler for specified PLATFORM is # correctly defined and available. dumpmachine: @$(CC) -dumpmachine #=== dummy target ============================================================== coffee: @echo "Makefile.pdlibbuilder: Can not make coffee. Sorry." ################################################################################ ### end of rules sections ###################################################### ################################################################################ # for syntax highlighting in vim and github # vim: set filetype=make: iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/pd-lib-builder/README.md000066400000000000000000000131461514557770000253010ustar00rootroot00000000000000 ### Makefile.pdlibbuilder ### Helper makefile for Pure Data external libraries. Written by Katja Vetter March-June 2015 for the public domain and since then developed as a Pd community project. No warranties. Inspired by Hans Christoph Steiner's Makefile Template and Stephan Beal's ShakeNMake. GNU make version >= 3.81 required. ### characteristics ### * defines build settings based on autodetected target platform * defines rules to build Pd class- or lib executables from C or C++ sources * defines rules for libdir installation * defines convenience targets for developer and user * evaluates implicit dependencies for non-clean builds ### basic usage ### In your Makefile, define your Pd lib name and class files, and include Makefile.pdlibbuilder at the end of the Makefile. Like so: # Makefile for mylib lib.name = mylib class.sources = myclass1.c myclass2.c datafiles = myclass1-help.pd myclass2-help.pd README.txt LICENSE.txt PDLIBBUILDER_DIR=. include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder For files in class.sources it is assumed that class name == source file basename. The default target builds all classes as individual executables with Pd's default extension for the platform. For anything more than the most basic usage, read the documentation sections in Makefile.pdlibbuilder. ### paths ### Makefile.pdlibbuilder >= v0.4.0 supports pd path variables which can be defined not only as make command argument but also in the environment, to override platform-dependent defaults: PDDIR: Root directory of 'portable' pd package. When defined, PDINCLUDEDIR and PDBINDIR will be evaluated as $(PDDIR)/src and $(PDDIR)/bin. PDINCLUDEDIR: Directory where Pd API m_pd.h should be found, and other Pd header files. Overrides the default search path. PDBINDIR: Directory where pd.dll should be found for linking (Windows only). Overrides the default search path. PDLIBDIR: Root directory for installation of Pd library directories. Overrides the default install location. ### platform detection and predefined variables ### Makefile.pdlibbuilder tries to detect architecture and operating system in order to define platform-specific variables. Since v0.6.0 we let the compiler report target platform, rather than taking the build machine as reference. This simplifies cross compilation. The kind of build options that are predefined: - optimizations useful for realtime DSP processing - options strictly required for the platform - options to make the build work accross a range of CPU's and OS versions The exact choice and definition predefined variables changes over time, as new platforms arrive and older platforms become obsolete. The easiest way to get an overview for your platform is by checking the flags categories in the output of target `vars`. Variables written in capitals (like `CFLAGS`) are intentionally exposed as user variables, although technically all makefile variables can be overridden by make command arguments. ### specific language versions ### Makefile.pdlibbuilder handles C and C++, but can not detect if your code uses features of a specific version (like C99, C++11, C++14 etc.). In such cases your makefile should specify that version as compiler option: cflags = -std=c++11 Also you may need to be explicit about minimum OSX version. For example, C++11 needs OSX 10.9 or higher: define forDarwin cflags = -mmacosx-version-min=10.9 endef ### documentation ### This README.md provides only basic information. A large comment section inside Makefile.pdlibbuilder lists and explains the available user variables, default paths, and targets. The internal documentation reflects the exact functionality of the particular version. For suggestions about project maintenance and advanced compilation see tips-tricks.md. ### versioning ### The project is versioned in MAJOR.MINOR.BUGFIX format (see http://semver.org), and maintained at https://github.com/pure-data/pd-lib-builder. Pd lib developers are invited to regulary check for updates, and to contribute and discuss improvements here. If you really need to distribute a personalized version with your library, rename Makefile.pdlibbuilder to avoid confusion. ### examples ### The list of projects using pd-lib-builder can be helpful if you are looking for examples, from the simplest use case to more complex implementations. - helloworld: traditional illustration of simplest use case - pd-windowing: straightforward real world use case of a small library - pd-nilwind / pd-cyclone: more elaborate source tree - zexy: migrated from autotools to pd-lib-builder ### projects using pd-lib-builder ### non-exhaustive list https://github.com/pure-data/helloworld https://github.com/electrickery/pd-nilwind https://github.com/electrickery/pd-maxlib https://github.com/electrickery/pd-sigpack https://github.com/electrickery/pd-tof https://github.com/electrickery/pd-windowing https://github.com/electrickery/pd-smlib https://github.com/porres/pd-cyclone https://github.com/porres/pd-else https://github.com/porres/pd-psycho https://git.iem.at/pd/comport https://git.iem.at/pd/hexloader https://git.iem.at/pd/iemgui https://git.iem.at/pd/iemguts https://git.iem.at/pd/iemlib https://git.iem.at/pd/iemnet https://git.iem.at/pd/iem_ambi https://git.iem.at/pd/iem_tab https://git.iem.at/pd/iem_adaptfilt https://git.iem.at/pd/iem_roomsim https://git.iem.at/pd/iem_spec2 https://git.iem.at/pd/mediasettings https://git.iem.at/pd/zexy https://git.iem.at/pd-gui/punish https://github.com/residuum/PuRestJson https://github.com/libpd/abl_link https://github.com/wbrent/timbreID https://github.com/MetaluNet/moonlib iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/pd-lib-builder/tips-tricks.md000066400000000000000000000210121514557770000266070ustar00rootroot00000000000000pd-lib-builder cheatsheet ========================= # Creating special builds ## Building for non-native platform Using pd-lib-builder >=0.6.0 we can define variable `PLATFORM` to specify a target triplet for cross-compilation. Assuming a W32 package for Pd is unzipped into path `${PDWIN32}`, to build for Windows 32 bit: make PLATFORM=i686-w64-mingw32 PDDIR="${PDWIN32}" #### Older pd-lib-builder versions Using pd-lib-builder < 0.6.0, in the absence of variable `PLATFORM`, you would instead override variables `system`, `target.arch`, `CC` and / or `CXX`, `STRIP`. Example: make system=Windows target.arch=i686 CC=i686-w64-mingw32-gcc STRIP=i686-w64-mingw32-strip PDDIR="${PDWIN32}" #### Toolchains To build for non-native OS and/or architecture you need a cross toolchain. On Linux such toolchains are relatively easy to get. For example Debian Buster amd64 provides them for the following platforms (install g++ with dependencies for a given platform to get the whole toolchain): - `arm-linux-gnueabihf` - `aarch64-linux-gnu` - `i686-linux-gnu` - `i686-w64-mingw32` and `x86_64-w64-mingw32` (install `mingw-w64`) Cross toolchains for OSX/MacOS are not generally distributed. Project `osxcross` from Thomas Poechtraeger can create them for Linux. ## Universal binaries on macOS The compiler, by default, builds for the native architecture of the build machine. To make a "universal" multi-arch build, specify the desired archtectures on the command line using the "arch" pd-lib-builder Makefile variable. For example, to build a "fat" external for both 64-bit Intel and Arm (Apple Silicon): make arch="x86_64 arm64" If the build is successful, the compiled architectures in the built external can be confirmed via the `file` command: ~~~sh % file vbap.pd_darwin vbap.pd_darwin: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64] vbap.pd_darwin (for architecture x86_64): Mach-O 64-bit bundle x86_64 vbap.pd_darwin (for architecture arm64): Mach-O 64-bit bundle arm64 ~~~ Note: The available architectures depend on which macOS version & command line tools/Xcode combination the build system has. For example, any newer macOS 10.15+ will support both x86_64 (Intel 64-bit) and arm64 (Apple Silicon) while OSX 10.6 - macOS 10.14 can build for x86_64 and i386 (Intel 32-bit). ## Building double-precision externals At the time of writing (2023-07-06) there is no official Pd that supports double-precision numbers yet. However, if you do get hold of an experimental double-precision Pd, you can easily build your externals for 64-bit numbers, by passing `floatsize=64` as an argument to `make`. Starting with Pd>=0.54, double precision externals use different extensions from traditional (single-precision) externals. The extension consists of the OS ("linux", "darwin", "windows"), the CPU architecture ("amd64" (x86_64), "i386" (x86), "arm64",...) and the floatsize in bits ("64" for double-precision), followed by the system's native extension for dynamic libraries (".dll" on Windows, ".so" on macOS/Linux/un*xes). As of pd-lib-builder==0.7.0, you have to manually pass this extension: make floatsize=64 extension=windows-amd64-64.dll make floatsize=64 extension=linux-arm64-64.so make floatsize=64 extension=darwin-fat-64.so arch="x86_64 arm64" # Project management In general it is advised to put the `Makefile.pdlibbuilder` into a separate subdirectory (e.g. `pd-lib-builder/`). This makes it much easier to update the `Makefile.pdlibbuilder` later You *should* also use a variable to the actual path of the Makefile.pdlibbuilder (even if you keep it in the root-directory), as this allows easy experimenting with newer (or older) (or site-specific) versions of the pd-lib-builder Makefile. ~~~make PDLIBBUILDER_DIR=pd-lib-builder/ include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder ~~~ ## Keeping pd-lib-builder up-to-date ### `git subtree` With git-subtrees, you make the pd-lib-builder repository (or any other repository for that matter) part of your own repository - with full history and everything - put nicely into a distinct subdirectory. Support for *manipulating* subtrees has been added with Git-v1.7.11 (May 2012). The nice thing however is, that from "outside" the subtree is part of your repository like any other directory. E.g. older versions of Git can clone your repository with the full subtree (and all it's history) just fine. You can also use git-archive to make a complete snapshot of your repository (including the subtree) - nice, if you e.g. want self-contained downloads of your project from git hosting platforms (like Github, Gitlab, Bitbucket,...) In short, `git subtree` is the better `git submodule`. So here's how to do it: #### Initial setup/check-out This will create a `pd-lib-builder/` directory containing the full history of the pd-lib-builder repository up to its release `v0.5.0` ~~~sh git subtree add --prefix=pd-lib-builder/ https://github.com/pure-data/pd-lib-builder v0.5.0 ~~~ This will automatically merge the `pd-lib-builder/` history into your current branch, so everything is ready to go. #### Cloning your repository with the subtree Nothing special, really. Just clone your repository as always: ~~~sh git clone https://git.example.org/pd/superbonk~.git ~~~ #### Updating the subtree Time passes and sooner or later you will find, that there is a shiny new pd-lib-builder with plenty of bugfixes and new features. To update your local copy to pd-lib-builder's current `master`, simply run: ~~~sh git subtree pull --prefix pd-lib-builder/ https://github.com/pure-data/pd-lib-builder master ~~~ #### Pulling the updated subtree into existing clones Again, nothing special. Just pull as always: ~~~sh git pull ~~~ #### Further reading More on the power of `git subtree` can be found online - https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844 - https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree - ... ### ~~`git submodule`~~ [DISCOURAGED] #### Initial setup/check-out To add a new submodule to your repository, just run `git submodule add` and commit the changes: ~~~sh git submodule add https://github.com/pure-data/pd-lib-builder git commit .gitmodules pd-lib-builder/ -m "Added pd-lib-builder as git-submodule" ~~~ #### Cloning your repository with the submodule When doing a fresh clone of your repository, pass the `--recursive` option to automatically fetch all submodules: ~~~sh git clone --recursive https://git.example.org/pd/superbonk~.git ~~~ If you've cloned non-recursively, you can initialize and update the submodules manually: ~~~sh git submodule init git submodule update ~~~ #### Updating the submodule Submodules are usually fixed to a given commit in their repository. To update the `pd-lib-builder` submodule to the current `master` do something like: ~~~sh cd pd-lib-builder git checkout master git pull cd .. git status pd-lib-builder git commit pd-lib-builder -m "Updated pd-lib-builder to current master" ~~~ #### Pulling the updated submodule into existing clones After you have pushed the submodule updates in your repository, other clones of the repository can be updated as follows: ~~~sh git pull ~~~ The above will make your repository aware, that the submodule is out-of-sync. ~~~sh $ LANG=C git status pd-lib-builder On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: pd-lib-builder (new commits) $ ~~~ In order to sync the submodule to the correct commit, run the following: ~~~sh git submodule update ~~~ #### Drawbacks `git submodule` has a number of drawbacks: - it requires special commands to synchronize the submodules, in addition to synching your repository. - you must make sure to use an URL for the submodule that is accessible to your potential users. e.g. using `git@github.com:pure-data/pd-lib-builder` is bad, because it requires everybody who wants to checkout your sources to have a github-account - even if they could checkout *your* repository anonymously. - submodules will be excluded from `git archive`. This means, that if you use a mainstream git provider (like Github, GitLab, Bitbucket,...) and make releases by creating a `git tag`, the automatically generated zipfiles with the sources will lack the submodule - and your users will not be able to compile your source code. In general, I would suggest to **avoid** `git submodule`, and instead use the better `git subtree` (above). iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/000077500000000000000000000000001514557770000220115ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix.c000066400000000000000000000014431514557770000241560ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_sources.h" #ifndef BUILD_DATE # define BUILD_DATE "" __DATE__ " : " __TIME__ #endif void iemmatrix_setup() { post(""); post("iemmatrix "VERSION); post("\tobjects for manipulating 2d-matrices"); post("\t(c) 2001-2026 iem"); post("\t\tIOhannes m zmölnig"); post("\t\tThomas Musil"); post("\t\tFranz Zotter"); post("\tcompiled "BUILD_DATE); iemmatrix_sources_setup(); post(""); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix.h000066400000000000000000000212371514557770000241660ustar00rootroot00000000000000/* ************************************* */ /* iemmatrix */ /* ************************************* */ /* objects for simple matrix operations */ /* ************************************* */ /* * IEMMATRIX 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 IEMMATRIX external * (except if you want to use the code for other things) * * you can get "pure data" at * http://pd.iem.at * ftp://iem.at/pd */ /* * Copyright (c) Thomas Musil; IEM KUG, Graz, Austria; 2001-2005 * Copyright (c) IOhannes m zmölnig (forum::für::umläute), IEM KUG, Graz, Austria; 2001-2005 * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * * * "pure data" has it's own license, that comes shipped with "pure data". * * there are ABSOLUTELY NO WARRANTIES for anything */ #ifndef INCLUDE_IEMMATRIX_H__ #define INCLUDE_IEMMATRIX_H__ #ifdef _MSC_VER # pragma warning( disable : 4244 ) # pragma warning( disable : 4305 ) #endif /* __WIN32__ */ #if defined __GNUC__ && __GNUC__ >= 8 /* this is actually a useful warning; but we get it for registering any callback... */ # pragma GCC diagnostic ignored "-Wcast-function-type" #endif #ifdef HAVE_CONFIG_H # include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_M_PD_H # include #elif defined HAVE_PD_M_PD_H # include #else # include #endif #ifdef HAVE_G_CANVAS_H # include # define IEMMATRIX_HAVE_G_CANVAS 1 #elif defined HAVE_PD_G_CANVAS_H # include # define IEMMATRIX_HAVE_G_CANVAS 1 #else # define IEMMATRIX_HAVE_G_CANVAS 0 #endif #ifndef VERSION #ifdef PACKAGE_VERSION # define VERSION PACKAGE_VERSION #else # define VERSION "(unknown)" #endif #endif /* VERSION */ #include #ifndef M_PI # define M_PI 3.141592653589793238462643383279502884L #endif #include #ifdef __WIN32__ #ifndef fabsf # define fabsf fabs #endif #ifndef sqrtf # define sqrtf sqrt #endif #ifndef powf # define powf pow #endif #ifndef atanf # define atanf atan #endif #endif #ifdef __APPLE__ # include # if defined (MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 # else /* float intrinsics not in math.h, so we define them here */ # define sqrtf(v) (float)sqrt((double)(v)) # define cosf(v) (float)cos((double)(v)) # define sinf(v) (float)sin((double)(v)) # define tanf(v) (float)tan((double)(v)) # define logf(v) (float)log((double)(v)) # define expf(v) (float)exp((double)(v)) # define atan2f(v,p) (float)atan2((double)(v), (double)(p)) # define powf(v,p) (float)pow((double)(v), (double)(p)) # endif #endif typedef double t_matrixfloat; /* the main class...*/ typedef struct _matrix { int row, col; t_atom *atombuffer; } t_matrix; typedef struct _matrixobj { t_object x_obj; t_matrix m; int current_row, current_col; /* this makes things easy for the mtx_row & mtx_col...*/ t_canvas *x_canvas; /* needed for file-reading */ t_outlet *x_outlet; /* just in case somebody wants an outlet */ } t_matrixobj; typedef struct _mtx_binscalar { t_object x_obj; t_matrix m; /* the output matrix */ t_float f; /* the second input */ } t_mtx_binscalar; typedef struct _mtx_binmtx { t_object x_obj; t_matrix m; /* the output matrix */ t_matrix m2; /* the second input */ } t_mtx_binmtx; /* G.Holzmann: the following is now implemented in iemmatrix_utility.c */ void matrix_free(t_matrix*x); /* utility function */ void setdimen(t_matrix *x, int row, int col); void matrix_set(t_matrix *m, t_float f); /* set the entire matrix to "f" */ void adjustsize(void*x, t_matrix *m, int desiredRow, int desiredCol); void printmatrix(void*x, const t_matrix*m); void debugmtx(int argc, t_float *buf, int id); t_matrixfloat *matrix2float(t_atom *ap); void float2matrix(t_atom *ap, t_matrixfloat *buffer); /* basic matrix message checks: returns 1 if matrix message is invalid, 0 otherwise ; prints error messages * tests specifies the tests to run (0==all tests) */ enum { IEMMATRIX_CHECK_CRIPPLED = 1<<0, IEMMATRIX_CHECK_DIMENSIONS = 1<<1, IEMMATRIX_CHECK_SPARSE = 1<<2, IEMMATRIX_CHECK_ALL = 0 }; int iemmatrix_check(void*object, t_symbol*s, int argc, t_atom*argv, unsigned int tests); /* get a (decorated) objname: returns either "[]: " or "" * the returned string MUST NOT be freed by the caller * 'object' must be of type 't_object*' (or derived) */ const char*iemmatrix_objname(void*object); /* get the name of the abstraction containing the object * you can use current=0 when calling this in the constructor */ const char*iemmatrix_parentabstractionname(const t_glist*current); /* get a Pd function by name */ void*iemmatrix_getpdfun(const char*name); /* an associative array */ EXTERN_STRUCT _iemmatrix_map; /* add a new element to the map (pass 'NULL' as to create a new one */ struct _iemmatrix_map*iemmatrix_map_add(struct _iemmatrix_map*map, t_symbol*key, void*value); void*iemmatrix_map_get(struct _iemmatrix_map*map, t_symbol*key); /* free the map: free_callback() is called for each in the map */ void iemmatrix_map_free(struct _iemmatrix_map*map, void(*free_callback)(void*)); /* basic I/O functions */ void matrix_bang(t_object *x, t_matrix* m); /* output the matrix stored in atombuffer */ void matrix_matrix2(void *x, t_matrix *m, int argc, t_atom *argv); /* store the matrix in atombuffer */ /* set data */ void matrix_zeros(t_object *x, t_matrix *m, int argc, t_atom *argv); void matrix_ones(t_object *x, t_matrix *m, int argc, t_atom *argv); void matrix_eye(t_object *x, t_matrix *m, int argc, t_atom *argv); void matrix_egg(t_object *x, t_matrix *m, int argc, t_atom *argv); void matrix_diag(t_object *x, t_matrix *m, int argc, t_atom *argv); void matrix_diegg(t_object *x, t_matrix *m, int argc, t_atom *argv); /* matrixobj shortcuts */ void matrixobj_free(t_matrixobj*x); void matrixobj_bang(t_matrixobj*x); void matrixobj_matrix2(t_matrixobj*x, t_symbol *s, int argc, t_atom *argv); void matrixobj_zeros(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv); void matrixobj_ones(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv); void matrixobj_eye(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv); void matrixobj_egg(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv); void matrixobj_diag(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv); void matrixobj_diegg(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv); /* get/set data */ void iemmatrix_floats2list(t_atom* dest, const t_float* src, size_t n); void iemmatrix_floats2list_modulo(t_atom* dest, const t_float* src, size_t n, size_t m); void iemmatrix_list2floats(t_float* dest, const t_atom* src, size_t n); void iemmatrix_list2floats_modulo(t_float* dest, const t_atom* src, size_t n, size_t m); /* in iemmatrix_unop.c */ typedef t_float(iemmatrix_unopfun_t)(t_float); /* the varargs are a 0-terminated list of alias names (const char*) */ void iemmatrix_unop_setup(const char*classname, const char* helpname, iemmatrix_unopfun_t*, ...); typedef t_float(iemmatrix_binopfun_t)(t_float, t_float); /* the varargs are a 0-terminated list of alias names (const char*) */ void iemmatrix_binop_setup(const char*classname, const char*helpname, iemmatrix_binopfun_t*, ...); /* in iemmatrix_binops.c */ void mtx_bin_matrix2(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv); void mtx_binmtx_bang(t_mtx_binmtx *x); void mtx_binmtx_free(t_mtx_binmtx *x); void mtx_binscalar_bang(t_mtx_binscalar *x); void mtx_binscalar_free(t_mtx_binscalar *x); /* some math */ /* invert a square matrix (row=col=rowcol) */ /* if "error" is non-NULL, it's content will be set to 0 if the matrix was invertable, else to non-0 */ t_matrixfloat*mtx_doInvert(t_matrixfloat*input, int rowcol, int*error); /* transpose a matrix */ t_matrixfloat*mtx_doTranspose(t_matrixfloat*output, int row, int col); /* multiply matrix A=[rowA*colA] with matrix B=[rowB*colB]; C=A*B; colA=rowB=colArowB */ t_matrixfloat*mtx_doMultiply(int rowA, t_matrixfloat*A, int colArowB, t_matrixfloat*B, int colB); /* version comparison */ #define KERNEL_VERSION(a, b, c) ((a * 1000) + b) * 1000 + c #if KERNEL_VERSION(PD_VERSION_MAJOR, PD_VERSION_MINOR, PD_VERSION_BUGFIX) < KERNEL_VERSION(0, 53, 0) # define PD_CRITICAL 0 # define PD_ERROR 1 # define PD_NORMAL 2 # define PD_DEBUG 3 # define PD_VERBOSE 3 #endif /* for debugging purposes */ #define MARK startpost("MARK[%s:%d@%s]", __FILE__, __LINE__, __FUNCTION__), post /* helpers */ unsigned int iemmatrix_atom_getuint(const t_atom*a); int iemmatrix_atom_getint(const t_atom*a); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_binop.c000066400000000000000000000207101514557770000253430ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include typedef struct _matrix_binop { t_object x_obj; t_matrix m; t_matrix m1; t_matrix m2; t_float f2; iemmatrix_binopfun_t*fun; t_symbol*x_selector; int x_argc; } t_matrix_binop; typedef struct _binop_ { t_class*class; t_class*scalarclass; iemmatrix_binopfun_t*fun; } _binop_t; static struct _iemmatrix_map*s_map = 0; static void mtx_binop_storematrix(t_matrix_binop*x, t_matrix*m, t_atom*argv) { int row = atom_getfloat(argv+0); int col = atom_getfloat(argv+1); int n = row * col; adjustsize(x, m, row, col); t_atom *ap = m->atombuffer + 2; argv+=2; while(n--) { t_float f = atom_getfloat(argv++); SETFLOAT(ap, f); ap++; } } static void mtx_binop_sendmatrix(t_matrix_binop*x) { int argc = x->m.row * x->m.col; outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc+2, x->m.atombuffer); } /* convert a valid argc/argv matrix to the 'm1' matrix * apply a scalar on the matrix * if 'reverse' is true, reverse the arguments * store the results in x->m */ static void mtx_binop_m2f(t_matrix_binop*x, t_matrix*m1, t_float f2, int reverse) { iemmatrix_binopfun_t*fun = x->fun; t_matrix *m = &x->m; /* output matrix */ int row = m1->row; int col = m1->col;; int n = row * col; t_atom *ap, *ap1 = m1->atombuffer + 2; adjustsize(x, m, row, col); ap = m->atombuffer + 2; while(n--) { t_float f1 = atom_getfloat(ap1++); t_float f = reverse?fun(f2, f1):fun(f1, f2); SETFLOAT(ap, f); ap++; } mtx_binop_sendmatrix(x); } static void mtx_binop_float(t_matrix_binop *x, t_float f1) { /* float on left-hand side; apply it to right-hand matrix */ if(!x->m2.row || !x->m2.col) { pd_error(x, "no right-hand matrix to operate on"); return; } mtx_binop_m2f(x, &x->m2, f1, 1); } static void mtx_binop_bang(t_matrix_binop *x) { iemmatrix_binopfun_t*fun = x->fun; int row=x->m1.row; int col=x->m1.col; int n = row * col; if (!(x->m2.col && x->m2.row)) { mtx_binop_m2f(x, &x->m1, 0., 0); return; } if(x->m2.col==1 && x->m2.row==1) { t_float f = atom_getfloat(x->m2.atombuffer+2); mtx_binop_m2f(x, &x->m1, f, 0); return; } if(x->m2.row==1 && x->m2.col == x->m1.col) { int c, r; adjustsize(x, &x->m, row, col); t_atom*m = x->m.atombuffer+2; t_atom*m1 = x->m1.atombuffer+2; for(r=0; rm2.atombuffer+2; for(c=0; cm2.col==1 && x->m2.row == x->m1.row) { int c, r; adjustsize(x, &x->m, row, col); t_atom*m = x->m.atombuffer+2; t_atom*m1 = x->m1.atombuffer+2; t_atom*m2 = x->m2.atombuffer+2; for(r=0; rm1.col != x->m2.col) || (x->m1.row != x->m2.row)) { pd_error(x, "matrix dimensions do not match"); return; } adjustsize(x, &x->m, row, col); t_atom *m = x->m .atombuffer+2; t_atom *m1 = x->m1.atombuffer+2; t_atom *m2 = x->m2.atombuffer+2; while(n--) { t_float f = fun(atom_getfloat(m1++), atom_getfloat(m2++)); SETFLOAT(m, f); m++; } mtx_binop_sendmatrix(x); } static void mtx_binop_matrix(t_matrix_binop *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; x->x_selector = s; x->x_argc = argc; mtx_binop_storematrix(x, &x->m1, argv); mtx_binop_bang(x); } static void mtx_binop_matrix2(t_matrix_binop *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; mtx_binop_storematrix(x, &x->m2, argv); } static void mtx_binopscalar_bang(t_matrix_binop *x) { iemmatrix_binopfun_t*fun = x->fun; int row=x->m1.row; int col=x->m1.col; int n = row * col; if(!x->x_argc) { outlet_bang(x->x_obj.ob_outlet); return; } adjustsize(x, &x->m, row, col); t_atom *m = x->m .atombuffer+2; t_atom *m1 = x->m1.atombuffer+2; t_float f2 = x->f2; while(n--) { t_float f = fun(atom_getfloat(m1++), f2); SETFLOAT(m, f); m++; } if(x->x_selector == gensym("matrix")) mtx_binop_sendmatrix(x); else { outlet_anything(x->x_obj.ob_outlet, x->x_selector, x->x_argc, x->m.atombuffer+2); } } static void mtx_binopscalar_matrix(t_matrix_binop *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; x->x_selector = s; x->x_argc = argc; mtx_binop_storematrix(x, &x->m1, argv); mtx_binopscalar_bang(x); } static void mtx_binopscalar_list(t_matrix_binop *x, t_symbol *s, int argc, t_atom *argv) { if(s) x->x_selector = s; else if (1 == argc) x->x_selector = gensym("float"); else x->x_selector = gensym("list"); x->x_argc = argc; adjustsize(x, &x->m1, 1, argc); t_atom *m1 = x->m1.atombuffer + 2; while(argc--) { t_float f = atom_getfloat(argv++); SETFLOAT(m1, f); m1++; } mtx_binopscalar_bang(x); } static void *mtx_binop_new(t_symbol*s, int argc, t_atom*argv) { t_matrix_binop *x = 0; /* element cos */ _binop_t *binop=iemmatrix_map_get(s_map, s); if(!binop) return x; t_class*cls = binop->class; t_class*scalarcls = binop->scalarclass; iemmatrix_binopfun_t *fun = binop->fun; if(!cls && !scalarcls) { pd_error(x, "no class for '%s'", s->s_name); return x; } if(!fun) { pd_error(x, "no function for '%s'", s->s_name); return x; } if(argc) { x = (t_matrix_binop *)pd_new(scalarcls); floatinlet_new(&x->x_obj, &x->f2); x->f2 = atom_getfloatarg(0, argc, argv); } else { x = (t_matrix_binop *)pd_new(cls); inlet_new(&x->x_obj, &x->x_obj.te_g.g_pd, gensym("matrix"), gensym("")); x->m1.col = x->m1.row = x->m2.col = x->m2.row = 0; x->m1.atombuffer = x->m2.atombuffer = 0; } x->fun = fun; outlet_new(&x->x_obj, 0); if (argc>1) { pd_error(x, "%s : extra arguments ignored", (s && s->s_name) ? s->s_name : "matrix object"); } return(x); } static void mtx_binop_free(t_matrix_binop*x) { matrix_free(&x->m); matrix_free(&x->m1); matrix_free(&x->m2); } void iemmatrix_binop_setup(const char*classname, const char*helpname, iemmatrix_binopfun_t*fun, ...) { if(!classname || !fun) return; t_class*cls, *scalarcls; t_symbol*s = gensym(classname); t_symbol*help = helpname?gensym(helpname):0; va_list ap; if(s == help) help = 0; cls = class_new(s, (t_newmethod)mtx_binop_new, (t_method)mtx_binop_free, sizeof(t_matrix_binop), 0, A_GIMME, A_NULL); class_addmethod(cls, (t_method)mtx_binop_matrix, gensym("matrix"), A_GIMME, A_NULL); class_addmethod(cls, (t_method)mtx_binop_matrix2, gensym(""), A_GIMME, A_NULL); class_addfloat(cls, (t_method)mtx_binop_float); class_addbang(cls, (t_method)mtx_binop_bang); if(help) class_sethelpsymbol(cls, help); scalarcls = class_new(s, 0, /* no constructor */ (t_method)mtx_binop_free, sizeof(t_matrix_binop), 0, A_NULL); class_addmethod(scalarcls, (t_method)mtx_binopscalar_matrix, gensym("matrix"), A_GIMME, A_NULL); class_addlist(scalarcls, (t_method)mtx_binopscalar_list); class_addbang(scalarcls, (t_method)mtx_binopscalar_bang); if(help) class_sethelpsymbol(scalarcls, help); _binop_t*binop = (_binop_t*)getbytes(sizeof(*binop)); binop->class = cls; binop->scalarclass = scalarcls; binop->fun = fun; s_map = iemmatrix_map_add(s_map, s, binop); va_start(ap, fun); while(1) { const char*alias = va_arg(ap, char*); if(!alias) break; s = gensym(alias); class_addcreator((t_newmethod)mtx_binop_new, s, A_GIMME, A_NULL); s_map = iemmatrix_map_add(s_map, s, binop); } va_end(ap); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_binops.c000066400000000000000000000027711514557770000255350ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* -------------------------------------------------------------- */ /* matrix math */ void mtx_bin_matrix2(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv) { int row = atom_getfloat(argv); int col = atom_getfloat(argv+1); if(iemmatrix_check(x, s, argc, argv, 0))return; if (row*col!=x->m2.row*x->m2.col) { freebytes(x->m2.atombuffer, (x->m2.row*x->m2.col+2)*sizeof(t_atom)); x->m2.atombuffer=copybytes(argv,(row*col+2)*sizeof(t_atom)); } else { memcpy(x->m2.atombuffer, argv, (row*col+2)*sizeof(t_atom)); } setdimen(&x->m2, row, col); } void mtx_binmtx_bang(t_mtx_binmtx *x) { if(x->m.atombuffer) { outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), x->m.col*x->m.row+2, x->m.atombuffer); } } void mtx_binmtx_free(t_mtx_binmtx *x) { matrix_free(&x->m); matrix_free(&x->m2); } void mtx_binscalar_bang(t_mtx_binscalar *x) { if(x->m.atombuffer) { outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), x->m.col*x->m.row+2, x->m.atombuffer); } } void mtx_binscalar_free(t_mtx_binscalar *x) { matrix_free(&x->m); } void iemtx_binops_setup(void) { } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_fft.c000066400000000000000000000404101514557770000250120ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2025, IOhannes m zmölnig * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ /* iemmatrix_mayer: fftw(f) compatible interface to Pd's mayer_fft */ /* use cases mtx_convolve~ - FFTWF: - IN: real-valued pd_in->in => convProcess => real-valued out->pd_out - OUT: - mayer - IN: --- - OUT: --- mtx_fft - FFTW: - IN: --- - OUT: --- - mayer - IN: separate re/im atomslists are converted to separate re/im floatlists - OUT: re/im floatlists are scaled & then converted into separate re/im atomlists mtx_ifft - FFTW: - IN: --- - OUT: --- - mayer - IN: separate re/im atomslists are converted to separate re/im floatlists - OUT: re/im floatlists are scaled & then converted into separate re/im atomlists mtx_rifft - FFTW: - IN: re/im atomlists is written directly into interleaved data vector - OUT: scale output vector & convert to atomlist - mayer: - IN: atomlist is converted to t_float & then rearranged for mayer blocked data - OUT: scale output vector & convert to atomlist mtx_rfft - FFTW: - IN: atomlist is written directly into real-valued data vector - OUT: interleaved output vector is converted to separate re/im atomlists - mayer: - IN: atomlist is written directly into real-valued data vector - OUT: imag-values are extracted from mayer blocked data & then written to separate re/im atomlists */ #include "iemmatrix_fft.h" #include "iemmatrix_stub.h" #define stringify(s) str(s) #define str(s) #s #include #if PD_FLOATSIZE == 64 # define x_in d_in # define x_out d_out # define c_in cd_in # define c_out cd_out #else # define x_in f_in # define x_out f_out # define c_in cf_in # define c_out cf_out #endif #ifdef HAVE_FFTW # include #else # include "stub/fftwf.h" # include "stub/fftw.h" #endif typedef void*(*t_my_malloc)(size_t); typedef void (*t_my_free)(void*); /* fftwf */ typedef void(*t_fftw32_destroy_plan)(fftwf_plan); typedef void(*t_fftw32_execute)(const fftwf_plan); typedef fftwf_plan(*t_fftw32_plan_dft_1d)(int, t_complexfloat*, t_complexfloat*, signed, unsigned); typedef fftwf_plan(*t_fftw32_plan_dft_c2r_1d)(int, t_complexfloat*, float*, unsigned); typedef fftwf_plan(*t_fftw32_plan_dft_r2c_1d)(int, float*, t_complexfloat*, unsigned); static t_my_malloc _fftw32_malloc = 0; static t_my_free _fftw32_free = 0; static t_fftw32_destroy_plan _fftw32_destroy_plan = 0; static t_fftw32_execute _fftw32_execute = 0; static t_fftw32_plan_dft_1d _fftw32_plan_dft_1d = 0; static t_fftw32_plan_dft_c2r_1d _fftw32_plan_dft_c2r_1d = 0; static t_fftw32_plan_dft_r2c_1d _fftw32_plan_dft_r2c_1d = 0; static int have_fftw32 = 0; /* fftw */ typedef void(*t_fftw64_destroy_plan)(fftw_plan); typedef void(*t_fftw64_execute)(const fftw_plan); typedef fftw_plan(*t_fftw64_plan_dft_1d)(int, t_complexdouble*, t_complexdouble*, signed, unsigned); typedef fftw_plan(*t_fftw64_plan_dft_c2r_1d)(int, t_complexdouble*, double*, unsigned); typedef fftw_plan(*t_fftw64_plan_dft_r2c_1d)(int, double*, t_complexdouble*, unsigned); static t_my_malloc _fftw64_malloc = 0; static t_my_free _fftw64_free = 0; static t_fftw64_destroy_plan _fftw64_destroy_plan = 0; static t_fftw64_execute _fftw64_execute = 0; static t_fftw64_plan_dft_1d _fftw64_plan_dft_1d = 0; static t_fftw64_plan_dft_c2r_1d _fftw64_plan_dft_c2r_1d = 0; static t_fftw64_plan_dft_r2c_1d _fftw64_plan_dft_r2c_1d = 0; static int have_fftw64 = 0; /* helpers */ static t_iemfft_flag flags2precision(t_iemfft_flag flags) { /* returns: DEFAULT(mayer), SINGLE(fftwf), or DOUBLE(fftw) */ int want_precision = 0; if(flags & PREFER_SINGLE) want_precision = 32; if(flags & PREFER_DOUBLE) want_precision = 64; #if PD_FLOATSIZE == 32 if(!(have_fftw32 || have_fftw64)) return DEFAULT; if(!have_fftw64) return PREFER_SINGLE; if((64 == want_precision) || !have_fftw32) return PREFER_DOUBLE; return PREFER_SINGLE; #else if((32 == want_precision) && have_fftw32) return PREFER_SINGLE; if(have_fftw64) return PREFER_DOUBLE; #endif return DEFAULT; } static void mayerfloat2complex(const unsigned int N, const t_float *in, t_complex *out) { /* mayer complex to interleaved complex IN.real : in[ 0..(N>>1 )] IN.imag : -in[(N-1)..(N>>1 +1)], y[0]=y[N>>1+1]=0 OUT.real: out[0..(N>>1 +1)].re OUT.imag: out[0..(N>>1 +1)].im OUT.re: +in[0], +in[1], ..., +in[(N>>2] */ const unsigned int N2 = (N>>1); for(unsigned int n=0; n>1)].re, -in[(N>>1)-1].im, -in[(N>>1)-2].im, ..., -in[0].im */ const unsigned int N2 = (N>>1) + 1; for(unsigned int n=0; n+2fftw32_plan) { _fftw32_destroy_plan(plan->fftw32_plan); } if(plan->fftw64_plan) { _fftw64_destroy_plan(plan->fftw64_plan); } iemfft_free(plan->_re); iemfft_free(plan->_im); iemfft_free(plan->_in); iemfft_free(plan->_out); freebytes(plan, sizeof(*plan)); } t_iemfft_plan iemfft_plan_rifft_1d(int n0, t_complex*in, t_float*out, t_iemfft_flag flags) { t_iemfft_plan plan = calloc(1, sizeof(*plan)); const t_iemfft_flag precision = flags2precision(flags); plan->flags = flags; plan->n0 = n0; plan->inptr = plan->c_in = in; plan->outptr = plan->x_out = out; plan->insize = ((n0>>1)+1)<<1; plan->outsize = n0; plan->inverse = 1; #if PD_FLOATSIZE == 32 t_complexdouble*_in = 0; double*_out = 0; #else t_complexfloat*_in = 0; float*_out = 0; #endif switch(precision) { case PREFER_SINGLE: #if PD_FLOATSIZE != 32 /* need to do type-conversion */ _in = plan->_in = iemfft_malloc(plan->insize * sizeof(*_in)); _out = plan->_out = iemfft_malloc(plan->outsize * sizeof(*_out)); plan->fftw32_plan = _fftw32_plan_dft_c2r_1d(n0, _in, _out, FFTW_ESTIMATE); #else plan->fftw32_plan = _fftw32_plan_dft_c2r_1d(n0, in, out, FFTW_ESTIMATE); #endif break; case PREFER_DOUBLE: #if PD_FLOATSIZE != 64 /* need to do type-conversion */ _in = plan->_in = iemfft_malloc(plan->insize * sizeof(*_in)); _out = plan->_out = iemfft_malloc(plan->outsize * sizeof(*_out)); plan->fftw64_plan = _fftw64_plan_dft_c2r_1d(n0, _in, _out, FFTW_ESTIMATE); #else plan->fftw64_plan = _fftw64_plan_dft_c2r_1d(n0, in, out, FFTW_ESTIMATE); #endif break; default: break; if(flags & PRESERVE_INPUT) { plan->_in = iemfft_malloc(n0 * sizeof(*in)); } } return plan; } t_iemfft_plan iemfft_plan_rfft_1d(int n0, t_float*in, t_complex*out, t_iemfft_flag flags) { t_iemfft_plan plan = calloc(1, sizeof(*plan)); const t_iemfft_flag precision = flags2precision(flags); plan->flags = flags; plan->n0 = n0; plan->inptr = plan->x_in = in; plan->outptr = plan->c_out = out; plan->insize = n0; plan->outsize = ((n0>>1)+1)<<1; plan->inverse = 0; #if PD_FLOATSIZE == 32 double*_in = 0; t_complexdouble*_out = 0; #else float*_in = 0; t_complexfloat*_out = 0; #endif switch(precision) { case PREFER_SINGLE: #if PD_FLOATSIZE != 32 /* need to do type-conversion */ _in = plan->_in = iemfft_malloc(n0 * sizeof(*_in)); _out = plan->_out = iemfft_malloc(n0 * sizeof(*_out)); plan->fftw32_plan = _fftw32_plan_dft_r2c_1d(n0, _in, _out, FFTW_ESTIMATE); #else plan->fftw32_plan = _fftw32_plan_dft_r2c_1d(n0, in, out, FFTW_ESTIMATE); #endif break; case PREFER_DOUBLE: #if PD_FLOATSIZE != 64 /* need to do type-conversion */ _in = plan->_in = iemfft_malloc(n0 * sizeof(*_in)); _out = plan->_out = iemfft_malloc(n0 * sizeof(*_out)); plan->fftw64_plan = _fftw64_plan_dft_r2c_1d(n0, _in, _out, FFTW_ESTIMATE); #else plan->fftw64_plan = _fftw64_plan_dft_r2c_1d(n0, in, out, FFTW_ESTIMATE); #endif break; default: if(flags & PRESERVE_INPUT) { plan->_in = iemfft_malloc(n0 * sizeof(*in)); } break; } return plan; } static t_iemfft_plan _fft_plan_1d(int n0, t_complex*in, t_complex* out, int inverse, t_iemfft_flag flags) { t_iemfft_plan plan = calloc(1, sizeof(*plan)); const t_iemfft_flag precision = flags2precision(flags); plan->flags = flags; plan->n0 = n0; plan->inptr = plan->c_in = in; plan->outptr = plan->c_out = out; plan->insize = plan->outsize = n0<<1; plan->inverse = inverse; #if PD_FLOATSIZE == 32 t_complexdouble*_in = 0, *_out = 0; #else t_complexfloat*_in = 0, *_out = 0; #endif switch(precision) { case PREFER_SINGLE: #if PD_FLOATSIZE != 32 /* need to do type-conversion */ _in = plan->_in = iemfft_malloc(n0 * sizeof(*_in)); _out = plan->_out = iemfft_malloc(n0 * sizeof(*_out)); plan->fftw32_plan = _fftw32_plan_dft_1d(n0, _in, _out, inverse?+1:-1, FFTW_ESTIMATE); #else plan->fftw32_plan = _fftw32_plan_dft_1d(n0, in, out, inverse?+1:-1, FFTW_ESTIMATE); #endif break; case PREFER_DOUBLE: #if PD_FLOATSIZE != 64 /* need to do type-conversion */ _in = plan->_in = iemfft_malloc(n0 * sizeof(*_in)); _out = plan->_out = iemfft_malloc(n0 * sizeof(*_out)); plan->fftw64_plan = _fftw64_plan_dft_1d(n0, _in, _out, inverse?+1:-1, FFTW_ESTIMATE); #else plan->fftw64_plan = _fftw64_plan_dft_1d(n0, in, out, inverse?+1:-1, FFTW_ESTIMATE); #endif break; default: plan->_re = iemfft_malloc(n0 * sizeof(*plan->_re)); plan->_im = iemfft_malloc(n0 * sizeof(*plan->_im)); break; } return plan; } t_iemfft_plan iemfft_plan_fft_1d(int n0, t_complex*in, t_complex* out, t_iemfft_flag flags) { return _fft_plan_1d(n0, in, out, 0, flags); } t_iemfft_plan iemfft_plan_ifft_1d(int n0, t_complex*in, t_complex* out, t_iemfft_flag flags) { return _fft_plan_1d(n0, in, out, 1, flags); } void iemfft_execute(const t_iemfft_plan plan) { if(0) { } else if(plan->fftw32_plan) { #if PD_FLOATSIZE != 32 if(plan->_in) { double2single(plan->_in, plan->inptr, plan->insize); } #endif _fftw32_execute(plan->fftw32_plan); #if PD_FLOATSIZE != 32 if(plan->_out) { single2double(plan->outptr, plan->_out, plan->outsize); } #endif } else if(plan->fftw64_plan) { #if PD_FLOATSIZE != 64 if(plan->_in) { single2double(plan->_in, plan->inptr, plan->insize); } #endif _fftw64_execute(plan->fftw64_plan); #if PD_FLOATSIZE != 64 if(plan->_out) { double2single(plan->outptr, plan->_out, plan->outsize); } #endif } else { if (0) { // real-valued FFTs } else if(plan->x_in && plan->c_out && !plan->inverse) { t_float*in = plan->x_in; if(plan->_in) { memcpy(plan->_in, plan->x_in, sizeof(*in)*plan->n0); in = plan->_in; } /* native precision rFFT */ mayer_realfft(plan->n0, in); mayerfloat2complex(plan->n0, in, plan->c_out); } else if(plan->c_in && plan->x_out && plan->inverse) { /* native precision rIFFT */ complex2mayerfloat(plan->n0, plan->c_in, plan->x_out); mayer_realifft(plan->n0, plan->x_out); // complex-valued FFTs } else if(plan->c_in && plan->c_out && !plan->inverse) { /* native precision FFT */ complex_deinterleave(plan->n0, plan->c_in, plan->_re, plan->_im); /* inplace FFT IN.real : x_re[0..(N-1)] IN.imag : x_im[0..(N-1)] OUT.real: x_re[0..(N-1)] OUT.imag: x_im[0..(N-1)] */ mayer_fft(plan->n0, plan->_re, plan->_im); complex_interleave(plan->n0, plan->_re, plan->_im, plan->c_out); } else if(plan->c_in && plan->c_out && plan->inverse) { /* native precision IFFT */ complex_deinterleave(plan->n0, plan->c_in, plan->_re, plan->_im); /* IN.real : x_re[0..(N-1)] IN.imag : x_im[0..(N-1)] OUT.real: x_re[0..(N-1)] OUT.imag: x_im[0..(N-1)] */ mayer_ifft(plan->n0, plan->_re, plan->_im); complex_interleave(plan->n0, plan->_re, plan->_im, plan->c_out); } else { pd_error(0, "iemmatrix_fft: no valid plan!"); } } } t_iemfft_backend iemfft_init(t_class*c) { static int have_fftw = 0; static int tried_fftw = 0; if(!tried_fftw) { /* initialize stubs */ tried_fftw = 1; /* #define register_my_fftw(prefix, name) \ my_fftw_##name = iemmatrix_get_stub(stringify(prefix) "_" #name, c) #define show_addr(x) post(#x "\t%p", x) */ #define register_fftw32(name) \ _fftw32_##name = iemmatrix_get_stub(stringify(fftwf_##name), c) #define register_fftw64(name) \ _fftw64_##name = iemmatrix_get_stub(stringify(fftw_##name), c) register_fftw32(malloc); register_fftw32(free); register_fftw32(destroy_plan); register_fftw32(execute); register_fftw32(plan_dft_1d); register_fftw32(plan_dft_c2r_1d); register_fftw32(plan_dft_r2c_1d); have_fftw32 = (1 && _fftw32_malloc && _fftw32_free && _fftw32_destroy_plan && _fftw32_execute && _fftw32_plan_dft_1d && _fftw32_plan_dft_c2r_1d && _fftw32_plan_dft_r2c_1d ); register_fftw64(malloc); register_fftw64(free); register_fftw64(destroy_plan); register_fftw64(execute); register_fftw64(plan_dft_1d); register_fftw64(plan_dft_c2r_1d); register_fftw64(plan_dft_r2c_1d); have_fftw64 = (1 && _fftw64_malloc && _fftw64_free && _fftw64_destroy_plan && _fftw64_execute && _fftw64_plan_dft_1d && _fftw64_plan_dft_c2r_1d && _fftw64_plan_dft_r2c_1d ); have_fftw = have_fftw32 || have_fftw64; if(have_fftw32 && have_fftw64) { post("iemmatrix: using FFTW/FFTWF/Mayer for Fourier transforms"); } else if (have_fftw64) { post("iemmatrix: using FFTW/Mayer for Fourier transforms"); } else if (have_fftw32) { post("iemmatrix: using FFTWF/Mayer for Fourier transforms"); } else { post("iemmatrix: using built in Mayer/Ooura for Fourier transforms"); } } if(have_fftw) { return FFTW; } return MAYER; } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_fft.h000066400000000000000000000035511514557770000250240ustar00rootroot00000000000000/* ************************************* */ /* iemmatrix */ /* ************************************* */ /* objects for simple matrix operations */ /* ************************************* */ /* * Copyright (c) IOhannes m zmölnig (forum::für::umläute), IEM KUG, Graz, Austria; 2025 * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * * there are ABSOLUTELY NO WARRANTIES for anything */ #ifndef _iemmatrix_fft_h_ #define _iemmatrix_fft_h_ #include "iemmatrix.h" typedef struct _complexfloat { float re; float im; } t_complexfloat; typedef struct _complexdouble { double re; double im; } t_complexdouble; #if PD_FLOATSIZE == 64 typedef struct _complexdouble t_complex; #else typedef struct _complexfloat t_complex; #endif typedef struct iemfft_plan *t_iemfft_plan; typedef enum { NONE = 0, MAYER, FFTW, INVALID } t_iemfft_backend; typedef enum { DEFAULT = 0, PREFER_SINGLE = 1 << 0, /* prefer single precision processing */ PREFER_DOUBLE = 1 << 1, /* prefer double precision processing */ PRESERVE_INPUT = 1 << 2, /* 'in' MUST not be modified during execute */ } t_iemfft_flag; /* initialize FFT backends */ t_iemfft_backend iemfft_init(t_class*c); void*iemfft_malloc(size_t size); void iemfft_free(void*data); t_iemfft_plan iemfft_plan_fft_1d(int n0, t_complex*in, t_complex* out, t_iemfft_flag flags); t_iemfft_plan iemfft_plan_ifft_1d(int n0, t_complex*in, t_complex* out, t_iemfft_flag flags); /* real-valued FFTs */ t_iemfft_plan iemfft_plan_rfft_1d(int n0, t_float*in, t_complex*out, t_iemfft_flag flags); t_iemfft_plan iemfft_plan_rifft_1d(int n0, t_complex*in, t_float*out, t_iemfft_flag flags); void iemfft_execute(const t_iemfft_plan plan); void iemfft_destroy_plan(t_iemfft_plan plan); #endif /* _iemmatrix_fft_h_ */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_stub.c000066400000000000000000000224501514557770000252140ustar00rootroot00000000000000/* * iemmatrix_stub * * loaders for 3rd party dependencies * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #ifdef _WIN32 # include typedef HINSTANCE module_t; # define snprintf _snprintf #else # define _GNU_SOURCE # include typedef void* module_t; #endif #include "iemmatrix_stub.h" #include "m_pd.h" #include #include # if defined(__GNUC__) # warning iemmatrix_stub #endif /* dlopen() well-known libraries and get symbols */ const char*extension = #ifdef SHARED_LIBRARY_EXTENSION SHARED_LIBRARY_EXTENSION #elif defined _WIN32 "dll" #else "so" #endif ; static module_t getmodule(const char*modulename, const char*path) { module_t mod = 0; #ifdef _WIN32 if (path) SetDllDirectory(path); mod = LoadLibrary(modulename); #else // search recursively, starting from the main program mod = dlopen(modulename, RTLD_NOW); if(!mod && path) { char fullmodulename[MAXPDSTRING]; if(snprintf(fullmodulename, MAXPDSTRING, "%s/%s", path, modulename) < MAXPDSTRING) mod = dlopen(fullmodulename, RTLD_NOW); } #endif return mod; } static module_t getstubmodule(const char*basename, const char*path) { char modulename[MAXPDSTRING]; snprintf(modulename, MAXPDSTRING-1, "libiemmatrixStub_%s.%s", basename, extension); modulename[MAXPDSTRING-1] = 0; return getmodule(modulename, path); } typedef void*(*getfun_t)(void); static getfun_t getfun(module_t module, const char*name) { static module_t module0 = 0; getfun_t fun = 0; (void)module0; #ifdef _WIN32 /* fall back to pd binary */ if (!module0) module0 = GetModuleHandle(0); if (!module) module = module0; fun = (void *)GetProcAddress(module, name); #else /* fall back to pd binary */ if(!module) { #ifdef RTLD_DEFAULT module = RTLD_DEFAULT; #else if(!module0) module0 = dlopen(0, RTLD_NOW); module = module0; #endif } fun = dlsym(module, name); #endif //post("%s(%p, %s) -> %p", __FUNCTION__, module, name, fun); return fun; } /* macros for retrieving the actual functions */ #define DECLARE_STUB(fun) \ static void* iemmatrix_stub_##fun = 0 #define MAKE_STUB(fun, module, function) \ do { \ if(!iemmatrix_stub_##fun) { \ getfun_t f = getfun(module, "iemmatrix_" #function); \ if(!f) f = getfun(module, #function); \ if(f)iemmatrix_stub_##fun = f(); \ } \ } while(0) #define GET_STUB(module, fun, name, path) \ do { \ if(!strcmp(name, #fun)) { \ if(!iemmatrix_stub_##fun) setup_##module(path); \ return iemmatrix_stub_##fun; \ } \ } while(0) /* GSL */ DECLARE_STUB(jn); DECLARE_STUB(yn); DECLARE_STUB(gsl_sf_bessel_Jn); DECLARE_STUB(gsl_sf_bessel_Yn); DECLARE_STUB(gsl_eigen_nonsymm); DECLARE_STUB(gsl_eigen_nonsymm_alloc); DECLARE_STUB(gsl_eigen_nonsymm_free); DECLARE_STUB(gsl_eigen_nonsymmv); DECLARE_STUB(gsl_eigen_nonsymmv_alloc); DECLARE_STUB(gsl_eigen_nonsymmv_free); DECLARE_STUB(gsl_linalg_QR_decomp); DECLARE_STUB(gsl_linalg_QR_unpack); DECLARE_STUB(gsl_linalg_SV_decomp); DECLARE_STUB(gsl_matrix_alloc); DECLARE_STUB(gsl_matrix_complex_alloc); DECLARE_STUB(gsl_matrix_complex_free); DECLARE_STUB(gsl_matrix_free); DECLARE_STUB(gsl_vector_alloc); DECLARE_STUB(gsl_vector_complex_alloc); DECLARE_STUB(gsl_vector_complex_free); DECLARE_STUB(gsl_vector_free); static void setup_gsl(const char*path) { static module_t mod = 0; if(!mod) mod = getstubmodule("gsl", path); MAKE_STUB(jn, mod, gsl_sf_bessel_Jn); MAKE_STUB(yn, mod, gsl_sf_bessel_Yn); MAKE_STUB(gsl_sf_bessel_Jn, mod, gsl_sf_bessel_Jn); MAKE_STUB(gsl_sf_bessel_Yn, mod, gsl_sf_bessel_Yn); MAKE_STUB(gsl_eigen_nonsymm, mod, gsl_eigen_nonsymm); MAKE_STUB(gsl_eigen_nonsymm_alloc, mod, gsl_eigen_nonsymm_alloc); MAKE_STUB(gsl_eigen_nonsymm_free, mod, gsl_eigen_nonsymm_free); MAKE_STUB(gsl_eigen_nonsymmv, mod, gsl_eigen_nonsymmv); MAKE_STUB(gsl_eigen_nonsymmv_alloc, mod, gsl_eigen_nonsymmv_alloc); MAKE_STUB(gsl_eigen_nonsymmv_free, mod, gsl_eigen_nonsymmv_free); MAKE_STUB(gsl_linalg_QR_decomp, mod, gsl_linalg_QR_decomp); MAKE_STUB(gsl_linalg_QR_unpack, mod, gsl_linalg_QR_unpack); MAKE_STUB(gsl_linalg_SV_decomp, mod, gsl_linalg_SV_decomp); MAKE_STUB(gsl_matrix_alloc, mod, gsl_matrix_alloc); MAKE_STUB(gsl_matrix_complex_alloc, mod, gsl_matrix_complex_alloc); MAKE_STUB(gsl_matrix_complex_free, mod, gsl_matrix_complex_free); MAKE_STUB(gsl_matrix_free, mod, gsl_matrix_free); MAKE_STUB(gsl_vector_alloc, mod, gsl_vector_alloc); MAKE_STUB(gsl_vector_complex_alloc, mod, gsl_vector_complex_alloc); MAKE_STUB(gsl_vector_complex_free, mod, gsl_vector_complex_free); MAKE_STUB(gsl_vector_free, mod, gsl_vector_free); /* default to math.h */ if(!iemmatrix_stub_gsl_sf_bessel_Jn) iemmatrix_stub_gsl_sf_bessel_Jn = jn; if(!iemmatrix_stub_gsl_sf_bessel_Yn) iemmatrix_stub_gsl_sf_bessel_Yn = yn; iemmatrix_stub_jn = iemmatrix_stub_gsl_sf_bessel_Jn; iemmatrix_stub_yn = iemmatrix_stub_gsl_sf_bessel_Yn; } /* sndfile */ DECLARE_STUB(sf_open); DECLARE_STUB(sf_close); DECLARE_STUB(sf_readf_float); static void setup_sndfile(const char*path) { static module_t mod = 0; if(!mod) mod = getstubmodule("sndfile", path); MAKE_STUB(sf_open, mod, sf_open); MAKE_STUB(sf_close, mod, sf_close); MAKE_STUB(sf_readf_float, mod, sf_readf_float); } /* fftw */ DECLARE_STUB(fftw_malloc); DECLARE_STUB(fftw_free); DECLARE_STUB(fftw_plan_dft_1d); DECLARE_STUB(fftw_plan_dft_c2r_1d); DECLARE_STUB(fftw_plan_dft_r2c_1d); DECLARE_STUB(fftw_execute); DECLARE_STUB(fftw_destroy_plan); static void setup_fftw(const char*path) { static module_t mod = 0; if(!mod) mod = getstubmodule("fftw", path); MAKE_STUB(fftw_malloc, mod, fftw_malloc); MAKE_STUB(fftw_free, mod, fftw_free); MAKE_STUB(fftw_plan_dft_1d, mod, fftw_plan_dft_1d); MAKE_STUB(fftw_plan_dft_c2r_1d, mod, fftw_plan_dft_c2r_1d); MAKE_STUB(fftw_plan_dft_r2c_1d, mod, fftw_plan_dft_r2c_1d); MAKE_STUB(fftw_execute, mod, fftw_execute); MAKE_STUB(fftw_destroy_plan, mod, fftw_destroy_plan); } /* fftwf */ DECLARE_STUB(fftwf_malloc); DECLARE_STUB(fftwf_free); DECLARE_STUB(fftwf_plan_dft_1d); DECLARE_STUB(fftwf_plan_dft_c2r_1d); DECLARE_STUB(fftwf_plan_dft_r2c_1d); DECLARE_STUB(fftwf_execute); DECLARE_STUB(fftwf_destroy_plan); static void setup_fftwf(const char*path) { static module_t mod = 0; if (!mod) mod = getstubmodule("fftwf", path); MAKE_STUB(fftwf_malloc, mod, fftwf_malloc); MAKE_STUB(fftwf_free, mod, fftwf_free); MAKE_STUB(fftwf_plan_dft_1d, mod, fftwf_plan_dft_1d); MAKE_STUB(fftwf_plan_dft_c2r_1d, mod, fftwf_plan_dft_c2r_1d); MAKE_STUB(fftwf_plan_dft_r2c_1d, mod, fftwf_plan_dft_r2c_1d); MAKE_STUB(fftwf_execute, mod, fftwf_execute); MAKE_STUB(fftwf_destroy_plan, mod, fftwf_destroy_plan); } void*iemmatrix_get_stub(const char*name, struct _class*cls) { /* gsl */ const char*path = cls?class_gethelpdir(cls):0; GET_STUB(gsl, jn, name, path); GET_STUB(gsl, yn, name, path); GET_STUB(gsl, gsl_sf_bessel_Jn, name, path); GET_STUB(gsl, gsl_sf_bessel_Yn, name, path); GET_STUB(gsl, gsl_eigen_nonsymm, name, path); GET_STUB(gsl, gsl_eigen_nonsymm_alloc, name, path); GET_STUB(gsl, gsl_eigen_nonsymm_free, name, path); GET_STUB(gsl, gsl_eigen_nonsymmv, name, path); GET_STUB(gsl, gsl_eigen_nonsymmv_alloc, name, path); GET_STUB(gsl, gsl_eigen_nonsymmv_free, name, path); GET_STUB(gsl, gsl_linalg_QR_decomp, name, path); GET_STUB(gsl, gsl_linalg_QR_unpack, name, path); GET_STUB(gsl, gsl_linalg_SV_decomp, name, path); GET_STUB(gsl, gsl_matrix_alloc, name, path); GET_STUB(gsl, gsl_matrix_complex_alloc, name, path); GET_STUB(gsl, gsl_matrix_complex_free, name, path); GET_STUB(gsl, gsl_matrix_free, name, path); GET_STUB(gsl, gsl_vector_alloc, name, path); GET_STUB(gsl, gsl_vector_complex_alloc, name, path); GET_STUB(gsl, gsl_vector_complex_free, name, path); GET_STUB(gsl, gsl_vector_free, name, path); /* sndfile */ GET_STUB(sndfile, sf_open, name, path); GET_STUB(sndfile, sf_close, name, path); GET_STUB(sndfile, sf_readf_float, name, path); /* fftw */ GET_STUB(fftw, fftw_malloc, name, path); GET_STUB(fftw, fftw_free, name, path); GET_STUB(fftw, fftw_plan_dft_1d, name, path); GET_STUB(fftw, fftw_plan_dft_c2r_1d, name, path); GET_STUB(fftw, fftw_plan_dft_r2c_1d, name, path); GET_STUB(fftw, fftw_execute, name, path); GET_STUB(fftw, fftw_destroy_plan, name, path); /* fftwf */ GET_STUB(fftwf, fftwf_malloc, name, path); GET_STUB(fftwf, fftwf_free, name, path); GET_STUB(fftwf, fftwf_plan_dft_1d, name, path); GET_STUB(fftwf, fftwf_plan_dft_c2r_1d, name, path); GET_STUB(fftwf, fftwf_plan_dft_r2c_1d, name, path); GET_STUB(fftwf, fftwf_execute, name, path); GET_STUB(fftwf, fftwf_destroy_plan, name, path); return 0; } void iemmatrix_stub_setup() { setup_gsl(0); setup_sndfile(0); setup_fftw(0); setup_fftwf(0); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_stub.h000066400000000000000000000022121514557770000252130ustar00rootroot00000000000000/* ************************************* */ /* iemmatrix */ /* ************************************* */ /* objects for simple matrix operations */ /* ************************************* */ /* * Copyright (c) IOhannes m zmölnig (forum::für::umläute), IEM KUG, Graz, Austria; 2025 * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * * there are ABSOLUTELY NO WARRANTIES for anything */ #ifndef _iemmatrix_stub_h_ #define _iemmatrix_stub_h_ #include typedef double (*t_besselfn)(int n, double x); typedef void* (*t_stub_alloc)(const size_t); typedef void (*t_stub_free)(void*); typedef void* (*t_stub_alloc2)(const size_t, const size_t); #define IEMMATRIX_DECLARE_ALLOCFREE_STUB(var) \ static t_stub_alloc var##_alloc = 0; \ static t_stub_free var##_free = 0; #define IEMMATRIX_DECLARE_ALLOCFREE2_STUB(var) \ static t_stub_alloc2 var##_alloc = 0; \ static t_stub_free var##_free = 0; struct _class; void*iemmatrix_get_stub(const char*name, struct _class*); #endif /* _iemmatrix_stub_h_ */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_unop.c000066400000000000000000000070321514557770000252170ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include typedef struct _matrix_unop { t_object x_obj; t_matrix m; iemmatrix_unopfun_t*fun; t_symbol*x_selector; int x_argc; } t_matrix_unop; typedef struct _unop_ { t_class*class; iemmatrix_unopfun_t*fun; } _unop_t; static struct _iemmatrix_map*s_map = 0; static void mtx_unop_bang(t_matrix_unop *x) { if(!x->x_argc) outlet_bang(x->x_obj.ob_outlet); else outlet_anything(x->x_obj.ob_outlet, x->x_selector, x->x_argc, x->m.atombuffer); } static void mtx_unop_matrix(t_matrix_unop *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; int row=atom_getint(argv++); int col=atom_getint(argv++); int n = argc-2; adjustsize(x, &x->m, row, col); t_atom *m = x->m.atombuffer+2; iemmatrix_unopfun_t*fun = x->fun; while(n--) { t_float f = fun(atom_getfloat(argv++)); SETFLOAT(m, f); m++; } x->x_selector = s; x->x_argc = argc; mtx_unop_bang(x); } static void mtx_unop_list(t_matrix_unop *x, t_symbol *s, int argc, t_atom *argv) { int n=argc; t_atom *m; (void)s; /* unused */ iemmatrix_unopfun_t*fun = x->fun; adjustsize(x, &x->m, 1, argc); m = x->m.atombuffer; while(n--) { t_float f = fun(atom_getfloat(argv++)); SETFLOAT(m, f); m++; } if(s) x->x_selector = s; else if (1 == argc) x->x_selector = gensym("float"); else x->x_selector = gensym("list"); x->x_argc = argc; mtx_unop_bang(x); } static void mtx_unop_free(t_matrix_unop *x) { matrix_free(&x->m); } static void *mtx_unop_new(t_symbol*s, int argc, t_atom*argv) { /* element cos */ _unop_t *unop=iemmatrix_map_get(s_map, s); if(!unop) return 0; (void)argc;(void)argv; /* unused */ t_class*cls = unop->class; iemmatrix_unopfun_t *fun = unop->fun; if(!cls) { pd_error(0, "no class for '%s'", s->s_name); return 0; } if(!fun) { pd_error(0, "no function for '%s'", s->s_name); return 0; } t_matrix_unop *x = (t_matrix_unop *)pd_new(cls); x->fun = fun; outlet_new(&x->x_obj, 0); return(x); } void iemmatrix_unop_setup(const char*classname, const char*helpname, iemmatrix_unopfun_t*fun, ...) { if(!classname || !fun) return; t_class*cls; t_symbol*s = gensym(classname); va_list ap; _unop_t*unop = (_unop_t*)getbytes(sizeof(*unop)); cls = class_new(s, (t_newmethod)mtx_unop_new, (t_method)mtx_unop_free, sizeof(t_matrix_unop), 0, A_GIMME, A_NULL); class_addbang(cls, (t_method)mtx_unop_bang); class_addlist(cls, (t_method)mtx_unop_list); class_addmethod(cls, (t_method)mtx_unop_matrix, gensym("matrix"), A_GIMME, A_NULL); if(helpname) { t_symbol*help = gensym(helpname); if (help != s) class_sethelpsymbol(cls, help); } unop->class = cls; unop->fun = fun; s_map = iemmatrix_map_add(s_map, s, unop); va_start(ap, fun); while(1) { const char*alias = va_arg(ap, char*); if(!alias) break; s = gensym(alias); class_addcreator((t_newmethod)mtx_unop_new, s, A_GIMME, A_NULL); s_map = iemmatrix_map_add(s_map, s, unop); } va_end(ap); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/iemmatrix_utility.c000066400000000000000000000347061514557770000257510ustar00rootroot00000000000000/* * iemmatrix_utility * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ /* G.Holzmann: this has been in mtx_matrix.c before now here should be the shared code !!! */ #if defined _WIN32 # include # include # define snprintf _snprintf #else # define _GNU_SOURCE # include #endif #include #include "iemmatrix.h" /* utility functions */ void setdimen(t_matrix *m, int row, int col) { m->col = col; m->row = row; if(!m->atombuffer) { return; } SETFLOAT(m->atombuffer, row); SETFLOAT(m->atombuffer+1, col); } void adjustsize(void*x, t_matrix *m, int desiredRow, int desiredCol) { int col=m->col, row=m->row; if (desiredRow<1) { pd_error(x, "matrix: cannot make less than 1 rows"); desiredRow=1; } if (desiredCol<1) { pd_error(x, "matrix: cannot make less than 1 columns"); desiredCol=1; } if (col*row!=desiredRow*desiredCol) { if(m->atombuffer) { freebytes(m->atombuffer, (col*row+2)*sizeof(t_atom)); } m->atombuffer=(t_atom *)getbytes((desiredCol*desiredRow+2)*sizeof(t_atom)); } setdimen(m, desiredRow, desiredCol); return; } void printmatrix(void*x, const t_matrix*m) { logpost(x, PD_NORMAL, "matrix@%p [%dx%d] :: %p", m, m?m->row:0, m?m->col:0, m?(m->atombuffer+2):0); if(!m)return; const t_atom*a = m->atombuffer+2; for(int r=0; rrow; r++) { for(int c=0; ccol; c++) { startpost(" %+g", atom_getfloat(a++)); } endpost(); } } void debugmtx(int argc, t_float *buf, int id) { int i=argc; while(i--) { int j=argc; startpost("debug%d: ", id); while(j--) { startpost("%f ", *buf++); } endpost(); } } t_matrixfloat *matrix2float(t_atom *ap) { int row = atom_getfloat(ap++); int col = atom_getfloat(ap++); int length = row * col; t_matrixfloat *buffer = (t_matrixfloat *)getbytes(sizeof( t_matrixfloat)*length); t_matrixfloat *buf = buffer; while(length--) { *buf++=atom_getfloat(ap++); } return buffer; } void float2matrix(t_atom *ap, t_matrixfloat *buffer) { int row=atom_getfloat(ap++); int col=atom_getfloat(ap++); int length = row * col; t_matrixfloat*buf= buffer; while(length--) { SETFLOAT(ap, *buf++); ap++; } freebytes(buffer, row*col*sizeof(t_matrixfloat)); } /* core functions */ void matrix_bang(t_object *x, t_matrix *m) { /* output the matrix */ if (m->atombuffer) { outlet_anything(x->ob_outlet, gensym("matrix"), m->col*m->row+2, m->atombuffer); } } void matrix_matrix2(void *x, t_matrix *m, int argc, t_atom *argv) { int row, col; if(iemmatrix_check(x, 0, argc, argv, 0))return; row = atom_getfloat(argv); col = atom_getfloat(argv+1); /* this is fast and dirty, MAYBE make it slow and clean */ /* or, to clean matrices, use the mtx_check object */ if (row*col != m->row*m->col) { freebytes(m->atombuffer, m->row*m->col*sizeof(t_atom)); m->atombuffer = copybytes(argv, (row*col+2)*sizeof(t_atom)); } else { memcpy(m->atombuffer, argv, (row*col+2)*sizeof(t_atom)); } setdimen(m, row, col); } void matrixobj_bang(t_matrixobj*x) { matrix_bang(&x->x_obj, &x->m); } void matrixobj_matrix2(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_matrix2(&x->x_obj, &x->m, argc, argv); } void matrixobj_zeros(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_zeros(&x->x_obj, &x->m, argc, argv); } void matrixobj_ones(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_ones(&x->x_obj, &x->m, argc, argv); } void matrixobj_eye(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_eye(&x->x_obj, &x->m, argc, argv); } void matrixobj_egg(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_egg(&x->x_obj, &x->m, argc, argv); } void matrixobj_diag(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_diag(&x->x_obj, &x->m, argc, argv); } void matrixobj_diegg(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_diegg(&x->x_obj, &x->m, argc, argv); } void matrixobj_free(t_matrixobj *x) { matrix_free(&x->m); } /* set data */ void matrix_set(t_matrix *m, t_float f) { int size = m->col * m->row; t_atom *buf=m->atombuffer+2; if(m->atombuffer)while(size--) { SETFLOAT(&buf[size], f); } } void matrix_zeros(t_object *x, t_matrix *m, int argc, t_atom *argv) { int col, row; switch(argc) { case 0: /* zero out the actual matrix */ matrix_set(m, 0); break; case 1: row=atom_getfloat(argv); adjustsize(x, m, row, row); matrix_set(m, 0); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); adjustsize(x, m, row, col); matrix_set(m, 0); } matrix_bang(x, m); } void matrix_ones(t_object *x, t_matrix *m, int argc, t_atom *argv) { int col, row; switch(argc) { case 0: /* zero out the actual matrix */ matrix_set(m, 1); break; case 1: row=atom_getfloat(argv); adjustsize(x, m, row, row); matrix_set(m, 1); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); adjustsize(x, m, row, col); matrix_set(m, 1); } matrix_bang(x, m); } void matrix_eye(t_object *x, t_matrix *m, int argc, t_atom *argv) { int col, row; int n; switch(argc) { case 0: /* zero out the actual matrix */ matrix_set(m, 0); break; case 1: row=atom_getfloat(argv); adjustsize(x, m, row, row); matrix_set(m, 0); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); adjustsize(x, m, row, col); matrix_set(m, 0); } col=m->col; row=m->row; n = (colatombuffer+2+n*(1+col), 1); } matrix_bang(x, m); } void matrix_egg(t_object *x, t_matrix *m, int argc, t_atom *argv) { int col, row; int n; switch(argc) { case 0: /* zero out the actual matrix */ matrix_set(m, 0); break; case 1: row=atom_getfloat(argv); adjustsize(x, m, row, row); matrix_set(m, 0); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); adjustsize(x, m, row, col); matrix_set(m, 0); } col=m->col; row=m->row; n = (colatombuffer+2+(n+1)*(col-1), 1); } matrix_bang(x, m); } void matrix_diag(t_object *x, t_matrix *m, int argc, t_atom *argv) { int col=argc; argv+=argc-1; if (argc<1) { pd_error(x, "matrix: no diagonal present"); return; } adjustsize(x, m, argc, argc); matrix_set(m, 0); while(argc--) { SETFLOAT(m->atombuffer+2+argc*(1+col), atom_getfloat(argv--)); } matrix_bang(x, m); } void matrix_diegg(t_object *x, t_matrix*m, int argc, t_atom *argv) { int col=argc; argv+=argc-1; if (argc<1) { pd_error(x, "matrix: no dieggonal present"); return; } adjustsize(x, m, argc, argc); matrix_set(m, 0); while(argc--) { t_atom *ap=m->atombuffer+2+(argc+1)*(col-1); SETFLOAT(ap, atom_getfloat(argv--)); } matrix_bang(x, m); } /* destructor */ void matrix_free(t_matrix *m) { freebytes(m->atombuffer, (m->col*m->row+2)*sizeof(t_atom)); m->atombuffer=0; m->col=m->row=0; } /* some math */ /* invert a square matrix (row=col=rowcol) */ /* if "error" is non-NULL, it's content will be set to 0 if the matrix was invertable, else to non-0 */ t_matrixfloat* mtx_doInvert(t_matrixfloat*input, int rowcol, int*err) { /* * row==col==rowclo * input=t_matrixfloat[row*col] * output=t_matrixfloat[row*col] */ int i, k; t_matrixfloat *a1, *b1, *a2, *b2; int ok=0; /* error counter */ int col=rowcol, row=rowcol, row2=row*col; t_matrixfloat *original=input; t_matrixfloat *inverted = 0; if(input==0) { return 0; } /* 1a reserve space for the inverted matrix */ inverted=(t_matrixfloat *)getbytes(sizeof(t_matrixfloat)*row2); if(inverted==0) { return 0; } /* 1b make an eye-shaped float-buf for B */ i=row2; b1=inverted; while(i--) { *b1++=0; } i=row; b1=inverted; while(i--) { b1[i*(row+1)]=1; } /* 2. do the Gauss-Jordan */ for (k=0; kte_binbuf) { char buf[MAXPDSTRING]; t_symbol*objsym = atom_getsymbol(binbuf_getvec(x->te_binbuf)); if(snprintf(buf, MAXPDSTRING, "[%s]: ", objsym->s_name) > 0) { buf[MAXPDSTRING-1] = 0; s = gensym(buf); } } return s->s_name; } const char*iemmatrix_parentabstractionname(const t_glist*ccurrent) { #if IEMMATRIX_HAVE_G_CANVAS t_canvas *canvas = 0; t_glist*current = (t_glist*)ccurrent; if(0 == current) current = canvas_getcurrent(); canvas = glist_getcanvas(current); while(canvas && !canvas_isabstraction(canvas)) { canvas=canvas->gl_owner; } if(canvas && canvas->gl_name) { return canvas->gl_name->s_name; } #else (void)ccurrent; /* unused */ #endif /* IEMMATRIX_HAVE_G_CANVAS */ return 0; } int iemmatrix_check(void*object, t_symbol*s, int argc, t_atom*argv, unsigned int tests) { t_object*x = (t_object*)object; const char*objname=iemmatrix_objname(x); int row=(argc>1)?atom_getfloat(argv+0):0; int col=(argc>1)?atom_getfloat(argv+1):0; (void)s; /* unused */ if (!tests) tests = IEMMATRIX_CHECK_CRIPPLED | IEMMATRIX_CHECK_DIMENSIONS | IEMMATRIX_CHECK_SPARSE; if ((tests & IEMMATRIX_CHECK_CRIPPLED) && argc<2) { pd_error(x, "%scrippled matrix", objname); return 1; } if ((tests & IEMMATRIX_CHECK_DIMENSIONS) && ((col<1)||(row<1))) { pd_error(x, "%sinvalid dimensions %dx%d", objname, col, row); return 1; } if ((tests & IEMMATRIX_CHECK_SPARSE)&&(col*row>argc-2)) { pd_error(x, "%ssparse matrix not yet supported : use [mtx_check]", objname); return 1; } return 0; } void iemmatrix_floats2list(t_atom* dest, const t_float* src, size_t n) { for (; n--; src++, dest++) { SETFLOAT (dest, *src); } } void iemmatrix_floats2list_modulo(t_atom* dest, const t_float* src, size_t n, size_t m) { t_atom *ptr = dest; int count1, count2; n /= m; count1 = m; while (count1--) for (count2 = n, ptr = dest++; count2--; ptr += m, src++) { SETFLOAT(ptr, *src); } } void iemmatrix_list2floats(t_float* dest, const t_atom* src, size_t n) { while (n--) { *dest++ = atom_getfloat (src++); } } void iemmatrix_list2floats_modulo(t_float* dest, const t_atom* src, size_t n, size_t m) { const t_atom *ptr = src; size_t count1, count2; n /= m; count1 = m; while (count1--) for (count2 = n, ptr = src++; count2--; ptr += m, dest++) { *dest = atom_getfloat (ptr); } } unsigned int iemmatrix_atom_getuint(const t_atom*a) { t_float f = atom_getfloat(a); return (f>0)?(unsigned int)f:0; } int iemmatrix_atom_getint(const t_atom*a) { t_float f = atom_getfloat(a); return (int)f; } struct _iemmatrix_map { t_symbol*key; void*value; struct _iemmatrix_map*next; }; /* add a new element to the map (pass 'NULL' as to create a new one */ struct _iemmatrix_map*iemmatrix_map_add(struct _iemmatrix_map*map, t_symbol*key, void*value) { struct _iemmatrix_map*m = 0; for(m=map; m; m=m->next) { if(m->key == key) { /* m->value = value */ return map; } } m = getbytes(sizeof(*m)); m->key = key; m->value = value; m->next = map; return m; } void*iemmatrix_map_get(struct _iemmatrix_map*map, t_symbol*key) { while(map) { if (key == map->key) return map->value; map = map->next; } return 0; } /* free the map: free_callback() is called for each in the map */ void iemmatrix_map_free(struct _iemmatrix_map*map, void(*free_callback)(void*)) { struct _iemmatrix_map*m = 0; if(free_callback) { for(m = map; m; m=m->next) { free_callback(m->value); } } while(map) { m = map; map = map->next; m->key = 0; m->value = 0; m->next = 0; freebytes(m, sizeof(*m)); } } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/makefile_win000066400000000000000000000034311514557770000243670ustar00rootroot00000000000000 all: iemmatrix.dll CC = cl LD = link VIS_CPP_PATH = "C:\Programme\Microsoft Visual Studio\Vc98" PD_INST_PATH = C:\Programme\pd PD_WIN_INCLUDE_PATH = /I. /I"$(PD_INST_PATH)\src" PD_WIN_C_FLAGS = /nologo /W3 /WX /DPD /D__WIN32__ /Ox -DPA_LITTLE_ENDIAN PD_WIN_L_FLAGS = /nologo PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NODEFAULTLIB:uuid \ libc.lib \ /LIBPATH:$(PD_INST_PATH)\bin pd.lib SRC = mtx_powtodb.c \ mtx_dbtopow.c \ mtx_bspline.c \ mtx_atan.c \ mtx_not.c \ mtx_add.c \ mtx_and.c \ mtx_cos.c \ mtx_decay.c \ mtx_rowrfft.c \ mtx_conv.c \ mtx_diag.c \ mtx_colon.c \ mtx_check.c \ mtx_rowrifft.c \ mtx_col.c \ mtx_diff.c \ mtx_diegg.c \ mtx_distance2.c \ mtx_cholesky.c \ mtx_egg.c \ mtx_exp.c \ mtx_fill.c \ mtx_find.c \ mtx_bitright.c \ mtx_int.c \ mtx_bitand.c \ mtx_eq.c \ mtx_eye.c \ mtx_bitleft.c \ mtx_bitor.c \ mtx_inverse.c \ mtx_ge.c \ mtx_log.c \ mtx_matrix.c \ mtx_concat.c \ mtx_minmax.c \ mtx_dbtorms.c \ mtx_gt.c \ mtx_mul~.c \ mtx_prod.c \ mtx_element.c \ mtx_sin.c \ mtx_mean.c \ mtx_max2.c \ mtx_min2.c \ mtx_le.c \ mtx_lt.c \ mtx_resize.c \ mtx_or.c \ mtx_repmat.c \ mtx_neq.c \ mtx_sort.c \ mtx_ones.c \ mtx_pivot.c \ mtx_rmstodb.c \ mtx_sub.c \ mtx_pow.c \ mtx_slice.c \ mtx_sum.c \ mtx_print.c \ mtx_abs.c \ mtx_rand.c \ mtx_reverse.c \ mtx_roll.c \ mtx_binops.c \ mtx_row.c \ mtx_cumsum.c \ mtx_scroll.c \ mtx_gauss.c \ mtx_size.c \ mtx_index.c \ mtx_trace.c \ mtx_transpose.c \ mtx_zeros.c \ mtx_mul.c \ iemmatrix_sources.c \ iemmatrix.c OBJ = $(SRC:.c=.obj) .c.obj: $(CC) $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c iemmatrix.dll: $(OBJ) $(LD) $(PD_WIN_L_FLAGS) /dll /export:iemmatrix_setup \ /out:iemmatrix.dll $(OBJ) $(PD_WIN_LIB) clean: del *.obj iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/makesource.sh000077500000000000000000000016761514557770000245200ustar00rootroot00000000000000#!/bin/sh : "${SED:=sed}" source2setup() { # input: .c file # output: the entry-function within the .c file (if any) local f="$1" f="${f##*/}" f="${f%.c}" # filter out any files that have a '.' in the name (e.g. because they are not .c files) # or start with iemmatrix f=$(echo "$f" | "${SED}" -e 's/[^[:alnum:].]/_/g') test "$f" != "${f%.*}" || test "${f}" != "${f#iemmatrix}" || echo "ie${f}_setup" } make_boilerplate() { local s cat < #ifdef _WIN32 /* or should we use the security enhanced _snprintf_s() ?? */ # define snprintf _snprintf #endif /* -------------------- matrix ------------------------------ */ /* G.Holzmann: see iemmatrix_utility.c for the functions you don't find here ... ;) */ static t_class *matrix_class; static void matrix_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; matrix_matrix2(x, &x->m, argc, argv); matrixobj_bang(x); } static void matrix_float(t_matrixobj *x, t_float f) { matrix_set(&x->m, f); matrixobj_bang(x); } static void matrix_size(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int col, row; (void)s; /* unused */ switch(argc) { case 0: /* size */ if (x->m.row && x->m.col) { outlet_list(x->x_obj.ob_outlet, gensym("size"), 2, x->m.atombuffer); } break; case 1: row=atom_getfloat(argv); adjustsize(x, &x->m, row, row); matrix_set(&x->m, 0); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); adjustsize(x, &x->m, row, col); matrix_set(&x->m, 0); } } void matrix_element(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { t_matrix*m = &x->m; t_atom *ap=m->atombuffer+2; int row=m->row, col=m->col; int r, c, i=row*col; (void)s; /* unused */ switch (argc) { case 0: while(i--) { outlet_float(x->x_obj.ob_outlet, atom_getfloat(ap++)); } break; case 1: r=c=atom_getfloat(argv)-1; if ((r<0)||(r>=row)) { pd_error(x, "matrix: row index %d is out of range", r+1); return; } if ((c<0)||(c>=col)) { pd_error(x, "matrix: col index %d is out of range", c+1); return; } outlet_float(x->x_obj.ob_outlet, atom_getfloat(m->atombuffer+2+c+r*col)); break; case 2: r=atom_getfloat(argv++)-1; c=atom_getfloat(argv++)-1; if ((r<0)||(r>=row)) { pd_error(x, "matrix: row index %d is out of range", r+1); return; } if ((c<0)||(c>=col)) { pd_error(x, "matrix: col index %d is out of range", c+1); return; } outlet_float(x->x_obj.ob_outlet, atom_getfloat(m->atombuffer+2+c+r*col)); break; default: r=atom_getfloat(argv++)-1; c=atom_getfloat(argv++)-1; if ((r<0)||(r>=row)) { pd_error(x, "matrix: row index %d is out of range", r+1); return; } if ((c<0)||(c>=col)) { pd_error(x, "matrix: col index %d is out of range", c+1); return; } SETFLOAT(m->atombuffer+2+c+r*col, atom_getfloat(argv)); } } void matrix_row(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { t_matrix*m = &x->m; t_atom *ap; int row=m->row, col=m->col; int r, c; t_float f; (void)s; /* unused */ switch (argc) { case 0: /* row: get all rows as lists */ for (r=0; rx_obj.ob_outlet, gensym("row"), col, m->atombuffer+r*col+2); } break; case 1: /* row : get row as list */ r=atom_getfloat(argv)-1; if ((r<0)||(r>=row)) { pd_error(x, "matrix: row index %d is out of range", r+1); return; } outlet_list(x->x_obj.ob_outlet, gensym("row"), col, m->atombuffer+r*col+2); break; case 2: /* row : set all elements of row to */ r=atom_getfloat(argv)-1; f=atom_getfloat(argv+1); if ((r<0)||(r>=row)) { pd_error(x, "matrix: row index %d is out of range", r+1); return; } for(c=0; catombuffer+2+c+r*col, f); } break; default: /* row ...: set elements of row to ... */ r=atom_getfloat(argv++)-1; if (argc--=row)) { pd_error(x, "matrix: row index %d is out of range", r+1); return; } ap=m->atombuffer+2+col*r; memcpy(ap, argv, col*sizeof(t_atom)); break; } } void matrix_col(t_matrixobj*x, t_symbol *s, int argc, t_atom *argv) { t_matrix*m = &x->m; t_atom *ap; int row=m->row, col=m->col; int c, r; t_float f; (void)s; /* unused */ switch (argc) { case 0: /* col: get all cols as lists */ ap=(t_atom *)getbytes(row*sizeof(t_atom)); for (c=0; catombuffer+2+c+col*r)); } outlet_list(x->x_obj.ob_outlet, gensym("col"), row, ap); } freebytes(ap, row*sizeof(t_atom)); break; case 1: /* col : get col as list */ ap=(t_atom *)getbytes(row*sizeof(t_atom)); c=atom_getfloat(argv)-1; if ((c<0)||(c>=col)) { pd_error(x, "matrix: col index %d is out of range", c+1); return; } for (r=0; ratombuffer+2+c+col*r)); } outlet_list(x->x_obj.ob_outlet, gensym("col"), row, ap); freebytes(ap, row*sizeof(t_atom)); break; case 2: /* row : set all elements of row to */ c=atom_getint(argv)-1; f=atom_getfloat(argv+1); if ((c<0)||(c>=col)) { pd_error(x, "matrix: col index %d is out of range", c+1); return; } for(r=0; ratombuffer+2+c+r*col, f); } break; default: /* row ...: set elements of row to ... */ c=atom_getfloat(argv++)-1; if (argc--=col)) { pd_error(x, "matrix: col index %d is out of range", c+1); return; } argv+=argc-1; if (argc>row) { argc=row; } while(argc--) { ap=m->atombuffer+2+c+col*argc; SETFLOAT(ap, atom_getfloat(argv--)); } } } /* ------------- file I/O ------------------ */ static void matrix_read(t_matrixobj *x, t_symbol *filename) { t_binbuf *bbuf = binbuf_new(); t_atom *ap; int n; if (binbuf_read_via_path(bbuf, filename->s_name, canvas_getdir(x->x_canvas)->s_name, 0)) { pd_error(x,"[matrix]: failed to read '%s'", filename->s_name); } ap=binbuf_getvec(bbuf); n =binbuf_getnatom(bbuf)-1; if ((ap->a_type == A_SYMBOL) && (!strcmp(ap->a_w.w_symbol->s_name,"matrix") || !strcmp(ap->a_w.w_symbol->s_name,"#matrix")) ) { matrix_matrix2(x, &x->m, n, ap+1); } binbuf_free(bbuf); } static void matrix_write(t_matrixobj *x, t_symbol *filename) { t_atom *ap=x->m.atombuffer+2; char filnam[MAXPDSTRING]; int rows = x->m.row, cols = x->m.col; FILE *f=0; sys_bashfilename(filename->s_name, filnam); /* open file */ if (!(f = fopen(filnam, "w"))) { pd_error(x, "[matrix]: failed to open '%s'", filnam); } else { char *text=(char *)getbytes(sizeof(char)*MAXPDSTRING); int textlen; /* header: * we now write "#matrix" instead of "matrix", * so that these files can easily read by other * applications such as octave */ snprintf(text, MAXPDSTRING, "#matrix %d %d\n", rows, cols); text[MAXPDSTRING-1]=0; textlen = strlen(text); if (fwrite(text, textlen*sizeof(char), 1, f) < 1) { pd_error(x, "[matrix]: failed to write '%s'", filnam); goto end; } while(rows--) { int c = cols; while (c--) { t_float val = atom_getfloat(ap++); snprintf(text, MAXPDSTRING, "%.15f ", val); text[MAXPDSTRING-1]=0; textlen=strlen(text); if (fwrite(text, textlen*sizeof(char), 1, f) < 1) { pd_error(x, "[matrix]: failed to write '%s'", filnam); goto end; } } if (fwrite("\n", sizeof(char), 1, f) < 1) { pd_error(x, "[matrix]: failed to write '%s'", filnam); goto end; } } freebytes(text, sizeof(char)*MAXPDSTRING); } end: /* close file */ if (f) { fclose(f); } } static void matrix_list(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { /* like matrix, but without col/row information, so the previous size is kept */ int row=x->m.row, col=x->m.col; (void)s; /* unused */ if(!(row && col)) { pd_error(x, "[matrix]: unknown matrix dimensions"); return; } if (argcm.atombuffer+2, argv, row*col*sizeof(t_atom)); matrixobj_bang(x); } static void *matrix_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(matrix_class); int row, col; (void)s; /* unused */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym("")); outlet_new(&x->x_obj, 0); x->m.atombuffer = 0; x->x_canvas = canvas_getcurrent(); switch (argc) { case 0: row = col = 0; break; case 1: if (argv->a_type == A_SYMBOL) { matrix_read(x, argv->a_w.w_symbol); return(x); } row = col = atom_getfloat(argv); break; default: row = atom_getfloat(argv++); col = atom_getfloat(argv++); } if(row && col) { adjustsize(x, &x->m, row, col); matrix_set(&x->m, 0); } return (x); } static void _add_library_path(t_class*c); void matrix_setup(void) { matrix_class = class_new(gensym("matrix"), (t_newmethod)matrix_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addcreator((t_newmethod)matrix_new, gensym("mtx"), A_GIMME, 0); class_addcreator((t_newmethod)matrix_new, gensym("iemmatrix"), A_GIMME, 0); /* the core : functions for matrices */ class_addmethod (matrix_class, (t_method)matrix_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_matrix2, gensym(""), A_GIMME, 0); /* the basics : functions for creation */ class_addmethod (matrix_class, (t_method)matrix_size, gensym("size"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_eye, gensym("eye"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_diag, gensym("diag"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_ones, gensym("ones"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_zeros, gensym("zeros"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_egg, gensym("egg"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrixobj_diegg, gensym("diegg"), A_GIMME, 0); /* the rest : functions for anything */ class_addbang (matrix_class, matrixobj_bang); class_addfloat (matrix_class, matrix_float); class_addlist (matrix_class, matrix_list); class_addmethod (matrix_class, (t_method)matrix_row, gensym("row"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrix_col, gensym("column"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrix_col, gensym("col"), A_GIMME, 0); class_addmethod (matrix_class, (t_method)matrix_element, gensym("element"), A_GIMME, 0); /* the file functions */ class_addmethod (matrix_class, (t_method)matrix_write, gensym("write"), A_SYMBOL, 0); class_addmethod (matrix_class, (t_method)matrix_read , gensym("read") , A_SYMBOL, 0); _add_library_path(matrix_class); } void iemtx_matrix_setup(void) { matrix_setup(); } void mtx_matrix_setup(void) { matrix_setup(); } void iematrix_setup(void) { matrix_setup(); } /* iemmatrix setup helper */ /* urgh. as of Pd-0.56, the "add-to-path" message refuses un-encoded strings * (though there really is no reason that it should not accept them) */ static const char*_encodestring(const char*src, char*dest, const size_t len) { if(!dest || len==0)return 0; if(len<2) {dest[0] = 0; return dest;} char *d = dest; *d++ = '+'; for (const char*s = src; s && *s && (size_t)(d - dest) + 2 < len; ++s) { switch (*s) { default: *d++ = *s; break; case ' ': *d++ = '+'; *d++ = '_'; break; case '$': *d++ = '+'; *d++ = 'd'; break; case ';': *d++ = '+'; *d++ = 's'; break; case ',': *d++ = '+'; *d++ = 'c'; break; case '+': *d++ = '+'; *d++ = '+'; break; } } *d = 0; return dest; } static void _add_library_path(t_class*c) { const char*path = class_gethelpdir(c); char _path[MAXPDSTRING]; t_atom ap[2]; _encodestring(path, _path, sizeof(_path)); SETSYMBOL(ap+0, gensym(_path)); SETFLOAT (ap+1, -1); /* '-1' adds the path only temporarily */ t_symbol*recv = gensym("pd"); if(recv->s_thing) { pd_typedmess(recv->s_thing, gensym("add-to-path"), 2, ap); } } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_abs.c000066400000000000000000000012131514557770000236070ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_abs: B=abs(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return fabsf(f); #else return fabs(f); #endif } void mtx_abs_setup(void) { iemmatrix_unop_setup("mtx_abs", 0, unop, (char*)0); } void iemtx_abs_setup(void) { mtx_abs_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_add.c000066400000000000000000000011211514557770000235700ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1+f2; } void mtx_add_setup(void) { iemmatrix_binop_setup("mtx_add", 0, binop, "mtx_+", (char*)0); } void iemtx_add_setup(void) { mtx_add_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_and.c000066400000000000000000000012241514557770000236060ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { int i1 = (int)f1; int i2 = (int)f2; int i = i1 && i2; return (t_float)i; } void mtx_and_setup(void) { iemmatrix_binop_setup("mtx_and", 0, binop, "mtx_&&", (char*)0); } void iemtx_and_setup(void) { mtx_and_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_atan.c000066400000000000000000000012211514557770000237640ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_atan: B=atan(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return atanf(f); #else return atan(f); #endif } void mtx_atan_setup(void) { iemmatrix_unop_setup("mtx_atan", 0, unop, (char*)0); } void iemtx_atan_setup(void) { mtx_atan_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_atan2.c000066400000000000000000000012251514557770000240520ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { #if PD_FLOATSIZE == 32 return atan2f(f1, f2); #else return atan2(f1, f2); #endif } void mtx_atan2_setup(void) { iemmatrix_binop_setup("mtx_atan2", 0, binop, (char*)0); } void iemtx_atan2_setup(void) { mtx_atan2_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_bessel.c000066400000000000000000000116571514557770000243340ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * this functions depends on the GNU scientific library * * Copyright (c) 2009, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include #include #include "iemmatrix_stub.h" static t_class *mtx_bessel_class; static t_besselfn my_jn = 0; static t_besselfn my_yn = 0; typedef struct _MTXBessel_ MTXBessel; struct _MTXBessel_ { t_object x_obj; t_outlet *list_h_re_out; t_outlet *list_h_im_out; t_atom *list_h_re; t_atom *list_h_im; double *kr; double *h_re; double *h_im; size_t nmax; size_t l; }; static void allocMTXBesseldata (MTXBessel *x) { x->kr=(double*)calloc(x->l,sizeof(double)); if (x->list_h_re_out!=0) { x->list_h_re=(t_atom*)calloc(x->l*(x->nmax+1)+2,sizeof(t_atom)); x->h_re=(double*)calloc(x->l*(x->nmax+1),sizeof(double)); } if (x->list_h_im_out!=0) { x->list_h_im=(t_atom*)calloc(x->l*(x->nmax+1)+2,sizeof(t_atom)); x->h_im=(double*)calloc(x->l*(x->nmax+1),sizeof(double)); } } static void deleteMTXBesseldata (MTXBessel *x) { if (x->kr!=0) { free(x->kr); } if (x->h_re!=0) { free(x->h_re); } if (x->h_im!=0) { free(x->h_im); } if (x->list_h_re!=0) { free(x->list_h_re); } if (x->list_h_im!=0) { free(x->list_h_im); } x->list_h_re=0; x->list_h_im=0; x->h_re=0; x->h_im=0; x->kr=0; } static void *newMTXBessel (t_symbol *s, int argc, t_atom *argv) { int nmax; char whichfunction = 'j'; t_symbol *fsym = 0; MTXBessel *x = (MTXBessel *) pd_new (mtx_bessel_class); (void)s; /* unused */ x->list_h_re = 0; x->list_h_im = 0; x->list_h_im_out = 0; x->list_h_re_out = 0; x->kr = 0; x->h_re = 0; x->h_im = 0; x->l=0; if(argc) fsym=atom_getsymbol(argv); if (fsym && fsym->s_name!=0) { whichfunction=fsym->s_name[0]; } switch (whichfunction) { default: case 'J': case 'j': x->list_h_re_out = outlet_new (&x->x_obj, gensym("matrix")); break; case 'H': case 'h': x->list_h_re_out = outlet_new (&x->x_obj, gensym("matrix")); /* coverity[unterminated_case]: H has both real&imag outlet */ /* fall through */ case 'Y': case 'y': x->list_h_im_out = outlet_new (&x->x_obj, gensym("matrix")); } nmax=(int) atom_getfloatarg(1, argc, argv); if (nmax<0) { nmax=0; } x->nmax=nmax; return ((void *) x); } static void mTXBesselBang (MTXBessel *x) { if (x->list_h_im!=0) { outlet_anything(x->list_h_im_out, gensym("matrix"), x->l*(x->nmax+1)+2, x->list_h_im); } if (x->list_h_re!=0) { outlet_anything(x->list_h_re_out, gensym("matrix"), x->l*(x->nmax+1)+2, x->list_h_re); } } static void mTXBesselMatrix (MTXBessel *x, t_symbol *s, int argc, t_atom *argv) { size_t columns; size_t n, m; (void)s; /* unused */ /* size check */ if(iemmatrix_check(x, s, argc, argv, 0))return; argv++; /* rows */ columns = atom_getint (argv++); if(my_jn && my_yn) { if (x->l != columns) { deleteMTXBesseldata(x); x->l=columns; allocMTXBesseldata(x); } for (n=0; n < x->l; n++) { x->kr[n]=(double) atom_getfloat(argv+n); } if (x->h_re != 0) for (m=0; m < x->l; m++) for (n=0; n < x->nmax+1; n++) { x->h_re[n+m*(x->nmax+1)]=my_jn(n,x->kr[m]); } if (x->h_im != 0) for (m=0; m < x->l; m++) for (n=0; n < x->nmax+1; n++) { x->h_im[n+m*(x->nmax+1)]=my_yn(n,x->kr[m]); } if (x->h_re != 0) { SETFLOAT(x->list_h_re+1,(t_float)(x->nmax+1)); SETFLOAT(x->list_h_re,(t_float)x->l); for (n=0; n < x->l*(x->nmax+1); n++) { SETFLOAT(x->list_h_re+n+2,(t_float)x->h_re[n]); } } if (x->h_im != 0) { SETFLOAT(x->list_h_im+1,(t_float)(x->nmax+1)); SETFLOAT(x->list_h_im,(t_float)x->l); for (n=0; n < x->l*(x->nmax+1); n++) { SETFLOAT(x->list_h_im+n+2,(t_float)x->h_im[n]); } } mTXBesselBang(x); } else { pd_error(x, "[mtx_bessel]: implementation requires math.h that implements jn and yn Bessel functions or gsl_sf_bessel.h"); } } void mtx_bessel_setup (void) { mtx_bessel_class = class_new (gensym("mtx_bessel"), (t_newmethod) newMTXBessel, (t_method) deleteMTXBesseldata, sizeof (MTXBessel), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_bessel_class, (t_method) mTXBesselBang); class_addmethod (mtx_bessel_class, (t_method) mTXBesselMatrix, gensym("matrix"), A_GIMME,0); my_jn = iemmatrix_get_stub("jn", mtx_bessel_class); my_yn = iemmatrix_get_stub("yn", mtx_bessel_class); } void iemtx_bessel_setup(void) { mtx_bessel_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_bitand.c000066400000000000000000000012361514557770000243100ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { int i1 = (int)f1; int i2 = (int)f2; int i = i1 & i2; return (t_float)i; } void mtx_bitand_setup(void) { iemmatrix_binop_setup("mtx_bitand", 0, binop, "mtx_&", (char*)0); } void iemtx_bitand_setup(void) { mtx_bitand_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_bitleft.c000066400000000000000000000012441514557770000244770ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { int i1 = (int)f1; int i2 = (int)f2; int i = i1 << i2; return (t_float)i; } void mtx_bitleft_setup(void) { iemmatrix_binop_setup("mtx_bitleft", 0, binop, "mtx_<<", (char*)0); } void iemtx_bitleft_setup(void) { mtx_bitleft_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_bitor.c000066400000000000000000000012321514557770000241620ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { int i1 = (int)f1; int i2 = (int)f2; int i = i1 | i2; return (t_float)i; } void mtx_bitor_setup(void) { iemmatrix_binop_setup("mtx_bitor", 0, binop, "mtx_|", (char*)0); } void iemtx_bitor_setup(void) { mtx_bitor_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_bitright.c000066400000000000000000000012501514557770000246570ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { int i1 = (int)f1; int i2 = (int)f2; int i = i1 >> i2; return (t_float)i; } void mtx_bitright_setup(void) { iemmatrix_binop_setup("mtx_bitright", 0, binop, "mtx_>>", (char*)0); } void iemtx_bitright_setup(void) { mtx_bitright_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_bspline.c000066400000000000000000000135731514557770000245120ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_bspline: this is only in the iemmatrix library since i have to make sure that there is an x-value for each y-value; this however enforces that for each point we have to define a point in all dimensions; think: should we split this into 2 objects? - one for calculating the coefficients of the polynomial function for the bspline - another for calculating the value of a piecewise polyfuns */ static t_class *mtx_bspline_class; typedef struct _mtx_spline { t_object x_obj; t_outlet *x_outlet; int x_numpoints; int x_dimension; t_matrixfloat x_min, x_max; t_matrixfloat*x_x; t_matrixfloat**x_y, **x_u, **x_p; t_atom*x_result; } t_mtx_spline; static void mtx_bspline_resize(t_mtx_spline *x, int cols, int dim) { int size=x->x_numpoints*sizeof(t_matrixfloat); int i=0; if(x->x_x) { freebytes(x->x_x, size); } x->x_x=0; for(i=0; ix_dimension; i++) { if(x->x_y&&x->x_y[i]) { freebytes(x->x_y[i], size); x->x_y[i]=0; } if(x->x_u&&x->x_u[i]) { freebytes(x->x_u[i], size); x->x_u[i]=0; } if(x->x_p&&x->x_p[i]) { freebytes(x->x_p[i], size); x->x_p[i]=0; } } if(x->x_y) { freebytes(x->x_y, x->x_dimension*sizeof(t_matrixfloat*)); } x->x_y=0; if(x->x_u) { freebytes(x->x_u, x->x_dimension*sizeof(t_matrixfloat*)); } x->x_u=0; if(x->x_p) { freebytes(x->x_p, x->x_dimension*sizeof(t_matrixfloat*)); } x->x_p=0; if(x->x_result) { freebytes(x->x_result, x->x_dimension*sizeof(t_atom)); } x->x_p=0; if(dim<1) { dim=1; } if(cols<0) { cols=0; } x->x_numpoints = cols; x->x_dimension = dim; if(cols>0) { size=x->x_numpoints*sizeof(t_matrixfloat); x->x_x = (t_matrixfloat*)getbytes(size); x->x_result = (t_atom*)getbytes(x->x_dimension*sizeof(t_atom)); x->x_y = (t_matrixfloat**)getbytes(dim*sizeof(t_matrixfloat*)); x->x_u = (t_matrixfloat**)getbytes(dim*sizeof(t_matrixfloat*)); x->x_p = (t_matrixfloat**)getbytes(dim*sizeof(t_matrixfloat*)); for(i=0; ix_dimension; i++) { x->x_y[i] = (t_matrixfloat*)getbytes(size); x->x_u[i] = (t_matrixfloat*)getbytes(size); x->x_p[i] = (t_matrixfloat*)getbytes(size); } } } static void mtx_bspline_matrix2(t_mtx_spline *X, t_symbol *s, int argc, t_atom *argv) { int row=0; int col=0; t_matrixfloat *x, **y, **u, **p, *w, *d, *fp; t_matrixfloat*dummy; int i,j; int N; (void)s; /* unused */ if(iemmatrix_check(X, s, argc, argv, 0))return; row=atom_getfloat(argv); col=atom_getfloat(argv+1); col--; mtx_bspline_resize(X, row, col); /* 1st fill the matrix into the arrays */ fp=matrix2float(argv); dummy=fp; x=X->x_x; y=X->x_y; u=X->x_u; p=X->x_p; for(i=0; ix_min=x[0]; X->x_max=x[row-1]; w=(t_matrixfloat*)getbytes(X->x_numpoints*sizeof(t_matrixfloat)); d=(t_matrixfloat*)getbytes(X->x_numpoints*sizeof(t_matrixfloat)); N=row-1; for(j=0; j0; i--) { p[j][i] = (w[i]-u[j][i]*p[j][i+1])/d[i]; } } } #if 0 static void mtx_bspline_list(t_mtx_spline *x, t_symbol *s, int argc, t_atom *argv) { /* this should output a matrix, one row for each element of this list */ } #endif static void mtx_bspline_float(t_mtx_spline *X, t_float f) { int i=0, j=0; int dim=X->x_dimension; t_matrixfloat *x=X->x_x, **y=X->x_y, **u=X->x_u, **p=X->x_p; t_atom*result=X->x_result; if(dim<1) { outlet_float(X->x_outlet, 0.f); return; } if(fx_min) { f=X->x_min; } if(f>X->x_max) { f=X->x_max; } while(f>x[i+1]) { i++; } for(j=0; jx_outlet, 0, dim, result); } static void mtx_bspline_free(t_mtx_spline *x) { mtx_bspline_resize(x, 0, 0); } static void *mtx_bspline_new(void) { t_mtx_spline *x = (t_mtx_spline *)pd_new(mtx_bspline_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym("")); x->x_numpoints=0; x->x_dimension=0; x->x_min=0.0; x->x_max=0.0; x->x_x=0; x->x_y=x->x_u=x->x_p=0; x->x_result=0; x->x_outlet=outlet_new(&x->x_obj, 0); return(x); } void mtx_bspline_setup(void) { mtx_bspline_class = class_new(gensym("mtx_bspline"), (t_newmethod)mtx_bspline_new, (t_method)mtx_bspline_free, sizeof(t_mtx_spline), 0, A_NULL); /* class_addmethod(mtx_bspline_class, (t_method)mtx_bspline_matrix, gensym("list"), A_GIMME, 0); */ class_addmethod(mtx_bspline_class, (t_method)mtx_bspline_matrix2, gensym(""), A_GIMME, 0); class_addfloat (mtx_bspline_class, mtx_bspline_float); } void iemtx_bspline_setup(void) { mtx_bspline_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_check.c000066400000000000000000000034241514557770000241250ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_check */ static t_class *mtx_check_class; static void mtx_check_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); t_atom *ap; int length=row*col, n; (void)s; /* unused */ argc-=2; if(length>argc) { /* sparse matrix */ adjustsize(x, &x->m, row, col); matrix_set(&x->m, 0); argv+=2; ap=x->m.atombuffer+2; n=argc; while(n--) { t_float f = atom_getfloat(argv++); SETFLOAT(ap, f); ap++; } matrixobj_bang(x); } else { SETFLOAT(argv, row); SETFLOAT(argv+1, col); ap=argv+2; n=length; while(n--) { t_float f = atom_getfloat(ap); SETFLOAT(ap, f); ap++; } outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), length+2, argv); } } static void *mtx_check_new() { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_check_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_check_setup(void) { mtx_check_class = class_new(gensym("mtx_check"), (t_newmethod)mtx_check_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0); class_addbang (mtx_check_class, matrixobj_bang); class_addmethod(mtx_check_class, (t_method)mtx_check_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_check_setup(void) { mtx_check_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_cholesky.c000066400000000000000000000064521514557770000246750ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_cholesky */ /* * calculate the "Cholesky Decomposition" of a "symmetric and positive definite matrix " * no check is done, whether the input matrix is really symmetric and positive definite. */ static t_class *mtx_cholesky_class; static void mtx_cholesky_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { /* maybe we should do this in double or long double ? */ int row=atom_getint(argv); int col=atom_getint(argv+1); int i, j, k, row2=row*row; t_matrixfloat *original, *cholesky; (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; if (row!=col) { pd_error(x, "[mtx_cholesky]: only symmetric and positive definite matrices can be cholesky-decomposed"); return; } /* reserve memory for outputting afterwards */ adjustsize(x, &x->m, row, row); /* 1. get the 2 matrices : orig; invert (create as eye, but will be orig^(-1)) */ cholesky = (t_matrixfloat *)getbytes(sizeof(t_matrixfloat)*row2); /* 1a extract values of A to float-buf */ original=matrix2float(argv); /* 2 set the cholesky matrix to zero */ for(i=0; im.atombuffer, cholesky); /* 4b destroy the buffers */ freebytes(original, sizeof(t_matrixfloat)*row2); /* 4c output the atombuf; */ matrixobj_bang(x); } static void *mtx_cholesky_new() { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_cholesky_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_cholesky_setup(void) { mtx_cholesky_class = class_new(gensym("mtx_cholesky"), (t_newmethod)mtx_cholesky_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0); class_addbang (mtx_cholesky_class, matrixobj_bang); class_addmethod(mtx_cholesky_class, (t_method)mtx_cholesky_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_cholesky_setup(void) { mtx_cholesky_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_col.c000066400000000000000000000067601514557770000236330ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_col */ static t_class *mtx_col_class; static void mtx_col_float(t_matrixobj *x, t_floatarg f) { int i = f; if(i<0) { i=0; } x->current_col = i; } static void mtx_col_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; matrix_matrix2(x, &x->m, argc, argv); matrixobj_bang(x); } static void mtx_col_list(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ if (argc==1) { t_float f=atom_getfloat(argv); t_atom *ap=x->m.atombuffer+1+x->current_col; if (x->current_col>x->m.col) { pd_error(x, "[mtx_col]: too high a column is to be set"); return; } if (x->current_col) { int n=x->m.row; while(n--) { SETFLOAT(ap, f); ap+=x->m.row+1; } } matrixobj_bang(x); return; } if (argcm.row) { pd_error(x, "[mtx_col]: column length is too small for %dx%d-matrix", x->m.row, x->m.col); return; } if (x->current_col>x->m.col) { pd_error(x, "[mtx_col]: too high a column is to be set"); return; } if(x->current_col) { int r=x->m.row; t_atom *ap=x->m.atombuffer+1+x->current_col; while(r--) { SETFLOAT(&ap[(x->m.row-r-1)*x->m.col], atom_getfloat(argv++)); } } else { int r=x->m.row; t_atom *ap=x->m.atombuffer+2; while (r--) { t_float f=atom_getfloat(argv++); int c=x->m.col; while(c--) { SETFLOAT(ap, f); ap++; } } } matrixobj_bang(x); } static void *mtx_col_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_col_class); int i, j, q; (void)s; /* unused */ outlet_new(&x->x_obj, 0); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); x->current_col=0; x->m.col=x->m.row=0; x->m.atombuffer=0; switch (argc) { case 0: break; case 1: i = atom_getfloat(argv); if (i<0) { i=0; } if(i) { adjustsize(x, &x->m, i, i); } matrix_set(&x->m, 0); break; case 2: i = atom_getfloat(argv++); if(i<0) { i=0; } j = atom_getfloat(argv++); if(j<0) { j=0; } if(i && j) { adjustsize(x, &x->m, i, j); } matrix_set(&x->m, 0); break; default: i = atom_getfloat(argv++); if(i<0) { i=0; } j = atom_getfloat(argv++); if(j<0) { j=0; } q = atom_getfloat(argv++); if(q<0) { q=0; } if(i && j) { adjustsize(x, &x->m, i, j); } matrix_set(&x->m, 0); x->current_col=q; } return (x); } void mtx_col_setup(void) { mtx_col_class = class_new(gensym("mtx_col"), (t_newmethod)mtx_col_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addbang (mtx_col_class, matrixobj_bang); class_addlist (mtx_col_class, mtx_col_list); class_addmethod(mtx_col_class, (t_method)mtx_col_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(mtx_col_class, (t_method)mtx_col_float, gensym(""), A_FLOAT, 0); } void iemtx_col_setup(void) { mtx_col_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_colon.c000066400000000000000000000102001514557770000241500ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_colon_class; typedef struct _MTXColon_ MTXColon; struct _MTXColon_ { t_object x_obj; int size; t_atom *list_out; t_outlet *list_outlet; }; static void deleteMTXColon (MTXColon *mtx_colon_obj) { if (mtx_colon_obj->list_out) { freebytes (mtx_colon_obj->list_out, sizeof(t_atom)*(mtx_colon_obj->size+2)); } } static void *newMTXColon () { MTXColon *mtx_colon_obj = (MTXColon *) pd_new (mtx_colon_class); mtx_colon_obj->list_outlet = outlet_new (&mtx_colon_obj->x_obj, gensym("matrix")); return ((void *) mtx_colon_obj); } static void mTXColonBang (MTXColon *mtx_colon_obj) { if (mtx_colon_obj->list_out) outlet_anything(mtx_colon_obj->list_outlet, gensym("matrix"), mtx_colon_obj->size+2, mtx_colon_obj->list_out); } static void mTXColonList (MTXColon *mtx_colon_obj, t_symbol *s, int argc, t_atom *argv) { int size; t_float startval; t_float stopval; t_float step; t_atom *list_out = mtx_colon_obj->list_out; (void)s; /* unused */ if (argc == 3) { startval = atom_getfloat(argv++); step = atom_getfloat(argv++); stopval = atom_getfloat(argv++); } else if (argc == 2) { startval = atom_getfloat(argv++); stopval = atom_getfloat(argv++); step = 1.0f; } else { pd_error(mtx_colon_obj, "[mtx_colon]: wrong number of input arguments"); return; } size = (int)((stopval- startval + step) / step); if (size) { if (size!=mtx_colon_obj->size) { if (list_out) list_out = (t_atom *) resizebytes (list_out, sizeof(t_atom)*(mtx_colon_obj->size+2), sizeof(t_atom)*(size+2)); else { list_out = (t_atom*) getbytes (sizeof(t_atom)*(size+2)); } mtx_colon_obj->size = size; } mtx_colon_obj->list_out = list_out; SETFLOAT (&list_out[0],1.0f); SETFLOAT (&list_out[1],(t_float)size); list_out += 2; for (; size--; list_out++,startval+=step) { SETFLOAT(list_out,startval); } mTXColonBang (mtx_colon_obj); } } static void mTXColonMtx (MTXColon *mtx_colon_obj, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; t_atom *list_ptr = argv+2; t_atom *list_out = mtx_colon_obj->list_out; (void)s; /* unused */ if(iemmatrix_check(mtx_colon_obj, s, argc, argv, 0))return; rows = atom_getint (argv+0); columns = atom_getint (argv+1); size = rows * columns; if (!list_out) { list_out = (t_atom*) getbytes (sizeof (t_atom) * (size+2)); } else if (size != mtx_colon_obj->size) { list_out = (t_atom*) resizebytes (list_out, sizeof (t_atom) * (mtx_colon_obj->size+2), sizeof (t_atom) * (size+2)); } mtx_colon_obj->list_out = list_out; mtx_colon_obj->size = size; list_out+=2; while (size--) { *list_out++ = *list_ptr++; } list_out = mtx_colon_obj->list_out; size = mtx_colon_obj->size; SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, 1); SETFLOAT(&list_out[1], size); mTXColonBang (mtx_colon_obj); } void mtx_colon_setup (void) { mtx_colon_class = class_new (gensym("mtx_colon"), (t_newmethod) newMTXColon, (t_method) deleteMTXColon, sizeof (MTXColon), CLASS_DEFAULT, 0); class_addbang (mtx_colon_class, (t_method) mTXColonBang); class_addmethod (mtx_colon_class, (t_method) mTXColonMtx, gensym("matrix"), A_GIMME, 0); class_addlist (mtx_colon_class, (t_method) mTXColonList); class_addcreator ((t_newmethod) newMTXColon, gensym("mtx_:"), A_GIMME, 0); } void iemtx_colon_setup(void) { mtx_colon_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_concat.c000066400000000000000000000125201514557770000243140ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_concat_class; static t_symbol *row_sym; typedef struct _MTXconcat_ MTXconcat; struct _MTXconcat_ { t_object x_obj; int size; int concat_mode; t_matrix mtx_in1; t_matrix mtx_in2; t_matrix mtx_out; t_outlet *outl; }; static void deleteMTXConcat (MTXconcat *mtx_concat_obj) { matrix_free(&mtx_concat_obj->mtx_in2); matrix_free(&mtx_concat_obj->mtx_out); } static void mTXSetConcatMode (MTXconcat *mtx_concat_obj, t_symbol *c_mode) { char c=*c_mode->s_name; switch(c) { case 'c': case 'C': case ':': /* "column" */ mtx_concat_obj->concat_mode = 1; break; case 'r': case 'R': /* "row" */ mtx_concat_obj->concat_mode = 0; break; default: pd_error(mtx_concat_obj, "mtx_concat: invalid mode '%s'", c_mode->s_name); break; } } static void *newMTXConcat (t_symbol *s, int argc, t_atom *argv) { MTXconcat *mtx_concat_obj = (MTXconcat *) pd_new (mtx_concat_class); (void)s; /* unused */ if(argc&&(A_SYMBOL==argv->a_type)) { mTXSetConcatMode (mtx_concat_obj, atom_getsymbol (argv)); } else { mTXSetConcatMode (mtx_concat_obj, gensym(":")); } mtx_concat_obj->outl = outlet_new ( &mtx_concat_obj->x_obj, gensym("matrix")); inlet_new(&mtx_concat_obj->x_obj, &mtx_concat_obj->x_obj.ob_pd, gensym("matrix"),gensym("")); return ((void *) mtx_concat_obj); } static void mTXConcatBang (MTXconcat *mtx_concat_obj) { outlet_anything(mtx_concat_obj->outl, gensym("matrix"), mtx_concat_obj->mtx_out.row * mtx_concat_obj->mtx_out.col + 2, mtx_concat_obj->mtx_out.atombuffer); } static void mTXConcatMatrix2 (MTXconcat *mtx_concat_obj, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_matrix2 (mtx_concat_obj, &mtx_concat_obj->mtx_in2, argc, argv); } static void mTXConcatDoRowConcatenation (MTXconcat *mtx_concat_obj, t_matrix *mtx1, t_matrix *mtx2, t_matrix *mtx_out) { int mcols = mtx1->col + mtx2->col; int cnt; t_atom *ptr_in1 = mtx1->atombuffer+2; t_atom *ptr_in2 = mtx2->atombuffer+2; t_atom *ptr_out; if (mtx1->row != mtx2->row) { pd_error(mtx_concat_obj, "[mtx_concat]: row-mode: matrices must have same number of rows!"); return; } adjustsize (mtx_concat_obj, mtx_out, mtx1->row, mcols); ptr_out = mtx_out->atombuffer+2; for (cnt=mtx1->row; cnt--; ptr_in1 += mtx1->col, ptr_in2 += mtx2->col, ptr_out += mtx_out->col) { memcpy (ptr_out, ptr_in1, mtx1->col * sizeof(t_atom)); memcpy (ptr_out+mtx1->col, ptr_in2, mtx2->col * sizeof(t_atom)); } mTXConcatBang(mtx_concat_obj); } static void mTXConcatDoColConcatenation (MTXconcat *mtx_concat_obj, t_matrix *mtx1, t_matrix *mtx2, t_matrix *mtx_out) { int mrows = mtx1->row + mtx2->row; int cnt; t_atom *ptr_in1 = mtx1->atombuffer+2; t_atom *ptr_in2 = mtx2->atombuffer+2; t_atom *ptr_out; if (mtx1->col != mtx2->col) { pd_error(mtx_concat_obj, "[mtx_concat]: col-mode: matrices must have same number of columns!"); return; } adjustsize (mtx_concat_obj, mtx_out, mrows, mtx1->col); ptr_out = mtx_out->atombuffer+2; for (cnt=mtx1->row; cnt--; ptr_in1 += mtx1->col, ptr_out += mtx_out->col) { memcpy (ptr_out, ptr_in1, mtx1->col * sizeof(t_atom)); } for (cnt=mtx2->row; cnt--; ptr_in2 += mtx2->col, ptr_out += mtx_out->col) { memcpy (ptr_out, ptr_in2, mtx2->col * sizeof(t_atom)); } mTXConcatBang(mtx_concat_obj); } static void mTXConcatMatrix (MTXconcat *mtx_concat_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv); int columns = atom_getint (argv+1); t_matrix *mtx_in1 = &mtx_concat_obj->mtx_in1; t_matrix *mtx_in2 = &mtx_concat_obj->mtx_in2; t_matrix *mtx_out = &mtx_concat_obj->mtx_out; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_concat_obj, s, argc, argv, 0))return; mtx_in1->row = rows; mtx_in1->col = columns; mtx_in1->atombuffer = argv; /* alternatively to the above: */ /* matrix_matrix2 (mtx_in1, s, argc, argv); */ if (mtx_concat_obj->concat_mode == 0) { mTXConcatDoRowConcatenation(mtx_concat_obj, mtx_in1, mtx_in2, mtx_out); } else { mTXConcatDoColConcatenation(mtx_concat_obj, mtx_in1, mtx_in2, mtx_out); } } void mtx_concat_setup (void) { mtx_concat_class = class_new (gensym("mtx_concat"), (t_newmethod) newMTXConcat, (t_method) deleteMTXConcat, sizeof (MTXconcat), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_concat_class, (t_method) mTXConcatBang); class_addmethod (mtx_concat_class, (t_method) mTXConcatMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_concat_class, (t_method) mTXConcatMatrix2, gensym(""), A_GIMME,0); class_addmethod (mtx_concat_class, (t_method) mTXSetConcatMode, gensym("mode"), A_DEFSYMBOL,0); row_sym = gensym("row"); } void iemtx_concat_setup(void) { mtx_concat_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_conv.c000066400000000000000000000210271514557770000240140ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include static t_class *mtx_conv_class; typedef struct _MTXConv_ MTXConv; struct _MTXConv_ { t_object x_obj; int size; int rows; int columns; int rows_k; int columns_k; int size_k; int rows_y; int columns_y; int size_y; t_float **x; t_float *x_array; t_float **k; t_float *k_array; t_float **y; t_float *y_array; t_outlet *list_outlet; t_atom *list; }; static void getTFloatMatrix (int rows, int columns, t_float ***mtx, t_float **array) { int size = rows*columns; t_float *ptr; t_float **dptr; if (!size) { return; } if ((*array=ptr=(t_float *)calloc(size, sizeof(t_float)))) { if ((*mtx=dptr=(t_float **)calloc(rows, sizeof(t_float *)))) { for(; rows-- ; ptr+=columns) { *dptr++ = ptr; } } else { free (*array); array=0; } } } static void deleteTFloatMatrix (int rows, int columns, t_float ***mtx, t_float **myarray) { (void)rows; (void)columns; if (*mtx) { free (*mtx); } if (*myarray) { free (*myarray); } *mtx=0; *myarray=0; } static void deleteMTXConv (MTXConv *mtx_conv_obj) { deleteTFloatMatrix (mtx_conv_obj->rows_k, mtx_conv_obj->columns_k, &mtx_conv_obj->k, &mtx_conv_obj->k_array); deleteTFloatMatrix (mtx_conv_obj->rows, mtx_conv_obj->columns, &mtx_conv_obj->x, &mtx_conv_obj->x_array); deleteTFloatMatrix (mtx_conv_obj->rows_y, mtx_conv_obj->columns_y, &mtx_conv_obj->y, &mtx_conv_obj->y_array); if (mtx_conv_obj->list) { free (mtx_conv_obj->list); } mtx_conv_obj->list = 0; } static void *newMTXConv () { MTXConv *mtx_conv_obj = (MTXConv *) pd_new (mtx_conv_class); mtx_conv_obj->list_outlet = outlet_new (&mtx_conv_obj->x_obj, gensym("matrix")); inlet_new(&mtx_conv_obj->x_obj, &mtx_conv_obj->x_obj.ob_pd, gensym("matrix"),gensym("")); mtx_conv_obj->size = 0; mtx_conv_obj->rows = 0; mtx_conv_obj->columns = 0; mtx_conv_obj->size_y = 0; mtx_conv_obj->rows_y = 0; mtx_conv_obj->columns_y = 0; mtx_conv_obj->size_k = 0; mtx_conv_obj->rows_k = 0; mtx_conv_obj->columns_k = 0; return ((void *) mtx_conv_obj); } static void mTXConvBang (MTXConv *mtx_conv_obj) { if (mtx_conv_obj->list) { outlet_anything(mtx_conv_obj->list_outlet, gensym("matrix"), mtx_conv_obj->size+2, mtx_conv_obj->list); } } static void zeroFloatArray (int n, t_float *f) { while (n--) { *f++ = 0.0f; } } static void zeroTFloatMatrix (t_float **mtx, int rows, int columns) { while (rows--) { zeroFloatArray (columns, *mtx++); } } static void readMatrixFromList (int rows, int columns, t_atom *l, t_float **mtx) { int n,m; for (n=0; nrows_k) || (columns_k != mtx_conv_obj->columns_k)) { if (mtx_conv_obj->k) deleteTFloatMatrix (mtx_conv_obj->rows_k, mtx_conv_obj->columns_k, &mtx_conv_obj->k, &mtx_conv_obj->k_array); getTFloatMatrix (rows_k, columns_k, &mtx_conv_obj->k, &mtx_conv_obj->k_array); if ((!mtx_conv_obj->k)||(!mtx_conv_obj->k_array)) { pd_error(mtx_conv_obj, "[mtx_conv]: memory allocation failed!"); return; } mtx_conv_obj->rows_k = rows_k; mtx_conv_obj->columns_k = columns_k; mtx_conv_obj->size_k = size_k; } readMatrixFromList (rows_k, columns_k, argv, mtx_conv_obj->k); } static void convolveMtx (int rows, int columns, int rows_h, int columns_h, t_float **x, t_float **h, t_float **y) { int n,m,k,l; int rows_y=rows+rows_h-1; int cols_y=columns+columns_h-1; int n_max, m_max; zeroTFloatMatrix (y, rows_y, cols_y); for (k=0; krows_k; int columns_k = mtx_conv_obj->columns_k; int size_k = mtx_conv_obj->size_k; int in_size = argc-2; int rows_y; int columns_y; int size_y = mtx_conv_obj->size_y; t_atom *list_ptr = mtx_conv_obj->list; (void)s; /* unused */ /* fftsize check */ if (!size) { pd_error(mtx_conv_obj, "[mtx_conv]: invalid dimensions"); return; } else if (in_sizerows != rows)||(mtx_conv_obj->columns != columns)) { if (mtx_conv_obj->x) deleteTFloatMatrix (mtx_conv_obj->rows, mtx_conv_obj->columns, &mtx_conv_obj->x, &mtx_conv_obj->x_array); getTFloatMatrix (rows, columns, &mtx_conv_obj->x, &mtx_conv_obj->x_array); if ((!mtx_conv_obj->x)||(!mtx_conv_obj->x_array)) { pd_error(mtx_conv_obj, "[mtx_conv]: memory allocation failed!"); return; } mtx_conv_obj->size = size; mtx_conv_obj->rows = rows; mtx_conv_obj->columns = columns; } rows_y = rows+rows_k-1; columns_y = columns+columns_k-1; if ((mtx_conv_obj->rows_y != rows_y) ||(mtx_conv_obj->columns_y != columns_y)) { size_y = rows_y * columns_y; if (mtx_conv_obj->y) deleteTFloatMatrix (mtx_conv_obj->rows_y, mtx_conv_obj->columns_y, &mtx_conv_obj->y, &mtx_conv_obj->y_array); getTFloatMatrix (rows_y, columns_y, &mtx_conv_obj->y, &mtx_conv_obj->y_array); if ((!mtx_conv_obj->y)||(!mtx_conv_obj->y_array)) { pd_error(mtx_conv_obj, "[mtx_conv]: memory allocation failed!"); return; } mtx_conv_obj->size_y = size_y; mtx_conv_obj->rows_y = rows_y; mtx_conv_obj->columns_y = columns_y; if (list_ptr) { list_ptr = (t_atom *) realloc (list_ptr, sizeof (t_atom) * (size_y+2)); } else { list_ptr = (t_atom *) calloc (size_y+2, sizeof (t_atom)); } mtx_conv_obj->list = list_ptr; if (!list_ptr) { pd_error(mtx_conv_obj, "[mtx_conv]: memory allocation failed!"); return; } } /* main part */ readMatrixFromList (rows, columns, argv, mtx_conv_obj->x); convolveMtx (rows, columns, rows_k, columns_k, mtx_conv_obj->x, mtx_conv_obj->k, mtx_conv_obj->y); writeMatrixIntoList (rows_y, columns_y, list_ptr+2, mtx_conv_obj->y); SETSYMBOL(list_ptr, gensym("matrix")); SETFLOAT(list_ptr, rows_y); SETFLOAT(&list_ptr[1], columns_y); outlet_anything(mtx_conv_obj->list_outlet, gensym("matrix"), size_y+2, list_ptr); } void mtx_conv_setup (void) { mtx_conv_class = class_new (gensym("mtx_conv"), (t_newmethod) newMTXConv, (t_method) deleteMTXConv, sizeof (MTXConv), CLASS_DEFAULT, 0); class_addbang (mtx_conv_class, (t_method) mTXConvBang); class_addmethod (mtx_conv_class, (t_method) mTXConvMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_conv_class, (t_method) mTXConvKernelMatrix, gensym(""), A_GIMME,0); } void iemtx_conv_setup(void) { mtx_conv_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver/000077500000000000000000000000001514557770000247165ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver/LICENSE.txt000066400000000000000000000021271514557770000265430ustar00rootroot00000000000000MIT License Copyright (c) 2024, 2025, Franz Zotter, Sourena Mosleh, Hannes Pescoller. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver/array.c000066400000000000000000000321301514557770000261770ustar00rootroot00000000000000/* Authors: Sourena Mosleh Franz Zotter For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "LICENSE.txt," in this distribution. Email-address: sourena.mosleh@student.kug.ac.at zotter@iem.at Institute of Electronic Music and Acoustics (IEM) University of Music and Performing Arts Graz 2024 */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* HAVE_CONFIG_H */ #include "array.h" #include #include #include #include #include /* HELPER FUNCTIONS, GENERATION, COPYING, RESETTING */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(cos2win) (t_float* w, int len){ t_float a=M_PI/(2*(len)); for(int n=0; n #include #include #define IEMCONVOLVE(x) mtxconv_##x /* HELPER FUNCTIONS, GENERATION, COPYING, RESETTING */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(cos2win) (t_float* w, int len); void IEMCONVOLVE(sin2win) (t_float* w, int len); void IEMCONVOLVE(coswin) (t_float* w, int len); void IEMCONVOLVE(sinwin) (t_float* w, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(addArray) (const t_float*array1, const t_float*array2, int len, t_float * result); t_float IEMCONVOLVE(squaredArray) (const t_float* array, int len); t_float IEMCONVOLVE(squared2DArray) (const t_float **x, int len1, int len2); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(resetArray) (t_float *in, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(reset2DArray) (t_float **in, int len1, int len2); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(reset3DArray) (t_float ***in, int len1, int len2, int len3); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(unit_impulse) (t_float *x, int len, int n); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(unitImpulse2D) (t_float **x, int len1, int len2, int k, int n); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(unitImpulse3D) (t_float ***x, int len1, int len2, int len3, int m, int n, int o); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(Rectangle2D) (t_float **x, int len1, int len2, int k); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(OneImpulse3D) (t_float ***x, int len1, int len2, int len3, int m, int n); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(copyComplexArray) (const t_complex *src, t_complex *dst, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(copyArray) (const t_float *src, t_float *dst, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(copy2DArray) (const t_float **src, t_float **dst, int channels, int src_offset, int dst_offset, int len); void IEMCONVOLVE(copyExcerpt) (const t_float *src, t_float *dst, int src_offset, int dst_offset, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(copyArrayWithGain) (const t_float *src, t_float *dst, int len, t_float gain); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(resetComplexArray) (t_complex *in, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(reset2DComplexArray) (t_complex **in, int len1, int len2); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(reset3DComplexArray) (t_complex ***in, int len1, int len2, int len3); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(reset4DComplexArray) (t_complex ****in, int len1, int len2, int len3, int len4); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(reset5DComplexArray) (t_complex *****in, int len1, int len2, int len3, int len4, int len5); /* COMPLEX MULTIPLY ACCUMULATE */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(freq_mul_acc) (const t_complex *array1, const t_complex *array2, t_complex *result, int len); /* PRINTING AND ERROR COMPUTATION TO DEBUG */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(print_signal ) (const t_float* in, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(print2DSignal ) (const t_float** in, int len1, int len2); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(print_complex_signal ) (const t_complex* in, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ t_float IEMCONVOLVE(squared_error) (const t_float *x, const t_float *y, int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ t_float IEMCONVOLVE(squared2DError) (const t_float **x, const t_float **y, int len1, int len2); /*MEMORY MANAGEMENT FUNCTIONS*/ /*allocate memory*/ /*complex arrays*/ /*-----------------------------------------------------------------------------------------------------------------------------*/ t_complex* IEMCONVOLVE(new1DComplexArray) (int I); t_complex** IEMCONVOLVE(new2DComplexArray) (int I,int J); t_complex*** IEMCONVOLVE(new3DComplexArray) (int I,int J,int K); t_complex**** IEMCONVOLVE(new4DComplexArray) (int I,int J,int K,int L); t_complex***** IEMCONVOLVE(new5DComplexArray) (int I,int J,int K,int L, int M); /*t_float arrays*/ /*-----------------------------------------------------------------------------------------------------------------------------*/ t_float* IEMCONVOLVE(new1DArray) (int I); t_float** IEMCONVOLVE(new2DArray) (int I,int J); t_float*** IEMCONVOLVE(new3DArray) (int I,int J,int K); t_float**** IEMCONVOLVE(new4DArray) (int I,int J,int K,int L); /*free memory*/ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(free1DComplexArray) (t_complex* x); void IEMCONVOLVE(free2DComplexArray) (t_complex** x, int I); void IEMCONVOLVE(free3DComplexArray) (t_complex*** x, int I,int J); void IEMCONVOLVE(free4DComplexArray) (t_complex**** x, int I,int J,int K); void IEMCONVOLVE(free5DComplexArray) (t_complex***** x, int I,int J,int K,int L); void IEMCONVOLVE(free1DArray) (t_float* x); void IEMCONVOLVE(free2DArray) (t_float** x, int I); void IEMCONVOLVE(free3DArray) (t_float*** x, int I, int J); #endif /* _mtx_convolver_array_h */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver/convolver.c000066400000000000000000000300721514557770000271010ustar00rootroot00000000000000/* Uniformly Partitioned, Time-Variant, Multichannel-Input-Mulichannel-Output Block Convolution (and because signal processing folks like incomprehensible abbreviations: UPTVMIMOBC, yeah!) useful for all kinds of real-time processes virtual acoustic reality, 6dof spatial audio rendering/auralization, convolution reverb, Ambisonic decoding to headphones (binaural), Ambisonic encoding of compact spherical microphone arrays Ambisonic decoding to compact spherical loudspeaker arrays Wave-Field Synthesis processing, dynamic Binaural rendering, Beamforming with loudspeaker or micrphone arrays, adaptive signal processing, frequency response equalization, ... For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "LICENSE.txt," in this distribution. Franz Zotter Hannes Pescoller Sourena Mosleh Email-address: zotter@iem.at h.pescoller@kug.ac.at sourena.mosleh@student.kug.ac.at Institute of Electronic Music and Acoustics (IEM) University of Music and Performing Arts Graz 2024, 2025 */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* HAVE_CONFIG_H */ #include "convolver.h" #include #include #include #include #include "m_pd.h" /* crossfade functions */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(crossFade) (t_float *y, t_float *y_new, t_float *w_old, t_float *w_new, unsigned int len) { for (unsigned int n = 0; n < len; n++) y[n] = y[n] * w_old[n] + y_new[n] * w_new[n]; } /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(registerCrossFade) (conv_data *conv) { conv->register_crossfade = 1; } void IEMCONVOLVE(registerCrossFadeComplete) (conv_data *conv) { conv->register_crossfade = 0; } /*-----------------------------------------------------------------------------------------------------------------------------*/ _Bool IEMCONVOLVE(wasCrossFadeRegistered)(conv_data *conv) { return conv->register_crossfade; } /*-----------------------------------------------------------------------------------------------------------------------------*/ /* PARTITIONED CONVOLUTION CORE */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(convProcess) (conv_data *conv, t_float **in, t_float **out) { for (unsigned int in_ch = 0; in_ch < conv->num_inputs; in_ch++) { IEMCONVOLVE(copyArray) (conv->x_old[in_ch], conv->xtemp, conv->blocksize); // copy old signal block IEMCONVOLVE(copyArray) (in[in_ch], &conv->xtemp[conv->blocksize],conv->blocksize);// append new signal block iemfft_execute(conv->fftplan_xtemp); // perform 2L FFT to xftemp IEMCONVOLVE(copyComplexArray) (conv->xftemp, conv->xf[in_ch][conv->current_rb], conv->blocksize + 1); // write FFT into ring buffer IEMCONVOLVE(copyArray) (in[in_ch], conv->x_old[in_ch],conv->blocksize); // store current signal block } for (unsigned int out_ch = 0; out_ch < conv->num_outputs; out_ch++) { IEMCONVOLVE(resetComplexArray) (conv->yftemp,conv->blocksize + 1); // zero output's partition accumulator for (unsigned int in_ch = 0; in_ch < conv->num_inputs; in_ch++) { // MIMO convolutions (main) for (unsigned int p = 0, px = conv->current_rb; p < conv->num_partitions; p++, px++) { IEMCONVOLVE(freq_mul_acc) (conv->xf[in_ch][px % conv->num_partitions], conv->hf[conv->current_cf][out_ch][in_ch][p], conv->yftemp, conv->blocksize + 1); } } iemfft_execute(conv->ifftplan_y); // perform iFFT of the main-IR output partition /* IF IR WAS UPDATED: ALSO COMPUTE NEW OUTPUT FOR CROSSFADE AT THE OUT CHANNEL */ if (IEMCONVOLVE(wasCrossFadeRegistered(conv))) { unsigned int current_cf = (conv->current_cf + 1) % NUM_CF; IEMCONVOLVE(resetComplexArray) (conv->yftemp, conv->blocksize + 1); // zero output's partitions accumulator for (unsigned int in_ch = 0; in_ch < conv->num_inputs; in_ch++) { // MIMO convolutions (update) for (unsigned int p = 0, px = conv->current_rb; p < conv->num_partitions; p++) { IEMCONVOLVE(freq_mul_acc) (conv->xf[in_ch][px % conv->num_partitions], conv->hf[current_cf][out_ch][in_ch][p], conv->yftemp, conv->blocksize + 1); px++; } } iemfft_execute(conv->ifftplan_y_cf); // perform iFFT of the updated-IR output partition IEMCONVOLVE(crossFade) (conv->y + conv->blocksize, conv->y_cf + conv->blocksize, conv->w_old, conv->w_new, conv->blocksize); // xfade main->updated } /* IF IR WAS UPDATED: CROSSFADE TO NEW OUTPUT OF THE OUT CHANNEL COMPLETE */ IEMCONVOLVE(copyArrayWithGain) (&conv->y[conv->blocksize], out[out_ch], conv->blocksize, 2 * conv->blocksize); // second half times N is the output's resulting signal block } if (IEMCONVOLVE(wasCrossFadeRegistered(conv))) { conv->current_cf = (conv->current_cf + 1) % NUM_CF; IEMCONVOLVE(registerCrossFadeComplete(conv)); // update status } conv->current_rb = (conv->current_rb + conv->num_partitions - 1) % conv->num_partitions; // decrease ring for IR partitions } /*-----------------------------------------------------------------------------------------------------------------------------*/ conv_data *IEMCONVOLVE(initConvolution) (unsigned int blocksize, unsigned int num_partitions, unsigned int xfade_length, unsigned int num_inputs, unsigned int num_outputs, _Bool coherent_xfade) { conv_data *conv = (conv_data *)malloc(sizeof(conv_data)); conv->blocksize = blocksize; // block length (2L=FFT length) conv->num_partitions = num_partitions; // number of partitions conv->num_inputs = num_inputs; conv->num_outputs = num_outputs; conv->xtemp = IEMCONVOLVE(new1DArray) (conv->blocksize * 2); // input signal FFT buffer conv->htemp = IEMCONVOLVE(new1DArray) (conv->blocksize * 2); // IR signal partition FFT buffer conv->y = IEMCONVOLVE(new1DArray) (conv->blocksize * 2); // output signal FFT buffer main/old conv->y_cf = IEMCONVOLVE(new1DArray) (conv->blocksize * 2); // output signal FFT buffer new for crossfade conv->w_old = IEMCONVOLVE(new1DArray) (conv->blocksize); // fade-out window signal buffer conv->w_new = IEMCONVOLVE(new1DArray) (conv->blocksize); // fade-in window signal buffer conv->current_rb = 0; // partition ringbuffer index [0;P-1] conv->current_cf = 0; // crossfade-from index {0, 1} conv->xfade_length = (xfade_lengthxtemp, conv->blocksize * 2); IEMCONVOLVE(resetArray) (conv->htemp, conv->blocksize * 2); IEMCONVOLVE(resetArray) (&conv->htemp[conv->blocksize], conv->blocksize); // zero pad IEMCONVOLVE(resetArray) (conv->w_old, conv->blocksize); IEMCONVOLVE(resetArray) (conv->w_new, conv->blocksize); if (coherent_xfade) { // amplitude-complementary crossfade for coherent signals IEMCONVOLVE(cos2win)(conv->w_old, conv->xfade_length); IEMCONVOLVE(sin2win)(conv->w_new, conv->xfade_length); } else { // power complementary crossfade for incoherent signals IEMCONVOLVE(coswin)(conv->w_old, conv->xfade_length); IEMCONVOLVE(sinwin)(conv->w_new, conv->xfade_length); } conv->register_crossfade = 0; conv->x_old = IEMCONVOLVE(new2DArray) (conv->num_inputs, conv->blocksize); // old input signal buffer IEMCONVOLVE(reset2DArray) (conv->x_old, conv->num_inputs, conv->blocksize); // frequency-domain buffers holding all input-signal partitions conv->xf = IEMCONVOLVE(new3DComplexArray) (conv->num_inputs, conv->num_partitions, conv->blocksize + 1); IEMCONVOLVE(reset3DComplexArray) (conv->xf, conv->num_inputs, conv->num_partitions, conv->blocksize + 1); // frequency-domain buffers holding all MIMO ir partitions conv->hf = IEMCONVOLVE(new5DComplexArray) (NUM_CF, conv->num_outputs, conv->num_inputs, conv->num_partitions, conv->blocksize + 1); IEMCONVOLVE(reset5DComplexArray) (conv->hf, NUM_CF, conv->num_outputs, conv->num_inputs, conv->num_partitions, conv->blocksize + 1); // frequency-domain single-channel temporary buffers conv->xftemp = IEMCONVOLVE(new1DComplexArray) (conv->blocksize + 1); conv->hftemp = IEMCONVOLVE(new1DComplexArray) (conv->blocksize + 1); conv->yftemp = IEMCONVOLVE(new1DComplexArray) (conv->blocksize + 1); // single-channel FFT plan for temporary signal and ir blocks conv->fftplan_xtemp = iemfft_plan_rfft_1d(conv->blocksize * 2, conv->xtemp, conv->xftemp, DEFAULT | PRESERVE_INPUT); conv->fftplan_htemp = iemfft_plan_rfft_1d(conv->blocksize * 2, conv->htemp, conv->hftemp, DEFAULT | PRESERVE_INPUT); // single-channel IFFT plan for temporary main/old and new output signal conv->ifftplan_y = iemfft_plan_rifft_1d(conv->blocksize * 2, conv->yftemp, conv->y, DEFAULT | PRESERVE_INPUT); conv->ifftplan_y_cf = iemfft_plan_rifft_1d(conv->blocksize * 2, conv->yftemp, conv->y_cf, DEFAULT | PRESERVE_INPUT); return conv; } /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(freeConvolution) (conv_data *conv) { // single-channel FFT and IFFT plans of temporary signals iemfft_destroy_plan(conv->fftplan_xtemp); iemfft_destroy_plan(conv->fftplan_htemp); iemfft_destroy_plan(conv->ifftplan_y); iemfft_destroy_plan(conv->ifftplan_y_cf); // frequency-domain array holding all input signal partitions IEMCONVOLVE(free3DComplexArray) (conv->xf, conv->num_inputs, conv->num_partitions); // frequency-domain array with all MIMO ir partitions IEMCONVOLVE(free5DComplexArray)(conv->hf, NUM_CF, conv->num_outputs, conv->num_inputs, conv->num_partitions); // old input signal-block buffers IEMCONVOLVE(free2DArray) (conv->x_old, conv->num_inputs); // time-domain temporary FFT signal blocks IEMCONVOLVE(free1DArray)(conv->xtemp); IEMCONVOLVE(free1DArray)(conv->htemp); IEMCONVOLVE(free1DArray)(conv->w_old); IEMCONVOLVE(free1DArray)(conv->w_new); IEMCONVOLVE(free1DArray)(conv->y); IEMCONVOLVE(free1DArray)(conv->y_cf); IEMCONVOLVE(free1DComplexArray)(conv->yftemp); IEMCONVOLVE(free1DComplexArray)(conv->hftemp); IEMCONVOLVE(free1DComplexArray)(conv->xftemp); free(conv); } /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(setImpulseResponseZeroPad) (conv_data *conv, t_float ***inh, unsigned int num_samples, _Bool no_xfade_init) { unsigned int offset; unsigned int copy_length; int hot_or_cold_stream; if (!conv) return; if (no_xfade_init) { // update hot stream directly, without crossfading, for initialization hot_or_cold_stream = conv->current_cf; IEMCONVOLVE(registerCrossFadeComplete) (conv); } else { // update cold stream and register a cross-fade from hot -> cold stream next dsp cycle hot_or_cold_stream = (conv->current_cf + 1) % NUM_CF; IEMCONVOLVE(registerCrossFade) (conv); } for (unsigned int out_ch = 0; out_ch < conv->num_outputs; out_ch++) { for (unsigned int in_ch = 0; in_ch < conv->num_inputs; in_ch++) { offset = 0; for (unsigned int partition = 0; partition < conv->num_partitions; partition++) { copy_length = (offset+conv->blocksize > num_samples) ? num_samples-offset : conv->blocksize; IEMCONVOLVE(copyArray) (&inh[out_ch][in_ch][offset], conv->htemp, copy_length); IEMCONVOLVE(resetArray) (&conv->htemp[copy_length], conv->blocksize - copy_length); iemfft_execute(conv->fftplan_htemp); IEMCONVOLVE(copyComplexArray) ( conv->hftemp, conv->hf[hot_or_cold_stream][out_ch][in_ch][partition], conv->blocksize + 1); offset+=conv->blocksize; } } } } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver/convolver.h000066400000000000000000000106531514557770000271110ustar00rootroot00000000000000/* Uniformly Partitioned, Time-Variant, Multichannel-Input-Mulichannel-Output Block Convolution (and because signal processing folks like incomprehensible abbreviations: UPTVMIMOBC, yeah!) useful for all kinds of real-time processes virtual acoustic reality, 6dof spatial audio rendering/auralization, convolution reverb, Ambisonic decoding to headphones (binaural), Ambisonic encoding of compact spherical microphone arrays Ambisonic decoding to compact spherical loudspeaker arrays Wave-Field Synthesis processing, dynamic Binaural rendering, Beamforming with loudspeaker or micrphone arrays, adaptive signal processing, frequency response equalization, ... For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "LICENSE.txt," in this distribution. Franz Zotter Hannes Pescoller Sourena Mosleh Email-address: zotter@iem.at h.pescoller@kug.ac.at sourena.mosleh@student.kug.ac.at Institute of Electronic Music and Acoustics (IEM) University of Music and Performing Arts Graz 2024, 2025 */ #ifndef _mtx_convolver_convolver_h #define _mtx_convolver_convolver_h #include "array.h" #include #define NUM_CF 2 // there are 2 crossfase buffers (re-occurring array dimension) typedef struct Conv_data { unsigned int blocksize; // signal block length (fft length = 2L) unsigned int num_partitions; // number of convolution partitions (length of h) unsigned int num_inputs; // number of input channels unsigned int num_outputs; unsigned int xfade_length; _Bool register_crossfade; // parameter for switching between different buffers t_float *xtemp; // 2L fft-input time-domain signal x=[xprev, xcurr] t_float *htemp; // 2L time-domain impulse response input h=[h, 0] t_float *y; // 2L time-domain result y=[ycircular, ylinear] t_float *y_cf; // 2L time-domain result y=[ycircular, ylinear] t_float **x_old; // previous input data t_float *w_old; // fade-out window t_float *w_new; // fade-in window unsigned int current_rb; // current_rb ring buffer position unsigned int current_cf; t_complex ***xf; // L+1 positive-half DFT, partition input ring buffer t_complex *****hf; // L+1 positive-half DFT, partition stack of h t_complex *yftemp; // L+1 positive-half DFT output buffer t_complex *xftemp; // L+1 FFT buffer for previous+current block t_complex *hftemp; // L+1 FFT buffer for response partition t_iemfft_plan fftplan_xtemp; // FFT DFT plan for previous+current block t_iemfft_plan fftplan_htemp; // FFT DFT plan for impulse response t_iemfft_plan ifftplan_y; // FFT iDFT plan for current output signal t_iemfft_plan ifftplan_y_cf; } conv_data; /* crossfade functions */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(crossFade) (t_float *y, t_float *y_new, t_float *w_old, t_float *w_new, unsigned int len); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(registerCrossFade) (conv_data *conv); /*-----------------------------------------------------------------------------------------------------------------------------*/ _Bool IEMCONVOLVE(wasCrossFadeRegistered)(conv_data *conv); /*-----------------------------------------------------------------------------------------------------------------------------*/ /* PARTITIONED CONVOLUTION CORE */ /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(convProcess) (conv_data *conv, t_float **in, t_float **out); /*-----------------------------------------------------------------------------------------------------------------------------*/ conv_data *IEMCONVOLVE(initConvolution) (unsigned int blocksize, unsigned int num_partitions, unsigned int xfade_length, unsigned int num_inputs, unsigned int num_outputs, _Bool coherent_xfade); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(freeConvolution) (conv_data *conv); /*-----------------------------------------------------------------------------------------------------------------------------*/ void IEMCONVOLVE(setImpulseResponseZeroPad) (conv_data *conv, t_float ***inh, unsigned int num_samples, _Bool no_xfade_init); #endif /* _mtx_convolver_convolver_h */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver/test_convolver.c000066400000000000000000000162071514557770000301440ustar00rootroot00000000000000/* Test script/sketch board for Uniformly Partitioned, Time-Variant, Multichannel-Input-Mulichannel-Output Block Convolution (and because signal processing folks like incomprehensible abbreviations: UPTVMIMOBC, yeah!) useful for all kinds of real-time processes virtual acoustic reality, 6dof spatial audio rendering/auralization, convolution reverb, Ambisonic decoding to headphones (binaural), Ambisonic encoding of compact spherical microphone arrays Ambisonic decoding to compact spherical loudspeaker arrays Wave-Field Synthesis processing, dynamic Binaural rendering, Beamforming with loudspeaker or micrphone arrays, adaptive signal processing, frequency response equalization, ... Franz Zotter Hannes Pescoller Sourena Mosleh Email-address: zotter@iem.at h.pescoller@kug.ac.at sourena.mosleh@student.kug.ac.at Institute of Electronic Music and Acoustics (IEM) University of Music and Performing Arts Graz 2024, 2025 */ #include "../include/array.h" #include "../include/convolver.h" #include /* MAIN TESTING ROUTINE */ /*-----------------------------------------------------------------------------------------------------------------------------*/ int main() { float **in; float ***inh; float **out; float **target; float *targettemp; float **intemp; float **outtemp; float eCounter = 0; float e; int M = 4; int L = 6; int P = 3; int Hann_len = L; int INPUT = 2; int OUTPUT = 5; conv_data *conv = initConvolution(L, P, Hann_len, INPUT, OUTPUT); // printf("hello!"); in = new2DArray(conv->num_inputs, conv->L * M); inh = new3DArray(conv->num_outputs, conv->num_inputs, conv->L * conv->P); out = new2DArray(conv->num_outputs, conv->L * M); target = new2DArray(conv->num_outputs, conv->L * M); targettemp = new1DArray(conv->L * M); intemp = new2DArray(conv->num_inputs, conv->L); outtemp = new2DArray(conv->num_outputs, conv->L); /*reset in ,inh, out and target*/ reset3DArray(inh, conv->num_outputs, conv->num_inputs, conv->L * M); reset2DArray(in, conv->num_inputs, conv->L * M); reset2DArray(intemp, conv->num_inputs, conv->L); reset2DArray(out, conv->num_outputs, conv->L * M); reset2DArray(target, conv->num_outputs, conv->L * M); reset2DArray(outtemp, conv->num_outputs, conv->L); for (int out_ch = 0; out_ch < conv->num_outputs; out_ch++) { for (int in_ch = 0; in_ch < conv->num_inputs; in_ch++) { for (int x_imp = 0; x_imp < conv->L * M; x_imp++) { unitImpulse2D(in, conv->num_inputs, conv->L * M, in_ch, x_imp); for (int h_imp = 0; h_imp < conv->L * conv->P; h_imp++) { unitImpulse3D(inh, conv->num_outputs, conv->num_inputs, conv->L * conv->P, out_ch, in_ch, h_imp); unitImpulse2D(target, conv->num_outputs, conv->L * M, out_ch, x_imp + h_imp); reset2DArray(conv->x_old, conv->num_inputs, conv->L); reset3DComplexArray(conv->xf, conv->num_inputs, conv->P, conv->L + 1); setImpulseResponse(conv, inh); printf("\nIR with Input channel %d, and Output channel %d=", in_ch, out_ch); print_signal(inh[out_ch][in_ch], conv->P * conv->L); for (int m = 0; m < M; m++) { copy2DArray(in, intemp, conv->num_inputs, m * conv->L, 0, conv->L); conv_process(conv, intemp, outtemp); copy2DArray(outtemp, out, conv->num_outputs, 0, m * conv->L, conv->L); } if ((e = fabsf(squared2DError(out, target, conv->num_outputs, conv->L))) > 0.3f) { printf("error i:%d,o:%d,xt:%d,ht:%d,e:%f\n", in_ch, out_ch, x_imp, h_imp, e); eCounter++; } else { printf("no error i:%d,o:%d,xt:%d,ht:%d,e:%f\n", in_ch, out_ch, x_imp, h_imp, e); } /* printf("\nOutput signal: "); print2DSignal(out,conv->num_outputs,conv->L*M); printf("\ntarget: "); print2DSignal(target,conv->num_outputs,conv->L*M); printf("\nInput signal: "); print2DSignal(in,conv->num_inputs,conv->L*M); */ } } } } float errorRatio = eCounter / (conv->num_outputs * conv->num_inputs * conv->L * M * conv->L * conv->P); printf("\n%f errors from %d", eCounter, conv->num_outputs * conv->num_inputs * conv->L * M * conv->L * conv->P); printf("\nerror ratio= %f", errorRatio); /*for(int out_ch=0; out_chnum_outputs;out_ch++) { for(int in_ch=0; in_chnum_inputs;in_ch++) //for(int x_imp=0;x_impL*M;x_imp++) { //int x_imp=0; //unitImpulse2D(in,conv->num_inputs,conv->L*M,in_ch,x_imp); Rectangle2D(in,conv->num_inputs,conv->L*M,in_ch); //for(int h_imp=0;h_impL*conv->P;h_imp++) { int h_imp=0; //unitImpulse3D(inh,conv->num_outputs,conv->num_inputs,conv->L*conv->P, //out_ch, in_ch, h_imp); //unitImpulse2D(target,conv->num_outputs,conv->L*M, //out_ch,x_imp+h_imp); Rectangle2D(target,conv->num_outputs,conv->L*M, out_ch); reset2DArray(conv->x_old,conv->num_inputs,conv->L); reset3DComplexArray(conv->xf,conv->num_inputs,conv->P,conv->L+1); int counter=0; for (int m=0; mnum_outputs,conv->num_inputs,conv->L*conv->P,out_ch, in_ch, h_imp); else reset3DArray(inh,conv->num_outputs,conv->num_inputs,conv->L*M); setImpulseResponse(conv,inh); //printf("convolver switch after set:%d \n",conv->convolver_switch); copy2DArray(in, intemp, conv->num_inputs, m*conv->L, 0, conv->L); conv_process(conv, intemp, outtemp); //printf("convolver switch after process:%d \n",conv->convolver_switch); copy2DArray(outtemp, out, conv->num_outputs, 0, m*conv->L, conv->L); counter++; } if ((e=fabsf(conv->num_outputs*squaredArray(conv->w,conv->L)-squared2DError(out,target,conv->num_outputs,conv->L)))>0.1f) { printf("error i:%d,o:%d,xt:%d,ht:%d,e:%f\n",in_ch,out_ch,x_imp,h_imp,e); //print2DSignal(out,conv->num_outputs,conv->L*M); //print2DSignal(target,conv->num_outputs,conv->L*M); } else { printf("no error i:%d,o:%d,xt:%d,ht:%d,e:%f\n",in_ch,out_ch,x_imp,h_imp,e); } */ // printf("\nOutput signal: "); // print2DSignal(out,conv->num_outputs,conv->L*M); // printf("\nInput signal: "); // print2DSignal(in,conv->num_inputs,conv->L*M); // printf("\nThe Hann window: "); // print_signal(conv->w, conv->L); //} // } // }*/ freeConvolution(conv); return 0; } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_convolver~.c000066400000000000000000000451761514557770000252750ustar00rootroot00000000000000/* Uniformly Partitioned, Time-Variant, Multichannel-Input-Mulichannel-Output Block Convolution (and because signal processing folks like incomprehensible abbreviations: UPTVMIMOBC, yeah!) for Pure-Data (with cross-faded outputs when updated) mtx_convolver~ useful for all kinds of real-time processes, like - virtual acoustic reality, - 6dof spatial audio rendering/auralization, - convolution reverb, - Ambisonic decoding to headphones (binaural), - Ambisonic encoding of compact spherical microphone arrays - Ambisonic decoding to compact spherical loudspeaker arrays - Wave-Field Synthesis processing, - dynamic Binaural rendering, - Beamforming with loudspeaker or micrphone arrays, - adaptive signal processing, - frequency response equalization, - ... For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "LICENSE.txt," in this distribution. Franz Zotter Hannes Pescoller Sourena Mosleh Email-address: zotter@iem.at h.pescoller@kug.ac.at sourena.mosleh@student.kug.ac.at Institute of Electronic Music and Acoustics (IEM) University of Music and Performing Arts Graz 2024, 2025 */ #include "iemmatrix.h" #include "iemmatrix_stub.h" #include "mtx_convolver/array.h" #include "mtx_convolver/convolver.h" #include #if 1 static void _noppost(const void *object, int level, const char *fmt, ...) { (void)object; (void)level; (void)fmt; } # define _debug_logpost _noppost #else # define _debug_logpost logpost #endif #ifndef CLASS_MULTICHANNEL # define CLASS_MULTICHANNEL 0 #endif typedef void (*setmultiout_f)(t_signal **sig, int nchans); static t_class *mtx_convolver_tilde_class; static t_class *mtx_convolver_tilde_mclass; typedef struct _mtx_convolver_tilde { t_object x_obj; t_symbol *x_objname; setmultiout_f x_setmultiout; /* when doing multichannel, this is Pd>=0.54's signal_setmultiout(); otherwise NULL */ unsigned int ins; // given/instantiated/mc number of inputs unsigned int outs; // given/instantiated number of inputs t_sample **inout_buffers; t_float ***h; // 3D impulse response array h, h_num_ins x h_num_outs x h_len from array.h unsigned int h_num_ins; unsigned int h_num_outs; unsigned int h_len; _Bool coherent_xfade; t_canvas *x_canvas; // to open array3 file conv_data *conv; // convolver structure from convolver.h t_float **conv_input_buffer; // input buffers to call convolver t_float **conv_output_buffer; // output buffers to call convolver t_inlet **x_inlet; // object's input ports t_outlet **x_outlet; // object's output ports unsigned int blocksize; int set_ir_at_dsp_start; // retarded updated of input IR on dsp start } t_mtx_convolver_tilde; unsigned int ceildiv(unsigned int a, unsigned int b) { if (b == 0) return 0; unsigned int c = a / b; if (c * b < a) return c + 1; return c; } t_int *mtx_convolver_tilde_perform(t_int *w) { t_mtx_convolver_tilde *x = (t_mtx_convolver_tilde *)w[1]; const char*objname=x->x_objname->s_name; unsigned int available_inputs = (x->h_num_ins < x->ins) ? x->h_num_ins : x->ins; unsigned int available_outputs = (x->h_num_outs < x->outs) ? x->h_num_outs : x->outs; _debug_logpost(x, PD_DEBUG, "[%s] available ins=%d, outs=%d", objname,available_inputs,available_outputs); if (x->conv) { _debug_logpost(x, PD_DEBUG, "[%s] processing with existing convolver",objname); // Operation: copy input signals, convolve, copy output signals for (unsigned int i = 0; i < available_inputs; i++) { // copy from inout pd buffers t_float *in = x->conv_input_buffer[i]; t_sample *pd_in = x->inout_buffers[i]; for (unsigned int n = 0; n < x->blocksize; n++) { in[n] = (t_float)pd_in[n]; } } for (unsigned int i=available_inputs; i < x->h_num_ins; i++) { // zeropad of unavailable convolver inputs t_float *in = x->conv_input_buffer[i]; for (unsigned int n = 0; n < x->blocksize; n++) { in[n] = (t_float)0; } } if (IEMCONVOLVE(wasCrossFadeRegistered) (x->conv)) logpost(x, PD_DEBUG, "[%s] have to crossfade to a new IR",objname); _debug_logpost(x, PD_DEBUG, "[%s] L=%d, P=%d, ins=%d, outs=%d",objname,x->conv->blocksize,x->conv->num_partitions,x->conv->num_inputs,x->conv->num_outputs); _debug_logpost(x, PD_DEBUG, "[%s] conv=%d, inbuf=%d, outpuf=%d",objname,x->conv,x->conv_input_buffer, x->conv_output_buffer); IEMCONVOLVE(convProcess) (x->conv, x->conv_input_buffer, x->conv_output_buffer); for (unsigned int i = 0; i < available_outputs; i++) { t_float *out = x->conv_output_buffer[i]; t_sample *pd_out = x->inout_buffers[i + x->ins]; for (unsigned int n = 0; n < x->blocksize; n++) { pd_out[n] = (t_sample)out[n]; } } } else { // DEFAULT: No convolver, deliver zero output signals. _debug_logpost(x, PD_DEBUG, "[%s] NOP with convolver inexistent, zeroing %d outs with blocksize %d",objname,x->outs,x->blocksize); for (unsigned int i = 0; i < x->outs; i++) { t_sample *pd_out = x->inout_buffers[i + x->ins]; for (unsigned int n = 0; n < x->blocksize; n++) { pd_out[n] = (t_sample)0; } } } return (w + 2); } void mtx_convolver_init(t_mtx_convolver_tilde *x) { if (x->conv) IEMCONVOLVE(freeConvolution) (x->conv); x->conv = 0; if ((x->blocksize > 0) && (x->h_num_ins > 0) && (x->h_num_outs > 0) && (x->h_len >0)) { unsigned int num_partitions = ceildiv(x->h_len, x->blocksize); x->conv = IEMCONVOLVE(initConvolution) (x->blocksize, num_partitions, x->blocksize, x->h_num_ins, x->h_num_outs, x->coherent_xfade); } } int mtx_convolver_resize(t_mtx_convolver_tilde *x) { const char*objname=x->x_objname->s_name; if (x->conv) { unsigned int num_partitions = ceildiv(x->h_len,x->blocksize); if ((x->conv->blocksize==x->blocksize)&&(x->conv->num_partitions==num_partitions)&& (x->conv->num_inputs==x->h_num_ins)&& (x->conv->num_outputs==x->h_num_outs)) { _debug_logpost(x, PD_DEBUG, "[%s] keeping convolver with ins=%d, outs=%d, partitions=%d, blocksize=%d", objname,x->conv->num_inputs,x->conv->num_outputs,x->conv->num_partitions,x->conv->blocksize); return 0; // keep convolver, it's size is perfect, exit! } else { // resize required, resize buffers and free convolver if (x->conv_output_buffer) { IEMCONVOLVE(free2DArray) (x->conv_output_buffer, x->conv->num_outputs); x->conv_output_buffer=0; } if (x->conv_input_buffer) { IEMCONVOLVE(free2DArray) (x->conv_input_buffer, x->conv->num_inputs); x->conv_input_buffer=0; } IEMCONVOLVE(freeConvolution(x->conv)); x->conv = 0; if ((x->blocksize)&&(x->h_num_ins)&&(x->h_num_outs)) { x->conv_input_buffer = IEMCONVOLVE(new2DArray) (x->h_num_ins, x->blocksize); x->conv_output_buffer = IEMCONVOLVE(new2DArray) (x->h_num_outs, x->blocksize); } } } // new convolver: if ((x->blocksize)&&(x->h_num_ins)&&(x->h_num_outs)&&(x->h_len)) { mtx_convolver_init(x); if (x->conv){ logpost(x, PD_DEBUG, "[%s] re-instantiated convolver with ins=%d, outs=%d, partitions=%d, blocksize=%d", objname,x->conv->num_inputs,x->conv->num_outputs,x->conv->num_partitions,x->conv->blocksize); } if (!x->conv_input_buffer) x->conv_input_buffer = IEMCONVOLVE(new2DArray) (x->h_num_ins, x->blocksize); if (!x->conv_output_buffer) x->conv_output_buffer = IEMCONVOLVE(new2DArray) (x->h_num_outs, x->blocksize); } return 1; } void mtx_convolver_tilde_dsp(t_mtx_convolver_tilde *x, t_signal **sp) { unsigned int ins = x->ins; unsigned int outs = x->outs; const char*objname=x->x_objname->s_name; #if CLASS_MULTICHANNEL if (x->x_setmultiout) { // override with num input signals in MC mode ins = sp[0]->s_nchans>0?sp[0]->s_nchans:0; logpost(x, PD_DEBUG, "[%s] multichannel mode, in=%u",objname,ins); // set number of outs in MC mode outs = x->h_num_outs; outs = (outs>0)?outs:1; logpost(x, PD_DEBUG, "[%s] multichannel mode, outs=%u",objname,outs); x->x_setmultiout(&sp[1], outs); if ((ins+outs != x->ins+x->outs)){ if (x->inout_buffers) { free(x->inout_buffers); x->inout_buffers=0; } } x->outs = outs; x->ins = ins; } else { _debug_logpost(x, PD_DEBUG, "[%s] non-multichannel mode, in=%d, out=%d",objname,ins,outs); } #endif if (!x->inout_buffers) { x->inout_buffers = (t_float **)malloc(sizeof(t_float *) * (x->ins + x->outs)); } x->blocksize = sp[0]->s_n>0?sp[0]->s_n:0; _debug_logpost(x, PD_DEBUG, "[%s] outs=%u, ins=%u, blocksize=%u",objname,outs,ins,x->blocksize); int resized; resized = mtx_convolver_resize(x); // check if renewed convolver is required int n0 = (sp && *sp)?sp[0]->s_n:0; /* Pd's blocksize might be non-power-of-two, which we don't support */ if((n0<=0) || ((n0 & (n0 - 1)) != 0)) { pd_error(x, "[%s] blocksize must be a power-of-two (have:%d)", objname, n0); if(0) { #if CLASS_MULTICHANNEL } else if (x->x_setmultiout) { dsp_add_zero(sp[1]->s_vec, sp[1]->s_length * sp[1]->s_nchans); #endif } else { for(unsigned int i=0; iouts; i++) { dsp_add_zero(sp[x->ins + i]->s_vec, sp[x->ins + i]->s_n); } } return; #if CLASS_MULTICHANNEL } else if (x->x_setmultiout) { for (unsigned int i = 0; i < x->ins; i++) { x->inout_buffers[i] = sp[0]->s_vec + i * x->blocksize; } for (unsigned int i = 0; i < x->outs; i++) { x->inout_buffers[x->ins + i] = sp[1]->s_vec + i * x->blocksize; } #endif } else { for (unsigned int i = 0; i < x->ins + x->outs; i++) { x->inout_buffers[i] = sp[i]->s_vec; } } if ((x->set_ir_at_dsp_start) || (resized)) { if (x->conv) { _debug_logpost(x, PD_DEBUG, "[%s] convolver has ins=%d, outs=%d, partitions=%d, blocksize=%d", objname,x->conv->num_inputs,x->conv->num_outputs,x->conv->num_partitions,x->conv->blocksize); IEMCONVOLVE(setImpulseResponseZeroPad) (x->conv, x->h, x->h_len, resized); // init with no xfade when conv was resized x->set_ir_at_dsp_start = 0; } } dsp_add(mtx_convolver_tilde_perform, 1, x); } void mtx_convolver_tilde_free(t_mtx_convolver_tilde *x) { if (x->inout_buffers) free(x->inout_buffers); if (x->h) IEMCONVOLVE(free3DArray) (x->h, x->h_num_outs, x->h_num_ins); if (x->conv) IEMCONVOLVE(freeConvolution) (x->conv); if (x->conv_input_buffer) IEMCONVOLVE(free2DArray) (x->conv_input_buffer, x->h_num_ins); if (x->conv_output_buffer) IEMCONVOLVE(free2DArray) (x->conv_output_buffer, x->h_num_outs); } int mtx_convolver_check(t_mtx_convolver_tilde*x, int argc, t_atom*argv, unsigned int tests) { const char*objname=x->x_objname->s_name; int outputs=(argc>2)?atom_getfloat(argv+0):0; int inputs=(argc>2)?atom_getfloat(argv+1):0; int length=(argc>2)?atom_getfloat(argv+2):0; if (!tests) tests = IEMMATRIX_CHECK_CRIPPLED | IEMMATRIX_CHECK_DIMENSIONS | IEMMATRIX_CHECK_SPARSE; if ((tests & IEMMATRIX_CHECK_CRIPPLED) && argc<3) { pd_error(x, "[%s] crippled array3", objname); return 1; } if ((tests & IEMMATRIX_CHECK_DIMENSIONS) && ((inputs<1)||(outputs<1)||(length<1))) { pd_error(x, "[%s] invalid dimensions %dx%dx%d", objname, inputs, outputs, length); return 1; } if ((tests & IEMMATRIX_CHECK_SPARSE)&&(inputs* outputs*length>argc-3)) { pd_error(x, "[%s] sparse array3 not yet supported", objname); return 1; } return 0; } void mtx_convolver_tilde_array3(t_mtx_convolver_tilde *x, t_symbol *s, int argc, t_atom *argv) { const char*objname=x->x_objname->s_name; unsigned int h_num_ins, h_num_outs, h_len; int resized_outs=0; if (argc < 3) { logpost(x, PD_ERROR, "[%s] %s message must have at least 3 arguments: num_inputs, num_outputs, ir_len", objname, s->s_name); return; } if (mtx_convolver_check(x, argc, argv, 0)) return; h_num_outs = (unsigned int)atom_getfloat(argv); h_num_ins = (unsigned int)atom_getfloat(argv + 1); h_len = (unsigned int)atom_getfloat(argv + 2); argv += 3; _debug_logpost(x, PD_DEBUG, "[%s] inputs=%d, outputs=%d, ir_len=%d, x->blocksize=%d", objname,h_num_ins, h_num_outs, h_len, x->blocksize); if ((h_num_ins != x->h_num_ins) || (h_num_outs != x->h_num_outs) || (h_len != x->h_len)) { _debug_logpost(x, PD_DEBUG, "[%s] input array3: re-sizing/setting x->h_num_ins=%u, x->h_num_outs=%u, x->h_len=%u", objname, h_num_ins, h_num_outs, h_len); if (x->h) IEMCONVOLVE(free3DArray) (x->h, x->h_num_outs, x->h_num_ins); x->h = IEMCONVOLVE(new3DArray) (h_num_outs, h_num_ins, h_len); x->h_num_ins = h_num_ins; if (x->h_num_outs!=h_num_outs) { resized_outs=1; } x->h_num_outs = h_num_outs; x->h_len = h_len; } for (unsigned int out = 0; out < x->h_num_outs; out++) { for (unsigned int in = 0; in < x->h_num_ins; in++) { // store input array for (unsigned int i = 0; i < x->h_len; i++) { x->h[out][in][i] = (t_float)atom_getfloat(argv++); } } } if (x->blocksize) { // if blocksize is already known int resized = mtx_convolver_resize(x); // check if new convolver needs to be instantiated if (x->conv) { if (canvas_dspstate) { // if convolver exists+dsp is running update IRs _debug_logpost(x, PD_DEBUG, "[%s] attempting IR update with dsp on, ins=%d, outs=%d, partitions=%d, blocksize=%d", objname,x->conv->num_inputs,x->conv->num_outputs,x->conv->num_partitions,x->conv->blocksize); IEMCONVOLVE(setImpulseResponseZeroPad) (x->conv, x->h, x->h_len, resized); // init with no xfade if conv was resized, with xfade otherwise if (resized_outs) { _debug_logpost(x, PD_DEBUG, "[%s] convolver changed, calling dsp startup",objname); canvas_update_dsp(); } } else { x->set_ir_at_dsp_start = 1; _debug_logpost(x, PD_DEBUG, "[%s] ir update postponed to dsp start, dsp is off",objname); } } else { x->set_ir_at_dsp_start = 1; _debug_logpost(x, PD_DEBUG, "[%s] ir update postponed to dsp start, convolver missing",objname); } } else { x->set_ir_at_dsp_start = 1; _debug_logpost(x, PD_DEBUG, "[%s] ir update postponed to dsp start, blocksize missing",objname); } } void mtx_convolver_tilde_read(t_mtx_convolver_tilde *x, t_symbol *filename) { const char *objname=x->x_objname->s_name; t_binbuf *bbuf = binbuf_new(); t_atom *ap; int n; if (binbuf_read_via_path(bbuf, filename->s_name, canvas_getdir(x->x_canvas)->s_name, 0)) { pd_error(x,"[%s] failed to read '%s'", objname, filename->s_name); } ap=binbuf_getvec(bbuf); n =binbuf_getnatom(bbuf)-1; if ((ap->a_type == A_SYMBOL) && (!strcmp(ap->a_w.w_symbol->s_name,"array3") || !strcmp(ap->a_w.w_symbol->s_name,"#array3")) ) { mtx_convolver_tilde_array3(x, gensym("array3"), n, ap+1); } binbuf_free(bbuf); } void *mtx_convolver_tilde_new(t_symbol *s, int argc, t_atom *argv) { setmultiout_f setmultiout = (CLASS_MULTICHANNEL)?iemmatrix_getpdfun("signal_setmultiout"):0; t_mtx_convolver_tilde *x = 0; t_class *selected_class = mtx_convolver_tilde_class; if (argc > 0 && argv[0].a_type == A_SYMBOL && strcmp(argv[0].a_w.w_symbol->s_name, "-m") == 0) { argv++; argc--; /* want multichannel! */ #if CLASS_MULTICHANNEL if(setmultiout) selected_class = mtx_convolver_tilde_mclass; else { int major, minor, bugfix; sys_getversion(&major, &minor, &bugfix); pd_error(x, "[%s] multichannel requested, but iemmatrix is running in Pd-%d.%d-%d, which doesn't support it", s->s_name, major, minor, bugfix); return 0; } #else pd_error(x, "[%s] has been compiled without multichannel support", s->s_name); return 0; #endif } x = (t_mtx_convolver_tilde *)pd_new(selected_class); x->x_objname = s; x->x_setmultiout = (mtx_convolver_tilde_class == selected_class)?0:setmultiout; if (!x->x_setmultiout) { if (argc < 1) { x->ins = x->outs = 1; } else if (argc < 2) { int io = (int)atom_getfloat(argv); x->ins = x->outs = (io>1)?io:1; } else { int o = (int)atom_getfloat(argv + 0); int i = (int)atom_getfloat(argv + 1); x->ins = (i>1)?i:1; x->outs = (o>1)?o:1; } for (unsigned int i = 0; i < x->ins; i++) { inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); } for (unsigned int i = 0; i < x->outs; i++) { outlet_new(&x->x_obj, &s_signal); } } else { inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); outlet_new(&x->x_obj, &s_signal); } x->x_canvas = canvas_getcurrent(); x->coherent_xfade = 1; for (int i=0; is_name, "pow") != 0) { mtx_convolver_tilde_read(x, matrix_file); break; } else { const char*objname=x->x_objname->s_name; logpost(x, PD_DEBUG, "[%s] activating power-complementary output crossfade",objname); x->coherent_xfade = 0; } } } return (void *)x; } void mtx_convolver_tilde_setup(void) { mtx_convolver_tilde_class = class_new(gensym("mtx_convolver~"), (t_newmethod)mtx_convolver_tilde_new, (t_method)mtx_convolver_tilde_free, sizeof(t_mtx_convolver_tilde), CLASS_DEFAULT, A_GIMME, 0); mtx_convolver_tilde_mclass = class_new( gensym("mtx_convolver~ -m"), (t_newmethod)mtx_convolver_tilde_new, (t_method)mtx_convolver_tilde_free, sizeof(t_mtx_convolver_tilde), CLASS_MULTICHANNEL, A_GIMME, 0); class_sethelpsymbol(mtx_convolver_tilde_mclass, gensym("mtx_convolver~")); class_addmethod(mtx_convolver_tilde_class, (t_method)mtx_convolver_tilde_dsp, gensym("dsp"), A_CANT, 0); class_addmethod(mtx_convolver_tilde_class, (t_method)mtx_convolver_tilde_array3, gensym("array3"), A_GIMME, 0); class_addmethod(mtx_convolver_tilde_class, (t_method)mtx_convolver_tilde_array3, gensym("#array3"), A_GIMME, 0); class_addmethod(mtx_convolver_tilde_mclass, (t_method)mtx_convolver_tilde_dsp, gensym("dsp"), A_CANT, 0); class_addmethod(mtx_convolver_tilde_mclass, (t_method)mtx_convolver_tilde_array3, gensym("array3"), A_GIMME, 0); class_addmethod(mtx_convolver_tilde_mclass, (t_method)mtx_convolver_tilde_read, gensym("read"), A_SYMBOL, 0); class_addmethod(mtx_convolver_tilde_class, (t_method)mtx_convolver_tilde_read, gensym("read"), A_SYMBOL, 0); } void iemtx_convolver__setup(void) { mtx_convolver_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_cos.c000066400000000000000000000012111514557770000236240ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_cos: B=cos(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return cosf(f); #else return cos(f); #endif } void mtx_cos_setup(void) { iemmatrix_unop_setup("mtx_cos", 0, unop, (char*)0); } void iemtx_cos_setup(void) { mtx_cos_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_cumprod.c000066400000000000000000000165421514557770000245260ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_cumprod_class; static t_symbol *row_sym; static t_symbol *col_sym; static t_symbol *col_sym2; typedef struct _MTXCumprod_ MTXCumprod; struct _MTXCumprod_ { t_object x_obj; int rows; int columns; int size; int cumprod_direction; t_symbol *cumprod_mode; t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; t_float *x; t_float *y; }; static void deleteMTXCumprod (MTXCumprod *mtx_cumprod_obj) { if (mtx_cumprod_obj->list_out) { freebytes (mtx_cumprod_obj->list_out, sizeof(t_atom)*(mtx_cumprod_obj->size+2)); } if (mtx_cumprod_obj->x) { freebytes (mtx_cumprod_obj->x, sizeof(t_float)*(mtx_cumprod_obj->size)); } if (mtx_cumprod_obj->y) { freebytes (mtx_cumprod_obj->y, sizeof(t_float)*(mtx_cumprod_obj->size)); } } static void mTXSetCumprodDirection (MTXCumprod *mtx_cumprod_obj, t_float c_dir) { int direction = (int) c_dir; mtx_cumprod_obj->cumprod_direction = (direction==-1)?direction:1; } static void mTXSetCumprodMode (MTXCumprod *mtx_cumprod_obj, t_symbol *m_sym) { mtx_cumprod_obj->cumprod_mode = m_sym; } static void *newMTXCumprod (t_symbol *s, int argc, t_atom *argv) { MTXCumprod *mtx_cumprod_obj = (MTXCumprod *) pd_new (mtx_cumprod_class); mTXSetCumprodMode (mtx_cumprod_obj, gensym(":")); mTXSetCumprodDirection (mtx_cumprod_obj, 1.0f); if (argc>=1) { if (argv[0].a_type == A_SYMBOL) { mTXSetCumprodMode (mtx_cumprod_obj, atom_getsymbol (argv)); if (argc>=2) { if (argv[1].a_type != A_SYMBOL) { mTXSetCumprodDirection (mtx_cumprod_obj, atom_getfloat (argv+1)); } else { pd_error(mtx_cumprod_obj, "[%s]: 2nd arg ignored. supposed to be float", s->s_name); } } } else { mTXSetCumprodDirection (mtx_cumprod_obj, atom_getfloat (argv)); if (argc>=2) { if (argv[1].a_type == A_SYMBOL) { mTXSetCumprodMode (mtx_cumprod_obj, atom_getsymbol (argv+1)); } else { pd_error(mtx_cumprod_obj, "[%s]: 2nd arg ignored. supposed to be symbolic, e.g. \"row\", \"col\", \":\"", s->s_name); } } } } mtx_cumprod_obj->list_outlet = outlet_new (&mtx_cumprod_obj->x_obj, gensym("matrix")); return ((void *) mtx_cumprod_obj); } static void mTXCumprodBang (MTXCumprod *mtx_cumprod_obj) { if (mtx_cumprod_obj->list_out) outlet_anything(mtx_cumprod_obj->list_outlet, gensym("matrix"), mtx_cumprod_obj->size+2, mtx_cumprod_obj->list_out); } static void cumProd (int n, t_float *x, t_float *y) { t_float accu = 1.0f; for (; n--; x++, y++) { accu *= *x; *y = accu; } } static void cumProdReverse (int n, t_float *x, t_float *y) { t_float accu = 1.0f; for (; n--; x--, y--) { accu *= *x; *y = accu; } } static void mTXCumprodMatrix (MTXCumprod *mtx_cumprod_obj, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; t_atom *list_ptr = argv+2; t_atom *list_out = mtx_cumprod_obj->list_out; t_float *x = mtx_cumprod_obj->x; t_float *y = mtx_cumprod_obj->y; int count; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_cumprod_obj, s, argc, argv, 0))return; rows = atom_getint(argv+0); columns = atom_getint(argv+1); size = rows * columns; if ((!x)||(!list_out)||(!y)) { if (!x) { x = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!y) { y = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size+2)); } } else if (size != mtx_cumprod_obj->size) { x = (t_float *) resizebytes (x, sizeof (t_float) * (mtx_cumprod_obj->size), sizeof (t_float) * (size)); y = (t_float *) resizebytes (y, sizeof (t_float) * (mtx_cumprod_obj->size), sizeof (t_float) * (size)); list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_cumprod_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_cumprod_obj->size = size; mtx_cumprod_obj->rows = rows; mtx_cumprod_obj->columns = columns; mtx_cumprod_obj->list_out = list_out; mtx_cumprod_obj->x = x; mtx_cumprod_obj->y = y; /* main part */ /* reading matrix from inlet */ if ((mtx_cumprod_obj->cumprod_mode == col_sym) || (mtx_cumprod_obj->cumprod_mode == col_sym2)) { iemmatrix_list2floats_modulo(x, list_ptr, size, columns); columns = mtx_cumprod_obj->rows; rows = mtx_cumprod_obj->columns; } else { iemmatrix_list2floats(x, list_ptr, size); } /* calculating cumprod */ if (mtx_cumprod_obj->cumprod_direction == -1) { if ((mtx_cumprod_obj->cumprod_mode == row_sym) || (mtx_cumprod_obj->cumprod_mode == col_sym) || (mtx_cumprod_obj->cumprod_mode == col_sym2)) { x += columns-1; y += columns-1; for (count = rows; count--; x += columns, y += columns) { cumProdReverse (columns,x,y); } } else { x += size-1; y += size-1; cumProdReverse (size, x, y); } } else if ((mtx_cumprod_obj->cumprod_mode == row_sym) || (mtx_cumprod_obj->cumprod_mode == col_sym) || (mtx_cumprod_obj->cumprod_mode == col_sym2)) for (count = rows; count--; x += columns, y += columns) { cumProd (columns,x,y); } else { cumProd (size, x, y); } x = mtx_cumprod_obj->x; y = mtx_cumprod_obj->y; /* writing matrix to outlet */ if ((mtx_cumprod_obj->cumprod_mode == col_sym) || (mtx_cumprod_obj->cumprod_mode == col_sym2)) { columns = mtx_cumprod_obj->columns; rows = mtx_cumprod_obj->rows; iemmatrix_floats2list_modulo(list_out+2, y, size, columns); } else { iemmatrix_floats2list(list_out+2, y, size); } SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, rows); SETFLOAT(&list_out[1], columns); outlet_anything(mtx_cumprod_obj->list_outlet, gensym("matrix"), mtx_cumprod_obj->size+2, list_out); } void mtx_cumprod_setup (void) { mtx_cumprod_class = class_new (gensym("mtx_cumprod"), (t_newmethod) newMTXCumprod, (t_method) deleteMTXCumprod, sizeof (MTXCumprod), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_cumprod_class, (t_method) mTXCumprodBang); class_addmethod (mtx_cumprod_class, (t_method) mTXCumprodMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_cumprod_class, (t_method) mTXSetCumprodMode, gensym("mode"), A_DEFSYMBOL,0); class_addmethod (mtx_cumprod_class, (t_method) mTXSetCumprodDirection, gensym("direction"), A_DEFFLOAT,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("column"); } void iemtx_cumprod_setup(void) { mtx_cumprod_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_cumsum.c000066400000000000000000000162761514557770000243720ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_cumsum_class; static t_symbol *row_sym; static t_symbol *col_sym; static t_symbol *col_sym2; typedef struct _MTXCumsum_ MTXCumsum; struct _MTXCumsum_ { t_object x_obj; int rows; int columns; int size; int cumsum_direction; t_symbol *cumsum_mode; t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; t_float *x; t_float *y; }; static void deleteMTXCumsum (MTXCumsum *mtx_cumsum_obj) { if (mtx_cumsum_obj->list_out) { freebytes (mtx_cumsum_obj->list_out, sizeof(t_atom)*(mtx_cumsum_obj->size+2)); } if (mtx_cumsum_obj->x) { freebytes (mtx_cumsum_obj->x, sizeof(t_float)*(mtx_cumsum_obj->size)); } if (mtx_cumsum_obj->y) { freebytes (mtx_cumsum_obj->y, sizeof(t_float)*(mtx_cumsum_obj->size)); } } static void mTXSetCumsumDirection (MTXCumsum *mtx_cumsum_obj, t_float c_dir) { int direction = (int) c_dir; mtx_cumsum_obj->cumsum_direction = (direction==-1)?direction:1; } static void mTXSetCumsumMode (MTXCumsum *mtx_cumsum_obj, t_symbol *m_sym) { mtx_cumsum_obj->cumsum_mode = m_sym; } static void *newMTXCumsum (t_symbol *s, int argc, t_atom *argv) { MTXCumsum *mtx_cumsum_obj = (MTXCumsum *) pd_new (mtx_cumsum_class); mTXSetCumsumMode (mtx_cumsum_obj, gensym(":")); mTXSetCumsumDirection (mtx_cumsum_obj, 1.0f); if (argc>=1) { if (argv[0].a_type == A_SYMBOL) { mTXSetCumsumMode (mtx_cumsum_obj, atom_getsymbol (argv)); if (argc>=2) { if (argv[1].a_type != A_SYMBOL) { mTXSetCumsumDirection (mtx_cumsum_obj, atom_getfloat (argv+1)); } else { pd_error(mtx_cumsum_obj, "[%s]: 2nd arg ignored. supposed to be float", s->s_name); } } } else { mTXSetCumsumDirection (mtx_cumsum_obj, atom_getfloat (argv)); if (argc>=2) { if (argv[1].a_type == A_SYMBOL) { mTXSetCumsumMode (mtx_cumsum_obj, atom_getsymbol (argv+1)); } else { pd_error(mtx_cumsum_obj, "[%s]: 2nd arg ignored. supposed to be symbolic, e.g. \"row\", \"col\", \":\"", s->s_name); } } } } mtx_cumsum_obj->list_outlet = outlet_new (&mtx_cumsum_obj->x_obj, gensym("matrix")); return ((void *) mtx_cumsum_obj); } static void mTXCumsumBang (MTXCumsum *mtx_cumsum_obj) { if (mtx_cumsum_obj->list_out) outlet_anything(mtx_cumsum_obj->list_outlet, gensym("matrix"), mtx_cumsum_obj->size+2, mtx_cumsum_obj->list_out); } static void cumSum (int n, t_float *x, t_float *y) { t_float accu = 0.0f; for (; n--; x++, y++) { accu += *x; *y = accu; } } static void cumSumReverse (int n, t_float *x, t_float *y) { t_float accu = 0.0f; for (; n--; x--, y--) { accu += *x; *y = accu; } } static void mTXCumsumMatrix (MTXCumsum *mtx_cumsum_obj, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; t_atom *list_ptr = argv+2; t_atom *list_out = mtx_cumsum_obj->list_out; t_float *x = mtx_cumsum_obj->x; t_float *y = mtx_cumsum_obj->y; int count; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_cumsum_obj, s, argc, argv, 0))return; rows = atom_getint (argv+0); columns = atom_getint (argv+1); size = rows * columns; if ((!x)||(!list_out)||(!y)) { if (!x) { x = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!y) { y = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size+2)); } } else if (size != mtx_cumsum_obj->size) { x = (t_float *) resizebytes (x, sizeof (t_float) * (mtx_cumsum_obj->size), sizeof (t_float) * (size)); y = (t_float *) resizebytes (y, sizeof (t_float) * (mtx_cumsum_obj->size), sizeof (t_float) * (size)); list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_cumsum_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_cumsum_obj->size = size; mtx_cumsum_obj->rows = rows; mtx_cumsum_obj->columns = columns; mtx_cumsum_obj->list_out = list_out; mtx_cumsum_obj->x = x; mtx_cumsum_obj->y = y; /* main part */ /* reading matrix from inlet */ if ((mtx_cumsum_obj->cumsum_mode == col_sym) || (mtx_cumsum_obj->cumsum_mode == col_sym2)) { iemmatrix_list2floats_modulo(x, list_ptr, size, columns); columns = mtx_cumsum_obj->rows; rows = mtx_cumsum_obj->columns; } else { iemmatrix_list2floats(x, list_ptr, size); } /* calculating cumsum */ if (mtx_cumsum_obj->cumsum_direction == -1) { if ((mtx_cumsum_obj->cumsum_mode == row_sym) || (mtx_cumsum_obj->cumsum_mode == col_sym) || (mtx_cumsum_obj->cumsum_mode == col_sym2)) { x += columns-1; y += columns-1; for (count = rows; count--; x += columns, y += columns) { cumSumReverse (columns,x,y); } } else { x += size-1; y += size-1; cumSumReverse (size, x, y); } } else if ((mtx_cumsum_obj->cumsum_mode == row_sym) || (mtx_cumsum_obj->cumsum_mode == col_sym) || (mtx_cumsum_obj->cumsum_mode == col_sym2)) for (count = rows; count--; x += columns, y += columns) { cumSum (columns,x,y); } else { cumSum (size, x, y); } x = mtx_cumsum_obj->x; y = mtx_cumsum_obj->y; /* writing matrix to outlet */ if ((mtx_cumsum_obj->cumsum_mode == col_sym) || (mtx_cumsum_obj->cumsum_mode == col_sym2)) { columns = mtx_cumsum_obj->columns; rows = mtx_cumsum_obj->rows; iemmatrix_floats2list_modulo(list_out+2, y, size, columns); } else { iemmatrix_floats2list(list_out+2, y, size); } SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, rows); SETFLOAT(&list_out[1], columns); outlet_anything(mtx_cumsum_obj->list_outlet, gensym("matrix"), mtx_cumsum_obj->size+2, list_out); } void mtx_cumsum_setup (void) { mtx_cumsum_class = class_new (gensym("mtx_cumsum"), (t_newmethod) newMTXCumsum, (t_method) deleteMTXCumsum, sizeof (MTXCumsum), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_cumsum_class, (t_method) mTXCumsumBang); class_addmethod (mtx_cumsum_class, (t_method) mTXCumsumMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_cumsum_class, (t_method) mTXSetCumsumMode, gensym("mode"), A_DEFSYMBOL,0); class_addmethod (mtx_cumsum_class, (t_method) mTXSetCumsumDirection, gensym("direction"), A_DEFFLOAT,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("column"); } void iemtx_cumsum_setup(void) { mtx_cumsum_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_dbtopow.c000066400000000000000000000011201514557770000245150ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_dbtopow: B=dbtopow(A); B[n,m]=dbtopow(A[n,m]) */ void mtx_dbtopow_setup(void) { iemmatrix_unop_setup("mtx_dbtopow", 0, dbtopow, (char*)0); } void iemtx_dbtopow_setup(void) { mtx_dbtopow_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_dbtorms.c000066400000000000000000000011211514557770000245120ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_dbtorms: B=dbtorms(A); B[n,m]=dbtorms(A[n,m]) */ void mtx_dbtorms_setup(void) { iemmatrix_unop_setup("mtx_dbtorms", 0, dbtorms, (char*)0); } void iemtx_dbtorms_setup(void) { mtx_dbtorms_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_decay.c000066400000000000000000000177341514557770000241460ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_decay_class; static t_symbol *row_sym; static t_symbol *col_sym; static t_symbol *col_sym2; typedef struct _MTXDecay_ MTXDecay; struct _MTXDecay_ { t_object x_obj; int rows; int columns; int size; int decay_direction; t_symbol *decay_mode; t_float decay_parameter; t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; t_float *x; t_float *y; }; static void deleteMTXDecay (MTXDecay *mtx_decay_obj) { if (mtx_decay_obj->list_out) { freebytes (mtx_decay_obj->list_out, sizeof(t_atom)*(mtx_decay_obj->size+2)); } if (mtx_decay_obj->x) { freebytes (mtx_decay_obj->x, sizeof(t_float)*(mtx_decay_obj->size)); } if (mtx_decay_obj->y) { freebytes (mtx_decay_obj->y, sizeof(t_float)*(mtx_decay_obj->size)); } } static void mTXSetDecayParameter (MTXDecay *mtx_decay_obj, t_float d_param) { d_param = (d_param > 0.0f)?d_param:0.0f; d_param = (d_param < 1.0f)?d_param:1.0f; mtx_decay_obj->decay_parameter = d_param; } static void mTXSetDecayDirection (MTXDecay *mtx_decay_obj, t_float c_dir) { int direction = (int) c_dir; mtx_decay_obj->decay_direction = (direction==-1)?direction:1; } static void mTXSetDecayMode (MTXDecay *mtx_decay_obj, t_symbol *c_mode) { mtx_decay_obj->decay_mode = c_mode; } static void *newMTXDecay (t_symbol *s, int argc, t_atom *argv) { MTXDecay *mtx_decay_obj = (MTXDecay *) pd_new (mtx_decay_class); int sym_count=0; int first_sym=argc; int n=0; (void)s; /* unused */ mTXSetDecayMode (mtx_decay_obj, gensym(":")); mTXSetDecayDirection (mtx_decay_obj, 1); mTXSetDecayParameter (mtx_decay_obj, .9f); argc = ((argc<3)?argc:3); while (n < argc) { if (argv[n].a_type == A_SYMBOL) { sym_count++; first_sym = (first_sym= 1) { mTXSetDecayMode (mtx_decay_obj, atom_getsymbol(argv+first_sym)); } if (sym_count > 1) { pd_error(mtx_decay_obj, "[mtx_decay]: args after pos %d ignored. supposed to be non-symbolic", first_sym); argc = first_sym+1; } switch (argc) { case 3: if (first_sym < 2) { mTXSetDecayDirection (mtx_decay_obj, atom_getfloat (argv+2)); } /* fall through */ case 2: if (first_sym < 1) { mTXSetDecayParameter (mtx_decay_obj, atom_getfloat (argv+1)); } else if (first_sym > 1) { mTXSetDecayDirection (mtx_decay_obj, atom_getfloat(argv+1)); } /* fall through */ case 1: if (first_sym != 0) { mTXSetDecayParameter (mtx_decay_obj, atom_getfloat (argv)); } } mtx_decay_obj->list_outlet = outlet_new (&mtx_decay_obj->x_obj, gensym("matrix")); return ((void *) mtx_decay_obj); } static void mTXDecayBang (MTXDecay *mtx_decay_obj) { if (mtx_decay_obj->list_out) outlet_anything(mtx_decay_obj->list_outlet, gensym("matrix"), mtx_decay_obj->size+2, mtx_decay_obj->list_out); } static void deCay (int n, t_float *x, t_float *y, t_float alpha) { t_float decay = *x; t_float oneminusalpha = 1.0f-alpha; for (; n--; x++, y++) { decay = alpha * decay + oneminusalpha **x; *y = decay = (decay < *x)? *x : decay; } } static void deCayReverse (int n, t_float *x, t_float *y, t_float alpha) { t_float decay = *x; t_float oneminusalpha = 1.0f-alpha; for (; n--; x--, y--) { decay = alpha * decay + oneminusalpha **x; *y = decay = (decay < *x)? *x : decay; } } static void mTXDecayMatrix (MTXDecay *mtx_decay_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); int size = rows * columns; t_atom *list_ptr = argv+2; t_atom *list_out = mtx_decay_obj->list_out; t_float *x = mtx_decay_obj->x; t_float *y = mtx_decay_obj->y; int count; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_decay_obj, s, argc, argv, 0))return; if ((!x)||(!list_out)||(!y)) { if (!x) { x = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!y) { y = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size+2)); } } else if (size != mtx_decay_obj->size) { x = (t_float *) resizebytes (x, sizeof (t_float) * (mtx_decay_obj->size), sizeof (t_float) * (size)); y = (t_float *) resizebytes (y, sizeof (t_float) * (mtx_decay_obj->size), sizeof (t_float) * (size)); list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_decay_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_decay_obj->size = size; mtx_decay_obj->rows = rows; mtx_decay_obj->columns = columns; mtx_decay_obj->list_out = list_out; mtx_decay_obj->x = x; mtx_decay_obj->y = y; /* main part */ /* reading matrix from inlet */ if ((mtx_decay_obj->decay_mode == col_sym) || (mtx_decay_obj->decay_mode == col_sym2)) { iemmatrix_list2floats_modulo(x, list_ptr, size, columns); columns = mtx_decay_obj->rows; rows = mtx_decay_obj->columns; } else { iemmatrix_list2floats(x, list_ptr, size); } /* calculating decay */ if (mtx_decay_obj->decay_direction == -1) { if ((mtx_decay_obj->decay_mode == col_sym) || (mtx_decay_obj->decay_mode == col_sym2) || (mtx_decay_obj->decay_mode == row_sym)) { x += columns-1; y += columns-1; for (count = rows; count--; x += columns, y += columns) { deCayReverse (columns,x,y,mtx_decay_obj->decay_parameter); } } else { x += size-1; y += size-1; deCayReverse (size,x,y,mtx_decay_obj->decay_parameter); } } else { if ((mtx_decay_obj->decay_mode == col_sym) || (mtx_decay_obj->decay_mode == col_sym2) || (mtx_decay_obj->decay_mode == row_sym)) for (count = rows; count--; x += columns, y += columns) { deCay (columns,x,y,mtx_decay_obj->decay_parameter); } else { deCay (size,x,y,mtx_decay_obj->decay_parameter); } } x = mtx_decay_obj->x; y = mtx_decay_obj->y; /* writing matrix to outlet */ if ((mtx_decay_obj->decay_mode == col_sym) || (mtx_decay_obj->decay_mode == col_sym2)) { columns = mtx_decay_obj->columns; rows = mtx_decay_obj->rows; iemmatrix_floats2list_modulo(list_out+2, y, size, columns); } else { iemmatrix_floats2list(list_out+2, y, size); } SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, rows); SETFLOAT(&list_out[1], columns); outlet_anything(mtx_decay_obj->list_outlet, gensym("matrix"), mtx_decay_obj->size+2, list_out); } void mtx_decay_setup (void) { mtx_decay_class = class_new (gensym("mtx_decay"), (t_newmethod) newMTXDecay, (t_method) deleteMTXDecay, sizeof (MTXDecay), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_decay_class, (t_method) mTXDecayBang); class_addmethod (mtx_decay_class, (t_method) mTXDecayMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_decay_class, (t_method) mTXSetDecayParameter, gensym("alpha"), A_DEFFLOAT,0); class_addmethod (mtx_decay_class, (t_method) mTXSetDecayMode, gensym("mode"), A_DEFSYMBOL,0); class_addmethod (mtx_decay_class, (t_method) mTXSetDecayDirection, gensym("direction"), A_DEFFLOAT,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("column"); } void iemtx_decay_setup(void) { mtx_decay_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_diag.c000066400000000000000000000037321514557770000237560ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_diag */ static t_class *mtx_diag_class; static void mtx_diag_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row, col, length, n; t_atom *ap = 0, *dummy=0; (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getfloat(argv++); col=atom_getfloat(argv++); length=(colx_obj.ob_outlet, gensym("diag"), length, ap); freebytes(ap, (length * sizeof(t_atom))); } static void *mtx_diag_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_diag_class); (void)s; /* unused */ outlet_new(&x->x_obj, 0); x->m.row = x->m.col = 0; x->m.atombuffer = 0; if(!argc) { return(x); } x->m.atombuffer = (t_atom *)getbytes((argc*argc+2)*sizeof(t_atom)); setdimen(&x->m, argc, argc); matrix_set(&x->m, 0); argv+=argc-1; while(argc--) { SETFLOAT(x->m.atombuffer+2+argc*(1+x->m.col), atom_getfloat(argv--)); } return (x); } void mtx_diag_setup(void) { mtx_diag_class = class_new(gensym("mtx_diag"), (t_newmethod)mtx_diag_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist (mtx_diag_class, matrixobj_diag); class_addbang (mtx_diag_class, matrixobj_bang); class_addmethod(mtx_diag_class, (t_method)mtx_diag_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_diag_setup(void) { mtx_diag_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_diegg.c000066400000000000000000000035141514557770000241270ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_diegg_class; static void mtx_diegg_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row, col, length, n; t_atom *ap = 0, *dummy=0; (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getfloat(argv++); col=atom_getfloat(argv++); length=(colx_obj.ob_outlet, gensym("diegg"), length, ap); freebytes(ap, (length * sizeof(t_atom))); } static void *mtx_diegg_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_diegg_class); outlet_new(&x->x_obj, 0); x->m.row = x->m.col = 0; x->m.atombuffer = 0; if(!argc) { (void)s; return(x); } matrix_diegg(&x->x_obj, &x->m, argc, argv); return (x); } void mtx_diegg_setup(void) { mtx_diegg_class = class_new(gensym("mtx_diegg"), (t_newmethod)mtx_diegg_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist (mtx_diegg_class, matrixobj_diegg); class_addbang (mtx_diegg_class, matrixobj_bang); class_addmethod(mtx_diegg_class, (t_method)mtx_diegg_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_diegg_setup(void) { mtx_diegg_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_diff.c000066400000000000000000000155251514557770000237650ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_diff_class; static t_symbol *row_sym; static t_symbol *col_sym; static t_symbol *col_sym2; typedef struct _MTXdiff_ MTXdiff; struct _MTXdiff_ { t_object x_obj; int rows; int columns; int size; int diff_direction; t_symbol *diff_mode; t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; t_float *x; t_float *y; }; static void deleteMTXdiff (MTXdiff *mtx_diff_obj) { if (mtx_diff_obj->list_out) { freebytes (mtx_diff_obj->list_out, sizeof(t_atom)*(mtx_diff_obj->size+2)); } if (mtx_diff_obj->x) { freebytes (mtx_diff_obj->x, sizeof(t_float)*(mtx_diff_obj->size)); } if (mtx_diff_obj->y) { freebytes (mtx_diff_obj->y, sizeof(t_float)*(mtx_diff_obj->size)); } } static void mTXSetdiffDirection (MTXdiff *mtx_diff_obj, t_float c_dir) { int direction = (int) c_dir; mtx_diff_obj->diff_direction = (direction==-1)?direction:1; } static void mTXSetdiffMode (MTXdiff *mtx_diff_obj, t_symbol *c_mode) { mtx_diff_obj->diff_mode = c_mode; } static void *newMTXdiff (t_symbol *s, int argc, t_atom *argv) { MTXdiff *mtx_diff_obj = (MTXdiff *) pd_new (mtx_diff_class); (void)s; /* unused */ mTXSetdiffMode (mtx_diff_obj, gensym(":")); mTXSetdiffDirection (mtx_diff_obj, 1.0f); if (argc>=1) { if (argv[0].a_type == A_SYMBOL) { mTXSetdiffMode (mtx_diff_obj, atom_getsymbol (argv)); if (argc>=2) { if (argv[1].a_type != A_SYMBOL) { mTXSetdiffDirection (mtx_diff_obj, atom_getfloat (argv+1)); } else { pd_error(mtx_diff_obj, "[mtx_diff]: 2nd arg ignored. supposed to be float"); } } } else { mTXSetdiffDirection (mtx_diff_obj, atom_getfloat (argv)); if (argc>=2) { if (argv[1].a_type == A_SYMBOL) { mTXSetdiffMode (mtx_diff_obj, atom_getsymbol (argv+1)); } else { pd_error(mtx_diff_obj, "[mtx_diff]: 2nd arg ignored. supposed to be symbolic, e.g. \"row\", \"col\", \":\""); } } } } mtx_diff_obj->list_outlet = outlet_new (&mtx_diff_obj->x_obj, gensym("matrix")); return ((void *) mtx_diff_obj); } static void mTXdiffBang (MTXdiff *mtx_diff_obj) { if (mtx_diff_obj->list_out) outlet_anything(mtx_diff_obj->list_outlet, gensym("matrix"), mtx_diff_obj->size+2, mtx_diff_obj->list_out); } static void diff (int n, t_float *x, t_float *y) { *y++ = *x++; for (; --n; x++, y++) { *y = *x - *(x-1); } } static void diffReverse (int n, t_float *x, t_float *y) { *y-- = *x--; for (; --n; x--, y--) { *y = *x - *(x+1); } } static void mTXdiffMatrix (MTXdiff *mtx_diff_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); int size = rows * columns; t_atom *list_ptr = argv+2; t_atom *list_out = mtx_diff_obj->list_out; t_float *x = mtx_diff_obj->x; t_float *y = mtx_diff_obj->y; int count; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_diff_obj, s, argc, argv, 0))return; if ((!x)||(!list_out)||(!y)) { if (!x) { x = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!y) { y = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size+2)); } } else if (size != mtx_diff_obj->size) { x = (t_float *) resizebytes (x, sizeof (t_float) * (mtx_diff_obj->size), sizeof (t_float) * (size)); y = (t_float *) resizebytes (y, sizeof (t_float) * (mtx_diff_obj->size), sizeof (t_float) * (size)); list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_diff_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_diff_obj->size = size; mtx_diff_obj->rows = rows; mtx_diff_obj->columns = columns; mtx_diff_obj->list_out = list_out; mtx_diff_obj->x = x; mtx_diff_obj->y = y; /* main part */ /* reading matrix from inlet */ if ((mtx_diff_obj->diff_mode == col_sym) || (mtx_diff_obj->diff_mode == col_sym2)) { iemmatrix_list2floats_modulo(x, list_ptr, size, columns); columns = mtx_diff_obj->rows; rows = mtx_diff_obj->columns; } else { iemmatrix_list2floats(x, list_ptr, size); } /* calculating diff */ if (mtx_diff_obj->diff_direction == -1) { if ((mtx_diff_obj->diff_mode == row_sym) || (mtx_diff_obj->diff_mode == col_sym) || (mtx_diff_obj->diff_mode == col_sym2)) { x += columns-1; y += columns-1; for (count = rows; count--; x += columns, y += columns) { diffReverse (columns,x,y); } } else { x += size-1; y += size-1; diffReverse (size, x, y); } } else if ((mtx_diff_obj->diff_mode == row_sym) || (mtx_diff_obj->diff_mode == col_sym) || (mtx_diff_obj->diff_mode == col_sym2)) { for (count = rows; count--; x += columns, y += columns) { diff (columns,x,y); } } else { diff (size,x,y); } x = mtx_diff_obj->x; y = mtx_diff_obj->y; /* writing matrix to outlet */ if ((mtx_diff_obj->diff_mode == col_sym) || (mtx_diff_obj->diff_mode == col_sym2)) { columns = mtx_diff_obj->columns; rows = mtx_diff_obj->rows; iemmatrix_floats2list_modulo(list_out+2, y, size, columns); } else { iemmatrix_floats2list(list_out+2, y, size); } SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, rows); SETFLOAT(&list_out[1], columns); outlet_anything(mtx_diff_obj->list_outlet, gensym("matrix"), mtx_diff_obj->size+2, list_out); } void mtx_diff_setup (void) { mtx_diff_class = class_new (gensym("mtx_diff"), (t_newmethod) newMTXdiff, (t_method) deleteMTXdiff, sizeof (MTXdiff), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_diff_class, (t_method) mTXdiffBang); class_addmethod (mtx_diff_class, (t_method) mTXdiffMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_diff_class, (t_method) mTXSetdiffMode, gensym("mode"), A_DEFSYMBOL,0); class_addmethod (mtx_diff_class, (t_method) mTXSetdiffDirection, gensym("direction"), A_DEFFLOAT,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("column"); } void iemtx_diff_setup(void) { mtx_diff_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_dispersive_dline.c000066400000000000000000000164471514557770000264110ustar00rootroot00000000000000/****************************************************** * * warped delay line * * written by Franz Zotter * * 2007 * * institute of electronic music and acoustics (iem) * ****************************************************** * * license: GNU General Public License v2 or later * ******************************************************/ /* ------------------------ mtx_dispersive_dline~ ----------------------------- */ /* builds a tap vector with first order all-passes A instead of unit delays. * 'ha *' denotes the convolution with the impulse response of A. The chain is of * length L {x[n]} -> {... ha * ha * x[n], ha * x[n], x[n]} especially useful for frequency warped ffts All-pass z-Transform A(z)=(1+lambda*z)/(z-lambda), lambda ... input parameter inlet: is a signal matrix with C rows (number of channels) and N columns (samples) outlet: C rows and L columns matrix with current state of the dispersive delay line after computing the N input samples. It is possible to capture the list outlet every sample when using a column (sample) vector as input matrix. creation input parameters are: 1: L ... length of allpass chain 2: lambda ... alpass/warping parameter */ #include "iemmatrix.h" static t_class *mtx_dispersive_dline_class; typedef struct _mtx_dispersive_dline { t_object x_obj; t_float lambda; int length; int channels; int size; t_float *z; t_float *tap; t_atom *list_out; t_outlet *list_outlet; } t_mtx_dispersive_dline; static void mtx_dispersive_dline_bang (t_mtx_dispersive_dline *x) { int count; t_atom *list = x->list_out; SETFLOAT(list, (t_float) x->channels); SETFLOAT(list+1, (t_float) x->length); list+=2; for (count=0; count < x->size; count++) { SETFLOAT(&list[count],x->tap[count]); } outlet_anything (x->list_outlet, gensym("matrix"), x->size+2, x->list_out); } static void mtx_dispersive_dline_set_lambda(t_mtx_dispersive_dline *x, t_floatarg f) { if ((f<1.0f)&&(f>-1.0f)) { x->lambda = f; } else { pd_error(x, "[mtx_dispersive_dline]: stable allpass coefficient must be -1size; count++) { x->tap[count]=0; x->z[count]=0; } } static void mtx_dispersive_dline_delete(t_mtx_dispersive_dline *x) { if(x->list_out) { freebytes(x->list_out, sizeof(t_atom)*(x->size+2)); } if(x->tap) { freebytes(x->tap, sizeof(t_float)*x->size); } if(x->z) { freebytes(x->z, sizeof(t_float)*x->size); } x->z=0; x->tap=0; x->list_out=0; } static void mtx_dispersive_dline_resize(t_mtx_dispersive_dline *x, t_symbol *s, int argc, t_atom *argv) { int length=(int)atom_getfloat(argv); int channels=x->channels; int size=length*channels; (void)s; /* unused */ if (argc>1) { channels=(int)atom_getfloat(argv+1); size=length*channels; if ((channels<1)||(channels>1000)) { pd_error(x, "[mtx_dispersive_dline]: number of channels (input rows) must lie between 1 and 1000!"); return; } } if ((length<1)||(length>10000)) { pd_error(x, "[mtx_dispersive_dline]: length not between 1 and 10000!"); return; } if ((x->size!=size)) { mtx_dispersive_dline_delete(x); if(!(x->list_out=(t_atom*) getbytes(sizeof(t_atom)*(size+2)))) { pd_error(x, "[mtx_dispersive_dline]: out of memory"); mtx_dispersive_dline_delete(x); return; } if(!(x->tap=(t_float*) getbytes(sizeof(t_float)*size))) { pd_error(x, "[mtx_dispersive_dline]: out of memory"); mtx_dispersive_dline_delete(x); return; } if(!(x->z = (t_float*) getbytes(sizeof(t_float)*size))) { pd_error(x, "[mtx_dispersive_dline]: out of memory"); mtx_dispersive_dline_delete(x); return; } x->length=length; x->channels=channels; x->size=size; } } static void allpass_chain_cycle (t_float x, t_float *y, t_float *z, int n, t_float a) { t_float w, in; int c; in = y[0] = x; // z[0] unused here for (c=1; clength); SETFLOAT(resize_msg+1,(t_float)channels); mtx_dispersive_dline_resize(x,gensym("resize"),2,resize_msg); logpost(x, 4, "%d new size",x->size); argv+=2; for (c=0, n2=0; csize; c+=x->length) { for (n=0; ntap+c,x->z+c,x->length, x->lambda); } } mtx_dispersive_dline_bang(x); } static void mtx_dispersive_dline_helper(void) { post("\n%c mtx_dispersive_dline~-object for warping a signal"); post("'help' : view this\n" "signal~"); post("outlet : signal~"); } static void *mtx_dispersive_dline_new(t_symbol *s, int argc, t_atom *argv) { t_mtx_dispersive_dline *x = (t_mtx_dispersive_dline *)pd_new( mtx_dispersive_dline_class); t_float length=1; t_float lambda=0; t_atom resize_msg[2]; (void)s; /* unused */ x->list_outlet = outlet_new(&x->x_obj, &s_list); switch ((argc>2)?2:argc) { case 2: lambda=atom_getfloat(argv+1); /* fall through */ case 1: length=atom_getfloat(argv); } x->length=0; x->channels=0; x->size=0; x->z=0; x->tap=0; x->list_out=0; mtx_dispersive_dline_set_lambda (x,lambda); SETFLOAT(resize_msg,(t_float)length); SETFLOAT(resize_msg+1,(t_float)1); mtx_dispersive_dline_resize (x,gensym("resize"),2,resize_msg); mtx_dispersive_dline_reset (x); return (x); } void mtx_dispersive_dline_setup(void) { mtx_dispersive_dline_class = class_new( gensym("mtx_dispersive_dline"), (t_newmethod)mtx_dispersive_dline_new, (t_method)mtx_dispersive_dline_delete, sizeof(t_mtx_dispersive_dline), CLASS_DEFAULT, A_GIMME,0); class_addmethod (mtx_dispersive_dline_class, (t_method) mtx_dispersive_dline_matrix, gensym("matrix"),A_GIMME,0); class_addmethod (mtx_dispersive_dline_class, (t_method) mtx_dispersive_dline_reset, gensym("reset"), 0); class_addmethod (mtx_dispersive_dline_class, (t_method) mtx_dispersive_dline_resize, gensym("resize"), A_GIMME,0); class_addmethod (mtx_dispersive_dline_class, (t_method) mtx_dispersive_dline_set_lambda, gensym("lambda"), A_DEFFLOAT,0); class_addmethod(mtx_dispersive_dline_class, (t_method)mtx_dispersive_dline_helper, gensym("help"), 0); } void iemtx_dispersive_dline_setup(void) { mtx_dispersive_dline_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_distance2.c000066400000000000000000000052021514557770000247200ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_distance2: gets the euclidean distances (squared) between 2 sets of n-dimensional vectors */ /* -­------------------------------------------------------------- */ /* matrix math */ /* mtx_distance2 */ static t_class *mtx_distance2_class; static void mtx_distance2_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); int row2=0, col2=0; t_atom *m; t_atom *m1 = argv+2; t_atom *m2 = x->m2.atombuffer+2; int i, j; (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; row2=x->m2.row; col2=x->m2.col; if (!(col2 && row2)) { /* 2nd matrix is NULL; take the 1st matrix instead (distance between it's own vectors) */ m2=argv+2; row2=row; col2=col; } else if (col!=col2) { pd_error(x, "[mtx_distance2]: matrix dimensions do not match"); return; } adjustsize(x, &x->m, row, row2); m = x->m.atombuffer+2; for(i=0; ix_obj.ob_outlet, gensym("matrix"), row*row2+2, x->m.atombuffer); } static void *mtx_distance2_new(void) { t_mtx_binmtx *x = (t_mtx_binmtx *)pd_new(mtx_distance2_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym("")); outlet_new(&x->x_obj, 0); x->m.col = x->m.row = x->m2.col = x->m2.row = 0; x->m.atombuffer = x->m2.atombuffer = 0; return(x); } void mtx_distance2_setup(void) { mtx_distance2_class = class_new(gensym("mtx_distance2"), (t_newmethod)mtx_distance2_new, (t_method)mtx_binmtx_free, sizeof(t_mtx_binmtx), 0, A_NULL, 0); class_addmethod(mtx_distance2_class, (t_method)mtx_distance2_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(mtx_distance2_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0); class_addbang (mtx_distance2_class, mtx_binmtx_bang); } void iemtx_distance2_setup(void) { mtx_distance2_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_div.c000066400000000000000000000011211514557770000236220ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1 / f2; } void mtx_div_setup(void) { iemmatrix_binop_setup("mtx_./", "mtx_mul", binop, (char*)0); } void iemtx_div_setup(void) { mtx_div_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_egg.c000066400000000000000000000030341514557770000236070ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_egg */ static t_class *mtx_egg_class; static void *mtx_egg_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_egg_class); int col=0, row=0; (void)s; /* unused */ outlet_new(&x->x_obj, 0); switch(argc) { case 0: break; case 1: col=row=atom_getfloat(argv); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); } if(col<0) { col=0; } if(row<0) { row=0; } if (col && row) { int n = (colm.atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom)); setdimen(&x->m, row, col); matrix_set(&x->m, 0); while(n--) { SETFLOAT(x->m.atombuffer+2+(n+1)*(col-1), 1); } } return (x); } void mtx_egg_setup(void) { mtx_egg_class = class_new(gensym("mtx_egg"), (t_newmethod)mtx_egg_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist(mtx_egg_class, matrixobj_egg); class_addbang(mtx_egg_class, matrixobj_bang); class_addmethod(mtx_egg_class, (t_method)matrixobj_egg, gensym("matrix"), A_GIMME, 0); } void iemtx_egg_setup(void) { mtx_egg_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_eig.c000066400000000000000000000173071514557770000236210ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * this functions depends on the GNU scientific library * * Copyright (c) 2009, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_stub.h" #include //#undef HAVE_GSL_EIGEN_NONSYMM #ifdef HAVE_GSL_EIGEN_NONSYMM #include #else #include "stub/gsl.h" #endif typedef int(*t_eigen_nonsymm)(gsl_matrix*, gsl_vector_complex*, gsl_eigen_nonsymm_workspace*); typedef int(*t_eigen_nonsymmv)(gsl_matrix*, gsl_vector_complex*, gsl_matrix_complex*, gsl_eigen_nonsymmv_workspace*); IEMMATRIX_DECLARE_ALLOCFREE2_STUB(my_matrix); IEMMATRIX_DECLARE_ALLOCFREE2_STUB(my_matrix_complex); IEMMATRIX_DECLARE_ALLOCFREE_STUB(my_vector_complex); IEMMATRIX_DECLARE_ALLOCFREE_STUB(my_eigen_nonsymmv); IEMMATRIX_DECLARE_ALLOCFREE_STUB(my_eigen_nonsymm); static t_eigen_nonsymm my_eigen_nonsymm = 0; static t_eigen_nonsymmv my_eigen_nonsymmv = 0; static int have_gsl = 0; static t_class *mtx_eig_class; enum WithEigenVectors {WITHEVS=1, WITHOUTEVS=0}; typedef struct _MTXEig_ MTXEig; struct _MTXEig_ { t_object x_obj; gsl_matrix *a; gsl_matrix_complex *q; gsl_vector_complex *l; gsl_eigen_nonsymm_workspace *w; gsl_eigen_nonsymmv_workspace *wv; t_outlet *list_q_out_re; t_outlet *list_q_out_im; t_outlet *list_l_out_re; t_outlet *list_l_out_im; t_atom *list_q_re; t_atom *list_q_im; t_atom *list_l_re; t_atom *list_l_im; int size; enum WithEigenVectors withevs; }; static void allocMTXqlw (MTXEig *x) { if (!have_gsl)return; x->a=(gsl_matrix*)my_matrix_alloc(x->size,x->size); x->l=(gsl_vector_complex*)my_vector_complex_alloc(x->size); switch (x->withevs) { case WITHEVS: x->wv=(gsl_eigen_nonsymmv_workspace*)my_eigen_nonsymmv_alloc(x->size); x->q=(gsl_matrix_complex*)my_matrix_complex_alloc(x->size,x->size); break; case WITHOUTEVS: x->w=(gsl_eigen_nonsymm_workspace*)my_eigen_nonsymm_alloc(x->size); } x->list_q_re=(t_atom*)calloc(x->size*x->size+2, sizeof(t_atom)); x->list_q_im=(t_atom*)calloc(x->size*x->size+2, sizeof(t_atom)); x->list_l_re=(t_atom*)calloc(x->size, sizeof(t_atom)); x->list_l_im=(t_atom*)calloc(x->size, sizeof(t_atom)); } static void deleteMTXqlw (MTXEig *x) { if (x->list_q_re!=0) { free(x->list_q_re); } if (x->list_q_im!=0) { free(x->list_q_im); } if (x->list_l_re!=0) { free(x->list_l_re); } if (x->list_l_im!=0) { free(x->list_l_im); } x->list_q_re = 0; x->list_q_im = 0; x->list_l_re = 0; x->list_l_im = 0; if (have_gsl) { if (x->a!=0) { my_matrix_free(x->a); } if (x->q!=0) { my_matrix_complex_free(x->q); } if (x->l!=0) { my_vector_complex_free(x->l); } if (x->w!=0) { my_eigen_nonsymm_free(x->w); } if (x->wv!=0) { my_eigen_nonsymmv_free(x->wv); } } x->a = 0; x->q = 0; x->l = 0; x->w = 0; x->wv = 0; } static void deleteMTXEig (MTXEig *x) { deleteMTXqlw(x); } static void *newMTXEig (t_symbol *s, int argc, t_atom *argv) { MTXEig *x = (MTXEig *) pd_new (mtx_eig_class); x->list_l_out_re = outlet_new (&x->x_obj, gensym("list")); x->list_l_out_im = outlet_new (&x->x_obj, gensym("list")); if (argc && atom_getsymbol(argv)==gensym("v")) { x->withevs=1; x->list_q_out_re = outlet_new (&x->x_obj, gensym("matrix")); x->list_q_out_im = outlet_new (&x->x_obj, gensym("matrix")); } if (!have_gsl) { static int warn_gsl = 1; if(warn_gsl) #ifdef HAVE_GSL_EIGEN_NONSYMM pd_error(x, "[%s] couldn't find (recent enough) GSL", s->s_name); #else pd_error(x, "[%s] compiled without GSL", s->s_name); #endif warn_gsl = 0; } return ((void *) x); } static void mTXEigBang (MTXEig *x) { if (!have_gsl)return; if (x->list_l_re) { switch (x->withevs) { case WITHEVS: outlet_anything(x->list_q_out_im, gensym("matrix"), x->size*x->size+2, x->list_q_im); outlet_anything(x->list_q_out_re, gensym("matrix"), x->size*x->size+2, x->list_q_re); /* fall through */ case WITHOUTEVS: outlet_anything(x->list_l_out_im, gensym("list"), x->size, x->list_l_im); outlet_anything(x->list_l_out_re, gensym("list"), x->size, x->list_l_re); } } } static void mTXEigMatrix (MTXEig *x, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; int n; float f; (void)s; /* unused */ if (!have_gsl) { return; } /* size check */ if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); size=rows*columns; if (rows!=columns) { pd_error(x, "[mtx_eig]: Eigendecomposition works for square matrices only!"); return; } size=rows; x->size=size; int size2 = size*size; deleteMTXqlw(x); allocMTXqlw(x); for (n=0; na->data[n]=(double) atom_getfloat(argv++); } switch (x->withevs) { case WITHOUTEVS: my_eigen_nonsymm(x->a,x->l,x->w); break; case WITHEVS: my_eigen_nonsymmv(x->a, x->l, x->q, x->wv); SETFLOAT((x->list_q_re+0),(t_float) x->size); SETFLOAT((x->list_q_re+1),(t_float) x->size); SETFLOAT((x->list_q_im+1),(t_float) x->size); SETFLOAT((x->list_q_im+0),(t_float) x->size); for (n=0; n<(size2); n++) { SETFLOAT((x->list_q_re+2+n), (t_float) x->q->data[2*n+0]); SETFLOAT((x->list_q_im+2+n), (t_float) x->q->data[2*n+1]); } break; } for (n=0; nsize; n++) { f=(float) GSL_VECTOR_IMAG(x->l, n); SETFLOAT((x->list_l_im+n), f); f=(float) GSL_VECTOR_REAL(x->l, n); SETFLOAT((x->list_l_re+n), f); } mTXEigBang(x); } void mtx_eig_setup (void) { mtx_eig_class = class_new (gensym("mtx_eig"), (t_newmethod) newMTXEig, (t_method) deleteMTXEig, sizeof (MTXEig), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_eig_class, (t_method) mTXEigBang); class_addmethod (mtx_eig_class, (t_method) mTXEigMatrix, gensym("matrix"), A_GIMME,0); #ifdef HAVE_GSL_EIGEN_NONSYMM my_matrix_alloc = iemmatrix_get_stub("gsl_matrix_alloc", mtx_eig_class); my_matrix_free = iemmatrix_get_stub("gsl_matrix_free", mtx_eig_class); my_matrix_complex_alloc = iemmatrix_get_stub("gsl_matrix_complex_alloc", mtx_eig_class); my_matrix_complex_free = iemmatrix_get_stub("gsl_matrix_complex_free", mtx_eig_class); my_vector_complex_alloc = iemmatrix_get_stub("gsl_vector_complex_alloc", mtx_eig_class); my_vector_complex_free = iemmatrix_get_stub("gsl_vector_complex_free", mtx_eig_class); my_eigen_nonsymmv_alloc = iemmatrix_get_stub("gsl_eigen_nonsymmv_alloc", mtx_eig_class); my_eigen_nonsymmv_free = iemmatrix_get_stub("gsl_eigen_nonsymmv_free", mtx_eig_class); my_eigen_nonsymm_alloc = iemmatrix_get_stub("gsl_eigen_nonsymm_alloc", mtx_eig_class); my_eigen_nonsymm_free = iemmatrix_get_stub("gsl_eigen_nonsymm_free", mtx_eig_class); my_eigen_nonsymm = iemmatrix_get_stub("gsl_eigen_nonsymm", mtx_eig_class); my_eigen_nonsymmv = iemmatrix_get_stub("gsl_eigen_nonsymmv", mtx_eig_class); #endif have_gsl = ( my_matrix_alloc && my_matrix_free && my_vector_complex_alloc && my_vector_complex_free && my_eigen_nonsymmv_alloc && my_eigen_nonsymmv_free && my_matrix_complex_alloc && my_matrix_complex_free && my_eigen_nonsymm_alloc && my_eigen_nonsymm_free && my_eigen_nonsymm_free && my_eigen_nonsymmv_free ); } void iemtx_eig_setup(void) { mtx_eig_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_element.c000066400000000000000000000067101514557770000245020ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_element */ static t_class *mtx_element_class; static void mtx_element_list2(t_matrixobj *x, t_floatarg f1, t_floatarg f2) { int r = f1, c= f2; if(r<0) { r=0; } if(c<0) { c=0; } x->current_row = r; x->current_col = c; } static void mtx_element_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; matrix_matrix2(x, &x->m, argc, argv); matrixobj_bang(x); } static void mtx_element_float(t_matrixobj *x, t_floatarg f) { if(x->current_col>x->m.col || x->current_row>x->m.row) { pd_error(x,"[mtx_element]: element position exceeds matrix dimensions"); return; } if(x->current_row == 0 && x->current_col == 0) { matrix_set(&x->m, f); matrixobj_bang(x); return; } if(x->current_row && x->current_col) { SETFLOAT(x->m.atombuffer+1+(x->current_row-1)*x->m.col+x->current_col, f); } else { t_atom *ap=x->m.atombuffer+2; int count; if (!x->current_col) { ap+=x->m.col*(x->current_row-1); count=x->m.col; while(count--) { SETFLOAT(&ap[count], f); } } else { ap+=x->current_col-1; count=x->m.row; while(count--) { SETFLOAT(&ap[count*x->m.col], f); } } } matrixobj_bang(x); } static void *mtx_element_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_element_class); int i, j, q; (void)s; /* unused */ outlet_new(&x->x_obj, 0); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); x->current_row=x->current_col=0; x->m.col=x->m.row=0; x->m.atombuffer=0; switch (argc) { case 1: i = atom_getfloat(argv); if (i<0) { i=0; } if(i) { adjustsize(x, &x->m, i, i); } matrix_set(&x->m, 0); break; case 2: i = atom_getfloat(argv++); if(i<0) { i=0; } j = atom_getfloat(argv++); if(j<0) { j=0; } if(i && j) { adjustsize(x, &x->m, i, j); } matrix_set(&x->m, 0); break; case 4: i = atom_getfloat(argv++); if(i<0) { i=0; } j = atom_getfloat(argv++); if(j<0) { j=0; } if(i && j) { adjustsize(x, &x->m, i, j); } matrix_set(&x->m, 0); q = atom_getfloat(argv++); if(q<0) { q=0; } x->current_row=q; q = atom_getfloat(argv++); if(q<0) { q=0; } x->current_col=q; break; default: ; } return (x); } void mtx_element_setup(void) { mtx_element_class = class_new(gensym("mtx_element"), (t_newmethod)mtx_element_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addbang (mtx_element_class, matrixobj_bang); class_addfloat (mtx_element_class, mtx_element_float); class_addmethod(mtx_element_class, (t_method)mtx_element_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(mtx_element_class, (t_method)mtx_element_list2, gensym(""), A_FLOAT, A_FLOAT, 0); } void iemtx_element_setup(void) { mtx_element_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_eq.c000066400000000000000000000011171514557770000234520ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1==f2; } void mtx_eq_setup(void) { iemmatrix_binop_setup("mtx_eq", 0, binop, "mtx_==", (char*)0); } void iemtx_eq_setup(void) { mtx_eq_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_exp.c000066400000000000000000000012111514557770000236340ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_exp: B=exp(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return expf(f); #else return exp(f); #endif } void mtx_exp_setup(void) { iemmatrix_unop_setup("mtx_exp", 0, unop, (char*)0); } void iemtx_exp_setup(void) { mtx_exp_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_eye.c000066400000000000000000000032511514557770000236300ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* ------------------------------------------------------------------------------------- */ /* mtx_eye */ static t_class *mtx_eye_class; static void *mtx_eye_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_eye_class); int col=0, row=0; (void)s; /* unused */ outlet_new(&x->x_obj, 0); x->m.row = x->m.col = 0; x->m.atombuffer = 0; switch(argc) { case 0: break; case 1: col=row=atom_getfloat(argv); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); } if(col<0) { col=0; } if(row<0) { row=0; } if (col && row) { int n = (colm.atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom)); setdimen(&x->m, row, col); matrix_set(&x->m, 0); while(n--) { SETFLOAT(x->m.atombuffer+2+n*(1+col), 1); } } return (x); } void mtx_eye_setup(void) { mtx_eye_class = class_new(gensym("mtx_eye"), (t_newmethod)mtx_eye_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist(mtx_eye_class, matrixobj_eye); class_addbang(mtx_eye_class, matrixobj_bang); class_addmethod(mtx_eye_class, (t_method)matrixobj_eye, gensym("matrix"), A_GIMME, 0); } void iemtx_eye_setup(void) { mtx_eye_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_fft.c000066400000000000000000000126711514557770000236330ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_fft.h" #include static t_class *mtx_fft_class; typedef struct _MtxFFT_ MtxFFT; struct _MtxFFT_ { t_object x_obj; t_outlet *msg_re_out; t_outlet *msg_im_out; t_float *f_re, *f_im; int rows, columns; t_iemfft_plan plan; t_complex*c_in, *c_out; t_atom *msg_re; t_atom *msg_im; int msg_size; }; static void deleteMtxFFT (MtxFFT *x) { if (x->f_re) free (x->f_re); if (x->f_im) free (x->f_im); if (x->plan) iemfft_destroy_plan(x->plan); if (x->c_in) free (x->c_in); if (x->c_out) free (x->c_out); if (x->msg_re) free (x->msg_re); if (x->msg_im) free (x->msg_im); } static void *newMtxFFT () { MtxFFT *x = (MtxFFT *) pd_new (mtx_fft_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"),gensym("")); x->msg_re_out = outlet_new (&x->x_obj, gensym("matrix")); x->msg_im_out = outlet_new (&x->x_obj, gensym("matrix")); x->msg_size = 0; x->msg_re = x->msg_im = 0; x->c_in = x->c_out = 0; return ((void *) x); } static void mtxFFTBang (MtxFFT *x) { if (x->msg_size) { outlet_anything(x->msg_im_out, gensym("matrix"), x->msg_size, x->msg_im); outlet_anything(x->msg_re_out, gensym("matrix"), x->msg_size, x->msg_re); } } static void resizeFFT(MtxFFT *x, int rows, int columns) { int size = rows * columns; x->f_re = (t_float*)realloc(x->f_re, sizeof(t_float)*size); x->f_im = (t_float*)realloc(x->f_im, sizeof(t_float)*size); x->c_in = (t_complex*)realloc(x->c_in , sizeof(*x->c_in )*columns); x->c_out= (t_complex*)realloc(x->c_out, sizeof(*x->c_out)*columns); if(columns != x->columns) { if(x->plan) iemfft_destroy_plan(x->plan); x->plan = iemfft_plan_fft_1d(columns, x->c_in, x->c_out, DEFAULT); } int msgsize = size + 2; x->msg_re=(t_atom*)realloc(x->msg_re, sizeof(*x->msg_re)*msgsize); x->msg_im=(t_atom*)realloc(x->msg_im, sizeof(*x->msg_im)*msgsize); x->msg_size = size; x->rows = rows; x->columns = columns; } static void mtxFFTMatrixCold (MtxFFT *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ /* fftsize check */ if(iemmatrix_check(x, s, argc, argv, 0))return; int rows = atom_getint (argv++); int columns = atom_getint (argv++); int size = rows * columns; if (columns < 4) { pd_error(x, "[mtx_fft]: matrix must have at least 4 columns"); return; } else if (columns != (1 << ilog2(columns))) { pd_error(x, "[mtx_fft]: rowvector size no power of 2!"); return; } /* ok, prepare real-part of FFT! */ /* memory things */ if((rows != x->rows) || (columns != x->columns)) { resizeFFT(x, rows, columns); } /* main part */ iemmatrix_list2floats(x->f_im, argv, size); } static void mtxFFTMatrixHot (MtxFFT *x, t_symbol *s, int argc, t_atom *argv) { int rows, columns, msg_size; (void)s; /* unused */ /* fftsize check */ if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); msg_size = rows * columns; if (msg_size != x->msg_size) { pd_error(x, "[mtx_fft]: left matrix has other dimensions than right matrix"); return; } else if (columns < 4) { pd_error(x, "[mtx_fft]: matrix must have at least 4 columns"); return; } else if (columns != (1 << ilog2(columns))) { pd_error(x, "[mtx_fft]: rowvector size no power of 2!"); return; } /* ok, do the FFT! */ /* memory things */ if((rows != x->rows) || (columns != x->columns)) { resizeFFT(x, rows, columns); } /* main part */ iemmatrix_list2floats(x->f_re, argv, msg_size); /* main part */ t_float *f_re = x->f_re, *f_im = x->f_im; t_atom *msg_re = x->msg_re + 2, *msg_im = x->msg_im + 2; for(int r=0; r < rows; r++) { t_complex*c = x->c_in; for(int col=0; col < columns; col++) { c->re = *f_re++; c->im = *f_im++; c++; } iemfft_execute(x->plan); c = x->c_out; for(int col=0; col < columns; col++) { t_float re = c->re, im = c->im; SETFLOAT(msg_re, re); SETFLOAT(msg_im, im); c++; msg_re++; msg_im++; } } msg_re = x->msg_re; msg_im = x->msg_im; SETSYMBOL(msg_re, gensym("matrix")); SETSYMBOL(msg_im, gensym("matrix")); SETFLOAT(msg_re+0, rows); SETFLOAT(msg_im+0, rows); SETFLOAT(msg_re+1, columns); SETFLOAT(msg_im+1, columns); outlet_anything(x->msg_im_out, gensym("matrix"), x->msg_size+2, msg_im); outlet_anything(x->msg_re_out, gensym("matrix"), x->msg_size+2, msg_re); } void mtx_fft_setup (void) { mtx_fft_class = class_new (gensym("mtx_fft"), (t_newmethod) newMtxFFT, (t_method) deleteMtxFFT, sizeof (MtxFFT), CLASS_DEFAULT, 0); class_addbang (mtx_fft_class, (t_method) mtxFFTBang); class_addmethod (mtx_fft_class, (t_method) mtxFFTMatrixHot, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_fft_class, (t_method) mtxFFTMatrixCold, gensym(""), A_GIMME,0); iemfft_init(mtx_fft_class); } void iemtx_fft_setup(void) { mtx_fft_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_fill.c000066400000000000000000000227511514557770000240020ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" typedef enum { FILL_SUBMATRIX, FILL_INDEXED_ELEMENTS, DONT_FILL_JUST_PASS } FillStyle; static t_class *mtx_fill_class; typedef struct _MTXfill_ MTXfill; struct _MTXfill_ { t_object x_obj; int size; int rows; int columns; int fill_startcol; int fill_startrow; int *index; int index_size; int num_idcs_used; int max_index; FillStyle fill_type; t_outlet *list_outlet; t_atom *list_out; }; static void deleteMTXFill (MTXfill *mtx_fill_obj) { if (mtx_fill_obj->list_out) { freebytes (mtx_fill_obj->list_out, sizeof(t_atom)*(mtx_fill_obj->size+2)); } if (mtx_fill_obj->index) { freebytes (mtx_fill_obj->index, sizeof(int)*(mtx_fill_obj->index_size)); } } static void copyList (int size, t_atom *x, t_atom *y) { while(size--) { *y++=*x++; } } static int copyNonZeroAtomsToIntegerArrayMax (int *size, t_atom *x, int *y) { int idx; int n = *size; int max = atom_getint(x); *size = 0; for (; n--; x++) { idx = atom_getint (x); if (idx) { size[0]++; *y++ = idx; max = (idx > max)?idx:max; } } return max; } static void writeIndexedValuesIntoMatrix (int n, int *idx, t_atom *x, t_atom *y) { for (; n--; idx++,x++) if (*idx) { y[*idx-1] = *x; } } static void writeFloatIndexedIntoMatrix (int n, int *idx, t_float f, t_atom *y) { for (; n--; idx++) if (*idx) { SETFLOAT(&y[*idx-1], f); } } static void mTXFillIndexMatrix (MTXfill *mtx_fill_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv++); int columns = atom_getint (argv++); int size = rows * columns; int list_size = argc - 2; int *idx = mtx_fill_obj->index; (void)s; /* unused */ /* size check */ if (!size) { mtx_fill_obj->fill_type = DONT_FILL_JUST_PASS; return; } if (list_size == 0) { if ((rows<1) || (columns<1)) { pd_error(mtx_fill_obj, "[mtx_fill]: row and column indices must be >0"); mtx_fill_obj->fill_type = DONT_FILL_JUST_PASS; return; } mtx_fill_obj->fill_startrow = rows; mtx_fill_obj->fill_startcol = columns; mtx_fill_obj->fill_type = FILL_SUBMATRIX; } else if (list_sizefill_type = DONT_FILL_JUST_PASS; return; } else { if (size > mtx_fill_obj->index_size) { if (!idx) { idx = (int *) getbytes (sizeof (int) * (size + 2)); } else idx = (int *) resizebytes (idx, sizeof (int) * (mtx_fill_obj->index_size+2), sizeof (t_atom) * (size + 2)); mtx_fill_obj->index_size = size; mtx_fill_obj->index = idx; } mtx_fill_obj->max_index = copyNonZeroAtomsToIntegerArrayMax (&size, argv++, idx); mtx_fill_obj->num_idcs_used = size; if (!size) { mtx_fill_obj->fill_type = DONT_FILL_JUST_PASS; } else { mtx_fill_obj->fill_type = FILL_INDEXED_ELEMENTS; } } } static void *newMTXFill (t_symbol *s, int argc, t_atom *argv) { MTXfill *mtx_fill_obj = (MTXfill *) pd_new (mtx_fill_class); mtx_fill_obj->size = 0; mtx_fill_obj->fill_startrow = 1; mtx_fill_obj->fill_startcol = 1; mtx_fill_obj->fill_type = DONT_FILL_JUST_PASS; pd_error(mtx_fill_obj, "[%s]: this object _might_ change in the future!", s->s_name); if (argc) { if (atom_getsymbol(argv)==gensym("matrix")) { mTXFillIndexMatrix (mtx_fill_obj, s, argc-1, argv+1); } else { pd_error(mtx_fill_obj, "%s: creation argument must be 'matrix ' for submatrix filling or 'matrix rows columns [...]' for indexed filling with scalar/matrices", s->s_name); } } mtx_fill_obj->list_outlet = outlet_new (&mtx_fill_obj->x_obj, gensym("matrix")); inlet_new(&mtx_fill_obj->x_obj, &mtx_fill_obj->x_obj.ob_pd, gensym("matrix"),gensym("fill_mtx")); inlet_new(&mtx_fill_obj->x_obj, &mtx_fill_obj->x_obj.ob_pd, gensym("matrix"),gensym("index")); return ((void *) mtx_fill_obj); } static void mTXBigMatrix (MTXfill *mtx_fill_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv); int columns = atom_getint (argv+1); int size = rows * columns; t_atom *list_out = mtx_fill_obj->list_out; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_fill_obj, s, argc, argv, 0))return; if (size != mtx_fill_obj->size) { if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size + 2)); } else list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_fill_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_fill_obj->size = size; mtx_fill_obj->columns = columns; mtx_fill_obj->rows = rows; mtx_fill_obj->list_out = list_out; memcpy(list_out,argv,argc*sizeof(t_atom)); } static void mTXFillBang (MTXfill *mtx_fill_obj) { if (mtx_fill_obj->list_out) outlet_anything(mtx_fill_obj->list_outlet, gensym("matrix"), mtx_fill_obj->size+2, mtx_fill_obj->list_out); } static void writeFillMatrixIntoList (int fillrows, const int fillcols, int columns, t_atom *x, t_atom *y) { for (; fillrows--; x+=fillcols,y+=columns) { copyList(fillcols, x, y); } } static void mTXFillScalar (MTXfill *mtx_fill_obj, t_float f) { t_atom *list_out = mtx_fill_obj->list_out; switch (mtx_fill_obj->fill_type) { case FILL_SUBMATRIX: pd_error(mtx_fill_obj, "[mtx_fill]: scalar fill for submatrices not supported yet"); return; break; /* coverity[unterminated_case]: fall thru to matrix output */ case FILL_INDEXED_ELEMENTS: if (mtx_fill_obj->max_index > mtx_fill_obj->size) { pd_error(mtx_fill_obj, "[mtx_fill]: index matrix index exceeds matrix borders"); return; } if (mtx_fill_obj->size == 0) { pd_error(mtx_fill_obj, "[mtx_fill]: no matrix defined for filling"); return; } /* main part */ writeFloatIndexedIntoMatrix (mtx_fill_obj->num_idcs_used, mtx_fill_obj->index, f,list_out+2); /* fall through */ default: mTXFillBang(mtx_fill_obj); } } static void mTXFillMatrix (MTXfill *mtx_fill_obj, t_symbol *s, int argc, t_atom *argv) { int fill_rows = atom_getint (argv++); int fill_columns = atom_getint (argv++); int fill_size = fill_rows * fill_columns; int list_size = argc - 2; int rows = mtx_fill_obj->rows; int columns = mtx_fill_obj->columns; t_atom *fill_mtx = argv; t_atom *list_out = mtx_fill_obj->list_out; int stopcol = mtx_fill_obj->fill_startcol+fill_columns-1; int stoprow = mtx_fill_obj->fill_startrow+fill_rows-1; (void)s; /* unused */ if (mtx_fill_obj->fill_type == DONT_FILL_JUST_PASS) { mTXFillBang(mtx_fill_obj); return; } /* size check */ if (!list_size) { pd_error(mtx_fill_obj, "[mtx_fill]: invalid dimensions"); return; } switch (mtx_fill_obj->fill_type) { case FILL_SUBMATRIX: if (list_size < fill_size) { pd_error(mtx_fill_obj, "[mtx_fill]: sparse matrix not yet supported: use [mtx_check]"); return; } if ((stopcol > columns) || (stoprow > rows)) { pd_error(mtx_fill_obj, "[mtx_fill]: fill matrix index exceeds matrix borders"); return; } break; case FILL_INDEXED_ELEMENTS: if (list_size < mtx_fill_obj->num_idcs_used) { pd_error(mtx_fill_obj, "[mtx_fill]: fill matrix smaller than indexing vector"); return; } else if (mtx_fill_obj->max_index > mtx_fill_obj->size) { pd_error(mtx_fill_obj, "[mtx_fill]: index matrix index exceeds matrix borders"); return; } break; case DONT_FILL_JUST_PASS: break; } if (mtx_fill_obj->size == 0) { pd_error(mtx_fill_obj, "[mtx_fill]: no matrix defined for filling"); return; } /* main part */ switch (mtx_fill_obj->fill_type) { case FILL_SUBMATRIX: list_out += columns * (mtx_fill_obj->fill_startrow-1) + mtx_fill_obj->fill_startcol-1; writeFillMatrixIntoList (fill_rows, fill_columns, columns, fill_mtx, list_out+2); break; case FILL_INDEXED_ELEMENTS: writeIndexedValuesIntoMatrix (mtx_fill_obj->num_idcs_used, mtx_fill_obj->index, fill_mtx,list_out+2); break; case DONT_FILL_JUST_PASS: break; } mTXFillBang(mtx_fill_obj); } void mtx_fill_setup (void) { mtx_fill_class = class_new (gensym("mtx_fill"), (t_newmethod) newMTXFill, (t_method) deleteMTXFill, sizeof (MTXfill), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_fill_class, (t_method) mTXFillBang); class_addmethod (mtx_fill_class, (t_method) mTXFillMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_fill_class, (t_method) mTXBigMatrix, gensym("fill_mtx"), A_GIMME,0); class_addmethod (mtx_fill_class, (t_method) mTXFillIndexMatrix, gensym("index"), A_GIMME,0); class_addfloat (mtx_fill_class, (t_method) mTXFillScalar); } void iemtx_fill_setup(void) { mtx_fill_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_find.c000066400000000000000000000231011514557770000237620ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_find_class; static t_symbol *row_sym; static t_symbol *col_sym; static t_symbol *col_sym2; static t_symbol *mtx_sym; static t_symbol *mtx_sym2; typedef struct _MTXfind_ MTXfind; struct _MTXfind_ { t_object x_obj; int size; int outsize; t_symbol *find_mode; int find_direction; t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; }; static void deleteMTXFind (MTXfind *mtx_find_obj) { if (mtx_find_obj->list_out) { freebytes (mtx_find_obj->list_out, sizeof(t_atom)*(mtx_find_obj->size+2)); } } static void mTXSetFindDirection (MTXfind *mtx_find_obj, t_float c_dir) { int direction = (int) c_dir; if ((direction != -1) && (direction != 1)) { direction = 1; } mtx_find_obj->find_direction = direction; } /* static void mTXSetFindDimension (MTXfind *mtx_find_obj, t_float c_dim) { int dimension = (int) c_dim; dimension = (dimension > 0)?dimension:0; dimension = (dimension < 3)?dimension:3; mtx_find_obj->find_dimension = dimension; } */ static void mTXSetFindMode (MTXfind *mtx_find_obj, t_symbol *c_dim) { mtx_find_obj->find_mode = c_dim; } static void *newMTXFind (t_symbol *s, int argc, t_atom *argv) { MTXfind *mtx_find_obj = (MTXfind *) pd_new (mtx_find_class); mTXSetFindMode (mtx_find_obj, gensym(":")); mTXSetFindDirection (mtx_find_obj, 1); if (argc>=1) { if (argv[0].a_type == A_SYMBOL) { mTXSetFindMode (mtx_find_obj, atom_getsymbol (argv)); if (argc>=2) { if (argv[1].a_type != A_SYMBOL) { mTXSetFindDirection (mtx_find_obj, atom_getfloat (argv+1)); } else { pd_error(mtx_find_obj, "[%s]: 2nd arg ignored. supposed to be float", s->s_name); } } } else { mTXSetFindDirection (mtx_find_obj, atom_getfloat (argv)); if (argc>=2) { if (argv[1].a_type == A_SYMBOL) { mTXSetFindMode (mtx_find_obj, atom_getsymbol (argv+1)); } else { pd_error(mtx_find_obj, "[%s]: 2nd arg ignored. supposed to be symbolic, e.g. \"row\", \"col\", \":\", \"mtx\"", s->s_name); } } } } /* switch ((argc>2)?2:argc) { case 2: c_dir = atom_getint(argv+1); case 1: c_dim = atom_getint(argv); } mTXSetFindDimension (mtx_find_obj, (t_float) c_dim); mTXSetFindDirection (mtx_find_obj, (t_float) c_dir); */ mtx_find_obj->list_outlet = outlet_new (&mtx_find_obj->x_obj, gensym("matrix")); pd_error(mtx_find_obj, "[mtx_find]: this object is likely to change! not really for use yet"); return ((void *) mtx_find_obj); } static void mTXFindBang (MTXfind *mtx_find_obj) { if (mtx_find_obj->list_out) outlet_anything(mtx_find_obj->list_outlet, gensym("matrix"), mtx_find_obj->outsize+2, mtx_find_obj->list_out); } /* static void copyList (int size, t_atom *x, t_atom *y) { while(size--) *y++=*x++; } */ static int findPreviousNonZero (const int n, t_atom *x, int offset) { x+=offset; for (; offset > n; offset--, x--) if (atom_getfloat(x)) { return offset; } return -1; } static int findPreviousNonZeroStep (const int step, t_atom *x, int offset) { x += offset; for (; offset >= 0; offset-=step, x-=step) if (atom_getfloat(x)) { return offset; } return -1; } static int findNextNonZero (const int n, t_atom *x, int offset) { x+=offset; for (; offset < n; offset++, x++) if (atom_getfloat(x)) { return offset; } return -1; } static int findNextNonZeroStep (const int n, const int step, t_atom *x, int offset) { x += offset; for (; offset < n; offset+=step, x+=step) if (atom_getfloat(x)) { return offset; } return -1; } static void findFirstNonZeroRow (const int rows, const int columns, t_atom *x, t_atom *y) { int offset; int pos; const int size = rows*columns; for (offset = 0; offset < size; y++, offset+=columns) { pos = findNextNonZero(offset+columns,x,offset)+1; SETFLOAT(y,(t_float)pos); } } static void findLastNonZeroRow (const int rows, const int columns, t_atom *x, t_atom *y) { int offset; int pos; const int size = rows*columns; for (offset = columns-1; offset < size; y++, offset+=columns) { pos = findPreviousNonZero(offset-columns,x,offset)+1; SETFLOAT(y,(t_float)pos); } } static void findFirstNonZeroColumn (const int rows, const int columns, t_atom *x, t_atom *y) { int offset; int pos; const int size = rows*columns; for (offset = 0; offset < columns; y++, offset++) { pos = findNextNonZeroStep(size,columns,x,offset)+1; SETFLOAT(y,(t_float)pos); } } static void findLastNonZeroColumn (const int rows, const int columns, t_atom *x, t_atom *y) { int offset; int pos; const int size = rows*columns; for (offset = size-columns; offset < size; y++, offset++) { pos = findPreviousNonZeroStep(columns,x,offset)+1; SETFLOAT(y,(t_float)pos); } } static int findAllNonZeros (int n, t_atom *x, t_atom *y) { int outsize = 0; int pos = 0; while ((pos = findNextNonZero(n,x,pos)) != -1) { pos++; SETFLOAT(y,(t_float)pos); y++; outsize++; } return outsize; } static void zeroFloatList (int n, t_atom *x) { for (; n--; x++) { SETFLOAT(x,0); } } static void findReplaceNonZerosWithIndex (int n, t_atom *x, t_atom *y) { int pos = 0; zeroFloatList(n,y); while ((pos = findNextNonZero(n,x,pos)) != -1) { SETFLOAT(y+pos,(t_float)pos+1); pos++; } } static void mTXFindMatrix (MTXfind *mtx_find_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); int size = rows * columns; t_atom *list_in = argv+2; t_atom *list_out = mtx_find_obj->list_out; int rows_out; int columns_out; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_find_obj, s, argc, argv, 0))return; if (size != mtx_find_obj->size) { if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size + 2)); } else list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_find_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_find_obj->size = size; mtx_find_obj->list_out = list_out; /* main part */ list_out += 2; rows_out = 1; if (mtx_find_obj->find_mode == row_sym) { if (mtx_find_obj->find_direction == -1) { findLastNonZeroRow (rows, columns, list_in, list_out); } else { findFirstNonZeroRow (rows, columns, list_in, list_out); } rows_out = rows; columns_out = 1; } else if ((mtx_find_obj->find_mode == col_sym)|| (mtx_find_obj->find_mode == col_sym2)) { if (mtx_find_obj->find_direction == -1) { findLastNonZeroColumn (rows, columns, list_in, list_out); } else { findFirstNonZeroColumn (rows, columns, list_in, list_out); } columns_out = columns; rows_out = 1; } else if ((mtx_find_obj->find_mode == mtx_sym)|| (mtx_find_obj->find_mode == mtx_sym2)) { findReplaceNonZerosWithIndex (size, list_in, list_out); rows_out = rows; columns_out = columns; } else { columns_out = findAllNonZeros (size, list_in, list_out); rows_out = 1; } /* switch (mtx_find_obj->find_dimension) { case 0: columns_out = findAllNonZeros (size, list_in, list_out); rows_out = 1; break; case 3: findReplaceNonZerosWithIndex (size, list_in, list_out); rows_out = rows; columns_out = columns; break; case 2: if (mtx_find_obj->find_direction == -1) findLastNonZeroColumn (rows, columns, list_in, list_out); else findFirstNonZeroColumn (rows, columns, list_in, list_out); columns_out = columns; rows_out = 1; break; case 1: if (mtx_find_obj->find_direction == -1) findLastNonZeroRow (rows, columns, list_in, list_out); else findFirstNonZeroRow (rows, columns, list_in, list_out); rows_out = rows; columns_out = 1; break; } */ mtx_find_obj->outsize = columns_out * rows_out; list_out = mtx_find_obj->list_out; SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, rows_out); SETFLOAT(&list_out[1], columns_out); outlet_anything(mtx_find_obj->list_outlet, gensym("matrix"), mtx_find_obj->outsize+2, list_out); } void mtx_find_setup (void) { mtx_find_class = class_new (gensym("mtx_find"), (t_newmethod) newMTXFind, (t_method) deleteMTXFind, sizeof (MTXfind), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_find_class, (t_method) mTXFindBang); class_addmethod (mtx_find_class, (t_method) mTXFindMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_find_class, (t_method) mTXSetFindMode, gensym("mode"), A_DEFSYMBOL,0); class_addmethod (mtx_find_class, (t_method) mTXSetFindDirection, gensym("direction"), A_DEFFLOAT,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("columns"); mtx_sym = gensym("mtx"); mtx_sym2 = gensym ("matrix"); } void iemtx_find_setup(void) { mtx_find_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_gauss.c000066400000000000000000000056121514557770000241730ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_gauss */ /* * gauss elimination of a matrix (without semi-pivoting) */ static t_class *mtx_gauss_class; static void mtx_gauss_xch(t_matrixfloat*a, t_matrixfloat*b, int count) { while(count--) { t_matrixfloat dummy=*a; *a++=*b; *b++=dummy; } } static void mtx_gauss_mulsub(t_matrixfloat*a, t_matrixfloat*b, int count, t_matrixfloat f) { t_matrixfloat f2=1./f; while(count--) { t_matrixfloat dummy=(f* (*b) - *a++)*f2; *b++=dummy; } } static void mtx_gauss_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { /* maybe we should do this in double or long double ? */ int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); int i, j; const t_matrixfloat singrange = 1.0e-10; t_matrixfloat *original; t_matrixfloat *a1, *a2; /* dummy pointers */ (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; if (row!=col) { pd_error(x, "[mtx_gauss]: only square matrices can be gauss eliminated"); return; } /* reserve memory for outputting afterwards */ adjustsize(x, &x->m, row, row); original=matrix2float(argv); /* Gauss elimination */ for(i=0; isingrange)||(f<-singrange)) { nz=j; break; } a1+=col; } /*if(nz)*/ { /* exchange rows "nz" and "i" */ if(nz != i) { mtx_gauss_xch(original+i*col+i, original+nz*col+i, col-i); } for(j=i+1; jm.atombuffer, original); /* 3c output the atombuf; */ matrixobj_bang(x); } static void *mtx_gauss_new() { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_gauss_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_gauss_setup(void) { mtx_gauss_class = class_new(gensym("mtx_gauss"), (t_newmethod)mtx_gauss_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0); class_addbang (mtx_gauss_class, matrixobj_bang); class_addmethod(mtx_gauss_class, (t_method)mtx_gauss_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_gauss_setup(void) { mtx_gauss_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_ge.c000066400000000000000000000011171514557770000234400ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1>=f2; } void mtx_ge_setup(void) { iemmatrix_binop_setup("mtx_ge", 0, binop, "mtx_>=", (char*)0); } void iemtx_ge_setup(void) { mtx_ge_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_gt.c000066400000000000000000000011151514557770000234550ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1>f2; } void mtx_gt_setup(void) { iemmatrix_binop_setup("mtx_gt", 0, binop, "mtx_>", (char*)0); } void iemtx_gt_setup(void) { mtx_gt_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_ifft.c000066400000000000000000000130511514557770000237750ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_fft.h" #include static t_class *mtx_ifft_class; typedef struct _MtxIFFT_ MtxIFFT; struct _MtxIFFT_ { t_object x_obj; t_outlet *msg_re_out; t_outlet *msg_im_out; t_float *f_re, *f_im; int rows, columns; t_iemfft_plan plan; t_complex*c_in, *c_out; t_atom *msg_re; t_atom *msg_im; int msg_size; }; static void deleteMtxIFFT (MtxIFFT *x) { if (x->f_re) free (x->f_re); if (x->f_im) free (x->f_im); if (x->plan) iemfft_destroy_plan(x->plan); if (x->c_in) free (x->c_in); if (x->c_out) free (x->c_out); if (x->msg_re) free (x->msg_re); if (x->msg_im) free (x->msg_im); } static void *newMtxIFFT () { MtxIFFT *x = (MtxIFFT *) pd_new (mtx_ifft_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"),gensym("")); x->msg_re_out = outlet_new (&x->x_obj, gensym("matrix")); x->msg_im_out = outlet_new (&x->x_obj, gensym("matrix")); x->msg_size = 0; x->msg_re = x->msg_im = 0; x->c_in = x->c_out = 0; return ((void *) x); } static void mtxIFFTBang (MtxIFFT *x) { if (x->msg_size) { outlet_anything(x->msg_im_out, gensym("matrix"), x->msg_size, x->msg_im); outlet_anything(x->msg_re_out, gensym("matrix"), x->msg_size, x->msg_re); } } static void resizeFFT(MtxIFFT *x, int rows, int columns) { int size = rows * columns; x->f_re = (t_float*)realloc(x->f_re, sizeof(t_float)*size); x->f_im = (t_float*)realloc(x->f_im, sizeof(t_float)*size); x->c_in = (t_complex*)realloc(x->c_in , sizeof(*x->c_in )*columns); x->c_out= (t_complex*)realloc(x->c_out, sizeof(*x->c_out)*columns); if(columns != x->columns) { if(x->plan) iemfft_destroy_plan(x->plan); x->plan = iemfft_plan_ifft_1d(columns, x->c_in, x->c_out, DEFAULT); } int msgsize = size + 2; x->msg_re=(t_atom*)realloc(x->msg_re, sizeof(*x->msg_re)*msgsize); x->msg_im=(t_atom*)realloc(x->msg_im, sizeof(*x->msg_im)*msgsize); x->msg_size = size; x->rows = rows; x->columns = columns; } static void mtxIFFTMatrixCold (MtxIFFT *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ /* fftsize check */ if(iemmatrix_check(x, s, argc, argv, 0))return; int rows = atom_getint (argv++); int columns = atom_getint (argv++); int size = rows * columns; if (columns < 4) { pd_error(x, "[mtx_ifft]: matrix must have at least 4 columns"); return; } else if (columns != (1 << ilog2(columns))) { pd_error(x, "[mtx_ifft]: rowvector size no power of 2!"); return; } /* ok, prepare real-part of FFT! */ /* memory things */ if((rows != x->rows) || (columns != x->columns)) { resizeFFT(x, rows, columns); } /* main part */ iemmatrix_list2floats(x->f_im, argv, size); } static void mtxIFFTMatrixHot (MtxIFFT *x, t_symbol *s, int argc, t_atom *argv) { int rows, columns, msg_size; (void)s; /* unused */ /* fftsize check */ if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); msg_size = rows * columns; if (msg_size != x->msg_size) { pd_error(x, "[mtx_ifft]: left matrix has other dimensions than right matrix"); return; } else if (columns < 4) { pd_error(x, "[mtx_ifft]: matrix must have at least 4 columns"); return; } else if (columns != (1 << ilog2(columns))) { pd_error(x, "[mtx_ifft]: rowvector size no power of 2!"); return; } /* ok, do the FFT! */ /* memory things */ if((rows != x->rows) || (columns != x->columns)) { resizeFFT(x, rows, columns); } /* main part */ iemmatrix_list2floats(x->f_re, argv, msg_size); /* main part */ t_float *f_re = x->f_re, *f_im = x->f_im; t_atom *msg_re = x->msg_re + 2, *msg_im = x->msg_im + 2; for(int r=0; r < rows; r++) { t_complex*c = x->c_in; for(int col=0; col < columns; col++) { c->re = *f_re++; c->im = *f_im++; c++; } iemfft_execute(x->plan); c = x->c_out; t_float renorm_fac = 1. / (t_float)columns; for(int col=0; col < columns; col++) { t_float re = c->re * renorm_fac, im = c->im * renorm_fac; SETFLOAT(msg_re, re); SETFLOAT(msg_im, im); c++; msg_re++; msg_im++; } } msg_re = x->msg_re; msg_im = x->msg_im; SETSYMBOL(msg_re, gensym("matrix")); SETSYMBOL(msg_im, gensym("matrix")); SETFLOAT(msg_re+0, rows); SETFLOAT(msg_im+0, rows); SETFLOAT(msg_re+1, columns); SETFLOAT(msg_im+1, columns); outlet_anything(x->msg_im_out, gensym("matrix"), x->msg_size+2, msg_im); outlet_anything(x->msg_re_out, gensym("matrix"), x->msg_size+2, msg_re); } void mtx_ifft_setup (void) { mtx_ifft_class = class_new (gensym("mtx_ifft"), (t_newmethod) newMtxIFFT, (t_method) deleteMtxIFFT, sizeof (MtxIFFT), CLASS_DEFAULT, 0); class_addbang (mtx_ifft_class, (t_method) mtxIFFTBang); class_addmethod (mtx_ifft_class, (t_method) mtxIFFTMatrixHot, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_ifft_class, (t_method) mtxIFFTMatrixCold, gensym(""), A_GIMME,0); iemfft_init(mtx_ifft_class); } void iemtx_ifft_setup(void) { mtx_ifft_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_index.c000066400000000000000000000136671514557770000241710ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_index_class; typedef struct _MTXindex_ MTXindex; struct _MTXindex_ { t_object x_obj; int index_size; int index_rows; int index_columns; t_float fill_value; int max_index; int *index_in; t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; }; static void deleteMTXIndex (MTXindex *mtx_index_obj) { if (mtx_index_obj->index_in) { freebytes (mtx_index_obj->index_in, sizeof(int)*(mtx_index_obj->index_size+2)); } if (mtx_index_obj->list_out) { freebytes (mtx_index_obj->list_out, sizeof(t_atom)*(mtx_index_obj->index_size+2)); } } static void *newMTXIndex (t_symbol *s, int argc, t_atom *argv) { MTXindex *mtx_index_obj = (MTXindex *) pd_new (mtx_index_class); t_atom fill_atom; SETFLOAT(&fill_atom,0); switch ((argc>1)?1:argc) { case 1: fill_atom = *argv; } if (atom_getsymbol(&fill_atom) == gensym("nan")) #ifdef __WIN32__ mtx_index_obj->fill_value = 0.0f; #else mtx_index_obj->fill_value = 0.0f/0.0f; #endif else { mtx_index_obj->fill_value = atom_getfloat(&fill_atom); } mtx_index_obj->list_outlet = outlet_new (&mtx_index_obj->x_obj, gensym("matrix")); inlet_new(&mtx_index_obj->x_obj, &mtx_index_obj->x_obj.ob_pd, gensym("matrix"),gensym("")); pd_error(mtx_index_obj, "[%s]: this object is likely to change! not really for use yet", s->s_name); return ((void *) mtx_index_obj); } static void mTXIndexBang (MTXindex *mtx_index_obj) { if (mtx_index_obj->list_out) outlet_anything(mtx_index_obj->list_outlet, gensym("matrix"), mtx_index_obj->index_size+2, mtx_index_obj->list_out); } /* static void copyList (int size, t_atom *x, t_atom *y) { while(size--) *y++=*x++; } */ static int copyAtomToIntegerArrayMax (int n, t_atom *x, int *y) { int max = atom_getint(x); for (; n--; x++,y++) { *y = atom_getint (x); max = (*y > max)?*y:max; } return max; } static void setAtomListConstFloat (int n, t_atom *x, t_float f) { for (; n--; x++) { SETFLOAT(x,f); } } static void writeIndexedValuesIntoList (int n, int *indx, t_atom *x, t_atom *y) { for (; n--; indx++,y++) if (*indx) { *y = x[*indx-1]; } } static void mTXIndexRightMatrix (MTXindex *mtx_index_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); int size = rows * columns; t_atom *list_in = argv + 2; t_atom *list_out = mtx_index_obj->list_out; int *index_in = mtx_index_obj->index_in; int max; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_index_obj, s, argc, argv, 0))return; if (size != mtx_index_obj->index_size) { if (!index_in) { index_in = (int *) getbytes (sizeof (int) * (size + 2)); } else index_in = (int *) resizebytes (index_in, sizeof (int) * (mtx_index_obj->index_size+2), sizeof (int) * (size + 2)); if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size + 2)); } else list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_index_obj->index_size+2), sizeof (t_atom) * (size + 2)); } mtx_index_obj->index_size = size; mtx_index_obj->index_columns = columns; mtx_index_obj->index_rows = rows; mtx_index_obj->list_out = list_out; mtx_index_obj->index_in = index_in; max = copyAtomToIntegerArrayMax (size, list_in, index_in); mtx_index_obj->max_index = max; } static void mTXIndexMatrix (MTXindex *mtx_index_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); int size = rows * columns; t_atom *list_in = argv+2; t_atom *list_out = mtx_index_obj->list_out; int index_rows = mtx_index_obj->index_rows; int index_columns = mtx_index_obj->index_columns; int *indx = mtx_index_obj->index_in; (void)s; /* unused */ /* size check */ if(iemmatrix_check(mtx_index_obj, s, argc, argv, 0))return; if (size < mtx_index_obj->max_index) { pd_error(mtx_index_obj, "[mtx_index]: index exceeds matrix dimensions"); return; } if ((!indx)||(mtx_index_obj->index_size == 0)) { pd_error(mtx_index_obj, "[mtx_index]: index with what? no right matrix defined"); return; } /* main part */ list_out += 2; setAtomListConstFloat (mtx_index_obj->index_size, list_out, mtx_index_obj->fill_value); writeIndexedValuesIntoList (mtx_index_obj->index_size, indx,list_in, list_out); list_out = mtx_index_obj->list_out; SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, index_rows); SETFLOAT(&list_out[1], index_columns); outlet_anything(mtx_index_obj->list_outlet, gensym("matrix"), mtx_index_obj->index_size+2, list_out); } void mtx_index_setup (void) { mtx_index_class = class_new (gensym("mtx_index"), (t_newmethod) newMTXIndex, (t_method) deleteMTXIndex, sizeof (MTXindex), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_index_class, (t_method) mTXIndexBang); class_addmethod (mtx_index_class, (t_method) mTXIndexMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_index_class, (t_method) mTXIndexRightMatrix, gensym(""), A_GIMME,0); } void iemtx_index_setup(void) { mtx_index_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_int.c000066400000000000000000000011521514557770000236360ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_int: B=int(A); */ static t_float unop(t_float f) { int i = (int)f; return (t_float)i; } void mtx_int_setup(void) { iemmatrix_unop_setup("mtx_int", 0, unop, (char*)0); } void iemtx_int_setup(void) { mtx_int_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_inverse.c000066400000000000000000000056751514557770000245350ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_inverse */ static t_class *mtx_inverse_class; static void mtx_inverse_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { /* maybe we should do this in double or long double ? */ int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); int err=0; t_matrixfloat *original, *inverted; (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; /* reserve memory for outputting afterwards */ adjustsize(x, &x->m, col, row); /* 1. extract values of A to float-buf */ original=matrix2float(argv); if (row==col) { /* fine, the matrix is square */ inverted=mtx_doInvert(original, row, &err); } else { /* we'll have to do the pseudo-inverse: * P=A'*inv(A*A') if rowcol) { inverteeCol=col; invertee =mtx_doMultiply(col, transposed, row, original, col); inverted =mtx_doMultiply(col, mtx_doInvert(invertee, col, &err), col, transposed, row); } else { inverteeCol=row; invertee =mtx_doMultiply(row, original, col, transposed, row); inverted =mtx_doMultiply(col, transposed, row, mtx_doInvert(invertee, row, &err), row); } freebytes(transposed, sizeof(t_matrixfloat)*col*row); freebytes(invertee , sizeof(t_matrixfloat)*inverteeCol*inverteeCol); } /* 3. output the matrix */ /* 3a convert the floatbuf to an atombuf; */ float2matrix(x->m.atombuffer, inverted); /* 3b destroy the buffers */ freebytes(original, sizeof(t_matrixfloat)*row*col); if(err) { outlet_bang(x->x_outlet); pd_error(x, "mtx_inverse: couldn't really invert the matrix !!! %d error%c", err, (err-1)?'s':0); } /* 3c output the atombuf; */ matrixobj_bang(x); } static void *mtx_inverse_new() { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_inverse_class); outlet_new(&x->x_obj, 0); x->x_outlet=outlet_new(&x->x_obj, 0); return (x); } void mtx_inverse_setup(void) { mtx_inverse_class = class_new(gensym("mtx_inverse"), (t_newmethod)mtx_inverse_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0); class_addbang (mtx_inverse_class, matrixobj_bang); class_addmethod(mtx_inverse_class, (t_method)mtx_inverse_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_inverse_setup(void) { mtx_inverse_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_isequal.c000066400000000000000000000130741514557770000245150ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_isequal */ #if PD_FLOATSIZE == 32 # define myabs(x) fabsf(x) #else # define myabs(x) fabs(x) #endif /* mtx_isequal */ static t_class *mtx_isequal_class, *mtx_isequalscalar_class; typedef struct _mtx_isequalscalar { t_mtx_binscalar x; t_float epsilon; } t_mtx_isequalscalar; typedef struct _mtx_isequalmtx { t_mtx_binmtx x; t_float epsilon; } t_mtx_isequalmtx; static int nearly_equal(const t_float a, const t_float b, const t_float epsilon) { return myabs(a-b) < epsilon; } static int _isequal_list2float(int argc, const t_atom*argv, const t_float ref, const t_float epsilon) { if(0. == epsilon) { while(argc--) { if(atom_getfloat(argv)!=ref) { return 0; } argv++; } } else { while(argc--) { if(!nearly_equal(atom_getfloat(argv), ref, epsilon)) { return 0; } argv++; } } return 1; } static int _isequal_list2list(int argc, const t_atom*argv, const t_atom*ref, const t_float epsilon) { if(0. == epsilon) { while(argc--) { if(atom_getfloat(argv)!=atom_getfloat(ref)) { return 0; } argv++; ref++; } } else { while(argc--) { if(!nearly_equal(atom_getfloat(argv), atom_getfloat(ref), epsilon)) { return 0; } argv++; ref++; } } return 1; } static void mtx_isequalscalar_matrix(t_mtx_isequalscalar *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, IEMMATRIX_CHECK_CRIPPLED))return; int result = _isequal_list2float(argc-2, argv+2, x->x.f, x->epsilon); outlet_float(x->x.x_obj.ob_outlet, (t_float)result); } static void mtx_isequalscalar_list(t_mtx_isequalscalar *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ int result = _isequal_list2float(argc, argv, x->x.f, x->epsilon); outlet_float(x->x.x_obj.ob_outlet, (t_float)result); } static void mtx_isequalscalar_eps(t_mtx_isequalscalar *x, t_float eps) { if (eps < 0.) { pd_error(x, "[mtx_isequal] epsilon must be >=0"); } else { x->epsilon = eps; } } static void mtx_isequal_matrix(t_mtx_isequalmtx *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); (void)s; /* unused */ if(iemmatrix_check(x, s, argc, argv, 0))return; if ((col!=x->x.m2.col)||(row!=x->x.m2.row)) { outlet_float(x->x.x_obj.ob_outlet, (t_float)0); return; } int result = _isequal_list2list(argc-2, argv+2, x->x.m2.atombuffer+2, x->epsilon); outlet_float(x->x.x_obj.ob_outlet, (t_float)result); } static void mtx_isequal_float(t_mtx_isequalmtx *x, t_float f) { t_matrix *m2=&x->x.m2; int row2, col2, n; if (!m2->atombuffer) { outlet_float(x->x.x_obj.ob_outlet, (t_float)0); return; } row2=atom_getfloat(m2->atombuffer); col2=atom_getfloat(m2->atombuffer+1); n=row2*col2; int result = _isequal_list2float(n, m2->atombuffer+2, f, x->epsilon); outlet_float(x->x.x_obj.ob_outlet, (t_float)result); } static void mtx_isequal_eps(t_mtx_isequalmtx *x, t_float eps) { if (eps < 0.) { pd_error(x, "[mtx_isequal] epsilon must be >=0"); } else { x->epsilon = eps; } } static void *mtx_isequal_new(t_symbol *s, int argc, t_atom *argv) { if (argc) { t_mtx_isequalscalar *x = (t_mtx_isequalscalar *)pd_new(mtx_isequalscalar_class); if (argc>1) { pd_error(x, "[%s]: extra arguments ignored", s->s_name); } floatinlet_new(&x->x.x_obj, &x->x.f); x->x.f = atom_getfloatarg(0, argc, argv); outlet_new(&x->x.x_obj, 0); return(x); } else { t_mtx_isequalmtx *x = (t_mtx_isequalmtx *)pd_new(mtx_isequal_class); inlet_new(&x->x.x_obj, &x->x.x_obj.ob_pd, gensym("matrix"), gensym("")); outlet_new(&x->x.x_obj, 0); x->x.m.col = x->x.m.row = x->x.m2.col = x->x.m2.row = 0; x->x.m.atombuffer = x->x.m2.atombuffer = 0; return(x); } } void mtx_isequal_setup(void) { mtx_isequal_class = class_new(gensym("mtx_isequal"), (t_newmethod)mtx_isequal_new, (t_method)mtx_binmtx_free, sizeof(t_mtx_isequalmtx), 0, A_GIMME, 0); class_addmethod(mtx_isequal_class, (t_method)mtx_isequal_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(mtx_isequal_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0); class_addfloat (mtx_isequal_class, mtx_isequal_float); class_addbang (mtx_isequal_class, mtx_binmtx_bang); class_addmethod(mtx_isequal_class, (t_method)mtx_isequal_eps, gensym("eps"), A_FLOAT, 0); mtx_isequalscalar_class = class_new(gensym("mtx_isequal"), 0, (t_method)mtx_binscalar_free, sizeof(t_mtx_isequalscalar), 0, 0); class_addmethod(mtx_isequalscalar_class, (t_method)mtx_isequalscalar_matrix, gensym("matrix"), A_GIMME, 0); class_addlist (mtx_isequalscalar_class, mtx_isequalscalar_list); class_addbang (mtx_isequalscalar_class, mtx_binscalar_bang); class_addmethod(mtx_isequalscalar_class, (t_method)mtx_isequalscalar_eps, gensym("eps"), A_FLOAT, 0); } void iemtx_isequal_setup(void) { mtx_isequal_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_le.c000066400000000000000000000011171514557770000234450ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1<=f2; } void mtx_le_setup(void) { iemmatrix_binop_setup("mtx_le", 0, binop, "mtx_<=", (char*)0); } void iemtx_le_setup(void) { mtx_le_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_log.c000066400000000000000000000012111514557770000236210ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_log: B=log(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return logf(f); #else return log(f); #endif } void mtx_log_setup(void) { iemmatrix_unop_setup("mtx_log", 0, unop, (char*)0); } void iemtx_log_setup(void) { mtx_log_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_lt.c000066400000000000000000000011151514557770000234620ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1f2)?f1:f2; } void mtx_max2_setup(void) { iemmatrix_binop_setup("mtx_max2", 0, binop, (char*)0); } void iemtx_max2_setup(void) { mtx_max2_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_mean.c000066400000000000000000000027451514557770000237750ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_mean */ static t_class *mtx_mean_class; static void mtx_mean_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { if(argc<2)return; int row=atom_getfloat(argv++); int col=atom_getfloat(argv++); t_atom *ip, *op; int c=col, r; t_float sum; t_float factor=1./row; (void)s; /* unused */ adjustsize(x, &x->m, 1, col); op=x->m.atombuffer; while(c--) { sum=0; ip=argv+col-c-1; r=row; while(r--) { sum+=atom_getfloat(ip+col*r); } SETFLOAT(op, sum*factor); op++; } outlet_list(x->x_obj.ob_outlet, gensym("row"), col, x->m.atombuffer); } static void *mtx_mean_new(void) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_mean_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_mean_setup(void) { mtx_mean_class = class_new(gensym("mtx_mean"), (t_newmethod)mtx_mean_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0, 0); class_addmethod(mtx_mean_class, (t_method)mtx_mean_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_mean_setup(void) { mtx_mean_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_min2.c000066400000000000000000000011241514557770000237100ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return (f1maxlist_out) { freebytes (mtx_minmax_obj->maxlist_out, sizeof(t_atom)*(mtx_minmax_obj->size)); } if (mtx_minmax_obj->minlist_out) { freebytes (mtx_minmax_obj->minlist_out, sizeof(t_atom)*(mtx_minmax_obj->size)); } } static void mTXSetMinMaxMode (MTXminmax *mtx_minmax_obj, t_symbol *m_sym) { int mode=0; if(gensym("row")==m_sym) { mode=1; } else if((gensym("col")==m_sym) || (gensym("column")==m_sym) || (gensym(":")==m_sym)) { mode=2; } mtx_minmax_obj->mode = mode; } static void *newMTXMinMax (t_symbol *s) { MTXminmax *mtx_minmax_obj = (MTXminmax *) pd_new (mtx_minmax_class); mtx_minmax_obj->mode=0; mtx_minmax_obj->operator_minimum = 1; mtx_minmax_obj->min_outlet = outlet_new (&mtx_minmax_obj->x_obj, gensym("matrix")); mtx_minmax_obj->max_outlet = outlet_new (&mtx_minmax_obj->x_obj, gensym("matrix")); if((NULL!=s)&&(&s_!=s)&&(NULL!=s->s_name)) { mTXSetMinMaxMode (mtx_minmax_obj, s); } return ((void *) mtx_minmax_obj); } static void mTXMinMaxBang (MTXminmax *mtx_minmax_obj) { if (mtx_minmax_obj->maxlist_out) outlet_list(mtx_minmax_obj->max_outlet, gensym("list"), mtx_minmax_obj->outsize, mtx_minmax_obj->maxlist_out); if (mtx_minmax_obj->minlist_out) outlet_list(mtx_minmax_obj->min_outlet, gensym("list"), mtx_minmax_obj->outsize, mtx_minmax_obj->minlist_out); } static void minmaxList (int n, t_atom *x, t_float*min, t_float*max) { t_float min_=atom_getfloat(x); t_float max_=min_; t_float f; for (; n--; x++) { f = atom_getfloat(x); min_ = (min_ < f)?min_:f; max_ = (max_ > f)?max_:f; } *max=max_; *min=min_; } static void minmaxListStep (int n, const int step, t_atom *x, t_float*min, t_float*max) { t_float min_=atom_getfloat(x); t_float max_=min_; t_float f; for (; n--; x+=step) { f = atom_getfloat(x); min_ = (min_ < f)?min_:f; max_ = (max_ > f)?max_:f; } *max=max_; *min=min_; } static void minmaxListColumns (const int rows, const int columns, t_atom *x, t_atom *ap_min, t_atom *ap_max) { int count; t_float min, max; for (count=0; count < columns; count++, x++, ap_min++, ap_max++) { minmaxListStep (rows, columns, x, &min, &max); SETFLOAT(ap_min,min); SETFLOAT(ap_max,max); } } static void minmaxListRows (int rows, int columns, t_atom *x, t_atom *ap_min, t_atom*ap_max) { int count; t_float min, max; for (count=0; count < rows; count++, x+=columns, ap_min++, ap_max++) { minmaxList (columns, x, &min, &max); SETFLOAT(ap_min, min); SETFLOAT(ap_max,max); } } static void mTXMinMaxMatrix (MTXminmax *mtx_minmax_obj, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; t_atom *maxlist_out = mtx_minmax_obj->maxlist_out; t_atom *minlist_out = mtx_minmax_obj->minlist_out; int elements_out; /* size check */ (void)s; /* unused */ if(iemmatrix_check(mtx_minmax_obj, s, argc, argv, 0))return; rows = atom_getint(argv++); columns = atom_getint(argv++); size = rows * columns; if (size != mtx_minmax_obj->size) { if (!minlist_out) { minlist_out = (t_atom *) getbytes (sizeof (t_atom) * size); } else minlist_out = (t_atom *) resizebytes (minlist_out, sizeof (t_atom) * (mtx_minmax_obj->size), sizeof (t_atom) * size); if (!maxlist_out) { maxlist_out = (t_atom *) getbytes (sizeof (t_atom) * size); } else maxlist_out = (t_atom *) resizebytes (maxlist_out, sizeof (t_atom) * (mtx_minmax_obj->size), sizeof (t_atom) * size); } mtx_minmax_obj->size = size; mtx_minmax_obj->minlist_out = minlist_out; mtx_minmax_obj->maxlist_out = maxlist_out; /* main part */ switch(mtx_minmax_obj->mode) { case 1: elements_out = rows; minmaxListRows (rows, columns, argv, minlist_out, maxlist_out); break; case 2: elements_out = columns; minmaxListColumns (rows, columns, argv, minlist_out, maxlist_out); break; default: elements_out = 1; minmaxListRows (1, size, argv, minlist_out, maxlist_out); } mtx_minmax_obj->outsize = elements_out; maxlist_out = mtx_minmax_obj->maxlist_out; minlist_out = mtx_minmax_obj->minlist_out; mTXMinMaxBang(mtx_minmax_obj); } void mtx_minmax_setup (void) { mtx_minmax_class = class_new ( gensym("mtx_minmax"), (t_newmethod) newMTXMinMax, (t_method) deleteMTXMinMax, sizeof (MTXminmax), CLASS_DEFAULT, A_DEFSYM, 0); class_addbang (mtx_minmax_class, (t_method) mTXMinMaxBang); class_addmethod (mtx_minmax_class, (t_method) mTXMinMaxMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_minmax_class, (t_method) mTXSetMinMaxMode, gensym("mode"), A_DEFSYMBOL ,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("column"); } void iemtx_minmax_setup(void) { mtx_minmax_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_mul.c000066400000000000000000000116311514557770000236440ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_mul mtx_* mtx_.* mtx_./ matrix multiplication */ /* mtx_mul */ static t_class *mtx_mul_class, *mtx_mulscalar_class; static void mtx_mul_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv) { t_matrix *m=&x->m, *m2=&x->m2; t_atom *ap, *ap1=argv+2, *ap2=m2->atombuffer+2; int row=atom_getfloat(argv), col=atom_getfloat(argv+1); int row2, col2, n, r, c; if (!m2->atombuffer) { pd_error(x, "[mtx_*]: right-hand matrix is missing"); return; } if(iemmatrix_check(x, s, argc, argv, 0))return; row2=atom_getfloat(m2->atombuffer); col2=atom_getfloat(m2->atombuffer+1); if (col!=row2) { pd_error(x, "[mtx_*]: matrix dimensions do not match !"); return; } adjustsize(x, m, row, col2); ap=m->atombuffer+2; for(r=0; rx_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer); } static void mtx_mul_float(t_mtx_binmtx *x, t_float f) { t_matrix *m=&x->m, *m2=&x->m2; t_atom *ap, *ap2=m2->atombuffer+2; int row2, col2, n; if (!m2->atombuffer) { pd_error(x, "[mtx_*]: right-hand matrix is missing"); return; } row2=atom_getfloat(m2->atombuffer); col2=atom_getfloat(m2->atombuffer+1); adjustsize(x, m, row2, col2); ap=m->atombuffer+2; n=row2*col2; while(n--) { SETFLOAT(ap, f*atom_getfloat(ap2++)); ap++; } outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer); } static void mtx_mulscalar_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv) { int row, col; int n=argc-2; t_atom *m; t_float factor = x->f; if(iemmatrix_check(x, s, argc, argv, IEMMATRIX_CHECK_CRIPPLED))return; row=atom_getfloat(argv++); col=atom_getfloat(argv++); adjustsize(x, &x->m, row, col); m = x->m.atombuffer+2; while(n--) { m->a_type = A_FLOAT; (m++)->a_w.w_float = atom_getfloat(argv++)*factor; } outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer); } static void mtx_mulscalar_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv) { int n=argc; t_atom *m; t_float factor = x->f; (void)s; /* unused */ adjustsize(x, &x->m, 1, argc); m = x->m.atombuffer; while(n--) { m->a_type = A_FLOAT; (m++)->a_w.w_float = atom_getfloat(argv++)*factor; } outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer); } static void *mtx_mul_new(t_symbol *s, int argc, t_atom *argv) { if (argc>1) { pd_error(0, "[%s]: extra arguments ignored", s->s_name); } if (argc) { t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_mulscalar_class); floatinlet_new(&x->x_obj, &x->f); x->f = atom_getfloatarg(0, argc, argv); outlet_new(&x->x_obj, 0); return(x); } else { t_mtx_binmtx *x = (t_mtx_binmtx *)pd_new(mtx_mul_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym("")); outlet_new(&x->x_obj, 0); x->m.col = x->m.row = x->m2.col = x->m2.row = 0; x->m.atombuffer = x->m2.atombuffer = 0; return (x); } } static t_float binop(t_float f1, t_float f2) { return f1 * f2; } void mtx_mul_setup(void) { mtx_mul_class = class_new(gensym("mtx_mul"), (t_newmethod)mtx_mul_new, (t_method)mtx_binmtx_free, sizeof(t_mtx_binmtx), 0, A_GIMME, 0); class_addcreator((t_newmethod)mtx_mul_new, gensym("mtx_*"), A_GIMME,0); class_addmethod(mtx_mul_class, (t_method)mtx_mul_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(mtx_mul_class, (t_method)mtx_bin_matrix2, gensym(""), A_GIMME, 0); class_addfloat (mtx_mul_class, mtx_mul_float); class_addbang (mtx_mul_class, mtx_binmtx_bang); mtx_mulscalar_class = class_new(gensym("mtx_mul"), 0, (t_method)mtx_binscalar_free, sizeof(t_mtx_binscalar), 0, 0); class_addmethod(mtx_mulscalar_class, (t_method)mtx_mulscalar_matrix, gensym("matrix"), A_GIMME, 0); class_addlist (mtx_mulscalar_class, mtx_mulscalar_list); class_addbang (mtx_mulscalar_class, mtx_binscalar_bang); iemmatrix_binop_setup("mtx_.*", "mtx_mul", binop, (char*)0); } void iemtx_mul_setup(void) { mtx_mul_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_mul~.c000066400000000000000000001066461514557770000240550ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) Thomas Musil, IEM KUG Graz Austria 2000-2003 * Copyright (c) IOhannes m zmölnig, forum::für::umläute, IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ /* NOTES on multichannel - the number of incoming channels is not changeable by us - non-multichannel ports are always *hard* restrictions (wrong matrix is discarded) - the matrix dimension can only change while the DSP is off - while the DSP is on, non-matching matrices are discarded - if the dimensions change, the source and target matrices are resized */ #include "iemmatrix.h" #ifndef CLASS_MULTICHANNEL # define CLASS_MULTICHANNEL 0 #endif typedef void (*setmultiout_f)(t_signal **sig, int nchans); /* ---------- mtx_*~ - signal matrix multiplication object with message matrix-coeff. ----------- */ /* usage: * [mtx_*~ <#out> <#in>]: multiply #in signals with a <#out,#in>-matrix to get #out-signals * [mtx_*~ <#io>]: multiply #io signals with a <#io,#io>-matrix to get #io-signals * * 1st inlet: (message only): the matrix to multiply with (defaults to zero(#out, #in) * 2nd-(n-1)th inlet: the input signals * last inlet: the interpolation time in [ms] * * this also implements a compatibility layer with old objects from tm and jmz * that provide basically the same functionality * * further note: * pd does not like signal-objects that don't listen to signals on the very first inlet * however, the first signal-inlet of [mtx_*~] is the 2nd(!) inlet * to achieve this, we silently ignore any signal that comes in at the first inlet */ typedef struct _proxy { t_object p_obj; struct matrix_multilde*p_owner; } t_proxy; enum { IEMMATRIX = 0, IEM_MATRIX = 1, /* matrix_mul_line~ */ ZEXY = 2 /* matrix~ */ } e_compat; typedef struct matrix_multilde { /* private weirdo stuff at the beginning */ t_object x_obj; t_symbol *x_name; t_proxy *x_proxy; int x_compat; /* 0=mtx_*~; 1=matrix_mul_line~; 2=matrix~ */ setmultiout_f x_setmultiout; /* when doing multichannel, this is Pd>=0.54's signal_setmultiout(); otherwise NULL */ /* DSP meta information */ t_sample **x_io; /* input/output signals (for easier passing to perform()) */ t_float x_msi; /* CLASS_MAINSIGNALIN() */ int x_dsp; /* is the DSP running? */ /* number of non-multichannels iolets. * a value of '0' indicates a single multichannel iolets */ size_t x_inports, x_outports; /* the matrix */ /* while DSP is running, rows=outs, cols=ins; * if XXports>0, then the rows/cols must match when setting a matrix */ size_t x_rows, x_cols; t_float *x_matcur; /* current matrix (being interpolated) */ t_float *x_matend; /* interpolation target */ /* interpolation data */ t_float x_time_ms; /* interpolation time (when new matrix comes through) */ int x_remaining_ticks; /* how long do we still need to interpolate */ t_float *x_inc, *x_biginc; /* matrices incrementation values */ int x_retarget; /* bool: whether we need to start a new interpolation */ t_float x_ms2tick; /* helper to translate time to ticks */ /* buffer for matrix multiplication */ t_sample *x_outsumbuf; /* N samples for summing up */ size_t x_outsumbufsize; } t_matrix_multilde; static void proxy_dspstopped(t_proxy*p) { p->p_owner->x_dsp = 0; } static t_float*get_resized_matrix(const t_float*src, const unsigned int srcR, const unsigned int srcC, const unsigned int dstR, const unsigned int dstC) { t_float*dst = (t_float*)getbytes(dstR*dstC*sizeof(*dst)); unsigned int c, r, cols, rows; if(!dst) return dst; cols = (srcCx_rows) && (cols == x->x_cols)) return 1; x->x_matend = resize_and_free(x->x_matend, x->x_rows, x->x_cols, rows, cols); x->x_matcur = resize_and_free(x->x_matcur, x->x_rows, x->x_cols, rows, cols); x->x_inc = resize_and_free(x->x_inc , x->x_rows, x->x_cols, rows, cols); x->x_biginc = resize_and_free(x->x_biginc, x->x_rows, x->x_cols, rows, cols); if(!x->x_matend || !x->x_matcur || !x->x_inc || !x->x_biginc) { pd_error(x, "[%s] failed to resize matrices to [%dx%d]", x->x_name->s_name, rows, cols); x->x_rows = x->x_cols = 0; return 0; } x->x_rows = rows; x->x_cols = cols; return 1; } static t_class *matrix_multilde_mclass; static t_class *matrix_multilde_class; static t_class *matrix_multilde_proxy; static void matrix_multilde_time(t_matrix_multilde *x, t_floatarg time_ms) { if(time_ms <= 0.0f) { time_ms = 0.0f; } x->x_time_ms = time_ms; } static void matrix_multilde_matrix_set(t_matrix_multilde *x, int argc, t_atom *argv, int transpose) { unsigned int col, row, length; t_float *matcur, *matend; if(argc<2) { pd_error(x, "[%s]: bad matrix: !", x->x_name->s_name); return; } if(iemmatrix_check(x, 0, argc, argv, 0))return; row = atom_getint(argv); argv++; col = atom_getint(argv); argv++; argc-=2; if(transpose) { int dummy=row; row=col; col=dummy; } if (x->x_dsp) { /* matrix dimensions must match while DSP is running */ if ((col != x->x_cols) || (row != x->x_rows)) { pd_error(x, "[%s]: matrix dimensions must not change (%dx%d != %dx%d) while DSP is running!!", x->x_name->s_name, row, col, (int)x->x_rows, (int)x->x_cols); return; } } else { /* DSP is not running, check if we have a fixed number of iolets */ if(x->x_inports && x->x_inports != col) { pd_error(x, "[%s]: cannot change fixed number of input channels (%d) to %d", x->x_name->s_name, (int)x->x_inports, col); return; } if(x->x_outports && x->x_outports != row) { pd_error(x, "[%s]: cannot change fixed number of output channels (%d) to %d", x->x_name->s_name, (int)x->x_outports, row); return; } if(!matrix_multilde_resize(x, row, col)) return; } matcur = x->x_matcur; matend = x->x_matend; length = col * row; if(transpose) { /* we need to transpose the matrix */ unsigned int i; for(i=0; ix_time_ms <= 0.0f) { unsigned int i; matend = x->x_matend; for(i=0; ix_remaining_ticks = x->x_retarget = 0; } else { x->x_retarget = 1; } } static void matrix_multilde_matrix(t_matrix_multilde *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ matrix_multilde_matrix_set(x, argc, argv, 0); } static void matrix_multilde_matrixT(t_matrix_multilde *x, t_symbol *s, int argc, t_atom *argv) { /* transpose the matrix before setting it */ (void)s; /* unused */ matrix_multilde_matrix_set(x, argc, argv, 1); } static void matrix_multilde_element(t_matrix_multilde *x, t_symbol *s, int argc, t_atom *argv) { unsigned int col, row, n_in_cols=x->x_cols; t_float element; t_float *matcur = x->x_matcur; t_float *matend = x->x_matend; (void)s; /* unused */ if(argc != 3) { pd_error(x, "[%s]: bad arguments, expected !", x->x_name->s_name); return; } int r = (int)atom_getfloat(argv+0) - 1; int c = (int)atom_getfloat(argv+1) - 1; row = (r >= 0)?r:0; col = (c >= 0)?c:0; element = atom_getfloat(argv+2); if((row >= x->x_rows) || (r < 0)) { pd_error(x, "[%s]: out of bound row!!", x->x_name->s_name); return; } if((col >= n_in_cols) || (c < 0)) { pd_error(x, "[%s]: out of bound column!!", x->x_name->s_name); return; } matend += row * n_in_cols + col; matcur += row * n_in_cols + col; if(x->x_time_ms <= 0.0f) { *matend = *matcur = element; x->x_remaining_ticks = x->x_retarget = 0; } else { *matend = element; x->x_retarget = 1; } } static void matrix_multilde_row(t_matrix_multilde *x, t_symbol *s, int argc, t_atom *argv) { unsigned int col, nth_row, i; t_float *matcur = x->x_matcur; t_float *matend = x->x_matend; (void)s; /* unused */ if(argc<1) { pd_error(x,"[%s]: bad row!", x->x_name->s_name); return; } int _nth_row = (int)atom_getfloat(argv) -1; nth_row = (_nth_row>0)?_nth_row:0; argv++; argc--; if((nth_row >= x->x_rows) || (_nth_row < 0)) { pd_error(x, "[%s]: out of bound row!!", x->x_name->s_name); return; } col = x->x_cols; if(argc < 0 || ((unsigned int)argc < col)) { pd_error(x,"[%s]: col dimensions do not match !!", x->x_name->s_name); return; } matend += nth_row * col; matcur += nth_row * col; if(x->x_time_ms <= 0.0f) { for(i=0; ix_remaining_ticks = x->x_retarget = 0; } else { for(i=0; ix_retarget = 1; } } static void matrix_multilde_col(t_matrix_multilde *x, t_symbol *s, int argc, t_atom *argv) { int row, col, nth_col, i; t_float *matcur = x->x_matcur; t_float *matend = x->x_matend; (void)s; /* unused */ if(argc<1) { pd_error(x,"[%s]: bad column!", x->x_name->s_name); return; } nth_col = atom_getint(argv) - 1; argv++; argc--; col = x->x_cols; if((nth_col < 0)||(nth_col >= col)) { pd_error(x, "[%s]: out of bound column!!", x->x_name->s_name); return; } row = x->x_rows; if(argc < row) { pd_error(x,"[%s]: row dimensions do not match !!", x->x_name->s_name); return; } matend += nth_col; matcur += nth_col; if(x->x_time_ms <= 0.0f) { for(i=0; ix_remaining_ticks = x->x_retarget = 0; } else { for(i=0; ix_retarget = 1; } } static void matrix_multilde_stop(t_matrix_multilde *x) { int i = x->x_rows*x->x_cols; t_float *matend=x->x_matend; t_float *matcur=x->x_matcur; while(i--) { *matend++ = *matcur++; } x->x_remaining_ticks = x->x_retarget = 0; } /* the dsp thing */ static t_int *matrix_multilde_perf8(t_int *w) { t_matrix_multilde *x = (t_matrix_multilde *)(w[1]); int n = (int)(w[2]); t_sample **io = x->x_io; t_sample *outsum, *houtsum; t_float *matcur, *matend; t_float *inc1 ,*biginc, inc; int n_in = x->x_cols; int n_out = x->x_rows; t_float *in, *out, mul, bigmul; int r, c, i; if(x->x_retarget) { int nticks = (int)(x->x_time_ms * x->x_ms2tick); if(!nticks) { nticks = 1; } x->x_remaining_ticks = nticks; inc1 = x->x_inc; biginc = x->x_biginc; matcur = x->x_matcur; matend = x->x_matend; bigmul = 1.0f / (t_float)nticks; mul = bigmul / ((t_float)n); i = n_out*n_in; while(i--) { inc = *matend++ - *matcur++; *inc1++ = inc * mul; *biginc++ = inc * bigmul; } x->x_retarget = 0; } if(x->x_remaining_ticks) { /* keep interpolating between current and target matrix */ inc1 = x->x_inc; biginc = x->x_biginc; matcur = x->x_matcur; /* 1. output-vector-row */ in = io[0]; houtsum = x->x_outsumbuf; outsum = houtsum; inc = *inc1++; mul = *matcur; for(i=n; i; i -= 8, outsum += 8, in += 8) { outsum[0] = in[0] * mul; mul += inc; outsum[1] = in[1] * mul; mul += inc; outsum[2] = in[2] * mul; mul += inc; outsum[3] = in[3] * mul; mul += inc; outsum[4] = in[4] * mul; mul += inc; outsum[5] = in[5] * mul; mul += inc; outsum[6] = in[6] * mul; mul += inc; outsum[7] = in[7] * mul; mul += inc; } *matcur++ += *biginc++; for(c=1; cx_remaining_ticks) { matcur = x->x_matcur; matend = x->x_matend; i = n_in * n_out; while(i--) { *matcur++ = *matend++; } } } else { /* no remaining ticks left - matrix stays constant for now */ matend = x->x_matend; /* 1. output-vector-row */ in = io[0]; houtsum = x->x_outsumbuf; outsum = houtsum; mul = *matend++; if(mul == 0.0f) { for(i=n; i; i -= 8, outsum += 8, in += 8) { outsum[0] = 0.0f; outsum[1] = 0.0f; outsum[2] = 0.0f; outsum[3] = 0.0f; outsum[4] = 0.0f; outsum[5] = 0.0f; outsum[6] = 0.0f; outsum[7] = 0.0f; } } else { for(i=n; i; i -= 8, outsum += 8, in += 8) { outsum[0] = in[0] * mul; outsum[1] = in[1] * mul; outsum[2] = in[2] * mul; outsum[3] = in[3] * mul; outsum[4] = in[4] * mul; outsum[5] = in[5] * mul; outsum[6] = in[6] * mul; outsum[7] = in[7] * mul; } } for(c=1; cx_outsumbuf; for(r=0; rx_io; t_sample *outsum, *houtsum; t_float *matcur, *matend; t_float *inc1 ,*biginc, inc; int n_in = x->x_cols; int n_out = x->x_rows; t_float *in, *out, mul, bigmul; int r, c, i; if(x->x_retarget) { int nticks = (int)(x->x_time_ms * x->x_ms2tick); if(!nticks) { nticks = 1; } x->x_remaining_ticks = nticks; inc1 = x->x_inc; biginc = x->x_biginc; matcur = x->x_matcur; matend = x->x_matend; bigmul = 1.0f / ((t_float)nticks); mul = bigmul / ((t_float)n); i = n_out*n_in; while(i--) { inc = *matend++ - *matcur++; *inc1++ = inc * mul; *biginc++ = inc * bigmul; } x->x_retarget = 0; } if(x->x_remaining_ticks) { /* keep interpolating between current and target matrix */ inc1 = x->x_inc; biginc = x->x_biginc; matcur = x->x_matcur; /* 1. output-vector-row */ in = io[0]; houtsum = x->x_outsumbuf; outsum = houtsum; inc = *inc1++; mul = *matcur; i=n; while(i--) { *outsum++ = *in++ * mul; mul += inc; } *matcur++ += *biginc++; for(c=1; cx_remaining_ticks) { matcur = x->x_matcur; matend = x->x_matend; i = n_in * n_out; while(i--) { *matcur++ = *matend++; } } } else { /* no remaining ticks left - matrix stays constant for now */ matend = x->x_matend; /* 1. output-vector-row */ in = io[0]; houtsum = x->x_outsumbuf; outsum = houtsum; mul = *matend++; i=n; if(mul == 0.0f) while(i--) { *outsum++ = 0.0f; } else while(i--) { *outsum++ = *in++ * mul; } for(c=1; cx_outsumbuf; for(r=0; rs_n > 0)?sp[0]->s_n:0; unsigned int i, n=length * x->x_rows; /* [mtx_*~] ignores the signal on the very 1st inlet */ int compat_offset=(x->x_compat)?0:1; size_t ichannels = x->x_inports?x->x_inports:0; size_t ochannels = x->x_outports?x->x_outports:x->x_rows; t_sample**io; /* DSP is running */ x->x_dsp = 1; if(x->x_setmultiout) { #if CLASS_MULTICHANNEL size_t inports = (x->x_inports < 1)?1:x->x_inports; /* multichannel mode */ if(!ichannels) { /* multichannel input */ ichannels = sp[compat_offset]->s_nchans; } if(x->x_outports) { /* create singlechannel outputs */ for(i=0; ix_setmultiout(&sp[compat_offset + inports + i], 1); } } else { /* create multichannel output */ ochannels = x->x_rows; x->x_setmultiout(&sp[compat_offset + inports], ochannels); } #else pd_error(x, "BUG: multichannel enabled but not compile-time multichannel support"); return; #endif } /* ensure that the matrices have the correct dimension */ io = (t_sample **)resizebytes(x->x_io, (x->x_cols + x->x_rows) * sizeof(*x->x_io), (ichannels + ochannels) * sizeof(*x->x_io)); if(!io) { pd_error(x, "Unable to get memory"); return; } x->x_io = io; if(!matrix_multilde_resize(x, ochannels, ichannels)) { return; } if(!x->x_outsumbuf) { x->x_outsumbufsize = n; x->x_outsumbuf = (t_sample*)getbytes(x->x_outsumbufsize * sizeof(t_sample)); } else if(x->x_outsumbufsize != n) { x->x_outsumbuf = (t_sample*)resizebytes(x->x_outsumbuf, x->x_outsumbufsize*sizeof(t_sample), n*sizeof(t_sample)); x->x_outsumbufsize = n; } if(x->x_setmultiout) { #if CLASS_MULTICHANNEL int offset = compat_offset; /* setup input channels */ if(x->x_inports) { for(i=0; ix_io[i] = sp[offset + i]->s_vec; } offset += ichannels; } else { for(i=0; ix_io[i] = sp[offset]->s_vec + i * length; } offset += 1; } /* setup output channels */ if(x->x_outports) { for(i=0; ix_io[ichannels + i] = sp[offset + i]->s_vec; } offset += ichannels; } else { for(i=0; ix_io[ichannels + i] = sp[offset]->s_vec + i * length; } offset += 1; } #endif } else { n = ichannels + ochannels; for(i=0; ix_io[i] = sp[compat_offset+i]->s_vec; } } x->x_ms2tick = 0.001f * (t_float)(sp[0]->s_sr) / (t_float)length; if(length&7) { dsp_add(matrix_multilde_perform, 2, x, length); } else { dsp_add(matrix_multilde_perf8, 2, x, length); } } /* setup/setdown things */ static void matrix_multilde_free(t_matrix_multilde *x) { freebytes(x->x_matcur, x->x_cols * x->x_rows * sizeof(t_float)); freebytes(x->x_matend, x->x_cols * x->x_rows * sizeof(t_float)); freebytes(x->x_inc, x->x_cols * x->x_rows * sizeof(t_float)); freebytes(x->x_biginc, x->x_cols * x->x_rows * sizeof(t_float)); freebytes(x->x_io, (x->x_cols + x->x_rows) * sizeof(t_sample*)); if(x->x_outsumbuf) { freebytes(x->x_outsumbuf, x->x_outsumbufsize * sizeof(t_sample)); } if(x->x_proxy) { pd_unbind(&x->x_proxy->p_obj.ob_pd, gensym("pd-dsp-stopped")); pd_free(&x->x_proxy->p_obj.ob_pd); } } static void *matrix_multilde_new(t_symbol *s, int argc, t_atom *argv) { /* // singlechannel [mtx_*~ ] singlechannel in:1/1 out:1/1 [mtx_*~ 3 ] singlechannel in:3/3 out:3/3 [mtx_*~ 3 4 ] singlechannel in:4/4 out:3/3 // in/out is singlechannel, out/in is multichannel [mtx_*~ 0 4 ] mixedchannel in:4/4 out:1/? [mtx_*~ 3 0 ] mixedchannel in:1/? out:3/3 // implicit full multichannel [mtx_*~ 0 ] multichannel in:1/? out:1/? [mtx_*~ 0 0 ] multichannel in:1/? out:1/? // explicit full multichannel [mtx_*~ -m ] multichannel in:1/? out:1/? [mtx_*~ -m 0 ] multichannel in:1/? out:1/? [mtx_*~ -m 0 0] multichannel in:1/? out:1/? [mtx_*~ -m 3 ] multichannel in:1/3 out:1/3 [mtx_*~ -m 3 4] multichannel in:1/4 out:1/3 (useless, as inchannels are defined by signal-in) [mtx_*~ -m 0 4] multichannel in:1/4 out:1/? (useless, as inchannels are defined by signal-in) [mtx_*~ -m 3 0] multichannel in:1/? out:1/3 (useless, as inchannels are defined by signal-in) // other names [matrix_mul~] ALIAS [mtx_mul~] ALIAS [matrix_mul_line~] LEGACY (iem_matrix); always singlechannel [matrix~] LEGACY (zexy); always singlechannel */ t_matrix_multilde *x = 0; t_class*cls; int force_multi = 0, want_multi = 0; setmultiout_f setmultiout = iemmatrix_getpdfun("signal_setmultiout"); unsigned int portsIn, portsOut, channelsIn, channelsOut; int nin, nout; t_float interpoltime = 0.; int compat = IEMMATRIX; int i; t_atom*ap_in, *ap_out, *ap_time; if(s==gensym("matrix~")) { compat = ZEXY; } else if (s==gensym("matrix_mul_line~")) { compat = IEM_MATRIX; } else { if(argc && A_SYMBOL == argv->a_type) { if (atom_getsymbol(argv) == gensym("-m")) { force_multi = want_multi = 1; argc--; argv++; } else { goto usage; } } } if(argc && A_FLOAT != argv->a_type) { goto usage; } /* arguments parsing: * this might depend on whether we are creating an object * [mtx_*~], [matrix~] or [matrix_mul_line~] * * [mtx_*~ [#out [#in [time]]]]: in1=matrix; in2-in(#in+1)=signals; in(#in+2)=time * [matrix~ [#in [#out [time]]]]: in1-in(#in)=signals; in(#in+1)=matrix; in(#in+2)=time * [matrix_mul_line~ [#in [#out [time]]]]: in1=matrix; in1=time; in1-in(#in):=signals * * furthermore: * [mtx_*~] and [matrix_mul_line~] : O^=A*I^ * [matrix~] : O^'=I^'*B * * with "matrix=(A or B)" and "A=B'" */ ap_in =argv+(compat?0:1); ap_out =argv+(compat?1:0); ap_time=argv+2; switch(argc) { case 0: nin = nout = 1; interpoltime = (ZEXY == compat)?0.f:50.0f; break; case 1: nin = nout = (int)atom_getfloat(argv); interpoltime = (ZEXY == compat)?0.f:50.0f; break; case 2: nin = (int)atom_getfloat(ap_in); nout = (int)atom_getfloat(ap_out); interpoltime = (ZEXY == compat)?0.f:50.0f; break; default: nin = (int)atom_getfloat(ap_in); nout = (int)atom_getfloat(ap_out); interpoltime = atom_getfloat(ap_time); break; } /* make sure that these are unsigned */ if((nin < 0) || (nout < 0)) { pd_error(0, "[%s] matrix dimensions must not be negative [%dx%d]", s->s_name, nout, nin); return 0; } /* sanity check */ if(interpoltime < 0.0f) { interpoltime = (IEM_MATRIX == compat)?50.f:0.0f; } /* do we need multichannel? */ if (!compat && (0==nin || 0==nout)) want_multi = 1; /* can we do multichannel? */ cls = matrix_multilde_class; if(!compat && want_multi) { if (CLASS_MULTICHANNEL && setmultiout) cls = matrix_multilde_mclass; } /* relate ports/channels to the arguments */ portsIn = channelsIn = nin; portsOut = channelsOut = nout; if(force_multi) { portsIn = portsOut = 0; } if(channelsIn <1) channelsIn = 1; if(channelsOut<1) channelsOut = 1; /* create the object */ x = (t_matrix_multilde *)pd_new(cls); if(compat) { /* print an error, nudging the user to upgrade to [mtx_*~] */ /* however, suppress the error in help-patches */ const char*absname = iemmatrix_parentabstractionname(0); if(absname) { char*absext = strrchr(absname, '-'); if (absext && !strcmp(absext, "-help.pd")) { /* the object lives in a help-patch: suppress error */ } else { absname = 0; } } if(!absname) pd_error(x, "[%s] is deprecated! use [mtx_*~] instead!", s->s_name); } x->x_name = s; x->x_compat=compat; x->x_setmultiout = (matrix_multilde_class == cls)?0:setmultiout; if (!compat && want_multi) { /* user requested multichannel */ /* warn (but only once) if we cannot actually do that */ static int warn_multichannel = 1; if(!x->x_setmultiout) { int major, minor, bugfix; sys_getversion(&major, &minor, &bugfix); if(warn_multichannel) pd_error(x, "[%s] multichannel requested, but iemmatrix is running in Pd-%d.%d-%d, which doesn't support it", s->s_name, major, minor, bugfix); x->x_setmultiout = 0; } else if (!CLASS_MULTICHANNEL) { if(warn_multichannel) pd_error(x, "[%s] multichannel requested, but iemmatrix was built against Pd-%d.%d-%d, which doesn't support it", s->s_name, PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION); x->x_setmultiout = 0; } warn_multichannel = 0; } x->x_proxy = (t_proxy*)pd_new(matrix_multilde_proxy); x->x_proxy->p_owner = x; pd_bind(&x->x_proxy->p_obj.ob_pd, gensym("pd-dsp-stopped")); x->x_inports = portsIn; x->x_outports = portsOut; x->x_time_ms = interpoltime; x->x_rows = channelsOut; x->x_cols = channelsIn; /* creating signal ins & outs */ /* in compat mode, the 1st signal inlet is already made */ if(portsIn<1)portsIn=1; if(portsOut<1)portsOut=1; i = portsIn - !!x->x_compat; while(i--) { inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); } i = portsOut; while(i--) { outlet_new(&x->x_obj, &s_signal); } /* creating the matrix-inlet for [matrix~] */ if(ZEXY == x->x_compat) { inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"), gensym("")); } /* creating time-inlet (not for [matrix_mul_linie~]) */ if(x->x_compat != IEM_MATRIX) { inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("time")); } /* setting up internal values */ x->x_matcur = (t_float *)getbytes(x->x_cols * x->x_rows * sizeof(*x->x_matcur)); x->x_matend = (t_float *)getbytes(x->x_cols * x->x_rows * sizeof(*x->x_matend)); x->x_inc = (t_float *)getbytes(x->x_cols * x->x_rows * sizeof(*x->x_inc)); x->x_biginc = (t_float *)getbytes(x->x_cols * x->x_rows * sizeof(*x->x_biginc)); x->x_io = (t_sample **)getbytes((x->x_cols + x->x_rows) * sizeof(*x->x_io)); return (x); usage: pd_error(0, "[%s] bad arguments\n\tuse ' '\n\tor '-m '", s->s_name); return 0; } static void mtx_mul_addmethods(t_class*c) { class_addmethod(c, (t_method)matrix_multilde_dsp, gensym("dsp"), A_CANT, 0); class_addmethod(c, (t_method)matrix_multilde_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(c, (t_method)matrix_multilde_element, gensym("element"), A_GIMME, 0); class_addmethod(c, (t_method)matrix_multilde_row, gensym("row"), A_GIMME, 0); class_addmethod(c, (t_method)matrix_multilde_col, gensym("col"), A_GIMME, 0); class_addmethod(c, (t_method)matrix_multilde_stop, gensym("stop"), 0); class_addmethod(c, (t_method)matrix_multilde_time, gensym("time"), A_FLOAT, 0); /* LATER: can we reuse the 'matrix' method and transpose * depending on the compat level? */ class_addmethod(c, (t_method)matrix_multilde_matrixT, gensym(""), A_GIMME, 0); CLASS_MAINSIGNALIN(c, t_matrix_multilde, x_msi); } void mtx_mul_tilde_setup(void) { if (CLASS_MULTICHANNEL && iemmatrix_getpdfun("signal_setmultiout")) { /* multichannel variant */ matrix_multilde_mclass = class_new(gensym("mtx_mul~"), (t_newmethod)matrix_multilde_new, (t_method)matrix_multilde_free, sizeof(t_matrix_multilde), 0 | CLASS_MULTICHANNEL, A_GIMME, 0); /* non-multichannel variant */ /* compatibility with jmz's zexy */ matrix_multilde_class = class_new(gensym("matrix~"), (t_newmethod)matrix_multilde_new, (t_method)matrix_multilde_free, sizeof(t_matrix_multilde), 0, A_GIMME, 0); class_sethelpsymbol(matrix_multilde_class, gensym("mtx_mul~")); } else { matrix_multilde_class = class_new(gensym("mtx_mul~"), (t_newmethod)matrix_multilde_new, (t_method)matrix_multilde_free, sizeof(t_matrix_multilde), 0, A_GIMME, 0); class_addcreator((t_newmethod)matrix_multilde_new, gensym("matrix~"), A_GIMME, 0); matrix_multilde_mclass = matrix_multilde_class; } class_addcreator((t_newmethod)matrix_multilde_new, gensym("mtx_*~"), A_GIMME, 0); class_addcreator((t_newmethod)matrix_multilde_new, gensym("matrix_mul~"), A_GIMME, 0); /* compatibility with tm's iem_matrix */ class_addcreator((t_newmethod)matrix_multilde_new, gensym("matrix_mul_line~"), A_GIMME, 0); mtx_mul_addmethods(matrix_multilde_mclass); if(matrix_multilde_mclass != matrix_multilde_class) mtx_mul_addmethods(matrix_multilde_class); matrix_multilde_proxy = class_new(gensym("mtx_*~ proxy"), 0, 0, sizeof(t_proxy), CLASS_PD, 0); class_addbang(matrix_multilde_proxy, (t_method)proxy_dspstopped); } void iemtx_mul__setup(void) { mtx_mul_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_neq.c000066400000000000000000000011231514557770000236250ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1!=f2; } void mtx_neq_setup(void) { iemmatrix_binop_setup("mtx_neq", 0, binop, "mtx_!=", (char*)0); } void iemtx_neq_setup(void) { mtx_neq_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_not.c000066400000000000000000000012351514557770000236460ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_not: B=!A; */ #define MTX_ALMOSTZERO 1e-19 static t_float unop(t_float f) { return (t_float)(f-MTX_ALMOSTZERO); } void mtx_not_setup(void) { iemmatrix_unop_setup("mtx_not", 0, unop, "mtx_!", (char*)0); } void iemtx_not_setup(void) { mtx_not_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_ones.c000066400000000000000000000027661514557770000240240ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_ones */ static t_class *mtx_ones_class; static void *mtx_ones_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_ones_class); int col=0, row=0; (void)s; /* unused */ outlet_new(&x->x_obj, 0); x->m.row = x->m.col = 0; x->m.atombuffer = 0; switch(argc) { case 0: break; case 1: col=row=atom_getfloat(argv); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); } if(col<0) { col=0; } if(row<0) { row=0; } if (col && row) { x->m.atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom)); setdimen(&x->m, row, col); matrix_set(&x->m, 1); } return (x); } void mtx_ones_setup(void) { mtx_ones_class = class_new(gensym("mtx_ones"), (t_newmethod)mtx_ones_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist(mtx_ones_class, matrixobj_ones); class_addbang(mtx_ones_class, matrixobj_bang); class_addmethod(mtx_ones_class, (t_method)matrixobj_ones, gensym("matrix"), A_GIMME, 0); } void iemtx_ones_setup(void) { mtx_ones_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_or.c000066400000000000000000000012201514557770000234600ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { int i1 = (int)f1; int i2 = (int)f2; int i = i1 || i2; return (t_float)i; } void mtx_or_setup(void) { iemmatrix_binop_setup("mtx_or", 0, binop, "mtx_||", (char*)0); } void iemtx_or_setup(void) { mtx_or_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_pack~.c000066400000000000000000000111221514557770000241560ustar00rootroot00000000000000#include "iemmatrix.h" #ifndef CLASS_MULTICHANNEL # define CLASS_MULTICHANNEL 0 #endif typedef void (*setmultiout_f)(t_signal **sig, int nchans); static int can_multiout = 0; #define MTX_PACK_MAXCHANNELS 200 static t_class *mtx_pack_tilde_class; typedef struct _mtx_pack_tilde { t_object x_obj; unsigned int block_size; size_t num_ports; /* number of inlet~s (0 for 1 multichannel signal) */ size_t num_channels; /* number of input signals */ t_sample **sig_in; t_atom *list_out; t_outlet *message_outlet, *info_outlet; t_clock*clock; } mtx_pack_tilde; static int should_defer(mtx_pack_tilde*x) { int major, minor, bugfix; sys_getversion(&major, &minor, &bugfix); if(KERNEL_VERSION(major, minor, bugfix) >= KERNEL_VERSION(0, 56, 0)) return 1; pd_error(x, "starting with Pd-0.56, [mtx_pack~] will stop sending messages in the DSP-tick!"); pd_error(x, "adjust your patches accordingly"); return 0; } static void mTxPackTildeOut(mtx_pack_tilde*x) { if(x->block_size && x->num_channels) { outlet_anything(x->message_outlet,gensym("matrix"), x->block_size*x->num_channels + 2, x->list_out); } } void *newMtxPackTilde (t_floatarg f) { static int deferred = -1; mtx_pack_tilde *x = (mtx_pack_tilde*) pd_new(mtx_pack_tilde_class); int num_ports = (int)f; if(deferred < 0) deferred = should_defer(x); if ((num_ports < 1) || (num_ports>MTX_PACK_MAXCHANNELS)) { num_ports=1; } x->num_ports = num_ports; while (num_ports--) { signalinlet_new(&x->x_obj, 0); } x->message_outlet=(t_outlet*)outlet_new(&x->x_obj, 0); x->info_outlet=(t_outlet*)outlet_new(&x->x_obj, 0); if(deferred) x->clock = clock_new(x, (t_method)mTxPackTildeOut); return (void *) x; } void deleteMtxPackTilde (mtx_pack_tilde *x) { if (x->sig_in) { freebytes (x->sig_in, x->num_channels * sizeof (*x->sig_in)); } if (x->list_out) { freebytes (x->list_out, (x->num_channels * x->block_size + 2)*sizeof(*x->list_out)); } if(x->clock) clock_free(x->clock); } static t_int *mTxPackTildePerform (t_int *arg) { mtx_pack_tilde *x = (mtx_pack_tilde *) (arg[1]); unsigned int chan; unsigned int samp; t_atom *lptr=x->list_out+2; for (chan=0; channum_channels; chan++) { for (samp=0; sampblock_size; samp++,lptr++) { SETFLOAT(lptr, x->sig_in[chan][samp]); } } if(x->clock) clock_delay(x->clock, 0); else mTxPackTildeOut(x); return(arg+2); } static void mTxPackTildeDsp (mtx_pack_tilde *x, t_signal **sp) { size_t i, chan = x->num_ports; int block_size=(sp[0]->s_n>0)?sp[0]->s_n:0; if(x->sig_in) freebytes(x->sig_in, sizeof(*x->sig_in) * x->num_channels); x->sig_in = 0; #if CLASS_MULTICHANNEL if(can_multiout) { /* with multichannels, we concatenate all channels from all ports */ chan = 0; for(i=0; inum_ports; i++) { chan += sp[i]->s_nchans; } } #endif x->num_channels = chan; x->sig_in = (t_sample**)getbytes(sizeof(*x->sig_in)*x->num_channels); if(0) { #if CLASS_MULTICHANNEL } else if (can_multiout) { for(i=0, chan=0; inum_ports; i++) { int j; for(j=0; js_nchans; j++) { x->sig_in[chan++] = sp[i]->s_vec + j * block_size; } } #endif } else { for (i=0; i < chan; i++) { x->sig_in[i]=sp[i]->s_vec; } } x->block_size=block_size; x->list_out = (t_atom*) getbytes ((x->num_channels * x->block_size + 2) * sizeof(*x->list_out)); dsp_add(mTxPackTildePerform,1,x); SETFLOAT(x->list_out+0, (t_float)x->num_channels); SETFLOAT(x->list_out+1, (t_float)x->block_size); outlet_anything(x->info_outlet,gensym("channels"), 1, x->list_out+0); outlet_anything(x->info_outlet,gensym("blocksize"), 1, x->list_out+1); outlet_anything(x->info_outlet,gensym("dimen"), 2, x->list_out); } void mtx_pack_tilde_setup (void) { int flags = CLASS_NOINLET; if (CLASS_MULTICHANNEL && iemmatrix_getpdfun("signal_setmultiout")) { flags |= CLASS_MULTICHANNEL; } mtx_pack_tilde_class = class_new(gensym("mtx_pack~"), (t_newmethod)newMtxPackTilde, (t_method)deleteMtxPackTilde, sizeof(mtx_pack_tilde), flags, A_DEFFLOAT, 0); class_addmethod (mtx_pack_tilde_class, (t_method) mTxPackTildeDsp, gensym("dsp"), A_CANT, 0); can_multiout = (CLASS_MULTICHANNEL && 0!=iemmatrix_getpdfun("signal_setmultiout")); } void iemtx_pack__setup(void) { mtx_pack_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_pivot.c000066400000000000000000000103411514557770000242050ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_pivot */ static t_class *mtx_pivot_class; typedef struct _mtx_pivot { t_object x_obj; t_matrix m; /* the output matrix */ t_matrix m_pre; /* the pre -multiply matrix */ t_matrix m_post; /* the post-multiply matrix */ t_outlet *pivo, *pre, *post; t_int ascending; } t_mtx_pivot; static void mtx_pivot_matrix(t_mtx_pivot *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); t_atom *m_pre, *m_post; int i, j, k; int min_rowcol = (rowascending); if(iemmatrix_check(x, s, argc, argv, 0))return; adjustsize(x, &x->m, row, col); adjustsize(x, &x->m_pre, row, row); adjustsize(x, &x->m_post,col, col); matrix_set(&x->m_pre, 0); matrix_set(&x->m_post, 0); buffer = matrix2float(argv); i_pre = (int *)getbytes(sizeof(int)*row); i_post = (int *)getbytes(sizeof(int)*col); /* clear pre&post matrices */ i=row; i_buf=i_pre; while(i--) { *i_buf++=row-i-1; } i=col; i_buf=i_post; while(i--) { *i_buf++=col-i-1; } /* do the pivot thing */ for (k=0; ktmp) || (!ascending && fm.atombuffer, buffer); i=col; m_post = x->m_post.atombuffer+2; while(i--) { SETFLOAT(m_post+i_post[i]*col+i, 1); } i=row; m_pre = x->m_pre.atombuffer+2; while(i--) { SETFLOAT(m_pre+i_pre[i]+i*row, 1); } outlet_anything(x->post, gensym("matrix"), 2+col*col, x->m_post.atombuffer); outlet_anything(x->pre, gensym("matrix"), 2+row*row, x->m_pre.atombuffer); outlet_anything(x->pivo , gensym("matrix"), 2+row*col, x->m.atombuffer ); } static void mtx_pivot_free(t_mtx_pivot *x) { matrix_free(&x->m); matrix_free(&x->m_pre); matrix_free(&x->m_post); } static void *mtx_pivot_new(t_floatarg f) { t_mtx_pivot *x = (t_mtx_pivot *)pd_new(mtx_pivot_class); x->pivo = outlet_new(&x->x_obj, 0); x->pre = outlet_new(&x->x_obj, 0); x->post = outlet_new(&x->x_obj, 0); x->ascending = (f < 0.f)?0:1; x->m.atombuffer = x->m_pre.atombuffer = x->m_post.atombuffer = 0; x->m.row = x->m.col = x->m_pre.row = x->m_pre.col = x->m_post.row = x->m_post.col = 0; return(x); } void mtx_pivot_setup(void) { mtx_pivot_class = class_new(gensym("mtx_pivot"), (t_newmethod)mtx_pivot_new, (t_method)mtx_pivot_free, sizeof(t_mtx_pivot), 0, A_DEFFLOAT, 0); class_addmethod(mtx_pivot_class, (t_method)mtx_pivot_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_pivot_setup(void) { mtx_pivot_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_pow.c000066400000000000000000000012201514557770000236450ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { #if PD_FLOATSIZE == 32 return powf(f1, f2); #else return pow(f1, f2); #endif } void mtx_pow_setup(void) { iemmatrix_binop_setup("mtx_.^", "mtx_pow", binop, (char*)0); } void iemtx_pow_setup(void) { mtx_pow_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_powtodb.c000066400000000000000000000011201514557770000245150ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_powtodb: B=powtodb(A); B[n,m]=powtodb(A[n,m]) */ void mtx_powtodb_setup(void) { iemmatrix_unop_setup("mtx_powtodb", 0, powtodb, (char*)0); } void iemtx_powtodb_setup(void) { mtx_powtodb_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_print.c000066400000000000000000000025241514557770000242040ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" typedef struct _mtxprint { t_object x_obj; t_symbol *x_s; } t_mtxprint; /* mtx_print */ static t_class *mtx_print_class; static void mtx_print(t_mtxprint *x, t_symbol *s, int argc, t_atom *argv) { int col, row; if(iemmatrix_check(x, s, argc, argv, 0))return; row = atom_getfloat(argv++); col = atom_getfloat(argv++); post("%s:", x->x_s->s_name); while(row--) { postatom(col, argv); argv+=col; endpost(); } endpost(); } static void *mtx_print_new(t_symbol*s) { t_mtxprint *x = (t_mtxprint *)pd_new(mtx_print_class); x->x_s=(s&&s!=&s_)?s:gensym("matrix"); return (x); } void mtx_print_setup(void) { mtx_print_class = class_new(gensym("mtx_print"), (t_newmethod)mtx_print_new, 0, sizeof(t_mtxprint), 0, A_DEFSYM, 0); class_addmethod (mtx_print_class, (t_method)mtx_print, gensym("matrix"), A_GIMME, 0); } void iemtx_print_setup(void) { mtx_print_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_prod.c000066400000000000000000000036011514557770000240110ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_prod */ /* column-wise product */ static t_class *mtx_prod_class; static void mtx_prod_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv++); int col=atom_getfloat(argv++); int n; (void)s; /* unused */ if(row*col>argc-2) { pd_error(x, "[mtx_prod]: sparse matrices not yet supported : use \"mtx_check\""); } else { t_atom *ap = (t_atom *)getbytes(col * sizeof(t_atom)), *dummy=ap; for(n=0; nx_obj.ob_outlet, gensym("prod"), col, ap); freebytes(ap, (col * sizeof(t_atom))); } } static void mtx_prod_list(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { t_float f=1.f; (void)s; /* unused */ while(argc--) { f*=atom_getfloat(argv++); } outlet_float(x->x_obj.ob_outlet, f); } static void *mtx_prod_new(void) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_prod_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_prod_setup(void) { mtx_prod_class = class_new(gensym("mtx_prod"), (t_newmethod)mtx_prod_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0); class_addlist (mtx_prod_class, mtx_prod_list); class_addmethod(mtx_prod_class, (t_method)mtx_prod_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_prod_setup(void) { mtx_prod_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull.c000066400000000000000000000075141514557770000242010ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * own qhull algorithm implementation * * Copyright (c) 2012, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include #include "mtx_qhull/zhull.h" static t_class *mtx_qhull_class; typedef struct MTXQhull_ MTXQhull; struct MTXQhull_ { t_object x_obj; t_outlet *outl; t_outlet *outl_fl; t_atom *list; size_t size; size_t hull_size; // int iter; zhull_t *zh; }; static void deleteMTXQhull(MTXQhull *xo) { if (xo->zh!=0) { free(xo->zh); xo->zh=0; } if (xo->list!=0) { free(xo->list); xo->list=0; xo->size=0; } } /*void mTXQhullSetIterations(MTXQhull *xo, t_float f) { xo->iter=(int)f; if (xo->iter<0) xo->iter=0; }*/ static void *newMTXQhull() { MTXQhull *xo = (MTXQhull *) pd_new (mtx_qhull_class); xo->outl = outlet_new (&xo->x_obj, gensym("matrix")); xo->outl_fl = outlet_new (&xo->x_obj, gensym("float")); // if (argc>0) // mTXQhullSetIterations(xo,atom_getfloat(argv)); return ((void *) xo); } static void mTXQhullMatrix(MTXQhull *xo, t_symbol *s, int argc, t_atom *argv) { unsigned int rows, columns; unsigned int i; float *x; float *y; float *z; /* size check */ if(iemmatrix_check(xo, s, argc, argv, 0))return; rows=atom_getint(argv++); columns=atom_getint(argv++); if ((rows<4)||(columns!=3)) { pd_error(xo, "[mtx_qhull]: requires an L x 3 matrix with at least L>=4"); return; } xo->zh = (zhull_t*)malloc(sizeof(zhull_t)); x=(float*)malloc(rows*sizeof(float)); y=(float*)malloc(rows*sizeof(float)); z=(float*)malloc(rows*sizeof(float)); if ((x!=0)&&(y!=0)&&(z!=0)&&(xo->zh!=0)) { for (i=0; izh)=zhullInitPoints(x,y,z,rows); i=calculateZHull(xo->zh); outlet_float(xo->outl_fl, (float)i); free(x); free(y); free(z); xo->hull_size=getLength(xo->zh->facets); if (xo->list==0) { xo->list = (t_atom*)malloc((xo->hull_size*3+2)*sizeof(t_atom)); } else { xo->list = (t_atom*)realloc(xo->list,(xo->hull_size*3+2)*sizeof(t_atom)); } if(xo->list!=0) { xo->size=(xo->hull_size*3+2); SETFLOAT(xo->list,(float)xo->hull_size); SETFLOAT(xo->list+1,(float)3); for (i=0; ihull_size; i++) { SETFLOAT(xo->list+2+3*i, (float)getTriangleCorner(xo->zh,i,0)+1); SETFLOAT(xo->list+3+3*i, (float)getTriangleCorner(xo->zh,i,1)+1); SETFLOAT(xo->list+4+3*i, (float)getTriangleCorner(xo->zh,i,2)+1); } outlet_anything(xo->outl, gensym("matrix"), xo->size, xo->list); freeZhull(xo->zh); free(xo->zh); xo->zh=0; } else { pd_error(xo, "[mtx_qhull]: memory problem, no operation!"); xo->size=0; freeZhull(xo->zh); free(xo->zh); xo->zh=0; } } else { if(x!=0) { free(x); } if(y!=0) { free(y); } if(z!=0) { free(z); } if(xo->zh!=0) { free(xo->zh); } xo->zh=0; pd_error(xo, "[mtx_qhull]: memory error, no operation!"); } } void mtx_qhull_setup (void) { mtx_qhull_class = class_new ( gensym("mtx_qhull"), (t_newmethod) newMTXQhull, (t_method) deleteMTXQhull, sizeof(MTXQhull), CLASS_DEFAULT, 0); class_addmethod(mtx_qhull_class, (t_method) mTXQhullMatrix, gensym("matrix"), A_GIMME, 0); // class_addfloat(mtx_qhull_class, (t_method) mTXQhullSetIterations); } void iemtx_qhull_setup(void) { mtx_qhull_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/000077500000000000000000000000001514557770000240265ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/convhull.pd000066400000000000000000000163571514557770000262210ustar00rootroot00000000000000#N canvas 516 162 809 477 12; #N canvas 361 7 823 746 alltriangles 0; #X obj 90 -47 t a a; #X obj 90 -21 mtx_size; #X obj 90 48 until; #X obj 132 48 f; #X obj 168 49 + 1; #X msg 150 26 1; #X obj 331 370 mtx; #X obj 273 370 mtx; #X obj 216 370 mtx; #X msg 216 348 row \$1; #X obj 132 154 until; #X obj 174 154 f; #X obj 202 154 + 1; #X obj 132 68 + 1; #X obj 132 110 -; #X obj 90 -1 t f b f; #X obj 132 88 t f f f; #X obj 216 283 pack f f f; #X obj 132 132 * -1; #X obj 90 27 - 2; #X obj 186 112 - 1; #X obj 174 262 until; #X obj 216 262 f; #X obj 244 262 + 1; #X obj 174 218 -; #X obj 174 196 t f f f; #X obj 174 240 * -1; #X obj 228 220 - 1; #X obj 174 176 + 1; #X obj 206 176 + 1; #X obj 90 -71 inlet; #X obj 216 508 outlet; #X obj 216 433 list append; #X obj 273 403 list append; #X obj 216 455 mtx 3 3; #X text 218 54 n=1...L; #X text 249 158 m=n+1...L; #X text 302 267 k=m+1...L; #X text 351 285 [k m n(; #X text 312 451 comment; #X obj 216 482 mtx_transpose; #X text 330 482 [ak \, am \, an]; #X obj 462 511 outlet kmn; #X msg 273 348 row \$2; #X msg 331 348 row \$3; #X obj 216 304 t l l l; #X connect 0 0 1 0; #X connect 0 1 6 1; #X connect 0 1 7 1; #X connect 0 1 8 1; #X connect 1 0 15 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 13 0; #X connect 4 0 3 1; #X connect 5 0 3 1; #X connect 6 0 33 1; #X connect 7 0 33 0; #X connect 8 0 32 0; #X connect 9 0 8 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 11 0 17 1; #X connect 11 0 28 0; #X connect 12 0 11 1; #X connect 13 0 16 0; #X connect 14 0 18 0; #X connect 15 0 19 0; #X connect 15 1 5 0; #X connect 15 2 14 1; #X connect 15 2 29 0; #X connect 16 0 14 0; #X connect 16 1 11 1; #X connect 16 2 20 0; #X connect 17 0 42 0; #X connect 17 0 45 0; #X connect 18 0 10 0; #X connect 19 0 2 0; #X connect 20 0 17 2; #X connect 21 0 22 0; #X connect 22 0 23 0; #X connect 22 0 17 0; #X connect 23 0 22 1; #X connect 24 0 26 0; #X connect 25 0 24 0; #X connect 25 1 22 1; #X connect 25 2 27 0; #X connect 26 0 21 0; #X connect 27 0 22 1; #X connect 28 0 25 0; #X connect 29 0 24 1; #X connect 30 0 0 0; #X connect 32 0 34 0; #X connect 33 0 32 1; #X connect 34 0 40 0; #X connect 40 0 31 0; #X connect 43 0 7 0; #X connect 44 0 6 0; #X connect 45 0 9 0; #X connect 45 1 43 0; #X connect 45 2 44 0; #X restore 107 124 pd alltriangles; #X obj 107 96 t a a; #X obj 16 16 inlet; #X obj 16 389 outlet; #N canvas 0 0 450 474 normalizepoints 0; #X obj 94 39 inlet; #X obj 94 63 t a a; #X obj 139 133 mtx_.^ 2; #X obj 139 156 mtx_sum; #X obj 139 180 t l l; #X obj 139 207 mtx; #X obj 185 180 length; #X obj 94 308 outlet; #X obj 94 282 mtx_./; #X obj 139 230 mtx_.^ 0.5; #X msg 240 180 size \$1 1; #X obj 138 254 mtx_repmat 1 3; #X obj 138 108 mtx_transpose; #X connect 0 0 1 0; #X connect 1 0 8 0; #X connect 1 1 12 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 5 0 9 0; #X connect 6 0 10 0; #X connect 8 0 7 0; #X connect 9 0 11 0; #X connect 10 0 5 0; #X connect 11 0 8 1; #X connect 12 0 2 0; #X restore 107 69 pd normalizepoints; #X obj 98 270 t l; #X obj 16 297 list; #X obj 16 321 t l l; #X obj 16 355 mtx; #X obj 70 321 length; #X obj 130 321 / 3; #X msg 164 321 size \$1 3; #X obj 59 270 list; #X obj 16 42 t b a b; #X text 308 55 \$1 allows to specify the algorithmic exactness; #X text 329 73 if \$1>0 \, triangles that are not strictly; #X text 330 91 part of the convex hull can be enclosed; #X text 329 109 it is recommended for numerical reasons to use; #X text 331 126 0.001 to ensure all triangles can be found; #N canvas 25 51 450 300 normal_vector 0; #X obj 47 32 inlet; #X obj 47 228 outlet; #X obj 109 166 mtx_-; #X obj 47 148 t a a; #X obj 47 59 t a a; #X obj 47 171 mtx_-; #X text 128 194 n_kmn = (am-ak) x (am-an); #X obj 95 84 mtx_slice 1 3 end 3; #X obj 79 105 mtx_slice 1 1 end 1; #X obj 47 128 mtx_slice 1 2 end 2; #X obj 47 193 mtx_xprod; #X connect 0 0 4 0; #X connect 2 0 10 1; #X connect 3 0 5 0; #X connect 3 1 2 0; #X connect 4 0 9 0; #X connect 4 1 7 0; #X connect 4 1 8 0; #X connect 5 0 10 0; #X connect 7 0 2 1; #X connect 8 0 5 1; #X connect 9 0 3 0; #X connect 10 0 1 0; #X restore 107 153 pd normal_vector; #N canvas 93 179 470 520 normal_distances 0; #X obj 16 21 inlet; #X obj 16 489 outlet; #X obj 333 24 inlet Punkte; #X obj 214 28 inlet k; #X obj 16 318 mtx_*; #X obj 16 183 t a a; #X obj 333 199 mtx_transpose; #X obj 214 155 mtx; #X msg 214 128 row \$1; #X obj 213 178 mtx 3 1; #X obj 69 349 mtx_*; #X text 30 290 n_kmn^T * P; #X text 116 348 n_kmn^T * ak; #X obj 16 153 mtx_transpose; #X obj 16 438 mtx_- 0; #X msg 69 378 \$3; #N canvas 612 2 450 474 normalizepoints2 0; #X obj 94 19 inlet; #X obj 94 43 t a a; #X obj 139 93 mtx_.^ 2; #X obj 139 116 mtx_sum; #X obj 139 140 t l l; #X obj 139 167 mtx; #X obj 185 140 length; #X obj 94 268 outlet; #X obj 94 242 mtx_./; #X obj 139 190 mtx_.^ 0.5; #X msg 240 141 size 1 \$1; #X obj 138 212 mtx_repmat 3 1; #X connect 0 0 1 0; #X connect 1 0 8 0; #X connect 1 1 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 5 0 9 0; #X connect 6 0 10 0; #X connect 8 0 7 0; #X connect 9 0 11 0; #X connect 10 0 5 0; #X connect 11 0 8 1; #X restore 16 98 pd normalizepoints2; #X connect 0 0 16 0; #X connect 2 0 6 0; #X connect 2 0 7 1; #X connect 3 0 8 0; #X connect 4 0 14 0; #X connect 5 0 4 0; #X connect 5 1 10 0; #X connect 6 0 4 1; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 10 1; #X connect 10 0 15 0; #X connect 13 0 5 0; #X connect 14 0 1 0; #X connect 15 0 14 1; #X connect 16 0 13 0; #X restore 107 186 pd normal_distances; #N canvas 0 0 678 377 filter_triangle_of_hull 0; #X obj 23 11 inlet; #X text 32 -8 normalabstaende; #X obj 241 12 inlet; #X text 246 -7 k m n; #X obj 23 58 t a a; #X obj 146 142 mtx_* -1; #X obj 146 188 mtx_prod; #X obj 23 36 mtx_transpose; #X obj 23 178 mtx_prod; #X obj 23 202 sel 1; #X obj 146 211 sel 1; #X obj 146 238 list; #X msg 23 278 \$3 \$2 \$1; #X obj 23 232 list; #X obj 23 325 outlet; #X text 419 40 \$1 adds some inaccuracy; #X text 446 57 to "convex"; #X text 265 202 of the regarded triangle?; #X text 298 265 hull; #X obj 365 14 loadbang; #X obj 146 165 mtx_>= 0; #X obj 23 142 mtx_>= 0; #X obj 365 36 f \$1; #X obj 365 57 abs; #X obj 364 79 * -1; #X text 264 185 are all points on one or the other side; #X text 296 248 then it is part of the convex; #X text 261 218 (or at least close to that); #X connect 0 0 7 0; #X connect 2 0 11 1; #X connect 2 0 13 1; #X connect 4 0 21 0; #X connect 4 1 5 0; #X connect 5 0 20 0; #X connect 6 0 10 0; #X connect 7 0 4 0; #X connect 8 0 9 0; #X connect 9 0 13 0; #X connect 10 0 11 0; #X connect 11 0 14 0; #X connect 12 0 14 0; #X connect 13 0 12 0; #X connect 19 0 22 0; #X connect 20 0 6 0; #X connect 21 0 8 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 24 0 20 1; #X connect 24 0 21 1; #X restore 107 218 pd filter_triangle_of_hull; #X connect 0 0 19 0; #X connect 0 1 20 1; #X connect 0 1 21 1; #X connect 1 0 0 0; #X connect 1 1 20 2; #X connect 2 0 13 0; #X connect 4 0 1 0; #X connect 5 0 12 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 8 0 3 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 8 0; #X connect 12 0 5 0; #X connect 12 0 6 1; #X connect 13 0 6 0; #X connect 13 1 4 0; #X connect 13 2 6 1; #X connect 13 2 12 1; #X connect 19 0 20 0; #X connect 20 0 21 0; #X connect 21 0 12 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/entry.h000066400000000000000000000031231514557770000253370ustar00rootroot00000000000000#ifndef QHULL_ENTRY_H #define QHULL_ENTRY_H #include #include /* * variable entry types for * list operations in zhull * * Copyright (c) 2012, IOhannes zmoelnig, * with friendly help from * IEM, Graz, Austria * * */ #ifdef __sgi__ # define index_t qhull_index_t #endif typedef size_t index_t; typedef union { index_t i; void*p; } entryvalu_t; typedef enum { INDEX, POINTER, INVALID } entrytype_t; typedef struct entry_ { entrytype_t typ; entryvalu_t val; } entry_t; static void entry_setIndex(entry_t*e, index_t i) { e->typ=INDEX; e->val.i=i; } static void entry_setPointer(entry_t*e, void*p) { e->typ=POINTER; e->val.p=p; } static entry_t entry_makeIndex(index_t i) { entry_t result; entry_setIndex(&result, i); return result; } static entry_t entry_makePointer(void*p) { entry_t result; entry_setPointer(&result, p); return result; } static index_t entry_getIndex(const entry_t*e) { return (INDEX==e->typ)?e->val.i:0; } static void*entry_getPointer(const entry_t*e) { return (POINTER==e->typ)?e->val.p:0; } static int entry_equals(const entry_t*e1, const entry_t*e2) { if(e1->typ!=e2->typ) { return 0; } switch(e1->typ) { case INDEX: return (e1->val.i == e2->val.i); case POINTER: return (e1->val.p == e2->val.p); default: return 0; } return 0; } static void print_entry(const entry_t e) { switch(e.typ) { case INDEX: printf("%lu", (unsigned long)(e.val.i)); return; case POINTER: printf("0x%p", e.val.p); return; default: printf(""); return; } } #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/list.c000066400000000000000000000175751514557770000251640ustar00rootroot00000000000000#include "list.h" #include #include /* * list operations for zhull * * Copyright (c) 2012, Franz Zotter, * with friendly help from * IOhannes zmoelnig * for variable entry types * in entry.h * IEM, Graz, Austria * * */ // memory things: list_t emptyList(void) { list_t generated_list; generated_list.length=0; generated_list.entries=0; return generated_list; } list_t allocateList(const size_t length) { list_t generated_list = emptyList(); if (length>0) { generated_list.entries= (entry_t*) malloc(length*sizeof(entry_t)); if (generated_list.entries!=0) { generated_list.length=length; } } return generated_list; } void reallocateList(list_t *list, const size_t length) { if (length>0) { if (getLength(*list)==0) { *list = allocateList(length); } else { if (list->length != length) { list->entries = (entry_t*) realloc(list->entries,length*sizeof(entry_t)); } if (list->entries!=0) { list->length=length; } else { *list=emptyList(); } } } else { freeList(list); } } void freeList(list_t *list) { if (list->entries!=0) { free(list->entries); } list->entries=0; list->length=0; } // programming interface: size_t getLength(const list_t list) { return list.length; } entry_t getEntry(const list_t list, const index_t index) { if (index=start) { length=(size_t) (stop-start+1); incr=1; } else { length=(size_t) (start-stop+1); incr=-1; } list_t l = allocateList(length); if (getLength(l)!=0) { for (i=0,c=start; i=getLength(list1)) { for (i=0; i0)&&(stop>0)&&(startstop) { incr=-1; new_list=allocateList(start-stop+1); } else { incr=1; new_list=allocateList(start-stop+1); } for (j=start,i=0; ii) { setEntry(*list,i,entry); } } void removeIndexFromList(list_t *list, const index_t index) { index_t i,j; for (i=j=0; i0) for (i=0, j=getLength(*list)-1; ientries[j]; entry_t e2=list->entries[i]; if(entry_equals(&e1, &e2)) { break; } } if (i==k) { list->entries[i++]=list->entries[j]; k++; } } reallocateList(list, k); } list_t findValueListInList(const list_t value_list, const list_t list) { list_t l=emptyList(); index_t i; for (i=0; i0) { print_entry(getEntry(list,0)); } for (i=1; i #include #include #include "entry.h" /* * list operations for zhull * * Copyright (c) 2012, Franz Zotter, * with friendly help from * IOhannes zmoelnig * for variable entry types * in entry.h * IEM, Graz, Austria * * */ typedef struct list_ { entry_t *entries; size_t length; } list_t; // memory things: list_t emptyList(void); void freeList(list_t *list); // programming interface: size_t getLength(const list_t list); entry_t getEntry(const list_t list, const index_t index); void setEntry(const list_t list, const index_t index, const entry_t entry); list_t initList(const entry_t *entries, const size_t length); list_t initListIndex(const index_t *entries, const size_t length); list_t initListFromTo(const index_t start, const index_t stop); list_t initConstantList(const entry_t c, const size_t length); list_t duplicateList(const list_t list_in); list_t mergeLists(const list_t list1, const list_t list2); list_t getSubList(const list_t list, const list_t indices); list_t getSubListFromTo(const list_t list, const index_t start, const index_t stop); void appendToList(list_t *list, const entry_t entry); void removeValueFromList(list_t *list, const entry_t entry); void removeIndexFromList(list_t *list, const index_t index); void appendListToList(list_t *list1, const list_t list2); void removeValueListFromList(list_t *list, const list_t excl_list); void removeEntryListFromList(list_t *list, const list_t indices); void reverseList(list_t * const list); int inList(const entry_t entry, const list_t list); int notInList(const entry_t entry, const list_t list); list_t findValueListInList(const list_t value_list, const list_t list); index_t findValueInList(const entry_t entry, const list_t list); void uniquefyListEntries(list_t *list); void printList(const list_t list); #endif /* QHULL_LIST_H */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/mtx_xprod.pd000066400000000000000000000014461514557770000264040ustar00rootroot00000000000000#N canvas 502 62 631 420 12; #X obj 73 53 inlet; #X obj 473 54 inlet; #X obj 73 81 t a a; #X obj 73 202 mtx_.*; #X obj 197 201 mtx_.*; #X obj 73 239 mtx_-; #X obj 73 287 outlet; #X text 180 34 mtx: cross product; #X text 291 206 matrix1: 3xN; #X text 291 227 matrix2: 3xN; #X text 291 252 ============; #X text 299 273 matrix: 3xN; #X text 407 206 [a1 a2 a3 ...]; #X text 408 227 [b1 b2 b3 ...]; #X text 410 272 [a1 x b1 \, a2 x b2 \, ...]; #X obj 73 114 mtx_scroll -1; #X obj 197 114 mtx_scroll 1; #X obj 345 112 mtx_scroll 1; #X obj 473 113 mtx_scroll -1; #X connect 0 0 2 0; #X connect 1 0 17 0; #X connect 1 0 18 0; #X connect 2 0 15 0; #X connect 2 1 16 0; #X connect 3 0 5 0; #X connect 4 0 5 1; #X connect 5 0 6 0; #X connect 15 0 3 0; #X connect 16 0 4 0; #X connect 17 0 3 1; #X connect 18 0 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/test_list.c000066400000000000000000000041131514557770000262030ustar00rootroot00000000000000#include #include #include "list.h" int main(char **argv, int argc) { list_t l1=emptyList(); list_t l2=emptyList(); list_t l3=emptyList(); index_t x[]= {0, 2, 4, 6}; printf("\nempty list:\n"); printList(l1); freeList(&l1); printf("\nconstant list with 10 1 entries:\n"); l1=initConstantList(entry_makeIndex(1),10); printList(l1); freeList(&l1); printf("\nlist from 2 to 3:\n"); l1=initListFromTo(2,3); printList(l1); printf("\nlist from 7 to 1:\n"); l2=initListFromTo(7,1); printList(l2); printf("\nduplicate list from 2 to 3:\n"); l3=duplicateList(l1); printList(l3); freeList(&l3); printf("\nmerge list from 2..3 with list 7..1:\n"); l3=mergeLists(l1,l2); printList(l3); printf("\nremove value 6 list from list:\n"); removeValueFromList(&l3,entry_makeIndex(6)); printList(l3); printf("\nremove values [2, 3] from list:\n"); removeValueListFromList(&l3,l1); printList(l3); printf("\nreverse list:\n"); reverseList (&l2); printList(l2); printf("\nappend entry 8 to list:\n"); appendToList(&l3,entry_makeIndex(8)); printList(l3); printf("\nis 8 not in list?: %d\n",notInList(entry_makeIndex(8),l3)); printf("is 3 not in list?: %d\n",notInList(entry_makeIndex(3),l3)); printf("\nremove index 4 from list\n"); removeIndexFromList(&l3,4); printList(l3); printf("\nremove index 1 from list\n"); removeIndexFromList(&l3,1); printList(l3); printf("\nremove index 0 from list\n"); removeIndexFromList(&l3,0); printList(l3); printf("\n...taking a longer list\n"); printList(l2); freeList(&l3); l3=initListIndex(x,4); printf("\nremoving index list "); printList(l3); removeEntryListFromList(&l2,l3); printList(l2); freeList(&l1); freeList(&l2); freeList(&l3); l1=initListFromTo(1,3); l2=initListFromTo(0,5); printf("\n...taking a longer list\n"); printList(l1); printf("\nfinding indices of values in list"); printList(l2); l3=findValueListInList(l2,l1); printList(l3); freeList(&l1); freeList(&l2); freeList(&l3); } // gcc list.c test_list.c && ./a.out iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/test_write_conv_hull_obj.pd000066400000000000000000000206441514557770000314550ustar00rootroot00000000000000#N canvas 468 416 824 552 10; #N canvas 69 11 539 331 writeobject 0; #X obj 163 270 textfile; #X obj 163 161 mtx; #X obj 163 123 until; #X obj 200 123 f; #X obj 226 123 + 1; #X msg 225 102 1; #X obj 163 81 t a a b; #X obj 163 102 mtx_size; #X obj 143 32 inlet; #X obj 373 44 inlet; #X msg 199 142 row \$1; #X obj 163 238 list trim; #X msg 269 196 add \$1; #X msg 329 174 symbol v; #X obj 373 65 t a b; #X obj 143 54 t b a b; #X msg 45 230 write test.obj cr; #X msg 399 108 clear; #X obj 164 218 list prepend; #X msg 269 174 symbol f; #X connect 1 0 18 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 10 0; #X connect 4 0 3 1; #X connect 5 0 3 1; #X connect 6 0 7 0; #X connect 6 1 1 1; #X connect 6 2 5 0; #X connect 7 0 2 0; #X connect 8 0 15 0; #X connect 9 0 14 0; #X connect 10 0 1 0; #X connect 11 0 0 0; #X connect 12 0 18 1; #X connect 13 0 12 0; #X connect 14 0 6 0; #X connect 14 1 13 0; #X connect 14 1 17 0; #X connect 15 0 16 0; #X connect 15 1 6 0; #X connect 15 2 19 0; #X connect 16 0 0 0; #X connect 17 0 0 0; #X connect 18 0 11 0; #X connect 19 0 12 0; #X restore 217 444 pd writeobject; #N canvas 4 49 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 41 route create; #X msg 67 70 set destroy; #X msg 142 68 set create; #X msg 132 112 create \, 1 \, lighting 1; #X msg 298 112 destroy \, reset; #X msg 256 79 color 0.78 0.8 1; #X obj 256 57 loadbang; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 6 0; #X connect 3 1 5 0; #X connect 3 1 7 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X connect 9 0 8 0; #X restore 376 128 pd gemwin; #X msg 376 109 destroy; #X obj 488 109 gemhead; #X obj 494 129 world_light; #X obj -11 319 gemhead; #X obj 79 452 model; #X floatatom 6 382 5 0 0 0 - - -; #X floatatom 49 383 5 0 0 0 - - -; #X floatatom 89 383 5 0 0 0 - - -; #X msg 33 333 open test.obj; #X msg 129 400 rescale 0; #X obj -9 358 color 0.9 0.9 0.9; #X obj 335 426 mtx_* 1.5; #X obj -10 338 ortho; #X obj 137 309 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 112 358 f; #X obj 167 358 % 360; #X obj 129 329 metro 50; #X msg 9 452 smooth 0; #X obj 213 386 mtx; #X obj 212 421 mtx_slice; #X msg 251 400 1 1 \$1 end; #X floatatom 73 276 5 0 0 0 - - -; #X obj 334 402 mtx; #X obj 113 277 t b b f b; #X obj 253 369 mtx_size; #X obj 229 350 t a a; #X msg 312 371 set \$1; #X obj -16 404 rotateXYZ -74 0 0; #X obj 140 358 + 3; #X obj 46 429 t b a; #X obj 335 317 convhull 0.001; #X obj 231 271 t a a; #X msg 151 83 4 40; #X msg 188 66 5 67; #X msg 149 67 3 26; #X msg 43 124 read designsN/N\$1_\$2.mtx \, bang; #X obj 41 205 mtx; #X obj 236 294 demux; #X obj 123 182 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 71 180 t b f; #X msg 190 85 9 180; #X msg 97 66 2 14; #X msg 46 88 2.5 12; #X floatatom 323 249 5 0 0 0 - - -; #X obj 317 269 t b f; #X msg -123 202 read Rls.mtx \, bang; #X msg 100 85 2.5 20; #X obj 107 239 mtx_size; #X obj 42 235 t b a a; #X obj 175 238 * 2; #X obj 207 238 - 4; #X floatatom 236 237 5 0 0 0 - - -; #X obj 396 64 mtx_print; #X msg 278 37 matrix 8 3 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1; #X obj 388 256 mtx_print; #N canvas 0 0 624 397 makepolygon 0; #X obj 75 114 mtx_:; #X obj 80 44 t f f; #X obj 83 70 - 1; #X msg 83 90 0 \$1; #X obj 89 139 mtx_./ 1; #X obj 87 187 mtx_* 3.14159; #X obj 92 163 mtx_* 2; #X obj 94 208 t a a a; #X obj 150 210 mtx_size; #X msg 218 208 1 \$1; #X obj 258 208 mtx_zeros; #X obj 103 238 mtx_cos; #X obj 136 265 mtx_sin; #X obj 143 341 mtx_transpose; #X obj 147 363 outlet; #X obj 114 17 inlet; #X obj 279 340 mtx_print; #X obj 135 317 mtx_concat col; #X obj 173 291 mtx_concat col; #X msg 68 19 5; #X connect 0 0 4 0; #X connect 1 0 2 0; #X connect 1 1 4 1; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 5 0; #X connect 7 0 11 0; #X connect 7 1 12 0; #X connect 7 2 8 0; #X connect 8 1 9 0; #X connect 9 0 10 0; #X connect 10 0 18 1; #X connect 11 0 17 0; #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 13 0 16 0; #X connect 15 0 1 0; #X connect 17 0 13 0; #X connect 18 0 17 1; #X connect 19 0 1 0; #X restore 376 163 pd makepolygon; #X obj 387 207 mtx_concat; #X msg 432 186 matrix 1 3 0 0 1; #X obj 382 187 t a b; #X msg 48 161 matrix 5 3 0 0 0 1 0 0 0 1 0 1 1 0 0.5 0.5 0; #X msg 322 136 9; #X obj -102 271 ../../abs/mtx_randperm; #X obj -103 229 t a a; #X obj -103 250 mtx_size; #X obj -101 293 mtx_*; #X obj -32 342 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 251 5 matrix 4 3 0 0 0 1 0 0 2 0 0 0 1 0; #X obj -115 -11 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #N canvas 547 27 715 363 combine_objects 0; #X obj -127 48 mtx; #X obj -124 69 t a a; #X obj -74 31 mtx_size; #X obj -68 53 pack; #X obj -69 72 mtx_rand; #X obj -89 131 mtx_+; #X obj -86 175 mtx_+; #X obj -41 175 mtx_* 0.94; #X obj -89 152 mtx_* 0.06; #X obj -67 92 mtx_* -2; #X obj -37 131 mtx_* 0.3; #X obj -99 8 metro 38; #X obj 264 5 inlet; #X obj -100 -13 inlet; #X obj -81 256 outlet; #X obj 204 2 inlet; #X obj 87 106 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj -52 112 mtx_+ 1; #X obj 73 225 mtx_concat; #X obj 56 63; #X obj 150 205 mtx_* 1; #X obj 78 204 mtx; #X obj 270 127 max 0.1; #X obj 238 46 t b f; #X obj 271 82 f; #X obj 192 64 delay 50; #X obj 243 106 t b b f; #X msg 434 97 4 40; #X obj 166 178 mtx; #X msg 473 99 9 180; #X msg 326 138 read designsN/N\$1_\$2.mtx; #X msg 374 75 1 4; #X msg 373 104 1.5 6; #X obj 380 51 loadbang; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 1 1 2 0; #X connect 2 0 3 0; #X connect 2 1 3 1; #X connect 3 0 4 0; #X connect 4 0 9 0; #X connect 5 0 8 0; #X connect 6 0 7 0; #X connect 6 0 14 0; #X connect 7 0 6 1; #X connect 8 0 6 0; #X connect 9 0 17 0; #X connect 10 0 5 1; #X connect 11 0 0 0; #X connect 12 0 23 0; #X connect 13 0 11 0; #X connect 15 0 0 1; #X connect 15 0 7 0; #X connect 15 0 21 1; #X connect 16 0 0 0; #X connect 17 0 10 0; #X connect 18 0 14 0; #X connect 20 0 18 1; #X connect 21 0 18 0; #X connect 22 0 20 1; #X connect 23 0 25 0; #X connect 23 1 24 1; #X connect 24 0 26 0; #X connect 25 0 24 0; #X connect 26 0 21 0; #X connect 26 1 28 0; #X connect 26 2 22 0; #X connect 27 0 30 0; #X connect 28 0 20 0; #X connect 29 0 30 0; #X connect 30 0 28 0; #X connect 31 0 30 0; #X connect 32 0 30 0; #X connect 33 0 31 0; #X restore -108 23 pd combine_objects; #X obj -95 -12 hsl 128 15 0 3 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 0 1; #X msg 48 69 1.5 6; #X floatatom 58 14 5 0 0 0 - - -; #X msg 20 46 0.573; #X obj 236 316 mtx_qhull; #X floatatom 302 333 5 0 0 0 - - -; #X obj 441 382 mtx_print; #X connect 1 0 2 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 5 0 14 0; #X connect 7 0 29 1; #X connect 8 0 29 2; #X connect 9 0 29 3; #X connect 10 0 31 0; #X connect 11 0 6 0; #X connect 12 0 29 0; #X connect 13 0 0 1; #X connect 14 0 12 0; #X connect 15 0 18 0; #X connect 16 0 9 0; #X connect 16 0 30 0; #X connect 17 0 16 1; #X connect 18 0 16 0; #X connect 19 0 6 0; #X connect 20 0 21 0; #X connect 21 0 0 0; #X connect 22 0 21 1; #X connect 23 0 25 0; #X connect 24 0 13 0; #X connect 25 0 10 0; #X connect 25 1 20 0; #X connect 25 2 22 0; #X connect 25 3 24 0; #X connect 26 0 22 0; #X connect 26 0 28 0; #X connect 27 0 20 0; #X connect 27 1 26 0; #X connect 28 0 23 0; #X connect 29 0 6 0; #X connect 30 0 17 0; #X connect 31 0 19 0; #X connect 31 1 6 0; #X connect 32 0 27 0; #X connect 33 0 39 0; #X connect 33 1 24 0; #X connect 34 0 37 0; #X connect 35 0 37 0; #X connect 36 0 37 0; #X connect 37 0 38 0; #X connect 38 0 50 0; #X connect 38 0 70 1; #X connect 39 0 75 0; #X connect 39 1 32 0; #X connect 40 0 41 0; #X connect 41 0 38 0; #X connect 41 1 39 1; #X connect 42 0 37 0; #X connect 43 0 37 0; #X connect 44 0 37 0; #X connect 45 0 46 0; #X connect 46 0 38 0; #X connect 46 1 75 0; #X connect 47 0 38 0; #X connect 48 0 37 0; #X connect 49 0 51 0; #X connect 50 0 10 0; #X connect 50 1 33 0; #X connect 50 2 49 0; #X connect 51 0 52 0; #X connect 52 0 53 0; #X connect 55 0 38 0; #X connect 57 0 60 0; #X connect 58 0 38 0; #X connect 59 0 58 1; #X connect 60 0 58 0; #X connect 60 1 59 0; #X connect 61 0 38 0; #X connect 62 0 57 0; #X connect 63 0 66 0; #X connect 64 0 65 0; #X connect 64 1 66 1; #X connect 65 0 63 0; #X connect 66 0 50 0; #X connect 67 0 14 0; #X connect 68 0 38 0; #X connect 69 0 70 0; #X connect 70 0 50 0; #X connect 71 0 70 2; #X connect 71 0 73 0; #X connect 72 0 37 0; #X connect 74 0 70 2; #X connect 75 0 27 0; #X connect 75 0 77 0; #X connect 75 1 76 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/vectors.c000066400000000000000000000166251514557770000256710ustar00rootroot00000000000000#include "vectors.h" /* * vector operations for zhull * * Copyright (c) 2012, Franz Zotter * IEM, Graz, Austria * * */ vector_t initVector (const float x, const float y, const float z) { vector_t vec= {.c = {x, y, z} }; return vec; } float lengthVector(const vector_t v) { return sqrtf(v.c[0]*v.c[0]+v.c[1]*v.c[1]+v.c[2]*v.c[2]); } vector_t normalizeVector(vector_t v) { float r=lengthVector(v); v.c[0]/=r; v.c[1]/=r; v.c[2]/=r; return v; } plane_t initPlane (vector_t normal, const vector_t point) { plane_t plane; plane.point = point; plane.normal = normalizeVector(normal); return plane; } line_t initLine (vector_t direction, const vector_t point) { line_t line; line.point = point; line.direction = normalizeVector(direction); return line; } points_t allocatePoints (const size_t num_points) { points_t points; points.v = (vector_t *) malloc(sizeof(vector_t)*num_points); if (points.v!=0) { points.num_points = num_points; } else { points.num_points = 0; } return points; } points_t initPoints (const float *x, const float *y, const float *z, const size_t num_points) { points_t points = allocatePoints(num_points); size_t i; for (i=0; iv); if (points!=0) { if (points->v!=0) { free(points->v); } points->v = 0; points->num_points = 0; } } void reallocatePoints (points_t *points, const size_t num_points) { if ((num_points>0)&&(points!=0)) { if (getNumPoints(*points)==0) { *points=allocatePoints(num_points); } else { points->v = (vector_t *) realloc(points->v,sizeof(vector_t)*num_points); if (points->v!=0) { points->num_points=num_points; } else { points->num_points=0; } } if (points->v!=0) { points->num_points = num_points; } } else { freePoints(points); } } void appendPoints(points_t *points, const float *x, const float *y, const float *z, const size_t num_points) { const size_t n=getNumPoints(*points); size_t i,j; reallocatePoints(points,getNumPoints(*points)+num_points); for (i=n,j=0; iv[i] = initVector(x[j],y[j],z[j]); } } vector_t crossProduct (const vector_t v1, const vector_t v2) { vector_t cp; cp.c[0]= v1.c[1]*v2.c[2]-v1.c[2]*v2.c[1]; cp.c[1]=-v1.c[0]*v2.c[2]+v1.c[2]*v2.c[0]; cp.c[2]= v1.c[0]*v2.c[1]-v1.c[1]*v2.c[0]; return cp; } float innerProduct (const vector_t v1, const vector_t v2) { return v1.c[0]*v2.c[0] + v1.c[1]*v2.c[1] + v1.c[2]*v2.c[2]; } float distancePointPoint(const vector_t a, const vector_t b) { vector_t d=subtractVectors(b,a); return lengthVector(d); } float distancePointPlane (const vector_t point, const plane_t plane) { return innerProduct(point, plane.normal) - innerProduct(plane.point, plane.normal); } float distancePointLine (const vector_t point, const line_t line) { return lengthVector(crossProduct(line.direction, subtractVectors(point,line.point))); } float distancePointLineOnPlane (vector_t const point, const line_t line, const plane_t plane) { vector_t normal_in_plane = normalizeVector(crossProduct( line.direction, plane.normal)); return innerProduct(subtractVectors(point,line.point),normal_in_plane); } vector_t addVectors(const vector_t v1, const vector_t v2) { vector_t v3; v3.c[0]=v1.c[0]+v2.c[0]; v3.c[1]=v1.c[1]+v2.c[1]; v3.c[2]=v1.c[2]+v2.c[2]; return v3; } vector_t subtractVectors(const vector_t v1, const vector_t v2) { vector_t v3; v3.c[0]=v1.c[0]-v2.c[0]; v3.c[1]=v1.c[1]-v2.c[1]; v3.c[2]=v1.c[2]-v2.c[2]; return v3; } vector_t scaleVector(vector_t v1, const float f) { vector_t v2; v2.c[0]=f*v1.c[0]; v2.c[1]=f*v1.c[1]; v2.c[2]=f*v1.c[2]; return v2; } /* vector_t averagePoints(points_t points) { vector_t m = initVector(0.0f, 0.0f, 0.0f); size_t i; for (i=0; i #include #include /* * vector operations for zhull * * Copyright (c) 2012, Franz Zotter * IEM, Graz, Austria * * */ typedef struct vec_ { float c[3]; } vector_t; typedef struct points_ { vector_t *v; size_t num_points; } points_t; typedef struct plane_ { vector_t normal; vector_t point; } plane_t; typedef struct line_ { vector_t direction; vector_t point; } line_t; vector_t initVector (const float x, const float y, const float z); float lengthVector(const vector_t v); vector_t normalizeVector(const vector_t v); plane_t initPlane (vector_t normal, const vector_t point); line_t initLine (vector_t direction, const vector_t point); points_t initPoints (const float *x, const float *y, const float *z, const size_t num_points); void freePoints (points_t *points); size_t getNumPoints(const points_t points); vector_t getPoint(const points_t points, const index_t index); vector_t crossProduct (const vector_t v1, const vector_t v2); float innerProduct (const vector_t v1, const vector_t v2); float distancePointPoint(const vector_t a, const vector_t b); float distancePointPlane (const vector_t point, const plane_t plane); float distancePointLine (const vector_t point, const line_t line); float distancePointLineOnPlane (const vector_t point, const line_t line, const plane_t plane); vector_t addVectors(const vector_t v1, const vector_t v2); vector_t subtractVectors(const vector_t v1, const vector_t v2); vector_t scaleVector(vector_t v1, const float f); /*vector_t averagePoints(points_t points); vector_t normalOfPoints(points_t points); plane_t planeFromPoints(points_t points);*/ plane_t planeFromThreePoints (const vector_t a, const vector_t b, const vector_t c); line_t lineFromTwoPoints (const vector_t a, const vector_t b); vector_t averageListedPoints(const points_t points, const list_t list); vector_t normalOfListedPoints(const points_t points, const list_t list); vector_t directionOfListedPoints(const points_t points, const list_t list); plane_t planeFromListedPoints(const points_t points, const list_t list); line_t lineFromListedPoints(const points_t points, const list_t list); void printPlane(const plane_t p); void printLine(const line_t l); void printVector(const vector_t v); #endif /* QHULL_VECTOR_H */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/zhull.c000066400000000000000000000614161514557770000253400ustar00rootroot00000000000000#include "zhull.h" /* * zhull * * own qhull algorithm implementation * * Copyright (c) 2012, Franz Zotter * with friendly help from * IOhannes zmoelnig * IEM, Graz, Austria * * own Implementation after the QHULL algorithm * that is documented in * Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., * "The Quickhull algorithm for convex hulls," ACM Trans. * on Mathematical Software, 22(4):469-483, Dec 1996, * http://www.qhull.org * */ /* facets, memory things */ static void freeFacet(facet_t *facet) { /* printf("deleting facet %li\n",facet); printList(facet->corners); printList(facet->outsideset); printList(facet->insideset); printList(facet->neighbors);*/ freeList(&(facet->corners)); freeList(&(facet->outsideset)); freeList(&(facet->insideset)); freeList(&(facet->neighbors)); } static list_t appendNewFacets(zhull_t * const zh, const size_t num_facets) { facet_t *new_facet; index_t i; entry_t e0=entry_makeIndex(0); list_t new_facets; new_facets=initConstantList(e0, num_facets); for (i=0; ineighbors=emptyList(); new_facet->corners=emptyList(); new_facet->outsideset=emptyList(); new_facet->insideset=emptyList(); new_facet->maxdistance=0; new_facet->farthest_outside_point=0; // printf("%li, %li\n", new_facet, entry_makePointer(new_facet)); setEntry(new_facets,i,entry_makePointer(new_facet)); // printf("created facet %li\n",new_facet); } appendListToList(&(zh->facets),new_facets); return new_facets; } /* facets, interface */ /*entry_t getFacetCornerByIndex(const facet_t *facet, index_t index_corner) { if (facet!=0) return getEntry(facet->corners, index_corner%getLength(facet->corners)); else return 0; } */ static facet_t *getFacetByIndex(const list_t facets, const index_t index) { entry_t e=getEntry(facets,index); return ((facet_t*)entry_getPointer(&e)); } index_t getTriangleCorner(const zhull_t * const zh, const index_t triangle_idx, const index_t corner_idx) { if (triangle_idxfacets)) { entry_t e=getEntry(getFacetByIndex(zh->facets,triangle_idx)->corners, corner_idx); return entry_getIndex(&e); } else { return 0; } } static facet_t *getFacetByPointer(const entry_t e) { return (facet_t*) entry_getPointer(&e); } static void getHorizonEdgeByIndex(index_t *corners, const list_t horizon_fcts, const list_t horizon_fcts_edges, const list_t other_horizon_edges, const index_t index) { index_t i=(index+getLength(horizon_fcts_edges)) %getLength(horizon_fcts_edges); entry_t e = getEntry(horizon_fcts_edges,i); facet_t *f = getFacetByIndex(horizon_fcts,i); index_t j= entry_getIndex(&e); if (f==0) { e=getEntry(horizon_fcts_edges,i); corners[0]=entry_getIndex(&e); e=getEntry(other_horizon_edges,i); corners[1]=entry_getIndex(&e); } else { e=getEntry(f->corners, j); corners[0]=entry_getIndex(&e); if (getLength(f->corners)>0) { e=getEntry(f->corners, (j+1) % getLength(f->corners)); corners[1]=entry_getIndex(&e); } else { corners[1]=corners[0]; } } } static void removeFacetByPointer(zhull_t * const zh, facet_t * const pointer) { removeValueFromList(&(zh->facets), entry_makePointer(pointer)); removeValueFromList(&(zh->facets_with_outsidepoints), entry_makePointer(pointer)); removeValueFromList(&(zh->facets_with_insidepoints), entry_makePointer(pointer)); freeFacet(pointer); } static void removeFacetByPointerList(zhull_t * const zh, const list_t pointers) { index_t i; for (i=0; ifacets, index)); } static void removeFacetByIndexList(zhull_t * const zh, const list_t indices) { facet_t *f; index_t i; for (i=0; ifacets, entry_getIndex(&e)); removeFacetByPointer(zh,f); } } static void freeFacets(zhull_t * const zh) { unsigned int i; facet_t *f; if (getLength(zh->facets)>0) { for (i=0; ifacets); i++) { f=getFacetByIndex(zh->facets,i); // printf("deleting facet %li\n",i); freeFacet(f); } freeList(&(zh->facets)); } } void freeZhull(zhull_t *zh) { if (zh!=0) { // printf("free zhull\n"); freeFacets(zh); freeList(&(zh->facets_with_insidepoints)); freeList(&(zh->facets_with_outsidepoints)); freeList(&(zh->used_pts)); freePoints(&(zh->pts)); } } // *********************************** // // interface static line_t getLine(const zhull_t * const zh, const facet_t * const f, const index_t corner) { vector_t a, b; entry_t e = getEntry(f->corners, (corner)%getLength(f->corners)); a=getPoint(zh->pts, entry_getIndex(&e)); e=getEntry(f->corners,(corner+1)%getLength(f->corners)); b=getPoint(zh->pts, entry_getIndex(&e)); return lineFromTwoPoints(a,b); } zhull_t zhullInitPoints(const float *x, const float *y, const float *z, const size_t num_points) { zhull_t zh; zh.pts=initPoints(x,y,z,num_points); zh.facets=emptyList(); zh.facets_with_outsidepoints=emptyList(); zh.facets_with_insidepoints=emptyList(); zh.used_pts=emptyList(); return zh; } static void dividePointsBetweenNewFacets ( zhull_t * const zh, const list_t assoc, const list_t new_facets) { index_t i,j; facet_t *f = 0; list_t point_inside_facet_list=emptyList(); float d = 0; entry_t e; for (i=0; ipts,idx), f->plane); if (d>=TOL_OUTSIDEPOINT) { break; } else if (d>=TOL_INSIDEPOINT) { appendToList(&point_inside_facet_list,entry_makePointer(f)); } } if (d>=TOL_OUTSIDEPOINT) { appendToList(&(f->outsideset), e); if (notInList(entry_makePointer(f),zh->facets_with_outsidepoints)) { appendToList(&(zh->facets_with_outsidepoints),entry_makePointer(f)); } if (f->maxdistancemaxdistance=d; f->farthest_outside_point=idx; } } else { if (getLength(point_inside_facet_list)>0) { for (j=0; jinsideset)) { appendToList(&(f->insideset),e); } } appendListToList(&(zh->facets_with_insidepoints),point_inside_facet_list); uniquefyListEntries(&(zh->facets_with_insidepoints)); } } } freeList(&point_inside_facet_list); } static void zhullInitialFacets(zhull_t *zh) { list_t assoc = emptyList(); list_t new_facets = emptyList(); index_t i; index_t idx[3]= {0,1,2}; list_t list=initListIndex(idx,3); if (getNumPoints(zh->pts)>= 3) { // printf("initListFromTo: %d..%d\n", 0,getNumPoints(zh->pts)-1); assoc = initListFromTo(0,getNumPoints(zh->pts)-1); // printList(assoc); new_facets = appendNewFacets(zh,2); if (getLength(new_facets)==2) { do { // circumvent coincident points if (distancePointPoint( getPoint(zh->pts,idx[0]), getPoint(zh->pts,idx[1]) )>TOL_DEGENERATE) { break; } else { idx[1]++; } } while (idx[1]pts)); if (idx[1]pts)) { do { // circumvent degenerate triangles list=initListIndex(idx,3); if (lengthVector(normalOfListedPoints(zh->pts,list))>TOL_DEGENERATE) { break; } else { idx[2]++; freeList(&list); } } while (idx[2]pts)); if (idx[2]pts)) { getFacetByIndex(new_facets,0)->corners = list; appendListToList(&(zh->used_pts),list); list=initListIndex(idx,3); reverseList(&list); getFacetByIndex(new_facets,1)->corners = list; getFacetByIndex(new_facets,0)->neighbors = initConstantList(entry_makePointer(getFacetByIndex(new_facets,1)),3); getFacetByIndex(new_facets,1)->neighbors = initConstantList(entry_makePointer(getFacetByIndex(new_facets,0)),3); for (i=0; i<2; i++) { getFacetByIndex(new_facets,i)->plane = planeFromListedPoints(zh->pts, getFacetByIndex(new_facets,i)->corners); getFacetByIndex(new_facets,i)->outsideset = emptyList(); getFacetByIndex(new_facets,i)->insideset = emptyList(); getFacetByIndex(new_facets,i)->maxdistance = 0.0f; //printf("removing facests\n"); //printList(getFacetByIndex(new_facets,i)->corners); removeValueListFromList(&assoc,getFacetByIndex(new_facets,i)->corners); } //printf("dividePoints..."); //printList(assoc); dividePointsBetweenNewFacets(zh, assoc, new_facets); } } } freeList(&new_facets); freeList(&assoc); } } static void printHorizonEdges(list_t *horizon_fcts, list_t *horizon_fcts_edges, list_t *other_horizon_edges) { index_t i; index_t c1[2]; printf("horizon : "); printList(*horizon_fcts); printList(*horizon_fcts_edges); printList(*other_horizon_edges); printf("\n horizon edges: "); for (i=0; i%lu",(unsigned long)c1[0],(unsigned long)c1[1]); } printf("\n"); } static void sortHorizonEdges(list_t *horizon_fcts, list_t *horizon_fcts_edges, list_t *other_horizon_edges) { index_t i,j; entry_t ei; index_t c1[2]; index_t c2[2]; if (getLength(*horizon_fcts_edges)==0) { return; } for (i=0; ipts,point_index),f->plane); // printf("distance %5.2f\n",d); appendToList(&fcts_to_visit,entry_makePointer(f)); if (d>=TOL_OUTSIDEPOINT) { while (getLength(fcts_to_visit)>0) { // visiting only visible facets // horizon: edges to invisible or coincident neighbors f=getFacetByIndex(fcts_to_visit,0); appendToList(&visible_fcts,entry_makePointer(f)); appendListToList(avail_points, f->outsideset); for (j=0; jneighbors); j++) { n=getFacetByIndex(f->neighbors,j); d=distancePointPlane(getPoint(zh->pts,point_index),n->plane); if (d>=TOL_OUTSIDEPOINT) { // visit visible neighbors appendToList(&fcts_to_visit,entry_makePointer(n)); } else { // horizon: coincident or invisible neighbors k=findValueInList(getEntry(f->corners,(j+1)%getLength(f->corners)), n->corners); appendToList(horizon_fcts,entry_makePointer(n)); appendToList(horizon_fcts_edges,entry_makeIndex(k)); appendToList(other_horizon_edges,entry_makeIndex(getNumPoints(zh->pts))); } } removeValueFromList(&fcts_to_visit,entry_makePointer(f)); appendToList(&fcts_visited,entry_makePointer(f)); removeValueListFromList(&fcts_to_visit,fcts_visited); } // printf("removing facets\n"); // list_for_printing=findValueListInList(visible_fcts,zh->facets); // printList(list_for_printing); // freeList(&list_for_printing); removeFacetByPointerList(zh,visible_fcts); freeList(&visible_fcts); freeList(&fcts_to_visit); freeList(&fcts_visited); sortHorizonEdges(horizon_fcts, horizon_fcts_edges, other_horizon_edges); //printHorizonEdges(horizon_fcts,horizon_fcts_edges,other_horizon_edges); } else if (d>=TOL_INSIDEPOINT) { // all coincident surfaces shall be removed // horizon might not be defined by facets while (getLength(fcts_to_visit)>0) { f=getFacetByIndex(fcts_to_visit,0); appendToList(&visible_fcts,entry_makePointer(f)); appendListToList(avail_points, f->outsideset); appendListToList(avail_points, f->insideset); for (j=0; jneighbors); j++) { n=getFacetByIndex(f->neighbors,j); d=distancePointPlane(getPoint(zh->pts,point_index),n->plane); if (d>=TOL_INSIDEPOINT) { // coincident facet if (notInList(entry_makePointer(n),visible_fcts)) { appendToList(&fcts_to_visit,entry_makePointer(n)); } if ((innerProduct(f->plane.normal,n->plane.normal)< -1.0f+TOL_DEGENERATE)&& (distancePointLineOnPlane(getPoint(zh->pts,point_index), getLine(zh,f,j), f->plane)corners,j)); appendToList(horizon_fcts_edges, getEntry(f->corners,(j+1)%getLength(f->corners))); } } else { // invisible facet forms horizon that persists k=findValueInList(getEntry(f->corners,(j+1)%getLength(f->corners)), n->corners); appendToList(horizon_fcts,entry_makePointer(n)); appendToList(horizon_fcts_edges,entry_makeIndex(k)); appendToList(other_horizon_edges,entry_makeIndex(getNumPoints(zh->pts))); } } removeValueFromList(&fcts_to_visit,entry_makePointer(f)); appendToList(&fcts_visited,entry_makePointer(f)); removeValueListFromList(&fcts_to_visit,fcts_visited); } // printf("removing facets\n"); // list_for_printing=findValueListInList(visible_fcts,zh->facets); // printList(list_for_printing); // freeList(&list_for_printing); removeFacetByPointerList(zh,visible_fcts); sortHorizonEdges(horizon_fcts, horizon_fcts_edges,other_horizon_edges); //printHorizonEdges(horizon_fcts,horizon_fcts_edges,other_horizon_edges); freeList(&visible_fcts); freeList(&fcts_to_visit); freeList(&fcts_visited); } } static void initNewFacets(zhull_t *zh, index_t point_index, list_t new_facets, list_t horizon_fcts, list_t horizon_fcts_edges, list_t other_horizon_edges) { index_t i,j; entry_t entry_array[3]; index_t array[3]; index_t temp; entry_t e; facet_t*f; //array[0]=entry_makeIndex(point_index); for (i=0; icorners=initListIndex(array,3); // neighbors // previous new neighbor j=(getLength(horizon_fcts)+i-1) % getLength(horizon_fcts); entry_array[1]=getEntry(new_facets,j); // next new neighbor j=(i+1) % getLength(horizon_fcts); entry_array[2]=getEntry(new_facets,j); // old neighbor e=getEntry(horizon_fcts,i); if (entry_getPointer(&e)!=0) { e=getEntry(horizon_fcts_edges,i); entry_array[0]=getEntry(horizon_fcts,i); setEntry(getFacetByIndex(horizon_fcts,i)->neighbors, entry_getIndex(&e), getEntry(new_facets,i)); } else { // registering at new neighbor where there // is no old one: degenerate 2D case for (j=0; jneighbors; setEntry(neighbors, 0, getEntry(new_facets,i)); } getFacetByIndex(new_facets,i)->neighbors= initList(entry_array,3); // removing inside points at (potential) horizon facet if point index is one if (getFacetByIndex(horizon_fcts,i)!=0) { removeValueFromList(&(getFacetByIndex(horizon_fcts,i)->insideset), entry_makeIndex(point_index)); if (getLength(getFacetByIndex(horizon_fcts,i)->insideset)==0) { removeValueFromList(&(zh->facets_with_insidepoints), entry_makePointer(getFacetByIndex(horizon_fcts,i))); } } // initializing normal vectors and lists getFacetByIndex(new_facets,i)->plane = planeFromListedPoints(zh->pts, getFacetByIndex(new_facets,i)->corners); // printf("new facet %d ",findValueInList(getEntry(new_facets,i),zh->facets)); // printFacet(zh, getFacetByIndex(new_facets,i)); } } static void makePyramidFacetsToHorizon(zhull_t *zh, index_t point_index, list_t horizon_fcts, list_t horizon_fcts_edges, list_t other_horizon_edges, list_t avail_points) { list_t new_facets = appendNewFacets(zh, getLength(horizon_fcts_edges)); // printf("making new pyramid of %d facets\n",getLength(horizon_fcts_edges)); initNewFacets(zh,point_index,new_facets,horizon_fcts,horizon_fcts_edges, other_horizon_edges); appendToList(&(zh->used_pts),entry_makeIndex(point_index)); /* printf("available points: "); printList(avail_points); printf("new facets : "); printList(new_facets);*/ dividePointsBetweenNewFacets(zh, avail_points, new_facets); freeList(&new_facets); } static void appendExteriorPoints(zhull_t *zh) { index_t i; vector_t center = initVector(0.0f,0.0f,0.0f); list_t facet_delete_list=emptyList(); facet_t *f; center=averageListedPoints(zh->pts,zh->used_pts); printf("central point\n"); printVector(center); printf("\n"); for (i=0; ifacets); i++) { f=getFacetByIndex(zh->facets,i); printf("distance of plane %lu, d=%5.2f\n",(unsigned long)i, distancePointPlane(center,f->plane)); if (distancePointPlane(center,f->plane)>-0.5f) { appendToList(&facet_delete_list,entry_makePointer(f)); } } printList(facet_delete_list); removeFacetByPointerList(zh,facet_delete_list); freeList(&facet_delete_list); } int calculateZHull(zhull_t *zh) { index_t fli=0; index_t pi; facet_t *f; int cnt=0; int maxit=getNumPoints(zh->pts); list_t horizon_fcts=emptyList(); list_t horizon_fcts_edges=emptyList(); list_t other_horizon_edges=emptyList(); list_t available_points=emptyList(); entry_t e; // if (maxit>MAXIT) // maxit=MAXIT; if (getNumPoints(zh->pts)!=0) { zhullInitialFacets(zh); //printZhull(zh); while(((getLength(zh->facets_with_insidepoints)>0) ||(getLength(zh->facets_with_outsidepoints)>0)) &&(cnt++facets_with_insidepoints)>0) { fli%=getLength(zh->facets_with_insidepoints); f=getFacetByIndex(zh->facets_with_insidepoints,fli); e=getEntry(f->insideset, 0); pi=entry_getIndex(&e); // printf("insidepoint\n"); // printList(zh->facets_with_insidepoints); } else { fli%=getLength(zh->facets_with_outsidepoints); f=getFacetByIndex(zh->facets_with_outsidepoints,fli); pi=f->farthest_outside_point; } // printf("point %d\n",pi); removeVisibleFacetsGetHorizonAndAvailablePoints(zh,pi,f, &horizon_fcts, &horizon_fcts_edges,&other_horizon_edges, &available_points); removeValueFromList(&available_points, entry_makeIndex(pi)); makePyramidFacetsToHorizon(zh,pi,horizon_fcts,horizon_fcts_edges, other_horizon_edges,available_points); // printZhull(zh); freeList(&horizon_fcts); freeList(&horizon_fcts_edges); freeList(&other_horizon_edges); freeList(&available_points); fli++; } // appendExteriorPoints(zh); } return cnt; } void printZhull(const zhull_t * const zh) { index_t fi; #if 0 list_t indices = emptyList(); printf("zhull from %d points\n", getNumPoints(zh->pts)); printf("facets with outsidepoints: "); indices=findValueListInList(zh->facets_with_outsidepoints,zh->facets); printList(indices); freeList(&indices); printf("facets with insidepoints: "); indices=findValueListInList(zh->facets_with_insidepoints,zh->facets); printList(indices); freeList(&indices); #endif printf("zhull has %lu facets\n", (unsigned long)getLength(zh->facets)); for (fi=0; fifacets); fi++) { printf("facet %lu<%p>: ",(unsigned long)fi,getFacetByIndex(zh->facets,fi)); printFacet(zh,getFacetByIndex(zh->facets,fi)); } } void printFacet(const zhull_t * const zh, const facet_t * const f) { list_t indices=emptyList(); indices=findValueListInList(f->neighbors,zh->facets); printf("plane: "); printPlane(f->plane); printf("\n"); printf("corners: "); printList(f->corners); printf("outsideset: "); printList(f->outsideset); printf("insideset: "); printList(f->insideset); printf("neighbors: "); printList(indices); freeList(&indices); printf("pt %lu with maxdist %5.2f\n", (unsigned long)(f->farthest_outside_point), f->maxdistance); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qhull/zhull.h000066400000000000000000000027741514557770000253470ustar00rootroot00000000000000#ifndef QHULL_ZHULL_H #define QHULL_ZHULL_H #include "vectors.h" #include "list.h" #include #include #include #define TOL_OUTSIDEPOINT 1e-7 #define TOL_INSIDEPOINT -1e-7 #define TOL_DEGENERATE 1e-6 #define MAXIT 1000000 /* * zhull * * own qhull algorithm implementation * * Copyright (c) 2012, Franz Zotter * with friendly help from * IOhannes zmoelnig * IEM, Graz, Austria * * own Implementation after the QHULL algorithm * that is documented in * Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., * "The Quickhull algorithm for convex hulls," ACM Trans. * on Mathematical Software, 22(4):469-483, Dec 1996, * http://www.qhull.org * */ typedef struct facet_ { plane_t plane; list_t corners; list_t outsideset; list_t insideset; size_t farthest_outside_point; list_t neighbors; float maxdistance; } facet_t; typedef struct zhull_ { points_t pts; list_t used_pts; list_t facets; list_t facets_with_outsidepoints; list_t facets_with_insidepoints; } zhull_t; int calculateZHull(zhull_t *zh); index_t getTriangleCorner(const zhull_t * const zh, const index_t triangle_idx, const index_t corner_idx); void printZhull(const zhull_t * const zh); void freeZhull(zhull_t *zh); zhull_t zhullInitPoints(const float *x, const float *y, const float *z, const size_t num_points); void printFacet(const zhull_t * const zh, const facet_t * const f); #endif /* QHULL_ZHULL_H */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_qr.c000066400000000000000000000120761514557770000234750ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * this functions depends on the GNU scientific library * * Copyright (c) 2009, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_stub.h" #include #ifdef HAVE_LIBGSL #include #else # include "stub/gsl.h" #endif IEMMATRIX_DECLARE_ALLOCFREE_STUB(my_vector); IEMMATRIX_DECLARE_ALLOCFREE2_STUB(my_matrix); typedef int(*t_linalg_QR_decomp)(gsl_matrix*, gsl_vector*); typedef int(*t_linalg_QR_unpack)(gsl_matrix*, gsl_vector*, gsl_matrix*, gsl_matrix*); static t_linalg_QR_decomp my_linalg_QR_decomp = 0; static t_linalg_QR_unpack my_linalg_QR_unpack = 0; static int have_gsl = 0; static t_class *mtx_qr_class; typedef struct _MTXQr_ MTXQr; struct _MTXQr_ { t_object x_obj; gsl_matrix *a; gsl_vector *tau; gsl_matrix *q; gsl_matrix *r; t_outlet *list_q_out; t_outlet *list_r_out; t_atom *list_q; t_atom *list_r; int rows; int columns; }; static void allocMTXqr (MTXQr *x) { x->a=(gsl_matrix*)my_matrix_alloc(x->rows,x->columns); x->tau=(gsl_vector*)my_vector_alloc( ((x->columnsrows)?x->columns:x->rows)); x->q=(gsl_matrix*)my_matrix_alloc(x->rows,x->rows); x->r=(gsl_matrix*)my_matrix_alloc(x->rows,x->columns); x->list_q=(t_atom*)calloc(x->rows*x->rows+2, sizeof(t_atom)); x->list_r=(t_atom*)calloc(x->rows*x->columns+2, sizeof(t_atom)); } static void deleteMTXqr (MTXQr *x) { if (x->list_q!=0) { free(x->list_q); } if (x->list_r!=0) { free(x->list_r); } x->list_q = x->list_r = 0; if(have_gsl) { if (x->a!=0) { my_matrix_free(x->a); } if (x->tau!=0) { my_vector_free(x->tau); } if (x->q!=0) { my_matrix_free(x->q); } if (x->r!=0) { my_matrix_free(x->r); } } x->list_q = 0; x->list_r = 0; x->a = 0; x->tau = 0; x->q = 0; x->r = 0; } static void deleteMTXQr (MTXQr *x) { deleteMTXqr(x); } static void *newMTXQr (t_symbol *s, int argc, t_atom *argv) { MTXQr *x = (MTXQr *) pd_new (mtx_qr_class); x->list_q_out = outlet_new (&x->x_obj, gensym("matrix")); x->list_r_out = outlet_new (&x->x_obj, gensym("matrix")); (void)argc; (void)argv; /* unused */ if (!have_gsl) { static int warn_gsl = 1; if(warn_gsl) #ifdef HAVE_LIBGSL pd_error(x, "[%s] couldn't find (recent enough) GSL", s->s_name); #else pd_error(x, "[%s] compiled without GSL", s->s_name); #endif warn_gsl = 0; } return ((void *) x); } static void mTXQrBang (MTXQr *x) { if (x->list_q) { outlet_anything(x->list_r_out, gensym("matrix"), x->rows*x->columns+2, x->list_r); outlet_anything(x->list_q_out, gensym("matrix"), x->rows*x->rows+2, x->list_q); } } static void mTXQrMatrix (MTXQr *x, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; int m,n; if(!have_gsl) return; if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); size = rows * columns; x->rows=rows; x->columns=columns; deleteMTXqr(x); allocMTXqr(x); for (n=0; na->data[n]=(double) atom_getfloat(argv++); } my_linalg_QR_decomp(x->a,x->tau); my_linalg_QR_unpack(x->a,x->tau, x->q, x->r); SETFLOAT((x->list_q),(float) x->rows); SETFLOAT((x->list_q+1),(float) x->rows); for (n=0,size=0; nrows; n++) { for (m=0; mrows; m++) { SETFLOAT((x->list_q+2+size), x->q->data[size]); size++; } } SETFLOAT((x->list_r),(float) x->rows); SETFLOAT((x->list_r+1),(float) x->columns); for (n=0,size=0; nrows; n++) { for (m=0; mcolumns; m++) { SETFLOAT((x->list_r+2+size), x->r->data[size]); size++; } } mTXQrBang(x); } void mtx_qr_setup (void) { mtx_qr_class = class_new (gensym("mtx_qr"), (t_newmethod) newMTXQr, (t_method) deleteMTXQr, sizeof (MTXQr), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_qr_class, (t_method) mTXQrBang); class_addmethod (mtx_qr_class, (t_method) mTXQrMatrix, gensym("matrix"), A_GIMME,0); #ifdef HAVE_LIBGSL my_matrix_alloc = iemmatrix_get_stub("gsl_matrix_alloc", mtx_qr_class); my_matrix_free = iemmatrix_get_stub("gsl_matrix_free", mtx_qr_class); my_vector_alloc = iemmatrix_get_stub("gsl_vector_complex_alloc", mtx_qr_class); my_vector_free = iemmatrix_get_stub("gsl_vector_complex_free", mtx_qr_class); my_linalg_QR_decomp = iemmatrix_get_stub("gsl_linalg_QR_decomp", mtx_qr_class); my_linalg_QR_unpack = iemmatrix_get_stub("gsl_linalg_QR_unpack", mtx_qr_class); #endif have_gsl = ( my_matrix_alloc && my_matrix_free && my_vector_alloc && my_vector_free && my_linalg_QR_decomp && my_linalg_QR_unpack ); } void iemtx_qr_setup(void) { mtx_qr_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_rand.c000066400000000000000000000054641514557770000240020ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_rand */ static t_class *mtx_rand_class; static void mtx_rand_seed(t_matrixobj *x, t_float f) { x->current_row=f; } static int makeseed(void) { static unsigned int random_nextseed = 1489853723; random_nextseed = random_nextseed * 435898247 + 938284287; return (random_nextseed & 0x7fffffff); } static inline t_float getrand(int *val) { t_float f=(((t_float)(((*val=*val*435898247+382842987)&0x7fffffff) -0x40000000))*(t_float)(0.5/0x40000000)+0.5); return f; } static void mtx_rand_random(t_matrixobj *x) { long size = x->m.row * x->m.col; t_atom *ap=x->m.atombuffer+2; while(size--) { SETFLOAT(ap+size, getrand(&x->current_row)); } } static void mtx_rand_list(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row, col; (void)s; /* unused */ switch(argc) { case 0: return; case 1: row = col = atom_getfloat(argv); break; default: row = atom_getfloat(argv+0); col = atom_getfloat(argv+1); } adjustsize(x, &x->m, row, col); mtx_rand_random(x); matrixobj_bang(x); } static void mtx_rand_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; matrix_matrix2(x, &x->m, argc, argv); mtx_rand_random(x); matrixobj_bang(x); } static void mtx_rand_bang(t_matrixobj *x) { if(0==x->m.col || 0==x->m.row) { outlet_float(x->x_obj.ob_outlet, getrand(&x->current_row)); } else { mtx_rand_random(x); matrixobj_bang(x); } } static void *mtx_rand_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_rand_class); int row, col; (void)s; /* unused */ outlet_new(&x->x_obj, 0); x->m.col=x->m.row=0; x->m.atombuffer=0; x->current_row=makeseed(); if (argc) { row=atom_getfloat(argv); col=(argc>1)?atom_getfloat(argv+1):row; adjustsize(x, &x->m, row, col); mtx_rand_random(x); } return (x); } void mtx_rand_setup(void) { mtx_rand_class = class_new(gensym("mtx_rand"), (t_newmethod)mtx_rand_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addmethod(mtx_rand_class, (t_method)mtx_rand_matrix, gensym("matrix"), A_GIMME, 0); class_addlist (mtx_rand_class, mtx_rand_list); class_addbang (mtx_rand_class, mtx_rand_bang); class_addmethod(mtx_rand_class, (t_method)mtx_rand_seed, gensym("seed"), A_FLOAT, 0); } void iemtx_rand_setup(void) { mtx_rand_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_repmat.c000066400000000000000000000111301514557770000243310ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_repmat_class; typedef struct _MTXrepmat_ MTXrepmat; struct _MTXrepmat_ { t_object x_obj; int size; int repeat_rows; int repeat_cols; t_outlet *list_outlet; t_atom *list_out; }; static void deleteMTXRepmat (MTXrepmat *mtx_repmat_obj) { if (mtx_repmat_obj->list_out) { freebytes (mtx_repmat_obj->list_out, sizeof(t_atom)*(mtx_repmat_obj->size+2)); } } static void mTXRepmatList (MTXrepmat *mtx_repmat_obj, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ if (argc!=2) { pd_error(mtx_repmat_obj, "[mtx_repmat]: there have to be exactly 2 arguments"); return; } mtx_repmat_obj->repeat_rows = atom_getint(argv++); mtx_repmat_obj->repeat_cols = atom_getint(argv); } static void *newMTXRepmat (t_symbol *s, int argc, t_atom *argv) { MTXrepmat *mtx_repmat_obj = (MTXrepmat *) pd_new (mtx_repmat_class); (void)s; /* unused */ mtx_repmat_obj->repeat_cols = 1; mtx_repmat_obj->repeat_rows = 1; if (argc) { mTXRepmatList (mtx_repmat_obj, gensym("list"), argc, argv); } mtx_repmat_obj->list_outlet = outlet_new (&mtx_repmat_obj->x_obj, gensym("matrix")); inlet_new(&mtx_repmat_obj->x_obj, &mtx_repmat_obj->x_obj.ob_pd, gensym("list"),gensym("")); return ((void *) mtx_repmat_obj); } static void mTXRepmatBang (MTXrepmat *mtx_repmat_obj) { if (mtx_repmat_obj->list_out) outlet_anything(mtx_repmat_obj->list_outlet, gensym("matrix"), mtx_repmat_obj->size+2, mtx_repmat_obj->list_out); } static void copyList (int n, t_atom *x, t_atom *y) { while (n--) { *y++=*x++; } } static void writeRepeatIntoMatrix (int repeat_rows, int repeat_cols, int rows, int columns, t_atom *x, t_atom *y) { int row_cnt; int col_cnt; int new_col = columns * repeat_cols; t_atom *ptr = y; /* writing each row repeatedly (repeat_col times) into output array */ /* so that : row1#1 row1#2 ... row1#RN | ... | rowN#1 rowN#2 ... rowN#RN */ for (row_cnt=rows; row_cnt--; x+=columns) for(col_cnt=repeat_cols; col_cnt--; ptr+=columns) { copyList (columns, x, ptr); } /* repeating the above written long lines repeat row_repeat times in output array */ for (; --repeat_rows;) for (row_cnt=rows; row_cnt--; y+=new_col,ptr+=new_col) { copyList (new_col, y, ptr); } } static void mTXRepmatMatrix (MTXrepmat *mtx_repmat_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); int rep_rows = mtx_repmat_obj->repeat_rows; int rep_cols = mtx_repmat_obj->repeat_cols; int mrows = rows * rep_rows; int mcolumns = columns * rep_cols; int size = rows * columns; t_atom *list_in = argv+2; t_atom *list_out = mtx_repmat_obj->list_out; /* size check */ if(iemmatrix_check(mtx_repmat_obj, s, argc, argv, 0))return; mrows = rows * rep_rows; mcolumns = columns * rep_cols; size = mrows * mcolumns; if (size != mtx_repmat_obj->size) { if (list_out) list_out = (t_atom*) resizebytes (list_out, sizeof(t_atom)*(mtx_repmat_obj->size+2), sizeof(t_atom)*(size+2)); else { list_out = (t_atom*) getbytes (sizeof(t_atom)*(size+2)); } mtx_repmat_obj->list_out = list_out; mtx_repmat_obj->size = size; } /* main part */ writeRepeatIntoMatrix (rep_rows, rep_cols, rows, columns, list_in, list_out+2); SETFLOAT(list_out, mrows); SETFLOAT(&list_out[1], mcolumns); mTXRepmatBang (mtx_repmat_obj); } void mtx_repmat_setup (void) { mtx_repmat_class = class_new (gensym("mtx_repmat"), (t_newmethod) newMTXRepmat, (t_method) deleteMTXRepmat, sizeof (MTXrepmat), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_repmat_class, (t_method) mTXRepmatBang); class_addmethod (mtx_repmat_class, (t_method) mTXRepmatMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_repmat_class, (t_method) mTXRepmatList, gensym(""), A_GIMME,0); } void iemtx_repmat_setup(void) { mtx_repmat_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_resize.c000066400000000000000000000055021514557770000243500ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_resize */ static t_class *mtx_resize_class; static void mtx_resize_list2(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int r, c; (void)s; /* unused */ if (argc<1) { return; } if (argc>2) { pd_error(x, "mtx_resize : only rows & cols are needed, skipping the rest"); } if (argc==1) { r=c=atom_getfloat(argv++); } else { r=atom_getfloat(argv++); c=atom_getfloat(argv++); } if (r<0) { r=0; } if (c<0) { c=0; } x->current_row = r; x->current_col = c; } static void mtx_resize_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); int r = x->current_row, c = x->current_col; int R=0, ROW, COL; if(iemmatrix_check(x, s, argc, argv, 0))return; if (!r) { r=row; } if (!c) { c=col; } if (r==row && c==col) { /* no need to change */ outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, argv); return; } x->m.atombuffer=(t_atom *)getbytes((c*r+2)*sizeof(t_atom)); setdimen(&x->m, r, c); matrix_set(&x->m, 0); ROW=(rm.atombuffer+2+(ROW-R-1)*c, argv+2+(ROW-R-1)*col, COL*sizeof(t_atom)); } matrixobj_bang(x); freebytes(x->m.atombuffer, (c*r+2)*sizeof(t_atom)); } static void *mtx_resize_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_resize_class); int c=0, r=0; (void)s; /* unused */ if(argc) { if(argc-1) { r=atom_getfloat(argv); c=atom_getfloat(argv+1); } else { r=c=atom_getfloat(argv); } if(c<0) { c=0; } if(r<0) { r=0; } } inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); outlet_new(&x->x_obj, 0); x->current_row = r; x->current_col = c; x->m.row = x->m.col= 0; x->m.atombuffer = 0; return (x); } void mtx_resize_setup(void) { mtx_resize_class = class_new(gensym("mtx_resize"), (t_newmethod)mtx_resize_new, 0, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addmethod (mtx_resize_class, (t_method)mtx_resize_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod (mtx_resize_class, (t_method)mtx_resize_list2, gensym(""), A_GIMME, 0); } void iemtx_resize_setup(void) { mtx_resize_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_reverse.c000066400000000000000000000116611514557770000245250ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * Copyright (c) 2006, IOhannes m zmölnig * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_reverse_class; typedef struct _MTXreverse_ MTXreverse; struct _MTXreverse_ { t_object x_obj; int size; int reverse_mode; /* 0=col; 1=row */ t_outlet *list_outlet; t_atom *list_out; t_atom *list_in; }; static void deleteMTXreverse (MTXreverse *mtx_reverse_obj) { if (mtx_reverse_obj->list_out) { freebytes (mtx_reverse_obj->list_out, sizeof(t_atom)*(mtx_reverse_obj->size+2)); } } static void mTXSetReverseMode (MTXreverse *mtx_reverse_obj, t_symbol *c_mode) { char c=*c_mode->s_name; switch(c) { case 'c': case 'C': case ':': /* "column" */ mtx_reverse_obj->reverse_mode = 1; break; case 'r': case 'R': /* "row" */ mtx_reverse_obj->reverse_mode = 0; break; case 'e': case 'E': case '.': /* "element" just revert the whole matrix as if it was a list */ mtx_reverse_obj->reverse_mode = -1; break; default: pd_error(mtx_reverse_obj, "mtx_reverse: invalid mode '%s'", c_mode->s_name); break; } } static void *newMTXreverse (t_symbol *s, int argc, t_atom *argv) { MTXreverse *mtx_reverse_obj = (MTXreverse *) pd_new (mtx_reverse_class); (void)s; /* unused */ if(argc&&(A_SYMBOL==argv->a_type)) { mTXSetReverseMode (mtx_reverse_obj, atom_getsymbol (argv)); } else { mTXSetReverseMode (mtx_reverse_obj, gensym(":")); } mtx_reverse_obj->list_outlet = outlet_new (&mtx_reverse_obj->x_obj, gensym("matrix")); return ((void *) mtx_reverse_obj); } static void mTXreverseBang (MTXreverse *mtx_reverse_obj) { if (mtx_reverse_obj->list_out) outlet_anything(mtx_reverse_obj->list_outlet, gensym("matrix"), mtx_reverse_obj->size+2, mtx_reverse_obj->list_out); } static void copyList (int n, t_atom *x, t_atom *y) { for (; n--;) { *y++ = *x++; } } static void reverseList (int n, t_atom *y) { t_atom *read = y+n-1; t_atom tmp; n >>= 1; while(n-->0) { tmp = *y; *y++ = *read; *read-- = tmp; } } static void reverseListStep (int n, int step, t_atom *y) { t_atom *read = y; t_atom tmp; n /= step; y += (n-1) * step; n >>= 1; for (; n--; y-=step, read+=step) { tmp = *y; *y = *read; *read = tmp; } } static void mTXreverseMatrix (MTXreverse *mtx_reverse_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv++); int columns = atom_getint (argv++); int size = rows * columns; int list_size = argc - 2; t_atom *list_out = mtx_reverse_obj->list_out; int count; (void)s; /* unused */ /* size check */ if (!size) { pd_error(mtx_reverse_obj, "mtx_reverse: invalid dimensions"); return; } else if (list_sizesize) { if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (size + 2)); } else list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_reverse_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_reverse_obj->size = size; mtx_reverse_obj->list_out = list_out; /* main part */ list_out += 2; copyList (size, argv, list_out); switch(mtx_reverse_obj->reverse_mode) { case 0: for (count = columns; count--; list_out++) { reverseListStep (size, columns, list_out); } break; case 1: for (count = rows; count--; list_out += columns) { reverseList (columns, list_out); } break; default: reverseList (size, list_out); } list_out = mtx_reverse_obj->list_out; SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, rows); SETFLOAT(&list_out[1], columns); outlet_anything(mtx_reverse_obj->list_outlet, gensym("matrix"), mtx_reverse_obj->size+2, list_out); } void mtx_reverse_setup (void) { mtx_reverse_class = class_new (gensym("mtx_reverse"), (t_newmethod) newMTXreverse, (t_method) deleteMTXreverse, sizeof (MTXreverse), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_reverse_class, (t_method) mTXreverseBang); class_addmethod (mtx_reverse_class, (t_method) mTXreverseMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_reverse_class, (t_method) mTXSetReverseMode, gensym("mode"), A_DEFSYMBOL,0); } void iemtx_reverse_setup(void) { mtx_reverse_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_rfft.c000066400000000000000000000110031514557770000240010ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_stub.h" #include "iemmatrix_fft.h" #include static t_class *mtx_rfft_class; typedef struct _MTXRfft_ MTXRfft; struct _MTXRfft_ { t_object x_obj; int columns, rows; t_iemfft_plan plan; t_float *f_in; t_complex *c_out; t_outlet *list_re_out; t_outlet *list_im_out; t_atom *list_re; t_atom *list_im; int list_size; }; static void deleteMTXRfft (MTXRfft *x) { if(x->plan) { iemfft_destroy_plan(x->plan); } if (x->f_in) free(x->f_in); if (x->c_out) free(x->c_out); if (x->list_re)free(x->list_re); if (x->list_im)free(x->list_im); } static void *newMTXRfft (t_symbol *s, int argc, t_atom *argv) { MTXRfft *x = (MTXRfft *) pd_new (mtx_rfft_class); (void)s; (void)argc; (void)argv; /* unused */ x->list_re_out = outlet_new (&x->x_obj, gensym("matrix")); x->list_im_out = outlet_new (&x->x_obj, gensym("matrix")); return ((void *) x); } static void mTXRfftBang (MTXRfft *x) { if (x->list_im) { outlet_anything(x->list_im_out, gensym("matrix"), x->list_size, x->list_im); outlet_anything(x->list_re_out, gensym("matrix"), x->list_size, x->list_re); } } static void complex2list (int n, t_complex*c, t_atom*re, t_atom*im) { while (n--) { SETFLOAT (re, c->re); SETFLOAT (im, c->im); c++; re++; im++; } } static void mTXRfftMatrix (MTXRfft *x, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv++); int columns = atom_getint (argv++); int columns_re = (columns>>1) +1; /* N/2+1 samples needed for real part of realfft */ int size = rows * columns; int in_size = argc-2; int list_size = columns_re * rows + 2; /* +2 since the list also contains matrix row+col */ t_float *f_in = x->f_in; t_complex *c_out = x->c_out; t_atom *list_re = x->list_re; t_atom *list_im = x->list_im; (void)s; /* unused */ /* fftsize check */ if (!size) { pd_error(x, "[mtx_rfft]: invalid dimensions"); return; } else if (in_sizerows != rows)||(x->columns != columns)) { /* size changed, so re-allocate */ x->f_in = f_in = (t_float* )realloc(f_in , sizeof(*f_in ) * columns); x->c_out= c_out = (t_complex*)realloc(c_out, sizeof(*c_out) * columns_re); if(x->plan) iemfft_destroy_plan(x->plan); x->rows = rows; x->columns = columns; x->plan = iemfft_plan_rfft_1d(columns, f_in, c_out, PREFER_DOUBLE); } list_re=(t_atom*)realloc(list_re, sizeof(t_atom)*list_size); list_im=(t_atom*)realloc(list_im, sizeof(t_atom)*list_size); x->list_size = list_size; x->list_im = list_im; x->list_re = list_re; for(int r=0; rplan); complex2list(columns_re, c_out, list_re + offset + 2, list_im + offset + 2); } SETSYMBOL(list_re, gensym("matrix")); SETSYMBOL(list_im, gensym("matrix")); SETFLOAT(list_re, rows); SETFLOAT(list_im, rows); SETFLOAT(list_re+1, columns_re); SETFLOAT(list_im+1, columns_re); outlet_anything(x->list_im_out, gensym("matrix"), x->list_size, list_im); outlet_anything(x->list_re_out, gensym("matrix"), x->list_size, list_re); } void mtx_rfft_setup (void) { mtx_rfft_class = class_new (gensym("mtx_rfft"), (t_newmethod) newMTXRfft, (t_method) deleteMTXRfft, sizeof (MTXRfft), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_rfft_class, (t_method) mTXRfftBang); class_addmethod (mtx_rfft_class, (t_method) mTXRfftMatrix, gensym("matrix"), A_GIMME,0); iemfft_init(mtx_rfft_class); } void iemtx_rfft_setup(void) { mtx_rfft_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_rifft.c000066400000000000000000000130241514557770000241570ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_stub.h" #include "iemmatrix_fft.h" #include static t_class *mtx_rifft_class; typedef struct _MTXRifft_ { t_object x_obj; t_outlet *list_re_out; int columns, rows; int size; // ??? t_iemfft_plan*plan; t_complex *c_in; t_float *f_out; int list_size; t_atom *list_re; } MTXRifft; /*--------------inverse real fft */ static void multiplyVector (int n, t_float *f, t_float fac) { while (n--) { *f++ *= fac; } } static void list2real(int n, t_atom*re, t_complex*c) { while (n--) { c->re = atom_getfloat(re++); c++; } } static void list2imag(int n, t_atom*im, t_complex*c) { while (n--) { c->im = atom_getfloat(im++); c++; } } static void *newMTXRifft () { MTXRifft *x = (MTXRifft *) pd_new (mtx_rifft_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("matrix"),gensym("")); x->list_re_out = outlet_new (&x->x_obj, gensym("matrix")); return ((void *) x); } static void mTXRifftMatrixCold (MTXRifft *x, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv++); int columns_re = atom_getint (argv++); int in_size = argc-2; int columns = (columns_re-1)<<1; int list_size = columns_re * rows; int size = rows * columns; t_atom *list_re = x->list_re; (void)s; /* unused */ /* ifftsize check */ if (columns_re < 3) { pd_error(x, "[mtx_rifft]: matrix must have at least 3 columns"); return; } else if (!size) { pd_error(x, "[mtx_rifft]: invalid dimensions"); return; } else if (in_size < list_size) { pd_error(x, "[mtx_rifft]: sparse matrix not yet supported: use [mtx_check]"); return; } else if (columns<4) { pd_error(x, "[mtx_rifft]: too small matrices"); return; } else if (columns == (1 << ilog2(columns))) { /* OK */ } else { pd_error(x, "[mtx_rifft]: rowvector 2*(size+1) no power of 2!"); return; } /* memory things */ if ((x->rows!=rows)||(columns!=x->columns)) { /* size changed, so re-allocate */ t_complex* c_in = x->c_in = (t_complex*)realloc(x->c_in ,sizeof(*x->c_in )*list_size); t_float* f_out = x->f_out = (t_float* )realloc(x->f_out,sizeof(*x->f_out)*size); for (int r=0; rrows; r++) { iemfft_destroy_plan(x->plan[r]); } x->rows = rows; x->columns = columns; x->plan=(t_iemfft_plan*)realloc(x->plan,sizeof(*x->plan)*x->rows); for (int r=0; rrows; r++) { x->plan[r] = iemfft_plan_rifft_1d(columns, c_in + r * columns_re, f_out + r * columns, PREFER_DOUBLE); } x->list_re = list_re =(t_atom*)realloc(list_re, sizeof(*list_re)*(size+2)); } x->list_size = list_size; x->rows = rows; x->columns = columns; /* main part: reading imaginary part */ t_complex*c_in = x->c_in; for (int r=0; rcolumns; int size = x->rows * x->columns; int in_size = argc-2; int list_size = x->list_size; t_complex *c_in = x->c_in; t_float renorm_fac = 1. / (t_float)columns; (void)s; /* unused */ /* ifftsize check */ if ((rows != x->rows) || (columns != ((columns_re-1)<<1))) { pd_error(x, "[mtx_rifft]: matrix dimensions do not match: expected %dx%d, got %dx%d[%d]", x->rows, x->columns, rows, ((columns_re-1)<<1), columns_re); return; } else if (in_sizelist_size) { pd_error(x, "[mtx_rifft]: invalid right side matrix"); return; } /* main part */ for (int r=0; rplan[r]); c_in+=columns_re; argv += columns_re; } multiplyVector(size, x->f_out, renorm_fac); iemmatrix_floats2list(x->list_re + 2, x->f_out, size); SETFLOAT(x->list_re, rows); SETFLOAT(x->list_re+1, x->columns); outlet_anything(x->list_re_out, gensym("matrix"), size+2, x->list_re); x->size = size; } static void mTXRifftBang (MTXRifft *x) { if (x->list_re) outlet_anything(x->list_re_out, gensym("matrix"), x->size+2, x->list_re); } static void deleteMTXRifft (MTXRifft *x) { if (x->plan) { int n; for (n=0; nrows; n++) { iemfft_destroy_plan(x->plan[n]); } free(x->plan); } free(x->c_in); free(x->f_out); free(x->list_re); } void mtx_rifft_setup (void) { mtx_rifft_class = class_new (gensym("mtx_rifft"), (t_newmethod) newMTXRifft, (t_method) deleteMTXRifft, sizeof (MTXRifft), CLASS_DEFAULT, 0); class_addbang (mtx_rifft_class, (t_method) mTXRifftBang); class_addmethod (mtx_rifft_class, (t_method) mTXRifftMatrixHot, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_rifft_class, (t_method) mTXRifftMatrixCold, gensym(""), A_GIMME,0); iemfft_init(mtx_rifft_class); } void iemtx_rifft_setup(void) { mtx_rifft_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_rmstodb.c000066400000000000000000000011201514557770000245110ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_rmstodb: B=rmstodb(A); B[n,m]=rmstodb(A[n,m]) */ void mtx_rmstodb_setup(void) { iemmatrix_unop_setup("mtx_rmstodb", 0, rmstodb, (char*)0); } void iemtx_rmstodb_setup(void) { mtx_rmstodb_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_roll.c000066400000000000000000000032351514557770000240200ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_roll */ /* roll the rows */ static t_class *mtx_roll_class; static void mtx_roll_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv) { int row, col, colroll; t_atom *ap; int c; if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getint(argv++); col=atom_getint(argv++); colroll = ((int)x->f%col+col)%col; adjustsize(x, &x->m, row, col); ap = x->m.atombuffer+2; c=col; while(c--) { t_atom *in = argv+col-c-1; t_atom *out = ap +(col-c-1+colroll)%col; int r = row; while (r--) { SETFLOAT(out, atom_getfloat(in)); out+=col; in+=col; } } matrixobj_bang((t_matrixobj*)x); } static void *mtx_roll_new(t_floatarg f) { t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_roll_class); floatinlet_new(&x->x_obj, &(x->f)); outlet_new(&x->x_obj, 0); x->f=f; return (x); } void mtx_roll_setup(void) { mtx_roll_class = class_new(gensym("mtx_roll"), (t_newmethod)mtx_roll_new, (t_method)matrixobj_free, sizeof(t_mtx_binscalar), 0, A_DEFFLOAT, 0); class_addbang (mtx_roll_class, matrixobj_bang); class_addmethod(mtx_roll_class, (t_method)mtx_roll_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_roll_setup(void) { mtx_roll_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_row.c000066400000000000000000000065201514557770000236570ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_row */ static t_class *mtx_row_class; static void mtx_row_float(t_matrixobj *x, t_floatarg f) { int i = f; if(i<0) { i=0; } x->current_row = i; } static void mtx_row_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { if(iemmatrix_check(x, s, argc, argv, 0))return; matrix_matrix2(x, &x->m, argc, argv); matrixobj_bang(x); } static void mtx_row_list(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ if (argc==1) { t_float f=atom_getfloat(argv); t_atom *ap=x->m.atombuffer+2+(x->current_row-1)*x->m.col; if (x->current_row>x->m.row) { pd_error(x, "[mtx_row]: too high a row is to be set"); return; } if (x->current_row) { int n=x->m.col; while(n--) { SETFLOAT(ap, f); ap++; } } matrixobj_bang(x); return; } if (argcm.col) { pd_error(x, "[mtx_row]: row length is too small for %dx%d-matrix", x->m.row, x->m.col); return; } if (x->current_row>x->m.row) { pd_error(x, "[mtx_row]: too high a row is to be set"); return; } if(x->current_row) { memcpy(x->m.atombuffer+2+(x->current_row-1)*x->m.col, argv, x->m.col*sizeof(t_atom)); } else { int r=x->m.row; while(r--) { memcpy(x->m.atombuffer+2+r*x->m.col, argv, x->m.col*sizeof(t_atom)); } } matrixobj_bang(x); } static void *mtx_row_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_row_class); int i, j, q; (void)s; /* unused */ outlet_new(&x->x_obj, 0); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); x->current_row=0; x->m.col=x->m.row=0; x->m.atombuffer=0; switch (argc) { case 0: break; case 1: i = atom_getfloat(argv); if (i<0) { i=0; } if(i) { adjustsize(x, &x->m, i, i); } matrix_set(&x->m, 0); break; case 2: i = atom_getfloat(argv++); if(i<0) { i=0; } j = atom_getfloat(argv++); if(j<0) { j=0; } if(i && j) { adjustsize(x, &x->m, i, j); } matrix_set(&x->m, 0); break; default: i = atom_getfloat(argv++); if(i<0) { i=0; } j = atom_getfloat(argv++); if(j<0) { j=0; } q = atom_getfloat(argv++); if(q<0) { q=0; } if(i && j) { adjustsize(x, &x->m, i, j); } matrix_set(&x->m, 0); x->current_row=q; } return (x); } void mtx_row_setup(void) { mtx_row_class = class_new(gensym("mtx_row"), (t_newmethod)mtx_row_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addbang (mtx_row_class, matrixobj_bang); class_addlist (mtx_row_class, mtx_row_list); class_addmethod(mtx_row_class, (t_method)mtx_row_matrix, gensym("matrix"), A_GIMME, 0); class_addmethod(mtx_row_class, (t_method)mtx_row_float, gensym(""), A_FLOAT, 0); } void iemtx_row_setup(void) { mtx_row_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_scroll.c000066400000000000000000000032261514557770000243460ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_scroll */ /* scroll the rows */ static t_class *mtx_scroll_class; static void mtx_scroll_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv) { int row, col, rowscroll; if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getfloat(argv++); col=atom_getfloat(argv++); rowscroll = ((int)x->f%row+row)%row; adjustsize(x, &x->m, row, col); memcpy(x->m.atombuffer+2, argv+(row-rowscroll)*col, rowscroll*col*sizeof(t_atom)); memcpy(x->m.atombuffer+2+rowscroll*col, argv, (row-rowscroll)*col*sizeof(t_atom)); matrixobj_bang((t_matrixobj*)x); } static void *mtx_scroll_new(t_floatarg f) { t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_scroll_class); floatinlet_new(&x->x_obj, &(x->f)); outlet_new(&x->x_obj, 0); x->f=f; return (x); } void mtx_scroll_setup(void) { mtx_scroll_class = class_new(gensym("mtx_scroll"), (t_newmethod)mtx_scroll_new, (t_method)matrixobj_free, sizeof(t_mtx_binscalar), 0, A_DEFFLOAT, 0); class_addbang (mtx_scroll_class, matrixobj_bang); class_addmethod(mtx_scroll_class, (t_method)mtx_scroll_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_scroll_setup(void) { mtx_scroll_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_sin.c000066400000000000000000000012111514557770000236310ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_sin: B=sin(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return sinf(f); #else return sin(f); #endif } void mtx_sin_setup(void) { iemmatrix_unop_setup("mtx_sin", 0, unop, (char*)0); } void iemtx_sin_setup(void) { mtx_sin_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_size.c000066400000000000000000000024531514557770000240230ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_size */ static t_class *mtx_size_class; typedef struct _mtx_size { t_object x_obj; int row; int col; t_outlet *left, *right; } t_mtx_size; static void mtx_size_matrix(t_mtx_size *x, t_symbol *s, int argc, t_atom *argv) { (void)s; /* unused */ if(argc<2) { return; } outlet_float(x->right, atom_getfloat(argv+1)); outlet_float(x->left, atom_getfloat(argv)); } static void *mtx_size_new() { t_mtx_size *x = (t_mtx_size *)pd_new(mtx_size_class); x->left = outlet_new(&x->x_obj, 0); x->right = outlet_new(&x->x_obj, 0); return (x); } void mtx_size_setup(void) { mtx_size_class = class_new(gensym("mtx_size"), (t_newmethod)mtx_size_new, 0, sizeof(t_mtx_size), 0, 0); class_addmethod(mtx_size_class, (t_method)mtx_size_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_size_setup(void) { mtx_size_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_slice.c000066400000000000000000000144771514557770000241610ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_slice_class; typedef struct _MTXslice_ MTXslice; struct _MTXslice_ { t_object x_obj; int slice_size; int slice_startcol; int slice_startrow; int slice_stopcol; int slice_stoprow; t_outlet *list_outlet; t_atom *list_out; }; static void deleteMTXSlice (MTXslice *mtx_slice_obj) { if (mtx_slice_obj->list_out) { freebytes (mtx_slice_obj->list_out, sizeof(t_atom)*(mtx_slice_obj->slice_size+2)); } } static void mTXSliceIndexList (MTXslice *mtx_slice_obj, t_symbol *s, int argc, t_atom *argv) { int startcol; int startrow; int stopcol; int stoprow; t_symbol *endsym = gensym("end"); (void)s; /* unused */ if (argc<4) { pd_error(mtx_slice_obj, "[mtx_slice]: invalid index vector: "); return; } startrow = atom_getint(&argv[0]); startcol = atom_getint(&argv[1]); stoprow = atom_getint(&argv[2]); stopcol = atom_getint(&argv[3]); if (atom_getsymbol(&argv[0])==endsym) { startrow = -1; } if (atom_getsymbol(&argv[1])==endsym) { startcol = -1; } if (atom_getsymbol(&argv[2])==endsym) { stoprow = -1; } if (atom_getsymbol(&argv[3])==endsym) { stopcol = -1; } if (((startrow<1) && (atom_getsymbol(&argv[0])!=endsym)) || ((startcol<1) && (atom_getsymbol(&argv[1])!=endsym))) { pd_error(mtx_slice_obj, "[mtx_slice]: row and column indices must be >0, or misused \"end\" keyword"); return; } if (((startrow>stoprow) && (atom_getsymbol(&argv[2])!=endsym)) || ((startcol>stopcol) && (atom_getsymbol (&argv[3])!=endsym))) { pd_error(mtx_slice_obj, "[mtx_slice]: start_indexslice_startrow = startrow; mtx_slice_obj->slice_startcol = startcol; mtx_slice_obj->slice_stoprow = stoprow; mtx_slice_obj->slice_stopcol = stopcol; } static void *newMTXSlice (t_symbol *s, int argc, t_atom *argv) { MTXslice *mtx_slice_obj = (MTXslice *) pd_new (mtx_slice_class); (void)s; /* unused */ if (argc==4) { mTXSliceIndexList (mtx_slice_obj, gensym("list"),argc,argv); } else { mtx_slice_obj->slice_startrow = 1; mtx_slice_obj->slice_startcol = 1; mtx_slice_obj->slice_stopcol = -1; mtx_slice_obj->slice_stoprow = -1; } mtx_slice_obj->list_outlet = outlet_new (&mtx_slice_obj->x_obj, gensym("matrix")); inlet_new(&mtx_slice_obj->x_obj, &mtx_slice_obj->x_obj.ob_pd, gensym("list"),gensym("")); return ((void *) mtx_slice_obj); } static void mTXSliceBang (MTXslice *mtx_slice_obj) { if (mtx_slice_obj->list_out) outlet_anything(mtx_slice_obj->list_outlet, gensym("matrix"), mtx_slice_obj->slice_size+2, mtx_slice_obj->list_out); } /* static void copyList (int size, t_atom *x, t_atom *y) { while(size--) *y++=*x++; } */ static void writeVectorIntoList (int n, t_atom *x, t_atom *y) { for (; n--; x++,y++) { *y = *x; } } static void writeSliceIntoList (int slicerows, const int slicecols, int columns, t_atom *x, t_atom *y) { for (; slicerows--; x+=columns,y+=slicecols) { writeVectorIntoList(slicecols, x, y); } } static void mTXSliceMatrix (MTXslice *mtx_slice_obj, t_symbol *s, int argc, t_atom *argv) { int rows = atom_getint (argv+0); int columns = atom_getint (argv+1); t_atom *list_in = argv+2; t_atom *list_out = mtx_slice_obj->list_out; int stopcol = mtx_slice_obj->slice_stopcol; int stoprow = mtx_slice_obj->slice_stoprow; int startrow = mtx_slice_obj->slice_startrow; int startcol = mtx_slice_obj->slice_startcol; int slicecols, slicerows, slicesize; /* size check */ if(iemmatrix_check(mtx_slice_obj, s, argc, argv, 0))return; startrow = (startrow==-1)?rows:startrow; startcol = (startcol==-1)?columns:startcol; stoprow = (stoprow==-1)?rows:stoprow; stopcol = (stopcol==-1)?columns:stopcol; if ((!startrow)||(!startcol)) { pd_error(mtx_slice_obj, "[mtx_slice]: indices must be >0"); return; } if ((stopcol > columns) || (stoprow > rows)) { pd_error(mtx_slice_obj, "[mtx_slice]: slice index exceeds matrix dimensions"); return; } if ((stoprowslice_size) { if (!list_out) { list_out = (t_atom *) getbytes (sizeof (t_atom) * (slicesize + 2)); } else list_out = (t_atom *) resizebytes (list_out, sizeof (t_atom) * (mtx_slice_obj->slice_size+2), sizeof (t_atom) * (slicesize + 2)); mtx_slice_obj->slice_size = slicesize; mtx_slice_obj->list_out = list_out; } list_out += 2; list_in += columns * (startrow-1) + startcol-1; writeSliceIntoList (slicerows, slicecols, columns, list_in,list_out); list_out = mtx_slice_obj->list_out; SETSYMBOL(list_out, gensym("matrix")); SETFLOAT(list_out, slicerows); SETFLOAT(&list_out[1], slicecols); outlet_anything(mtx_slice_obj->list_outlet, gensym("matrix"), slicesize+2, list_out); } void mtx_slice_setup (void) { mtx_slice_class = class_new (gensym("mtx_slice"), (t_newmethod) newMTXSlice, (t_method) deleteMTXSlice, sizeof (MTXslice), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_slice_class, (t_method) mTXSliceBang); class_addmethod (mtx_slice_class, (t_method) mTXSliceMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_slice_class, (t_method) mTXSliceIndexList, gensym(""), A_GIMME,0); } void iemtx_slice_setup(void) { mtx_slice_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_sndfileread.c000066400000000000000000000273731514557770000253410ustar00rootroot00000000000000 #include "iemmatrix.h" #include "iemmatrix_stub.h" #ifdef HAVE_SNDFILE_H # include #else typedef struct sf_private_tag SNDFILE; typedef int64_t sf_count_t; typedef struct { sf_count_t frames ; /* Used to be called samples. */ int samplerate ; int channels ; int format ; int sections ; int seekable ; } SF_INFO ; #define SFM_READ 0x10 #endif #ifdef __WIN32__ # include # include # define close _close #else # include #endif // SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc); // mode // SFM_READ - read only mode // SFM_WRITE - write only mode // SFM_RDWR - read/write mode // close_desc=0 if file shouldn't be closed, =1 if the file shall be closed // in sf_close() // // typedef struct // { sf_count_t frames ; /* Used to be called samples. */ // int samplerate ; // int channels ; // int format ; // int sections ; // int seekable ; // } SF_INFO ; // // int sf_close (SNDFILE *sndfile); // // format //enum // { /* Major formats. */ // SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian). */ // SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */ // SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */ // SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */ // SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */ // SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */ // SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */ // SF_FORMAT_VOC = 0x080000, /* VOC files. */ // SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */ // SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */ // SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */ // SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */ // SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */ // SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */ // SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */ // SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */ // SF_FORMAT_AVR = 0x120000, /* Audio Visual Research */ // SF_FORMAT_WAVEX = 0x130000, /* MS WAVE with WAVEFORMATEX */ // SF_FORMAT_SD2 = 0x160000, /* Sound Designer 2 */ // SF_FORMAT_FLAC = 0x170000, /* FLAC lossless file format */ // SF_FORMAT_CAF = 0x180000, /* Core Audio File format */ // // /* Subtypes from here on. */ // // SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */ // SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */ // SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */ // SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */ // // SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */ // // SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */ // SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */ // // SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */ // SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */ // SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */ // SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */ // // SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */ // SF_FORMAT_VOX_ADPCM = 0x0021, /* Oki Dialogic ADPCM encoding. */ // // SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */ // SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */ // SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */ // // SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */ // SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */ // SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */ // SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */ // // SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */ // SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */ // // /* Endian-ness options. */ // // SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */ // SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */ // SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */ // SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */ // // SF_FORMAT_SUBMASK = 0x0000FFFF, // SF_FORMAT_TYPEMASK = 0x0FFF0000, // SF_FORMAT_ENDMASK = 0x30000000 // }; // typedef SNDFILE*(*t_sf_open)(const char*, int, SF_INFO*); typedef SNDFILE*(*t_sf_close)(SNDFILE*); typedef sf_count_t(*t_sf_readf_float)(SNDFILE*, float*, sf_count_t) ; static t_sf_open my_open = 0; static t_sf_close my_close = 0; static t_sf_readf_float my_readf_float = 0; static t_class *mtx_sndfileread_class; typedef struct mtx_sndfileread { t_object x_ob; SNDFILE *x_sndfileread; SF_INFO x_sfinfo; t_outlet *x_message_outlet; t_outlet *x_readybang_outlet; t_canvas *x_canvas; float *x_float; t_atom *x_outlist; int num_chan; int num_frames; } t_mtx_sndfileread; static void mtx_sndfileread_close (t_mtx_sndfileread *x) { if(my_close && x->x_sndfileread) { my_close (x->x_sndfileread); } x->x_sndfileread=0; if(x->x_outlist) { freebytes(x->x_outlist, sizeof(t_atom)*(2+x->num_chan*x->num_frames)); } x->x_outlist=0; if(x->x_float) { freebytes(x->x_float, sizeof(float)*(x->num_chan*x->num_frames)); } x->x_float=0; } typedef int (*fdclose_fun_t)(int fd); static void mtx_sndfileread_open (t_mtx_sndfileread *x, t_symbol *s, t_symbol*type) { static fdclose_fun_t myclose = 0; (void)type; /* unused */ if(!myclose) myclose = (fdclose_fun_t)iemmatrix_getpdfun("sys_close"); if(!myclose) myclose = close; char filenamebuf[MAXPDSTRING], *filenamebufptr; int fd; mtx_sndfileread_close(x); if(!my_open) { pd_error(x, "[mtx_sndfileread] missing libsndfile"); return; } /* directory, filename, extension, dirresult, nameresult, unsigned int size, int bin */ fd=canvas_open(x->x_canvas, s->s_name, "", filenamebuf, &filenamebufptr, MAXPDSTRING, 1); if(fd<0) { pd_error(x, "[mtx_sndfileread]: failed to open %s : %s", s->s_name, filenamebuf); return; } myclose(fd); if(!filenamebufptr[-1]) { filenamebufptr[-1]='/'; } if (!(x->x_sndfileread = my_open (filenamebuf, SFM_READ, &x->x_sfinfo))) { pd_error(x, "[mtx_sndfileread]: failed to sfopen %s : %s", s->s_name, filenamebuf); mtx_sndfileread_close(x); return; } x->num_chan = x->x_sfinfo.channels; } static void mtx_sndfileread_frame (t_mtx_sndfileread *x) { int n; t_atom *ptr; if ((!x->x_sndfileread)||(x->num_chan<=0)) { pd_error(x, "[mtx_sndfileread] read_frame: no or damaged file opened for reading"); return; } if (!(x->x_float)||(x->num_frames<1)) { if(!(x->x_outlist=(t_atom*)getbytes(sizeof(t_atom)*(2+x->num_chan)))) { pd_error(x, "[mtx_sndfileread] read_frame: out of memory!"); return; } if (!(x->x_float=(float*)getbytes(sizeof(float)*x->num_chan))) { freebytes(x->x_outlist,sizeof(t_atom)*(2+x->num_chan)); x->x_outlist=0; pd_error(x, "[mtx_sndfileread] read_frame: out of memory!!"); return; } x->num_frames=1; } if (my_readf_float(x->x_sndfileread, x->x_float, (sf_count_t)1)<1) { mtx_sndfileread_close(x); outlet_bang(x->x_readybang_outlet); } else { SETFLOAT(x->x_outlist,(t_float)x->num_chan); SETFLOAT(x->x_outlist+1,(t_float)1); ptr=x->x_outlist+2; for (n=0; nnum_chan; n++) { SETFLOAT(&ptr[n],x->x_float[n]); } outlet_anything(x->x_message_outlet,gensym("matrix"),x->num_chan+2, x->x_outlist); } } static void mtx_sndfileread_frames (t_mtx_sndfileread *x, t_float f) { int n,n2,c; sf_count_t frames_read; int num_frames=(int)f; t_atom *ptr; if ((!x->x_sndfileread)||(x->num_chan<=0)) { pd_error(x, "[mtx_sndfileread] read_frames: no or damaged file opened for reading"); return; } if (!(x->x_float)||(x->num_framesx_outlist=(t_atom*)getbytes(sizeof(t_atom)*(2 +num_frames*x->num_chan)))) { pd_error(x, "[mtx_sndfileread] read_frames: out of memory!"); return; } if (!(x->x_float=(float*)getbytes(sizeof(float)*num_frames*x->num_chan))) { freebytes(x->x_outlist,sizeof(t_atom)*(2+num_frames*x->num_chan)); x->x_outlist=0; pd_error(x, "[mtx_sndfileread] read_frames: out of memory!!"); return; } x->num_frames=num_frames; } if ((frames_read=my_readf_float(x->x_sndfileread, x->x_float, (sf_count_t)num_frames))<1) { mtx_sndfileread_close(x); outlet_bang(x->x_readybang_outlet); } else { SETFLOAT(x->x_outlist,(t_float)x->num_chan); SETFLOAT(x->x_outlist+1,(t_float)frames_read); ptr=x->x_outlist+2; for (n=0,c=0; cnum_chan; c++) { for (n2=c; n2num_chan; n++, n2+=x->num_chan) { SETFLOAT(&ptr[n],x->x_float[n2]); } } outlet_anything(x->x_message_outlet,gensym("matrix"), frames_read*x->num_chan+2,x->x_outlist); if (frames_readx_readybang_outlet); } } } static void mtx_sndfileread_free (t_mtx_sndfileread *x) { mtx_sndfileread_close(x); outlet_free (x->x_message_outlet); outlet_free (x->x_readybang_outlet); } static void *mtx_sndfileread_new(void) { t_mtx_sndfileread *x = (t_mtx_sndfileread *)pd_new(mtx_sndfileread_class); x->x_message_outlet = outlet_new(&x->x_ob, &s_list); x->x_readybang_outlet = outlet_new(&x->x_ob, &s_bang); x->x_sndfileread=0; if (!(my_open && my_close && my_readf_float)) { static int warn_sndfile = 1; if(warn_sndfile) pd_error(x, "[mtx_sndfileread] won't work: missing libsndfile!"); warn_sndfile = 0; } x->num_chan=0; x->num_frames=0; x->x_canvas = canvas_getcurrent(); return (void *)x; } void mtx_sndfileread_setup(void) { mtx_sndfileread_class = class_new(gensym("mtx_sndfileread"), (t_newmethod)mtx_sndfileread_new, (t_method) mtx_sndfileread_free, sizeof(t_mtx_sndfileread), 0, 0); class_addmethod(mtx_sndfileread_class, (t_method)mtx_sndfileread_open, gensym("open"), A_SYMBOL, A_DEFSYM, 0); class_addmethod(mtx_sndfileread_class, (t_method)mtx_sndfileread_close, gensym("close"), A_NULL, 0); class_addbang(mtx_sndfileread_class, (t_method)mtx_sndfileread_frame); class_addfloat(mtx_sndfileread_class, (t_method)mtx_sndfileread_frames); #ifdef HAVE_SNDFILE_H my_open = iemmatrix_get_stub("sf_open", mtx_sndfileread_class); my_close = iemmatrix_get_stub("sf_close", mtx_sndfileread_class); my_readf_float = iemmatrix_get_stub("sf_readf_float", mtx_sndfileread_class); #endif } void iemtx_sndfileread_setup (void) { mtx_sndfileread_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_sort.c000066400000000000000000000233341514557770000240410ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2005, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_class *mtx_sort_class; static t_symbol *row_sym; static t_symbol *col_sym; static t_symbol *col_sym2; typedef struct _MTXSort_ MTXSort; struct _MTXSort_ { t_object x_obj; int rows; int columns; int size; t_symbol *sort_mode; int sort_direction; t_outlet *list_outlet1; t_outlet *list_outlet2; t_atom *list_out1; t_atom *list_out2; t_atom *list_in; t_float *x; t_float *i; }; static void deleteMTXSort (MTXSort *mtx_sort_obj) { if (mtx_sort_obj->list_out1) { freebytes (mtx_sort_obj->list_out1, sizeof(t_atom)*(mtx_sort_obj->size+2)); } if (mtx_sort_obj->list_out2) { freebytes (mtx_sort_obj->list_out2, sizeof(t_atom)*(mtx_sort_obj->size+2)); } if (mtx_sort_obj->x) { freebytes (mtx_sort_obj->x, sizeof(t_float)*(mtx_sort_obj->size)); } /* if (mtx_sort_obj->y) freebytes (mtx_sort_obj->y, sizeof(t_float)*(mtx_sort_obj->size)); */ if (mtx_sort_obj->i) { freebytes (mtx_sort_obj->i, sizeof(t_float)*(mtx_sort_obj->size)); } } static void mTXSetSortDirection (MTXSort *mtx_sort_obj, t_float s_dir) { int direction = (int) s_dir; mtx_sort_obj->sort_direction = (direction==-1)?direction:1; } static void mTXSetSortMode (MTXSort *mtx_sort_obj, t_symbol *m_sym) { mtx_sort_obj->sort_mode = m_sym; } static void *newMTXSort (t_symbol *s, int argc, t_atom *argv) { MTXSort *mtx_sort_obj = (MTXSort *) pd_new (mtx_sort_class); (void)s; /* unused */ /* defaults: */ mTXSetSortMode (mtx_sort_obj, gensym(":")); mTXSetSortDirection (mtx_sort_obj, 1.0f); if (argc>=1) { if (argv[0].a_type == A_SYMBOL) { mTXSetSortMode (mtx_sort_obj, atom_getsymbol (argv)); if (argc>=2) { if (argv[1].a_type != A_SYMBOL) { mTXSetSortDirection (mtx_sort_obj, atom_getfloat (argv+1)); } else { pd_error(mtx_sort_obj, "[mtx_sort]: 2nd arg ignored. supposed to be float"); } } } else { mTXSetSortDirection (mtx_sort_obj, atom_getfloat (argv)); if (argc>=2) { if (argv[1].a_type == A_SYMBOL) { mTXSetSortMode (mtx_sort_obj, atom_getsymbol (argv+1)); } else { pd_error(mtx_sort_obj, "[mtx_sort]: 2nd arg ignored. supposed to be symbolic, e.g. \"row\", \"col\", \":\""); } } } } mtx_sort_obj->list_outlet1 = outlet_new (&mtx_sort_obj->x_obj, gensym("matrix")); mtx_sort_obj->list_outlet2 = outlet_new (&mtx_sort_obj->x_obj, gensym("matrix")); return ((void *) mtx_sort_obj); } static void mTXSortBang (MTXSort *mtx_sort_obj) { if (mtx_sort_obj->list_out2) outlet_anything(mtx_sort_obj->list_outlet2, gensym("matrix"), mtx_sort_obj->size+2, mtx_sort_obj->list_out2); if (mtx_sort_obj->list_out1) outlet_anything(mtx_sort_obj->list_outlet1, gensym("matrix"), mtx_sort_obj->size+2, mtx_sort_obj->list_out1); } static void sortVector (int n, t_float *x, t_float *i, int direction) { int step = n; int size = n; int k, loops = 1; int i_tmp; t_float x_tmp; switch (direction) { case -1: while (step > 1) { step = (step % 2)?(step+1)/2:step/2; k = loops; loops += 2; while(k--) { /* there might be some optimization in here */ for (n=0; n<(size-step); n++) if (x[n] < x[n+step]) { i_tmp = i[n]; x_tmp = x[n]; x[n] = x[n+step]; x[n+step] = x_tmp; i[n] = i[n+step]; i[n+step] = i_tmp; } } } break; default: case 1: while (step > 1) { step = (step % 2)?(step+1)/2:step/2; k = loops; loops += 2; while(k--) { /* there might be some optimization in here */ for (n=0; n<(size-step); n++) if (x[n] > x[n+step]) { i_tmp = i[n]; x_tmp = x[n]; x[n] = x[n+step]; x[n+step] = x_tmp; i[n] = i[n+step]; i[n+step] = i_tmp; } } } } } /* static void indexingVector (int n, int m, int dimension, t_float *i) { int count; int count2; int idx = n; t_float *ptr; i += n; switch (dimension) { case 2: n /= m; for (count = m; count--;) { ptr = --i; for (count2 = n; count2--; ptr -= m) *ptr = idx--; } break; default: case 1: for (; idx;) *--i = idx--; } } */ static void indexingVector (int n, int m, t_symbol *sort_mode, t_float *i) { int count; int count2; int idx = n; t_float *ptr; i += n; if ((sort_mode == col_sym)||(sort_mode == col_sym2)) { n /= m; for (count = m; count--;) { ptr = --i; for (count2 = n; count2--; ptr -= m) { *ptr = idx--; } } } else { for (; idx;) { *--i = idx--; } } } static void mTXSortMatrix (MTXSort *mtx_sort_obj, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; t_atom *list_ptr = argv + 2; t_atom *list_out1 = mtx_sort_obj->list_out1; t_atom *list_out2 = mtx_sort_obj->list_out2; t_float *x = mtx_sort_obj->x; t_float *i = mtx_sort_obj->i; int count; /* size check */ if(iemmatrix_check(mtx_sort_obj, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); size = rows * columns; if ((!x)||(!list_out1)||(!list_out2)/*||(!y)*/) { if (!x) { x = (t_float *) getbytes (sizeof (t_float) * (size)); } /*if (!y) * y = (t_float *) getbytes (sizeof (t_float) * (size)); */ if (!i) { i = (t_float *) getbytes (sizeof (t_float) * (size)); } if (!list_out1) { list_out1 = (t_atom *) getbytes (sizeof (t_atom) * (size+2)); } if (!list_out2) { list_out2 = (t_atom *) getbytes (sizeof (t_atom) * (size+2)); } } else if (size != mtx_sort_obj->size) { x = (t_float *) resizebytes (x, sizeof (t_float) * (mtx_sort_obj->size), sizeof (t_float) * (size)); i = (t_float *) resizebytes (i, sizeof (t_float) * (mtx_sort_obj->size), sizeof (t_float) * (size)); list_out1 = (t_atom *) resizebytes (list_out1, sizeof (t_atom) * (mtx_sort_obj->size+2), sizeof (t_atom) * (size + 2)); list_out2 = (t_atom *) resizebytes (list_out2, sizeof (t_atom) * (mtx_sort_obj->size+2), sizeof (t_atom) * (size + 2)); } mtx_sort_obj->list_out1 = list_out1; mtx_sort_obj->list_out2 = list_out2; mtx_sort_obj->x = x; mtx_sort_obj->i = i; mtx_sort_obj->size = size; mtx_sort_obj->rows = rows; mtx_sort_obj->columns = columns; /* generating indexing vector */ indexingVector (size, columns, mtx_sort_obj->sort_mode, i); /* main part */ /* reading matrix from inlet */ if ((mtx_sort_obj->sort_mode == col_sym)|| (mtx_sort_obj->sort_mode == col_sym2)) { iemmatrix_list2floats_modulo(x, list_ptr, size, columns); columns = mtx_sort_obj->rows; rows = mtx_sort_obj->columns; } else { iemmatrix_list2floats(x, list_ptr, size); } /* calculating sort */ if ((mtx_sort_obj->sort_mode != col_sym) && (mtx_sort_obj->sort_mode != col_sym2) && (mtx_sort_obj->sort_mode != row_sym)) { sortVector (size,x,i,mtx_sort_obj->sort_direction); } else for (count = rows; count--; x+=columns,i+=columns) { sortVector (columns,x,i,mtx_sort_obj->sort_direction); } x = mtx_sort_obj->x; i = mtx_sort_obj->i; /* writing matrix to outlet */ if ((mtx_sort_obj->sort_mode == col_sym)|| (mtx_sort_obj->sort_mode == col_sym2)) { columns = mtx_sort_obj->columns; rows = mtx_sort_obj->rows; iemmatrix_floats2list_modulo(list_out1+2, x, size, columns); iemmatrix_floats2list_modulo(list_out2+2, i, size, columns); } else { iemmatrix_floats2list(list_out1+2, x, size); iemmatrix_floats2list(list_out2+2, i, size); } /* writing indices */ SETSYMBOL(list_out2, gensym("matrix")); SETFLOAT(list_out2, rows); SETFLOAT(&list_out2[1], columns); outlet_anything(mtx_sort_obj->list_outlet2, gensym("matrix"), mtx_sort_obj->size+2, list_out2); /* writing sorted values */ SETSYMBOL(list_out1, gensym("matrix")); SETFLOAT(list_out1, rows); SETFLOAT(&list_out1[1], columns); outlet_anything(mtx_sort_obj->list_outlet1, gensym("matrix"), mtx_sort_obj->size+2, list_out1); } void mtx_sort_setup (void) { mtx_sort_class = class_new (gensym("mtx_sort"), (t_newmethod) newMTXSort, (t_method) deleteMTXSort, sizeof (MTXSort), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_sort_class, (t_method) mTXSortBang); class_addmethod (mtx_sort_class, (t_method) mTXSortMatrix, gensym("matrix"), A_GIMME,0); class_addmethod (mtx_sort_class, (t_method) mTXSetSortMode, gensym("mode"), A_DEFSYMBOL,0); class_addmethod (mtx_sort_class, (t_method) mTXSetSortDirection, gensym("direction"), A_DEFFLOAT,0); row_sym = gensym("row"); col_sym = gensym("col"); col_sym2 = gensym("column"); } void iemtx_sort_setup(void) { mtx_sort_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics.c000066400000000000000000000210631514557770000270640ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * this functions depends on the GNU scientific library * * Copyright (c) 2009, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include #include "mtx_spherical_harmonics/sharmonics.h" #include "mtx_spherical_harmonics/legendre_a.h" #include "mtx_spherical_harmonics/chebyshev12.h" #include "mtx_spherical_harmonics/sharmonics_normalization.h" static t_class *mtx_spherical_harmonics_class; typedef struct _MTXSh_ MTXSh; struct _MTXSh_ { t_object x_obj; t_outlet *list_sh_out; t_atom *list_sh; SHNormType ntype; int legacy_azi_reverse; double *phi; double *theta; SHWorkSpace *ws; size_t nmax; size_t l; }; static t_class *mtx_circular_harmonics_class; typedef struct _MTXCh_ MTXCh; struct _MTXCh_ { t_object x_obj; t_outlet *list_ch_out; t_atom *list_ch; CHNormType ntype; double *phi; Cheby12WorkSpace *wc; size_t nmax; size_t l; }; static void allocMTXShdata (MTXSh *x) { x->phi=(double*)calloc(x->l,sizeof(double)); x->theta=(double*)calloc(x->l,sizeof(double)); x->ws=sharmonics_alloc(x->nmax,x->l,x->ntype); x->list_sh=(t_atom*)calloc(x->l*(x->nmax+1)*(x->nmax+1)+2,sizeof(t_atom)); } static void deleteMTXShdata (MTXSh *x) { if (x->phi!=0) { free(x->phi); } if (x->theta!=0) { free(x->theta); } if (x->list_sh!=0) { free(x->list_sh); } sharmonics_free(x->ws); x->ws=0; x->list_sh=0; x->theta=0; x->phi=0; } static void *newMTXSh (t_symbol *s, int argc, t_atom *argv) { int nmax; MTXSh *x = (MTXSh *) pd_new (mtx_spherical_harmonics_class); (void)s; /* unused */ x->list_sh_out = outlet_new (&x->x_obj, gensym("matrix")); x->ntype=N3D; x->legacy_azi_reverse=1; t_symbol *nt; if (argc<1) { nmax=1; } else { if (argc>1) { nt=atom_getsymbol(argv+1); x->legacy_azi_reverse=0; if (nt==gensym("N3D")) { x->ntype=N3D; } else if (nt==gensym("N3D4PI")) { x->ntype=N3D4PI; } else if (nt==gensym("SN3D")) { x->ntype=SN3D; } else { x->legacy_azi_reverse=1; x->ntype=N3D; } } nmax=(int) atom_getfloat(argv); if (nmax<0) { nmax=0; } } x->nmax=nmax; return ((void *) x); } static void mTXShBang (MTXSh *x) { if (x->list_sh!=0) { outlet_anything(x->list_sh_out, gensym("matrix"), x->l*(x->nmax+1)*(x->nmax+1)+2, x->list_sh); } } static void _mTXShMatrix (MTXSh *x, unsigned int rows, unsigned int columns, t_atom *argv) { unsigned int size = rows * columns; if ((rows!=2)||(columns<1)) { pd_error(x, "[mtx_spherical_harmonics]: 2 X L matrix expected with phi and theta vector, but got more rows/no entries"); return; } if ((rows!=2)||(columns<1)) { pd_error(x, "[mtx_spherical_harmonics]: 2 X L matrix expected with phi and theta vector, but got more rows/no entries"); return; } if (x->l!=columns) { deleteMTXShdata(x); x->l=columns; allocMTXShdata(x); } if (1) { unsigned int n; switch (x->legacy_azi_reverse) { case 0: for (n=0; nl; n++) { x->phi[n]=(double) atom_getfloat(argv+n); x->theta[n]=(double) atom_getfloat(argv+columns+n); } break; default: for (n=0; nl; n++) { x->phi[n]=-(double) atom_getfloat(argv+n); x->theta[n]=(double) atom_getfloat(argv+columns+n); } break; } } if (x->ws!=0) { unsigned int n; sharmonics(x->phi, x->theta, x->ws); size=x->l*(x->nmax+1)*(x->nmax+1); SETFLOAT(x->list_sh,(t_float)x->l); SETFLOAT(x->list_sh+1,(t_float)(x->nmax+1)*(x->nmax+1)); for (n=0; nlist_sh+n+2,(t_float)x->ws->y[n]); } mTXShBang(x); } else { pd_error(x, "[mtx_spherical_harmonics]: memory error, no operation"); } } static void mTXShMatrix (MTXSh *x, t_symbol *s, int argc, t_atom *argv) { unsigned int rows, columns, size; /* size check */ if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); _mTXShMatrix(x, rows, columns, argv); } static void mTXShList (MTXSh *x, t_symbol *s, int argc, t_atom *argv) { (void)s; if(2 != argc) { _mTXShMatrix(x, 2, 0, argv); } else { _mTXShMatrix(x, 2, argc>>1, argv); } } static void allocMTXChdata (MTXCh *x) { x->phi=(double*)calloc(x->l,sizeof(double)); x->wc=chebyshev12_alloc(x->nmax,x->l,x->ntype); x->list_ch=(t_atom*)calloc(x->l*(2*x->nmax+1)+2,sizeof(t_atom)); } static void deleteMTXChdata (MTXCh *x) { if (x->phi!=0) { free(x->phi); } if (x->list_ch!=0) { free(x->list_ch); } chebyshev12_free(x->wc); x->wc=0; x->list_ch=0; x->phi=0; } static void *newMTXCh (t_symbol *s, int argc, t_atom *argv) { int nmax; MTXCh *x = (MTXCh *) pd_new (mtx_circular_harmonics_class); (void)s; /* unused */ x->list_ch_out = outlet_new (&x->x_obj, gensym("matrix")); x->list_ch = 0; x->phi = 0; x->wc = 0; x->l=0; x->ntype=N2D; t_symbol *nt; if (argc<1) { nmax=1; } else { if (argc>1) { nt=atom_getsymbol(argv+1); if (nt==gensym("N2D")) { x->ntype=N2D; } else if (nt==gensym("N2D2PI")) { x->ntype=N2D2PI; } else if (nt==gensym("SN2D")) { x->ntype=SN2D; } else { x->ntype=N2D; } } nmax=(int) atom_getfloat(argv); if (nmax<0) { nmax=0; } } x->nmax=nmax; return ((void *) x); } static void mTXChBang (MTXCh *x) { if (x->list_ch!=0) { outlet_anything(x->list_ch_out, gensym("matrix"), x->l*(2*x->nmax+1)+2, x->list_ch); } } static void mTXChList (MTXCh *x, t_symbol*s, int argc, t_atom*argv) { (void)s; unsigned int rows = 1, columns = argc; unsigned int size = rows * columns; if (x->l!=columns) { deleteMTXChdata(x); x->l=columns; allocMTXChdata(x); } if (1) { unsigned int n; for (n=0; nl; n++) { x->phi[n]=(double) atom_getfloat(argv+n); } } if (x->wc!=0) { unsigned int n; chebyshev12(x->phi, x->wc); size=x->l*(2*x->nmax+1); SETFLOAT(x->list_ch,(t_float)x->l); SETFLOAT(x->list_ch+1,(t_float)(2*x->nmax+1)); for (n=0; nlist_ch+n+2,(t_float)x->wc->t[n]); } mTXChBang(x); } else { pd_error(x, "[mtx_circular_harmonics]: memory error, no operation"); } } static void mTXChMatrix (MTXCh *x, t_symbol *s, int argc, t_atom *argv) { unsigned int rows, columns; /* size check */ if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv+0); columns = atom_getint (argv+1); if ((rows!=1)||(columns<1)) { pd_error(x, "[mtx_circular_harmonics]: 1*L matrix expected with phi vector, but got more rows/no entries"); return; } mTXChList(x, s, argc-2, argv+2); } void mtx_spherical_harmonics_setup (void) { mtx_spherical_harmonics_class = class_new (gensym("mtx_spherical_harmonics"), (t_newmethod) newMTXSh, (t_method) deleteMTXShdata, sizeof (MTXSh), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_spherical_harmonics_class, (t_method) mTXShBang); class_addmethod (mtx_spherical_harmonics_class, (t_method) mTXShMatrix, gensym("matrix"), A_GIMME,0); class_addlist (mtx_spherical_harmonics_class, (t_method) mTXShList); } void mtx_circular_harmonics_setup (void) { mtx_circular_harmonics_class = class_new (gensym("mtx_circular_harmonics"), (t_newmethod) newMTXCh, (t_method) deleteMTXChdata, sizeof (MTXCh), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_circular_harmonics_class, (t_method) mTXChBang); class_addlist (mtx_circular_harmonics_class, (t_method) mTXChList); class_addmethod (mtx_circular_harmonics_class, (t_method) mTXChMatrix, gensym("matrix"), A_GIMME,0); } void iemtx_spherical_harmonics_setup(void) { mtx_circular_harmonics_setup(); mtx_spherical_harmonics_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/000077500000000000000000000000001514557770000267165ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/AUTHORS000066400000000000000000000002241514557770000277640ustar00rootroot00000000000000Franz Zotter, zotter@iem.at, Institute of Electronic Music and Acoustics, University of Music and dramatic Arts (KUG), http://iem.at/Members/zotter iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/ChangeLog000066400000000000000000000000001514557770000304560ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/Makefile.am000066400000000000000000000004171514557770000307540ustar00rootroot00000000000000SUBDIRS = . cmdline lib_LIBRARIES = libsharmonics.a libsharmonics_a_CPPFLAGS = -I$(top_srcdir)/.. libsharmonics_a_SOURCES = \ legendre_a.c \ sharmonics_normalization.c \ chebyshev12.c \ sharmonics.c include_HEADERS = \ legendre_a.h \ sharmonics_normalization.h iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/NEWS000066400000000000000000000000001514557770000274030ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/README000066400000000000000000000013441514557770000276000ustar00rootroot00000000000000This directory contains the "sphbase" library C-files implementing the Legendre-polynomials, spherical harmonics, normalization constants, spherical Hankel and Bessel functions. The rotation/translation operations are currently not implemented and will be added soon. The C-code is published under the Gnu General Public License. To make the c-sources, use: /c_src$ make You will get some test routines (legendre_a, sh_normalization, sh) and the library file (sh.o). To test the functions, use e.g. ./legendre_a 3 ./sh_normalization 3 ./sh 3 1 0.5 0.5 The radial functions are currently not part of the Makefile. The near-field approximation for the spherical Bessel function hasn't been added yet. Franz Zotter, 2008. iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/chebyshev12.c000066400000000000000000000046021514557770000312070ustar00rootroot00000000000000/* Evaluates all fully normalized circular harmonics at the angles phi up to the order nmax. using the recurrence for the Chebyshev polynomials of the first and second kind T has the dimensions length(phi) x 2nmax+1 Implementation by Franz Zotter, Institute of Electronic Music and Acoustics (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria http://iem.at/Members/zotter, 2008. This code is published under the Gnu General Public License, see the "LICENSE" file. */ #include "mtx_spherical_harmonics/chebyshev12.h" Cheby12WorkSpace *chebyshev12_alloc(const size_t nmax, const size_t l, CHNormType type) { Cheby12WorkSpace *wc; // memory allocation if ((wc=(Cheby12WorkSpace*)calloc(1,sizeof(Cheby12WorkSpace)))!=0) { wc->l=l; wc->nmax=nmax; if ((wc->t=(double*)calloc(l*(2*nmax+1),sizeof(double)))==0) { free(wc); return 0; } switch(type) { case N2D2PI: wc->n0=1.0; wc->nm=sqrt(2.0); break; case SN2D: wc->n0=1.0; wc->nm=1.0; break; case N2D: default: wc->n0=1.0/sqrt(2.0*M_PI); wc->nm=1.0/sqrt(M_PI); } return wc; } return 0; } void chebyshev12_free(Cheby12WorkSpace *wc) { if (wc!=0) { free(wc->t); free(wc); } } void chebyshev12(double *phi, Cheby12WorkSpace *wc) { unsigned int l,l0,n; const int incr=wc?(2*wc->nmax+1):0; double *cosphi; double *sinphi; // memory allocation if ((wc!=0)&&(phi!=0)) { // constants and initialization for (l=0, l0=wc->nmax; ll; l++, l0+=incr) { // initial value T_0=1 wc->t[l0]=wc->n0; } if (wc->nmax==0) { return; } if ((cosphi=(double*)calloc(wc->l,sizeof(double)))==0) { return; } if ((sinphi=(double*)calloc(wc->l,sizeof(double)))==0) { free(cosphi); return; } for (l=0, l0=wc->nmax; ll; l++, l0+=incr) { // initial value T_0=1 cosphi[l]=cos(phi[l]); sinphi[l]=sin(phi[l]); wc->t[l0+1]=cosphi[l]*wc->nm; wc->t[l0-1]=sinphi[l]*wc->nm; } // recurrence for n>1 for (n=2; n<=wc->nmax; n++) { for (l=0, l0=wc->nmax; ll; l++, l0+=incr) { wc->t[l0+n]=cosphi[l]* wc->t[l0+n-1] - sinphi[l]* wc->t[l0-n+1]; wc->t[l0-n]=sinphi[l]* wc->t[l0+n-1] + cosphi[l]* wc->t[l0-n+1]; } } free(cosphi); free(sinphi); } } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/chebyshev12.h000066400000000000000000000021051514557770000312100ustar00rootroot00000000000000/* Evaluates all circular harmonics at the angles phi up to the order nmax. using the recurrence for the Chebyshev polynomials of the first and second kind T has the dimensions length(phi) x 2nmax+1 Implementation by Franz Zotter, Institute of Electronic Music and Acoustics (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria http://iem.at/Members/zotter, 2008. This code is published under the Gnu General Public License, see the "LICENSE" file. */ #ifndef _chebyshev12_h__ #define _chebyshev12_h__ #include #include #ifndef M_PI # define M_PI 3.141592653589793238462643383279502884L #endif typedef enum _CHNormType_ { N2D, N2D2PI, SN2D, } CHNormType; typedef struct _Cheby12WorkSpace_ { size_t nmax; size_t l; double *t; double n0; // normalizer for m==0 double nm; // normalizer for m>0 } Cheby12WorkSpace; Cheby12WorkSpace *chebyshev12_alloc(const size_t nmax, const size_t l, CHNormType type); void chebyshev12_free(Cheby12WorkSpace *wc); void chebyshev12(double *phi, Cheby12WorkSpace *wc); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/cmdline/000077500000000000000000000000001514557770000303315ustar00rootroot00000000000000Makefile.am000066400000000000000000000011001514557770000322760ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/cmdline#check_PROGRAMS = \ # bin_PROGRAMS = \ legendre_a_cmd \ sharmonics_normalization_cmd \ chebyshev12_cmd \ sharmonics_cmd #TESTS = $(check_PROGRAMS) AM_CPPFLAGS = -I$(top_srcdir) legendre_a_cmd_LDADD = ../libsharmonics.a sharmonics_normalization_cmd_LDADD = ../libsharmonics.a chebyshev12_cmd_LDADD = ../libsharmonics.a sharmonics_cmd_LDADD = ../libsharmonics.a legendre_a_cmd_SOURCES = legendre_a_cmd.c sharmonics_normalization_cmd_SOURCES = sharmonics_normalization_cmd.c chebyshev12_cmd_SOURCES = chebyshev12_cmd.c sharmonics_cmd_SOURCES = sharmonics_cmd.c chebyshev12_cmd.c000066400000000000000000000017511514557770000333700ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/cmdline /* command line test for chebyshev12.c * Franz Zotter, 2009, see the "LICENSE" file. */ #include #include "chebyshev12.h" int main (int argc, char *argv[]) { int nmax, l, lc, n, m; Cheby12WorkSpace *wc=0; double *ptr,*phi; if (argc <3) { printf("chebyshev12 requires nmax as input argument followed by phi values\n"); return 0; } nmax=atoi(argv[1]); l=argc-2; if ((phi=(double*)calloc(l,sizeof(double)))==0) { printf("chebyshev12 could not allocate memory for %d phi-values\n",l); return 0; } if ((wc=chebyshev12_alloc(nmax,l))==0) { printf("chebyshev12 could not allocate memory for n=%d\n and l=%d\n",nmax, l); free(phi); return 0; } for (n=0; nt; for (lc=0; lc #include "legendre_a.h" int main (int argc, char *argv[]) { int nmax, l, lc, n, m; LegendreWorkSpace *wl=0; double *ptr,*theta; if (argc <3) { printf("legendre_a requires nmax as input argument followed by theta values\n"); return 0; } nmax=atoi(argv[1]); l=argc-2; if ((theta=(double*)calloc(l,sizeof(double)))==0) { printf("legendre_a could not allocate memory for %d theta-values\n",l); return 0; } if ((wl=legendre_a_alloc(nmax,l))==0) { printf("legendre_a could not allocate memory for n=%d\n and l=%d\n",nmax, l); free(theta); return 0; } for (n=0; np; for (lc=0; lc #include "sharmonics.h" int main (int argc, char *argv[]) { int nmax, l, lc, n, m; SHWorkSpace *ws=0; double *ptr,*phi,*theta; if (argc <4) { printf("sharmonics requires nmax as input argument followed by phi theta value pairs\n"); return 0; } nmax=atoi(argv[1]); l=(argc-2)/2; if ((phi=(double*)calloc(l,sizeof(double)))==0) { printf("sharmonics could not allocate memory for %d phi-values\n",l); return 0; } if ((theta=(double*)calloc(l,sizeof(double)))==0) { printf("sharmonics could not allocate memory for %d theta-values\n",l); free(phi); return 0; } if ((ws=sharmonics_alloc(nmax,l))==0) { printf("sharmonics could not allocate memory for n=%d\n and l=%d\n",nmax, l); free(theta); free(phi); return 0; } for (n=0; ny; for (lc=0; lc #include "sharmonics_normalization.h" int main (int argc, char *argv[]) { int nmax, n, m; SHNorml *ws=0; double *ptr; if (argc!=2) { printf("sharmonics_normalization requires nmax as input argument\n"); return 0; } nmax=atoi(argv[1]); if ((ws=sharmonics_normalization_new(nmax))==0) { printf("sharmonics_normalization could not allocate memory for n=%d",nmax); return 0; } ptr=ws->n; for (n=0; n<=nmax; n++) { for (m=0; m<=n; m++) { printf("N[%2d][%2d]=%7.4f\n",n,m,*ptr++); } } sharmonics_normalization_free(ws); return 1; } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/configure.ac000066400000000000000000000012231514557770000312020ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) AC_INIT([sh], [0.1], [zotter@iem.at]) AM_INIT_AUTOMAKE([-Wall]) AC_CONFIG_SRCDIR([legendre_a.h]) # Checks for programs. AC_PROG_CC AC_PROG_RANLIB # Checks for libraries. # FIXME: Replace `main' with a function in `-lm': AC_CHECK_LIB([m], [cos]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h]) # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([pow]) AC_CONFIG_FILES([Makefile cmdline/Makefile]) AC_OUTPUT iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/legendre_a.c000066400000000000000000000062031514557770000311500ustar00rootroot00000000000000/* Evaluates all associated legendre functions at the angles theta up to the order nmax using the three-term recurrence of the Legendre functions. P has dimensions length(theta) x (nmax+1)(nmax+2) Implementation by Franz Zotter, Institute of Electronic Music and Acoustics (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria http://iem.at/Members/zotter, 2008. This code is published under the Gnu General Public License, see the "LICENSE" file. */ #include "mtx_spherical_harmonics/legendre_a.h" static void legendre_first_recurrence (double *sintheta, LegendreWorkSpace *wl) { unsigned int l,l0; size_t nmo0=0; size_t n0=1; const size_t incr=(wl->nmax+1)*(wl->nmax+2)/2; // computes the legendre functions P_n^m(costheta) for m=n // from P_0^0 for (int n=1; n<=(int)wl->nmax; n++) { for (l=0,l0=0; ll; l++,l0+=incr) { wl->p[l0+n0+n] = -(2*n-1) * wl->p[l0+nmo0+n-1] * sintheta[l]; } nmo0=n0; n0+=n+1; } } static void legendre_second_recurrence (double *costheta, LegendreWorkSpace *wl) { int nmt0=-1; int nmo0=0; int n0=1; const int incr=(wl->nmax+1)*(wl->nmax+2)/2; // computes the Legendre functions P_n^m(costheta) from // P_n^m with m=n for (size_t n=1; n<=wl->nmax; n++) { for (size_t m=0; ml; l++,l0+=incr) { wl->p[l0+n0+m] = ( (2*n-1) * costheta[l] * wl->p[l0+nmo0+m] - (n+m-1) * wl->p[l0+nmt0+m] ) / (n-m); } } else { for (size_t l=0,l0=0; ll; l++,l0+=incr) { wl->p[l0+n0+m] = ( (2*n-1) * costheta[l] * wl->p[l0+nmo0+m] ) / (n-m); } } } nmt0=nmo0; nmo0=n0; n0+=n+1; } } LegendreWorkSpace *legendre_a_alloc(const size_t nmax, const size_t l) { LegendreWorkSpace *wl; // memory allocation if ((wl=(LegendreWorkSpace*)calloc(1,sizeof(LegendreWorkSpace)))!=0) { wl->l=l; wl->nmax=nmax; if ((wl->p=(double*)calloc(l*(nmax+1)*(nmax+2)/2,sizeof(double)))==0) { free(wl); wl = 0; } } return wl; } void legendre_a_free(LegendreWorkSpace *wl) { if (wl!=0) { free(wl->p); free(wl); } } void legendre_a(double *theta, LegendreWorkSpace *wl) { unsigned int l,l0; const int incr=wl?((wl->nmax+1)*(wl->nmax+2)/2):0; double *costheta; double *sintheta; // memory allocation if ((wl!=0)&&(theta!=0)) { if ((costheta=(double*)calloc(wl->l,sizeof(double)))==0) { return; } if ((sintheta=(double*)calloc(wl->l,sizeof(double)))==0) { free(costheta); return; } // constants and initialization for (l=0, l0=0; ll; l++, l0+=incr) { costheta[l]=cos(theta[l]); sintheta[l]=sin(theta[l]); // initial value P_0^0=1 wl->p[l0]=1; } // recurrences evaluating all the Legendre functions legendre_first_recurrence(sintheta,wl); legendre_second_recurrence(costheta,wl); free(sintheta); free(costheta); } } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/legendre_a.h000066400000000000000000000015161514557770000311570ustar00rootroot00000000000000/* Evaluates all associated legendre functions at the angles theta up to the order nmax using the three-term recurrence of the Legendre functions. P has dimensions length(theta) x (nmax+1)(nmax+2) Implementation by Franz Zotter, Institute of Electronic Music and Acoustics (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria http://iem.at/Members/zotter, 2008. This code is published under the Gnu General Public License, see the "LICENSE" file. */ #ifndef _legendre_a_h__ #define _legendre_a_h__ #include #include typedef struct _LegendreWorkSpace_ { size_t nmax; size_t l; double *p; } LegendreWorkSpace; LegendreWorkSpace *legendre_a_alloc(const size_t nmax, const size_t l); void legendre_a_free(LegendreWorkSpace *wl); void legendre_a(double *theta, LegendreWorkSpace *wl); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/sharmonics.c000066400000000000000000000116741514557770000312410ustar00rootroot00000000000000/* * Recursive computation of (arbitrary degree) spherical harmonics, * according to Gumerov and Duraiswami, * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions", * Elsevier, 2005. * * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria * http://iem.at/Members/zotter, 2008. * * This code is published under the Gnu General Public License, see * the "LICENSE" file. */ #include "mtx_spherical_harmonics/sharmonics.h" // HELPER ROUTINES // preliminarily writing normalized Legendre functions into the result // Y_n^m(theta) = N_n^m * P_n^m(cos(theta)) // ny0 and np0 denote where the position (n,m)=(n,0) is in the arrays // ly0 and lp0 denote the starting position for one vertex in the arrays // see below to find out how the data is arranged static void sharmonics_initlegendrenormalized(SHWorkSpace *ws) { unsigned int n,m,ny0,np0; unsigned int l,ly0,lp0; const int pincr=(ws->nmax+1)*(ws->nmax+2)/2; const int yincr=(ws->nmax+1)*(ws->nmax+1); for (n=0,ny0=0,np0=0; n<=ws->nmax; n++) { for (m=0; m<=n; m++) { ly0=0; lp0=0; for (l=0; ll; l++) { ws->y[ly0+ny0+m] = ws->wn->n[np0+m] * ws->wl->p[lp0+np0+m]; ws->y[ly0+ny0-m] = ws->y[ly0+ny0+m]; ly0+=yincr; lp0+=pincr; } } ny0+=2*n+2; np0+=n+1; } } // multiplying normalized Chebyshev sin/cos to the preliminary result // Y_n^m(phi,theta) = Y_n^m(theta) * T_m(phi) // ny0 and nt0 denote where the position (n,m)=(n,0) or m=0 is in the arrays // ly0 and lt0 denote the starting position for one vertex in the arrays // see below to find out how the data is arranged static void sharmonics_multcheby12(SHWorkSpace *ws) { unsigned int n,m,ny0; const int nt0=ws->nmax; unsigned int l,ly0,lt0; const int tincr=2*ws->nmax+1; const int yincr=(ws->nmax+1)*(ws->nmax+1); for (n=0,ny0=0; n<=ws->nmax; n++) { m=0; ly0=0; lt0=nt0; for (l=0; ll; l++) { ws->y[ly0+ny0+m]*= ws->wc->t[lt0+m]; ly0+=yincr; lt0+=tincr; } for (m=1; m<=n; m++) { ly0=0; lt0=nt0; for (l=0; ll; l++) { ws->y[ly0+ny0-m]*= ws->wc->t[lt0-m]; ws->y[ly0+ny0+m]*= ws->wc->t[lt0+m]; ly0+=yincr; lt0+=tincr; } } ny0+=2*n+2; } } /* MAIN PROGRAM. IMPORTANT EXPRESSIONS p... vector containing Legendre functions evaluated at the vector z=cos(theta) structure [P_0^0(z1) P_1^0(z1) P_1^1(z1) P_2^0(z1) .... Pnmax^nmax(z1) P_0^0(z2) P_1^0(z1) P_1^1(z2) P_2^0(z2) .... Pnmax^nmax(z2) ... P_0^0(zL) P_1^0(zL) P_1^1(zL) P_2^0(zL) .... Pnmax^nmax(zL)] with length L X (nmax+1)*(nmax+2)/2 t... vector containing Chebyshev polynomials sin/cos evaluated at the vector phi structure [T_-nmax(phi1) ... T_-1(phi1) T_0(phi1) T_1(phi1) ... T_nmax(phi1) T_-nmax(phi2) ... T_-1(phi2) T_0(phi2) T_1(phi2) ... T_nmax(phi2) ... T_-nmax(phiL) ... T_-1(phiL) T_0(phiL) T_1(phiL) ... T_nmax(phiL)] with length L X (2*nmax+1); negative indices are sine, positive ones cosine terms normals ... vector containing normalization terms structure [N_0^0 N_1^0 N_1^1 N_2^0 N_2^1 N_2^2 .... N_nmax^nmax] with length (nmax+1)*(nmax+2)/2 y ... THE RESULT: containing the spherical harmonics, with negative m for sine positive m for cosine terms; p=(phi,theta) structure [Y_0^0(p1) Y_1^-1(p1) Y_1^0(p1) Y_1^1 ... Y_nmax^nmax(p1) Y_0^0(p2) Y_1^-1(p2) Y_1^0(p2) Y_1^1 ... Y_nmax^nmax(p2) ... Y_0^0(pL) Y_1^-1(pL) Y_1^0(pL) Y_1^1 ... Y_nmax^nmax(pL)] with length L X (nmax+1)^2 */ SHWorkSpace *sharmonics_alloc(size_t nmax, size_t l, SHNormType ntype) { SHWorkSpace *ws=0; CHNormType ctype; if ((ws=(SHWorkSpace*)calloc(1,sizeof(SHWorkSpace)))!=0) { ws->y=(double*)calloc(l*(nmax+1)*(nmax+1),sizeof(double)); switch(ntype) { case N3D4PI: case SN3D: ctype=N2D2PI; break; case N3D: default: ctype=N2D; } ws->wl=(LegendreWorkSpace*)legendre_a_alloc(nmax,l); ws->wc=(Cheby12WorkSpace*)chebyshev12_alloc(nmax,l, ctype); ws->wn=(SHNorml*)sharmonics_normalization_new(nmax, ntype); if ((ws->y==0)||(ws->wl==0)||(ws->wc==0)||(ws->wn==0)) { sharmonics_free(ws); ws=0; } else { ws->l=l; ws->nmax=nmax; } } return ws; } void sharmonics_free(SHWorkSpace *ws) { if (ws!=0) { legendre_a_free(ws->wl); chebyshev12_free(ws->wc); sharmonics_normalization_free(ws->wn); free(ws); } } void sharmonics(double *phi, double *theta, SHWorkSpace *ws) { if ((ws!=0)&&(theta!=0)&&(phi!=0)) { chebyshev12(phi,ws->wc); legendre_a(theta,ws->wl); sharmonics_initlegendrenormalized(ws); sharmonics_multcheby12(ws); } } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/sharmonics.h000066400000000000000000000017451514557770000312440ustar00rootroot00000000000000/* * Recursive computation of (arbitrary degree) spherical harmonics, * according to Gumerov and Duraiswami, * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions", * Elsevier, 2005. * * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria * http://iem.at/Members/zotter, 2007. * * This code is published under the Gnu General Public License, see * the "LICENSE" file. */ #ifndef _sh_h__ #define _sh_h__ #include #include "legendre_a.h" #include "chebyshev12.h" #include "sharmonics_normalization.h" typedef struct _SHWorkSpace_ { size_t nmax; size_t l; SHNormType ntype; double *y; SHNorml *wn; Cheby12WorkSpace *wc; LegendreWorkSpace *wl; } SHWorkSpace; SHWorkSpace *sharmonics_alloc(size_t nmax, size_t l, SHNormType ntype); void sharmonics_free(SHWorkSpace *sh); void sharmonics(double *phi, double *theta, SHWorkSpace *ws); #endif sharmonics_normalization.c000066400000000000000000000036161514557770000341250ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/* * Recursive computation of (arbitrary degree) normalization constants * for spherical harmonics, according to Gumerov and Duraiswami, * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions", * Elsevier, 2005. * * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria * http://iem.at/Members/zotter, 2007. * * This code is published under the Gnu General Public License, see * the "LICENSE" file. */ #include "mtx_spherical_harmonics/sharmonics_normalization.h" SHNorml *sharmonics_normalization_new (const size_t nmax, const SHNormType type) { SHNorml *wn; unsigned int n,n0,m; const double oneoversqrt2 = 1.0/sqrt(2); // memory allocation if ((wn=(SHNorml*)calloc(1,sizeof(SHNorml)))!=0) { wn->nmax=nmax; if ((wn->n=(double*)calloc((nmax+1)*(nmax+2)/2,sizeof(double)))==0) { free(wn); wn=0; } else { // computing N_n^m for m=0, switch(type) { case N3D4PI: case SN3D: wn->n[0]=1.0; break; case N3D: default: wn->n[0]=oneoversqrt2; } switch(type) { case N3D: case N3D4PI: for (n=1,n0=1; n<=nmax; n++) { wn->n[n0]=wn->n[0] * sqrt(2*n+1); n0+=n+1; } break; case SN3D: default: for (n=1,n0=1; n<=nmax; n++) { wn->n[n0]=wn->n[0]; n0+=n+1; } } // computing N_n^m for 0n[n0+m]= - wn->n[n0+m-1] / sqrt((n+m)*(n-m+1)); } n0+=n+1; } } } return wn; } void sharmonics_normalization_free(SHNorml *wn) { if (wn!=0) { free(wn->n); free(wn); } } sharmonics_normalization.h000066400000000000000000000016511514557770000341270ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/* * Recursive computation of (arbitrary degree) normalization constants * for spherical harmonics, according to Gumerov and Duraiswami, * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions", * Elsevier, 2005. * * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria * http://iem.at/Members/zotter, 2008. * * This code is published under the Gnu General Public License, see * the "LICENSE" file. */ #ifndef _sharmonics_normalization_h__ #define _sharmonics_normalization_h__ #include #include typedef enum _SHNormType_ { N3D, N3D4PI, SN3D, } SHNormType; typedef struct _SHNorml_ { double *n; size_t nmax; } SHNorml; SHNorml *sharmonics_normalization_new (const size_t nmax, const SHNormType type); void sharmonics_normalization_free (SHNorml *wn); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_harmonics/sph_radial.c000066400000000000000000000037001514557770000311700ustar00rootroot00000000000000/* * Recursive computation of (arbitrary degree) spherical Bessel/Neumann/Hankel functions, * according to Gumerov and Duraiswami, * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions", * Elsevier, 2005. * * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria * http://iem.at/Members/zotter, 2007. * * This code is published under the Gnu General Public License, see * the "LICENSE" file. */ #include #include #include "sph_radial.h" #define EPS 1e-10 static void radialRecurrence (double x, double *y, int n); // the two recurrences for higher n: // by now no numeric stabilization for the bessel function is performed static void radialRecurrence (double x, double *y, int n) { int k; for (k=1; k=0) { y[0] = (x=1) { y[1] = -cos(x)/x + y[0]/x; } radialRecurrence (x,y,n); } void sphNeumann (double x, double *y, int n) { if (y==0) { return; } if (n>=0) { y[0] = -cos(x)/x; } if (n>=1) { y[1] = ((x #include #include "iemmatrix.h" #define SQRT2 1.4142135623730951 typedef struct _matrix_ { size_t size1; size_t size2; double *data; } matrix; static matrix *matrix_calloc(size_t size1, size_t size2) { matrix *_matrix = (matrix *)malloc(sizeof(matrix)); if (_matrix == NULL) { return NULL; } _matrix->size1 = size1; _matrix->size2 = size2; _matrix->data = (double *)calloc(size1 * size2, sizeof(double)); if (_matrix->data == NULL) { free(_matrix); return NULL; } return _matrix; } static double matrix_get(matrix *matrix_, size_t i, size_t j) { return matrix_->data[i * matrix_->size2 + j]; } static void matrix_set_(matrix *matrix_, size_t i, size_t j, double value) { matrix_->data[i * matrix_->size2 + j] = value; } static matrix *matrix_free_(matrix *matrix_) { if (matrix_ != NULL) { if (matrix_->data != NULL) { free(matrix_->data); } free(matrix_); } return NULL; } typedef struct _ivanic_s_ { matrix *R; matrix *Rz_alpha; matrix *Rz_beta; matrix *Rz_gamma; matrix *ping; matrix *pong; size_t N; } ivanic_s; static void mat_mul_three(matrix *A, matrix *B, matrix *C, matrix *temp, matrix *result) { size_t i, j, k; for (i = 0; i < A->size1; ++i) { for (j = 0; j < B->size2; ++j) { double sum = 0.0; for (k = 0; k < A->size2; ++k) { sum += matrix_get(A, i, k) * matrix_get(B, k, j); } matrix_set_(temp, i, j, sum); } } for (i = 0; i < temp->size1; ++i) { for (j = 0; j < C->size2; ++j) { double sum = 0.0; for (k = 0; k < temp->size2; ++k) { sum += matrix_get(temp, i, k) * matrix_get(C, k, j); } matrix_set_(result, i, j, sum); } } } static void fill_Rz(matrix *Rz, double cosx, double sinx) { matrix_set_(Rz, 0, 0, cosx); matrix_set_(Rz, 0, 2, sinx); matrix_set_(Rz, 1, 1, 1.0); matrix_set_(Rz, 2, 0, -sinx); matrix_set_(Rz, 2, 2, cosx); } static void fill_Ry(matrix *Ry, double cosx, double sinx) { matrix_set_(Ry, 0, 0, 1.0); matrix_set_(Ry, 1, 1, cosx); matrix_set_(Ry, 1, 2, -sinx); matrix_set_(Ry, 2, 1, sinx); matrix_set_(Ry, 2, 2, cosx); } static ivanic_s *ivanic_s_new(size_t N) { ivanic_s *s = (ivanic_s *)malloc(sizeof(ivanic_s)); if (s == NULL) return NULL; s->N = N; int l = (N + 1) * (N + 1); s->R = matrix_calloc(l, l); s->Rz_alpha = matrix_calloc(3, 3); s->Rz_beta = matrix_calloc(3, 3); s->Rz_gamma = matrix_calloc(3, 3); s->ping = matrix_calloc(3, 3); s->pong = matrix_calloc(3, 3); matrix *matrices[] = {s->R, s->Rz_alpha, s->Rz_beta, s->Rz_gamma, s->ping, s->pong}; for (int i = 0; i < 6; ++i) { if (matrices[i] == NULL) { for (int j = 0; j < i; ++j) matrix_free_(matrices[j]); free(s); return NULL; } } return s; } static void ivanic_s_free(ivanic_s *s) { if (s == NULL) return; matrix *matrices[] = {s->R, s->Rz_alpha, s->Rz_beta, s->Rz_gamma, s->ping, s->pong}; for (int i = 0; i < 6; ++i) { if (matrices[i] != NULL) matrix_free_(matrices[i]); } free(s); } static double P(int i, int l, int mu, int m_prime, matrix *R, int R_lm1_offset) { i += 2; // shift i by 2 to skip R0 mu += l - 1 + R_lm1_offset; int m_prime_lm1 = m_prime + l - 1 + R_lm1_offset; int twolm2 = 2 * l - 2 + R_lm1_offset; if (abs(m_prime) < l) { return matrix_get(R, i, 2) * matrix_get(R, mu, m_prime_lm1); } if (m_prime == l) { return matrix_get(R, i, 3) * matrix_get(R, mu, twolm2) - matrix_get(R, i, 1 + 0) * matrix_get(R, mu, R_lm1_offset); } return matrix_get(R, i, 3) * matrix_get(R, mu, R_lm1_offset) + matrix_get(R, i, 1 + 0) * matrix_get(R, mu, twolm2); } static double U(int l, int m1, int m2, matrix *R, int R_lm1_offset) { return P(0, l, m1, m2, R, R_lm1_offset); } static double V(int l, int m1, int m2, matrix *R, int R_lm1_offset) { if (m1 == 0) { return P(1, l, 1, m2, R, R_lm1_offset) + P(-1, l, -1, m2, R, R_lm1_offset); } if (m1 == 1) { return SQRT2 * P(1, l, 0, m2, R, R_lm1_offset); } if (m1 == -1) { return SQRT2 * P(-1, l, 0, m2, R, R_lm1_offset); } if (m1 > 0) { return P(1, l, m1 - 1, m2, R, R_lm1_offset) - P(-1, l, -m1 + 1, m2, R, R_lm1_offset); } else { return P(1, l, m1 + 1, m2, R, R_lm1_offset) + P(-1, l, -m1 - 1, m2, R, R_lm1_offset); } } static double W(int l, int m1, int m2, matrix *R, int R_lm1_offset) { if (m1 > 0) { return P(1, l, m1 + 1, m2, R, R_lm1_offset) + P(-1, l, -m1 - 1, m2, R, R_lm1_offset); } if (m1 < 0) { return P(1, l, m1 - 1, m2, R, R_lm1_offset) - P(-1, l, -m1 + 1, m2, R, R_lm1_offset); } return NAN; } static void uvw(double buffer[3], int l, int m1, int m2) { static double denom; static const double one_half = 0.5; int abs_m1 = abs(m1); int m1_is_zero = (m1 == 0); if (abs(m2) < l) { denom = (double)((l + m2) * (l - m2)); } else { denom = (double)((l << 1) * ((l << 1) - 1)); } int u_num = (l + m1) * (l - m1); int v_num = (1 + m1_is_zero) * (l + abs_m1 - 1) * (l + abs_m1); int w_num = (l - abs_m1 - 1) * (l - abs_m1); buffer[0] = sqrt((double)u_num / denom); buffer[1] = one_half * sqrt((double)v_num / denom) * (double)(1 - 2 * m1_is_zero); buffer[2] = -one_half * sqrt((double)w_num / denom) * (double)(1 - m1_is_zero); } void ivanic_ruedenberg_rotation_matrix(ivanic_s *s, double alpha, double beta, double gamma) { static double uvw_buffer[3]; double cos_alpha = cos(alpha); double sin_alpha = sin(alpha); double cos_beta = cos(beta); double sin_beta = sin(beta); double cos_gamma = cos(gamma); double sin_gamma = sin(gamma); // Rz_alpha fill_Rz(s->Rz_alpha, cos_alpha, sin_alpha); // Rz_beta fill_Ry(s->Rz_beta, cos_beta, sin_beta); // Rz_gamma fill_Rz(s->Rz_gamma, cos_gamma, sin_gamma); mat_mul_three(s->Rz_alpha, s->Rz_beta, s->Rz_gamma, s->ping, s->pong); for (size_t i = 0; i < 3; ++i) { for (size_t j = 0; j < 3; ++j) { matrix_set_(s->R, i + 1, j + 1, matrix_get(s->pong, i, j)); } } int n_start; matrix_set_(s->R, 0, 0, 1.0); if (s->N <= 1) { return; } int R_lm1_offset; int m1, m2; double u_val, v_val, w_val; for (size_t n = 2; n <= s->N; ++n) { n_start = n * n + n; R_lm1_offset = (n - 1) * (n - 1); for (m1 = -(int)n; m1 <= (int)n; ++m1) { for (m2 = -(int)n; m2 <= (int)n; ++m2) { u_val = 0.0; v_val = 0.0; w_val = 0.0; uvw(uvw_buffer, n, m1, m2); // ------ U ------ if (fabs(uvw_buffer[0]) > 1e-15) { u_val = uvw_buffer[0] * U(n, m1, m2, s->R, R_lm1_offset); } // ------- V ------ if (fabs(uvw_buffer[1]) > 1e-15) { v_val = uvw_buffer[1] * V(n, m1, m2, s->R, R_lm1_offset); } // ------- W ------ if (fabs(uvw_buffer[2]) > 1e-15) { w_val = uvw_buffer[2] * W(n, m1, m2, s->R, R_lm1_offset); } matrix_set_(s->R, n_start + m1, n_start + m2, u_val + v_val + w_val); } } } } typedef struct _mtx_spherical_harmonics_rotator_ { t_object x_obj; t_outlet *list_rot_out; t_atom *list_rot; ivanic_s *ivanic; double alpha; double beta; double gamma; } t_mtx_spherical_harmonics_rotator; static t_class *mtx_spherical_harmonics_rotator_class; static t_mtx_spherical_harmonics_rotator *mtx_spherical_harmonics_rotator_new(t_symbol *s, int argc, t_atom *argv) { (void)s; // To suppress unused variable warning int N; t_mtx_spherical_harmonics_rotator *x = (t_mtx_spherical_harmonics_rotator *)pd_new(mtx_spherical_harmonics_rotator_class); x->list_rot_out = outlet_new(&x->x_obj, gensym("matrix")); if (argc < 1) { N = 1; } if (argc >= 1) { N = (int)atom_getfloat(argv); if (N < 0) { N = 0; } x->ivanic = ivanic_s_new((size_t)N); } x->list_rot = (t_atom *)calloc((size_t)pow((N + 1), 4) + 2, sizeof(t_atom)); x->alpha = 0.0; x->beta = 0.0; x->gamma = 0.0; return (void *)x; } static void mtx_spherical_harmonics_rotator_free(t_mtx_spherical_harmonics_rotator *x) { if (x->list_rot) { free(x->list_rot); } if (x->ivanic) { ivanic_s_free(x->ivanic); } } static void mtx_spherical_harmonics_rotator_bang(t_mtx_spherical_harmonics_rotator *x) { if (x->list_rot != 0) { outlet_anything(x->list_rot_out, gensym("matrix"), (size_t)pow((x->ivanic->N + 1), 4) + 2, x->list_rot); } } static void mtx_spherical_harmonics_rotator_list(t_mtx_spherical_harmonics_rotator *x, t_symbol *s, int argc, t_atom *argv) { (void)s; size_t num_harmonics, n; if (argc >= 1) { x->alpha = atom_getfloat(argv + 0); } if (argc >= 2) { x->beta = atom_getfloat(argv + 1); } if (argc >= 3) { x->gamma = atom_getfloat(argv + 2); } ivanic_ruedenberg_rotation_matrix(x->ivanic, x->alpha, x->beta, x->gamma); num_harmonics = (size_t)((x->ivanic->N + 1) * (x->ivanic->N + 1)); SETFLOAT(x->list_rot, (t_float)num_harmonics); SETFLOAT(x->list_rot + 1, (t_float)num_harmonics); for (n = 0; n < num_harmonics * num_harmonics; ++n) { SETFLOAT(x->list_rot + n + 2, (t_float)x->ivanic->R->data[n]); } mtx_spherical_harmonics_rotator_bang(x); } void mtx_spherical_harmonics_rotator_setup(void) { mtx_spherical_harmonics_rotator_class = class_new( gensym("mtx_spherical_harmonics_rotator"), (t_newmethod)mtx_spherical_harmonics_rotator_new, (t_method)mtx_spherical_harmonics_rotator_free, sizeof(t_mtx_spherical_harmonics_rotator), CLASS_DEFAULT, A_GIMME, 0); class_addbang(mtx_spherical_harmonics_rotator_class, (t_method)mtx_spherical_harmonics_rotator_bang); class_addlist(mtx_spherical_harmonics_rotator_class, (t_method)mtx_spherical_harmonics_rotator_list); } void iemtx_spherical_harmonics_rotator_setup(void) { mtx_spherical_harmonics_rotator_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_spherical_radial.c000066400000000000000000000113151514557770000263340ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * this functions depends on the GNU scientific library * * Copyright (c) 2009, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include #include "mtx_spherical_harmonics/sph_radial.h" static t_class *mtx_spherical_radial_class; typedef struct _MTXSph_ MTXSph; struct _MTXSph_ { t_object x_obj; t_outlet *list_h_re_out; t_outlet *list_h_im_out; t_atom *list_h_re; t_atom *list_h_im; double *kr; double *h_re; double *h_im; size_t nmax; size_t l; }; static void allocMTXSphdata (MTXSph *x) { x->kr=(double*)calloc(x->l,sizeof(double)); if (x->list_h_re_out!=0) { x->list_h_re=(t_atom*)calloc(x->l*(x->nmax+1)+2,sizeof(t_atom)); x->h_re=(double*)calloc(x->l*(x->nmax+1),sizeof(double)); } if (x->list_h_im_out!=0) { x->list_h_im=(t_atom*)calloc(x->l*(x->nmax+1)+2,sizeof(t_atom)); x->h_im=(double*)calloc(x->l*(x->nmax+1),sizeof(double)); } } static void deleteMTXSphdata (MTXSph *x) { if (x->kr!=0) { free(x->kr); } if (x->h_re!=0) { free(x->h_re); } if (x->h_im!=0) { free(x->h_im); } if (x->list_h_re!=0) { free(x->list_h_re); } if (x->list_h_im!=0) { free(x->list_h_im); } x->list_h_re=0; x->list_h_im=0; x->h_re=0; x->h_im=0; x->kr=0; } static void *newMTXSph (t_symbol *s, int argc, t_atom *argv) { int nmax; char whichfunction = 'j'; t_symbol *fsym = 0; MTXSph *x = (MTXSph *) pd_new (mtx_spherical_radial_class); (void)s; /* unused */ x->list_h_re = 0; x->list_h_im = 0; x->list_h_im_out = 0; x->list_h_re_out = 0; x->kr = 0; x->h_re = 0; x->h_im = 0; x->l=0; if(argc) fsym=atom_getsymbol(argv); if (fsym && fsym->s_name!=0) { whichfunction=fsym->s_name[0]; } switch (whichfunction) { default: case 'J': case 'j': x->list_h_re_out = outlet_new (&x->x_obj, gensym("matrix")); break; case 'H': case 'h': x->list_h_re_out = outlet_new (&x->x_obj, gensym("matrix")); /* coverity[unterminated_case]: H has both real&imag outlet */ /* fall through */ case 'Y': case 'y': x->list_h_im_out = outlet_new (&x->x_obj, gensym("matrix")); } nmax=(int) atom_getfloat(argv+1); if (nmax<0) { nmax=0; } x->nmax=nmax; return ((void *) x); } static void mTXSphBang (MTXSph *x) { if (x->list_h_im!=0) { outlet_anything(x->list_h_im_out, gensym("matrix"), x->l*(x->nmax+1)+2, x->list_h_im); } if (x->list_h_re!=0) { outlet_anything(x->list_h_re_out, gensym("matrix"), x->l*(x->nmax+1)+2, x->list_h_re); } } static void mTXSphMatrix (MTXSph *x, t_symbol *s, int argc, t_atom *argv) { unsigned int rows, columns; unsigned int n,ofs; /* size check */ if(iemmatrix_check(x, s, argc, argv, 0))return; rows=atom_getint(argv++); columns=atom_getint(argv++); if ((rows!=1)||(columns<1)) { pd_error(x, "[mtx_spherical_radial]: 1*L matrix expected with kr and h vector, but got more rows/no entries"); return; } if (x->l!=columns) { deleteMTXSphdata(x); x->l=columns; allocMTXSphdata(x); } for (n=0; nl; n++) { x->kr[n]=(double) atom_getfloat(argv+n); } if (x->h_re!=0) for (n=0,ofs=0; nl; n++,ofs+=x->nmax+1) { sphBessel(x->kr[n], x->h_re+ofs, x->nmax); } if (x->h_im!=0) for (n=0,ofs=0; nl; n++,ofs+=x->nmax+1) { sphNeumann(x->kr[n], x->h_im+ofs, x->nmax); } if (x->h_re!=0) { SETFLOAT(x->list_h_re+1,(t_float)(x->nmax+1)); SETFLOAT(x->list_h_re,(t_float)x->l); for (n=0; nl*(x->nmax+1); n++) { SETFLOAT(x->list_h_re+n+2,(t_float)x->h_re[n]); } } if (x->h_im!=0) { SETFLOAT(x->list_h_im+1,(t_float)(x->nmax+1)); SETFLOAT(x->list_h_im,(t_float)x->l); for (n=0; nl*(x->nmax+1); n++) { SETFLOAT(x->list_h_im+n+2,(t_float)x->h_im[n]); } } mTXSphBang(x); } void mtx_spherical_radial_setup (void) { mtx_spherical_radial_class = class_new (gensym("mtx_spherical_radial"), (t_newmethod) newMTXSph, (t_method) deleteMTXSphdata, sizeof (MTXSph), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_spherical_radial_class, (t_method) mTXSphBang); class_addmethod (mtx_spherical_radial_class, (t_method) mTXSphMatrix, gensym("matrix"), A_GIMME,0); } void iemtx_spherical_radial_setup(void) { mtx_spherical_radial_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_sqrt.c000066400000000000000000000012211514557770000240320ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_sqrt: B=sqrt(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return sqrtf(f); #else return sqrt(f); #endif } void mtx_sqrt_setup(void) { iemmatrix_unop_setup("mtx_sqrt", 0, unop, (char*)0); } void iemtx_sqrt_setup(void) { mtx_sqrt_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_sub.c000066400000000000000000000011211514557770000236310ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" static t_float binop(t_float f1, t_float f2) { return f1-f2; } void mtx_sub_setup(void) { iemmatrix_binop_setup("mtx_sub", 0, binop, "mtx_-", (char*)0); } void iemtx_sub_setup(void) { mtx_sub_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_sum.c000066400000000000000000000035031514557770000236520ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_sum */ /* column-wise sum */ static t_class *mtx_sum_class; static void mtx_sum_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row, col; int n; t_atom *ap = 0, *dummy=0; if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getint(argv++); col=atom_getint(argv++); dummy = ap = (t_atom *)getbytes(col * sizeof(t_atom)); for(n=0; nx_obj.ob_outlet, gensym("prod"), col, ap); freebytes(ap, (col * sizeof(t_atom))); } static void mtx_sum_list(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { t_float f=0.f; (void)s; /* unused */ while(argc--) { f+=atom_getfloat(argv++); } outlet_float(x->x_obj.ob_outlet, f); } static void *mtx_sum_new(void) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_sum_class); outlet_new(&x->x_obj, 0); x->m.row = x->m.col = 0; x->m.atombuffer = 0; return (x); } void mtx_sum_setup(void) { mtx_sum_class = class_new(gensym("mtx_sum"), (t_newmethod)mtx_sum_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist (mtx_sum_class, mtx_sum_list); class_addmethod(mtx_sum_class, (t_method)mtx_sum_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_sum_setup(void) { mtx_sum_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_svd.c000066400000000000000000000123441514557770000236450ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * this functions depends on the GNU scientific library * * Copyright (c) 2009, Franz Zotter * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #include "iemmatrix_stub.h" #include #ifdef HAVE_LIBGSL # include #else # include "stub/gsl.h" #endif IEMMATRIX_DECLARE_ALLOCFREE_STUB(my_vector); IEMMATRIX_DECLARE_ALLOCFREE2_STUB(my_matrix); typedef int(*t_linalg_SV_decomp)(gsl_matrix*, gsl_matrix*, gsl_vector*, gsl_vector*); static t_linalg_SV_decomp my_linalg_SV_decomp = 0; static int have_gsl = 0; static t_class *mtx_svd_class; typedef struct _MTXSvd_ MTXSvd; struct _MTXSvd_ { t_object x_obj; gsl_matrix *u; gsl_vector *s; gsl_matrix *v; gsl_vector *w; t_outlet *list_u_out; t_outlet *list_s_out; t_outlet *list_v_out; t_atom *list_u; t_atom *list_s; t_atom *list_v; int rows; int columns; }; static void allocMTXusvw (MTXSvd *x) { if(have_gsl) { x->u=(gsl_matrix*)my_matrix_alloc(x->rows,x->columns); x->s=(gsl_vector*)my_vector_alloc(x->columns); x->v=(gsl_matrix*)my_matrix_alloc(x->columns,x->columns); x->w=(gsl_vector*)my_vector_alloc(x->columns); x->list_u=(t_atom*)calloc(x->rows*x->columns+2, sizeof(t_atom)); x->list_s=(t_atom*)calloc(x->columns, sizeof(t_atom)); x->list_v=(t_atom*)calloc(x->columns*x->columns+2, sizeof(t_atom)); } } static void deleteMTXusvw (MTXSvd *x) { if (x->list_u!=0) { free(x->list_u); } if (x->list_s!=0) { free(x->list_s); } if (x->list_v!=0) { free(x->list_v); } x->list_u = x->list_s = x->list_v = 0; if(have_gsl) { if (x->u!=0) { my_matrix_free(x->u); } if (x->s!=0) { my_vector_free(x->s); } if (x->v!=0) { my_matrix_free(x->v); } if (x->w!=0) { my_vector_free(x->w); } } x->u = 0; x->s = 0; x->v = 0; x->w = 0; } static void deleteMTXSvd (MTXSvd *x) { deleteMTXusvw(x); } static void *newMTXSvd (t_symbol *s, int argc, t_atom *argv) { MTXSvd *x = (MTXSvd *) pd_new (mtx_svd_class); (void)argc; (void)argv; /* unused */ x->list_u_out = outlet_new (&x->x_obj, gensym("matrix")); x->list_s_out = outlet_new (&x->x_obj, gensym("list")); x->list_v_out = outlet_new (&x->x_obj, gensym("matrix")); if (!have_gsl) { static int warn_gsl = 1; if(warn_gsl) #ifdef HAVE_LIBGSL pd_error(x, "[%s] couldn't find (recent enough) GSL", s->s_name); #else pd_error(x, "[%s] compiled without GSL", s->s_name); #endif warn_gsl = 0; } return ((void *) x); } static void mTXSvdBang (MTXSvd *x) { if (x->list_u) { outlet_anything(x->list_v_out, gensym("matrix"), x->columns*x->columns+2, x->list_v); outlet_anything(x->list_s_out, gensym("list"), x->columns, x->list_s); outlet_anything(x->list_u_out, gensym("matrix"), x->rows*x->columns+2, x->list_u); } } static void mTXSvdMatrix (MTXSvd *x, t_symbol *s, int argc, t_atom *argv) { int rows, columns, size; int n; if(iemmatrix_check(x, s, argc, argv, 0))return; rows = atom_getint (argv++); columns = atom_getint (argv++); size=rows*columns; if(!have_gsl) return; /* size check */ if (rowsrows=rows; x->columns=columns; deleteMTXusvw(x); allocMTXusvw(x); for (n=0; nu->data[n]=(double) atom_getfloat(argv++); } my_linalg_SV_decomp(x->u,x->v,x->s,x->w); SETFLOAT((x->list_u),(float) x->rows); SETFLOAT((x->list_u+1),(float) x->columns); for (n=0; nlist_u+2+n), (float) x->u->data[n]); } for (n=0; ncolumns; n++) { SETFLOAT((x->list_s+n),(float) x->s->data[n]); } SETFLOAT((x->list_v),(float) x->columns); SETFLOAT((x->list_v+1),(float) x->columns); size=x->columns*x->columns; for (n=0; nlist_v+n+2), (float) x->v->data[n]); } mTXSvdBang(x); } void mtx_svd_setup (void) { mtx_svd_class = class_new (gensym("mtx_svd"), (t_newmethod) newMTXSvd, (t_method) deleteMTXSvd, sizeof (MTXSvd), CLASS_DEFAULT, A_GIMME, 0); class_addbang (mtx_svd_class, (t_method) mTXSvdBang); class_addmethod (mtx_svd_class, (t_method) mTXSvdMatrix, gensym("matrix"), A_GIMME,0); #ifdef HAVE_LIBGSL my_matrix_alloc = iemmatrix_get_stub("gsl_matrix_alloc", mtx_svd_class); my_matrix_free = iemmatrix_get_stub("gsl_matrix_free", mtx_svd_class); my_vector_alloc = iemmatrix_get_stub("gsl_vector_complex_alloc", mtx_svd_class); my_vector_free = iemmatrix_get_stub("gsl_vector_complex_free", mtx_svd_class); my_linalg_SV_decomp = iemmatrix_get_stub("gsl_linalg_SV_decomp", mtx_svd_class); #endif have_gsl = ( my_matrix_alloc && my_matrix_free && my_vector_alloc && my_vector_free && my_linalg_SV_decomp ); } void iemtx_svd_setup(void) { mtx_svd_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_tan.c000066400000000000000000000012111514557770000236220ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_tan: B=tan(A); */ static t_float unop(t_float f) { #if PD_FLOATSIZE == 32 return tanf(f); #else return tan(f); #endif } void mtx_tan_setup(void) { iemmatrix_unop_setup("mtx_tan", 0, unop, (char*)0); } void iemtx_tan_setup(void) { mtx_tan_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_trace.c000066400000000000000000000030261514557770000241440ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_trace */ static t_class *mtx_trace_class; typedef struct _mtx_trace { t_object x_obj; t_float trace; } t_mtx_trace; static void mtx_trace_bang(t_mtx_trace *x) { outlet_float(x->x_obj.ob_outlet, x->trace); } static void mtx_trace_matrix(t_mtx_trace *x, t_symbol *s, int argc, t_atom *argv) { int row, col, length; t_float trace = 0; if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getint(argv+0); col=atom_getint(argv+1); length=(coltrace=trace; mtx_trace_bang(x); } static void *mtx_trace_new() { t_mtx_trace *x = (t_mtx_trace *)pd_new(mtx_trace_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_trace_setup(void) { mtx_trace_class = class_new(gensym("mtx_trace"), (t_newmethod)mtx_trace_new, 0, sizeof(t_mtx_trace), 0, 0); class_addbang (mtx_trace_class, mtx_trace_bang); class_addmethod(mtx_trace_class, (t_method)mtx_trace_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_trace_setup(void) { mtx_trace_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_transpose.c000066400000000000000000000033141514557770000250640ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_transpose */ static t_class *mtx_transpose_class; static void mtx_transpose_matrix(t_matrixobj *x, t_symbol *s, int argc, t_atom *argv) { int row, col; t_atom *ap; int r, c; if(iemmatrix_check(x, s, argc, argv, 0))return; row=atom_getint(argv+0); col=atom_getint(argv+1); if (col*row!=x->m.col*x->m.row) { freebytes(x->m.atombuffer, (x->m.col*x->m.row+2)*sizeof(t_atom)); x->m.atombuffer = (t_atom *)getbytes((row*col+2)*sizeof(t_atom)); } ap = x->m.atombuffer+2; setdimen(&x->m, col, row); r = row; while(r--) { c=col; while(c--) { t_float f = atom_getfloat(argv+2+r*col+c); SETFLOAT(ap+c*row+r, f); } } matrixobj_bang(x); } static void *mtx_transpose_new() { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_transpose_class); outlet_new(&x->x_obj, 0); return (x); } void mtx_transpose_setup(void) { mtx_transpose_class = class_new(gensym("mtx_transpose"), (t_newmethod)mtx_transpose_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, 0); class_addbang (mtx_transpose_class, matrixobj_bang); class_addmethod(mtx_transpose_class, (t_method)mtx_transpose_matrix, gensym("matrix"), A_GIMME, 0); } void iemtx_transpose_setup(void) { mtx_transpose_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_unpack~.c000066400000000000000000000177521514557770000245400ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) 2008, Franz Zotter, IEM KUG Graz Austria * Copyright (c) IOhannes m zmölnig, forum::für::umläute, IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" #define MTX_PACK_MAXCHANNELS 200 #ifndef CLASS_MULTICHANNEL # define CLASS_MULTICHANNEL 0 #endif typedef void (*setmultiout_f)(t_signal **sig, int nchans); static t_class *mtx_unpack_tilde_class; static t_class *mtx_unpack_tilde_proxy; typedef struct _proxy { t_object p_obj; struct _mtx_unpack_tilde*p_owner; } t_proxy; typedef struct _mtx_unpack_tilde { t_object x_obj; t_proxy *x_proxy; int x_dsp; /* whether DSP is currently running */ unsigned int rows, cols; unsigned int block_size; unsigned int num_chan, num_ports; t_float **sig_out; t_atom *list_in; t_int *(*perform_fcn)(t_int*); /* when doing multichannel, this is Pd>=0.54's signal_setmultiout(); otherwise NULL */ setmultiout_f x_setmultiout; } mtx_unpack_tilde; static void proxy_dspstopped(t_proxy*p) { p->p_owner->x_dsp = 0; } static t_int *mtx_unpack_Perform (t_int *arg) { mtx_unpack_tilde *x = (mtx_unpack_tilde *) (arg[1]); return (x->perform_fcn(arg)); } static t_int *mtx_unpack_PerformInactive (t_int *arg) { return(arg+2); } static t_int *mtx_unpack_PerformSetInactive (t_int *arg) { mtx_unpack_tilde *x = (mtx_unpack_tilde *) (arg[1]); unsigned int chan; unsigned int samp; t_atom *lptr=x->list_in; for (chan=0; channum_chan; chan++) { for (samp=0; sampblock_size; samp++) { x->sig_out[chan][samp]=0; } lptr+=x->cols; } x->perform_fcn=mtx_unpack_PerformInactive; return(arg+2); } static t_int *mtx_unpack_PerformActive (t_int *arg) { mtx_unpack_tilde *x = (mtx_unpack_tilde *) (arg[1]); unsigned int chan; unsigned int samp; const unsigned int maxchan = (x->rows < x->num_chan) ? x->rows : x->num_chan; const unsigned int maxsamp = (x->cols < x->block_size) ? x->cols : x->block_size; t_atom *lptr=x->list_in; for (chan=0; chansig_out[chan][samp]=atom_getfloat(&lptr[samp]); } lptr+=x->cols; } // zero missing signal samples lptr=x->list_in; for (chan=0; chanblock_size; samp++) { x->sig_out[chan][samp]=0; lptr+=x->cols; } } // zero missing channels for (chan=maxchan; channum_chan; chan++) { for (samp=0; sampblock_size; samp++) { x->sig_out[chan][samp]=0; } lptr+=x->cols; } // delete in the next dsp cycle, unless overwritten // by new matrix: x->perform_fcn=mtx_unpack_PerformSetInactive; return(arg+2); } void *mtx_unpack_new (t_symbol*s, int argc, t_atom*argv) { setmultiout_f setmultiout = (CLASS_MULTICHANNEL)?iemmatrix_getpdfun("signal_setmultiout"):0; int want_multi = 0; int num_chan=(int)1; mtx_unpack_tilde *x = 0; /* args: - (none): single-signal, n=1 - : single-signal, n=N - '-m': multi-signal, n=? - '-m : multi-signal, n=N */ if(argc && A_SYMBOL == argv->a_type) { if (atom_getsymbol(argv) == gensym("-m")) { want_multi = 1; argc--; argv++; } else { goto usage; } } if(argc && A_FLOAT != argv->a_type) { goto usage; } if(argc) num_chan = (int)atom_getfloat(argv); x = (mtx_unpack_tilde*) pd_new(mtx_unpack_tilde_class); /* DSP stopped proxy */ x->x_proxy = (t_proxy*)pd_new(mtx_unpack_tilde_proxy); x->x_proxy->p_owner = x; pd_bind(&x->x_proxy->p_obj.ob_pd, gensym("pd-dsp-stopped")); /* check multichannel support */ if(want_multi) { static int warn_multichannel = 1; x->x_setmultiout = setmultiout; if (warn_multichannel && !setmultiout) { if(CLASS_MULTICHANNEL) { int major, minor, bugfix; sys_getversion(&major, &minor, &bugfix); pd_error(x, "[%s] multichannel requested, but iemmatrix is running in Pd-%d.%d-%d, which doesn't support it", s->s_name, major, minor, bugfix); } else { pd_error(x, "[%s] multichannel requested, but iemmatrix was built against Pd-%d.%d-%d, which doesn't support it", s->s_name, PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION); } } warn_multichannel = 0; } if ((num_chan<1) || (num_chan>MTX_PACK_MAXCHANNELS)) { if(!want_multi) { /* when not doing multichannel, we require a valid channel count * and error out otherwise */ /* however, suppress the error in help-patches */ const char*absname = iemmatrix_parentabstractionname(0); if(absname) { char*absext = strrchr(absname, '-'); if (absext && !strcmp(absext, "-help.pd")) { /* the object lives in a help-patch: suppress error */ } else { absname = 0; } } if(!absname) pd_error(x, "[mtx_unpack~] invalid number of channels (%d), default to 1.", num_chan); } num_chan=1; } x->perform_fcn=mtx_unpack_PerformInactive; x->rows = num_chan; x->num_chan= ((want_multi && !x->x_setmultiout)?1:num_chan); x->num_ports = (want_multi?1:num_chan); x->sig_out = (t_float**)getbytes(sizeof(t_float*)*x->num_chan); num_chan = x->num_ports; while (num_chan--) { outlet_new(&x->x_obj, &s_signal); } return (void *) x; usage: pd_error(0, "[mtx_unpack~] bad arguments, use '' or '-m '"); return 0; } void mtx_unpack_delete (mtx_unpack_tilde *x) { if (x->sig_out) { freebytes (x->sig_out, x->num_chan * sizeof (t_float)); } if(x->x_proxy) { pd_unbind(&x->x_proxy->p_obj.ob_pd, gensym("pd-dsp-stopped")); pd_free(&x->x_proxy->p_obj.ob_pd); } } static void mtx_unpack_matrix (mtx_unpack_tilde *x, t_symbol *s, int argc, t_atom *argv) { int rows, cols; if(iemmatrix_check(x, s, argc, argv, 0))return; rows=(int) atom_getfloat (argv++); cols=(int) atom_getfloat (argv++); argc-=2; x->rows=rows; x->cols=cols; x->list_in=argv; x->perform_fcn=mtx_unpack_PerformActive; } static void mtx_unpack_dsp (mtx_unpack_tilde *x, t_signal **sp) { unsigned int chan; x->x_dsp = 1; x->block_size=sp[0]->s_n; if(x->x_setmultiout) { #if CLASS_MULTICHANNEL if(x->rows != x->num_chan) { if (x->sig_out) { freebytes (x->sig_out, x->num_chan * sizeof (t_float)); } x->num_chan = x->rows; if(x->rows < 1) x->num_chan = 1; x->sig_out = (t_float**)getbytes(sizeof(t_float*)*x->num_chan); } /* create multichannel output */ x->x_setmultiout(&sp[0], x->num_chan); for(chan=0; channum_chan; chan++) { x->sig_out[chan] = sp[0]->s_vec + chan * x->block_size; } #else pd_error(x, "BUG: multichannel enabled but not compile-time multichannel support"); return; #endif } else { for (chan=0; channum_chan; chan++) { x->sig_out[chan]=sp[chan]->s_vec; } } x->perform_fcn=mtx_unpack_PerformInactive; dsp_add(mtx_unpack_Perform, 1, x); } void mtx_unpack_tilde_setup (void) { mtx_unpack_tilde_class = class_new(gensym("mtx_unpack~"), (t_newmethod)mtx_unpack_new, (t_method) mtx_unpack_delete, sizeof(mtx_unpack_tilde), CLASS_DEFAULT, A_GIMME, 0); class_addmethod (mtx_unpack_tilde_class, (t_method) mtx_unpack_matrix, gensym("matrix"),A_GIMME,0); class_addmethod (mtx_unpack_tilde_class, (t_method) mtx_unpack_dsp, gensym("dsp"), A_CANT, 0); mtx_unpack_tilde_proxy = class_new(gensym("mtx_unpack~ proxy"), 0, 0, sizeof(t_proxy), CLASS_PD, 0); class_addbang(mtx_unpack_tilde_proxy, (t_method)proxy_dspstopped); } void iemtx_unpack__setup(void) { mtx_unpack_tilde_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/mtx_zeros.c000066400000000000000000000030441514557770000242100ustar00rootroot00000000000000/* * iemmatrix * * objects for manipulating simple matrices * mostly referring to matlab/octave matrix functions * * Copyright (c) IOhannes m zmölnig, forum::für::umläute * IEM, Graz, Austria * * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * */ #include "iemmatrix.h" /* mtx_zeros */ static t_class *mtx_zeros_class; static void *mtx_zeros_new(t_symbol *s, int argc, t_atom *argv) { t_matrixobj *x = (t_matrixobj *)pd_new(mtx_zeros_class); int col=0, row=0; (void)s; /* unused */ outlet_new(&x->x_obj, 0); x->m.row = x->m.col = 0; x->m.atombuffer = 0; switch(argc) { case 0: break; case 1: col=row=atom_getfloat(argv); break; default: row=atom_getfloat(argv++); col=atom_getfloat(argv); } if(col<0) { col=0; } if(row<0) { row=0; } if (col && row) { x->m.atombuffer = (t_atom *)getbytes((col*row+2)*sizeof(t_atom)); setdimen(&x->m, row, col); matrix_set(&x->m, 0); } return (x); } void mtx_zeros_setup(void) { mtx_zeros_class = class_new(gensym("mtx_zeros"), (t_newmethod)mtx_zeros_new, (t_method)matrixobj_free, sizeof(t_matrixobj), 0, A_GIMME, 0); class_addlist(mtx_zeros_class, matrixobj_zeros); class_addbang(mtx_zeros_class, matrixobj_bang); class_addmethod(mtx_zeros_class, (t_method)matrixobj_zeros, gensym("matrix"), A_GIMME, 0); } void iemtx_zeros_setup(void) { mtx_zeros_setup(); } iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/000077500000000000000000000000001514557770000227665ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/Make.stublibs000066400000000000000000000070721514557770000254220ustar00rootroot00000000000000##################################################################### # STUB LIBRARIES # this is a makefile snippet (to be included by the main Makefile # it depends on pd-lib-builder,... # stub-libraries help with weak linking against some optional libraries # - dylink against their stubbed library # - can be dlopen()ed # - have a well-known name and path # - stub-libraries provide the addresses of (some) symbols in the stubbed library ifneq ($(filter %.$(shared.extension), .$(extension)), ) # $(extension) already ends with $(shared.extension), no need to duplicate it shared.fullextension = $(extension) else shared.fullextension = $(extension).$(shared.extension) endif c.flags += -DSHARED_LIBRARY_EXTENSION='"$(shared.fullextension)"' lib$(lib.name)Stub_%.$(shared.fullextension): src/stub/%.$(object.extension) $(info ++++ info: linking stub library $@: $<, $(c.ldlibs), $(shared.ldlibs), $(stub.ldlibs)) $(compile-c) $(shared.ldflags) -o $@ $< $(c.ldlibs) $(shared.ldlibs) $(stub.ldlibs) # sometimes dependencies for the stub libraries are not picked up correctly, # and the stub libraries are built with the default shared-library dependencies # (leaving out our stub object!) # listing each stub-library explicitly, seems to fix this... ¯\_(ツ)_/¯ # I don't know exactly when it happens; # at least I've seen this for # - Windows/.dll # - Linux/.Linux-amd64.32.so # however NOT for # - Linux/.pd_linux.so lib$(lib.name)Stub_fftw.$(extension).$(shared.extension): src/stub/fftw.$(object.extension) lib$(lib.name)Stub_fftwf.$(extension).$(shared.extension): src/stub/fftwf.$(object.extension) lib$(lib.name)Stub_gsl.$(extension).$(shared.extension): src/stub/gsl.$(object.extension) lib$(lib.name)Stub_sndfile.$(extension).$(shared.extension): src/stub/sndfile.$(object.extension) lib$(lib.name)Stub_fftw.$(extension): src/stub/fftw.$(object.extension) lib$(lib.name)Stub_fftwf.$(extension): src/stub/fftwf.$(object.extension) lib$(lib.name)Stub_gsl.$(extension): src/stub/gsl.$(object.extension) lib$(lib.name)Stub_sndfile.$(extension): src/stub/sndfile.$(object.extension) lib$(lib.name)Stub_fftw.$(shared.fullextension): stub.ldlibs = $(FFTW_LIBS) lib$(lib.name)Stub_fftwf.$(shared.fullextension): stub.ldlibs = $(FFTWF_LIBS) lib$(lib.name)Stub_sndfile.$(shared.fullextension): stub.ldlibs = $(SNDFILE_LIBS) lib$(lib.name)Stub_gsl.$(shared.fullextension): stub.ldlibs = $(GSL_LIBS) ## on macOS this is needed to properly set the install_name. ## on Linux, it is used to set the soname ## (on Windows it doesn't do anythng, at least if the correct linking rule is invoked) lib$(lib.name)Stub_fftw.$(shared.fullextension): shared.lib = lib$(lib.name)Stub_fftw.$(shared.fullextension) lib$(lib.name)Stub_fftwf.$(shared.fullextension): shared.lib = lib$(lib.name)Stub_fftwf.$(shared.fullextension) lib$(lib.name)Stub_sndfile.$(shared.fullextension): shared.lib = lib$(lib.name)Stub_sndfile.$(shared.fullextension) lib$(lib.name)Stub_gsl.$(shared.fullextension): shared.lib = lib$(lib.name)Stub_gsl.$(shared.fullextension) stub.libs = stub.libs += lib$(lib.name)Stub_fftw.$(shared.fullextension) stub.libs += lib$(lib.name)Stub_fftwf.$(shared.fullextension) stub.libs += lib$(lib.name)Stub_sndfile.$(shared.fullextension) stub.libs += lib$(lib.name)Stub_gsl.$(shared.fullextension) executables += $(stub.libs) .PHONY: stubs stubs: $(stub.libs) post: $(stub.libs) .PHONY: clean.stublibs clean: clean.stublibs clean.stublibs: rm -f $(stub.libs) rm -f $(stub.libs:%.$(shared.fullextension)=%.$(object.extension)) rm -f $(stub.libs:lib$(lib.name)Stub_%.$(shared.fullextension)=src/stub/%.$(object.extension)) iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/fftw.c000066400000000000000000000004251514557770000241010ustar00rootroot00000000000000#ifdef HAVE_FFTW #include #undef STUB #define STUB(x) \ void* iemmatrix_ ## x() { return x; } STUB(fftw_malloc); STUB(fftw_free); STUB(fftw_plan_dft_1d); STUB(fftw_plan_dft_c2r_1d); STUB(fftw_plan_dft_r2c_1d); STUB(fftw_execute); STUB(fftw_destroy_plan); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/fftw.h000066400000000000000000000004121514557770000241020ustar00rootroot00000000000000#ifndef _iemmatrix_stub_fftw_h_ #define _iemmatrix_stub_fftw_h_ /* from fftw3.h */ typedef struct _fftw_plan_private_tag *fftw_plan; typedef float fftw_complex[2]; #ifndef FFTW_ESTIMATE # define FFTW_ESTIMATE (1U << 6) #endif #endif /* _iemmatrix_stub_fftw_h_ */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/fftwf.c000066400000000000000000000004351514557770000242500ustar00rootroot00000000000000#ifdef HAVE_FFTWF #include #undef STUB #define STUB(x) \ void* iemmatrix_ ## x() { return x; } STUB(fftwf_malloc); STUB(fftwf_free); STUB(fftwf_plan_dft_1d); STUB(fftwf_plan_dft_c2r_1d); STUB(fftwf_plan_dft_r2c_1d); STUB(fftwf_execute); STUB(fftwf_destroy_plan); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/fftwf.h000066400000000000000000000004201514557770000242470ustar00rootroot00000000000000#ifndef _iemmatrix_stub_fftwf_h_ #define _iemmatrix_stub_fftwf_h_ /* from fftw3.h */ typedef struct _fftwf_plan_private_tag *fftwf_plan; typedef float fftwf_complex[2]; #ifndef FFTW_ESTIMATE # define FFTW_ESTIMATE (1U << 6) #endif #endif /* _iemmatrix_stub_fftwf_h_ */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/gsl.c000066400000000000000000000014151514557770000237200ustar00rootroot00000000000000#ifdef HAVE_LIBGSL #include #include #include # undef STUB # define STUB(x) \ void* iemmatrix_##x() { return x; } STUB(gsl_sf_bessel_Jn); STUB(gsl_sf_bessel_Yn); STUB(gsl_eigen_nonsymm); STUB(gsl_eigen_nonsymm_alloc); STUB(gsl_eigen_nonsymm_free); STUB(gsl_eigen_nonsymmv); STUB(gsl_eigen_nonsymmv_alloc); STUB(gsl_eigen_nonsymmv_free); STUB(gsl_linalg_QR_decomp); STUB(gsl_linalg_QR_unpack); STUB(gsl_linalg_SV_decomp); STUB(gsl_matrix_alloc); STUB(gsl_matrix_complex_alloc); STUB(gsl_matrix_calloc); STUB(gsl_matrix_set); STUB(gsl_matrix_get); STUB(gsl_matrix_complex_free); STUB(gsl_matrix_free); STUB(gsl_vector_alloc); STUB(gsl_vector_complex_alloc); STUB(gsl_vector_complex_free); STUB(gsl_vector_free); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/gsl.h000066400000000000000000000022171514557770000237260ustar00rootroot00000000000000#ifndef _iemmatrix_stub_gsl_h_ #define _iemmatrix_stub_gsl_h_ #ifndef HAVE_LIBGSL typedef struct _gsl_complext_private_tag { double dat[2]; } gsl_complex; typedef struct _gsl_matrix_private_tag { size_t size1; size_t size2; size_t tda; double *data; void *block; int owner; } gsl_matrix; typedef struct _gsl_vector_private_tag { size_t size; size_t stride; double *data; void *block; int owner; } gsl_vector; typedef struct _gsl_matrix_complex_private_tag { size_t size1; size_t size2; size_t tda; double *data; void *block; int owner; } gsl_matrix_complex; typedef struct _gsl_vector_complex_private_tag { size_t size; size_t stride; double *data; void *block; int owner; } gsl_vector_complex; #ifndef GSL_VECTOR_REAL # define GSL_VECTOR_REAL(z, i) ((z)->data[2*(i)*(z)->stride + 0]) #endif #ifndef GSL_VECTOR_IMAG # define GSL_VECTOR_IMAG(z, i) ((z)->data[2*(i)*(z)->stride + 1]) #endif typedef struct _gsl_eigen_nonsymm_workspace_private_tag gsl_eigen_nonsymm_workspace; typedef struct _gsl_eigen_nonsymmv_workspace_private_tag gsl_eigen_nonsymmv_workspace; #endif /* GSL */ #endif /* _iemmatrix_stub_gsl_h_ */ iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/sndfile.c000066400000000000000000000002611514557770000245550ustar00rootroot00000000000000#ifdef HAVE_SNDFILE_H # include # undef STUB # define STUB(x) \ void* iemmatrix_##x() { return x; } STUB(sf_open); STUB(sf_close); STUB(sf_readf_float); #endif iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/src/stub/stubify.sh000077500000000000000000000010471514557770000250140ustar00rootroot00000000000000#!/bin/sh infile="$1" module="${infile%.c}" module="${module##*/}" stubfuns="$(cat "${infile}" | egrep "^STUB" | sed -e 's|^STUB(\(.*\));|\1|')" echo "/* ${module} */" for fun in ${stubfuns}; do echo "DECLARE_STUB($fun);" done cat <> 2; #X obj 277 221 >> 2; #X obj 318 220 >> 2; #X obj 359 220 >> 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/02_function.pd000066400000000000000000000025771514557770000275560ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_bitright; #X obj 236 269 >>; #X obj 267 269 >>; #X obj 298 268 >>; #X obj 329 268 >>; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/03_function.pd000066400000000000000000000021111514557770000275370ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_bitright 1; #X obj 256 221 >> 1; #X obj 297 221 >> 1; #X obj 338 220 >> 1; #X obj 379 220 >> 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/04_function.pd000066400000000000000000000024651514557770000275540ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_bitright; #X obj 236 269 >>; #X obj 267 269 >>; #X obj 298 268 >>; #X obj 329 268 >>; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/05_function.pd000066400000000000000000000005671514557770000275560ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_bitright 7; #X obj 207 221 >> 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/06_function.pd000066400000000000000000000024661514557770000275570ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 >>; #X obj 267 269 >>; #X obj 298 268 >>; #X obj 329 268 >>; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_bitright 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/07_function.pd000066400000000000000000000007551514557770000275570ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_bitright 0; #X obj 239 251 >>; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/08_function.pd000066400000000000000000000024671514557770000275620ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 >>; #X obj 267 269 >>; #X obj 298 268 >>; #X obj 329 268 >>; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_bitright 0; #X msg 122 132 4 3 7 6; #X msg 185 133 3.6; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/09_function.pd000066400000000000000000000025631514557770000275600ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_bitright; #X obj 236 269 >>; #X obj 267 269 >>; #X obj 298 268 >>; #X obj 329 268 >>; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 4.3; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_bitright/10_function.pd000066400000000000000000000025571514557770000275530ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_bitright; #X obj 236 269 >>; #X obj 267 269 >>; #X obj 298 268 >>; #X obj 329 268 >>; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_check/000077500000000000000000000000001514557770000243315ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_check/00_exist.pd000066400000000000000000000005051514557770000263110ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_check; #X text 67 37 test for existence of [mtx_check]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_check/01_function.pd000066400000000000000000000022561514557770000270100ustar00rootroot00000000000000#N canvas 117 373 642 474 10; #X obj 122 68 inlet bang; #X obj 122 405 outlet 1==OK; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 2 2 1 2 -3 0; #X msg 122 179 matrix \$1 \$2 \$3 \$4 \$5 \$6; #X obj 236 200 unpack 0 0 0 0 0 0; #X obj 122 221 mtx_check; #X msg 122 243 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0 0 0; #X obj 244 330 *; #X obj 244 307 ==; #X obj 275 307 ==; #X obj 122 380 *; #X connect 0 0 10 0; #X connect 2 0 4 1; #X connect 3 0 4 0; #X connect 4 0 20 0; #X connect 5 0 3 0; #X connect 6 0 3 1; #X connect 7 0 2 0; #X connect 8 0 2 1; #X connect 9 0 12 0; #X connect 9 1 13 0; #X connect 10 0 11 0; #X connect 11 0 9 0; #X connect 12 0 14 0; #X connect 13 0 5 1; #X connect 13 1 6 1; #X connect 13 2 7 1; #X connect 13 3 8 1; #X connect 13 4 18 1; #X connect 13 5 19 1; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 5 0; #X connect 16 1 6 0; #X connect 16 2 7 0; #X connect 16 3 8 0; #X connect 16 4 18 0; #X connect 16 5 19 0; #X connect 17 0 20 1; #X connect 18 0 17 0; #X connect 19 0 17 1; #X connect 20 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_check/02_function.pd000066400000000000000000000026101514557770000270030ustar00rootroot00000000000000#N canvas 117 373 642 474 10; #X obj 122 68 inlet bang; #X obj 122 405 outlet 1==OK; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 179 matrix \$1 \$2 \$3 \$4 \$5 \$6; #X obj 236 200 unpack 0 0 0 0 0 0; #X obj 122 221 mtx_check; #X obj 244 330 *; #X obj 244 307 ==; #X obj 275 307 ==; #X obj 122 380 *; #X msg 122 132 3 2 1 2 -3 0; #X msg 122 243 \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 268 unpack 0 0 0 0 0 0 0 0; #X obj 304 330 *; #X obj 304 307 ==; #X obj 335 307 ==; #X obj 244 354 *; #X connect 0 0 10 0; #X connect 2 0 4 1; #X connect 3 0 4 0; #X connect 4 0 17 0; #X connect 5 0 3 0; #X connect 6 0 3 1; #X connect 7 0 2 0; #X connect 8 0 2 1; #X connect 9 0 11 0; #X connect 9 1 12 0; #X connect 10 0 18 0; #X connect 11 0 13 0; #X connect 12 0 5 1; #X connect 12 1 6 1; #X connect 12 2 7 1; #X connect 12 3 8 1; #X connect 12 4 15 1; #X connect 12 5 16 1; #X connect 13 0 19 0; #X connect 14 0 24 0; #X connect 15 0 14 0; #X connect 16 0 14 1; #X connect 17 0 1 0; #X connect 18 0 9 0; #X connect 19 0 20 0; #X connect 20 0 5 0; #X connect 20 1 6 0; #X connect 20 2 7 0; #X connect 20 3 8 0; #X connect 20 4 15 0; #X connect 20 5 16 0; #X connect 20 6 22 0; #X connect 20 7 23 0; #X connect 21 0 24 1; #X connect 22 0 21 0; #X connect 23 0 21 1; #X connect 24 0 17 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_check/03_function.pd000066400000000000000000000026101514557770000270040ustar00rootroot00000000000000#N canvas 117 373 642 474 10; #X obj 122 68 inlet bang; #X obj 122 405 outlet 1==OK; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 179 matrix \$1 \$2 \$3 \$4 \$5 \$6; #X obj 236 200 unpack 0 0 0 0 0 0; #X obj 122 221 mtx_check; #X obj 244 330 *; #X obj 244 307 ==; #X obj 275 307 ==; #X obj 122 380 *; #X msg 122 243 \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 268 unpack 0 0 0 0 0 0 0 0; #X obj 304 330 *; #X obj 304 307 ==; #X obj 335 307 ==; #X obj 244 354 *; #X msg 122 132 2 3 1 2 -3 0; #X connect 0 0 10 0; #X connect 2 0 4 1; #X connect 3 0 4 0; #X connect 4 0 17 0; #X connect 5 0 3 0; #X connect 6 0 3 1; #X connect 7 0 2 0; #X connect 8 0 2 1; #X connect 9 0 11 0; #X connect 9 1 12 0; #X connect 10 0 24 0; #X connect 11 0 13 0; #X connect 12 0 5 1; #X connect 12 1 6 1; #X connect 12 2 7 1; #X connect 12 3 8 1; #X connect 12 4 15 1; #X connect 12 5 16 1; #X connect 13 0 18 0; #X connect 14 0 23 0; #X connect 15 0 14 0; #X connect 16 0 14 1; #X connect 17 0 1 0; #X connect 18 0 19 0; #X connect 19 0 5 0; #X connect 19 1 6 0; #X connect 19 2 7 0; #X connect 19 3 8 0; #X connect 19 4 15 0; #X connect 19 5 16 0; #X connect 19 6 21 0; #X connect 19 7 22 0; #X connect 20 0 23 1; #X connect 21 0 20 0; #X connect 22 0 20 1; #X connect 23 0 17 1; #X connect 24 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cholesky/000077500000000000000000000000001514557770000250755ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cholesky/00_exist.pd000066400000000000000000000005131514557770000270540ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_cholesky; #X text 67 37 test for existence of [mtx_cholesky]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_col/000077500000000000000000000000001514557770000240315ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_col/00_exist.pd000066400000000000000000000005011514557770000260050ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_col; #X text 67 37 test for existence of [mtx_col]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_colon/000077500000000000000000000000001514557770000243665ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_colon/00_exist.pd000066400000000000000000000004741514557770000263530ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_colon; #X text 67 37 test for existence of [mtx_colon]; #X msg 122 119 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_colon/00_exist1.pd000066400000000000000000000004641514557770000264330ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_:; #X text 67 37 test for existence of [mtx_:]; #X msg 122 119 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_concat/000077500000000000000000000000001514557770000245235ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_concat/00_exist.pd000066400000000000000000000004261514557770000265050ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_concat; #X text 67 37 test for existence of [mtx_concat]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_conv/000077500000000000000000000000001514557770000242215ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_conv/00_exist.pd000066400000000000000000000006011514557770000261760ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_conv; #X text 67 37 test for existence of [mtx_conv]; #X obj 122 136 t a a; #X msg 122 116 matrix 1 1 1; #X connect 0 0 7 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; #X connect 6 1 4 1; #X connect 7 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cos/000077500000000000000000000000001514557770000240405ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cos/00_exist.pd000066400000000000000000000005011514557770000260140ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_cos; #X text 67 37 test for existence of [mtx_cos]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cos/01_function.pd000066400000000000000000000007241514557770000265150ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_cos; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 165 232 cos; #X obj 122 265 epseq 1e-7; #X msg 122 127 -2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cos/02_function.pd000066400000000000000000000022431514557770000265140ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 415 outlet 1==OK; #X obj 122 191 mtx_cos; #X text 67 37 test for functionality of [mtx_cos]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 184 360 *; #X obj 122 360 *; #X obj 122 386 *; #X obj 236 218 unpack 0 0 0 0; #X obj 122 277 epseq 1e-07; #X obj 153 297 epseq 1e-07; #X obj 184 317 epseq 1e-07; #X obj 215 337 epseq 1e-07; #X obj 236 239 cos; #X obj 267 239 cos; #X obj 298 238 cos; #X obj 329 238 cos; #X connect 0 0 5 0; #X connect 2 0 8 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 13 0; #X connect 8 0 9 0; #X connect 9 0 14 0; #X connect 9 1 15 0; #X connect 9 2 16 0; #X connect 9 3 17 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 18 0; #X connect 13 1 19 0; #X connect 13 2 20 0; #X connect 13 3 21 0; #X connect 14 0 11 0; #X connect 15 0 11 1; #X connect 16 0 10 0; #X connect 17 0 10 1; #X connect 18 0 14 1; #X connect 19 0 15 1; #X connect 20 0 16 1; #X connect 21 0 17 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cos/03_function.pd000066400000000000000000000030411514557770000265120ustar00rootroot00000000000000#N canvas 385 142 508 482 10; #X obj 122 68 inlet bang; #X obj 122 435 outlet 1==OK; #X obj 122 191 mtx_cos; #X text 67 37 test for functionality of [mtx_cos]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 350 *; #X obj 122 350 *; #X obj 122 376 *; #X obj 122 277 epseq 1e-07; #X obj 153 297 epseq 1e-07; #X obj 184 317 epseq 1e-07; #X obj 215 277 epseq 1e-07; #X obj 266 239 cos; #X obj 297 239 cos; #X obj 328 238 cos; #X obj 359 238 cos; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 350 *; #X obj 254 297 epseq 1e-07; #X obj 285 317 epseq 1e-07; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 cos; #X obj 419 238 cos; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 397 *; #X msg 122 110 3 -1 10.5 0.05 0 12; #X connect 0 0 4 0; #X connect 2 0 22 0; #X connect 4 0 27 0; #X connect 5 0 17 0; #X connect 5 1 25 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 26 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 6 0; #X connect 12 0 6 1; #X connect 13 0 9 1; #X connect 14 0 10 1; #X connect 15 0 11 1; #X connect 16 0 12 1; #X connect 17 0 2 0; #X connect 18 0 26 1; #X connect 19 0 18 0; #X connect 20 0 18 1; #X connect 21 0 9 0; #X connect 21 1 10 0; #X connect 21 2 11 0; #X connect 21 3 12 0; #X connect 21 4 19 0; #X connect 21 5 20 0; #X connect 22 0 21 0; #X connect 23 0 19 1; #X connect 24 0 20 1; #X connect 25 0 13 0; #X connect 25 1 14 0; #X connect 25 2 15 0; #X connect 25 3 16 0; #X connect 25 4 23 0; #X connect 25 5 24 0; #X connect 26 0 1 0; #X connect 27 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cumsum/000077500000000000000000000000001514557770000245655ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_cumsum/00_exist.pd000066400000000000000000000005071514557770000265470ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_cumsum; #X text 67 37 test for existence of [mtx_cumsum]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_dbtorms/000077500000000000000000000000001514557770000247265ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_dbtorms/00_exist.pd000066400000000000000000000005111514557770000267030ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_dbtorms; #X text 67 37 test for existence of [mtx_dbtorms]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_dbtorms/01_function.pd000066400000000000000000000007241514557770000274030ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_dbtorms; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 165 232 dbtorms; #X obj 122 265 ==; #X msg 122 127 -2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_dbtorms/02_function.pd000066400000000000000000000022671514557770000274100ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_dbtorms; #X text 67 37 test for existence of [mtx_dbtorms]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 204 340 *; #X obj 122 340 *; #X obj 122 366 *; #X obj 236 218 unpack 0 0 0 0; #X obj 236 239 dbtorms; #X obj 267 239 dbtorms; #X obj 298 238 dbtorms; #X obj 329 238 dbtorms; #X obj 122 277 epseq 1e-07; #X obj 153 307 epseq 1e-07; #X obj 204 277 epseq 1e-07; #X obj 235 307 epseq 1e-07; #X connect 0 0 5 0; #X connect 2 0 8 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 13 0; #X connect 8 0 9 0; #X connect 9 0 18 0; #X connect 9 1 19 0; #X connect 9 2 20 0; #X connect 9 3 21 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 14 0; #X connect 13 1 15 0; #X connect 13 2 16 0; #X connect 13 3 17 0; #X connect 14 0 18 1; #X connect 15 0 19 1; #X connect 16 0 20 1; #X connect 17 0 21 1; #X connect 18 0 11 0; #X connect 19 0 11 1; #X connect 20 0 10 0; #X connect 21 0 10 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_dbtorms/03_function.pd000066400000000000000000000030761514557770000274100ustar00rootroot00000000000000#N canvas 385 142 508 589 10; #X obj 122 68 inlet bang; #X obj 122 415 outlet 1==OK; #X obj 122 191 mtx_dbtorms; #X text 67 37 test for existence of [mtx_dbtorms]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 266 239 dbtorms; #X obj 297 239 dbtorms; #X obj 328 238 dbtorms; #X obj 359 238 dbtorms; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 330 *; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 dbtorms; #X obj 419 238 dbtorms; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 377 *; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 122 277 epseq 1e-07; #X obj 153 307 epseq 1e-07; #X obj 184 277 epseq 1e-07; #X obj 215 307 epseq 1e-07; #X obj 254 277 epseq 1e-07; #X obj 285 307 epseq 1e-07; #X connect 0 0 4 0; #X connect 2 0 16 0; #X connect 4 0 21 0; #X connect 5 0 13 0; #X connect 5 1 19 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 20 0; #X connect 9 0 22 1; #X connect 10 0 23 1; #X connect 11 0 24 1; #X connect 12 0 25 1; #X connect 13 0 2 0; #X connect 14 0 20 1; #X connect 15 0 22 0; #X connect 15 1 23 0; #X connect 15 2 24 0; #X connect 15 3 25 0; #X connect 15 4 26 0; #X connect 15 5 27 0; #X connect 16 0 15 0; #X connect 17 0 26 1; #X connect 18 0 27 1; #X connect 19 0 9 0; #X connect 19 1 10 0; #X connect 19 2 11 0; #X connect 19 3 12 0; #X connect 19 4 17 0; #X connect 19 5 18 0; #X connect 20 0 1 0; #X connect 21 0 5 0; #X connect 22 0 7 0; #X connect 23 0 7 1; #X connect 24 0 6 0; #X connect 25 0 6 1; #X connect 26 0 14 0; #X connect 27 0 14 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_decay/000077500000000000000000000000001514557770000243415ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_decay/00_exist.pd000066400000000000000000000005051514557770000263210ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_decay; #X text 67 37 test for existence of [mtx_decay]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diag/000077500000000000000000000000001514557770000241605ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diag/00_exist.pd000066400000000000000000000004241514557770000261400ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_diag]; #X obj 122 161 mtx_diag 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diegg/000077500000000000000000000000001514557770000243335ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diegg/00_exist.pd000066400000000000000000000005051514557770000263130ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_diegg; #X text 67 37 test for existence of [mtx_diegg]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diegg/01_init.pd000066400000000000000000000012711514557770000261240ustar00rootroot00000000000000#N canvas 192 359 450 432 10; #X msg 69 90 bang; #X obj 69 187 unpack 0 0 0 0 0 0; #X obj 141 212 == 1; #X obj 117 235 == 0; #X obj 117 257 *; #X obj 165 257 *; #X obj 117 280 *; #X obj 69 166 route matrix; #X obj 165 234 == 2; #X obj 190 212 == 0; #X obj 69 145 mtx_diegg 1 2; #X obj 69 65 inlet bang; #X obj 117 305 outlet; #X text 265 139 0 1; #X text 265 154 2 0; #X text 200 145 1 2 -->; #X connect 0 0 10 0; #X connect 1 2 3 0; #X connect 1 3 2 0; #X connect 1 4 8 0; #X connect 1 5 9 0; #X connect 2 0 4 1; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 5 0 6 1; #X connect 6 0 12 0; #X connect 7 0 1 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 7 0; #X connect 11 0 0 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diegg/02_getdiegg.pd000066400000000000000000000007001514557770000267350ustar00rootroot00000000000000#N canvas 446 389 450 432 10; #X obj 87 257 *; #X obj 69 65 inlet bang; #X obj 87 305 outlet; #X obj 69 125 mtx_diegg; #X msg 69 90 matrix 2 2 0 1 2 0; #X obj 69 187 unpack 0 0; #X text 265 139 0 1; #X text 265 154 2 0; #X text 297 145 --> 1 2; #X obj 87 235 == 1; #X obj 111 212 == 2; #X connect 0 0 2 0; #X connect 1 0 4 0; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 5 0 9 0; #X connect 5 1 10 0; #X connect 9 0 0 0; #X connect 10 0 0 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diegg/02_init.pd000066400000000000000000000013331514557770000261240ustar00rootroot00000000000000#N canvas 0 0 450 432 10; #X msg 69 90 bang; #X obj 69 187 unpack 0 0 0 0 0 0; #X obj 141 212 == 1; #X obj 117 235 == 0; #X obj 117 257 *; #X obj 165 257 *; #X obj 117 280 *; #X obj 165 234 == 2; #X obj 190 212 == 0; #X obj 69 65 inlet bang; #X obj 117 305 outlet; #X obj 69 145 mtx_diegg; #X msg 69 126 1 2; #X obj 69 166 route matrix; #X text 265 139 0 1; #X text 265 154 2 0; #X text 200 145 1 2 -->; #X connect 0 0 12 0; #X connect 1 2 3 0; #X connect 1 3 2 0; #X connect 1 4 7 0; #X connect 1 5 8 0; #X connect 2 0 4 1; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 5 0 6 1; #X connect 6 0 10 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 0 0; #X connect 11 0 13 0; #X connect 12 0 11 0; #X connect 13 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diff/000077500000000000000000000000001514557770000241645ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_diff/00_exist.pd000066400000000000000000000005031514557770000261420ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_diff; #X text 67 37 test for existence of [mtx_diff]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_distance2/000077500000000000000000000000001514557770000251305ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_distance2/00_exist.pd000066400000000000000000000005151514557770000271110ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_distance2; #X text 67 37 test for existence of [mtx_distance2]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/000077500000000000000000000000001514557770000240165ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/00_exist.pd000066400000000000000000000005011514557770000257720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_egg; #X text 67 37 test for existence of [mtx_egg]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/01_function.pd000066400000000000000000000011761514557770000264750ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 214 \$3 \$4 \$5 \$6; #X obj 122 161 mtx_egg 2; #X obj 122 238 unpack 0 0 0 0; #X obj 122 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 162 262 == 1; #X obj 202 262 == 1; #X connect 0 0 10 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 4 1 11 0; #X connect 4 2 12 0; #X connect 4 3 6 0; #X connect 5 0 7 0; #X connect 6 0 9 1; #X connect 7 0 8 0; #X connect 8 0 1 0; #X connect 9 0 8 1; #X connect 10 0 3 0; #X connect 11 0 7 1; #X connect 12 0 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/02_function.pd000066400000000000000000000015411514557770000264720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 262 == 0; #X obj 162 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 161 mtx_egg 2 3; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 322 262 == 0; #X obj 282 282 *; #X obj 122 324 *; #X obj 202 262 == 1; #X obj 282 262 == 1; #X connect 0 0 8 0; #X connect 2 0 5 0; #X connect 3 0 5 1; #X connect 4 0 7 1; #X connect 5 0 6 0; #X connect 6 0 14 0; #X connect 7 0 6 1; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 2 0; #X connect 11 1 3 0; #X connect 11 2 15 0; #X connect 11 3 4 0; #X connect 11 4 16 0; #X connect 11 5 12 0; #X connect 12 0 13 1; #X connect 13 0 14 1; #X connect 14 0 1 0; #X connect 15 0 7 0; #X connect 16 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/03_function.pd000066400000000000000000000012541514557770000264740ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 122 161 mtx_egg 7 8; #X msg 122 214 \$3 \$4 \$5 \$6; #X msg 122 135 2; #X obj 162 262 == 1; #X obj 202 262 == 1; #X connect 0 0 7 0; #X connect 2 0 4 0; #X connect 3 0 6 1; #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 6 0 5 1; #X connect 7 0 11 0; #X connect 8 0 2 0; #X connect 8 1 12 0; #X connect 8 2 13 0; #X connect 8 3 3 0; #X connect 9 0 10 0; #X connect 10 0 8 0; #X connect 11 0 9 0; #X connect 12 0 4 1; #X connect 13 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/04_function.pd000066400000000000000000000016021514557770000264720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 282 262 == 0; #X obj 322 262 == 0; #X obj 282 282 *; #X obj 122 324 *; #X msg 122 135 3 2; #X obj 122 161 mtx_egg; #X obj 162 262 == 1; #X obj 202 262 == 1; #X connect 0 0 7 0; #X connect 2 0 4 0; #X connect 3 0 6 1; #X connect 4 0 5 0; #X connect 5 0 13 0; #X connect 6 0 5 1; #X connect 7 0 14 0; #X connect 8 0 9 0; #X connect 9 0 2 0; #X connect 9 1 16 0; #X connect 9 2 17 0; #X connect 9 3 3 0; #X connect 9 4 10 0; #X connect 9 5 11 0; #X connect 10 0 12 0; #X connect 11 0 12 1; #X connect 12 0 13 1; #X connect 13 0 1 0; #X connect 14 0 15 0; #X connect 15 0 8 0; #X connect 16 0 4 1; #X connect 17 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/05_function.pd000066400000000000000000000011151514557770000264720ustar00rootroot00000000000000#N canvas 541 351 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 104 t b; #X obj 122 191 mtx_egg 7 8; #X msg 122 135 10 14; #X msg 122 214 \$1 \$2; #X obj 122 157 t l l; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 179 215 unpack; #X obj 122 236 unpack; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 11 0; #X connect 7 0 4 0; #X connect 7 1 10 0; #X connect 8 0 2 0; #X connect 9 0 2 1; #X connect 10 0 8 1; #X connect 10 1 9 1; #X connect 11 0 8 0; #X connect 11 1 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_egg/06_function.pd000066400000000000000000000011111514557770000264670ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 104 t b; #X obj 122 282 *; #X obj 122 191 mtx_egg 7 8; #X msg 122 214 \$1 \$2; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 122 236 unpack; #X msg 122 135 32; #X obj 122 157 t f f; #X obj 179 215 t f f; #X connect 0 0 2 0; #X connect 2 0 9 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 6 0 3 0; #X connect 7 0 3 1; #X connect 8 0 6 0; #X connect 8 1 7 0; #X connect 9 0 10 0; #X connect 10 0 4 0; #X connect 10 1 11 0; #X connect 11 0 6 1; #X connect 11 1 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_element/000077500000000000000000000000001514557770000247055ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_element/00_exist.pd000066400000000000000000000005111514557770000266620ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 69 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_element; #X text 67 37 test for existence of [mtx_element]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/000077500000000000000000000000001514557770000236615ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/00_exist.pd000066400000000000000000000004771514557770000256510ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_eq]; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_eq; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/01_function.pd000066400000000000000000000021061514557770000263320ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X obj 122 221 mtx_eq 2; #X obj 236 221 == 2; #X obj 277 221 == 2; #X obj 318 220 == 2; #X obj 359 220 == 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/02_function.pd000066400000000000000000000025711514557770000263410ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_eq; #X obj 236 269 ==; #X obj 267 269 ==; #X obj 298 268 ==; #X obj 329 268 ==; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/03_function.pd000066400000000000000000000021031514557770000263310ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_eq 1; #X obj 256 221 == 1; #X obj 297 221 == 1; #X obj 338 220 == 1; #X obj 379 220 == 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/04_function.pd000066400000000000000000000024571514557770000263460ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_eq; #X obj 236 269 ==; #X obj 267 269 ==; #X obj 298 268 ==; #X obj 329 268 ==; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/05_function.pd000066400000000000000000000005611514557770000263410ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_eq 7; #X obj 207 221 == 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/06_function.pd000066400000000000000000000024601514557770000263420ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 ==; #X obj 267 269 ==; #X obj 298 268 ==; #X obj 329 268 ==; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_eq 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/07_function.pd000066400000000000000000000007471514557770000263510ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_eq 0; #X obj 239 251 ==; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/08_function.pd000066400000000000000000000024611514557770000263450ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 ==; #X obj 267 269 ==; #X obj 298 268 ==; #X obj 329 268 ==; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_eq 0; #X msg 122 132 4 3 7 6; #X msg 185 133 123; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/09_function.pd000066400000000000000000000025541514557770000263510ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_eq; #X obj 236 269 ==; #X obj 267 269 ==; #X obj 298 268 ==; #X obj 329 268 ==; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 34; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eq/10_function.pd000066400000000000000000000025511514557770000263360ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_eq; #X obj 236 269 ==; #X obj 267 269 ==; #X obj 298 268 ==; #X obj 329 268 ==; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_exp/000077500000000000000000000000001514557770000240505ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_exp/00_exist.pd000066400000000000000000000005011514557770000260240ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_exp; #X text 67 37 test for existence of [mtx_exp]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_exp/01_function.pd000066400000000000000000000007141514557770000265240ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_exp; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 165 232 exp; #X obj 122 265 ==; #X msg 122 127 -2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_exp/02_function.pd000066400000000000000000000021731514557770000265260ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_exp; #X text 67 37 test for existence of [mtx_exp]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 184 300 *; #X obj 122 300 *; #X obj 122 326 *; #X obj 236 218 unpack 0 0 0 0; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 184 277 ==; #X obj 215 277 ==; #X obj 236 239 exp; #X obj 267 239 exp; #X obj 298 238 exp; #X obj 329 238 exp; #X connect 0 0 5 0; #X connect 2 0 8 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 13 0; #X connect 8 0 9 0; #X connect 9 0 14 0; #X connect 9 1 15 0; #X connect 9 2 16 0; #X connect 9 3 17 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 18 0; #X connect 13 1 19 0; #X connect 13 2 20 0; #X connect 13 3 21 0; #X connect 14 0 11 0; #X connect 15 0 11 1; #X connect 16 0 10 0; #X connect 17 0 10 1; #X connect 18 0 14 1; #X connect 19 0 15 1; #X connect 20 0 16 1; #X connect 21 0 17 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_exp/03_function.pd000066400000000000000000000027471514557770000265360ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_exp; #X text 67 37 test for existence of [mtx_exp]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 300 *; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 184 277 ==; #X obj 215 277 ==; #X obj 266 239 exp; #X obj 297 239 exp; #X obj 328 238 exp; #X obj 359 238 exp; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 300 *; #X obj 254 277 ==; #X obj 285 277 ==; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 exp; #X obj 419 238 exp; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 347 *; #X msg 122 110 3 -1 10.5 0.05 0 12; #X connect 0 0 4 0; #X connect 2 0 22 0; #X connect 4 0 27 0; #X connect 5 0 17 0; #X connect 5 1 25 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 26 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 6 0; #X connect 12 0 6 1; #X connect 13 0 9 1; #X connect 14 0 10 1; #X connect 15 0 11 1; #X connect 16 0 12 1; #X connect 17 0 2 0; #X connect 18 0 26 1; #X connect 19 0 18 0; #X connect 20 0 18 1; #X connect 21 0 9 0; #X connect 21 1 10 0; #X connect 21 2 11 0; #X connect 21 3 12 0; #X connect 21 4 19 0; #X connect 21 5 20 0; #X connect 22 0 21 0; #X connect 23 0 19 1; #X connect 24 0 20 1; #X connect 25 0 13 0; #X connect 25 1 14 0; #X connect 25 2 15 0; #X connect 25 3 16 0; #X connect 25 4 23 0; #X connect 25 5 24 0; #X connect 26 0 1 0; #X connect 27 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/000077500000000000000000000000001514557770000240365ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/00_exist.pd000066400000000000000000000005011514557770000260120ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_eye; #X text 67 37 test for existence of [mtx_eye]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/01_function.pd000066400000000000000000000011761514557770000265150ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 214 \$3 \$4 \$5 \$6; #X obj 122 161 mtx_eye 2; #X obj 122 238 unpack 0 0 0 0; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 262 == 1; #X obj 242 262 == 1; #X connect 0 0 10 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 11 0; #X connect 4 1 5 0; #X connect 4 2 6 0; #X connect 4 3 12 0; #X connect 5 0 7 1; #X connect 6 0 9 0; #X connect 7 0 8 0; #X connect 8 0 1 0; #X connect 9 0 8 1; #X connect 10 0 3 0; #X connect 11 0 7 0; #X connect 12 0 9 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/02_function.pd000066400000000000000000000016131514557770000265120ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 161 mtx_eye 2 3; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 322 262 == 0; #X obj 282 282 *; #X obj 122 324 *; #X obj 122 262 == 1; #X msg 140 133 bang; #X obj 242 262 == 0; #X obj 282 262 == 1; #X connect 0 0 7 0; #X connect 2 0 4 1; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 5 0 13 0; #X connect 6 0 5 1; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 14 0; #X connect 10 1 2 0; #X connect 10 2 3 0; #X connect 10 3 16 0; #X connect 10 4 17 0; #X connect 10 5 11 0; #X connect 11 0 12 1; #X connect 12 0 13 1; #X connect 13 0 1 0; #X connect 14 0 4 0; #X connect 15 0 8 0; #X connect 16 0 6 1; #X connect 17 0 12 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/03_function.pd000066400000000000000000000012541514557770000265140ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 122 161 mtx_eye 7 8; #X msg 122 214 \$3 \$4 \$5 \$6; #X msg 122 135 2; #X obj 122 262 == 1; #X obj 242 262 == 1; #X connect 0 0 7 0; #X connect 2 0 4 1; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 6 0 5 1; #X connect 7 0 11 0; #X connect 8 0 12 0; #X connect 8 1 2 0; #X connect 8 2 3 0; #X connect 8 3 13 0; #X connect 9 0 10 0; #X connect 10 0 8 0; #X connect 11 0 9 0; #X connect 12 0 4 0; #X connect 13 0 6 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/04_function.pd000066400000000000000000000016021514557770000265120ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 162 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 322 262 == 0; #X obj 282 282 *; #X obj 122 324 *; #X msg 122 135 3 2; #X obj 122 161 mtx_eye; #X obj 122 262 == 1; #X obj 202 262 == 0; #X obj 242 262 == 1; #X obj 282 262 == 0; #X connect 0 0 6 0; #X connect 2 0 3 1; #X connect 3 0 4 0; #X connect 4 0 11 0; #X connect 5 0 4 1; #X connect 6 0 12 0; #X connect 7 0 8 0; #X connect 8 0 14 0; #X connect 8 1 2 0; #X connect 8 2 15 0; #X connect 8 3 16 0; #X connect 8 4 17 0; #X connect 8 5 9 0; #X connect 9 0 10 1; #X connect 10 0 11 1; #X connect 11 0 1 0; #X connect 12 0 13 0; #X connect 13 0 7 0; #X connect 14 0 3 0; #X connect 15 0 5 0; #X connect 16 0 5 1; #X connect 17 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/05_function.pd000066400000000000000000000011151514557770000265120ustar00rootroot00000000000000#N canvas 541 351 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 104 t b; #X obj 122 191 mtx_eye 7 8; #X msg 122 135 10 14; #X msg 122 214 \$1 \$2; #X obj 122 157 t l l; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 179 215 unpack; #X obj 122 236 unpack; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 11 0; #X connect 7 0 4 0; #X connect 7 1 10 0; #X connect 8 0 2 0; #X connect 9 0 2 1; #X connect 10 0 8 1; #X connect 10 1 9 1; #X connect 11 0 8 0; #X connect 11 1 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_eye/06_function.pd000066400000000000000000000011111514557770000265070ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 104 t b; #X obj 122 282 *; #X obj 122 191 mtx_eye 7 8; #X msg 122 214 \$1 \$2; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 122 236 unpack; #X msg 122 135 32; #X obj 122 157 t f f; #X obj 179 215 t f f; #X connect 0 0 2 0; #X connect 2 0 9 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 6 0 3 0; #X connect 7 0 3 1; #X connect 8 0 6 0; #X connect 8 1 7 0; #X connect 9 0 10 0; #X connect 10 0 4 0; #X connect 10 1 11 0; #X connect 11 0 6 1; #X connect 11 1 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_fft/000077500000000000000000000000001514557770000240335ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_fft/00_exist.pd000066400000000000000000000006151514557770000260150ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 132 t a a; #X msg 122 102 matrix 1 8 0 0 0 0 0 0 0 0; #X obj 122 161 mtx_fft; #X text 67 37 test for existence of [mtx_fft]; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 6 0; #X connect 4 1 6 1; #X connect 5 0 4 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_fft/02_function.pd000066400000000000000000000126151514557770000265130ustar00rootroot00000000000000#N canvas 316 110 645 684 10; #N canvas 492 104 545 558 ~ 0; #X obj 363 240 array define \$0.re~; #X obj 363 260 array define \$0.im~; #X msg 74 160 set \$1 \, bang; #X obj 74 184 switch~; #X obj 62 312 bang~; #N canvas 735 461 450 300 DSP? 0; #X obj 83 102 inlet; #X obj 83 125 spigot; #X obj 83 148 outlet; #X obj 134 113 r pd; #X obj 134 136 route dsp; #X text 86 64 only calculate if DSP is on...; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 4 0 1 1; #X restore 74 110 pd DSP?; #X text 75 25 calculate the FFT using Pd's built-in [fft~] object; #X text 74 50 (this patch only works if DSP is *on*); #X obj 62 492 mtx; #X obj 62 394 t l l; #X obj 89 418 list length; #X msg 89 441 1 \$1; #X obj 89 464 mtx_zeros; #X obj 194 78 inlet mtx.im; #X obj 74 80 inlet mtx.re; #X obj 112 212 tabreceive~ \$0.re~; #X obj 232 212 tabreceive~ \$0.im~; #N canvas 204 229 450 300 mtx2table+resize 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 280 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 115 170 array set \$0.im~; #X obj 163 76 t f f; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 12 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 11 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 10 0 9 0; #X connect 10 1 8 0; #X connect 12 0 3 1; #X connect 12 1 10 0; #X restore 194 139 pd mtx2table+resize; #N canvas 204 229 450 300 mtx2table+resize 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 265 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 115 170 array set \$0.re~; #X obj 163 76 t f f; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 12 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 11 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 10 0 9 0; #X connect 10 1 8 0; #X connect 12 0 3 1; #X connect 12 1 10 0; #X restore 74 139 pd mtx2table+resize; #X obj 62 342 t b b; #X obj 212 492 mtx; #X obj 212 394 t l l; #X obj 239 418 list length; #X msg 239 441 1 \$1; #X obj 239 464 mtx_zeros; #X obj 62 372 array get \$0.re~; #X obj 212 372 array get \$0.im~; #X obj 62 515 outlet re; #X obj 212 515 outlet im; #X obj 112 258 tabsend~ \$0.re~; #X obj 232 258 tabsend~ \$0.im~; #X obj 112 235 fft~; #X connect 2 0 3 0; #X connect 4 0 19 0; #X connect 5 0 18 0; #X connect 8 0 27 0; #X connect 9 0 8 0; #X connect 9 1 10 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 8 1; #X connect 13 0 17 0; #X connect 14 0 5 0; #X connect 15 0 31 0; #X connect 16 0 31 1; #X connect 18 0 2 0; #X connect 19 0 25 0; #X connect 19 1 26 0; #X connect 20 0 28 0; #X connect 21 0 20 0; #X connect 21 1 22 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 24 0 20 1; #X connect 25 0 9 0; #X connect 26 0 21 0; #X connect 31 0 29 0; #X connect 31 1 30 0; #X restore 49 380 pd ~; #X obj 49 358 t a a, f 9; #X obj 90 8 inlet bang; #N canvas 735 461 450 300 DSP 0; #X obj 57 28 inlet post; #X obj 186 26 inlet pre; #X obj 328 70 r pd-dsp-started; #X obj 330 130 r pd-dsp-stopped; #X msg 328 95 1; #X msg 330 155 0; #X obj 218 109 i; #X obj 57 136 i; #X obj 57 53 t b; #X msg 57 161 dsp \$1; #X obj 57 186 s pd; #X obj 186 51 t b b; #X msg 186 76 1; #X connect 0 0 8 0; #X connect 1 0 11 0; #X connect 2 0 4 0; #X connect 3 0 5 0; #X connect 4 0 6 1; #X connect 5 0 6 1; #X connect 6 0 7 1; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 11 1 6 0; #X connect 12 0 9 0; #X restore 133 100 pd DSP; #X msg 159 8 bang; #X floatatom 159 45 5 0 0 0 - - - 0; #X obj 49 466 mtx_-; #X obj 49 489 mtx_abs; #X obj 49 538 mtx_isequal 1; #X obj 49 624 outlet 1==OK; #X text 279 372 this uses Pd's DSP \, and therefore the result is one tick late!; #X obj 90 70 t b f b b, f 24; #X text 284 607 wait for the result; #X obj 49 593 t a a; #X msg 231 604 -1000; #X obj 160 358 t a a, f 9; #X obj 49 224 t a a; #X msg 48 202 1 \$1; #X floatatom 120 587 5 0 0 0 - - - 0; #X obj 49 248 mtx_rand 1 9; #X obj 160 248 mtx_rand 1 9; #X obj 100 403 mtx_.* 64; #X obj 211 403 mtx_.* 64; #X obj 139 466 mtx_-; #X obj 139 489 mtx_abs; #X obj 139 538 mtx_isequal 1; #X obj 49 566 *; #X obj 100 380 mtx_fft, f 19; #X obj 48 176 t f f; #X msg 122 169 1; #X obj 122 191 t f f; #X msg 90 31 1024; #X obj 49 512 mtx_< 0.0001; #X obj 139 512 mtx_< 0.0001; #X connect 0 0 6 0; #X connect 0 1 23 0; #X connect 1 0 0 0; #X connect 1 1 27 0; #X connect 2 0 31 0; #X connect 4 0 5 0; #X connect 5 0 11 0; #X connect 6 0 7 0; #X connect 7 0 32 0; #X connect 8 0 26 0; #X connect 11 0 3 0; #X connect 11 1 28 0; #X connect 11 2 3 1; #X connect 11 3 14 0; #X connect 13 0 9 0; #X connect 13 1 18 0; #X connect 14 0 13 0; #X connect 15 0 0 1; #X connect 15 1 27 1; #X connect 16 0 19 0; #X connect 16 1 20 0; #X connect 17 0 16 0; #X connect 19 0 1 0; #X connect 20 0 15 0; #X connect 21 0 6 1; #X connect 22 0 23 1; #X connect 23 0 24 0; #X connect 24 0 33 0; #X connect 25 0 26 1; #X connect 26 0 13 0; #X connect 27 0 21 0; #X connect 27 1 22 0; #X connect 28 0 17 0; #X connect 28 1 29 0; #X connect 29 0 30 0; #X connect 30 0 21 1; #X connect 30 1 22 1; #X connect 31 0 11 0; #X connect 32 0 8 0; #X connect 33 0 25 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_fill/000077500000000000000000000000001514557770000242025ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_fill/00_exist.pd000066400000000000000000000006261514557770000261660ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_fill; #X text 67 37 test for existence of [mtx_fill]; #X msg 122 96 matrix 1 1 1; #X obj 122 127 t a a a; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 4 1; #X connect 7 2 4 2; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_find/000077500000000000000000000000001514557770000241745ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_find/00_exist.pd000066400000000000000000000005031514557770000261520ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_find]; #X msg 122 125 matrix 1 1 1; #X obj 122 161 mtx_find; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gauss/000077500000000000000000000000001514557770000243765ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gauss/00_exist.pd000066400000000000000000000005051514557770000263560ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_gauss; #X text 67 37 test for existence of [mtx_gauss]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/000077500000000000000000000000001514557770000236475ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/00_exist.pd000066400000000000000000000004771514557770000256370ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_ge; #X text 67 37 test for existence of [mtx_ge]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/01_function.pd000066400000000000000000000021061514557770000263200ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X obj 122 221 mtx_ge 2; #X obj 236 221 >= 2; #X obj 277 221 >= 2; #X obj 318 220 >= 2; #X obj 359 220 >= 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/02_function.pd000066400000000000000000000025711514557770000263270ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_ge; #X obj 236 269 >=; #X obj 267 269 >=; #X obj 298 268 >=; #X obj 329 268 >=; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/03_function.pd000066400000000000000000000021031514557770000263170ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_ge 1; #X obj 256 221 >= 1; #X obj 297 221 >= 1; #X obj 338 220 >= 1; #X obj 379 220 >= 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/04_function.pd000066400000000000000000000024571514557770000263340ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_ge; #X obj 236 269 >=; #X obj 267 269 >=; #X obj 298 268 >=; #X obj 329 268 >=; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/05_function.pd000066400000000000000000000005611514557770000263270ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_ge 7; #X obj 207 221 >= 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/06_function.pd000066400000000000000000000024601514557770000263300ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 >=; #X obj 267 269 >=; #X obj 298 268 >=; #X obj 329 268 >=; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_ge 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/07_function.pd000066400000000000000000000007471514557770000263370ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_ge 0; #X obj 239 251 >=; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/08_function.pd000066400000000000000000000024611514557770000263330ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 >=; #X obj 267 269 >=; #X obj 298 268 >=; #X obj 329 268 >=; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_ge 0; #X msg 122 132 4 3 7 6; #X msg 185 133 123; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/09_function.pd000066400000000000000000000025541514557770000263370ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_ge; #X obj 236 269 >=; #X obj 267 269 >=; #X obj 298 268 >=; #X obj 329 268 >=; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 34; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ge/10_function.pd000066400000000000000000000025511514557770000263240ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_ge; #X obj 236 269 >=; #X obj 267 269 >=; #X obj 298 268 >=; #X obj 329 268 >=; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/000077500000000000000000000000001514557770000236665ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/00_exist.pd000066400000000000000000000004771514557770000256560ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_gt; #X text 67 37 test for existence of [mtx_gt]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/01_function.pd000066400000000000000000000021021514557770000263330ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X obj 122 221 mtx_gt 2; #X obj 236 221 > 2; #X obj 277 221 > 2; #X obj 318 220 > 2; #X obj 359 220 > 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/02_function.pd000066400000000000000000000025651514557770000263510ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_gt; #X obj 236 269 >; #X obj 267 269 >; #X obj 298 268 >; #X obj 329 268 >; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/03_function.pd000066400000000000000000000020771514557770000263500ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_gt 1; #X obj 256 221 > 1; #X obj 297 221 > 1; #X obj 338 220 > 1; #X obj 379 220 > 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/04_function.pd000066400000000000000000000024531514557770000263470ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_gt; #X obj 236 269 >; #X obj 267 269 >; #X obj 298 268 >; #X obj 329 268 >; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/05_function.pd000066400000000000000000000005601514557770000263450ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_gt 7; #X obj 207 221 > 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/06_function.pd000066400000000000000000000024541514557770000263520ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 >; #X obj 267 269 >; #X obj 298 268 >; #X obj 329 268 >; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_gt 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/07_function.pd000066400000000000000000000007461514557770000263550ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_gt 0; #X obj 239 251 >; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/08_function.pd000066400000000000000000000024551514557770000263550ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 >; #X obj 267 269 >; #X obj 298 268 >; #X obj 329 268 >; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_gt 0; #X msg 122 132 4 3 7 6; #X msg 185 133 123; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/09_function.pd000066400000000000000000000025501514557770000263520ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_gt; #X obj 236 269 >; #X obj 267 269 >; #X obj 298 268 >; #X obj 329 268 >; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 34; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_gt/10_function.pd000066400000000000000000000025451514557770000263460ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_gt; #X obj 236 269 >; #X obj 267 269 >; #X obj 298 268 >; #X obj 329 268 >; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ifft/000077500000000000000000000000001514557770000242045ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ifft/00_exist.pd000066400000000000000000000006171514557770000261700ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 132 t a a; #X obj 122 161 mtx_ifft; #X msg 122 102 matrix 1 8 0 0 0 0 0 0 0 0; #X text 67 37 test for existence of [mtx_ifft]; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 4 1 5 1; #X connect 5 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ifft/02_function.pd000066400000000000000000000125451514557770000266660ustar00rootroot00000000000000#N canvas 316 110 645 684 10; #N canvas 492 104 545 558 ~ 0; #X obj 363 240 array define \$0.re~; #X obj 363 260 array define \$0.im~; #X msg 74 160 set \$1 \, bang; #X obj 74 184 switch~; #X obj 62 312 bang~; #N canvas 735 461 450 300 DSP? 0; #X obj 83 102 inlet; #X obj 83 125 spigot; #X obj 83 148 outlet; #X obj 134 113 r pd; #X obj 134 136 route dsp; #X text 86 64 only calculate if DSP is on...; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 4 0 1 1; #X restore 74 110 pd DSP?; #X text 75 25 calculate the IFFT using Pd's built-in [ifft~] object; #X text 74 50 (this patch only works if DSP is *on*); #X obj 62 492 mtx; #X obj 62 394 t l l; #X obj 89 418 list length; #X msg 89 441 1 \$1; #X obj 89 464 mtx_zeros; #X obj 194 78 inlet mtx.im; #X obj 74 80 inlet mtx.re; #X obj 112 212 tabreceive~ \$0.re~; #X obj 232 212 tabreceive~ \$0.im~; #N canvas 204 229 450 300 mtx2table+resize 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 280 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 115 170 array set \$0.im~; #X obj 163 76 t f f; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 12 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 11 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 10 0 9 0; #X connect 10 1 8 0; #X connect 12 0 3 1; #X connect 12 1 10 0; #X restore 194 139 pd mtx2table+resize; #N canvas 204 229 450 300 mtx2table+resize 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 265 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 115 170 array set \$0.re~; #X obj 163 76 t f f; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 12 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 11 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 10 0 9 0; #X connect 10 1 8 0; #X connect 12 0 3 1; #X connect 12 1 10 0; #X restore 74 139 pd mtx2table+resize; #X obj 62 342 t b b; #X obj 212 492 mtx; #X obj 212 394 t l l; #X obj 239 418 list length; #X msg 239 441 1 \$1; #X obj 239 464 mtx_zeros; #X obj 62 372 array get \$0.re~; #X obj 212 372 array get \$0.im~; #X obj 62 515 outlet re; #X obj 212 515 outlet im; #X obj 112 258 tabsend~ \$0.re~; #X obj 112 235 ifft~; #X obj 232 258 tabsend~ \$0.im~; #X connect 2 0 3 0; #X connect 4 0 19 0; #X connect 5 0 18 0; #X connect 8 0 27 0; #X connect 9 0 8 0; #X connect 9 1 10 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 8 1; #X connect 13 0 17 0; #X connect 14 0 5 0; #X connect 15 0 30 0; #X connect 16 0 30 1; #X connect 18 0 2 0; #X connect 19 0 25 0; #X connect 19 1 26 0; #X connect 20 0 28 0; #X connect 21 0 20 0; #X connect 21 1 22 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 24 0 20 1; #X connect 25 0 9 0; #X connect 26 0 21 0; #X connect 30 0 29 0; #X connect 30 1 31 0; #X restore 49 380 pd ~; #X obj 49 358 t a a, f 9; #X obj 90 8 inlet bang; #N canvas 735 461 450 300 DSP 0; #X obj 57 28 inlet post; #X obj 186 26 inlet pre; #X obj 328 70 r pd-dsp-started; #X obj 330 130 r pd-dsp-stopped; #X msg 328 95 1; #X msg 330 155 0; #X obj 218 109 i; #X obj 57 136 i; #X obj 57 53 t b; #X msg 57 161 dsp \$1; #X obj 57 186 s pd; #X obj 186 51 t b b; #X msg 186 76 1; #X connect 0 0 8 0; #X connect 1 0 11 0; #X connect 2 0 4 0; #X connect 3 0 5 0; #X connect 4 0 6 1; #X connect 5 0 6 1; #X connect 6 0 7 1; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 11 1 6 0; #X connect 12 0 9 0; #X restore 133 100 pd DSP; #X msg 159 8 bang; #X floatatom 159 45 5 0 0 0 - - - 0; #X obj 49 466 mtx_-; #X obj 49 489 mtx_abs; #X obj 49 538 mtx_isequal 1; #X obj 49 624 outlet 1==OK; #X text 279 372 this uses Pd's DSP \, and therefore the result is one tick late!; #X obj 90 70 t b f b b, f 24; #X text 284 607 wait for the result; #X obj 49 593 t a a; #X msg 231 604 -1000; #X obj 160 358 t a a, f 9; #X obj 49 224 t a a; #X msg 48 202 1 \$1; #X floatatom 120 587 5 0 0 0 - - - 0; #X obj 100 380 mtx_ifft, f 19; #X obj 49 248 mtx_rand 1 9; #X obj 160 248 mtx_rand 1 9; #X msg 90 31 64; #X obj 100 403 mtx_.* 64; #X obj 211 403 mtx_.* 64; #X obj 139 466 mtx_-; #X obj 139 489 mtx_abs; #X obj 139 538 mtx_isequal 1; #X obj 49 566 *; #X obj 151 177 t f f; #X obj 48 176 t f f; #X obj 49 512 mtx_< 1e-05; #X obj 139 512 mtx_< 1e-05; #X connect 0 0 6 0; #X connect 0 1 25 0; #X connect 1 0 0 0; #X connect 1 1 19 0; #X connect 2 0 22 0; #X connect 4 0 5 0; #X connect 5 0 11 0; #X connect 6 0 7 0; #X connect 7 0 31 0; #X connect 8 0 28 0; #X connect 11 0 3 0; #X connect 11 1 30 0; #X connect 11 2 3 1; #X connect 11 3 14 0; #X connect 13 0 9 0; #X connect 13 1 18 0; #X connect 14 0 13 0; #X connect 15 0 0 1; #X connect 15 1 19 1; #X connect 16 0 20 0; #X connect 16 1 21 0; #X connect 17 0 16 0; #X connect 19 0 23 0; #X connect 19 1 24 0; #X connect 20 0 1 0; #X connect 21 0 15 0; #X connect 22 0 11 0; #X connect 23 0 6 1; #X connect 24 0 25 1; #X connect 25 0 26 0; #X connect 26 0 32 0; #X connect 27 0 28 1; #X connect 28 0 13 0; #X connect 29 0 23 1; #X connect 29 1 24 1; #X connect 30 0 17 0; #X connect 30 1 29 0; #X connect 31 0 8 0; #X connect 32 0 27 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_index/000077500000000000000000000000001514557770000243635ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_index/00_exist.pd000066400000000000000000000006031514557770000263420ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_index; #X text 67 37 test for existence of [mtx_index]; #X msg 122 102 matrix 1 1 1; #X obj 122 126 t a a; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_int/000077500000000000000000000000001514557770000240465ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_int/00_exist.pd000066400000000000000000000005011514557770000260220ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_int; #X text 67 37 test for existence of [mtx_int]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_int/01_function.pd000066400000000000000000000007141514557770000265220ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_int; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 165 232 int; #X obj 122 265 ==; #X msg 122 127 -2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_int/02_function.pd000066400000000000000000000021731514557770000265240ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_int; #X text 67 37 test for existence of [mtx_int]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 184 300 *; #X obj 122 300 *; #X obj 122 326 *; #X obj 236 218 unpack 0 0 0 0; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 184 277 ==; #X obj 215 277 ==; #X obj 236 239 int; #X obj 267 239 int; #X obj 298 238 int; #X obj 329 238 int; #X connect 0 0 5 0; #X connect 2 0 8 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 13 0; #X connect 8 0 9 0; #X connect 9 0 14 0; #X connect 9 1 15 0; #X connect 9 2 16 0; #X connect 9 3 17 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 18 0; #X connect 13 1 19 0; #X connect 13 2 20 0; #X connect 13 3 21 0; #X connect 14 0 11 0; #X connect 15 0 11 1; #X connect 16 0 10 0; #X connect 17 0 10 1; #X connect 18 0 14 1; #X connect 19 0 15 1; #X connect 20 0 16 1; #X connect 21 0 17 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_int/03_function.pd000066400000000000000000000027471514557770000265340ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_int; #X text 67 37 test for existence of [mtx_int]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 300 *; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 184 277 ==; #X obj 215 277 ==; #X obj 266 239 int; #X obj 297 239 int; #X obj 328 238 int; #X obj 359 238 int; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 300 *; #X obj 254 277 ==; #X obj 285 277 ==; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 int; #X obj 419 238 int; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 347 *; #X msg 122 110 3 -1 10.5 0.05 0 12; #X connect 0 0 4 0; #X connect 2 0 22 0; #X connect 4 0 27 0; #X connect 5 0 17 0; #X connect 5 1 25 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 26 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 6 0; #X connect 12 0 6 1; #X connect 13 0 9 1; #X connect 14 0 10 1; #X connect 15 0 11 1; #X connect 16 0 12 1; #X connect 17 0 2 0; #X connect 18 0 26 1; #X connect 19 0 18 0; #X connect 20 0 18 1; #X connect 21 0 9 0; #X connect 21 1 10 0; #X connect 21 2 11 0; #X connect 21 3 12 0; #X connect 21 4 19 0; #X connect 21 5 20 0; #X connect 22 0 21 0; #X connect 23 0 19 1; #X connect 24 0 20 1; #X connect 25 0 13 0; #X connect 25 1 14 0; #X connect 25 2 15 0; #X connect 25 3 16 0; #X connect 25 4 23 0; #X connect 25 5 24 0; #X connect 26 0 1 0; #X connect 27 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_inverse/000077500000000000000000000000001514557770000247275ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_inverse/00_exist.pd000066400000000000000000000005111514557770000267040ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_inverse; #X text 67 37 test for existence of [mtx_inverse]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_isequal/000077500000000000000000000000001514557770000247175ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_isequal/00_exist.pd000066400000000000000000000005111514557770000266740ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_isequal; #X text 67 37 test for existence of [mtx_isequal]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_isequal/01_function0.pd000066400000000000000000000007021514557770000274500ustar00rootroot00000000000000#N canvas 433 156 508 521 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 366 1; #X msg 122 112 matrix 3 3 1 2 3 4 5 6 7 8 9; #X obj 122 231 mtx_isequal; #X text 67 37 test whether [mtx_isequal] correctly detects the equality of 2 matrices; #X obj 122 347 select 1; #X obj 122 165 t a a; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 7 0; #X connect 4 0 6 0; #X connect 6 0 2 0; #X connect 7 0 4 0; #X connect 7 1 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_isequal/01_function1.pd000066400000000000000000000006621514557770000274560ustar00rootroot00000000000000#N canvas 386 139 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 366 1; #X obj 122 161 mtx_isequal; #X obj 122 347 select 1; #X text 67 37 test whether [mtx_isequal] correctly detects the equality of 2 matrices; #X obj 122 139 t a a a; #X obj 122 112 mtx_rand 4; #X connect 0 0 7 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 6 0 3 0; #X connect 6 1 3 1; #X connect 7 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_isequal/01_function2.pd000066400000000000000000000010051514557770000274470ustar00rootroot00000000000000#N canvas 433 156 508 521 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 366 1; #X msg 122 112 matrix 3 3 1 2 3 4 5 6 7 8 9; #X obj 122 231 mtx_isequal; #X obj 122 90 t b b; #X msg 154 138 matrix 3 3 1 2 3 4 5 6 7 8 10; #X text 67 37 test whether [mtx_isequal] correctly detects the inequality of 2 matrices; #X obj 122 347 select 0; #X connect 0 0 5 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 3 0; #X connect 5 1 6 0; #X connect 6 0 4 1; #X connect 8 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_isequal/01_function3.pd000066400000000000000000000007721514557770000274620ustar00rootroot00000000000000#N canvas 433 156 508 521 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 366 1; #X msg 122 112 matrix 3 3 1 2 3 4 5 6 7 8 9; #X obj 122 231 mtx_isequal; #X obj 122 90 t b b; #X text 67 37 test whether [mtx_isequal] correctly detects the inequality of 2 matrices; #X obj 122 347 select 0; #X msg 154 138 matrix 2 2 1 2 3 4; #X connect 0 0 5 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 4 0 7 0; #X connect 5 0 3 0; #X connect 5 1 8 0; #X connect 7 0 2 0; #X connect 8 0 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/000077500000000000000000000000001514557770000236545ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/00_exist.pd000066400000000000000000000004771514557770000256440ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_le; #X text 67 37 test for existence of [mtx_le]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/01_function.pd000066400000000000000000000021061514557770000263250ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X obj 122 221 mtx_le 2; #X obj 236 221 <= 2; #X obj 277 221 <= 2; #X obj 318 220 <= 2; #X obj 359 220 <= 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/02_function.pd000066400000000000000000000025711514557770000263340ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_le; #X obj 236 269 <=; #X obj 267 269 <=; #X obj 298 268 <=; #X obj 329 268 <=; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/03_function.pd000066400000000000000000000021031514557770000263240ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_le 1; #X obj 256 221 <= 1; #X obj 297 221 <= 1; #X obj 338 220 <= 1; #X obj 379 220 <= 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/04_function.pd000066400000000000000000000024571514557770000263410ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_le; #X obj 236 269 <=; #X obj 267 269 <=; #X obj 298 268 <=; #X obj 329 268 <=; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/05_function.pd000066400000000000000000000005611514557770000263340ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_le 7; #X obj 207 221 <= 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/06_function.pd000066400000000000000000000024601514557770000263350ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 <=; #X obj 267 269 <=; #X obj 298 268 <=; #X obj 329 268 <=; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_le 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/07_function.pd000066400000000000000000000007471514557770000263440ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_le 0; #X obj 239 251 <=; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/08_function.pd000066400000000000000000000024611514557770000263400ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 <=; #X obj 267 269 <=; #X obj 298 268 <=; #X obj 329 268 <=; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_le 0; #X msg 122 132 4 3 7 6; #X msg 185 133 123; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/09_function.pd000066400000000000000000000025541514557770000263440ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_le; #X obj 236 269 <=; #X obj 267 269 <=; #X obj 298 268 <=; #X obj 329 268 <=; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 34; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_le/10_function.pd000066400000000000000000000025511514557770000263310ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_le; #X obj 236 269 <=; #X obj 267 269 <=; #X obj 298 268 <=; #X obj 329 268 <=; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_log/000077500000000000000000000000001514557770000240355ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_log/00_exist.pd000066400000000000000000000005011514557770000260110ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_log; #X text 67 37 test for existence of [mtx_log]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_log/01_function.pd000066400000000000000000000007131514557770000265100ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_log; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 188 matrix 1 1 \$1; #X obj 165 232 log; #X obj 122 271 ==; #X msg 122 127 2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_log/02_function.pd000066400000000000000000000021721514557770000265120ustar00rootroot00000000000000#N canvas 597 136 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_log; #X text 67 37 test for existence of [mtx_log]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 184 300 *; #X obj 122 300 *; #X obj 122 326 *; #X obj 236 218 unpack 0 0 0 0; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 184 277 ==; #X obj 215 277 ==; #X obj 236 239 log; #X obj 267 239 log; #X obj 298 238 log; #X obj 329 238 log; #X msg 122 110 3 1 10.5 0.1; #X connect 0 0 5 0; #X connect 2 0 7 0; #X connect 4 0 2 0; #X connect 5 0 21 0; #X connect 6 0 4 0; #X connect 6 1 12 0; #X connect 7 0 8 0; #X connect 8 0 13 0; #X connect 8 1 14 0; #X connect 8 2 15 0; #X connect 8 3 16 0; #X connect 9 0 11 1; #X connect 10 0 11 0; #X connect 11 0 1 0; #X connect 12 0 17 0; #X connect 12 1 18 0; #X connect 12 2 19 0; #X connect 12 3 20 0; #X connect 13 0 10 0; #X connect 14 0 10 1; #X connect 15 0 9 0; #X connect 16 0 9 1; #X connect 17 0 13 1; #X connect 18 0 14 1; #X connect 19 0 15 1; #X connect 20 0 16 1; #X connect 21 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_log/03_function.pd000066400000000000000000000027461514557770000265220ustar00rootroot00000000000000#N canvas 42 94 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_log; #X text 67 37 test for existence of [mtx_log]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 300 *; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 184 277 ==; #X obj 215 277 ==; #X obj 266 239 log; #X obj 297 239 log; #X obj 328 238 log; #X obj 359 238 log; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 300 *; #X obj 254 277 ==; #X obj 285 277 ==; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 log; #X obj 419 238 log; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 347 *; #X msg 122 110 4 2 10.5 0.05 100 12; #X connect 0 0 4 0; #X connect 2 0 22 0; #X connect 4 0 27 0; #X connect 5 0 17 0; #X connect 5 1 25 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 26 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 6 0; #X connect 12 0 6 1; #X connect 13 0 9 1; #X connect 14 0 10 1; #X connect 15 0 11 1; #X connect 16 0 12 1; #X connect 17 0 2 0; #X connect 18 0 26 1; #X connect 19 0 18 0; #X connect 20 0 18 1; #X connect 21 0 9 0; #X connect 21 1 10 0; #X connect 21 2 11 0; #X connect 21 3 12 0; #X connect 21 4 19 0; #X connect 21 5 20 0; #X connect 22 0 21 0; #X connect 23 0 19 1; #X connect 24 0 20 1; #X connect 25 0 13 0; #X connect 25 1 14 0; #X connect 25 2 15 0; #X connect 25 3 16 0; #X connect 25 4 23 0; #X connect 25 5 24 0; #X connect 26 0 1 0; #X connect 27 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_log/04_function.pd000066400000000000000000000025601514557770000265150ustar00rootroot00000000000000#N canvas 385 142 710 488 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 222 191 mtx_log; #X text 67 37 test for existence of [mtx_log]; #X msg 222 170 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 222 110 3 -1 -10.5 0; #X obj 222 135 t l l; #X msg 222 213 \$3 \$4 \$5 \$6; #X obj 222 238 unpack 0 0 0 0; #X obj 284 300 *; #X obj 222 300 *; #X obj 222 326 *; #X obj 336 218 unpack 0 0 0 0; #X obj 222 277 ==; #X obj 253 277 ==; #X obj 284 277 ==; #X obj 315 277 ==; #X obj 336 239 log; #X obj 367 239 log; #X obj 398 238 log; #X obj 429 238 log; #X obj 122 89 t b b; #X obj 222 433 print mtx_log; #X msg 222 392 for NaNs the behaviour is different from [log] \, this is no bug !; #X msg 122 354 1; #X obj 222 351 select 0; #X connect 0 0 21 0; #X connect 2 0 7 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 4 0; #X connect 6 1 12 0; #X connect 7 0 8 0; #X connect 8 0 13 0; #X connect 8 1 14 0; #X connect 8 2 15 0; #X connect 8 3 16 0; #X connect 9 0 11 1; #X connect 10 0 11 0; #X connect 11 0 25 0; #X connect 12 0 17 0; #X connect 12 1 18 0; #X connect 12 2 19 0; #X connect 12 3 20 0; #X connect 13 0 10 0; #X connect 14 0 10 1; #X connect 15 0 9 0; #X connect 16 0 9 1; #X connect 17 0 13 1; #X connect 18 0 14 1; #X connect 19 0 15 1; #X connect 20 0 16 1; #X connect 21 0 24 0; #X connect 21 1 5 0; #X connect 23 0 22 0; #X connect 24 0 1 0; #X connect 25 0 23 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/000077500000000000000000000000001514557770000236735ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/00_exist.pd000066400000000000000000000004771514557770000256630ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_lt; #X text 67 37 test for existence of [mtx_lt]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/01_function.pd000066400000000000000000000021021514557770000263400ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X obj 122 221 mtx_lt 2; #X obj 236 221 < 2; #X obj 277 221 < 2; #X obj 318 220 < 2; #X obj 359 220 < 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/02_function.pd000066400000000000000000000025651514557770000263560ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_lt; #X obj 236 269 <; #X obj 267 269 <; #X obj 298 268 <; #X obj 329 268 <; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/03_function.pd000066400000000000000000000020771514557770000263550ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_lt 1; #X obj 256 221 < 1; #X obj 297 221 < 1; #X obj 338 220 < 1; #X obj 379 220 < 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/04_function.pd000066400000000000000000000024531514557770000263540ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_lt; #X obj 236 269 <; #X obj 267 269 <; #X obj 298 268 <; #X obj 329 268 <; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/05_function.pd000066400000000000000000000005601514557770000263520ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_lt 7; #X obj 207 221 < 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/06_function.pd000066400000000000000000000024541514557770000263570ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 <; #X obj 267 269 <; #X obj 298 268 <; #X obj 329 268 <; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_lt 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/07_function.pd000066400000000000000000000007461514557770000263620ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_lt 0; #X obj 239 251 <; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/08_function.pd000066400000000000000000000024551514557770000263620ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 <; #X obj 267 269 <; #X obj 298 268 <; #X obj 329 268 <; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_lt 0; #X msg 122 132 4 3 7 6; #X msg 185 133 123; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/09_function.pd000066400000000000000000000025501514557770000263570ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_lt; #X obj 236 269 <; #X obj 267 269 <; #X obj 298 268 <; #X obj 329 268 <; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 34; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_lt/10_function.pd000066400000000000000000000025451514557770000263530ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_lt; #X obj 236 269 <; #X obj 267 269 <; #X obj 298 268 <; #X obj 329 268 <; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_matcher/000077500000000000000000000000001514557770000246775ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_matcher/00_exist.pd000066400000000000000000000005111514557770000266540ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_matcher; #X text 67 37 test for existence of [mtx_matcher]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_matrix/000077500000000000000000000000001514557770000245605ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_matrix/00_exist.pd000066400000000000000000000004771514557770000265500ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [matrix]; #X obj 122 161 matrix; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; #X connect 6 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_matrix/00_exist1.pd000066400000000000000000000004121514557770000266160ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx]; #X obj 122 161 mtx 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/000077500000000000000000000000001514557770000240415ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/00_exist.pd000066400000000000000000000005011514557770000260150ustar00rootroot00000000000000#N canvas 166 104 310 436 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_max; #X text 67 37 test for existence of [mtx_max]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/01_function.pd000066400000000000000000000005721514557770000265170ustar00rootroot00000000000000#N canvas 50 42 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 122 265 ==; #X msg 122 127 -2; #X obj 122 211 mtx_max; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 3 1 5 1; #X connect 4 0 7 0; #X connect 5 0 1 0; #X connect 6 0 3 0; #X connect 7 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/02_function.pd000066400000000000000000000012561514557770000265200ustar00rootroot00000000000000#N canvas 175 99 591 461 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_max]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 277 ==; #X obj 297 167 unpack 0 0 0 0; #X obj 297 188 max; #X obj 359 187 max; #X obj 297 208 max; #X obj 122 191 mtx_max; #X obj 122 136 t l l; #X connect 0 0 4 0; #X connect 3 0 11 0; #X connect 4 0 5 0; #X connect 5 0 12 0; #X connect 6 0 1 0; #X connect 7 0 8 0; #X connect 7 1 8 1; #X connect 7 2 9 0; #X connect 7 3 9 1; #X connect 8 0 10 0; #X connect 9 0 10 1; #X connect 10 0 6 1; #X connect 11 0 6 0; #X connect 12 0 3 0; #X connect 12 1 7 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/03_function.pd000066400000000000000000000017561514557770000265260ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_max]; #X obj 122 89 t b; #X obj 122 135 t l l; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 349 196 unpack 0 0 0 0 0 0; #X obj 349 217 max; #X obj 380 217 max; #X obj 411 216 max; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X obj 122 255 unpack 0 0 0; #X obj 122 191 mtx_max :; #X connect 0 0 3 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 4 1 7 0; #X connect 5 0 17 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 7 2 10 0; #X connect 7 3 8 1; #X connect 7 4 9 1; #X connect 7 5 10 1; #X connect 8 0 13 1; #X connect 9 0 14 1; #X connect 10 0 15 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 11 0; #X connect 14 0 11 1; #X connect 15 0 12 1; #X connect 16 0 13 0; #X connect 16 1 14 0; #X connect 16 2 15 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/04_function.pd000066400000000000000000000017601514557770000265220ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_max]; #X obj 122 89 t b; #X obj 122 135 t l l; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 138 226 unpack 0 0 0 0 0 0; #X obj 138 247 max; #X obj 169 247 max; #X obj 200 246 max; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 161 307 ==; #X obj 201 307 ==; #X obj 122 285 unpack 0 0 0; #X obj 122 191 mtx_max col; #X connect 0 0 3 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 4 1 7 0; #X connect 5 0 17 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 7 2 10 0; #X connect 7 3 8 1; #X connect 7 4 9 1; #X connect 7 5 10 1; #X connect 8 0 13 1; #X connect 9 0 14 1; #X connect 10 0 15 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 11 0; #X connect 14 0 11 1; #X connect 15 0 12 1; #X connect 16 0 13 0; #X connect 16 1 14 0; #X connect 16 2 15 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/05_function.pd000066400000000000000000000017631514557770000265260ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_max]; #X obj 122 89 t b; #X obj 122 135 t l l; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 152 216 unpack 0 0 0 0 0 0; #X obj 152 237 max; #X obj 183 237 max; #X obj 214 236 max; #X obj 122 320 *; #X obj 122 346 *; #X obj 122 297 ==; #X obj 161 297 ==; #X obj 201 297 ==; #X obj 122 275 unpack 0 0 0; #X obj 122 191 mtx_max column; #X connect 0 0 3 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 4 1 7 0; #X connect 5 0 17 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 7 2 10 0; #X connect 7 3 8 1; #X connect 7 4 9 1; #X connect 7 5 10 1; #X connect 8 0 13 1; #X connect 9 0 14 1; #X connect 10 0 15 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 11 0; #X connect 14 0 11 1; #X connect 15 0 12 1; #X connect 16 0 13 0; #X connect 16 1 14 0; #X connect 16 2 15 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max/06_function.pd000066400000000000000000000016651514557770000265300ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_max]; #X obj 122 89 t b; #X obj 122 135 t l l; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 122 341 *; #X obj 122 318 ==; #X obj 161 318 ==; #X obj 138 255 unpack 0 0 0 0 0 0; #X obj 122 296 unpack 0 0; #X obj 138 276 max; #X obj 169 276 max; #X obj 198 276 max; #X obj 229 276 max; #X obj 122 191 mtx_max row; #X connect 0 0 3 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 4 1 10 0; #X connect 5 0 16 0; #X connect 6 0 4 0; #X connect 7 0 1 0; #X connect 8 0 7 0; #X connect 9 0 7 1; #X connect 10 0 12 0; #X connect 10 1 13 0; #X connect 10 2 13 1; #X connect 10 3 14 0; #X connect 10 4 15 0; #X connect 10 5 15 1; #X connect 11 0 8 0; #X connect 11 1 9 0; #X connect 12 0 8 1; #X connect 13 0 12 1; #X connect 14 0 9 1; #X connect 15 0 14 1; #X connect 16 0 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max2/000077500000000000000000000000001514557770000241235ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_max2/00_exist.pd000066400000000000000000000005031514557770000261010ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_max2; #X text 67 37 test for existence of [mtx_max2]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mean/000077500000000000000000000000001514557770000241745ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mean/00_exist.pd000066400000000000000000000005031514557770000261520ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_mean; #X text 67 37 test for existence of [mtx_mean]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/000077500000000000000000000000001514557770000240375ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/00_exist.pd000066400000000000000000000004761514557770000260260ustar00rootroot00000000000000#N canvas 0 77 396 423 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_min; #X text 67 37 test for existence of [mtx_min]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/01_function.pd000066400000000000000000000005721514557770000265150ustar00rootroot00000000000000#N canvas 50 42 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 122 265 ==; #X msg 122 127 -2; #X obj 122 211 mtx_min; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 3 1 5 1; #X connect 4 0 7 0; #X connect 5 0 1 0; #X connect 6 0 3 0; #X connect 7 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/02_function.pd000066400000000000000000000012561514557770000265160ustar00rootroot00000000000000#N canvas 175 99 591 461 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_min]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 285 168 unpack 0 0 0 0; #X obj 122 277 ==; #X obj 285 189 min; #X obj 347 188 min; #X obj 285 209 min; #X obj 122 191 mtx_min; #X obj 122 135 t l l; #X connect 0 0 4 0; #X connect 3 0 11 0; #X connect 4 0 5 0; #X connect 5 0 12 0; #X connect 6 0 8 0; #X connect 6 1 8 1; #X connect 6 2 9 0; #X connect 6 3 9 1; #X connect 7 0 1 0; #X connect 8 0 10 0; #X connect 9 0 10 1; #X connect 10 0 7 1; #X connect 11 0 7 0; #X connect 12 0 3 0; #X connect 12 1 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/03_function.pd000066400000000000000000000017601514557770000265170ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_min]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 216 195 unpack 0 0 0 0 0 0; #X obj 216 216 min; #X obj 247 216 min; #X obj 278 215 min; #X obj 122 255 unpack 0 0 0; #X obj 122 191 mtx_min :; #X connect 0 0 3 0; #X connect 3 0 11 0; #X connect 4 0 10 0; #X connect 4 1 12 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 17 0; #X connect 11 0 4 0; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; #X connect 12 3 13 1; #X connect 12 4 14 1; #X connect 12 5 15 1; #X connect 13 0 7 1; #X connect 14 0 8 1; #X connect 15 0 9 1; #X connect 16 0 7 0; #X connect 16 1 8 0; #X connect 16 2 9 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/04_function.pd000066400000000000000000000017621514557770000265220ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_min]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 286 195 unpack 0 0 0 0 0 0; #X obj 286 216 min; #X obj 317 216 min; #X obj 348 215 min; #X obj 122 255 unpack 0 0 0; #X obj 122 191 mtx_min col; #X connect 0 0 3 0; #X connect 3 0 11 0; #X connect 4 0 10 0; #X connect 4 1 12 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 17 0; #X connect 11 0 4 0; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; #X connect 12 3 13 1; #X connect 12 4 14 1; #X connect 12 5 15 1; #X connect 13 0 7 1; #X connect 14 0 8 1; #X connect 15 0 9 1; #X connect 16 0 7 0; #X connect 16 1 8 0; #X connect 16 2 9 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/05_function.pd000066400000000000000000000017651514557770000265260ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_min]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 286 195 unpack 0 0 0 0 0 0; #X obj 286 216 min; #X obj 317 216 min; #X obj 348 215 min; #X obj 122 255 unpack 0 0 0; #X obj 122 191 mtx_min column; #X connect 0 0 3 0; #X connect 3 0 11 0; #X connect 4 0 10 0; #X connect 4 1 12 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 17 0; #X connect 11 0 4 0; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; #X connect 12 3 13 1; #X connect 12 4 14 1; #X connect 12 5 15 1; #X connect 13 0 7 1; #X connect 14 0 8 1; #X connect 15 0 9 1; #X connect 16 0 7 0; #X connect 16 1 8 0; #X connect 16 2 9 0; #X connect 17 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min/06_function.pd000066400000000000000000000016651514557770000265260ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_min]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 277 ==; #X obj 161 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 138 214 unpack 0 0 0 0 0 0; #X obj 138 235 min; #X obj 169 235 min; #X obj 122 255 unpack 0 0; #X obj 198 235 min; #X obj 229 235 min; #X obj 122 191 mtx_min row; #X connect 0 0 3 0; #X connect 3 0 9 0; #X connect 4 0 8 0; #X connect 4 1 10 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 16 0; #X connect 9 0 4 0; #X connect 10 0 11 0; #X connect 10 1 12 0; #X connect 10 2 12 1; #X connect 10 3 14 0; #X connect 10 4 15 0; #X connect 10 5 15 1; #X connect 11 0 6 1; #X connect 12 0 11 1; #X connect 13 0 6 0; #X connect 13 1 7 0; #X connect 14 0 7 1; #X connect 15 0 14 1; #X connect 16 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min2/000077500000000000000000000000001514557770000241215ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_min2/00_exist.pd000066400000000000000000000005031514557770000260770ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_min2; #X text 67 37 test for existence of [mtx_min2]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/000077500000000000000000000000001514557770000245455ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/00_exist.pd000066400000000000000000000005071514557770000265270ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_minmax; #X text 67 37 test for existence of [mtx_minmax]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/01_function.pd000066400000000000000000000007621514557770000272240ustar00rootroot00000000000000#N canvas 50 42 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 122 265 ==; #X msg 122 127 -2; #X obj 122 211 mtx_minmax; #X obj 183 265 ==; #X obj 122 299 *; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 3 1 5 1; #X connect 3 1 8 1; #X connect 4 0 7 0; #X connect 5 0 9 0; #X connect 6 0 3 0; #X connect 7 0 5 0; #X connect 7 1 8 0; #X connect 8 0 9 1; #X connect 9 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/02_function.pd000066400000000000000000000020451514557770000272210ustar00rootroot00000000000000#N canvas 175 99 591 461 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_abs]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 300 *; #X obj 285 168 unpack 0 0 0 0; #X obj 122 277 ==; #X obj 153 277 ==; #X obj 122 191 mtx_minmax; #X obj 285 189 min; #X obj 347 188 min; #X obj 285 209 min; #X obj 122 135 t l l l; #X obj 387 167 unpack 0 0 0 0; #X obj 387 188 max; #X obj 449 187 max; #X obj 387 208 max; #X connect 0 0 4 0; #X connect 3 0 10 0; #X connect 4 0 5 0; #X connect 5 0 14 0; #X connect 6 0 1 0; #X connect 7 0 11 0; #X connect 7 1 11 1; #X connect 7 2 12 0; #X connect 7 3 12 1; #X connect 8 0 6 0; #X connect 9 0 6 1; #X connect 10 0 8 0; #X connect 10 1 9 0; #X connect 11 0 13 0; #X connect 12 0 13 1; #X connect 13 0 8 1; #X connect 14 0 3 0; #X connect 14 1 7 0; #X connect 14 2 15 0; #X connect 15 0 16 0; #X connect 15 1 16 1; #X connect 15 2 17 0; #X connect 15 3 17 1; #X connect 16 0 18 0; #X connect 17 0 18 1; #X connect 18 0 9 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/03_function.pd000066400000000000000000000032251514557770000272230ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_abs]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 122 191 mtx_minmax :; #X obj 216 195 unpack 0 0 0 0 0 0; #X obj 216 216 min; #X obj 247 216 min; #X obj 278 215 min; #X obj 122 255 unpack 0 0 0; #X obj 122 357 *; #X obj 349 196 unpack 0 0 0 0 0 0; #X obj 349 217 max; #X obj 380 217 max; #X obj 411 216 max; #X obj 333 300 *; #X obj 333 326 *; #X obj 333 277 ==; #X obj 372 277 ==; #X obj 412 277 ==; #X obj 333 255 unpack 0 0 0; #X connect 0 0 3 0; #X connect 3 0 11 0; #X connect 4 0 10 0; #X connect 4 1 13 0; #X connect 4 1 19 0; #X connect 5 0 6 0; #X connect 6 0 18 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 12 0; #X connect 11 0 4 0; #X connect 12 0 17 0; #X connect 12 1 28 0; #X connect 13 0 14 0; #X connect 13 1 15 0; #X connect 13 2 16 0; #X connect 13 3 14 1; #X connect 13 4 15 1; #X connect 13 5 16 1; #X connect 14 0 7 1; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 7 0; #X connect 17 1 8 0; #X connect 17 2 9 0; #X connect 18 0 1 0; #X connect 19 0 20 0; #X connect 19 1 21 0; #X connect 19 2 22 0; #X connect 19 3 20 1; #X connect 19 4 21 1; #X connect 19 5 22 1; #X connect 20 0 25 1; #X connect 21 0 26 1; #X connect 22 0 27 1; #X connect 23 0 24 0; #X connect 24 0 18 1; #X connect 25 0 23 0; #X connect 26 0 23 1; #X connect 27 0 24 1; #X connect 28 0 25 0; #X connect 28 1 26 0; #X connect 28 2 27 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/04_function.pd000066400000000000000000000032271514557770000272260ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_abs]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 286 195 unpack 0 0 0 0 0 0; #X obj 286 216 min; #X obj 317 216 min; #X obj 348 215 min; #X obj 122 255 unpack 0 0 0; #X obj 122 357 *; #X obj 419 196 unpack 0 0 0 0 0 0; #X obj 419 217 max; #X obj 450 217 max; #X obj 481 216 max; #X obj 403 300 *; #X obj 403 326 *; #X obj 403 277 ==; #X obj 442 277 ==; #X obj 482 277 ==; #X obj 403 255 unpack 0 0 0; #X obj 122 191 mtx_minmax col; #X connect 0 0 3 0; #X connect 3 0 11 0; #X connect 4 0 10 0; #X connect 4 1 12 0; #X connect 4 1 18 0; #X connect 5 0 6 0; #X connect 6 0 17 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 28 0; #X connect 11 0 4 0; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; #X connect 12 3 13 1; #X connect 12 4 14 1; #X connect 12 5 15 1; #X connect 13 0 7 1; #X connect 14 0 8 1; #X connect 15 0 9 1; #X connect 16 0 7 0; #X connect 16 1 8 0; #X connect 16 2 9 0; #X connect 17 0 1 0; #X connect 18 0 19 0; #X connect 18 1 20 0; #X connect 18 2 21 0; #X connect 18 3 19 1; #X connect 18 4 20 1; #X connect 18 5 21 1; #X connect 19 0 24 1; #X connect 20 0 25 1; #X connect 21 0 26 1; #X connect 22 0 23 0; #X connect 23 0 17 1; #X connect 24 0 22 0; #X connect 25 0 22 1; #X connect 26 0 23 1; #X connect 27 0 24 0; #X connect 27 1 25 0; #X connect 27 2 26 0; #X connect 28 0 16 0; #X connect 28 1 27 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/05_function.pd000066400000000000000000000032321514557770000272230ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_abs]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X obj 201 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 286 195 unpack 0 0 0 0 0 0; #X obj 286 216 min; #X obj 317 216 min; #X obj 348 215 min; #X obj 122 255 unpack 0 0 0; #X obj 122 357 *; #X obj 419 196 unpack 0 0 0 0 0 0; #X obj 419 217 max; #X obj 450 217 max; #X obj 481 216 max; #X obj 403 300 *; #X obj 403 326 *; #X obj 403 277 ==; #X obj 442 277 ==; #X obj 482 277 ==; #X obj 403 255 unpack 0 0 0; #X obj 122 191 mtx_minmax column; #X connect 0 0 3 0; #X connect 3 0 11 0; #X connect 4 0 10 0; #X connect 4 1 12 0; #X connect 4 1 18 0; #X connect 5 0 6 0; #X connect 6 0 17 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 28 0; #X connect 11 0 4 0; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; #X connect 12 3 13 1; #X connect 12 4 14 1; #X connect 12 5 15 1; #X connect 13 0 7 1; #X connect 14 0 8 1; #X connect 15 0 9 1; #X connect 16 0 7 0; #X connect 16 1 8 0; #X connect 16 2 9 0; #X connect 17 0 1 0; #X connect 18 0 19 0; #X connect 18 1 20 0; #X connect 18 2 21 0; #X connect 18 3 19 1; #X connect 18 4 20 1; #X connect 18 5 21 1; #X connect 19 0 24 1; #X connect 20 0 25 1; #X connect 21 0 26 1; #X connect 22 0 23 0; #X connect 23 0 17 1; #X connect 24 0 22 0; #X connect 25 0 22 1; #X connect 26 0 23 1; #X connect 27 0 24 0; #X connect 27 1 25 0; #X connect 27 2 26 0; #X connect 28 0 16 0; #X connect 28 1 27 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_minmax/06_function.pd000066400000000000000000000030321514557770000272220ustar00rootroot00000000000000#N canvas 105 62 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_abs]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 122 300 *; #X obj 122 326 *; #X obj 122 277 ==; #X obj 161 277 ==; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 138 214 unpack 0 0 0 0 0 0; #X obj 138 235 min; #X obj 169 235 min; #X obj 122 191 mtx_minmax row; #X obj 122 255 unpack 0 0; #X obj 198 235 min; #X obj 229 235 min; #X obj 262 300 *; #X obj 262 277 ==; #X obj 301 277 ==; #X obj 278 214 unpack 0 0 0 0 0 0; #X obj 262 255 unpack 0 0; #X obj 278 235 max; #X obj 309 235 max; #X obj 338 235 max; #X obj 369 235 max; #X connect 0 0 3 0; #X connect 3 0 10 0; #X connect 4 0 9 0; #X connect 4 1 11 0; #X connect 4 1 21 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 14 0; #X connect 10 0 4 0; #X connect 11 0 12 0; #X connect 11 1 13 0; #X connect 11 2 13 1; #X connect 11 3 16 0; #X connect 11 4 17 0; #X connect 11 5 17 1; #X connect 12 0 7 1; #X connect 13 0 12 1; #X connect 14 0 15 0; #X connect 14 1 22 0; #X connect 15 0 7 0; #X connect 15 1 8 0; #X connect 16 0 8 1; #X connect 17 0 16 1; #X connect 18 0 6 1; #X connect 19 0 18 0; #X connect 20 0 18 1; #X connect 21 0 23 0; #X connect 21 1 24 0; #X connect 21 2 24 1; #X connect 21 3 25 0; #X connect 21 4 26 0; #X connect 21 5 26 1; #X connect 22 0 19 0; #X connect 22 1 20 0; #X connect 23 0 19 1; #X connect 24 0 23 1; #X connect 25 0 20 1; #X connect 26 0 25 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mul/000077500000000000000000000000001514557770000240515ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mul/00_exist.pd000066400000000000000000000005031514557770000260270ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_mul]; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_mul 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mul/00_exist1.pd000066400000000000000000000004771514557770000261220ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_*]; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_* 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mul/00_exist2.pd000066400000000000000000000005011514557770000261070ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_.*]; #X msg 122 122 matrix 1 1 1; #X obj 122 161 mtx_.* 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_mul/01_dotmul.pd000066400000000000000000000010231514557770000261760ustar00rootroot00000000000000#N canvas 885 212 445 546 10; #X obj 52 270 mtx_.*; #X obj 52 204 t b b; #X msg 82 146 bang; #X obj 52 114 inlet bang; #X obj 52 383 b; #X msg 52 406 1; #X obj 52 435 outlet 1==OK; #X text 38 47 with iemmatrix-0.3.1 [mtx_.*] is broken. as it refuses to multiply; #X msg 52 229 matrix 3 3 1 0 0 0 1 0 0 0 1; #X msg 85 249 matrix 3 3 1 1 1 1 1 1 1 1 1; #X connect 0 0 4 0; #X connect 1 0 8 0; #X connect 1 1 9 0; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 8 0 0 0; #X connect 9 0 0 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/000077500000000000000000000000001514557770000240375ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/00_exist.pd000066400000000000000000000005011514557770000260130ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_neq; #X text 67 37 test for existence of [mtx_neq]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/01_function.pd000066400000000000000000000021071514557770000265110ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X obj 122 221 mtx_neq 2; #X obj 236 221 != 2; #X obj 277 221 != 2; #X obj 318 220 != 2; #X obj 359 220 != 2; #X msg 122 132 2 5 -1.1 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 16 0; #X connect 7 1 17 0; #X connect 7 2 18 0; #X connect 7 3 19 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 15 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 20 0; #X connect 15 0 2 0; #X connect 16 0 8 1; #X connect 17 0 9 1; #X connect 18 0 10 1; #X connect 19 0 11 1; #X connect 20 0 13 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/02_function.pd000066400000000000000000000025721514557770000265200ustar00rootroot00000000000000#N canvas 176 399 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_neq; #X obj 236 269 !=; #X obj 267 269 !=; #X obj 298 268 !=; #X obj 329 268 !=; #X msg 122 132 1 2 3 4; #X msg 185 133 9 8 7 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/03_function.pd000066400000000000000000000021041514557770000265100ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 2 1 0; #X obj 122 221 mtx_neq 1; #X obj 256 221 != 1; #X obj 297 221 != 1; #X obj 338 220 != 1; #X obj 379 220 != 1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/04_function.pd000066400000000000000000000024601514557770000265160ustar00rootroot00000000000000#N canvas 190 400 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_neq; #X obj 236 269 !=; #X obj 267 269 !=; #X obj 298 268 !=; #X obj 329 268 !=; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 5; #X msg 185 133 1 2 4 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/05_function.pd000066400000000000000000000005621514557770000265200ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 11; #X obj 122 221 mtx_neq 7; #X obj 207 221 != 7; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/06_function.pd000066400000000000000000000024611514557770000265210ustar00rootroot00000000000000#N canvas 282 295 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 !=; #X obj 267 269 !=; #X obj 298 268 !=; #X obj 329 268 !=; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_neq 0; #X msg 122 132 0 2 3 5; #X msg 185 133 17; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/07_function.pd000066400000000000000000000007501514557770000265210ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_neq 0; #X obj 239 251 !=; #X msg 122 132 6; #X msg 152 131 9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/08_function.pd000066400000000000000000000024621514557770000265240ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 !=; #X obj 267 269 !=; #X obj 298 268 !=; #X obj 329 268 !=; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_neq 0; #X msg 122 132 4 3 7 6; #X msg 185 133 123; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/09_function.pd000066400000000000000000000025551514557770000265300ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_neq; #X obj 236 269 !=; #X obj 267 269 !=; #X obj 298 268 !=; #X obj 329 268 !=; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 10 9 -1 3; #X msg 185 133 7 34; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_neq/10_function.pd000066400000000000000000000025521514557770000265150ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_neq; #X obj 236 269 !=; #X obj 267 269 !=; #X obj 298 268 !=; #X obj 329 268 !=; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 185 133 5 3; #X msg 122 132 4 2 9 8; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 24 0; #X connect 13 1 23 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 14 0; #X connect 24 0 15 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_not/000077500000000000000000000000001514557770000240545ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_not/00_exist.pd000066400000000000000000000005011514557770000260300ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_not; #X text 67 37 test for existence of [mtx_not]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_not/00_exist1.pd000066400000000000000000000004751514557770000261230ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_!; #X text 67 37 test for existence of [mtx_!]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/000077500000000000000000000000001514557770000242205ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/00_exist.pd000066400000000000000000000004241514557770000262000ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_ones]; #X obj 122 161 mtx_ones 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/01_function.pd000066400000000000000000000011771514557770000267000ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 214 \$3 \$4 \$5 \$6; #X obj 122 161 mtx_ones 2; #X obj 122 238 unpack 0 0 0 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 262 == 1; #X obj 162 262 == 1; #X obj 202 262 == 1; #X obj 242 262 == 1; #X connect 0 0 8 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 9 0; #X connect 4 1 10 0; #X connect 4 2 11 0; #X connect 4 3 12 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 6 1; #X connect 8 0 3 0; #X connect 9 0 5 0; #X connect 10 0 5 1; #X connect 11 0 7 0; #X connect 12 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/02_function.pd000066400000000000000000000015341514557770000266760ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 161 mtx_ones 2 3; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 282 282 *; #X obj 122 324 *; #X obj 122 262 == 1; #X obj 162 262 == 1; #X obj 202 262 == 1; #X obj 242 262 == 1; #X obj 282 262 == 1; #X obj 322 262 == 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 10 0; #X connect 4 0 3 1; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 8 1 12 0; #X connect 8 2 13 0; #X connect 8 3 14 0; #X connect 8 4 15 0; #X connect 8 5 16 0; #X connect 9 0 10 1; #X connect 10 0 1 0; #X connect 11 0 2 0; #X connect 12 0 2 1; #X connect 13 0 4 0; #X connect 14 0 4 1; #X connect 15 0 9 0; #X connect 16 0 9 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/03_function.pd000066400000000000000000000012551514557770000266770ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 122 161 mtx_ones 7 8; #X msg 122 214 \$3 \$4 \$5 \$6; #X msg 122 135 2; #X obj 122 262 == 1; #X obj 162 262 == 1; #X obj 202 262 == 1; #X obj 242 262 == 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 3 1; #X connect 5 0 9 0; #X connect 6 0 10 0; #X connect 6 1 11 0; #X connect 6 2 12 0; #X connect 6 3 13 0; #X connect 7 0 8 0; #X connect 8 0 6 0; #X connect 9 0 7 0; #X connect 10 0 2 0; #X connect 11 0 2 1; #X connect 12 0 4 0; #X connect 13 0 4 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/04_function.pd000066400000000000000000000016011514557770000266730ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 282 282 *; #X obj 122 324 *; #X msg 122 135 3 2; #X obj 122 161 mtx_ones; #X obj 122 262 == 1; #X obj 162 262 == 1; #X obj 202 262 == 1; #X obj 242 262 == 1; #X obj 282 262 == 1; #X obj 322 262 == 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 9 0; #X connect 4 0 3 1; #X connect 5 0 10 0; #X connect 6 0 7 0; #X connect 7 0 12 0; #X connect 7 1 13 0; #X connect 7 2 14 0; #X connect 7 3 15 0; #X connect 7 4 16 0; #X connect 7 5 17 0; #X connect 8 0 9 1; #X connect 9 0 1 0; #X connect 10 0 11 0; #X connect 11 0 6 0; #X connect 12 0 2 0; #X connect 13 0 2 1; #X connect 14 0 4 0; #X connect 15 0 4 1; #X connect 16 0 8 0; #X connect 17 0 8 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/05_function.pd000066400000000000000000000011161514557770000266750ustar00rootroot00000000000000#N canvas 541 351 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 104 t b; #X obj 122 191 mtx_ones 7 8; #X msg 122 135 10 14; #X msg 122 214 \$1 \$2; #X obj 122 157 t l l; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 179 215 unpack; #X obj 122 236 unpack; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 11 0; #X connect 7 0 4 0; #X connect 7 1 10 0; #X connect 8 0 2 0; #X connect 9 0 2 1; #X connect 10 0 8 1; #X connect 10 1 9 1; #X connect 11 0 8 0; #X connect 11 1 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_ones/06_function.pd000066400000000000000000000011121514557770000266720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 104 t b; #X obj 122 282 *; #X obj 122 191 mtx_ones 7 8; #X msg 122 214 \$1 \$2; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 122 236 unpack; #X msg 122 135 32; #X obj 122 157 t f f; #X obj 179 215 t f f; #X connect 0 0 2 0; #X connect 2 0 9 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 6 0 3 0; #X connect 7 0 3 1; #X connect 8 0 6 0; #X connect 8 1 7 0; #X connect 9 0 10 0; #X connect 10 0 4 0; #X connect 10 1 11 0; #X connect 11 0 6 1; #X connect 11 1 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/000077500000000000000000000000001514557770000236745ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/00_exist.pd000066400000000000000000000004771514557770000256640ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_or; #X text 67 37 test for existence of [mtx_or]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/01_function.pd000066400000000000000000000021031514557770000263420ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 0 1 0 2; #X obj 122 221 mtx_or 4; #X obj 236 221 || 4; #X obj 277 221 || 4; #X obj 318 220 || 4; #X obj 359 220 || 4; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/02_function.pd000066400000000000000000000025711514557770000263540ustar00rootroot00000000000000#N canvas 721 420 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_or; #X obj 236 269 ||; #X obj 267 269 ||; #X obj 298 268 ||; #X obj 329 268 ||; #X msg 122 132 0 1 0 1; #X msg 185 133 1 1 0 0; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/03_function.pd000066400000000000000000000021031514557770000263440ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 0 1 2 3; #X obj 122 221 mtx_or 2; #X obj 256 221 || 2; #X obj 297 221 || 2; #X obj 338 220 || 2; #X obj 379 220 || 2; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/04_function.pd000066400000000000000000000024571514557770000263610ustar00rootroot00000000000000#N canvas 385 142 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_or; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 2; #X obj 236 269 ||; #X obj 267 269 ||; #X obj 298 268 ||; #X obj 329 268 ||; #X msg 185 133 1 0 3 2; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 19 1; #X connect 12 1 20 1; #X connect 12 2 21 1; #X connect 12 3 22 1; #X connect 13 0 18 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 15 0; #X connect 16 1 17 0; #X connect 17 0 19 0; #X connect 17 1 20 0; #X connect 17 2 21 0; #X connect 17 3 22 0; #X connect 18 0 16 0; #X connect 19 0 7 1; #X connect 20 0 8 1; #X connect 21 0 9 1; #X connect 22 0 10 1; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/05_function.pd000066400000000000000000000005661514557770000263610ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 6.2; #X obj 122 221 mtx_or 1.1; #X obj 207 222 || 1.1; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/06_function.pd000066400000000000000000000024651514557770000263620ustar00rootroot00000000000000#N canvas 385 142 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 ||; #X obj 267 269 ||; #X obj 298 268 ||; #X obj 329 268 ||; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_or 0; #X msg 82 132 -1 0 2.2 0.1; #X msg 185 133 3.1; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/07_function.pd000066400000000000000000000007471514557770000263640ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_or 0; #X obj 239 251 ||; #X msg 122 132 2; #X msg 152 131 0; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/08_function.pd000066400000000000000000000024571514557770000263650ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 ||; #X obj 267 269 ||; #X obj 298 268 ||; #X obj 329 268 ||; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_or 0; #X msg 122 132 0 1 0 1; #X msg 185 133 2; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/09_function.pd000066400000000000000000000025511514557770000263610ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_or; #X obj 236 269 ||; #X obj 267 269 ||; #X obj 298 268 ||; #X obj 329 268 ||; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 0 1 0 1; #X msg 185 133 1 0; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_or/10_function.pd000066400000000000000000000025521514557770000263520ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_or; #X obj 236 269 ||; #X obj 267 269 ||; #X obj 298 268 ||; #X obj 329 268 ||; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 122 132 1 0 -1 2; #X msg 185 133 0 1; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_pivot/000077500000000000000000000000001514557770000244155ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_pivot/00_exist.pd000066400000000000000000000005051514557770000263750ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_pivot; #X text 67 37 test for existence of [mtx_pivot]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_prod/000077500000000000000000000000001514557770000242205ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_prod/00_exist.pd000066400000000000000000000005031514557770000261760ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_prod; #X text 67 37 test for existence of [mtx_prod]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rand/000077500000000000000000000000001514557770000242005ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rand/00_exist.pd000066400000000000000000000004241514557770000261600ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_rand]; #X obj 122 161 mtx_rand 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rand/01_default.pd000066400000000000000000000004711514557770000264530ustar00rootroot00000000000000#N canvas 386 139 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_rand]; #X obj 122 161 mtx_rand; #X obj 122 90 t b; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; #X connect 6 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_repmat/000077500000000000000000000000001514557770000245445ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_repmat/00_exist.pd000066400000000000000000000005071514557770000265260ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_repmat; #X text 67 37 test for existence of [mtx_repmat]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_resize/000077500000000000000000000000001514557770000245555ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_resize/00_exist.pd000066400000000000000000000005071514557770000265370ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_resize; #X text 67 37 test for existence of [mtx_resize]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_reverse/000077500000000000000000000000001514557770000247275ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_reverse/00_exist.pd000066400000000000000000000005111514557770000267040ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_reverse; #X text 67 37 test for existence of [mtx_reverse]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rfft/000077500000000000000000000000001514557770000242155ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rfft/00_exist.pd000066400000000000000000000005111514557770000261720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_rfft]; #X msg 122 122 matrix 1 4 0 0 0 0; #X obj 122 161 mtx_rfft; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rfft/01_function.pd000066400000000000000000000010301514557770000266610ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_rfft]; #X obj 122 161 mtx_rfft; #X msg 122 102 matrix 1 4 0.25 0.25 0.25 0.25; #X obj 210 207 mtx_isequal 0; #X obj 122 132 t a b; #X msg 185 160 matrix 1 3 1 0 0; #X obj 122 207 mtx_isequal; #X obj 122 244 *; #X connect 0 0 4 0; #X connect 3 0 8 0; #X connect 3 1 5 0; #X connect 4 0 6 0; #X connect 5 0 9 1; #X connect 6 0 3 0; #X connect 6 1 7 0; #X connect 7 0 8 1; #X connect 8 0 9 0; #X connect 9 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rfft/02_function.pd000066400000000000000000000006001514557770000266640ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_rfft]; #X obj 122 161 mtx_rfft; #X msg 122 122 matrix 1 4 0.25 0.25 0.25 0.25; #X obj 122 184 mtx_rifft; #X obj 122 207 mtx_isequal 0.25; #X connect 0 0 4 0; #X connect 3 0 5 0; #X connect 3 1 5 1; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 6 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rfft/03_function.pd000066400000000000000000000117151514557770000266760ustar00rootroot00000000000000#N canvas 316 110 645 562 10; #X obj 49 211 mtx_cumsum; #X msg 49 167 1 16; #X obj 49 189 mtx_ones; #X obj 49 233 mtx_- 1; #X obj 49 255 mtx_* 0; #X obj 117 165 / 8; #X obj 49 280 mtx_cos; #X obj 117 255 * 3.14159; #X text 109 280 cosine wave; #X obj 100 330 mtx_rfft, f 19; #X obj 90 141 t b f; #N canvas 205 83 207 172 pi 0; #X obj 38 16 loadbang; #X msg 38 39 1 1; #X obj 38 62 atan2; #X obj 38 85 * 4; #X obj 38 108 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X restore 168 232 pd pi; #N canvas 0 0 545 558 ~ 0; #X obj 74 80 inlet mtx; #X obj 343 208 array define \$0.orig~; #N canvas 1067 375 450 300 mtx2table 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 115 170 array set \$0.orig~; #X obj 221 76 array size \$0.orig~; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 220 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 163 76 t f f f; #X obj 236 132 + 1; #X obj 236 109 >> 1; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 13 0; #X connect 3 0 4 0; #X connect 4 0 7 0; #X connect 4 1 5 0; #X connect 7 0 9 0; #X connect 8 0 1 0; #X connect 12 0 11 0; #X connect 12 1 10 0; #X connect 13 0 3 1; #X connect 13 1 15 0; #X connect 13 2 6 0; #X connect 14 0 12 0; #X connect 15 0 14 0; #X restore 74 139 pd mtx2table; #X obj 112 212 tabreceive~ \$0.orig~; #X obj 112 235 rfft~; #X obj 112 258 tabsend~ \$0.re~; #X obj 222 258 tabsend~ \$0.im~; #X obj 343 240 array define \$0.re~; #X obj 343 260 array define \$0.im~; #X msg 74 160 set \$1 \, bang; #X obj 74 184 switch~; #X obj 62 342 array get \$0.re~; #X obj 62 292 bang~; #X obj 62 315 t b b, f 21; #X obj 185 341 array get \$0.im~; #N canvas 735 461 450 300 DSP? 0; #X obj 83 102 inlet; #X obj 83 125 spigot; #X obj 83 148 outlet; #X obj 134 113 r pd; #X obj 134 136 route dsp; #X text 86 64 only calculate if DSP is on...; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 4 0 1 1; #X restore 74 110 pd DSP?; #X text 75 25 calculate the rFFT using Pd's built-in [rfft~] object; #X text 74 50 (this patch only works if DSP is *on*); #X obj 62 485 outlet re; #X obj 185 486 outlet im; #X obj 185 462 mtx; #X obj 185 364 t l l; #X obj 212 388 list length; #X msg 212 411 1 \$1; #X obj 212 434 mtx_zeros; #X obj 62 462 mtx; #X obj 62 364 t l l; #X obj 89 388 list length; #X msg 89 411 1 \$1; #X obj 89 434 mtx_zeros; #X connect 0 0 15 0; #X connect 2 0 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 9 0 10 0; #X connect 11 0 26 0; #X connect 12 0 13 0; #X connect 13 0 11 0; #X connect 13 1 14 0; #X connect 14 0 21 0; #X connect 15 0 2 0; #X connect 20 0 19 0; #X connect 21 0 20 0; #X connect 21 1 22 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 24 0 20 1; #X connect 25 0 18 0; #X connect 26 0 25 0; #X connect 26 1 27 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X connect 29 0 25 1; #X restore 49 330 pd ~; #X obj 49 303 t a a, f 9; #X obj 90 8 inlet bang; #N canvas 735 461 450 300 DSP 0; #X obj 57 28 inlet post; #X obj 186 26 inlet pre; #X obj 328 70 r pd-dsp-started; #X obj 330 130 r pd-dsp-stopped; #X msg 328 95 1; #X msg 330 155 0; #X obj 218 109 i; #X obj 57 136 i; #X obj 57 53 t b; #X msg 57 161 dsp \$1; #X obj 57 186 s pd; #X obj 186 51 t b b; #X msg 186 76 1; #X connect 0 0 8 0; #X connect 1 0 11 0; #X connect 2 0 4 0; #X connect 3 0 5 0; #X connect 4 0 6 1; #X connect 5 0 6 1; #X connect 6 0 7 1; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 11 1 6 0; #X connect 12 0 9 0; #X restore 133 100 pd DSP; #X msg 159 8 bang; #X msg 90 31 2.5; #X floatatom 159 45 5 0 0 0 - - - 0; #X obj 49 366 mtx_-; #X obj 49 389 mtx_abs; #X obj 149 366 mtx_-; #X obj 149 389 mtx_abs; #X obj 49 438 mtx_isequal 1; #X obj 149 438 mtx_isequal 1; #X obj 49 461 *; #X obj 49 524 outlet 1==OK; #X text 279 332 this uses Pd's DSP \, and therefore the result is one tick late!; #X obj 90 70 t b f b b, f 24; #X text 284 507 wait for the result; #X obj 99 475 print mtx_rfft:03_function; #X obj 49 493 t a a; #X msg 231 504 -1000; #X obj 49 412 mtx_< 1e-06; #X obj 149 412 mtx_< 1e-06; #X connect 0 0 3 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 13 0; #X connect 7 0 4 1; #X connect 9 0 19 1; #X connect 9 1 21 1; #X connect 10 0 1 0; #X connect 10 1 5 0; #X connect 11 0 7 1; #X connect 12 0 19 0; #X connect 12 1 21 0; #X connect 13 0 12 0; #X connect 13 1 9 0; #X connect 14 0 17 0; #X connect 16 0 18 0; #X connect 17 0 28 0; #X connect 18 0 28 0; #X connect 19 0 20 0; #X connect 20 0 33 0; #X connect 21 0 22 0; #X connect 22 0 34 0; #X connect 23 0 25 0; #X connect 24 0 25 1; #X connect 25 0 31 0; #X connect 28 0 15 0; #X connect 28 1 10 0; #X connect 28 2 15 1; #X connect 28 3 32 0; #X connect 31 0 26 0; #X connect 31 1 30 0; #X connect 32 0 31 0; #X connect 33 0 23 0; #X connect 34 0 24 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rifft/000077500000000000000000000000001514557770000243665ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rifft/00_exist.pd000066400000000000000000000006071514557770000263510ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_rifft]; #X obj 122 161 mtx_rifft; #X obj 122 132 t a a; #X msg 122 102 matrix 1 3 0 0 0; #X connect 0 0 7 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; #X connect 6 0 5 0; #X connect 6 1 5 1; #X connect 7 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rifft/01_function.pd000066400000000000000000000011111514557770000270320ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_rifft]; #X obj 122 161 mtx_rifft; #X msg 122 102 matrix 1 3 1 0 0; #X obj 122 184 mtx_- 0.25; #X obj 122 132 t a a; #X obj 122 207 mtx_abs; #X obj 122 230 mtx_transpose; #X obj 122 253 mtx_sum; #X obj 122 276 t f; #X obj 122 299 == 0; #X connect 0 0 4 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 3 0; #X connect 6 1 3 1; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rifft/02_function.pd000066400000000000000000000127621514557770000270510ustar00rootroot00000000000000#N canvas 316 110 645 684 10; #N canvas 492 104 545 558 ~ 0; #X obj 363 208 array define \$0.orig~; #X obj 363 240 array define \$0.re~; #X obj 363 260 array define \$0.im~; #X msg 74 160 set \$1 \, bang; #X obj 74 184 switch~; #X obj 62 312 bang~; #N canvas 735 461 450 300 DSP? 0; #X obj 83 102 inlet; #X obj 83 125 spigot; #X obj 83 148 outlet; #X obj 134 113 r pd; #X obj 134 136 route dsp; #X text 86 64 only calculate if DSP is on...; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 4 0 1 1; #X restore 74 110 pd DSP?; #X text 75 25 calculate the rFFT using Pd's built-in [rfft~] object; #X text 74 50 (this patch only works if DSP is *on*); #X obj 62 462 mtx; #X obj 62 364 t l l; #X obj 89 388 list length; #X msg 89 411 1 \$1; #X obj 89 434 mtx_zeros; #X obj 194 78 inlet mtx.im; #X obj 74 80 inlet mtx.re; #X obj 112 212 tabreceive~ \$0.re~; #X obj 232 212 tabreceive~ \$0.im~; #X obj 112 235 rifft~; #X obj 112 258 tabsend~ \$0.orig~; #X obj 62 342 array get \$0.orig~; #X obj 62 485 outlet orig; #N canvas 204 229 450 300 mtx2table+resize 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 221 76 array size \$0.orig~; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 280 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 163 76 t f f f; #X obj 221 31 - 1; #X obj 221 54 << 1; #X obj 115 170 array set \$0.im~; #X obj 88 230 - 1; #X obj 88 253 << 1; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 12 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 4 1 15 0; #X connect 6 0 16 0; #X connect 7 0 1 0; #X connect 11 0 10 0; #X connect 11 1 9 0; #X connect 12 0 3 1; #X connect 12 1 11 0; #X connect 12 2 13 0; #X connect 13 0 14 0; #X connect 14 0 5 0; #X connect 16 0 17 0; #X connect 17 0 8 0; #X restore 194 139 pd mtx2table+resize; #N canvas 204 229 450 300 mtx2table+resize 0; #X obj 54 93 list split 3; #X obj 54 32 t a a; #X obj 94 32 mtx_size; #X obj 88 119 list split 16; #X obj 88 146 t l l; #X obj 221 76 array size \$0.orig~; #X obj 88 197 list length; #X obj 54 9 inlet; #X obj 88 265 outlet; #X obj 261 187 array size \$0.re~; #X obj 261 207 array size \$0.im~; #X obj 236 156 t f f; #X obj 163 76 t f f f; #X obj 221 31 - 1; #X obj 221 54 << 1; #X obj 115 170 array set \$0.re~; #X obj 88 220 - 1; #X obj 88 243 << 1; #X connect 0 1 3 0; #X connect 1 0 0 0; #X connect 1 1 2 0; #X connect 2 1 12 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 4 1 15 0; #X connect 6 0 16 0; #X connect 7 0 1 0; #X connect 11 0 10 0; #X connect 11 1 9 0; #X connect 12 0 3 1; #X connect 12 1 11 0; #X connect 12 2 13 0; #X connect 13 0 14 0; #X connect 14 0 5 0; #X connect 16 0 17 0; #X connect 17 0 8 0; #X restore 74 139 pd mtx2table+resize; #X connect 3 0 4 0; #X connect 5 0 20 0; #X connect 6 0 23 0; #X connect 9 0 21 0; #X connect 10 0 9 0; #X connect 10 1 11 0; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 9 1; #X connect 14 0 22 0; #X connect 15 0 6 0; #X connect 16 0 18 0; #X connect 17 0 18 1; #X connect 18 0 19 0; #X connect 20 0 10 0; #X connect 23 0 3 0; #X restore 49 380 pd ~; #X obj 49 358 t a a, f 9; #X obj 90 8 inlet bang; #N canvas 735 461 450 300 DSP 0; #X obj 57 28 inlet post; #X obj 186 26 inlet pre; #X obj 328 70 r pd-dsp-started; #X obj 330 130 r pd-dsp-stopped; #X msg 328 95 1; #X msg 330 155 0; #X obj 218 109 i; #X obj 57 136 i; #X obj 57 53 t b; #X msg 57 161 dsp \$1; #X obj 57 186 s pd; #X obj 186 51 t b b; #X msg 186 76 1; #X connect 0 0 8 0; #X connect 1 0 11 0; #X connect 2 0 4 0; #X connect 3 0 5 0; #X connect 4 0 6 1; #X connect 5 0 6 1; #X connect 6 0 7 1; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 11 1 6 0; #X connect 12 0 9 0; #X restore 133 100 pd DSP; #X msg 159 8 bang; #X floatatom 159 45 5 0 0 0 - - - 0; #X obj 49 466 mtx_-; #X obj 49 489 mtx_abs; #X obj 49 538 mtx_isequal 1; #X obj 49 624 outlet 1==OK; #X text 279 372 this uses Pd's DSP \, and therefore the result is one tick late!; #X obj 90 70 t b f b b, f 24; #X text 284 607 wait for the result; #X obj 49 593 t a a; #X msg 231 604 -1000; #X obj 100 380 mtx_rifft, f 19; #X obj 160 358 t a a, f 9; #X obj 160 248 mtx_zeros 1 9; #X obj 49 248 mtx_eye 1 9; #X obj 49 271 mtx_roll 1; #X obj 49 294 mtx_* 8; #X obj 49 224 t a a; #X obj 88 423 mtx_* 16; #X floatatom 507 90 5 0 0 0 - - - 0; #X obj 507 142 pow; #X floatatom 507 165 5 0 0 0 - - - 0; #X msg 507 112 2 \$1; #X obj 39 68 int; #X msg 39 91 2 \$1; #X obj 39 114 pow; #X msg 90 31 7; #X msg 51 202 1 \$1; #X obj 39 177 + 1; #X floatatom 120 587 5 0 0 0 - - - 0; #X obj 39 146 t f f; #X obj 133 150 * 2; #X obj 49 512 mtx_< 1e-05; #X connect 0 0 6 0; #X connect 1 0 0 0; #X connect 1 1 15 0; #X connect 2 0 30 0; #X connect 4 0 5 0; #X connect 5 0 11 0; #X connect 6 0 7 0; #X connect 7 0 36 0; #X connect 8 0 13 0; #X connect 11 0 3 0; #X connect 11 1 27 0; #X connect 11 2 3 1; #X connect 11 3 14 0; #X connect 13 0 9 0; #X connect 13 1 33 0; #X connect 14 0 13 0; #X connect 15 0 22 0; #X connect 16 0 0 1; #X connect 16 1 15 1; #X connect 17 0 16 0; #X connect 18 0 19 0; #X connect 19 0 20 0; #X connect 20 0 1 0; #X connect 21 0 18 0; #X connect 21 1 17 0; #X connect 22 0 6 1; #X connect 23 0 26 0; #X connect 24 0 25 0; #X connect 26 0 24 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X connect 29 0 34 0; #X connect 30 0 11 0; #X connect 31 0 21 0; #X connect 32 0 31 0; #X connect 34 0 32 0; #X connect 34 1 35 0; #X connect 35 0 22 1; #X connect 36 0 8 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rmstodb/000077500000000000000000000000001514557770000247265ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rmstodb/00_exist.pd000066400000000000000000000005111514557770000267030ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_rmstodb; #X text 67 37 test for existence of [mtx_rmstodb]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rmstodb/01_function.pd000066400000000000000000000007241514557770000274030ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_rmstodb; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 165 232 rmstodb; #X obj 122 265 ==; #X msg 122 127 -2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rmstodb/02_function.pd000066400000000000000000000022671514557770000274100ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 191 mtx_rmstodb; #X text 67 37 test for existence of [mtx_rmstodb]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 218 unpack 0 0 0 0; #X obj 236 239 rmstodb; #X obj 267 239 rmstodb; #X obj 298 238 rmstodb; #X obj 329 238 rmstodb; #X obj 122 277 epseq 1e-07; #X obj 153 307 epseq 1e-07; #X obj 184 277 epseq 1e-07; #X obj 215 307 epseq 1e-07; #X connect 0 0 5 0; #X connect 2 0 8 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 13 0; #X connect 8 0 9 0; #X connect 9 0 18 0; #X connect 9 1 19 0; #X connect 9 2 20 0; #X connect 9 3 21 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 14 0; #X connect 13 1 15 0; #X connect 13 2 16 0; #X connect 13 3 17 0; #X connect 14 0 18 1; #X connect 15 0 19 1; #X connect 16 0 20 1; #X connect 17 0 21 1; #X connect 18 0 11 0; #X connect 19 0 11 1; #X connect 20 0 10 0; #X connect 21 0 10 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rmstodb/03_function.pd000066400000000000000000000030761514557770000274100ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 415 outlet 1==OK; #X obj 122 191 mtx_rmstodb; #X text 67 37 test for existence of [mtx_rmstodb]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 266 239 rmstodb; #X obj 297 239 rmstodb; #X obj 328 238 rmstodb; #X obj 359 238 rmstodb; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 330 *; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 rmstodb; #X obj 419 238 rmstodb; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 377 *; #X msg 122 110 3 -1 10.5 0.05 0 12; #X obj 122 277 epseq 1e-07; #X obj 153 307 epseq 1e-07; #X obj 184 277 epseq 1e-07; #X obj 215 307 epseq 1e-07; #X obj 254 277 epseq 1e-07; #X obj 285 307 epseq 1e-07; #X connect 0 0 4 0; #X connect 2 0 16 0; #X connect 4 0 21 0; #X connect 5 0 13 0; #X connect 5 1 19 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 20 0; #X connect 9 0 22 1; #X connect 10 0 23 1; #X connect 11 0 24 1; #X connect 12 0 25 1; #X connect 13 0 2 0; #X connect 14 0 20 1; #X connect 15 0 22 0; #X connect 15 1 23 0; #X connect 15 2 24 0; #X connect 15 3 25 0; #X connect 15 4 26 0; #X connect 15 5 27 0; #X connect 16 0 15 0; #X connect 17 0 26 1; #X connect 18 0 27 1; #X connect 19 0 9 0; #X connect 19 1 10 0; #X connect 19 2 11 0; #X connect 19 3 12 0; #X connect 19 4 17 0; #X connect 19 5 18 0; #X connect 20 0 1 0; #X connect 21 0 5 0; #X connect 22 0 7 0; #X connect 23 0 7 1; #X connect 24 0 6 0; #X connect 25 0 6 1; #X connect 26 0 14 0; #X connect 27 0 14 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_roll/000077500000000000000000000000001514557770000242245ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_roll/00_exist.pd000066400000000000000000000005031514557770000262020ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_roll; #X text 67 37 test for existence of [mtx_roll]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_row/000077500000000000000000000000001514557770000240635ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_row/00_exist.pd000066400000000000000000000005011514557770000260370ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_row; #X text 67 37 test for existence of [mtx_row]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rowrfft/000077500000000000000000000000001514557770000247455ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rowrfft/00_exist.pd000066400000000000000000000005171514557770000267300ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_rowrfft; #X text 67 37 test for existence of [mtx_rowrfft]; #X msg 122 122 matrix 1 4 0 0 0 0; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rowrifft/000077500000000000000000000000001514557770000251165ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_rowrifft/00_exist.pd000066400000000000000000000006151514557770000271000ustar00rootroot00000000000000#N canvas 386 139 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_rowrifft; #X text 67 37 test for existence of [mtx_rowrifft]; #X obj 122 136 t a a; #X msg 122 115 matrix 1 3 0 0 0; #X connect 0 0 7 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; #X connect 6 1 4 1; #X connect 7 0 6 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_scroll/000077500000000000000000000000001514557770000245525ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_scroll/00_exist.pd000066400000000000000000000005071514557770000265340ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_scroll; #X text 67 37 test for existence of [mtx_scroll]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sin/000077500000000000000000000000001514557770000240455ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sin/00_exist.pd000066400000000000000000000005011514557770000260210ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_sin; #X text 67 37 test for existence of [mtx_sin]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sin/01_function.pd000066400000000000000000000007241514557770000265220ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 211 mtx_sin; #X msg 122 233 \$3; #X obj 122 101 t b; #X obj 122 151 t f f; #X msg 122 190 matrix 1 1 \$1; #X obj 165 232 sin; #X obj 122 265 epseq 1e-7; #X msg 122 127 -2; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 2 0; #X connect 7 0 8 1; #X connect 8 0 1 0; #X connect 9 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sin/02_function.pd000066400000000000000000000022431514557770000265210ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 415 outlet 1==OK; #X obj 122 191 mtx_sin; #X text 67 37 test for functionality of [mtx_sin]; #X msg 122 170 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 89 t b; #X msg 122 110 3 -1 -10.5 0; #X obj 122 135 t l l; #X msg 122 213 \$3 \$4 \$5 \$6; #X obj 122 238 unpack 0 0 0 0; #X obj 184 360 *; #X obj 122 360 *; #X obj 122 386 *; #X obj 236 218 unpack 0 0 0 0; #X obj 122 277 epseq 1e-07; #X obj 153 297 epseq 1e-07; #X obj 184 317 epseq 1e-07; #X obj 215 337 epseq 1e-07; #X obj 236 239 sin; #X obj 267 239 sin; #X obj 298 238 sin; #X obj 329 238 sin; #X connect 0 0 5 0; #X connect 2 0 8 0; #X connect 4 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 4 0; #X connect 7 1 13 0; #X connect 8 0 9 0; #X connect 9 0 14 0; #X connect 9 1 15 0; #X connect 9 2 16 0; #X connect 9 3 17 0; #X connect 10 0 12 1; #X connect 11 0 12 0; #X connect 12 0 1 0; #X connect 13 0 18 0; #X connect 13 1 19 0; #X connect 13 2 20 0; #X connect 13 3 21 0; #X connect 14 0 11 0; #X connect 15 0 11 1; #X connect 16 0 10 0; #X connect 17 0 10 1; #X connect 18 0 14 1; #X connect 19 0 15 1; #X connect 20 0 16 1; #X connect 21 0 17 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sin/03_function.pd000066400000000000000000000030411514557770000265170ustar00rootroot00000000000000#N canvas 385 142 508 482 10; #X obj 122 68 inlet bang; #X obj 122 435 outlet 1==OK; #X obj 122 191 mtx_sin; #X text 67 37 test for functionality of [mtx_sin]; #X obj 122 89 t b; #X obj 122 135 t l l; #X obj 184 350 *; #X obj 122 350 *; #X obj 122 376 *; #X obj 122 277 epseq 1e-07; #X obj 153 297 epseq 1e-07; #X obj 184 317 epseq 1e-07; #X obj 215 277 epseq 1e-07; #X obj 266 239 sin; #X obj 297 239 sin; #X obj 328 238 sin; #X obj 359 238 sin; #X msg 122 170 matrix 2 3 \$1 \$2 \$3 \$4 \$5 \$6; #X obj 254 350 *; #X obj 254 297 epseq 1e-07; #X obj 285 317 epseq 1e-07; #X obj 122 238 unpack 0 0 0 0 0 0; #X msg 122 213 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 388 238 sin; #X obj 419 238 sin; #X obj 266 218 unpack 0 0 0 0 0 0; #X obj 122 397 *; #X msg 122 110 3 -1 10.5 0.05 0 12; #X connect 0 0 4 0; #X connect 2 0 22 0; #X connect 4 0 27 0; #X connect 5 0 17 0; #X connect 5 1 25 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 26 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 6 0; #X connect 12 0 6 1; #X connect 13 0 9 1; #X connect 14 0 10 1; #X connect 15 0 11 1; #X connect 16 0 12 1; #X connect 17 0 2 0; #X connect 18 0 26 1; #X connect 19 0 18 0; #X connect 20 0 18 1; #X connect 21 0 9 0; #X connect 21 1 10 0; #X connect 21 2 11 0; #X connect 21 3 12 0; #X connect 21 4 19 0; #X connect 21 5 20 0; #X connect 22 0 21 0; #X connect 23 0 19 1; #X connect 24 0 20 1; #X connect 25 0 13 0; #X connect 25 1 14 0; #X connect 25 2 15 0; #X connect 25 3 16 0; #X connect 25 4 23 0; #X connect 25 5 24 0; #X connect 26 0 1 0; #X connect 27 0 5 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_size/000077500000000000000000000000001514557770000242265ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_size/00_exist.pd000066400000000000000000000005031514557770000262040ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_size; #X text 67 37 test for existence of [mtx_size]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_size/01_function.pd000066400000000000000000000010431514557770000266760ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 335 outlet 1==OK; #X obj 122 211 mtx_size; #X obj 122 90 t b; #X msg 122 132 1 8; #X obj 122 161 t l l; #X msg 122 190 matrix \$1 \$2 -2; #X obj 204 211 unpack; #X obj 122 259 ==; #X obj 173 259 ==; #X obj 122 297 *; #X connect 0 0 3 0; #X connect 2 0 8 0; #X connect 2 1 9 0; #X connect 3 0 4 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 8 1; #X connect 7 1 9 1; #X connect 8 0 10 0; #X connect 9 0 10 1; #X connect 10 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_slice/000077500000000000000000000000001514557770000243535ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_slice/00_exist.pd000066400000000000000000000005051514557770000263330ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_slice; #X text 67 37 test for existence of [mtx_slice]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sort/000077500000000000000000000000001514557770000242435ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sort/00_exist.pd000066400000000000000000000005031514557770000262210ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_sort; #X text 67 37 test for existence of [mtx_sort]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_spherical_harmonics/000077500000000000000000000000001514557770000272715ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_spherical_harmonics/00_exist.pd000066400000000000000000000005221514557770000312500ustar00rootroot00000000000000#N canvas 0 77 396 423 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 327 b; #X msg 122 356 1; #X text 67 37 test for existence of [mtx_min]; #X obj 122 161 mtx_spherical_harmonics 3; #X msg 122 122 matrix 2 1 0 0; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; #X connect 6 0 5 0; 01_function.pd000066400000000000000000000013351514557770000316660ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_spherical_harmonics#N canvas 0 77 839 423 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X text 67 37 test for existence of [mtx_min]; #X msg 122 99 1; #X obj 122 120 atan; #X obj 122 266 mtx_* 1e+06; #X obj 122 287 mtx_int; #X obj 122 308 mtx_./ 1e+06; #X obj 122 141 * 2; #X obj 122 245 mtx_spherical_harmonics 1 SN3D; #X obj 122 213 t a a; #X msg 122 181 matrix 2 3 0 \$1 \$1 \$1 \$1 0; #X msg 323 213 matrix 3 4 1 0 0 1 1 1 0 0 1 0 1 0; #X obj 122 333 mtx_isequal; #X connect 0 0 3 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 13 0; #X connect 8 0 11 0; #X connect 9 0 5 0; #X connect 10 0 9 0; #X connect 10 1 12 0; #X connect 11 0 10 0; #X connect 12 0 13 1; #X connect 13 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_spivot/000077500000000000000000000000001514557770000246005ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_spivot/00_exist.pd000066400000000000000000000005071514557770000265620ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_spivot; #X text 67 37 test for existence of [mtx_spivot]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/000077500000000000000000000000001514557770000240455ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/00_exist.pd000066400000000000000000000005011514557770000260210ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_sub; #X text 67 37 test for existence of [mtx_sub]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/00_exist1.pd000066400000000000000000000004751514557770000261140ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_-; #X text 67 37 test for existence of [mtx_-]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/01_function.pd000066400000000000000000000021101514557770000265110ustar00rootroot00000000000000#N canvas 117 373 440 427 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 3 9 243 43; #X obj 122 221 mtx_sub -1; #X obj 236 221 - -1; #X obj 277 221 - -1; #X obj 318 220 - -1; #X obj 359 220 - -1; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/02_function.pd000066400000000000000000000025671514557770000265320ustar00rootroot00000000000000#N canvas 252 376 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 166 200 matrix 2 2 \$1 \$2 \$3 \$4; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_sub; #X obj 236 269 -; #X obj 267 269 -; #X obj 298 268 -; #X obj 329 268 -; #X msg 122 132 1 3 2 -1; #X msg 185 133 0 0 4 6; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 7 2 21 0; #X connect 7 3 22 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 18 1; #X connect 13 0 18 0; #X connect 14 0 19 1; #X connect 14 1 20 1; #X connect 14 2 21 1; #X connect 14 3 22 1; #X connect 15 0 23 0; #X connect 15 1 24 0; #X connect 16 0 12 0; #X connect 16 1 14 0; #X connect 17 0 13 0; #X connect 17 1 7 0; #X connect 18 0 2 0; #X connect 19 0 8 1; #X connect 20 0 9 1; #X connect 21 0 10 1; #X connect 22 0 11 1; #X connect 23 0 17 0; #X connect 24 0 16 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/03_function.pd000066400000000000000000000021041514557770000265160ustar00rootroot00000000000000#N canvas 144 215 431 450 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 256 200 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 156 t l l; #X obj 122 98 t b; #X msg 122 132 23 -3 4.4 9; #X obj 122 221 mtx_sub 6; #X obj 256 221 - 6; #X obj 297 221 - 6; #X obj 338 220 - 6; #X obj 379 220 - 6; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 13 1 7 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/04_function.pd000066400000000000000000000024661514557770000265320ustar00rootroot00000000000000#N canvas 385 142 412 429 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 185 190 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 252 228 unpack 0 0 0 0; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 221 mtx_sub; #X obj 236 269 -; #X obj 267 269 -; #X obj 298 268 -; #X obj 329 268 -; #X obj 122 156 t f f; #X obj 236 248 t f f f f; #X msg 122 132 8; #X msg 185 133 5 3 -1000 12.1235; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 8 0; #X connect 3 2 9 0; #X connect 3 3 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 4 0; #X connect 10 0 4 1; #X connect 11 0 15 1; #X connect 12 0 16 1; #X connect 12 1 17 1; #X connect 12 2 18 1; #X connect 12 3 19 1; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 11 0; #X connect 14 1 12 0; #X connect 15 0 2 0; #X connect 16 0 7 1; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 21 0 16 0; #X connect 21 1 17 0; #X connect 21 2 18 0; #X connect 21 3 19 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/05_function.pd000066400000000000000000000005641514557770000265300ustar00rootroot00000000000000#N canvas 55 354 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 307 ==; #X obj 122 98 t b; #X obj 122 174 t f f; #X msg 122 132 7; #X obj 122 221 mtx_sub 2.1; #X obj 207 221 - 2.1; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 2 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/06_function.pd000066400000000000000000000024621514557770000265300ustar00rootroot00000000000000#N canvas 385 142 386 465 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 -; #X obj 267 269 -; #X obj 298 268 -; #X obj 329 268 -; #X obj 252 228 t f f f f; #X obj 185 156 t f f; #X obj 122 221 mtx_sub 0; #X msg 122 132 4 34 76 0.1; #X msg 205 133 9.5; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 23 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 14 0; #X connect 23 0 20 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/07_function.pd000066400000000000000000000007511514557770000265300ustar00rootroot00000000000000#N canvas 270 180 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 213 71 bang; #X obj 122 98 t b b; #X obj 122 175 t f f; #X obj 122 307 ==; #X obj 122 251 mtx_sub 0; #X obj 239 251 -; #X msg 122 132 2; #X msg 152 131 6.9; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 4 0 6 0; #X connect 4 1 7 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 4 0; #X connect 9 0 6 1; #X connect 9 0 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/08_function.pd000066400000000000000000000024651514557770000265350ustar00rootroot00000000000000#N canvas 277 252 796 483 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 122 156 t l l; #X obj 236 269 -; #X obj 267 269 -; #X obj 298 268 -; #X obj 329 268 -; #X obj 252 228 t f f f f; #X obj 225 156 t f f; #X obj 122 221 mtx_sub 0; #X msg 225 133 9.99; #X msg 122 132 3 2 6543.1 -1; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 15 0; #X connect 7 1 16 0; #X connect 7 2 17 0; #X connect 7 3 18 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 21 0; #X connect 13 0 23 0; #X connect 13 1 22 0; #X connect 14 0 12 0; #X connect 14 1 7 0; #X connect 15 0 8 1; #X connect 16 0 9 1; #X connect 17 0 10 1; #X connect 18 0 11 1; #X connect 19 0 15 1; #X connect 19 1 16 1; #X connect 19 2 17 1; #X connect 19 3 18 1; #X connect 20 0 21 1; #X connect 20 1 19 0; #X connect 21 0 2 0; #X connect 22 0 20 0; #X connect 23 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/09_function.pd000066400000000000000000000025541514557770000265350ustar00rootroot00000000000000#N canvas 311 295 379 440 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_sub; #X obj 236 269 -; #X obj 267 269 -; #X obj 298 268 -; #X obj 329 268 -; #X msg 186 200 matrix 1 2 \$1 \$2; #X obj 252 228 unpack 0 0; #X msg 122 132 3 -1 0.2 4.4; #X msg 215 133 9 13; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 19 1; #X connect 22 1 18 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sub/10_function.pd000066400000000000000000000025551514557770000265260ustar00rootroot00000000000000#N canvas 182 266 409 472 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 243 \$3 \$4 \$5 \$6; #X obj 122 268 unpack 0 0 0 0; #X obj 184 330 *; #X obj 122 330 *; #X obj 122 356 *; #X obj 236 248 unpack 0 0 0 0; #X obj 122 307 ==; #X obj 153 307 ==; #X obj 184 307 ==; #X obj 215 307 ==; #X msg 122 179 matrix 2 2 \$1 \$2 \$3 \$4; #X obj 122 98 t b b; #X obj 185 156 t l l; #X obj 122 156 t l l; #X obj 122 221 mtx_sub; #X obj 236 269 -; #X obj 267 269 -; #X obj 298 268 -; #X obj 329 268 -; #X msg 166 200 matrix 2 1 \$1 \$2; #X obj 252 226 unpack 0 0; #X msg 122 132 3 2 -1 6; #X msg 185 133 12.5 -100; #X connect 0 0 13 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 9 0; #X connect 3 2 10 0; #X connect 3 3 11 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 7 0 17 0; #X connect 7 1 18 0; #X connect 7 2 19 0; #X connect 7 3 20 0; #X connect 8 0 5 0; #X connect 9 0 5 1; #X connect 10 0 4 0; #X connect 11 0 4 1; #X connect 12 0 16 0; #X connect 13 0 23 0; #X connect 13 1 24 0; #X connect 14 0 21 0; #X connect 14 1 22 0; #X connect 15 0 12 0; #X connect 15 1 7 0; #X connect 16 0 2 0; #X connect 17 0 8 1; #X connect 18 0 9 1; #X connect 19 0 10 1; #X connect 20 0 11 1; #X connect 21 0 16 1; #X connect 22 0 17 1; #X connect 22 0 18 1; #X connect 22 1 19 1; #X connect 22 1 20 1; #X connect 23 0 15 0; #X connect 24 0 14 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sum/000077500000000000000000000000001514557770000240605ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_sum/00_exist.pd000066400000000000000000000004201514557770000260340ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_sum; #X text 67 37 test for existence of [mtx_sum]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_symasym/000077500000000000000000000000001514557770000247565ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_symasym/00_exist.pd000066400000000000000000000005111514557770000267330ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_symasym; #X text 67 37 test for existence of [mtx_symasym]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_trace/000077500000000000000000000000001514557770000243525ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_trace/00_exist.pd000066400000000000000000000004241514557770000263320ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_trace; #X text 67 37 test for existence of [mtx_trace]; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_transpose/000077500000000000000000000000001514557770000252725ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_transpose/00_exist.pd000066400000000000000000000005151514557770000272530ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X obj 122 161 mtx_transpose; #X text 67 37 test for existence of [mtx_transpose]; #X msg 122 122 matrix 1 1 1; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/000077500000000000000000000000001514557770000244165ustar00rootroot00000000000000iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/00_exist.pd000066400000000000000000000004261514557770000264000ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 347 b; #X msg 122 366 1; #X text 67 37 test for existence of [mtx_zeros]; #X obj 122 161 mtx_zeros 1; #X connect 0 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 2 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/01_function.pd000066400000000000000000000012021514557770000270630ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X msg 122 214 \$3 \$4 \$5 \$6; #X obj 122 161 mtx_zeros 2; #X obj 122 238 unpack 0 0 0 0; #X obj 122 262 == 0; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X connect 0 0 12 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 4 2 7 0; #X connect 4 3 8 0; #X connect 5 0 9 0; #X connect 6 0 9 1; #X connect 7 0 11 0; #X connect 8 0 11 1; #X connect 9 0 10 0; #X connect 10 0 1 0; #X connect 11 0 10 1; #X connect 12 0 3 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/02_function.pd000066400000000000000000000015431514557770000270740ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 262 == 0; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 161 mtx_zeros 2 3; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 282 262 == 0; #X obj 322 262 == 0; #X obj 282 282 *; #X obj 122 324 *; #X connect 0 0 9 0; #X connect 2 0 6 0; #X connect 3 0 6 1; #X connect 4 0 8 0; #X connect 5 0 8 1; #X connect 6 0 7 0; #X connect 7 0 16 0; #X connect 8 0 7 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 2 0; #X connect 12 1 3 0; #X connect 12 2 4 0; #X connect 12 3 5 0; #X connect 12 4 13 0; #X connect 12 5 14 0; #X connect 13 0 15 0; #X connect 14 0 15 1; #X connect 15 0 16 1; #X connect 16 0 1 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/03_function.pd000066400000000000000000000012611514557770000270720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 262 == 0; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 122 161 mtx_zeros 7 8; #X msg 122 214 \$3 \$4 \$5 \$6; #X msg 122 135 2; #X connect 0 0 9 0; #X connect 2 0 6 0; #X connect 3 0 6 1; #X connect 4 0 8 0; #X connect 5 0 8 1; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 8 0 7 1; #X connect 9 0 13 0; #X connect 10 0 2 0; #X connect 10 1 3 0; #X connect 10 2 4 0; #X connect 10 3 5 0; #X connect 11 0 12 0; #X connect 12 0 10 0; #X connect 13 0 11 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/04_function.pd000066400000000000000000000016111514557770000270720ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 262 == 0; #X obj 162 262 == 0; #X obj 202 262 == 0; #X obj 242 262 == 0; #X obj 122 282 *; #X obj 122 302 *; #X obj 202 282 *; #X obj 122 104 t b; #X msg 122 214 \$3 \$4 \$5 \$6 \$7 \$8; #X obj 122 238 unpack 0 0 0 0 0 0; #X obj 282 262 == 0; #X obj 322 262 == 0; #X obj 282 282 *; #X obj 122 324 *; #X msg 122 135 3 2; #X obj 122 161 mtx_zeros; #X connect 0 0 9 0; #X connect 2 0 6 0; #X connect 3 0 6 1; #X connect 4 0 8 0; #X connect 5 0 8 1; #X connect 6 0 7 0; #X connect 7 0 15 0; #X connect 8 0 7 1; #X connect 9 0 16 0; #X connect 10 0 11 0; #X connect 11 0 2 0; #X connect 11 1 3 0; #X connect 11 2 4 0; #X connect 11 3 5 0; #X connect 11 4 12 0; #X connect 11 5 13 0; #X connect 12 0 14 0; #X connect 13 0 14 1; #X connect 14 0 15 1; #X connect 15 0 1 0; #X connect 16 0 17 0; #X connect 17 0 10 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/05_function.pd000066400000000000000000000011171514557770000270740ustar00rootroot00000000000000#N canvas 541 351 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 282 *; #X obj 122 104 t b; #X obj 122 191 mtx_zeros 7 8; #X msg 122 135 10 14; #X msg 122 214 \$1 \$2; #X obj 122 157 t l l; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 179 215 unpack; #X obj 122 236 unpack; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 11 0; #X connect 7 0 4 0; #X connect 7 1 10 0; #X connect 8 0 2 0; #X connect 9 0 2 1; #X connect 10 0 8 1; #X connect 10 1 9 1; #X connect 11 0 8 0; #X connect 11 1 9 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/mtx_zeros/06_function.pd000066400000000000000000000011131514557770000270710ustar00rootroot00000000000000#N canvas 385 142 508 466 10; #X obj 122 68 inlet bang; #X obj 122 385 outlet 1==OK; #X obj 122 104 t b; #X obj 122 282 *; #X obj 122 191 mtx_zeros 7 8; #X msg 122 214 \$1 \$2; #X obj 122 262 ==; #X obj 162 262 ==; #X obj 122 236 unpack; #X msg 122 135 32; #X obj 122 157 t f f; #X obj 179 215 t f f; #X connect 0 0 2 0; #X connect 2 0 9 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 6 0 3 0; #X connect 7 0 3 1; #X connect 8 0 6 0; #X connect 8 1 7 0; #X connect 9 0 10 0; #X connect 10 0 4 0; #X connect 10 1 11 0; #X connect 11 0 6 1; #X connect 11 1 7 1; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/runtests.bat000066400000000000000000000002111514557770000247350ustar00rootroot00000000000000rem RUN TEST SUITE set PATH=%PATH%;C:\Programme\pd\bin\ pd -lib ..\iemmatrix -path ..\abs -nogui runtests_nogui.pd > runtests.log 2>&1 iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/runtests.pd000066400000000000000000000012171514557770000246010ustar00rootroot00000000000000#N canvas 368 197 813 499 10; #X obj 177 463 testunit; #X obj 177 377 textfile; #X obj 177 183 t b b; #X msg 207 261 read runtests.txt \, rewind; #X obj 177 287 metro 10; #X msg 243 289 0; #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 177 430 0 0 0 0 - - -; #X obj 177 399 symbol; #X obj 138 260 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X connect 1 0 9 0; #X connect 1 1 5 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 6 0 2 0; #X connect 7 0 1 0; #X connect 8 0 0 0; #X connect 9 0 8 0; #X connect 10 0 4 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/runtests.sh000077500000000000000000000034401514557770000246130ustar00rootroot00000000000000#!/bin/sh : "${PD:=pd}" : "${PDARGS:=-noprefs -nosound -nrt}" builddir="$(cd ..; pwd)" : "${libdir:=${builddir}}" : "${absdir:=${builddir}/abs}" : "${IEMMATRIX:=-lib "${libdir}/iemmatrix" -path "${absdir}"}" RUNTESTS_TXT=runtests.txt runtests_log=runtests.log if [ "${RUNTESTS_LOG}" != "${RUNTESTS_LOG%/*}" ]; then mkdir -p "${RUNTESTS_LOG%/*}" || true fi XITCODE=0 for f in */*.pd; do test -e "${f}" && echo "${f%.pd};" done | LC_ALL=C sort > "${RUNTESTS_TXT}" run_nogui() { echo ${PD} ${PDARGS} ${IEMMATRIX} -batch -nogui runtests_nogui.pd > "${RUNTESTS_LOG}" 2>&1 ${PD} ${PDARGS} ${IEMMATRIX} -batch -nogui runtests_nogui.pd >> "${RUNTESTS_LOG}" 2>&1 pdexit="$?" NUMTESTS=$(grep -c . "${RUNTESTS_TXT}") echo "regression-test: ${NUMTESTS} tests total" >> "${RUNTESTS_LOG}" cat "${RUNTESTS_LOG}" \ | grep -E "^regression-test: " \ | sed -e 's/^regression-test: //' FAILEDTESTS=$(cat "${RUNTESTS_LOG}" \ | grep -E "^regression-test: .*: failed$" \ | sed -e 's|^regression-test: ||' -e 's|: failed$||' \ | tr '\n' ' ' \ ) echo "failed tests: ${FAILEDTESTS}" if [ -n "${FAILEDTESTS}" ]; then XITCODE=1 fi if [ "${pdexit}" != 0 ]; then echo "Pd exited with ${pdexit}" XITCODE=2 fi } run_withgui() { ${PD} ${PDARGS} ${IEMMATRIX} -stderr runtests.pd 2>&1 | tee "${RUNTESTS_LOG}" } if test "$1" = "-gui"; then : "${RUNTESTS_LOG:=${runtests_log}}" run_withgui else : "${RUNTESTS_LOG:=${runtests_log}.$(date +%Y%m%d-%H%M).$$}" run_nogui fi show_log=no case "${RUNTESTS_SHOW_LOG}" in "always") show_log=yes ;; "failure") test "${XITCODE}" = "0" || show_log=yes ;; esac if [ "${show_log}" = "yes" ]; then echo echo "output of ${RUNTESTS_LOG}:" cat "${RUNTESTS_LOG}" echo fi exit ${XITCODE} iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/runtests.txt000066400000000000000000000150271514557770000250210ustar00rootroot00000000000000mtx_abs/00_exist; mtx_abs/01_function; mtx_abs/02_function; mtx_abs/03_function; mtx_add/00_exist1; mtx_add/00_exist; mtx_add/01_function; mtx_add/02_function; mtx_add/03_function; mtx_add/04_function; mtx_add/05_function; mtx_add/06_function; mtx_add/07_function; mtx_add/08_function; mtx_add/09_function; mtx_add/10_function; mtx_and/00_exist; mtx_and/01_function; mtx_and/02_function; mtx_and/03_function; mtx_and/04_function; mtx_and/05_function; mtx_and/06_function; mtx_and/07_function; mtx_and/08_function; mtx_and/09_function; mtx_and/10_function; mtx_bitand/00_exist; mtx_bitand/01_function; mtx_bitand/02_function; mtx_bitand/03_function; mtx_bitand/04_function; mtx_bitand/05_function; mtx_bitand/06_function; mtx_bitand/07_function; mtx_bitand/08_function; mtx_bitand/09_function; mtx_bitand/10_function; mtx_bitleft/00_exist; mtx_bitleft/01_function; mtx_bitleft/02_function; mtx_bitleft/03_function; mtx_bitleft/04_function; mtx_bitleft/05_function; mtx_bitleft/06_function; mtx_bitleft/07_function; mtx_bitleft/08_function; mtx_bitleft/09_function; mtx_bitleft/10_function; mtx_bitor/00_exist; mtx_bitor/01_function; mtx_bitor/02_function; mtx_bitor/03_function; mtx_bitor/04_function; mtx_bitor/05_function; mtx_bitor/06_function; mtx_bitor/07_function; mtx_bitor/08_function; mtx_bitor/09_function; mtx_bitor/10_function; mtx_bitright/00_exist; mtx_bitright/01_function; mtx_bitright/02_function; mtx_bitright/03_function; mtx_bitright/04_function; mtx_bitright/05_function; mtx_bitright/06_function; mtx_bitright/07_function; mtx_bitright/08_function; mtx_bitright/09_function; mtx_bitright/10_function; mtx_check/00_exist; mtx_check/01_function; mtx_check/02_function; mtx_check/03_function; mtx_cholesky/00_exist; mtx_col/00_exist; mtx_colon/00_exist1; mtx_colon/00_exist; mtx_concat/00_exist; mtx_conv/00_exist; mtx_cos/00_exist; mtx_cos/01_function; mtx_cos/02_function; mtx_cos/03_function; mtx_cumsum/00_exist; mtx_dbtorms/00_exist; mtx_dbtorms/01_function; mtx_dbtorms/02_function; mtx_dbtorms/03_function; mtx_decay/00_exist; mtx_diag/00_exist; mtx_diegg/00_exist; mtx_diegg/01_init; mtx_diegg/02_getdiegg; mtx_diegg/02_init; mtx_diff/00_exist; mtx_distance2/00_exist; mtx_egg/00_exist; mtx_egg/01_function; mtx_egg/02_function; mtx_egg/03_function; mtx_egg/04_function; mtx_egg/05_function; mtx_egg/06_function; mtx_element/00_exist; mtx_eq/00_exist; mtx_eq/01_function; mtx_eq/02_function; mtx_eq/03_function; mtx_eq/04_function; mtx_eq/05_function; mtx_eq/06_function; mtx_eq/07_function; mtx_eq/08_function; mtx_eq/09_function; mtx_eq/10_function; mtx_exp/00_exist; mtx_exp/01_function; mtx_exp/02_function; mtx_exp/03_function; mtx_eye/00_exist; mtx_eye/01_function; mtx_eye/02_function; mtx_eye/03_function; mtx_eye/04_function; mtx_eye/05_function; mtx_eye/06_function; mtx_fft/00_exist; mtx_fft/02_function; mtx_fill/00_exist; mtx_find/00_exist; mtx_gauss/00_exist; mtx_ge/00_exist; mtx_ge/01_function; mtx_ge/02_function; mtx_ge/03_function; mtx_ge/04_function; mtx_ge/05_function; mtx_ge/06_function; mtx_ge/07_function; mtx_ge/08_function; mtx_ge/09_function; mtx_ge/10_function; mtx_gt/00_exist; mtx_gt/01_function; mtx_gt/02_function; mtx_gt/03_function; mtx_gt/04_function; mtx_gt/05_function; mtx_gt/06_function; mtx_gt/07_function; mtx_gt/08_function; mtx_gt/09_function; mtx_gt/10_function; mtx_ifft/00_exist; mtx_ifft/02_function; mtx_index/00_exist; mtx_int/00_exist; mtx_int/01_function; mtx_int/02_function; mtx_int/03_function; mtx_inverse/00_exist; mtx_isequal/00_exist; mtx_isequal/01_function0; mtx_isequal/01_function1; mtx_isequal/01_function2; mtx_isequal/01_function3; mtx_le/00_exist; mtx_le/01_function; mtx_le/02_function; mtx_le/03_function; mtx_le/04_function; mtx_le/05_function; mtx_le/06_function; mtx_le/07_function; mtx_le/08_function; mtx_le/09_function; mtx_le/10_function; mtx_log/00_exist; mtx_log/01_function; mtx_log/02_function; mtx_log/03_function; mtx_log/04_function; mtx_lt/00_exist; mtx_lt/01_function; mtx_lt/02_function; mtx_lt/03_function; mtx_lt/04_function; mtx_lt/05_function; mtx_lt/06_function; mtx_lt/07_function; mtx_lt/08_function; mtx_lt/09_function; mtx_lt/10_function; mtx_matcher/00_exist; mtx_matrix/00_exist1; mtx_matrix/00_exist; mtx_max/00_exist; mtx_max/01_function; mtx_max/02_function; mtx_max/03_function; mtx_max/04_function; mtx_max/05_function; mtx_max/06_function; mtx_max2/00_exist; mtx_mean/00_exist; mtx_min/00_exist; mtx_min/01_function; mtx_min/02_function; mtx_min/03_function; mtx_min/04_function; mtx_min/05_function; mtx_min/06_function; mtx_min2/00_exist; mtx_minmax/00_exist; mtx_minmax/01_function; mtx_minmax/02_function; mtx_minmax/03_function; mtx_minmax/04_function; mtx_minmax/05_function; mtx_minmax/06_function; mtx_mul/00_exist1; mtx_mul/00_exist2; mtx_mul/00_exist; mtx_mul/01_dotmul; mtx_neq/00_exist; mtx_neq/01_function; mtx_neq/02_function; mtx_neq/03_function; mtx_neq/04_function; mtx_neq/05_function; mtx_neq/06_function; mtx_neq/07_function; mtx_neq/08_function; mtx_neq/09_function; mtx_neq/10_function; mtx_not/00_exist1; mtx_not/00_exist; mtx_ones/00_exist; mtx_ones/01_function; mtx_ones/02_function; mtx_ones/03_function; mtx_ones/04_function; mtx_ones/05_function; mtx_ones/06_function; mtx_or/00_exist; mtx_or/01_function; mtx_or/02_function; mtx_or/03_function; mtx_or/04_function; mtx_or/05_function; mtx_or/06_function; mtx_or/07_function; mtx_or/08_function; mtx_or/09_function; mtx_or/10_function; mtx_pivot/00_exist; mtx_prod/00_exist; mtx_rand/00_exist; mtx_rand/01_default; mtx_repmat/00_exist; mtx_resize/00_exist; mtx_reverse/00_exist; mtx_rfft/00_exist; mtx_rfft/01_function; mtx_rfft/02_function; mtx_rfft/03_function; mtx_rifft/00_exist; mtx_rifft/01_function; mtx_rifft/02_function; mtx_rmstodb/00_exist; mtx_rmstodb/01_function; mtx_rmstodb/02_function; mtx_rmstodb/03_function; mtx_roll/00_exist; mtx_row/00_exist; mtx_rowrfft/00_exist; mtx_rowrifft/00_exist; mtx_scroll/00_exist; mtx_sin/00_exist; mtx_sin/01_function; mtx_sin/02_function; mtx_sin/03_function; mtx_size/00_exist; mtx_size/01_function; mtx_slice/00_exist; mtx_sort/00_exist; mtx_spherical_harmonics/00_exist; mtx_spherical_harmonics/01_function; mtx_spivot/00_exist; mtx_sub/00_exist1; mtx_sub/00_exist; mtx_sub/01_function; mtx_sub/02_function; mtx_sub/03_function; mtx_sub/04_function; mtx_sub/05_function; mtx_sub/06_function; mtx_sub/07_function; mtx_sub/08_function; mtx_sub/09_function; mtx_sub/10_function; mtx_sum/00_exist; mtx_symasym/00_exist; mtx_trace/00_exist; mtx_transpose/00_exist; mtx_zeros/00_exist; mtx_zeros/01_function; mtx_zeros/02_function; mtx_zeros/03_function; mtx_zeros/04_function; mtx_zeros/05_function; mtx_zeros/06_function; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/runtests_nogui.pd000066400000000000000000000041761514557770000260110ustar00rootroot00000000000000#N canvas 209 168 503 651 10; #X obj 86 249 testunit; #X obj 86 200 textfile, f 10; #X msg 126 133 read runtests.txt \, rewind; #X obj 67 4 loadbang; #X msg 44 601 \; pd quit; #X obj 86 333 select 0 1; #X obj 111 359 + 1; #X obj 171 359 + 1; #X obj 71 492 i; #X obj 131 492 i; #X obj 131 561 print regression-test; #X msg 131 536 \$1 tests passed; #X msg 71 515 \$1 tests failed; #X obj 86 359 i 1; #X obj 146 359 i 1; #X obj 146 382 t f f; #X obj 86 382 t f f; #X msg 30 33 bang; #X obj 86 225 t a a; #X obj 345 243 print testing; #X obj 143 280 t b; #X msg 86 133 bang; #X msg 227 257 0; #X obj 86 167 t b b; #X obj 67 66 t b b b; #X obj 67 35 t b b; #X msg 112 37 1; #X obj 44 426 t b b; #X obj 44 449 i; #X obj 44 575 select 1; #X obj 243 379 print oops; #X obj 243 354 list append ???; #X obj 294 242 t a b a; #X obj 343 468 i 1; #X obj 343 491 t f f; #X obj 373 467 + 1; #X obj 227 280 t f f f; #X obj 328 514 i; #X msg 328 537 \$1 total; #X obj 71 471 t b b b; #X obj 86 279 t f b b; #X connect 0 0 40 0; #X connect 1 0 18 0; #X connect 1 1 20 0; #X connect 2 0 1 0; #X connect 3 0 25 0; #X connect 5 0 13 0; #X connect 5 1 14 0; #X connect 5 2 31 0; #X connect 6 0 13 1; #X connect 7 0 14 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 16 0; #X connect 14 0 15 0; #X connect 15 0 9 1; #X connect 15 1 7 0; #X connect 16 0 8 1; #X connect 16 1 6 0; #X connect 17 0 24 0; #X connect 18 0 0 0; #X connect 18 1 32 0; #X connect 20 0 27 0; #X connect 21 0 23 0; #X connect 22 0 36 0; #X connect 23 0 1 0; #X connect 23 1 22 0; #X connect 24 1 21 0; #X connect 24 2 2 0; #X connect 25 0 24 0; #X connect 25 1 26 0; #X connect 26 0 28 1; #X connect 27 0 28 0; #X connect 27 1 39 0; #X connect 28 0 29 0; #X connect 29 0 4 0; #X connect 31 0 30 0; #X connect 32 0 31 1; #X connect 32 2 19 0; #X connect 33 0 34 0; #X connect 34 0 37 1; #X connect 34 1 35 0; #X connect 35 0 33 1; #X connect 36 0 6 0; #X connect 36 1 7 0; #X connect 36 2 35 0; #X connect 37 0 38 0; #X connect 38 0 10 0; #X connect 39 0 8 0; #X connect 39 1 9 0; #X connect 39 2 37 0; #X connect 40 0 5 0; #X connect 40 1 1 0; #X connect 40 2 33 0; iemmatrix-v0.6.0-cf549254a4fe740800f15f0c965624d0f3aaf687/tests/testunit.pd000066400000000000000000000042601514557770000245720ustar00rootroot00000000000000#N canvas 697 324 312 252 10; #X declare -path .; #N canvas 6 50 681 696 run-test 0; #X obj 71 76 symbol; #X obj 71 44 inlet test-to-run; #X obj 88 509 outlet result; #X obj 88 485 pack 0 s; #X msg 140 72 bang; #X obj 71 135 s \$0-send; #N canvas 395 348 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 296 82 inlet test; #X obj 101 92 inlet result; #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 1 1; #X connect 9 0 2 0; #X restore 118 454 pd print result; #X obj 88 435 t f f; #X obj 219 317 s pd-\$0-regressiontest; #X msg 219 246 clear \, 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 msg 208 294 clear; #X obj 88 239 delay 0; #X obj 71 160 r \$0-receive; #X obj 71 183 moses 0; #X obj 71 206 * -1; #X obj 110 207 t f b; #X obj 88 262 f; #X msg 137 239 stop; #X obj 88 312 delay 0; #X obj 88 335 f; #X msg 154 209 0; #X obj 71 104 t b b s s b; #X obj 313 289 t s s; #X obj 219 226 pack s \$0; #X obj 88 385 t f b; #X obj 88 289 t b f; #X connect 0 0 21 0; #X connect 1 0 0 0; #X connect 3 0 2 0; #X connect 4 0 0 0; #X connect 7 0 3 0; #X connect 7 1 6 0; #X connect 9 0 8 0; #X connect 10 0 8 0; #X connect 11 0 16 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 13 1 15 0; #X connect 14 0 11 0; #X connect 15 0 16 0; #X connect 15 1 17 0; #X connect 16 0 25 0; #X connect 17 0 11 0; #X connect 18 0 19 0; #X connect 19 0 24 0; #X connect 20 0 16 1; #X connect 21 0 5 0; #X connect 21 1 11 0; #X connect 21 2 23 0; #X connect 21 3 22 0; #X connect 21 4 20 0; #X connect 22 0 3 1; #X connect 22 1 6 1; #X connect 23 0 9 0; #X connect 24 0 7 0; #X connect 24 1 10 0; #X connect 25 0 18 0; #X connect 25 1 19 1; #X restore 94 138 pd run-test; #X obj 94 163 outlet; #X obj 94 111 inlet; #N canvas 672 477 450 300 \$0-regressiontest 0; #X restore 92 186 pd \$0-regressiontest; #X obj 91 49 declare -path .; #X connect 0 0 1 0; #X connect 2 0 0 0;