pax_global_header00006660000000000000000000000064143436473760014533gustar00rootroot0000000000000052 comment=5bb3f6c08865961e1d28b933dc235e0f656fa5eb pd-creb-0.10.0/000077500000000000000000000000001434364737600131255ustar00rootroot00000000000000pd-creb-0.10.0/.gitignore000066400000000000000000000000171434364737600151130ustar00rootroot00000000000000*.o *.pd_linux pd-creb-0.10.0/CHANGES.LOG000066400000000000000000000032531434364737600145430ustar00rootroot000000000000000.1-0.7: the dark ages 0.8: 2003/02/18 fixed makefiles, added window~ (0.8.1) some bugfixes + gcc 3 compilation problems 0.9: lots of bugfixes and new objects & abstractions bugfixes: exponential envelopes no longer have a 'hold feature' (use eadsr~ or ear~ combined with a del obj to get a hold) fdn~ blowup fixed lattice~ blowup fixed new objects: blocknorm~: normalizes a set of blocks to rms = 1 sbosc~: smallband pitched complex oscillator (i.e. for formant synth) bitsplit~: splits a signal into a binary representation clog~/cexp~: complex log and exp (clib functions) nfft~/nifft~: normalized versions of the fft~/ifft~ objects blosc~: minimum phase filtered bandlimited oscillators + comparator resofilt~: some vintage filters with all-signal input and proper interpolation scrollgrid1D~: chaotic scroll grid oscillator new abstractions: step_*: some array readers/writers (for step sequencer) cstate~/cstate+~: complex dynwav state read & write pulsor~: pulse with duty cycle for dynwav spectral filtering frequor~: a phasor for frequencies (fft traversal) dsfosc~: complex discrete summation formula oscillator idsfosc~: infinite series version (cheaper, but aliased) cosc~: complex oscillator (complex phasor) ucnorm~: complex unit circle normalization ucmod~: complex unit circle modulation lattice3: expand a (3d) harmonic lattice vector to a frequency ratio ccmap~: complex conformal map of the unit disk cinv~: complex inverse cmul~: complex multipy cadd~/csub~: complex add/sub cconj~: complex conjugate fmop~: fm operator cep~/icep~: cepstrum transform and inverse sin~: sine pd-creb-0.10.0/COPYING000066400000000000000000000431031434364737600141610ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 PDP.LICENSE, 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 Appendix: 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) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. pd-creb-0.10.0/Makefile000066400000000000000000000033101434364737600145620ustar00rootroot00000000000000#!/usr/bin/make -f # Makefile for pure data externals in lib creb. # Needs Makefile.pdlibbuilder to work (https://github.com/pure-data/pd-lib-builder) # per default, build a multi-object library make-lib-executable=no lib.name = creb # special file that does not provide a class lib.setup.sources = modules/setup.c # all other C and C++ files in subdirs are source files per class # (alternatively, enumerate them by hand) class.sources = $(filter-out $(lib.setup.sources),$(wildcard modules/*.c modules++/*.cc)) datafiles = \ $(wildcard doc/*-help.pd abs/*.pd) \ creb-meta.pd \ CHANGES.LOG \ COPYING \ README \ TODO #datadirs = \ #doc/examples # pass current version (from creb-meta.pd) to the compiler #cflags = -DCREB_VERSION=\"$(shell $(SHELL) bin/version)\" # default target 'all' all: pre: bootstrap ################################################################################ ### pdlibbuilder ############################################################### ################################################################################ PDLIBBUILDER_DIR=pd-lib-builder/ include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder ################################################################################ ### creb extra targets ######################################################### ################################################################################ # install files with idiosyncratic source/destination paths install: install-creb-extras install-creb-extras: all $(INSTALL_DIR) $(installpath)/manual && \ $(INSTALL_DATA) doc/reference.txt $(installpath)/manual $(INSTALL_DIR) $(installpath)/examples && \ $(INSTALL_DATA) $(wildcard doc/examples/*.pd) $(installpath)/examples pd-creb-0.10.0/Makefile.config.in000066400000000000000000000007461434364737600164450ustar00rootroot00000000000000PD_INCLUDE_DIR = @PD_INCLUDE_DIR@ LIBNAME = @LIBNAME@ LIBFLAGS = @LIBFLAGS@ prefix=@prefix@ CREB_VERSION = 0.9.2 DEFS = -DPD -DCREB_VERSION=\"$(CREB_VERSION)\" CFLAGS = $(DEFS) -fPIC -O2 -funroll-loops -fomit-frame-pointer \ -Wall -W -Wstrict-prototypes \ -Wno-unused -Wno-parentheses -Wno-switch # -Wshadow INCLUDE = -I$(PD_INCLUDE_DIR) -I../include -I../include/dspi .c.o: $(CC) $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c .cc.o: $(CXX) $(CFLAGS) $(INCLUDE) -o $*.o -c $*.cc pd-creb-0.10.0/README000066400000000000000000000023431434364737600140070ustar00rootroot00000000000000CREB - compl. red. ext. blk. some externals for pure data Copyright (c) by Tom Schouten 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., 675 Mass Ave, Cambridge, MA 02139, USA. The GNU Public Licence can be found in the file COPYING ------------------------------------------------------------------ This is a collection of pd externals. My bag of tricks. To build: ./configure make To run: add the library to the pd startup line, and specify the path for the included abstractions (/abs) To figure out how it works: Documentation patches in doc/ See doc/reference.txt for a list of objects Should build on linux and darwin (OSX). Enjoy, Tom pd-creb-0.10.0/README.darcs000066400000000000000000000002211434364737600150730ustar00rootroot00000000000000to update type darcs pull after getting/pulling, do . bootstrap this will generate the configure scripts, so you can ./configure && make pd-creb-0.10.0/README.extcvs000066400000000000000000000006221434364737600153200ustar00rootroot00000000000000 NOTE FOR THE PURE DATA EXTERNALS CVS if you need to change anything to the source files here, let me know at to prevent i overwrite your changes when i update the CVS from my darcs archive at: http://zwizwa.be/darcs/creb i update like this: * update from darcs tree * update from sourceforge cvs * briefly look over changes, take mine as master * commit darcs + sourceforge pd-creb-0.10.0/README.md000066400000000000000000000020521434364737600144030ustar00rootroot00000000000000Creb - Tom Schouten's abstractions & externals library for Pure Data. This repository will be a merge of Tom Schouten's darcs version from http://zwizwa.be/darcs/creb/ and the pd-extended version from https://git.puredata.info/cgit/svn2git/libraries/creb.git/. As both have seen some independend development, this is an attenpt to merge both. The zwizwa.be version has no commit history (at least in a git readable format) and the git.puredata.info instance does, so the latter is used as the basis. The changes at the zwizwa.be seem rather minor. To reflect the changes, the version number will be changed to 0.9.3. The 2022 change for the Makefile.pdlibbuilder directory, modifies the version number to the more standard format 0.10.0. Compilation (Linux MacOSX) example:
make PDDIR=../pure-data/
Compilation (Windows MinGW2)) example:
make PDDIR=../pure-data/ PDBINDIR=../pdbin64/
Installation example:
make PDDIR=../pure-data/ install pkglibdir=~/Documents/Pd/externals/
Fred Jan Kraan, fjkraan@electrickery.nl, 2022-12-06 pd-creb-0.10.0/TODO000066400000000000000000000001611434364737600136130ustar00rootroot00000000000000* rename or remove matrix~ * fix nan/denorm problems in recursive filters * rewrite iir (c++) stuff -> filters.h pd-creb-0.10.0/abs/000077500000000000000000000000001434364737600136725ustar00rootroot00000000000000pd-creb-0.10.0/abs/64k.pd000066400000000000000000000042251434364737600146260ustar00rootroot00000000000000#N canvas 0 0 968 634 10; #X obj 501 74 soundfiler; #X obj 45 125 * 65536; #X obj 197 414 +~; #X obj 212 383 *~ 65536; #X obj 268 232 metro 62.5; #X obj 213 347 phasor~ 1; #X obj 272 271 sel 0; #X msg 270 296 0; #X obj 561 181 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 45 35 +; #X obj 45 10 *; #X obj 683 196 bpm; #X msg 265 177 reset; #X obj 189 133 count 32; #X obj 478 -63 loadbang; #X obj 265 55 mod 16; #X obj 257 2 *; #X obj 45 97 +; #X obj 257 79 / 16; #X text 41 -46 sample shuffle; #X text 257 -44 beat shuffle; #X obj 265 28 +; #X obj 497 -16 symbol \$1; #X obj 273 -23 inlet; #X obj 498 99 / 65536; #X obj 499 128 - 1; #X obj 45 62 mod; #X obj 61 -25 inlet; #X obj 171 -25 inlet; #X text 151 -46 sample offset; #X obj 377 -23 inlet; #X text 357 -44 beat offset; #X obj 601 278 f; #X obj 681 144 inlet; #X text 688 123 bpm; #X msg 500 43 read -resize -raw 0 1 2 l \$1 \$2; #X obj 501 17 pack s s; #X obj 571 -47 t b b; #X obj 589 144 inlet; #X text 589 123 reset; #X obj 193 477 outlet~; #X obj 580 -17 symbol \$0-table; #X obj 795 95 table \$0-table; #X obj 201 441 tabread4~ \$0-table; #X text 433 459 reset; #X obj 433 480 outlet; #X obj 362 480 outlet; #X text 362 459 counter; #X connect 0 0 24 0; #X connect 1 0 2 0; #X connect 2 0 43 0; #X connect 3 0 2 1; #X connect 4 0 13 0; #X connect 5 0 3 0; #X connect 6 0 7 0; #X connect 7 0 5 1; #X connect 7 0 45 0; #X connect 8 0 4 0; #X connect 8 0 7 0; #X connect 8 0 12 0; #X connect 8 0 32 0; #X connect 9 0 26 0; #X connect 10 0 9 0; #X connect 11 0 4 1; #X connect 11 1 32 0; #X connect 12 0 13 0; #X connect 13 0 6 0; #X connect 13 0 10 0; #X connect 13 0 16 0; #X connect 13 0 46 0; #X connect 14 0 8 0; #X connect 14 0 37 0; #X connect 15 0 18 0; #X connect 16 0 21 0; #X connect 17 0 1 0; #X connect 18 0 17 1; #X connect 21 0 15 0; #X connect 22 0 36 0; #X connect 23 0 16 1; #X connect 24 0 25 0; #X connect 25 0 26 1; #X connect 26 0 17 0; #X connect 27 0 10 1; #X connect 28 0 9 1; #X connect 30 0 21 1; #X connect 32 0 5 0; #X connect 33 0 11 0; #X connect 35 0 0 0; #X connect 36 0 35 0; #X connect 37 0 22 0; #X connect 37 1 41 0; #X connect 38 0 8 0; #X connect 41 0 36 1; #X connect 43 0 40 0; pd-creb-0.10.0/abs/bdft.pd000066400000000000000000000005511434364737600151370ustar00rootroot00000000000000#N canvas 520 402 300 195 10; #X obj 106 9 inlet; #X obj 169 11 inlet; #X obj 121 90 pack \$1 0 0; #X obj 136 150 outlet; #X obj 167 41 t b f; #X obj 110 41 t b f; #X msg 100 125 timefreq \$1 \$2 \$3; #X connect 0 0 5 0; #X connect 1 0 4 0; #X connect 2 0 6 0; #X connect 4 0 2 0; #X connect 4 1 2 1; #X connect 5 0 2 0; #X connect 5 1 2 2; #X connect 6 0 3 0; pd-creb-0.10.0/abs/bdfts.pd000066400000000000000000000006231434364737600153220ustar00rootroot00000000000000#N canvas 520 402 300 195 10; #X obj 106 9 inlet; #X obj 169 11 inlet; #X obj 121 90 pack \$1 0 0; #X obj 136 150 outlet; #X obj 166 60 t b f; #X obj 109 60 t b f; #X msg 100 125 timefreq \$1 \$2 \$3; #X obj 170 36 * 1000; #X connect 0 0 5 0; #X connect 1 0 7 0; #X connect 2 0 6 0; #X connect 4 0 2 0; #X connect 4 1 2 1; #X connect 5 0 2 0; #X connect 5 1 2 2; #X connect 6 0 3 0; #X connect 7 0 4 0; pd-creb-0.10.0/abs/bhip~.pd000066400000000000000000000003571434364737600153440ustar00rootroot00000000000000#N canvas 399 553 450 300 10; #X obj 87 196 biquadseries~ \$1; #X obj 81 134 inlet~; #X obj 138 134 inlet; #X obj 82 236 outlet~; #X msg 107 162 butterHP \$1; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 4 0; #X connect 4 0 0 0; pd-creb-0.10.0/abs/blop~.pd000066400000000000000000000003571434364737600153560ustar00rootroot00000000000000#N canvas 399 553 450 300 10; #X obj 87 196 biquadseries~ \$1; #X msg 107 162 butterLP \$1; #X obj 81 134 inlet~; #X obj 138 134 inlet; #X obj 82 236 outlet~; #X connect 0 0 4 0; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 1 0; pd-creb-0.10.0/abs/bpm.pd000066400000000000000000000006301434364737600147740ustar00rootroot00000000000000#N canvas 385 419 372 239 10; #X obj 48 40 inlet; #X obj 52 155 outlet; #X obj 213 157 outlet; #X text 30 185 quarter note time; #X text 184 188 measure frequency; #X text 46 18 bpm input; #X obj 55 126 /; #X obj 36 67 t b f; #X obj 200 101 / 240; #X msg 44 99 15000; #X connect 0 0 7 0; #X connect 0 0 8 0; #X connect 6 0 1 0; #X connect 7 0 9 0; #X connect 7 1 6 1; #X connect 8 0 2 0; #X connect 9 0 6 0; pd-creb-0.10.0/abs/cadd~.pd000066400000000000000000000004231434364737600153070ustar00rootroot00000000000000#N canvas 800 696 381 197 10; #X obj 58 49 inlet~; #X obj 58 159 outlet~; #X text 49 5 complex addition; #X obj 195 49 inlet~; #X obj 114 49 inlet~; #X obj 114 159 outlet~; #X obj 251 49 inlet~; #X connect 0 0 1 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 6 0 5 0; pd-creb-0.10.0/abs/ccmap~.pd000066400000000000000000000014371434364737600155050ustar00rootroot00000000000000#N canvas 725 589 450 300 10; #X obj 39 85 inlet~; #X obj 139 254 outlet~; #X obj 210 86 inlet~; #X obj 98 85 inlet~; #X obj 198 254 outlet~; #X obj 269 86 inlet~; #X text 63 58 z; #X text 237 60 a; #X obj 159 206 cinv~; #X obj 138 230 cmul~; #X obj 211 117 cconj~; #X obj 159 167 -~ 1; #X obj 64 169 csub~; #X text 23 10 conformal self map of the unit disk (z-a)/(1-conj(a)z) ; #X obj 182 142 cmul~; #X connect 0 0 12 2; #X connect 0 0 14 0; #X connect 2 0 10 0; #X connect 2 0 12 0; #X connect 3 0 12 3; #X connect 3 0 14 1; #X connect 5 0 10 1; #X connect 5 0 12 1; #X connect 8 0 9 2; #X connect 8 1 9 3; #X connect 9 0 1 0; #X connect 9 1 4 0; #X connect 10 0 14 2; #X connect 10 1 14 3; #X connect 11 0 8 0; #X connect 12 0 9 0; #X connect 12 1 9 1; #X connect 14 0 11 0; #X connect 14 1 8 1; pd-creb-0.10.0/abs/cconj~.pd000066400000000000000000000003511434364737600155100ustar00rootroot00000000000000#N canvas 700 418 285 166 10; #X obj 58 49 inlet~; #X obj 57 105 outlet~; #X obj 195 49 inlet~; #X obj 194 105 outlet~; #X obj 194 75 *~ -1; #X text 49 5 complex conjugate; #X connect 0 0 1 0; #X connect 2 0 4 0; #X connect 4 0 3 0; pd-creb-0.10.0/abs/cep~.pd000066400000000000000000000006511434364737600151660ustar00rootroot00000000000000#N canvas 203 382 521 228 10; #X obj 70 42 inlet~; #X obj 124 42 inlet~; #X obj 94 66 nfft~; #X obj 94 95 clog~; #X obj 94 124 nifft~; #X obj 68 164 outlet~; #X obj 126 164 outlet~; #X text 229 45 forward cepstrum; #X text 229 64 using normalized fft/ifft objects; #X connect 0 0 2 0; #X connect 1 0 2 1; #X connect 2 0 3 0; #X connect 2 1 3 1; #X connect 3 0 4 0; #X connect 3 1 4 1; #X connect 4 0 5 0; #X connect 4 1 6 0; pd-creb-0.10.0/abs/cinv~.pd000066400000000000000000000010631434364737600153540ustar00rootroot00000000000000#N canvas 808 178 381 297 10; #X obj 58 49 inlet~; #X obj 58 207 outlet~; #X obj 59 182 *~; #X obj 110 84 *~; #X obj 195 49 inlet~; #X obj 179 208 outlet~; #X obj 180 183 *~; #X obj 145 83 *~; #X obj 94 119 /~; #X obj 196 111 *~ -1; #X obj 73 85 +~ 1; #X text 49 5 complex inverse; #X connect 0 0 2 0; #X connect 0 0 3 0; #X connect 0 0 3 1; #X connect 2 0 1 0; #X connect 3 0 8 1; #X connect 4 0 7 0; #X connect 4 0 7 1; #X connect 4 0 9 0; #X connect 6 0 5 0; #X connect 7 0 8 1; #X connect 8 0 2 1; #X connect 8 0 6 0; #X connect 9 0 6 1; #X connect 10 0 8 0; pd-creb-0.10.0/abs/cmul~.pd000066400000000000000000000011301434364737600153500ustar00rootroot00000000000000#N canvas 24 618 381 197 10; #X obj 58 49 inlet~; #X obj 58 159 outlet~; #X obj 177 154 outlet~; #X text 49 5 complex multiplication; #X obj 178 131 +~; #X obj 58 136 -~; #X obj 58 105 *~; #X obj 108 49 inlet~; #X obj 108 105 *~; #X obj 192 49 inlet~; #X obj 177 106 *~; #X obj 242 49 inlet~; #X obj 227 106 *~; #X connect 0 0 6 0; #X connect 0 0 12 0; #X connect 4 0 2 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 7 0 10 0; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 9 0 10 1; #X connect 10 0 4 0; #X connect 11 0 8 1; #X connect 11 0 12 1; #X connect 12 0 4 1; pd-creb-0.10.0/abs/cosc~.pd000066400000000000000000000010271434364737600153440ustar00rootroot00000000000000#N canvas 267 527 381 197 10; #X obj 57 52 inlet~; #X obj 58 78 phasor~; #X obj 151 51 inlet; #X text 48 25 frequency; #X text 154 25 phase; #X text 49 5 complex oscillator (unit norm exponential); #X obj 59 131 cos~; #X obj 118 132 sin~; #X obj 58 159 outlet~; #X obj 119 158 outlet~; #X obj 221 52 inlet; #X obj 59 105 *~ 1; #X text 211 24 phase synchronous harmonic; #X connect 0 0 1 0; #X connect 1 0 11 0; #X connect 2 0 1 1; #X connect 6 0 8 0; #X connect 7 0 9 0; #X connect 10 0 11 1; #X connect 11 0 7 0; #X connect 11 0 6 0; pd-creb-0.10.0/abs/count.pd000066400000000000000000000006411434364737600153500ustar00rootroot00000000000000#N canvas 245 395 450 300 10; #X obj 51 24 inlet; #X obj 63 144 f 0; #X obj 64 180 + 1; #X obj 99 144 mod \$1; #X msg 75 108 0; #X obj 41 246 outlet; #X obj 44 66 route reset; #X msg 13 109 bang; #X obj 161 20 inlet; #X connect 0 0 6 0; #X connect 1 0 2 0; #X connect 1 0 5 0; #X connect 2 0 3 0; #X connect 3 0 1 1; #X connect 4 0 1 1; #X connect 6 0 4 0; #X connect 6 1 7 0; #X connect 7 0 1 0; #X connect 8 0 3 1; pd-creb-0.10.0/abs/cstate+~.pd000066400000000000000000000003661434364737600157600ustar00rootroot00000000000000#N canvas 441 639 286 142 10; #X obj 23 12 table \$1-real \$2; #X obj 23 33 table \$1-imag \$2; #X obj 23 101 tabsend~ \$1-real; #X obj 143 101 tabsend~ \$1-imag; #X obj 22 70 inlet~; #X obj 143 69 inlet~; #X connect 4 0 2 0; #X connect 5 0 3 0; pd-creb-0.10.0/abs/cstate~.pd000066400000000000000000000002721434364737600157010ustar00rootroot00000000000000#N canvas 441 639 416 164 10; #X obj 18 23 tabreceive~ \$1-real; #X obj 17 52 outlet~; #X obj 164 53 outlet~; #X obj 165 24 tabreceive~ \$1-imag; #X connect 0 0 1 0; #X connect 3 0 2 0; pd-creb-0.10.0/abs/csub~.pd000066400000000000000000000005431434364737600153530ustar00rootroot00000000000000#N canvas 703 725 381 197 10; #X obj 58 49 inlet~; #X obj 58 159 outlet~; #X obj 195 49 inlet~; #X obj 59 101 -~; #X obj 116 49 inlet~; #X obj 116 159 outlet~; #X obj 253 49 inlet~; #X obj 117 101 -~; #X text 49 5 complex subtraction; #X connect 0 0 3 0; #X connect 2 0 3 1; #X connect 3 0 1 0; #X connect 4 0 7 0; #X connect 6 0 7 1; #X connect 7 0 5 0; pd-creb-0.10.0/abs/dsfosc~.pd000066400000000000000000000032501434364737600156760ustar00rootroot00000000000000#N canvas 162 88 557 519 10; #X obj 201 473 outlet~; #X obj 258 473 outlet~; #X text 59 21 complex form of the discrete summation oscillator; #X text 62 38 (1-az^n)/(1-az) \, with z = e^(jw); #X obj 118 122 inlet~; #X text 93 100 frequency; #X obj 263 119 inlet; #X obj 118 284 cosc~; #X obj 233 258 *~ \$1; #X obj 118 350 *~; #X obj 149 350 *~; #X obj 233 283 cosc~; #X obj 232 340 *~; #X obj 263 340 *~; #X obj 118 378 +~ 1; #X obj 233 368 +~ 1; #X obj 119 404 cinv~; #X obj 213 446 cmul~; #X obj 354 122 inlet; #X obj 354 170 * -1; #X obj 166 327 lop~ 10; #X text 195 100 harmonics (N); #X text 317 102 modulation (r); #X obj 384 217 abs; #X obj 354 194 t f f; #X obj 354 278 *; #X obj 354 236 /; #X obj 384 256 pow \$1; #X floatatom 368 316 5 0 0 0 - - -; #X floatatom 192 270 5 0 0 0 - - -; #X obj 264 150 t b f; #X obj 354 148 f; #X obj 298 333 lop~ 10; #X connect 4 0 8 0; #X connect 4 0 7 0; #X connect 6 0 30 0; #X connect 7 0 9 0; #X connect 7 1 10 0; #X connect 8 0 11 0; #X connect 9 0 14 0; #X connect 10 0 16 1; #X connect 11 0 12 0; #X connect 11 1 13 0; #X connect 12 0 15 0; #X connect 13 0 17 3; #X connect 14 0 16 0; #X connect 15 0 17 2; #X connect 16 0 17 0; #X connect 16 1 17 1; #X connect 17 0 0 0; #X connect 17 1 1 0; #X connect 18 0 31 0; #X connect 19 0 24 0; #X connect 19 0 20 0; #X connect 20 0 10 1; #X connect 20 0 9 1; #X connect 23 0 26 1; #X connect 23 0 27 0; #X connect 24 0 26 0; #X connect 24 1 23 0; #X connect 25 0 32 0; #X connect 26 0 25 0; #X connect 27 0 25 1; #X connect 28 0 32 1; #X connect 28 0 29 0; #X connect 29 0 20 1; #X connect 30 0 31 0; #X connect 30 1 8 1; #X connect 30 1 27 1; #X connect 31 0 19 0; #X connect 32 0 13 1; #X connect 32 0 12 1; pd-creb-0.10.0/abs/eadh~.pd000066400000000000000000000007561434364737600153260ustar00rootroot00000000000000#N canvas 127 436 262 228 10; #X obj 34 27 inlet; #X obj 84 27 inlet; #X obj 133 27 inlet; #X msg 44 108 start; #X msg 92 107 stop; #X obj 179 27 inlet; #X msg 34 49 bang; #X obj 44 187 outlet~; #X text 14 6 trigger - attack - decay - hold; #X obj 44 144 ear~ \$1 \$2; #X obj 68 78 del \$3; #X connect 0 0 6 0; #X connect 1 0 9 1; #X connect 2 0 9 2; #X connect 3 0 9 0; #X connect 4 0 9 0; #X connect 5 0 10 1; #X connect 6 0 3 0; #X connect 6 0 10 0; #X connect 9 0 7 0; #X connect 10 0 4 0; pd-creb-0.10.0/abs/eadsrh~.pd000066400000000000000000000011471434364737600156660ustar00rootroot00000000000000#N canvas 127 436 524 279 10; #X obj 34 27 inlet; #X obj 84 27 inlet; #X obj 133 27 inlet; #X msg 44 108 start; #X msg 306 113 stop; #X obj 354 31 inlet; #X msg 34 49 bang; #X obj 44 187 outlet~; #X text 13 6 trigger - attack - decay - sustain - release - duration ; #X obj 44 144 eadsr~ \$1 \$2 \$3 \$4; #X obj 306 84 del \$5; #X obj 211 27 inlet; #X obj 260 27 inlet; #X connect 0 0 6 0; #X connect 1 0 9 1; #X connect 2 0 9 2; #X connect 3 0 9 0; #X connect 4 0 9 0; #X connect 5 0 10 1; #X connect 6 0 3 0; #X connect 6 0 10 0; #X connect 9 0 7 0; #X connect 10 0 4 0; #X connect 11 0 9 3; #X connect 12 0 9 4; pd-creb-0.10.0/abs/expmap~.pd000066400000000000000000000015151434364737600157110ustar00rootroot00000000000000#N canvas 754 478 456 394 10; #X obj 75 47 inlet~; #X obj 134 47 inlet; #X obj 186 47 inlet; #X obj 167 138 /; #X obj 167 160 log; #X text 138 29 min; #X text 193 30 max; #X text 80 9 exponential map from (-1 \, 1) to (min \, max); #X obj 75 244 *~; #X obj 75 302 *~; #X obj 74 335 outlet~; #X obj 214 114 f \$1; #X obj 167 114 f \$2; #X obj 75 268 exp~; #X obj 271 70 t b b; #X obj 271 49 loadbang; #X obj 134 71 t b f; #X obj 74 137 +~ 1; #X obj 74 162 *~ 0.5; #X connect 0 0 17 0; #X connect 1 0 16 0; #X connect 2 0 12 0; #X connect 3 0 4 0; #X connect 4 0 8 1; #X connect 8 0 13 0; #X connect 9 0 10 0; #X connect 11 0 3 1; #X connect 11 0 9 1; #X connect 12 0 3 0; #X connect 13 0 9 0; #X connect 14 0 12 0; #X connect 14 1 11 0; #X connect 15 0 14 0; #X connect 16 0 12 0; #X connect 16 1 11 0; #X connect 17 0 18 0; #X connect 18 0 8 0; pd-creb-0.10.0/abs/fblock.pd000066400000000000000000000012371434364737600154620ustar00rootroot00000000000000#N canvas 290 132 617 246 10; #X obj 36 36 inlet; #X obj 101 35 inlet; #X obj 42 196 outlet; #X obj 104 83 samplerate~; #X obj 101 115 / \$1; #X obj 59 158 +; #X obj 103 144 *; #X obj 103 59 t b b f; #X text 200 79 right inlet is also "active"; #X text 201 119 main usage is to compute block synchronous frequencies ; #X text 200 134 for spectral domain processing; #X text 201 49 out = left + right * (sys samplerate / blocksize); #X text 200 35 fblock: compute block relative frequencies; #X connect 0 0 5 0; #X connect 1 0 7 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 5 0 2 0; #X connect 6 0 5 1; #X connect 7 0 5 0; #X connect 7 1 3 0; #X connect 7 2 6 1; pd-creb-0.10.0/abs/fblock~.pd000066400000000000000000000012071434364737600156550ustar00rootroot00000000000000#N canvas 64 291 617 246 10; #X text 201 77 main usage is to compute block synchronous frequencies ; #X text 200 92 for spectral domain processing; #X text 201 49 out = left + right * (sys samplerate / blocksize); #X obj 36 36 inlet~; #X obj 37 198 outlet~; #X obj 102 110 samplerate~; #X text 200 35 fblock~: compute block relative frequencies; #X obj 102 83 loadbang; #X obj 57 165 *~; #X obj 101 35 inlet~; #X obj 102 138 / \$1; #X obj 171 86 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X connect 3 0 4 0; #X connect 5 0 10 0; #X connect 7 0 5 0; #X connect 8 0 4 0; #X connect 9 0 8 0; #X connect 10 0 8 1; #X connect 11 0 5 0; pd-creb-0.10.0/abs/fmod.pd000066400000000000000000000010351434364737600151430ustar00rootroot00000000000000#N canvas 714 472 443 338 10; #X obj 52 36 inlet; #X obj 52 255 outlet; #X obj 110 36 inlet; #X obj 52 64 / \$1; #X obj 52 230 * \$1; #X obj 82 122 int; #X obj 52 96 t f f; #X obj 52 148 -; #X text 175 90 floating point version of; #X text 361 91 [mod]; #X obj 52 175 moses 0; #X obj 52 203 + 1; #X connect 0 0 3 0; #X connect 2 0 3 1; #X connect 2 0 4 1; #X connect 3 0 6 0; #X connect 4 0 1 0; #X connect 5 0 7 1; #X connect 6 0 7 0; #X connect 6 1 5 0; #X connect 7 0 10 0; #X connect 10 0 11 0; #X connect 10 1 4 0; #X connect 11 0 4 0; pd-creb-0.10.0/abs/fmop~.pd000066400000000000000000000006751434364737600153660ustar00rootroot00000000000000#N canvas 662 414 450 300 10; #X obj 82 154 cos~; #X obj 82 89 phasor~; #X obj 160 96 osc~; #X obj 160 122 *~; #X obj 82 190 outlet~; #X obj 82 61 inlet~; #X obj 160 60 inlet~; #X obj 230 60 inlet~; #X text 76 12 fm operator; #X text 234 38 mod depth; #X text 157 40 mod freq; #X text 59 39 carrier freq; #X connect 0 0 4 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 5 0 1 0; #X connect 6 0 2 0; #X connect 7 0 3 1; pd-creb-0.10.0/abs/frequor~.pd000066400000000000000000000012031434364737600160740ustar00rootroot00000000000000#N canvas 649 489 450 300 10; #X obj 133 212 *~ 2; #X obj 134 235 -~ 1; #X obj 230 141 + 0.5; #X obj 133 188 phasor~; #X msg 190 112 0; #X obj 190 90 loadbang; #X obj 135 258 outlet~; #X obj 133 165 fblock \$1; #X msg 190 141 1; #X obj 132 92 inlet; #X text 28 4 frequor~: frequency domain phasor~ (for traversing spectra) ; #X text 98 75 nb windings; #X text 102 25 output: (0 \, N/2-1) -> (0 \, 1); #X text 152 41 (N/2 \, N-1) -> (-1 \, 0); #X connect 0 0 1 0; #X connect 1 0 6 0; #X connect 2 0 3 1; #X connect 3 0 0 0; #X connect 4 0 2 0; #X connect 4 0 8 0; #X connect 5 0 4 0; #X connect 7 0 3 0; #X connect 8 0 7 1; #X connect 9 0 7 1; pd-creb-0.10.0/abs/icep~.pd000066400000000000000000000006521434364737600153400ustar00rootroot00000000000000#N canvas 318 596 521 228 10; #X obj 70 42 inlet~; #X obj 124 42 inlet~; #X obj 94 66 nfft~; #X obj 94 124 nifft~; #X obj 68 164 outlet~; #X obj 126 164 outlet~; #X text 229 45 backward cepstrum; #X obj 94 95 cexp~; #X text 229 64 using normalized fft/ifft objects; #X connect 0 0 2 0; #X connect 1 0 2 1; #X connect 2 0 7 0; #X connect 2 1 7 1; #X connect 3 0 4 0; #X connect 3 1 5 0; #X connect 7 0 3 0; #X connect 7 1 3 1; pd-creb-0.10.0/abs/idsfosc~.pd000066400000000000000000000012131434364737600160440ustar00rootroot00000000000000#N canvas 414 255 527 400 10; #X obj 118 339 outlet~; #X obj 175 339 outlet~; #X obj 118 122 inlet~; #X text 93 100 frequency; #X obj 118 162 cosc~; #X obj 118 228 *~; #X obj 149 228 *~; #X obj 118 256 +~ 1; #X obj 119 282 cinv~; #X text 59 21 complex form of the (infinite) discrete summation oscillator ; #X text 62 38 1/(1-az) \, with z = e^(jw); #X text 178 103 modulation (a); #X obj 215 123 inlet~; #X obj 214 192 *~ -1; #X connect 2 0 4 0; #X connect 4 0 5 0; #X connect 4 1 6 0; #X connect 5 0 7 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 0 0; #X connect 8 1 1 0; #X connect 12 0 13 0; #X connect 13 0 6 1; #X connect 13 0 5 1; pd-creb-0.10.0/abs/inv.pd000066400000000000000000000002521434364737600150120ustar00rootroot00000000000000#N canvas 329 434 450 300 10; #X obj 68 45 inlet; #X obj 67 130 outlet; #X obj 68 71 + 1; #X obj 68 96 mod 2; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 3 0 1 0; pd-creb-0.10.0/abs/lattice3.pd000066400000000000000000000012421434364737600157260ustar00rootroot00000000000000#N canvas 178 387 450 300 10; #X obj 59 138 pow; #X msg 59 116 2; #X obj 106 139 pow; #X obj 159 136 pow; #X msg 106 117 1.5; #X msg 159 114 1.25; #X obj 106 166 *; #X obj 59 197 *; #X obj 130 47 unpack 0 0 0; #X obj 59 46 t b b b a; #X obj 59 226 outlet; #X obj 59 24 inlet; #X text 22 4 expand harmonic lattice vector in the (2 \, 3/2 \, 5/4) basis; #X connect 0 0 7 0; #X connect 1 0 0 0; #X connect 2 0 6 0; #X connect 3 0 6 1; #X connect 4 0 2 0; #X connect 5 0 3 0; #X connect 6 0 7 1; #X connect 7 0 10 0; #X connect 8 0 0 1; #X connect 8 1 2 1; #X connect 8 2 3 1; #X connect 9 0 1 0; #X connect 9 1 4 0; #X connect 9 2 5 0; #X connect 9 3 8 0; #X connect 11 0 9 0; pd-creb-0.10.0/abs/lpifft~.pd000066400000000000000000000025511434364737600157040ustar00rootroot00000000000000#N canvas 261 505 536 346 10; #X obj 407 227 f; #X obj 351 251 * -1; #X obj 73 189 *~; #X obj 104 189 *~; #X obj 49 41 inlet~; #X obj 103 42 inlet~; #X obj 64 242 +~; #X obj 112 246 -~; #X obj 361 35 inlet; #X obj 377 59 fblock \$1; #X msg 434 38 1; #X obj 361 85 /; #X obj 392 299 +~; #X obj 361 109 moses 1; #X msg 361 131 1; #X obj 407 154 t b f; #X msg 407 176 0.5; #X obj 409 204 /; #X obj 407 275 pulsor~ \$1; #X obj 329 275 pulsor~ \$1; #X obj 446 15 loadbang; #X obj 48 315 outlet~; #X obj 123 312 outlet~; #X text 18 265 xform s.t. real spectrum = mono; #X text 18 7 ifft with rectangular lowpass for anti-aliased dynwav ; #X text 9 18 creation arg = fft size \, right inlet = dynwav cutoff freq; #X obj 122 165 +~; #X obj 73 214 nifft~; #X connect 0 0 1 0; #X connect 0 0 18 0; #X connect 1 0 19 0; #X connect 2 0 27 0; #X connect 3 0 27 1; #X connect 4 0 2 0; #X connect 5 0 3 0; #X connect 6 0 21 0; #X connect 7 0 22 0; #X connect 8 0 11 0; #X connect 9 0 11 1; #X connect 10 0 9 1; #X connect 11 0 13 0; #X connect 12 0 26 0; #X connect 13 0 14 0; #X connect 13 1 15 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 15 1 17 1; #X connect 16 0 17 0; #X connect 17 0 0 0; #X connect 18 0 12 1; #X connect 19 1 12 0; #X connect 20 0 10 0; #X connect 26 0 3 1; #X connect 26 0 2 1; #X connect 27 0 6 0; #X connect 27 0 7 0; #X connect 27 1 6 1; #X connect 27 1 7 1; pd-creb-0.10.0/abs/onecomp~.pd000066400000000000000000000003141434364737600160530ustar00rootroot00000000000000#N canvas 527 369 294 159 10; #X obj 53 26 inlet~; #X obj 53 53 *~ -1; #X obj 53 78 +~ 1; #X obj 53 104 outlet~; #X text 155 23 one compliment; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; pd-creb-0.10.0/abs/pdynwav~.pd000066400000000000000000000003331434364737600161040ustar00rootroot00000000000000#N canvas 164 313 194 151 10; #X obj 30 24 inlet~; #X obj 110 23 inlet; #X obj 30 98 outlet~; #X obj 110 49 phasor~; #X obj 30 67 dynwav~; #X connect 0 0 4 0; #X connect 1 0 3 0; #X connect 3 0 4 1; #X connect 4 0 2 0; pd-creb-0.10.0/abs/pulsor~.pd000066400000000000000000000015741434364737600157500ustar00rootroot00000000000000#N canvas 641 469 535 446 10; #X obj 96 90 fblock \$1; #X obj 203 102 bang~; #X msg 203 126 0; #X obj 96 179 phasor~; #X obj 159 179 phasor~; #X obj 133 216 -~; #X msg 154 64 1; #X obj 154 37 loadbang; #X obj 203 151 +; #X obj 266 78 inlet; #X text 251 57 duty cycle; #X text 46 11 pulsor~: rectangular window w. duty cycle; #X obj 133 243 +~; #X obj 266 126 fmod 1; #X obj 132 273 onecomp~; #X obj 133 301 outlet~; #X text 115 332 pulse outlet; #X obj 266 104 * -1; #X obj 232 301 outlet~; #X text 228 331 complement; #X connect 0 0 4 0; #X connect 0 0 3 0; #X connect 1 0 2 0; #X connect 2 0 8 0; #X connect 2 0 3 1; #X connect 3 0 5 0; #X connect 4 0 5 1; #X connect 5 0 12 0; #X connect 6 0 0 1; #X connect 7 0 6 0; #X connect 8 0 4 1; #X connect 9 0 17 0; #X connect 12 0 14 0; #X connect 12 0 18 0; #X connect 13 0 8 1; #X connect 13 0 12 1; #X connect 14 0 15 0; #X connect 17 0 13 0; pd-creb-0.10.0/abs/rms~.pd000066400000000000000000000002621434364737600152160ustar00rootroot00000000000000#N canvas 190 209 347 206 10; #X obj 113 45 inlet~; #X obj 114 72 env~; #X obj 115 98 dbtorms; #X obj 113 134 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; pd-creb-0.10.0/abs/scale7.pd000066400000000000000000000015401434364737600153750ustar00rootroot00000000000000#N canvas 647 521 450 373 10; #X obj 152 175 select 0 1 2 3 4 5 6; #X obj 224 115 unpack 0 0 0 0 0 0 0; #X obj 225 59 inlet; #X obj 57 51 inlet; #X obj 154 97 mod 7; #X text 219 37 scale input; #X text 48 29 note input; #X obj 224 287 outlet; #X obj 153 220 f; #X obj 185 221 f; #X obj 217 221 f; #X obj 248 220 f; #X obj 280 218 f; #X obj 311 214 f; #X obj 343 212 f; #X connect 0 0 8 0; #X connect 0 1 9 0; #X connect 0 2 10 0; #X connect 0 3 11 0; #X connect 0 4 12 0; #X connect 0 5 13 0; #X connect 0 6 14 0; #X connect 1 0 8 1; #X connect 1 1 9 1; #X connect 1 2 10 1; #X connect 1 3 11 1; #X connect 1 4 12 1; #X connect 1 5 13 1; #X connect 1 6 14 1; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 4 0 0 0; #X connect 8 0 7 0; #X connect 9 0 7 0; #X connect 10 0 7 0; #X connect 11 0 7 0; #X connect 12 0 7 0; #X connect 13 0 7 0; #X connect 14 0 7 0; pd-creb-0.10.0/abs/sin~.pd000066400000000000000000000002561434364737600152110ustar00rootroot00000000000000#N canvas 843 64 157 187 10; #X obj 29 28 inlet~; #X obj 29 59 -~ 0.25; #X obj 29 90 cos~; #X obj 29 117 outlet~; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; pd-creb-0.10.0/abs/step_16.pd000066400000000000000000000022361434364737600155030ustar00rootroot00000000000000#N canvas 347 311 817 158 10; #X obj 42 62 inlet; #X obj 84 62 inlet; #X obj 125 62 inlet; #X obj 166 62 inlet; #X obj 209 62 inlet; #X obj 251 62 inlet; #X obj 292 62 inlet; #X obj 333 62 inlet; #X obj 374 62 inlet; #X obj 416 62 inlet; #X obj 457 62 inlet; #X obj 498 62 inlet; #X obj 541 62 inlet; #X obj 583 62 inlet; #X obj 624 62 inlet; #X obj 665 62 inlet; #X text 51 14 16 part step sequencer array input; #X obj 185 41 + 4; #X obj 42 110 step_4 \$1; #X obj 209 110 step_4 \$1; #X obj 374 41 + 4; #X obj 374 110 step_4 \$1; #X obj 541 110 step_4 \$1; #X obj 540 40 + 4; #X obj 737 40 inlet; #X obj 100 40 f 0; #X obj 341 15 loadbang; #X connect 0 0 18 0; #X connect 1 0 18 1; #X connect 2 0 18 2; #X connect 3 0 18 3; #X connect 4 0 19 0; #X connect 5 0 19 1; #X connect 6 0 19 2; #X connect 7 0 19 3; #X connect 8 0 21 0; #X connect 9 0 21 1; #X connect 10 0 21 2; #X connect 11 0 21 3; #X connect 12 0 22 0; #X connect 13 0 22 1; #X connect 14 0 22 2; #X connect 15 0 22 3; #X connect 17 0 19 4; #X connect 17 0 20 0; #X connect 20 0 21 4; #X connect 20 0 23 0; #X connect 23 0 22 4; #X connect 24 0 25 0; #X connect 25 0 17 0; #X connect 25 0 18 4; #X connect 26 0 25 0; pd-creb-0.10.0/abs/step_16r.pd000066400000000000000000000021751434364737600156670ustar00rootroot00000000000000#N canvas 602 279 442 438 10; #X obj 135 64 inlet; #X text 43 21 4 part building block (read) for a step sequencer array input; #X obj 135 148 + 4; #X obj 135 173 step_4r \$1; #X obj 200 203 outlet; #X obj 178 229 outlet; #X obj 156 252 outlet; #X obj 135 278 outlet; #X obj 21 176 step_4r \$1; #X obj 86 206 outlet; #X obj 64 232 outlet; #X obj 42 255 outlet; #X obj 21 281 outlet; #X obj 363 166 step_4r \$1; #X obj 428 196 outlet; #X obj 406 222 outlet; #X obj 384 245 outlet; #X obj 363 271 outlet; #X obj 249 169 step_4r \$1; #X obj 314 199 outlet; #X obj 292 225 outlet; #X obj 270 248 outlet; #X obj 249 274 outlet; #X obj 249 144 + 8; #X obj 363 141 + 12; #X connect 0 0 2 0; #X connect 0 0 8 0; #X connect 0 0 23 0; #X connect 0 0 24 0; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 3 1 6 0; #X connect 3 2 5 0; #X connect 3 3 4 0; #X connect 8 0 12 0; #X connect 8 1 11 0; #X connect 8 2 10 0; #X connect 8 3 9 0; #X connect 13 0 17 0; #X connect 13 1 16 0; #X connect 13 2 15 0; #X connect 13 3 14 0; #X connect 18 0 22 0; #X connect 18 1 21 0; #X connect 18 2 20 0; #X connect 18 3 19 0; #X connect 23 0 18 0; #X connect 24 0 13 0; pd-creb-0.10.0/abs/step_4.pd000066400000000000000000000014121434364737600154130ustar00rootroot00000000000000#N canvas 241 612 442 251 10; #X obj 59 51 inlet; #X obj 90 186 tabwrite \$1; #X obj 59 79 t f b; #X msg 89 104 0; #X obj 102 51 inlet; #X obj 102 79 t f b; #X obj 145 51 inlet; #X obj 145 79 t f b; #X obj 188 51 inlet; #X obj 188 79 t f b; #X msg 132 104 1; #X msg 175 104 2; #X msg 218 104 3; #X text 43 21 4 part building block for a step sequencer array input ; #X obj 293 50 inlet; #X obj 162 157 +; #X connect 0 0 2 0; #X connect 2 0 1 0; #X connect 2 1 3 0; #X connect 3 0 15 0; #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 5 1 10 0; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 7 1 11 0; #X connect 8 0 9 0; #X connect 9 0 1 0; #X connect 9 1 12 0; #X connect 10 0 15 0; #X connect 11 0 15 0; #X connect 12 0 15 0; #X connect 14 0 15 1; #X connect 15 0 1 1; pd-creb-0.10.0/abs/step_4r.pd000066400000000000000000000011461434364737600156010ustar00rootroot00000000000000#N canvas 241 612 442 251 10; #X obj 59 173 tabread \$1; #X obj 59 199 outlet; #X obj 135 64 inlet; #X obj 135 173 tabread \$1; #X obj 135 199 outlet; #X obj 210 173 tabread \$1; #X obj 210 199 outlet; #X obj 288 173 tabread \$1; #X obj 288 199 outlet; #X obj 135 148 + 1; #X obj 210 148 + 2; #X obj 288 148 + 3; #X text 43 21 4 part building block (read) for a step sequencer array input; #X connect 0 0 1 0; #X connect 2 0 0 0; #X connect 2 0 9 0; #X connect 2 0 10 0; #X connect 2 0 11 0; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 7 0 8 0; #X connect 9 0 3 0; #X connect 10 0 5 0; #X connect 11 0 7 0; pd-creb-0.10.0/abs/tblock.pd000066400000000000000000000013201434364737600154710ustar00rootroot00000000000000#N canvas 506 229 617 246 10; #X obj 36 36 inlet; #X obj 101 35 inlet; #X obj 42 196 outlet; #X obj 144 99 samplerate~; #X obj 59 158 +; #X text 222 78 right inlet is also "active"; #X text 222 133 for spectral domain processing; #X text 222 34 tblock: compute block relative time delays; #X text 223 48 out = left + right * (blocksize / sys_samplerate); #X obj 104 115 /; #X obj 101 92 * \$1; #X obj 103 59 t b f b; #X text 223 118 main usage is to compute block synchronous time delays ; #X obj 95 141 * 1000; #X connect 0 0 4 0; #X connect 1 0 11 0; #X connect 3 0 9 1; #X connect 4 0 2 0; #X connect 9 0 13 0; #X connect 10 0 9 0; #X connect 11 0 4 0; #X connect 11 1 10 0; #X connect 11 2 3 0; #X connect 13 0 4 1; pd-creb-0.10.0/abs/ti_hihat.pd000066400000000000000000000077411434364737600160210ustar00rootroot00000000000000#N canvas 172 85 810 555 10; #X obj -27 21 inlet; #X obj 91 224 ead~; #X obj 90 272 *~; #N canvas 413 387 659 494 hihat 0; #X obj 27 324 square~; #X obj 87 324 square~; #X obj 60 360 *~; #X obj 156 326 square~; #X obj 216 326 square~; #X obj 189 362 *~; #X obj 289 329 square~; #X obj 349 329 square~; #X obj 322 365 *~; #X obj 418 331 square~; #X obj 478 331 square~; #X obj 451 367 *~; #X obj 320 396 +~; #X obj 165 408 +~; #X obj 217 444 outlet~; #X obj 212 181 f; #X obj 251 183 + 1; #X obj 211 155 until; #X msg 210 131 8; #X msg 242 130 0; #X obj 210 108 t b b; #X obj 210 79 t b f; #X obj 277 212 random 20000; #X msg 309 128 seed \$1; #X obj 211 211 t f b; #X obj 212 256 pack 0 0; #X obj 212 278 route 0 1 2 3 4 5 6 7; #X obj 210 34 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 600.246 256; #X floatatom 28 304 5 0 0 0 - - -; #X floatatom 93 305 5 0 0 0 - - -; #X floatatom 161 305 5 0 0 0 - - -; #X floatatom 219 307 5 0 0 0 - - -; #X floatatom 292 307 5 0 0 0 - - -; #X floatatom 353 305 5 0 0 0 - - -; #X floatatom 421 307 5 0 0 0 - - -; #X floatatom 481 311 5 0 0 0 - - -; #X obj 279 237 + 0; #X text 193 16 magic number; #X obj 355 37 nbx 5 14 20 20000 1 1 empty empty empty 0 -6 0 10 -262144 -1 -1 10752.2 256; #X text 344 18 freq range; #X obj 464 37 nbx 5 14 20 20000 1 1 empty empty empty 0 -6 0 10 -262144 -1 -1 95.6572 256; #X text 433 16 bottom freq; #X obj 143 31 inlet; #X obj 307 38 inlet; #X obj 424 36 inlet; #X obj 143 62 * 1000; #X obj 210 55 f 0; #X obj 456 79 t b f; #X obj 354 59 t b f; #X connect 0 0 2 0; #X connect 1 0 2 1; #X connect 2 0 13 0; #X connect 3 0 5 0; #X connect 4 0 5 1; #X connect 5 0 13 1; #X connect 6 0 8 0; #X connect 7 0 8 1; #X connect 8 0 12 0; #X connect 9 0 11 0; #X connect 10 0 11 1; #X connect 11 0 12 1; #X connect 12 0 14 0; #X connect 13 0 14 0; #X connect 15 0 16 0; #X connect 15 0 24 0; #X connect 16 0 15 1; #X connect 17 0 15 0; #X connect 18 0 17 0; #X connect 19 0 15 1; #X connect 20 0 18 0; #X connect 20 1 19 0; #X connect 21 0 20 0; #X connect 21 1 23 0; #X connect 22 0 36 0; #X connect 23 0 22 0; #X connect 24 0 25 0; #X connect 24 1 22 0; #X connect 25 0 26 0; #X connect 26 0 28 0; #X connect 26 1 29 0; #X connect 26 2 30 0; #X connect 26 3 31 0; #X connect 26 4 32 0; #X connect 26 5 33 0; #X connect 26 6 34 0; #X connect 26 7 35 0; #X connect 27 0 46 0; #X connect 28 0 0 0; #X connect 29 0 1 0; #X connect 30 0 3 0; #X connect 31 0 4 0; #X connect 32 0 6 0; #X connect 33 0 7 0; #X connect 34 0 9 0; #X connect 35 0 10 0; #X connect 36 0 25 1; #X connect 38 0 48 0; #X connect 40 0 36 1; #X connect 40 0 47 0; #X connect 42 0 45 0; #X connect 43 0 38 0; #X connect 44 0 40 0; #X connect 45 0 27 0; #X connect 46 0 21 0; #X connect 47 0 46 0; #X connect 47 1 36 1; #X connect 48 0 46 0; #X connect 48 1 22 1; #X restore 105 248 pd hihat; #X obj 130 294 nbx 5 14 20 20000 1 1 empty empty HP -20 7 0 10 -24198 -1 -1 20 256; #X obj 89 313 bhip~ 1; #X obj 189 42 nbx 3 14 -1e+37 1e+37 0 1 empty empty A' -14 7 0 10 -225271 -1 -1 5 256; #X obj 76 174 +; #X obj 38 39 nbx 3 14 -1e+37 1e+37 0 1 empty empty A -10 7 0 10 -260818 -1 -1 5 256; #X obj 145 180 +; #X obj 101 39 nbx 3 14 -1e+37 1e+37 0 1 empty empty D -10 7 0 10 -260818 -1 -1 36 256; #X obj 76 141 *; #X obj 145 142 *; #X obj 89 339 outlet~; #X obj 258 41 nbx 3 14 -1e+37 1e+37 0 1 empty empty D' -14 7 0 10 -225271 -1 -1 36 256; #X obj -20 82 t b f; #X obj 101 17 inlet; #X obj 38 18 inlet; #X obj 257 19 inlet; #X obj 188 18 inlet; #X obj 327 21 inlet; #X obj 379 21 inlet; #X connect 0 0 15 0; #X connect 1 0 2 0; #X connect 2 0 5 0; #X connect 3 0 2 1; #X connect 4 0 5 1; #X connect 5 0 13 0; #X connect 6 0 11 1; #X connect 7 0 1 1; #X connect 8 0 7 1; #X connect 9 0 1 2; #X connect 10 0 9 1; #X connect 11 0 7 0; #X connect 12 0 9 0; #X connect 14 0 12 1; #X connect 15 0 1 0; #X connect 15 1 11 0; #X connect 15 1 12 0; #X connect 16 0 10 0; #X connect 17 0 8 0; #X connect 18 0 14 0; #X connect 19 0 6 0; #X connect 20 0 4 0; #X connect 21 0 3 0; #X coords 0 0 0.00245098 0.00260417 200 50 0; pd-creb-0.10.0/abs/ti_snare.pd000066400000000000000000000036751434364737600160360ustar00rootroot00000000000000#N canvas 448 117 288 79 10; #X obj 143 84 inlet; #X obj 243 84 inlet; #X obj 112 323 vol~; #X obj 222 52 nbx 3 14 -1e+37 1e+37 0 1 empty empty VOL -20 7 0 10 -262144 -1 -1 99.47 256; #X obj 140 30 nbx 5 14 20 20000 1 1 empty empty T1 -20 7 0 10 -24198 -1 -1 552.632 256; #X obj 74 30 nbx 3 14 -1e+37 1e+37 0 1 empty empty A' -14 7 0 10 -225271 -1 -1 0 256; #X obj 43 106 +; #X obj 12 29 nbx 3 14 -1e+37 1e+37 0 1 empty empty A -10 7 0 10 -260818 -1 -1 -1 256; #X obj 44 172 +; #X obj 13 50 nbx 3 14 -1e+37 1e+37 0 1 empty empty D -10 7 0 10 -260818 -1 -1 113 256; #X obj 43 83 *; #X obj 44 134 *; #X obj 101 347 outlet~; #X obj 80 4 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 178 153 spigot; #X obj 74 50 nbx 3 14 -1e+37 1e+37 0 1 empty empty D' -14 7 0 10 -225271 -1 -1 45 256; #X obj 140 51 nbx 5 14 20 20000 1 1 empty empty T2 -20 7 0 10 -24198 -1 -1 151.334 256; #X obj 222 30 nbx 5 14 20 20000 1 1 empty empty T3 -20 7 0 10 -24198 -1 -1 9652.14 256; #X text 9 2 ti_snare; #X obj 186 209 ead~; #X obj 236 247 osc~; #X obj 122 172 osc~; #X obj 109 286 *~; #X obj 242 178 noise~; #X obj 240 210 lop~; #X obj 151 209 *~; #X obj 82 250 *~; #X obj 103 207 *~; #X obj 154 109 t b b; #X obj 116 110 f 0; #X connect 0 0 28 0; #X connect 1 0 29 0; #X connect 2 0 12 0; #X connect 3 0 2 1; #X connect 4 0 21 0; #X connect 5 0 10 1; #X connect 6 0 19 1; #X connect 7 0 6 1; #X connect 8 0 19 2; #X connect 9 0 8 1; #X connect 10 0 6 0; #X connect 11 0 8 0; #X connect 13 0 14 1; #X connect 14 0 19 0; #X connect 15 0 11 1; #X connect 16 0 20 0; #X connect 17 0 24 1; #X connect 19 0 22 1; #X connect 19 0 25 1; #X connect 19 0 26 1; #X connect 20 0 22 0; #X connect 21 0 25 0; #X connect 21 0 27 0; #X connect 22 0 2 0; #X connect 23 0 24 0; #X connect 24 0 22 0; #X connect 24 0 27 1; #X connect 25 0 22 0; #X connect 26 0 22 1; #X connect 27 0 26 0; #X connect 28 0 14 0; #X connect 28 1 29 0; #X connect 29 0 10 0; #X connect 29 0 11 0; #X coords 0 0 1 1 270 50 1; pd-creb-0.10.0/abs/ucmod~.pd000066400000000000000000000011271434364737600155250ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X obj 74 72 inlet~; #X obj 121 72 inlet~; #X obj 150 147 *~ -1; #X obj 87 114 *~; #X obj 124 114 *~; #X obj 179 71 inlet~; #X obj 86 146 +~ 1; #X obj 88 236 cmul~; #X obj 135 193 cinv~; #X obj 87 266 outlet~; #X obj 144 267 outlet~; #X text 84 18 unit circle modulator. (1+r conj(z)/(1+rz); #X connect 0 0 3 0; #X connect 1 0 4 0; #X connect 2 0 8 1; #X connect 3 0 6 0; #X connect 4 0 7 1; #X connect 4 0 2 0; #X connect 5 0 4 1; #X connect 5 0 3 1; #X connect 6 0 7 0; #X connect 6 0 8 0; #X connect 7 0 9 0; #X connect 7 1 10 0; #X connect 8 0 7 2; #X connect 8 1 7 3; pd-creb-0.10.0/abs/ucnorm~.pd000066400000000000000000000011241434364737600157160ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X text 59 21 normalize complex number to unit magnitude; #X obj 117 70 inlet~; #X obj 131 99 *~; #X obj 187 70 inlet~; #X obj 203 99 *~; #X obj 226 157 +~ 1; #X obj 226 185 /~; #X obj 226 213 sqrt~; #X obj 116 242 *~; #X obj 116 264 outlet~; #X obj 186 242 *~; #X obj 186 264 outlet~; #X connect 1 0 2 0; #X connect 1 0 2 1; #X connect 1 0 8 0; #X connect 2 0 6 1; #X connect 3 0 4 0; #X connect 3 0 4 1; #X connect 3 0 10 0; #X connect 4 0 6 1; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 10 1; #X connect 7 0 8 1; #X connect 8 0 9 0; #X connect 10 0 11 0; pd-creb-0.10.0/abs/vols~.pd000066400000000000000000000007741434364737600154100ustar00rootroot00000000000000#N canvas 441 433 450 300 10; #X obj 68 21 inlet~; #X obj 122 22 inlet; #X obj 80 104 *~; #X obj 77 141 outlet~; #X obj 116 42 dbtorms; #X obj 114 92 line~; #X msg 112 66 \$1 5; #X obj 215 34 loadbang; #X obj 218 66 f \$1; #X obj 6 22 inlet~; #X obj 18 105 *~; #X obj 15 142 outlet~; #X connect 0 0 2 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 4 0 6 0; #X connect 5 0 2 1; #X connect 5 0 10 1; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 8 0 4 0; #X connect 9 0 10 0; #X connect 10 0 11 0; pd-creb-0.10.0/abs/vol~.pd000066400000000000000000000005771434364737600152260ustar00rootroot00000000000000#N canvas 441 433 450 300 10; #X obj 68 21 inlet~; #X obj 122 22 inlet; #X obj 80 104 *~; #X obj 77 141 outlet~; #X obj 116 42 dbtorms; #X obj 114 92 line~; #X msg 112 66 \$1 5; #X obj 215 34 loadbang; #X obj 218 66 f \$1; #X connect 0 0 2 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 4 0 6 0; #X connect 5 0 2 1; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 8 0 4 0; pd-creb-0.10.0/bootstrap000066400000000000000000000000441434364737600150630ustar00rootroot00000000000000#!/bin/bash autoconf chmod +x bin/* pd-creb-0.10.0/configure.ac000066400000000000000000000015471434364737600154220ustar00rootroot00000000000000AC_INIT(modules/setup.c) AC_PROG_CC AC_HEADER_STDC echo -n "checking architecture... " ARCH=`uname -s` if test $ARCH == Linux; then PD_INCLUDE_DIR=$prefix/pd/src LIBNAME=creb.pd_linux LIBFLAGS="-rdynamic -shared" echo "Linux" elif test $ARCH == Darwin; then PD_INCLUDE_DIR=$prefix/pd/src LIBNAME=creb.pd_darwin LIBFLAGS="-bundle -bundle_loader $prefix/pd/bin/pd" echo "Darwin" else echo WARNING: Architecture `uname -s` not supported. exit; fi CPPFLAGS="$CPPFLAGS -I$prefix/pd/src" AC_CHECK_HEADER(m_pd.h,, echo "WARNING: m_pd.h not found in the standard include path." echo " If PD_DIR in Makefile.config.in is set correctly you can ignore this warning." ) AC_CHECK_LIB(m,sin,, echo "Math library not found. sorry..." || exit) AC_SUBST(PD_INCLUDE_DIR) AC_SUBST(LIBNAME) AC_SUBST(LIBFLAGS) AC_CONFIG_FILES(Makefile.config) AC_OUTPUT pd-creb-0.10.0/creb-meta.pd000066400000000000000000000005421434364737600153120ustar00rootroot00000000000000#N canvas 48 350 450 300 10; #X text 9 20 AUTHOR Tom Schouten ; #X text 9 40 DESCRIPTION This is a collection of pd externals. My bag of tricks.; #X text 9 80 LICENSE GNU GPL 2; #X text 9 100 VERSION 0.10.0; #X text 9 120 REPOSITORY https://github.com/electrickery/pd-creb; #X text 9 140 MAINAINER Fred Jan Kraan pd-creb-0.10.0/creb.mk000066400000000000000000000037551434364737600144030ustar00rootroot00000000000000#!/usr/bin/make -f # Faster alternative makefile, for development only. SRC_C:= \ ./modules/dwt.c \ ./modules/scrollgrid1D~.c \ ./modules/diag~.c \ ./modules/statwav~.c \ ./modules/xfm~.c \ ./modules/junction~.c \ ./modules/permut~.c \ ./modules/dynwav~.c \ ./modules/dist~.c \ ./modules/setup.c \ ./modules/qmult~.c \ ./modules/ffpoly.c \ ./modules/sawtooth~.c \ ./modules/sbosc~.c \ ./modules/ratio.c \ ./modules/bitsplit~.c \ ./modules/fdn~.c \ ./modules/eblosc~.c \ ./modules/bwin~.c \ ./modules/fwarp.c \ ./modules/cmath.c \ ./modules/cheby~.c \ ./modules/blocknorm~.c \ ./modules/bdiag~.c \ ./modules/ramp~.c \ ./modules/tabreadmix~.c \ ./modules/ead~.c \ ./modules/matrix~.c \ ./modules/abs~.c \ ./modules/lattice~.c \ ./modules/resofilt~.c \ ./modules/ear~.c \ ./modules/qnorm~.c \ ./modules/eadsr~.c \ ./modules/bfft~.c \ SRC_CC := \ ./modules++/blosc~.cc \ ./modules++/biquadseries~.cc \ ./modules++/filterortho~.cc \ GCC_CFLAGS := -funroll-loops CC := gcc $(GCC_CFLAGS) CPLUSPLUS := g++ $(GCC_CFLAGS) # CC := clang # CPLUSPLUS := clang++ CFLAGS := -DPD -DCREB_VERSION=\"0.9.2\" -fPIC -O3 -fomit-frame-pointer -Wall -W -Wno-unused -Wno-parentheses -Wno-switch BUILD := build ARCH := pd_linux LDFLAGS := -rdynamic -shared OUT := $(BUILD)/creb.$(ARCH) O := \ $(patsubst %.c,$(BUILD)/%.o,$(SRC_C)) \ $(patsubst %.cc,$(BUILD)/%.o,$(SRC_CC)) D := $(O:.o=.d) .SECONDARY: .DELETE_ON_ERROR: .PHONY: all all: $(OUT) .PHONY: clean clean: rm -rf build $(BUILD)/%.d: %.c @echo [d] $(notdir $@) @mkdir -p $(dir $@) @$(CC) -MT $(basename $@).o -MM $(CFLAGS) $< >$@ $(BUILD)/%.d: %.cc @echo [d] $(notdir $@) @mkdir -p $(dir $@) @$(CPLUSPLUS) -MT $(basename $@).o -MM $(CFLAGS) $< >$@ $(BUILD)/%.o: %.c $(BUILD)/%.d @echo [o] $(notdir $@) @mkdir -p $(dir $@) @$(CC) $(CFLAGS) -c $< -o $@ $(BUILD)/%.o: %.cc $(BUILD)/%.d @echo [o] $(notdir $@) @mkdir -p $(dir $@) @$(CPLUSPLUS) $(CFLAGS) -c $< -o $@ $(OUT): $(O) @echo [pd_linux] $(notdir $@) @$(CPLUSPLUS) $(LDFLAGS) -o $@ $(O) $(LIBS) -include $(D) pd-creb-0.10.0/doc/000077500000000000000000000000001434364737600136725ustar00rootroot00000000000000pd-creb-0.10.0/doc/64k-help.pd000066400000000000000000000013751434364737600155570ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X text 102 32 a beat shuffler using raw 64k/break sample banks; #N canvas 331 92 494 506 META 0; #X text 12 265 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_1 float; #X text 12 45 DESCRIPTION an overlap add tabread~ clone; #X text 12 65 INLET_0 float; #X text 12 105 INLET_2 float; #X text 12 125 INLET_3 bang; #X text 12 145 INLET_4 float; #X text 12 165 INLET_5 float; #X text 12 185 OUTLET_0 signal; #X text 12 205 OUTLET_1 float; #X text 12 225 OUTLET_2 float; #X text 12 5 KEYWORDS signal abstraction array needs_work (example patch); #X text 12 245 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 398 277 pd META; #X obj 33 32 64k ------; pd-creb-0.10.0/doc/all-abstractions.pd000066400000000000000000000052411434364737600174630ustar00rootroot00000000000000#N canvas 1051 76 572 997 12; #X text 10 10 creb abstractions; #X obj 10 30 creb/64k; #X obj 10 55 creb/bdft; #X obj 10 80 creb/bdfts; #X obj 10 105 creb/bhip~; #X obj 10 130 creb/blop~; #X obj 10 155 creb/bpm; #X obj 10 180 creb/cadd~; #X obj 10 205 creb/ccmap~; #X obj 10 230 creb/cconj~; #X obj 10 255 creb/cep~; #X obj 10 280 creb/icep~; #X obj 10 305 creb/cinv~; #X obj 10 330 creb/cmul~; #X obj 10 355 creb/count; #X obj 10 380 creb/cosc~; #X obj 10 405 creb/csub~; #X obj 10 430 creb/dsfosc~; #X obj 10 455 creb/eadh~; #X obj 10 480 creb/eadsrh~; #X obj 10 505 creb/expmap~; #X obj 10 530 creb/fblock; #X obj 10 555 creb/fmod; #X obj 10 580 creb/fmop~; #X obj 10 605 creb/frequor~; #X obj 10 630 creb/idsfosc~; #X obj 10 655 creb/inv; #X obj 10 680 creb/lattice3; #X obj 10 705 creb/pdynwav~; #X obj 10 730 creb/lpifft~; #X obj 10 755 creb/scale7; #X obj 10 780 creb/ti_hihat; #X obj 10 845 creb/ti_snare; #X obj 10 900 creb/tblock; #X obj 10 925 creb/ucnorm~; #X obj 10 950 creb/ucmod~; #X obj 10 975 creb/vols~; #X obj 10 1000 creb/vol~; #X text 130 30 a beat shuffler using raw 64k/break sample banks; #X text 130 55 set decay time (ms/sec) and osc frequency (for bdiag~) ; #X text 130 80 set decay time (ms/sec) and osc frequency (for bdiag~) ; #X text 130 105 butterworth high pass filter; #X text 130 130 butterworth low pass filter; #X text 130 155 convert bpm to metro time and phasor freq; #X text 130 180 complex add; #X text 130 205 conformal self map of the unit disk; #X text 130 230 complex conjugate; #X text 130 255 complex cepstrum; #X text 130 280 complex cepstrum inverse; #X text 130 305 complex inverse; #X text 130 330 complex multiplication; #X text 130 355 modulo counter; #X text 130 380 complex oscillator; #X text 130 405 complex subtraction; #X text 130 430 (finite) discrete summation formula oscillator; #X text 130 455 exponential attack decay (with hold == duration); #X text 130 480 exponential attack decay sustain release (..); #X text 130 505 exponential map; #X text 130 530 block relative frequency conversion; #X text 130 555 floating point modulo; #X text 130 580 fm operator; #X text 130 605 like phasor; #X text 130 630 infinite discrete summation formula; #X text 130 655 inverse; #X text 130 680 expand a 3D harmonic lattice vector; #X text 130 705 ifft + lowpass (for anti-aliased dynwav); #X text 130 730 phasor~ + dynwav~; #X text 130 755 arbitrary 7 tone scale; #X text 300 781 hihat gop object; #X text 300 845 snare drum gop object; #X text 130 900 block relative time conversion; #X text 130 925 normalize a complex signal to unit norm; #X text 130 950 unit circle modulator; #X text 130 975 volume for a stereo signal; #X text 130 1000 volume for a mono signal; pd-creb-0.10.0/doc/all-modules.pd000066400000000000000000000061061434364737600164400ustar00rootroot00000000000000#N canvas 447 76 577 969 12; #X text 10 1 creb all modules; #X obj 10 30 creb/ffpoly; #X obj 10 55 creb/fwarp; #X obj 10 80 creb/ratio; #X obj 10 155 creb/bdiag~; #X obj 10 180 creb/bfft~; #X obj 10 205 creb/bitsplit~; #X obj 10 230 creb/bwin~; #X obj 10 255 creb/biquadseries~; #X obj 10 280 creb/bitsplit~; #X obj 10 305 creb/blocknorm~; #X obj 10 345 creb/blosc~; #X obj 10 395 creb/cheby~; #X obj 10 420 creb/clog~; #X obj 10 445 creb/diag~; #X obj 10 470 creb/dist~; #X obj 10 495 creb/dwt~; #X text 150 30 finite field polynomial; #X text 150 55 tangent warp frequency; #X text 150 80 multiply by 2^k so result is 1<=r<2 (transposer); #X text 150 155 block diagonal state space system (spectral processor) ; #X text 150 180 reordered fft; #X text 150 205 convert signal to binary vector; #X text 150 230 several windowing functions and spectral envelopes ; #X text 150 255 biquad second order sections (i.e. butterworth); #X text 150 280 convert a signal to binary representation; #X text 150 305 normalize a (set of) dsp block(s) (i.e. for spectral processing); #X text 150 345 several bandlimited oscillators; #X text 150 395 chebyshev polynomial waveshaper; #X text 150 420 complex log; #X text 150 445 diagonal state space system (spectral processor); #X text 150 470 several distortions & waveshaping functions; #X text 150 495 discrete wavelet transform; #X obj 10 370 creb/cexp~; #X text 150 370 complex exp; #X obj 10 539 creb/dynwav~; #X obj 10 564 creb/ead~; #X obj 10 589 creb/eadsr~; #X obj 10 614 creb/ear~; #X obj 10 639 creb/filterortho~; #X obj 10 664 creb/fdn~; #X obj 10 689 creb/junction~; #X obj 10 714 creb/lattice~; #X obj 10 764 creb/permut~; #X obj 10 789 creb/qmult~; #X obj 10 814 creb/qnorm~; #X obj 10 839 creb/ramp~; #X obj 10 864 creb/resofilt~; #X obj 10 889 creb/sbosc~; #X obj 10 914 creb/statwav~; #X obj 10 939 creb/scrollgrid1D~; #X obj 10 964 creb/tabreadmix~; #X obj 10 989 creb/xfm~; #X text 150 514 inverse discrete wavelet transform; #X text 150 539 dynamic wavetable: use a signal block as wavetable ; #X text 150 564 exp. attack decay; #X text 150 589 exp. attack decay sustain release; #X text 150 614 exp. attack release; #X text 150 639 several biquad filters; #X text 150 664 a feedback delay network; #X text 150 689 a circulant lossless signal junction; #X text 150 714 lattice filter; #X text 150 739 multiply a signal block with an arbitrary matrix; #X text 150 764 random permute a signal block; #X text 150 789 multiply 2 quaternion signals; #X text 150 814 normalize a quaternion signal (or any 4 channel sig) ; #X text 150 839 generates an integer ramp; #X text 150 864 a reso filter (4pole; #X text 150 889 smallband oscillator (i.e. for formant synthesis); #X text 150 914 a tabread4~ clone with 8 point interpolation; #X text 150 939 a stabilized scroll grid chaotic oscillator; #X text 150 964 a tabread~ clone with overlap add (for smooth time stretch); #X text 150 989 coupled frequency modulation; #X text 5 516 [creb/idwt~]; #X obj 10 739 creb/bmatrix~; #X obj 10 1014 creb/nfft~; #X text 150 1014 mayer fft; #X obj 10 1038 creb/nifft~; #X text 150 1038 mayer inverse fft; pd-creb-0.10.0/doc/bdft-help.pd000066400000000000000000000007551434364737600160730ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #N canvas 145 112 494 314 META 0; #X text 12 145 HELP_PATCH_AUTHORS Added by Jonathan Wilkes.; #X text 12 5 KEYWORDS control abstraction; #X text 12 45 DESCRIPTION set decay time for [bdiag~]; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 anything; #X text 12 125 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 398 279 pd META; #X text 114 58 set decay time (ms/sec) for [bdiag~]; #X obj 71 58 bdft; pd-creb-0.10.0/doc/bdfts-help.pd000066400000000000000000000010211434364737600162410ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #N canvas 145 112 494 314 META 0; #X text 12 165 HELP_PATCH_AUTHORS Added by Jonathan Wilkes.; #X text 12 125 LIBRARY external creb; #X text 12 5 KEYWORDS control abstraction; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 anything; #X text 12 45 DESCRIPTION set osc frequency for [bdiag~]; #X text 12 145 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 398 279 pd META; #X text 114 58 set osc frequency for [bdiag~]; #X obj 71 58 bdfts; pd-creb-0.10.0/doc/bdiag~-help.pd000066400000000000000000000066701434364737600164220ustar00rootroot00000000000000#N canvas 0 26 650 407 10; #X obj 34 45 metro; #X msg 34 20 bang; #X floatatom 76 20 5 0 0 0 - - -; #X obj 34 327 dist~ 1; #X obj 24 359 dac~; #N canvas 11 6 262 403 systemparams 0; #X floatatom 81 47 5 0 0 0 - - -; #X floatatom 125 47 5 0 0 0 - - -; #X floatatom 81 74 5 0 0 0 - - -; #X floatatom 125 74 5 0 0 0 - - -; #X floatatom 81 102 5 0 0 0 - - -; #X floatatom 125 102 5 0 0 0 - - -; #X floatatom 81 129 5 0 0 0 - - -; #X floatatom 125 129 5 0 0 0 - - -; #X floatatom 81 157 5 0 0 0 - - -; #X floatatom 125 157 5 0 0 0 - - -; #X floatatom 81 184 5 0 0 0 - - -; #X floatatom 125 184 5 0 0 0 - - -; #X floatatom 81 212 5 0 0 0 - - -; #X floatatom 125 212 5 0 0 0 - - -; #X floatatom 81 239 5 0 0 0 - - -; #X floatatom 125 239 5 0 0 0 - - -; #X obj 28 65 bdft 1; #X obj 27 93 bdft 2; #X obj 28 120 bdft 3; #X obj 28 175 bdft 7; #X obj 28 202 bdft 11; #X obj 28 230 bdft 17; #X obj 28 257 bdft 30; #X obj 28 319 outlet; #X text 20 23 frequency detune and damping; #X text 49 283 bdft argument = harmonic; #X obj 28 147 bdft 5; #X connect 0 0 16 0; #X connect 1 0 16 1; #X connect 2 0 17 0; #X connect 3 0 17 1; #X connect 4 0 18 0; #X connect 5 0 18 1; #X connect 6 0 26 0; #X connect 7 0 26 1; #X connect 8 0 19 0; #X connect 9 0 19 1; #X connect 10 0 20 0; #X connect 11 0 20 1; #X connect 12 0 21 0; #X connect 13 0 21 1; #X connect 14 0 22 0; #X connect 15 0 22 1; #X connect 16 0 23 0; #X connect 17 0 23 0; #X connect 18 0 23 0; #X connect 19 0 23 0; #X connect 20 0 23 0; #X connect 21 0 23 0; #X connect 22 0 23 0; #X connect 26 0 23 0; #X restore 89 76 pd systemparams; #X obj 34 93 bdiag~; #X obj 34 232 dynwav~; #X obj 34 283 vol~; #X floatatom 57 257 5 0 0 0 - - -; #X floatatom 78 168 5 0 0 0 - - -; #X obj 78 196 phasor~; #X text 258 168 the [eig ] message sets the eigenvalue for the corresponding block. there are n/2 blocks \, with n the dsp blocksize.; #X text 259 223 you can use [timefreq <60dB time> ] for a more appropriate initialization of the eigenvalues using decay time in milliseconds and oscillation frequency in Hz.; #X text 256 18 bdiag~: parallel block diagonal state space model (parallel 2d rotations) see bdiag.c for more info. the state equations for one block are:; #X text 300 70 state1 = real * state1 - imag * state2 + input1; #X text 300 85 state2 = real * state2 + imag * state1 + input2; #X text 258 121 this module is intended to "filter" spectral data produced by bfft or other short time spectral transforms like dwt.; #X text 256 279 [bang] or [random] set the state vector to a random value. [reset] sets it to 0; #X text 256 327 this patch uses of bdiag~ \, ibfft~ and dynwav~ to build a 32 voice harmonic modal synth \, with the state excited with white noise on bang.; #N canvas 379 254 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION parallel block diagonal state space model (parallel 2d rotations); #X text 12 75 INLET_0 bang signal random reset timefreq eig; #X text 12 95 OUTLET_0 signal; #X text 11 5 KEYWORDS signal; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR Tom Schouten ; #X restore 600 386 pd META; #X obj 34 129 ibfft~; #X connect 0 0 6 0; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 4 0; #X connect 3 0 4 1; #X connect 5 0 6 0; #X connect 6 0 21 0; #X connect 7 0 8 0; #X connect 8 0 3 0; #X connect 9 0 8 1; #X connect 10 0 11 0; #X connect 11 0 7 1; #X connect 21 0 7 0; pd-creb-0.10.0/doc/bfft~-help.pd000066400000000000000000000020161434364737600162630ustar00rootroot00000000000000#N canvas 5 76 480 309 10; #X obj 17 62 osc~ 500; #X floatatom 17 -11 5 0 0 0 - - -; #X obj 17 23 * 187.5; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 64 float 0; #X coords 0 1 63 -1 200 140 1 0 0; #X restore 233 16 graph; #X text 13 -74 like fft~ but normalized and; #N canvas 379 254 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal block_oriented; #X text 12 45 DESCRIPTION like fft~ but normalized and spectrum: (DC \, NY) \, (R1 \, I1) \, ...(RN-1 \, IN-1); #X text 12 75 INLET_0 signal; #X text 12 95 OUTLET_0 signal; #X text 12 115 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 428 216 pd META; #X text 12 -60 spectrum: (DC \, NY) \, (R1 \, I1) \, ...(RN-1 \, IN-1) ; #X obj 17 180 tabsend~ \$0-scope; #X obj 18 113 creb/bfft~; #X obj 158 208 creb/ibfft~; #X obj 233 208 creb/fht~; #X text 159 186 Also see:; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 8 0 7 0; pd-creb-0.10.0/doc/bhip~-help.pd000066400000000000000000000011271434364737600162660ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X obj 130 55 bhip~; #X text 175 53 butterworth high pass filter; #N canvas 331 92 494 327 META 0; #X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 135 LIBRARY external creb; #X text 12 95 INLET_1 float; #X text 12 115 OUTLET_0 signal; #X text 12 5 KEYWORDS signal abstraction filter needs_work (example patch); #X text 12 55 DESCRIPTION butterworth high pass filter; #X text 12 75 INLET_0 signal; #X text 12 155 AUTHOR Tom Schouten ; #X text 12 35 LICENSE GPL v2; #X restore 398 277 pd META; pd-creb-0.10.0/doc/biquadseries~-help.pd000066400000000000000000000021011434364737600200150ustar00rootroot00000000000000#N canvas 0 26 533 299 10; #X obj 37 246 dac~; #X msg 81 132 butterLP \$1; #X msg 173 131 butterHP \$1; #X floatatom 81 105 5 0 0 0 - - -; #X floatatom 173 104 5 0 0 0 - - -; #X obj 48 78 *~; #X floatatom 82 55 5 0 0 0 - - -; #X obj 48 35 noise~; #X text 269 132 butterworth lowpass and highpass; #X text 181 178 creation argument: number of 2nd order sections; #X obj 48 178 biquadseries~ 4; #X text 173 22 biquadseries~ second order iir series section; #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal block_oriented filter; #X text 12 45 DESCRIPTION biquadseries~ 2nd order iir series section ; #X text 12 65 INLET_0 signal butterLP butterHP; #X text 12 85 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 482 277 pd META; #X connect 1 0 10 0; #X connect 2 0 10 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 5 0 10 0; #X connect 6 0 5 1; #X connect 7 0 5 0; #X connect 10 0 0 0; #X connect 10 0 0 1; pd-creb-0.10.0/doc/bitsplit~-help.pd000066400000000000000000000031121434364737600171720ustar00rootroot00000000000000#N canvas 0 26 536 243 10; #X obj 111 51 osc~; #X floatatom 111 29 5 0 0 0 - - -; #X obj 112 93 bitsplit~ 4; #X obj 81 177 dac~; #X obj 81 153 vol~; #X floatatom 110 136 5 0 0 0 - - -; #X obj 183 178 dac~; #X obj 183 154 vol~; #X floatatom 212 137 5 0 0 0 - - -; #X floatatom 178 50 5 0 0 0 - - -; #X obj 112 72 *~ 1; #X text 267 25 split a signal into a parallel binary word.; #X text 267 43 MSB = left \, LSB = right.; #X obj 339 127 *~; #X obj 367 127 / 2; #X obj 402 127 *~; #X obj 430 127 / 2; #N canvas 0 0 450 300 s 0; #X obj 152 123 *~; #X obj 152 89 inlet~; #X obj 206 90 inlet; #X obj 206 121 / 2; #X obj 152 150 outlet~; #X obj 206 151 outlet; #X connect 0 0 4 0; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X restore 383 178 pd s; #N canvas 379 254 494 400 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 165 LIBRARY external creb; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION split a signal into a parallel binary word ; #X text 12 65 INLET_0 signal; #X text 12 85 OUTLET_0 signal; #X text 12 105 OUTLET_1 signal; #X text 12 125 OUTLET_2 signal; #X text 12 145 OUTLET_3 signal; #X text 12 185 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 485 221 pd META; #X connect 0 0 10 0; #X connect 1 0 0 0; #X connect 2 0 4 0; #X connect 2 3 7 0; #X connect 4 0 3 0; #X connect 4 0 3 1; #X connect 5 0 4 1; #X connect 7 0 6 0; #X connect 7 0 6 1; #X connect 8 0 7 1; #X connect 9 0 10 1; #X connect 10 0 2 0; #X connect 14 0 15 1; #X connect 14 0 16 0; pd-creb-0.10.0/doc/blocknorm~-help.pd000066400000000000000000000050341434364737600173330ustar00rootroot00000000000000#N canvas 3 0 565 484 10; #X text 62 14 blocknorm~: normalize a dsp block to RMS = 1; #X text 144 33 creation argument = nb channels; #X obj 96 349 lop~; #X obj 95 410 tabsend~ state; #X obj 95 384 blocknorm~ 1; #X obj 95 320 hip~; #X obj 134 298 hsl 128 15 100 10000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 3800 1; #X obj 93 131 tabreceive~ state; #X obj 138 222 fblock 64; #X obj 352 388 pdynwav~; #X obj 351 429 vol~; #X obj 350 458 dac~; #X floatatom 389 408 5 0 0 0 - - -; #X floatatom 406 365 5 0 0 0 - - -; #X obj 13 144 ead~ 0 20; #X obj 30 168 noise~; #X obj 14 191 *~; #X obj 13 121 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 237 134 1; #X floatatom 237 157 5 0 0 0 - - -; #X floatatom 138 202 5 0 0 0 - - -; #X text 11 64 example: a waveform folding oscillator: power is shifted up or down in frequency by contraction/dilatation \, and filtered \, but normalized to preserve total state energy.; #X obj 466 281 table state 64; #X obj 94 270 dynwav~; #X obj 138 245 phasor~; #X obj 310 181 bang~; #X msg 268 133 2; #X obj 310 205 f; #X floatatom 358 200 5 0 0 0 - - -; #X msg 357 179 0; #X msg 387 179 0.03; #X msg 425 179 0.17; #X obj 310 241 spigot; #X obj 348 223 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X text 403 201 phase offset; #X text 182 201 mod freq; #X text 366 222 phase sync; #X obj 134 326 hsl 128 15 100 10000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 8100 1; #X text 282 157 relative formant shift; #N canvas 379 254 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 LIBRARY external creb; #X text 12 5 KEYWORDS signal block_oriented; #X text 12 45 DESCRIPTION normalize a dsp block to RMS = 1; #X text 12 65 INLET_0 signal; #X text 12 85 OUTLET_0 signal; #X text 12 125 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 514 462 pd META; #X connect 2 0 4 0; #X connect 2 0 9 0; #X connect 4 0 3 0; #X connect 5 0 2 0; #X connect 6 0 5 1; #X connect 7 0 23 0; #X connect 8 0 24 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 10 0 11 1; #X connect 12 0 10 1; #X connect 13 0 9 1; #X connect 14 0 16 0; #X connect 15 0 16 1; #X connect 16 0 5 0; #X connect 17 0 14 0; #X connect 18 0 19 0; #X connect 19 0 8 1; #X connect 20 0 8 0; #X connect 23 0 5 0; #X connect 24 0 23 1; #X connect 25 0 27 0; #X connect 26 0 19 0; #X connect 27 0 32 0; #X connect 28 0 27 1; #X connect 29 0 28 0; #X connect 30 0 28 0; #X connect 31 0 28 0; #X connect 32 0 24 1; #X connect 33 0 32 1; #X connect 37 0 2 1; pd-creb-0.10.0/doc/blockramp~-help.pd000066400000000000000000000011211434364737600173100ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #X obj 29 19 ramp~; #X obj 153 21 blockramp~; #N canvas 107 51 494 364 META 0; #X text 12 5 ALIAS blockramp~; #X text 12 95 INLET_0 bang; #X text 12 75 DESCRIPTION retriggerable counter for dsp signals; #X text 12 135 LIBRARY external creb; #X text 12 115 OUTLET_0 signal; #X text 12 175 HELP_PATCH_AUTHORS Jonathan Wilkes for PDDP.; #X text 12 25 KEYWORDS signal conversion ramp block_oriented needs_work (example patch); #X text 12 55 LICENSE GPL v2; #X text 12 155 AUTHOR Tom Schouten ; #X restore 395 276 pd META; #X text 95 121 needs an example; pd-creb-0.10.0/doc/blop~-help.pd000066400000000000000000000010571434364737600163020ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #N canvas 331 92 494 327 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 95 INLET_1 float; #X text 12 115 OUTLET_0 signal; #X text 12 5 KEYWORDS signal abstraction filter needs_work (example patch); #X text 12 75 INLET_0 signal; #X text 12 55 DESCRIPTION butterworth low pass filter; #X text 12 135 AUTHOR Tom Schouten ; #X text 12 35 LICENSE GPL v2; #X restore 398 277 pd META; #X obj 130 55 blop~; #X text 175 53 butterworth low pass filter; pd-creb-0.10.0/doc/blosc~-help.pd000066400000000000000000000066551434364737600164610ustar00rootroot00000000000000#N canvas 0 26 763 649 10; #X obj 80 243 dac~; #X obj 80 219 vol~; #X floatatom 103 195 5 0 0 0 - - -; #X obj 80 158 blosc~ pulse; #X floatatom 80 128 5 0 0 0 - - -; #X text 59 106 one-sided impulse; #X obj 255 243 dac~; #X obj 255 219 vol~; #X floatatom 278 195 5 0 0 0 - - -; #X floatatom 255 128 5 0 0 0 - - -; #X text 234 106 two-sided impulse; #X obj 255 158 blosc~ pulse2; #X obj 433 241 dac~; #X obj 433 217 vol~; #X floatatom 456 193 5 0 0 0 - - -; #X floatatom 433 126 5 0 0 0 - - -; #X text 442 105 sawtooth; #X obj 596 245 dac~; #X obj 596 221 vol~; #X floatatom 619 197 5 0 0 0 - - -; #X floatatom 596 130 5 0 0 0 - - -; #X text 571 106 hard synced sawtooth; #X text 53 18 blosc~ - some bandlimited oscillators based on minimal phase impulse and step functions. (inspired by Eli Brandt's paper "Hard Sync Without Aliasing".); #X obj 433 156 blosc~ saw; #X obj 596 160 blosc~ syncsaw; #X floatatom 642 130 5 0 0 0 - - -; #X obj 416 625 dac~; #X obj 416 590 vol~; #X floatatom 439 566 5 0 0 0 - - -; #X text 255 284 bandlimited comparator; #X obj 416 529 blosc~ comparator; #X obj 416 415 phasor~; #X obj 416 499 -~; #X floatatom 416 360 5 0 0 0 - - -; #X floatatom 416 335 5 0 0 0 - - -; #X obj 80 371 phasor~; #X floatatom 80 347 5 0 0 0 - - -; #X obj 80 428 blosc~ comparator; #X obj 80 518 dac~; #X obj 80 483 vol~; #X floatatom 103 459 5 0 0 0 - - -; #X obj 80 400 -~ 0.5; #X text 75 321 (square - pulse wave); #X floatatom 150 382 5 0 0 0 - - -; #X obj 153 364 hsl 50 15 0.01 0.99 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X msg 150 343 0.5; #X text 411 312 (pwm); #X obj 511 396 osc~; #X floatatom 511 363 5 0 0 0 - - -; #X obj 511 426 *~; #X floatatom 561 408 5 0 0 0 - - -; #X obj 564 386 hsl 50 15 0 0.99 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X text 626 386 depth; #X obj 514 342 hsl 50 15 0.1 10 1 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X text 578 342 mod freq; #X obj 416 440 *~ 2; #X obj 416 465 -~ 1; #N canvas 379 254 494 344 META 0; #X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION bandlimited oscillators based on minimal phase impulse and step functions.; #X text 12 5 KEYWORDS signal bandlimited; #X text 12 75 INLET_0 float signal; #X text 12 95 INLET_1 float signal; #X text 12 115 INLET_2 float; #X text 12 135 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 155 AUTHOR Tom Schouten ; #X restore 714 628 pd META; #X connect 1 0 0 0; #X connect 1 0 0 1; #X connect 2 0 1 1; #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 7 0 6 0; #X connect 7 0 6 1; #X connect 8 0 7 1; #X connect 9 0 11 0; #X connect 11 0 7 0; #X connect 13 0 12 0; #X connect 13 0 12 1; #X connect 14 0 13 1; #X connect 15 0 23 0; #X connect 18 0 17 0; #X connect 18 0 17 1; #X connect 19 0 18 1; #X connect 20 0 24 0; #X connect 23 0 13 0; #X connect 24 0 18 0; #X connect 25 0 24 1; #X connect 27 0 26 0; #X connect 27 0 26 1; #X connect 28 0 27 1; #X connect 30 0 27 0; #X connect 31 0 55 0; #X connect 32 0 30 0; #X connect 33 0 31 0; #X connect 34 0 33 0; #X connect 35 0 41 0; #X connect 36 0 35 0; #X connect 37 0 39 0; #X connect 39 0 38 0; #X connect 39 0 38 1; #X connect 40 0 39 1; #X connect 41 0 37 0; #X connect 43 0 41 1; #X connect 44 0 43 0; #X connect 45 0 44 0; #X connect 47 0 49 0; #X connect 48 0 47 0; #X connect 49 0 32 1; #X connect 50 0 49 1; #X connect 51 0 50 0; #X connect 53 0 48 0; #X connect 55 0 56 0; #X connect 56 0 32 0; pd-creb-0.10.0/doc/bmatrix~-help.pd000066400000000000000000000013551434364737600170150ustar00rootroot00000000000000#N canvas 0 26 418 231 10; #X msg 69 127 load matrix.bin; #X text 27 39 added for completeness. mainly intended for spectral transfos; #X text 26 73 the file format is binary floating point \, column encoded. ; #X obj 46 174 bmatrix~; #X text 29 23 bmatrix multiplies a signal block with an arbitrary matrix ; #N canvas 200 154 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION multiply a signal block with an arbitrary matrix; #X text 12 85 OUTLET_0 signal; #X text 12 65 INLET_0 signal load; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 369 209 pd META; #X connect 0 0 3 0; pd-creb-0.10.0/doc/bpm-help.pd000066400000000000000000000010741434364737600157250ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #N canvas 331 92 494 398 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION convert bpm to metro time and phasor freq ; #X text 12 65 INLET_0 float; #X text 12 85 OUTLET_0 float; #X text 12 105 OUTLET_1 float; #X text 12 125 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control conversion needs_work (example); #X restore 398 277 pd META; #X text 150 50 convert bpm to metro time and phasor freq; #X obj 105 52 bpm; pd-creb-0.10.0/doc/bwin~-help.pd000066400000000000000000000037141434364737600163070ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #N canvas 5 5 639 472 windowing 0; #X obj 62 441 outlet~; #X obj 62 65 inlet~; #X obj 62 142 bfft~; #X obj 62 365 ibfft~; #X floatatom 85 173 5 0 0 0 - - -; #X obj 62 199 vol~; #X text 60 6 bwin~ multiplies a signal block with a window; #X text 211 310 after maximizing the spectrum is multiplied by a pink noise envelope; #X obj 62 250 dist~ 1; #X text 211 105 apply analysis window; #X text 211 172 set drive; #X text 212 251 soft clip spectral data; #X text 212 133 transform block to freq domain; #X text 210 360 transform block back to time domain; #X text 212 401 undo analysis window + apply synthesis window; #X text 212 39 this example is a poor man's spectral maximizer using bwin~ bfft~ bifft~ and dist~; #X obj 62 225 bwin~ bfft_blue; #X obj 62 327 bwin~ bfft_pink; #X obj 62 401 bwin~ hann/hamming; #X obj 62 106 bwin~ hamming; #X msg 344 207 type bfft_db/octave \$1; #X floatatom 517 172 5 0 0 0 - - -; #X msg 345 277 type bfft_db/octave \$1; #X floatatom 519 244 5 0 0 0 - - -; #X obj 554 437 block~ 1024 2; #X connect 1 0 19 0; #X connect 2 0 5 0; #X connect 3 0 18 0; #X connect 4 0 5 1; #X connect 5 0 16 0; #X connect 8 0 17 0; #X connect 16 0 8 0; #X connect 17 0 3 0; #X connect 18 0 0 0; #X connect 19 0 2 0; #X connect 20 0 16 0; #X connect 21 0 20 0; #X connect 22 0 17 0; #X connect 23 0 22 0; #X restore 53 88 pd windowing; #X obj 41 219 dac~; #X obj 53 150 vol~; #X floatatom 76 124 5 0 0 0 - - -; #X obj 53 41 adc~ 1; #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal block_oriented; #X text 12 45 DESCRIPTION multiply a signal block with a window; #X text 12 65 INLET_0 signal type; #X text 12 85 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 400 279 pd META; #X connect 0 0 2 0; #X connect 2 0 1 0; #X connect 2 0 1 1; #X connect 3 0 2 1; #X connect 4 0 0 0; pd-creb-0.10.0/doc/cadd~-help.pd000066400000000000000000000011371434364737600162400ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #N canvas 331 92 494 398 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION complex addition; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 145 OUTLET_0 signal; #X text 12 165 OUTLET_1 signal; #X text 12 185 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS signal needs_work (example); #X restore 398 277 pd META; #X obj 105 52 cadd~; #X text 150 50 complex addition; pd-creb-0.10.0/doc/ccmap~-help.pd000066400000000000000000000012541434364737600164300ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #X text 23 10 conformal self map of the unit disk (z-a)/(1-conj(a)z) ; #N canvas 331 92 494 392 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 145 OUTLET_0 signal; #X text 12 45 DESCRIPTION conformal self map of the unit disk; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 165 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 185 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 398 277 pd META; #X obj 24 90 ccmap~; pd-creb-0.10.0/doc/cconj~-help.pd000066400000000000000000000010651434364737600164410ustar00rootroot00000000000000#N canvas 0 26 285 166 10; #X text 49 5 complex conjugate; #N canvas 331 92 494 353 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 OUTLET_0 signal; #X text 12 45 DESCRIPTION complex conjugate; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 125 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 145 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 236 144 pd META; #X obj 49 55 cconj~; pd-creb-0.10.0/doc/cep~-help.pd000066400000000000000000000011251434364737600161110ustar00rootroot00000000000000#N canvas 0 26 521 228 10; #X text 229 45 forward cepstrum; #X text 229 64 using normalized fft/ifft objects; #N canvas 21 119 494 354 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 OUTLET_0 signal; #X text 12 125 OUTLET_1 signal; #X text 12 145 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X text 12 45 DESCRIPTION complex cepstrum; #X text 12 5 KEYWORDS signal abstraction needs_work; #X restore 448 207 pd META; #X obj 72 111 cep~; pd-creb-0.10.0/doc/cexp~-help.pd000066400000000000000000000013041434364737600163000ustar00rootroot00000000000000#N canvas 0 26 475 207 10; #X obj 85 82 clog~; #X obj 145 82 cexp~; #X text 235 81 complex log and exp.; #X text 237 105 see also; #X obj 309 104 cep~; #X text 351 103 and; #X obj 384 105 icep~; #N canvas 379 254 494 344 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_0 signal; #X text 12 105 INLET_1 signal; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 5 NAME clog~ cexp~; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS signal needs_work needs_work (example); #X text 12 65 DESCRIPTION complex log and exp; #X restore 424 185 pd META; pd-creb-0.10.0/doc/cheby~-help.pd000066400000000000000000000030111434364737600164300ustar00rootroot00000000000000#N canvas 1 0 494 348 10; #X obj 130 230 cheby~ 4; #X msg 147 149 coef 1 \$1; #X floatatom 147 93 5 0 0 0 - - -; #X obj 147 117 dbtorms; #X obj 124 313 dac~; #X obj 130 281 vol~; #X floatatom 156 261 5 0 0 0 - - -; #X obj 40 113 osc~; #X floatatom 40 88 5 0 0 0 - - -; #X floatatom 226 94 5 0 0 0 - - -; #X obj 226 118 dbtorms; #X floatatom 305 94 5 0 0 0 - - -; #X obj 305 118 dbtorms; #X floatatom 384 93 5 0 0 0 - - -; #X obj 384 117 dbtorms; #X msg 226 150 coef 2 \$1; #X msg 305 150 coef 3 \$1; #X msg 384 150 coef 4 \$1; #X text 96 3 chebyshev waveshaper; #X text 207 229 creation argument: order of polynomial; #X text 135 47 coef n x sets coefficient of nth order cheby poly to x; #X text 135 60 if the input is a sine wave \, these are the amplitudes for the harmonics.; #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION Chebyshev waveshaper; #X text 12 65 INLET_0 signal coef; #X text 12 85 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 444 327 pd META; #X connect 0 0 5 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 4 1; #X connect 5 0 4 0; #X connect 6 0 5 1; #X connect 7 0 0 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 10 0 15 0; #X connect 11 0 12 0; #X connect 12 0 16 0; #X connect 13 0 14 0; #X connect 14 0 17 0; #X connect 15 0 0 0; #X connect 16 0 0 0; #X connect 17 0 0 0; pd-creb-0.10.0/doc/cinv~-help.pd000066400000000000000000000011101434364737600162730ustar00rootroot00000000000000#N canvas 0 26 381 297 10; #X text 49 5 complex inverse; #N canvas 331 92 494 345 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 OUTLET_0 signal; #X text 12 45 DESCRIPTION complex inverse; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 125 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 145 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X text 12 145 comment; #X restore 332 275 pd META; #X obj 81 56 cinv~; pd-creb-0.10.0/doc/clog~-help.pd000066400000000000000000000013051434364737600162660ustar00rootroot00000000000000#N canvas 0 26 475 207 10; #X obj 85 82 clog~; #X obj 145 82 cexp~; #X text 235 81 complex log and exp.; #X text 237 105 see also; #X obj 309 104 cep~; #X text 351 103 and; #X obj 384 105 icep~; #N canvas 379 254 494 344 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 DESCRIPTION complex log and exp.; #X text 12 85 INLET_0 signal; #X text 12 105 INLET_1 signal; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 5 NAME clog~ cexp~; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS signal needs_work needs_work (example); #X restore 424 185 pd META; pd-creb-0.10.0/doc/cmul~-help.pd000066400000000000000000000011741434364737600163060ustar00rootroot00000000000000#N canvas 0 26 381 197 10; #X text 49 5 complex multiplication; #N canvas 331 92 494 393 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 145 OUTLET_0 signal; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 165 OUTLET_1 signal; #X text 12 45 DESCRIPTION complex multiplication; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 185 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 331 175 pd META; #X obj 92 78 cmul~; pd-creb-0.10.0/doc/cosc~-help.pd000066400000000000000000000011531434364737600162720ustar00rootroot00000000000000#N canvas 0 31 381 197 10; #X text 49 5 complex oscillator (unit norm exponential); #N canvas 331 92 494 369 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 signal; #X text 12 45 DESCRIPTION complex oscillator; #X text 12 85 INLET_1 float; #X text 12 105 INLET_2 float; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 331 176 pd META; #X obj 63 64 cosc~; pd-creb-0.10.0/doc/count-help.pd000066400000000000000000000015211434364737600162740ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #N canvas 331 92 494 345 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS control storage; #X text 12 45 DESCRIPTION modulo counter; #X text 12 85 INLET_1 float; #X text 12 65 INLET_0 bang reset; #X text 12 105 OUTLET_0 float; #X text 12 125 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 392 275 pd META; #X obj 164 162 count; #X text 157 32 modulo counter; #X floatatom 164 189 5 0 0 0 - - -; #X obj 106 85 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X floatatom 191 136 5 0 0 0 - - -; #X obj 106 110 metro 275; #X floatatom 106 189 5 0 0 0 - - -; #X obj 106 162 count 5; #X connect 1 0 3 0; #X connect 4 0 6 0; #X connect 5 0 1 1; #X connect 6 0 1 0; #X connect 6 0 8 0; #X connect 8 0 7 0; pd-creb-0.10.0/doc/csub~-help.pd000066400000000000000000000011661434364737600163030ustar00rootroot00000000000000#N canvas 0 26 381 197 10; #X text 49 5 complex subtraction; #N canvas 162 93 494 386 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION complex subtraction; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 145 OUTLET_0 signal; #X text 12 165 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 185 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 331 175 pd META; #X obj 54 96 csub~; pd-creb-0.10.0/doc/diag~-help.pd000066400000000000000000000015611434364737600162520ustar00rootroot00000000000000#N canvas 3 26 450 300 10; #X obj 36 29 diag~; #X text 83 31 diagonal state space system; #X text 38 67 treats input dsp block as n parallel signals; #X text 40 92 s1 = (a * s1) + (b * s2) + u1; #X text 41 109 s2 = (a * s2) - (b * s1) + u2; #N canvas 145 112 494 314 META 0; #X text 12 5 KEYWORDS signal needs_work (example patch); #X text 12 45 DESCRIPTION diagonal state space system; #X text 12 65 INLET_0 signal bang reset random time eigen; #X text 12 85 OUTLET_0 signal; #X text 12 125 HELP_PATCH_AUTHORS Added by Jonathan Wilkes.; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 395 275 pd META; #X msg 108 140 reset; #X obj 108 262 diag~; #X msg 118 163 random; #X msg 127 184 bang; #X msg 144 232 eigen; #X msg 137 206 time; #X connect 6 0 7 0; #X connect 8 0 7 0; #X connect 9 0 7 0; #X connect 10 0 7 0; #X connect 11 0 7 0; pd-creb-0.10.0/doc/dist~-help.pd000066400000000000000000000015751434364737600163160ustar00rootroot00000000000000#N canvas 3 4 450 300 10; #X text 156 35 dist~ waveshaper; #X text 154 53 creation argument: type (see dist.c); #X floatatom 136 120 5 0 0 0 - - -; #X obj 64 121 osc~; #X obj 66 206 dac~; #X floatatom 63 84 5 0 0 0 - - -; #X text 189 119 right inlet: pre gain; #X obj 148 95 hsl 128 15 0.5 20 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X obj 64 157 dist~ 1; #N canvas 379 254 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION waveshaper; #X text 12 85 INLET_1 float; #X text 12 65 INLET_0 signal; #X text 12 105 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 400 279 pd META; #X connect 2 0 8 1; #X connect 3 0 8 0; #X connect 5 0 3 0; #X connect 7 0 2 0; #X connect 8 0 4 0; #X connect 8 0 4 1; pd-creb-0.10.0/doc/dsfosc~-help.pd000066400000000000000000000013231434364737600166230ustar00rootroot00000000000000#N canvas 0 26 447 341 10; #X text 59 21 complex form of the discrete summation oscillator; #X text 62 38 (1-az^n)/(1-az) \, with z = e^(jw); #N canvas 331 92 494 393 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 INLET_1 float; #X text 12 125 INLET_2 float; #X text 12 145 OUTLET_0 signal; #X text 12 85 INLET_0 signal; #X text 12 165 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction oscillator needs_work (example patch); #X text 12 185 AUTHOR Tom Schouten ; #X text 12 35 LICENSE GPL v2; #X text 12 55 DESCRIPTION complex form of the discrete summation oscillator ; #X restore 394 317 pd META; #X obj 72 104 dsfosc~; pd-creb-0.10.0/doc/dwt16~-help.pd000066400000000000000000000052531434364737600163150ustar00rootroot00000000000000#N canvas 5 76 952 611 10; #X obj 17 62 osc~ 500; #X msg 83 -115 predict 0.5 0.5 \, update 0.25 0.25; #X msg 83 -76 predict -0.0625 0.5625 0.5625 -0.0625 \, update -0.03125 0.28125 0.28125 -0.03125; #X floatatom 24 10 5 0 0 0 - - -; #X msg 201 144 mask -1 9 9 -1; #X obj 67 279 r coef; #X obj 82 -30 s coef; #X obj 195 337 s coef; #X msg 201 167 mask 3 -25 150 150 -25 3; #X msg 216 189 mask -5 49 -245 1225 1225 -245 49 -5; #X obj 196 39 pack; #X floatatom 222 8 5 0 0 0 - - -; #X floatatom 166 -4 5 0 0 0 - - -; #X msg 171 64 coef \$1 \$2; #X msg 191 120 mask 1 1; #X msg 228 212 mask 35 -405 2268 -8820 39690 39690 -8820 2268 -405 35; #X msg 244 246 mask -63 847 -5445 22869 -76230 320166 320166 -76230 22869 -5445 847 -63; #X msg 245 306 predict 1 0 \, update 0 0.5; #X obj 36 31 * 187.5; #X msg 469 376 mask 0 0 0 35 140 -70 28 -5; #X msg 469 352 mask 7 -45 126 -210 315 63 0 0 0 0; #X msg 469 328 mask -21 154 -495 924 -1155 1386 231 0 0 0 0 0; #X obj 26 443 tabsend~ scope; #N canvas 0 0 450 300 (subpatch) 0; #X array scope 256 float 0; #X coords 0 1 255 -1 200 140 1; #X restore 718 -98 graph; #X text 61 165 print out coefs; #X msg 100 184 print; #X text 315 -24 dwt~ performs a discrete wavelet transform; #X text 315 -10 idwt~ performs the inverse transform; #X text 309 105 mask sets the predict mask \, and uses the corresponding update mask; #X text 266 63 coef sets half of a symmetric predict mask; #X text 243 286 predict and update masks can be specified explicitly ; #X text 433 307 haar wavelet; #X msg 672 189 even \$1; #X floatatom 672 167 5 0 0 0 - - -; #X text 570 134 even is the order symmetric interpolating biorthogonal wavelet with n vanishing moments.; #N canvas 379 254 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 KEYWORDS signal; #X text 12 65 DESCRIPTION dwt~ performas a descrete wavelet transform/ idwt~ performs the inverse transform; #X text 12 95 INLET_0 signal print mask predict update even; #X text 12 5 NAME dwt~ idwt~; #X text 12 115 OUTLET_0 signal; #X text 12 45 LICENSE GPL v2; #X text 12 135 AUTHOR Tom Schouten ; #X restore 884 465 pd META; #X obj 26 341 creb/dwt16~ 1; #X connect 0 0 36 0; #X connect 1 0 6 0; #X connect 2 0 6 0; #X connect 3 0 18 0; #X connect 4 0 7 0; #X connect 5 0 36 0; #X connect 8 0 7 0; #X connect 9 0 7 0; #X connect 10 0 13 0; #X connect 11 0 10 1; #X connect 12 0 10 0; #X connect 13 0 7 0; #X connect 14 0 7 0; #X connect 15 0 7 0; #X connect 16 0 7 0; #X connect 17 0 7 0; #X connect 18 0 0 0; #X connect 19 0 7 0; #X connect 20 0 7 0; #X connect 21 0 7 0; #X connect 25 0 7 0; #X connect 32 0 7 0; #X connect 33 0 32 0; #X connect 36 0 22 0; pd-creb-0.10.0/doc/dwt~-help.pd000066400000000000000000000052721434364737600161470ustar00rootroot00000000000000#N canvas 66 259 952 611 10; #X obj 17 186 osc~ 500; #X msg 83 9 predict 0.5 0.5 \, update 0.25 0.25; #X msg 83 48 predict -0.0625 0.5625 0.5625 -0.0625 \, update -0.03125 0.28125 0.28125 -0.03125; #X floatatom 24 134 5 0 0 0 - - -; #X msg 201 268 mask -1 9 9 -1; #X obj 67 403 r coef; #X obj 82 94 s coef; #X obj 195 461 s coef; #X msg 201 291 mask 3 -25 150 150 -25 3; #X msg 216 313 mask -5 49 -245 1225 1225 -245 49 -5; #X obj 196 163 pack; #X floatatom 222 132 5 0 0 0 - - -; #X floatatom 166 120 5 0 0 0 - - -; #X msg 171 188 coef \$1 \$2; #X msg 191 244 mask 1 1; #X msg 228 336 mask 35 -405 2268 -8820 39690 39690 -8820 2268 -405 35; #X msg 244 370 mask -63 847 -5445 22869 -76230 320166 320166 -76230 22869 -5445 847 -63; #X msg 245 430 predict 1 0 \, update 0 0.5; #X obj 36 155 * 187.5; #X msg 469 500 mask 0 0 0 35 140 -70 28 -5; #X msg 469 476 mask 7 -45 126 -210 315 63 0 0 0 0; #X msg 469 452 mask -21 154 -495 924 -1155 1386 231 0 0 0 0 0; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 256 float 0; #X coords 0 1 255 -1 200 140 1 0 0; #X restore 718 26 graph; #X text 61 289 print out coefs; #X msg 100 308 print; #X text 315 100 dwt~ performs a discrete wavelet transform; #X text 315 114 idwt~ performs the inverse transform; #X text 309 229 mask sets the predict mask \, and uses the corresponding update mask; #X text 266 187 coef sets half of a symmetric predict mask; #X text 243 410 predict and update masks can be specified explicitly ; #X text 433 431 haar wavelet; #X msg 672 313 even \$1; #X floatatom 672 291 5 0 0 0 - - -; #X text 570 258 even is the order symmetric interpolating biorthogonal wavelet with n vanishing moments.; #N canvas 379 254 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 KEYWORDS signal; #X text 12 65 DESCRIPTION dwt~ performas a descrete wavelet transform/ idwt~ performs the inverse transform; #X text 12 95 INLET_0 signal print mask predict update even; #X text 12 5 NAME dwt~ idwt~; #X text 12 115 OUTLET_0 signal; #X text 12 45 LICENSE GPL v2; #X text 12 135 AUTHOR Tom Schouten ; #X restore 884 589 pd META; #X obj 27 465 creb/dwt~ 1; #X obj 26 567 tabsend~ \$0-scope; #X connect 0 0 35 0; #X connect 1 0 6 0; #X connect 2 0 6 0; #X connect 3 0 18 0; #X connect 4 0 7 0; #X connect 5 0 35 0; #X connect 8 0 7 0; #X connect 9 0 7 0; #X connect 10 0 13 0; #X connect 11 0 10 1; #X connect 12 0 10 0; #X connect 13 0 7 0; #X connect 14 0 7 0; #X connect 15 0 7 0; #X connect 16 0 7 0; #X connect 17 0 7 0; #X connect 18 0 0 0; #X connect 19 0 7 0; #X connect 20 0 7 0; #X connect 21 0 7 0; #X connect 24 0 7 0; #X connect 31 0 7 0; #X connect 32 0 31 0; #X connect 35 0 36 0; pd-creb-0.10.0/doc/dynwav~-help.pd000066400000000000000000000021411434364737600166510ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #X text 96 6 dynwav~: dynamic wavetable oscillator; #X obj 61 98 osc~; #X floatatom 60 56 5 0 0 0 - - -; #X obj 60 151 dynwav~; #X obj 60 214 vol~; #X floatatom 85 190 5 0 0 0 - - -; #X obj 50 256 dac~; #X obj 172 105 phasor~; #X floatatom 172 80 5 0 0 0 - - -; #X obj 107 54 bang~; #X text 171 22 (scanned synthesis); #X text 165 143 left inlet's dsp block = wavetable; #X msg 107 78 0.25; #X text 242 157 right inlet = phase (0-1); #N canvas 379 254 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 75 INLET_0 signal; #X text 12 95 INLET_1 signal; #X text 12 115 OUTLET_0 signal; #X text 12 45 DESCRIPTION dynamic wavetable oscillator ( scanned synthesis ); #X text 12 5 KEYWORDS signal oscillator; #X text 12 25 LICENSE GPL v2; #X text 12 135 AUTHOR Tom Schouten ; #X restore 400 279 pd META; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 4 0 6 1; #X connect 4 0 6 0; #X connect 5 0 4 1; #X connect 7 0 3 1; #X connect 8 0 7 0; #X connect 9 0 12 0; #X connect 12 0 1 1; pd-creb-0.10.0/doc/eadh~-help.pd000066400000000000000000000012011434364737600162360ustar00rootroot00000000000000#N canvas 0 26 319 228 10; #N canvas 36 104 494 367 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_1 float; #X text 12 165 AUTHOR Tom Shouten; #X text 12 105 INLET_2 float; #X text 12 145 OUTLET_0 signal; #X text 12 45 DESCRIPTION exponential attack decay (with hold == duration) ; #X text 12 65 INLET_0 bang; #X text 12 125 INLET_3 float; #X text 12 5 KEYWORDS signal abstraction ramp needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X restore 268 207 pd META; #X obj 63 81 eadh~; #X text 12 31 exponential attack decay (with hold == duration); pd-creb-0.10.0/doc/eadsrh~-help.pd000066400000000000000000000013221434364737600166070ustar00rootroot00000000000000#N canvas 0 26 430 230 10; #N canvas 331 92 494 388 META 0; #X text 12 215 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 95 INLET_1 float; #X text 12 115 INLET_2 float; #X text 12 155 INLET_4 float; #X text 12 175 OUTLET_0 signal; #X text 12 45 DESCRIPTION exponential attack decay sustain release (with hold == duration); #X text 12 75 INLET_0 bang; #X text 12 135 INLET_3 float; #X text 12 5 KEYWORDS signal abstraction ramp needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 195 AUTHOR Tom Schouten ; #X restore 378 207 pd META; #X obj 105 92 eadsrh~; #X text 22 15 exponential attack decay sustain release (with hold == duration); pd-creb-0.10.0/doc/eadsr~-help.pd000066400000000000000000000037761434364737600164560ustar00rootroot00000000000000#N canvas 0 26 581 306 10; #X obj 89 227 *~; #X obj 105 40 metro; #X obj 26 203 osc~; #X floatatom 26 171 5 0 0 0 - - -; #X floatatom 135 12 5 0 0 0 - - -; #X floatatom 209 117 5 0 0 0 - - -; #X floatatom 208 139 5 0 0 0 - - -; #X obj 81 277 dac~; #X msg 58 12 stop; #X msg 26 124 start; #X msg 71 123 stop; #X obj 105 77 del; #X floatatom 159 50 5 0 0 0 - - -; #X obj 105 197 eadsr~ 0 0; #X text 191 81 exponential attack/decay/sustain/release envelope; #X text 265 125 60db attack and decay time; #X floatatom 209 160 5 0 0 0 - - -; #X floatatom 209 180 5 0 0 0 - - -; #X text 264 159 sustain level; #X obj 88 253 vol~; #X floatatom 132 238 5 0 0 0 - - -; #X obj 343 228 table t 10000; #X obj 343 267 tabwrite~ t; #X obj 343 247 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 103 13 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 262 276 del; #X floatatom 276 225 5 0 0 0 - - -; #X text 265 182 60db release time; #N canvas 379 254 494 372 META 0; #X text 12 215 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION exponential attack/decay/sustain/release envelope; #X text 12 5 KEYWORDS signal ramp; #X text 12 175 OUTLET_0 signal; #X text 12 95 INLET_1 float; #X text 12 115 INLET_2 float; #X text 12 135 INLET_3 float; #X text 12 155 INLET_4 float; #X text 12 75 INLET_0 start stop; #X text 12 25 LICENSE GPL v2; #X text 12 195 AUTHOR Tom Schouten ; #X restore 531 285 pd META; #X connect 0 0 19 0; #X connect 1 0 9 0; #X connect 1 0 11 0; #X connect 2 0 0 0; #X connect 3 0 2 0; #X connect 4 0 1 1; #X connect 5 0 13 1; #X connect 6 0 13 2; #X connect 8 0 1 0; #X connect 9 0 13 0; #X connect 10 0 13 0; #X connect 11 0 10 0; #X connect 12 0 11 1; #X connect 13 0 0 1; #X connect 13 0 22 0; #X connect 16 0 13 3; #X connect 17 0 13 4; #X connect 19 0 7 1; #X connect 19 0 7 0; #X connect 20 0 19 1; #X connect 23 0 22 0; #X connect 23 0 25 0; #X connect 23 0 9 0; #X connect 24 0 1 0; #X connect 25 0 10 0; #X connect 26 0 25 1; pd-creb-0.10.0/doc/ead~-help.pd000066400000000000000000000027641434364737600161050ustar00rootroot00000000000000#N canvas 0 26 413 265 10; #X obj 105 111 ead~ 0 0; #X obj 89 179 *~; #X obj 105 40 metro; #X obj 41 144 osc~; #X floatatom 41 112 5 0 0 0 - - -; #X floatatom 135 12 5 0 0 0 - - -; #X floatatom 130 64 5 0 0 0 - - -; #X floatatom 156 86 5 0 0 0 - - -; #X obj 78 242 dac~; #X text 202 71 60db attack and decay time; #X obj 70 76 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 58 12 stop; #X text 201 51 exponential attack/decay envelope; #X obj 89 212 vol~; #X floatatom 117 193 5 0 0 0 - - -; #X obj 265 119 table t 5000; #X obj 265 176 tabwrite~ t; #X obj 265 152 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 105 13 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #N canvas 379 254 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION exponential attack/decay envelope; #X text 12 5 KEYWORDS signal ramp; #X text 12 85 INLET_1 float; #X text 12 65 INLET_0 bang; #X text 12 105 INLET_2 float; #X text 12 125 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR Tom Schouten ; #X restore 362 242 pd META; #X connect 0 0 1 1; #X connect 0 0 16 0; #X connect 1 0 13 0; #X connect 2 0 0 0; #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 5 0 2 1; #X connect 6 0 0 1; #X connect 7 0 0 2; #X connect 10 0 0 0; #X connect 11 0 2 0; #X connect 13 0 8 0; #X connect 13 0 8 1; #X connect 14 0 13 1; #X connect 17 0 16 0; #X connect 17 0 0 0; #X connect 18 0 2 0; pd-creb-0.10.0/doc/ear~-help.pd000066400000000000000000000025201434364737600161110ustar00rootroot00000000000000#N canvas 0 26 421 306 10; #X obj 89 227 *~; #X obj 105 40 metro; #X obj 105 12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 41 192 osc~; #X floatatom 41 160 5 0 0 0 - - -; #X floatatom 135 12 5 0 0 0 - - -; #X floatatom 130 112 5 0 0 0 - - -; #X floatatom 157 134 5 0 0 0 - - -; #X obj 77 265 dac~; #X msg 58 12 stop; #X msg 26 124 start; #X msg 71 123 stop; #X obj 105 159 ear~ 0 0; #X obj 105 77 del; #X floatatom 159 50 5 0 0 0 - - -; #X text 201 99 exponential attack/release envelope; #X text 202 119 60db attack and release time; #N canvas 379 254 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION exponential attack/release envelope; #X text 12 5 KEYWORDS signal ramp; #X text 12 125 OUTLET_0 signal; #X text 12 85 INLET_1 float; #X text 12 105 INLET_2 float; #X text 12 65 INLET_0 start stop; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR Tom Schouten ; #X restore 372 286 pd META; #X connect 0 0 8 0; #X connect 0 0 8 1; #X connect 1 0 10 0; #X connect 1 0 13 0; #X connect 2 0 1 0; #X connect 3 0 0 0; #X connect 4 0 3 0; #X connect 5 0 1 1; #X connect 6 0 12 1; #X connect 7 0 12 2; #X connect 9 0 1 0; #X connect 10 0 12 0; #X connect 11 0 12 0; #X connect 12 0 0 1; #X connect 13 0 11 0; #X connect 14 0 13 1; pd-creb-0.10.0/doc/examples/000077500000000000000000000000001434364737600155105ustar00rootroot00000000000000pd-creb-0.10.0/doc/examples/formantdynwav.pd000066400000000000000000000105661434364737600207440ustar00rootroot00000000000000#N canvas 131 302 276 242 10; #N canvas 342 154 748 636 stuff 1; #X obj 59 376 outlet~; #X obj 59 348 vol~; #X floatatom 176 317 5 0 0; #X obj 197 29 bang~; #X obj 59 290 pdynwav~; #X floatatom 189 221 5 0 0; #X obj 46 103 osc~; #X obj 91 103 osc~; #X obj 135 102 osc~; #X obj 104 223 *~; #X obj 345 87 phasor~; #X obj 277 185 *~; #X obj 346 136 *~; #X obj 346 108 onecomp~; #X obj 346 164 *~; #X text 38 33 formant frequencies; #N canvas 139 0 533 326 to_formant 0; #X obj 339 217 /; #X obj 391 149 t b f; #X obj 291 182 samplerate~; #X floatatom 335 243 5 0 0; #X obj 369 47 inlet; #X obj 405 126 * 1024; #X obj 30 158 *~; #X obj 88 159 *~; #X obj 150 156 *~; #X obj 30 192 outlet~; #X obj 88 193 outlet~; #X obj 150 190 outlet~; #X obj 150 100 inlet~; #X obj 88 103 inlet~; #X obj 30 102 inlet~; #X connect 0 0 3 0; #X connect 0 0 8 1; #X connect 0 0 7 1; #X connect 0 0 6 1; #X connect 1 0 2 0; #X connect 1 1 0 1; #X connect 2 0 0 0; #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 6 0 9 0; #X connect 7 0 10 0; #X connect 8 0 11 0; #X connect 12 0 8 0; #X connect 13 0 7 0; #X connect 14 0 6 0; #X restore 45 71 pd to_formant; #X obj 189 260 +; #X obj 227 261 -; #X obj 136 374 outlet~; #X obj 136 346 vol~; #X obj 127 290 pdynwav~; #X floatatom 244 210 5 0 0; #X obj 253 237 t b f; #X obj 520 332 block~ 1024; #X obj 277 28 fblock 1024; #X obj 469 163 random 120; #X obj 469 191 - 60; #X obj 466 139 metro 750; #X obj 470 111 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 43 -75 *~; #X floatatom 59 -99 5 0 0; #X obj 43 -121 osc~; #X floatatom 43 -151 5 0 0; #X obj 113 -75 *~; #X floatatom 129 -99 5 0 0; #X obj 113 -121 osc~; #X floatatom 113 -151 5 0 0; #X obj 180 -74 *~; #X floatatom 196 -98 5 0 0; #X obj 180 -120 osc~; #X floatatom 180 -150 5 0 0; #X floatatom 531 106 5 0 0; #X floatatom 84 128 5 0 0; #X obj 44 157 vol~; #X floatatom 125 128 5 0 0; #X obj 85 157 vol~; #X floatatom 173 129 5 0 0; #X obj 133 158 vol~; #X floatatom 304 -126 5 0 0; #X msg 349 6 1; #X obj 277 159 phasor~; #X obj 94 199 *~ 1; #X msg 389 58 0; #X msg 197 60 0.25; #X obj 346 189 *~; #X msg 194 92 100; #X obj 374 242 tabsend~ period; #X obj 494 213 table period 1024; #X floatatom 298 322 5 0 0; #X obj 343 -83 loadbang; #X floatatom 198 -52 5 0 0; #X obj 182 -28 +~; #X floatatom 125 -49 5 0 0; #X obj 109 -25 +~; #X floatatom 65 -45 5 0 0; #X obj 49 -21 +~; #X connect 1 0 0 0; #X connect 2 0 1 1; #X connect 2 0 20 1; #X connect 3 0 54 0; #X connect 3 0 53 0; #X connect 4 0 1 0; #X connect 5 0 16 3; #X connect 5 0 17 0; #X connect 5 0 18 0; #X connect 6 0 44 0; #X connect 7 0 46 0; #X connect 8 0 48 0; #X connect 9 0 4 0; #X connect 9 0 21 0; #X connect 9 0 57 0; #X connect 10 0 13 0; #X connect 11 0 9 1; #X connect 12 0 14 0; #X connect 12 0 14 1; #X connect 13 0 12 1; #X connect 13 0 12 0; #X connect 14 0 55 0; #X connect 14 0 55 1; #X connect 14 0 11 1; #X connect 16 0 6 0; #X connect 16 1 7 0; #X connect 16 2 8 0; #X connect 17 0 4 1; #X connect 18 0 21 1; #X connect 20 0 19 0; #X connect 21 0 20 0; #X connect 22 0 17 1; #X connect 22 0 23 0; #X connect 23 0 18 0; #X connect 23 0 17 0; #X connect 23 1 18 1; #X connect 23 1 17 1; #X connect 25 0 10 0; #X connect 25 0 51 0; #X connect 26 0 27 0; #X connect 27 0 5 0; #X connect 28 0 26 0; #X connect 29 0 28 0; #X connect 30 0 66 0; #X connect 31 0 30 1; #X connect 32 0 30 0; #X connect 33 0 32 0; #X connect 34 0 64 0; #X connect 35 0 34 1; #X connect 36 0 34 0; #X connect 37 0 36 0; #X connect 38 0 62 0; #X connect 39 0 38 1; #X connect 40 0 38 0; #X connect 41 0 40 0; #X connect 42 0 28 1; #X connect 43 0 44 1; #X connect 44 0 52 0; #X connect 45 0 46 1; #X connect 46 0 52 0; #X connect 47 0 48 1; #X connect 48 0 52 0; #X connect 50 0 25 1; #X connect 51 0 11 0; #X connect 52 0 9 0; #X connect 53 0 10 1; #X connect 54 0 8 1; #X connect 54 0 7 1; #X connect 54 0 6 1; #X connect 56 0 47 0; #X connect 56 0 45 0; #X connect 56 0 43 0; #X connect 60 0 50 0; #X connect 61 0 62 1; #X connect 62 0 16 2; #X connect 63 0 64 1; #X connect 64 0 16 1; #X connect 65 0 66 1; #X connect 66 0 16 0; #X restore 18 14 pd stuff; #X obj 19 75 dac~; #X obj 94 79 vols~; #X obj 96 54 fdn~; #X floatatom 140 53 5 0 0; #X floatatom 108 24 5 0 0; #X floatatom 154 24 5 0 0; #X connect 0 0 1 0; #X connect 0 0 3 0; #X connect 0 1 1 1; #X connect 0 1 3 0; #X connect 2 0 1 0; #X connect 2 1 1 1; #X connect 3 0 2 0; #X connect 3 1 2 1; #X connect 4 0 2 2; #X connect 5 0 3 1; #X connect 6 0 3 2; pd-creb-0.10.0/doc/examples/xfmdelay.pd000066400000000000000000000063401434364737600176510ustar00rootroot00000000000000#N canvas 25 206 921 653 10; #X obj 289 329 xfm~ 0 0 0 0; #X obj 279 280 *~; #X obj 398 233 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 862.744 256; #X obj 306 279 *~; #X obj 398 250 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 795.103 256; #X obj 332 279 *~; #X obj 399 266 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 23.7527 256; #X obj 359 278 *~; #X obj 398 284 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 224.294 256; #X obj 251 170 xfm~ 0 0 0 0; #X obj 392 111 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 703.454 256; #X obj 392 132 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 675.315 256; #X obj 304 138 *~; #X obj 393 148 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 51.5902 256; #X obj 331 137 *~; #X obj 392 166 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 49.5265 256; #X obj 191 403 vols~; #X floatatom 233 374 5 0 0; #X obj 195 525 dac~; #X obj 274 51 vd~ del1; #X obj 274 24 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 73 256; #X obj 339 23 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 339 256; #X obj 339 50 vd~ del2; #X obj 296 393 delwrite~ del1 1000; #X obj 448 393 delwrite~ del2 1000; #X msg 136 125 type 0; #X msg 137 146 type 1; #X obj 464 110 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 21700 1; #X obj 464 130 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 21600 1; #X obj 463 150 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 15300 1; #X obj 464 168 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 15200 1; #X obj 465 232 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 22200 1; #X obj 465 252 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 22000 1; #X obj 464 271 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 13400 1; #X obj 465 289 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 18900 1; #X text 479 29 2 xfm oscillators coupled by 2 delay lines; #X obj 188 475 *~; #X obj 217 474 *~; #X obj 270 458 osc~; #X obj 269 433 hsl 300 15 0.1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 18900 1; #X connect 0 0 23 0; #X connect 0 1 24 0; #X connect 1 0 0 0; #X connect 2 0 1 1; #X connect 3 0 0 1; #X connect 4 0 3 1; #X connect 5 0 0 2; #X connect 6 0 5 1; #X connect 7 0 0 3; #X connect 8 0 7 1; #X connect 9 0 3 0; #X connect 9 0 5 0; #X connect 9 0 16 0; #X connect 9 1 1 0; #X connect 9 1 7 0; #X connect 9 1 16 1; #X connect 10 0 9 0; #X connect 11 0 9 1; #X connect 12 0 9 2; #X connect 13 0 12 1; #X connect 14 0 9 3; #X connect 15 0 14 1; #X connect 16 0 36 0; #X connect 16 1 37 0; #X connect 17 0 16 2; #X connect 19 0 12 0; #X connect 20 0 19 0; #X connect 21 0 22 0; #X connect 22 0 14 0; #X connect 25 0 9 0; #X connect 25 0 0 0; #X connect 26 0 9 0; #X connect 26 0 0 0; #X connect 27 0 10 0; #X connect 28 0 11 0; #X connect 29 0 13 0; #X connect 30 0 15 0; #X connect 31 0 2 0; #X connect 32 0 4 0; #X connect 33 0 6 0; #X connect 34 0 8 0; #X connect 36 0 18 0; #X connect 37 0 18 1; #X connect 38 0 37 1; #X connect 38 0 36 1; #X connect 39 0 38 0; pd-creb-0.10.0/doc/expmap~-help.pd000066400000000000000000000011571434364737600166410ustar00rootroot00000000000000#N canvas 0 26 352 368 10; #X text 80 9 exponential map from (-1 \, 1) to (min \, max); #N canvas 331 92 494 345 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_1 float; #X text 12 45 DESCRIPTION exponential map from (-1 \, 1) to (min \, max); #X text 12 65 INLET_0 signal; #X text 12 105 INLET_2 float; #X text 12 125 OUTLET_0 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR Tom Schouten ; #X restore 302 347 pd META; #X obj 103 141 expmap~; pd-creb-0.10.0/doc/fblock-help.pd000066400000000000000000000014501434364737600164050ustar00rootroot00000000000000#N canvas 0 26 551 236 10; #X text 200 79 right inlet is also "active"; #X text 201 119 main usage is to compute block synchronous frequencies ; #X text 200 134 for spectral domain processing; #X text 201 49 out = left + right * (sys samplerate / blocksize); #X text 200 35 fblock: compute block relative frequencies; #N canvas 198 157 494 345 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 float; #X text 12 45 DESCRIPTION compute block relative frequencies; #X text 12 5 KEYWORDS control abstraction needs_work (example patch) ; #X text 12 125 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 502 215 pd META; #X obj 40 67 fblock; pd-creb-0.10.0/doc/fdn~-help.pd000066400000000000000000000044361434364737600161210ustar00rootroot00000000000000#N canvas 4 4 680 586 10; #X obj 146 529 vols~; #X floatatom 203 509 5 0 0 0 - - -; #X obj 143 562 dac~; #X obj 128 131 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 10 415 print; #X floatatom 216 431 5 0 0 0 - - -; #X floatatom 267 432 5 0 0 0 - - -; #X obj 54 144 noise~; #X obj 94 190 *~; #X floatatom 203 111 5 0 0 0 - - -; #X obj 146 157 ead~; #X msg 360 119 lines 501 752 5003 7504 105 206 307 408; #X floatatom 152 110 5 0 0 0 - - -; #X msg 361 248 linear 32 100 105; #X msg 360 271 linear 32 1000 1005; #X msg 12 465 reset; #X obj 142 463 fdn~ 64 40000; #X msg 358 327 exponential 32 10 5000; #X msg 360 292 linear 32 100 2015; #X msg 361 224 linear 8 75 100; #X msg 361 201 linear 32 50 2175; #X msg 360 374 exponential 8 50 175; #X text 186 20 fdn~ a feedback delay network; #X text 316 468 creation arguments: ; #X text 3 396 print delay lengths; #X text 2 448 reset state; #X text 316 512 nb delay lines is always a multiple of 4; #X text 358 96 specify delay line lengths manually; #X text 359 152 specify a linear/exponential delay length range; #X text 361 170 ; #X text 359 430 inlets: low/high frequency reverb time (60dB time) ; #X msg 358 351 exponential 64 1000 10; #N canvas 379 254 494 359 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION a feedback delay network; #X text 12 85 INLET_1 float; #X text 12 65 INLET_0 signal lines linear exponential; #X text 12 105 INLET_2 float; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 622 562 pd META; #X connect 0 0 2 0; #X connect 0 1 2 1; #X connect 1 0 0 2; #X connect 3 0 10 0; #X connect 4 0 16 0; #X connect 5 0 16 1; #X connect 6 0 16 2; #X connect 7 0 8 0; #X connect 8 0 16 0; #X connect 9 0 10 2; #X connect 10 0 8 1; #X connect 10 0 16 0; #X connect 11 0 16 0; #X connect 12 0 10 1; #X connect 13 0 16 0; #X connect 14 0 16 0; #X connect 15 0 16 0; #X connect 16 0 0 0; #X connect 16 1 0 1; #X connect 17 0 16 0; #X connect 18 0 16 0; #X connect 19 0 16 0; #X connect 20 0 16 0; #X connect 21 0 16 0; #X connect 31 0 16 0; pd-creb-0.10.0/doc/ffpoly-help.pd000066400000000000000000000026611434364737600164510ustar00rootroot00000000000000#N canvas 0 26 461 404 10; #X text 85 14 ffpoly - compute a finite field polynomial; #X msg 103 89 coef 0 \$1; #X floatatom 103 65 5 0 0 0 - - -; #X floatatom 181 65 5 0 0 0 - - -; #X floatatom 257 65 5 0 0 0 - - -; #X floatatom 334 64 5 0 0 0 - - -; #X msg 181 89 coef 1 \$1; #X msg 257 89 coef 2 \$1; #X msg 334 89 coef 3 \$1; #X floatatom 38 106 5 0 0 0 - - -; #X obj 38 350 ffpoly 3 5; #X text 125 350 creation args: ; #X floatatom 38 384 5 0 0 0 - - -; #X msg 334 150 order \$1; #X floatatom 334 125 5 0 0 0 - - -; #X text 332 174 finite field order; #X floatatom 335 217 5 0 0 0 - - -; #X msg 335 242 coefficients \$1; #X text 271 279 set coefs in packed form; #X text 203 292 digit representation in base = field order; #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION compute a finite field polynomial; #X text 12 65 INLET_0 float coef order; #X text 12 85 OUTLET_0 float; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 412 384 pd META; #X connect 1 0 10 0; #X connect 2 0 1 0; #X connect 3 0 6 0; #X connect 4 0 7 0; #X connect 5 0 8 0; #X connect 6 0 10 0; #X connect 7 0 10 0; #X connect 8 0 10 0; #X connect 9 0 10 0; #X connect 10 0 12 0; #X connect 13 0 10 0; #X connect 14 0 13 0; #X connect 16 0 17 0; #X connect 17 0 10 0; pd-creb-0.10.0/doc/fht~-help.pd000066400000000000000000000020201434364737600161160ustar00rootroot00000000000000#N canvas 5 76 480 309 10; #X obj 17 62 osc~ 500; #X floatatom 17 -11 5 0 0 0 - - -; #X obj 17 23 * 187.5; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 64 float 0; #X coords 0 1 63 -1 200 140 1 0 0; #X restore 233 16 graph; #X text 13 -74 like fft~ but normalized and; #N canvas 379 254 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal block_oriented; #X text 12 45 DESCRIPTION like fft~ but normalized and spectrum: (DC \, NY) \, (R1 \, I1) \, ...(RN-1 \, IN-1); #X text 12 75 INLET_0 signal; #X text 12 95 OUTLET_0 signal; #X text 12 115 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 428 216 pd META; #X text 12 -60 spectrum: (DC \, NY) \, (R1 \, I1) \, ...(RN-1 \, IN-1) ; #X obj 17 180 tabsend~ \$0-scope; #X text 159 186 Also see:; #X obj 158 208 creb/bfft~; #X obj 233 208 creb/ibfft~; #X obj 18 113 creb/fht~; #X connect 0 0 11 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 11 0 7 0; pd-creb-0.10.0/doc/filterortho~-help.pd000066400000000000000000000035001434364737600177020ustar00rootroot00000000000000#N canvas 0 26 525 473 10; #X obj 146 452 dac~; #X floatatom 255 83 7 0 0 0 - - -; #X floatatom 194 83 7 0 0 0 - - -; #X obj 158 405 filterortho~; #X obj 194 123 t b f; #X floatatom 29 31 5 0 0 0 - - -; #X obj 13 9 noise~; #X floatatom 133 83 7 0 0 0 - - -; #X obj 150 123 t b f; #X obj 13 52 *~; #X text 333 9 orthogonal biquad object; #X obj 157 330 pack s 0 0 0; #X obj 237 122 t b f; #X text 137 61 freq; #X text 213 61 Q; #X msg 335 126 setEQ; #X msg 335 150 setLP; #X msg 158 363 \$1 \$2 \$3 \$4; #X msg 336 175 setHP; #X msg 336 201 setBP; #X msg 336 225 setBR; #X msg 336 251 setHS; #X msg 337 275 setLS; #X msg 338 299 setAP; #X text 391 127 parametric equalizer; #X text 390 150 lowpass; #X text 391 175 highpass; #X text 391 201 bandpass; #X text 391 224 bandreject; #X text 390 252 highshelf; #X text 390 277 lowshelf; #X text 391 300 allpass; #X text 265 62 gain (only for EQ \, LS \, HS); #N canvas 379 254 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal filter; #X text 12 45 DESCRIPTION orthogonal biquad object; #X text 12 65 INLET_0 signal setEQ setLP setHP setBP setBR setHS setLS setAP; #X text 12 95 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR Tom Schouten ; #X restore 472 453 pd META; #X connect 1 0 12 0; #X connect 2 0 4 0; #X connect 3 0 0 0; #X connect 3 0 0 1; #X connect 4 0 11 0; #X connect 4 1 11 2; #X connect 5 0 9 1; #X connect 6 0 9 0; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 8 1 11 1; #X connect 9 0 3 0; #X connect 11 0 17 0; #X connect 12 0 11 0; #X connect 12 1 11 3; #X connect 15 0 11 0; #X connect 16 0 11 0; #X connect 17 0 3 0; #X connect 18 0 11 0; #X connect 19 0 11 0; #X connect 20 0 11 0; #X connect 21 0 11 0; #X connect 22 0 11 0; #X connect 23 0 11 0; pd-creb-0.10.0/doc/fmod-help.pd000066400000000000000000000010611434364737600160700ustar00rootroot00000000000000#N canvas 0 26 418 289 10; #X text 175 90 floating point version of; #X text 361 91 [mod]; #N canvas 45 93 494 329 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_1 float; #X text 12 45 DESCRIPTION floating point version of [mod]; #X text 12 65 INLET_0 float; #X text 12 105 OUTLET_0 float; #X text 12 5 KEYWORDS control needs_work (example patch); #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 368 267 pd META; #X obj 67 87 fmod; pd-creb-0.10.0/doc/fmop~-help.pd000066400000000000000000000010731434364737600163050ustar00rootroot00000000000000#N canvas 0 26 344 223 10; #X text 76 12 fm operator; #N canvas 21 119 494 354 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 45 DESCRIPTION frequency modulation operator; #X text 12 105 INLET_2 signal; #X text 12 125 OUTLET_0 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR Tom Schouten ; #X restore 288 197 pd META; #X obj 79 101 fmop~; pd-creb-0.10.0/doc/frequor~-help.pd000066400000000000000000000012371434364737600170310ustar00rootroot00000000000000#N canvas 0 26 405 288 10; #X text 28 4 frequor~: frequency domain phasor~ (for traversing spectra) ; #X text 102 25 output: (0 \, N/2-1) -> (0 \, 1); #X text 152 41 (N/2 \, N-1) -> (-1 \, 0); #N canvas 331 92 494 345 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 95 OUTLET_0 signal; #X text 12 45 DESCRIPTION frequency domain phasor~ (for traversing spectra); #X text 12 75 INLET_0 float; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR Tom Schouten ; #X restore 352 267 pd META; #X obj 128 131 frequor~; pd-creb-0.10.0/doc/fwarp-help.pd000066400000000000000000000026071434364737600162710ustar00rootroot00000000000000#N canvas 0 26 448 408 10; #X obj 18 85 fwarp; #X floatatom 18 53 5 0 0 0 - - -; #X floatatom 18 121 7 0 0 0 - - -; #X text 112 49 fwarp - warps a frequency using the formula; #X obj 173 261 xfm~ 0 0 0 0; #X obj 173 218 fwarp; #X floatatom 173 186 5 0 0 0 - - -; #X obj 117 260 osc~; #X obj 152 324 vol~; #X obj 152 350 dac~; #X floatatom 212 298 5 0 0 0 - - -; #X obj 351 263 xfm~ 0 0 0 0; #X floatatom 351 188 5 0 0 0 - - -; #X obj 295 262 osc~; #X obj 330 326 vol~; #X obj 330 352 dac~; #X floatatom 390 300 5 0 0 0 - - -; #X text 132 126 example: xfm~ uses warped frequencies; #X text 112 67 out = tan(2pi*in/sr) * (sr/2pi); #N canvas 482 199 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION warp a frequency using the formula out = tan(2pi*in/sr) * (sr/2pi); #X text 12 75 INLET_0 float; #X text 12 95 OUTLET_0 float; #X text 12 25 LICENSE GPL v2; #X text 12 115 AUTHOR Tom Schouten ; #X restore 399 388 pd META; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 4 0 8 0; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 8 0 9 1; #X connect 10 0 8 1; #X connect 11 0 14 0; #X connect 12 0 13 0; #X connect 12 0 11 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 14 0 15 1; #X connect 16 0 14 1; pd-creb-0.10.0/doc/ibfft~-help.pd000066400000000000000000000020201434364737600164270ustar00rootroot00000000000000#N canvas 5 76 480 309 10; #X obj 17 62 osc~ 500; #X floatatom 17 -11 5 0 0 0 - - -; #X obj 17 23 * 187.5; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-scope 64 float 0; #X coords 0 1 63 -1 200 140 1 0 0; #X restore 233 16 graph; #X text 13 -74 like fft~ but normalized and; #N canvas 379 254 494 344 META 0; #X text 12 135 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal block_oriented; #X text 12 45 DESCRIPTION like fft~ but normalized and spectrum: (DC \, NY) \, (R1 \, I1) \, ...(RN-1 \, IN-1); #X text 12 75 INLET_0 signal; #X text 12 95 OUTLET_0 signal; #X text 12 115 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 428 216 pd META; #X text 12 -60 spectrum: (DC \, NY) \, (R1 \, I1) \, ...(RN-1 \, IN-1) ; #X obj 17 180 tabsend~ \$0-scope; #X obj 233 208 creb/fht~; #X text 159 186 Also see:; #X obj 18 113 creb/ibfft~; #X obj 158 208 creb/bfft~; #X connect 0 0 10 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 10 0 7 0; pd-creb-0.10.0/doc/icep~-help.pd000066400000000000000000000011511434364737600162610ustar00rootroot00000000000000#N canvas 0 26 488 228 10; #X text 229 45 backward cepstrum; #X text 229 64 using normalized fft/ifft objects; #N canvas 331 92 494 506 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 OUTLET_0 signal; #X text 12 45 DESCRIPTION backward cepstrum; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 125 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR Tom Schouten ; #X restore 438 207 pd META; #X obj 151 51 icep~; pd-creb-0.10.0/doc/idsfosc~-help.pd000066400000000000000000000013061434364737600167750ustar00rootroot00000000000000#N canvas 0 26 454 368 10; #X text 59 21 complex form of the (infinite) discrete summation oscillator ; #X text 62 38 1/(1-az) \, with z = e^(jw); #N canvas 331 92 494 345 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 125 OUTLET_0 signal; #X text 12 85 INLET_0 signal; #X text 12 105 INLET_1 signal; #X text 12 145 OUTLET_1 signal; #X text 12 55 DESCRIPTION complex form of the (infinite) discrete summation oscillator; #X text 12 5 KEYWORDS signal abstraction oscillator needs_work (example patch); #X text 12 35 LICENSE GPL v2; #X text 12 165 AUTHOR Tom Schouten ; #X restore 401 345 pd META; #X obj 80 110 idsfosc~; pd-creb-0.10.0/doc/idwt16~-help.pd000066400000000000000000000052541434364737600164670ustar00rootroot00000000000000#N canvas 5 76 952 611 10; #X obj 17 62 osc~ 500; #X msg 83 -115 predict 0.5 0.5 \, update 0.25 0.25; #X msg 83 -76 predict -0.0625 0.5625 0.5625 -0.0625 \, update -0.03125 0.28125 0.28125 -0.03125; #X floatatom 24 10 5 0 0 0 - - -; #X msg 201 144 mask -1 9 9 -1; #X obj 67 279 r coef; #X obj 82 -30 s coef; #X obj 195 337 s coef; #X msg 201 167 mask 3 -25 150 150 -25 3; #X msg 216 189 mask -5 49 -245 1225 1225 -245 49 -5; #X obj 196 39 pack; #X floatatom 222 8 5 0 0 0 - - -; #X floatatom 166 -4 5 0 0 0 - - -; #X msg 171 64 coef \$1 \$2; #X msg 191 120 mask 1 1; #X msg 228 212 mask 35 -405 2268 -8820 39690 39690 -8820 2268 -405 35; #X msg 244 246 mask -63 847 -5445 22869 -76230 320166 320166 -76230 22869 -5445 847 -63; #X msg 245 306 predict 1 0 \, update 0 0.5; #X obj 36 31 * 187.5; #X msg 469 376 mask 0 0 0 35 140 -70 28 -5; #X msg 469 352 mask 7 -45 126 -210 315 63 0 0 0 0; #X msg 469 328 mask -21 154 -495 924 -1155 1386 231 0 0 0 0 0; #X obj 26 443 tabsend~ scope; #N canvas 0 0 450 300 (subpatch) 0; #X array scope 256 float 0; #X coords 0 1 255 -1 200 140 1; #X restore 718 -98 graph; #X text 61 165 print out coefs; #X msg 100 184 print; #X text 315 -24 dwt~ performs a discrete wavelet transform; #X text 315 -10 idwt~ performs the inverse transform; #X text 309 105 mask sets the predict mask \, and uses the corresponding update mask; #X text 266 63 coef sets half of a symmetric predict mask; #X text 243 286 predict and update masks can be specified explicitly ; #X text 433 307 haar wavelet; #X msg 672 189 even \$1; #X floatatom 672 167 5 0 0 0 - - -; #X text 570 134 even is the order symmetric interpolating biorthogonal wavelet with n vanishing moments.; #N canvas 379 254 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 KEYWORDS signal; #X text 12 65 DESCRIPTION dwt~ performas a descrete wavelet transform/ idwt~ performs the inverse transform; #X text 12 95 INLET_0 signal print mask predict update even; #X text 12 5 NAME dwt~ idwt~; #X text 12 115 OUTLET_0 signal; #X text 12 45 LICENSE GPL v2; #X text 12 135 AUTHOR Tom Schouten ; #X restore 884 465 pd META; #X obj 26 341 creb/idwt16~ 1; #X connect 0 0 36 0; #X connect 1 0 6 0; #X connect 2 0 6 0; #X connect 3 0 18 0; #X connect 4 0 7 0; #X connect 5 0 36 0; #X connect 8 0 7 0; #X connect 9 0 7 0; #X connect 10 0 13 0; #X connect 11 0 10 1; #X connect 12 0 10 0; #X connect 13 0 7 0; #X connect 14 0 7 0; #X connect 15 0 7 0; #X connect 16 0 7 0; #X connect 17 0 7 0; #X connect 18 0 0 0; #X connect 19 0 7 0; #X connect 20 0 7 0; #X connect 21 0 7 0; #X connect 25 0 7 0; #X connect 32 0 7 0; #X connect 33 0 32 0; #X connect 36 0 22 0; pd-creb-0.10.0/doc/idwt~-help.pd000066400000000000000000000052521434364737600163160ustar00rootroot00000000000000#N canvas 5 76 952 611 10; #X obj 17 62 osc~ 500; #X msg 83 -115 predict 0.5 0.5 \, update 0.25 0.25; #X msg 83 -76 predict -0.0625 0.5625 0.5625 -0.0625 \, update -0.03125 0.28125 0.28125 -0.03125; #X floatatom 24 10 5 0 0 0 - - -; #X msg 201 144 mask -1 9 9 -1; #X obj 67 279 r coef; #X obj 82 -30 s coef; #X obj 195 337 s coef; #X msg 201 167 mask 3 -25 150 150 -25 3; #X msg 216 189 mask -5 49 -245 1225 1225 -245 49 -5; #X obj 196 39 pack; #X floatatom 222 8 5 0 0 0 - - -; #X floatatom 166 -4 5 0 0 0 - - -; #X msg 171 64 coef \$1 \$2; #X msg 191 120 mask 1 1; #X msg 228 212 mask 35 -405 2268 -8820 39690 39690 -8820 2268 -405 35; #X msg 244 246 mask -63 847 -5445 22869 -76230 320166 320166 -76230 22869 -5445 847 -63; #X msg 245 306 predict 1 0 \, update 0 0.5; #X obj 36 31 * 187.5; #X msg 469 376 mask 0 0 0 35 140 -70 28 -5; #X msg 469 352 mask 7 -45 126 -210 315 63 0 0 0 0; #X msg 469 328 mask -21 154 -495 924 -1155 1386 231 0 0 0 0 0; #X obj 26 443 tabsend~ scope; #N canvas 0 0 450 300 (subpatch) 0; #X array scope 256 float 0; #X coords 0 1 255 -1 200 140 1; #X restore 718 -98 graph; #X text 61 165 print out coefs; #X msg 100 184 print; #X text 315 -24 dwt~ performs a discrete wavelet transform; #X text 315 -10 idwt~ performs the inverse transform; #X text 309 105 mask sets the predict mask \, and uses the corresponding update mask; #X text 266 63 coef sets half of a symmetric predict mask; #X text 243 286 predict and update masks can be specified explicitly ; #X text 433 307 haar wavelet; #X msg 672 189 even \$1; #X floatatom 672 167 5 0 0 0 - - -; #X text 570 134 even is the order symmetric interpolating biorthogonal wavelet with n vanishing moments.; #N canvas 379 254 494 344 META 0; #X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 KEYWORDS signal; #X text 12 65 DESCRIPTION dwt~ performas a descrete wavelet transform/ idwt~ performs the inverse transform; #X text 12 95 INLET_0 signal print mask predict update even; #X text 12 5 NAME dwt~ idwt~; #X text 12 115 OUTLET_0 signal; #X text 12 45 LICENSE GPL v2; #X text 12 135 AUTHOR Tom Schouten ; #X restore 884 465 pd META; #X obj 26 341 creb/idwt~ 1; #X connect 0 0 36 0; #X connect 1 0 6 0; #X connect 2 0 6 0; #X connect 3 0 18 0; #X connect 4 0 7 0; #X connect 5 0 36 0; #X connect 8 0 7 0; #X connect 9 0 7 0; #X connect 10 0 13 0; #X connect 11 0 10 1; #X connect 12 0 10 0; #X connect 13 0 7 0; #X connect 14 0 7 0; #X connect 15 0 7 0; #X connect 16 0 7 0; #X connect 17 0 7 0; #X connect 18 0 0 0; #X connect 19 0 7 0; #X connect 20 0 7 0; #X connect 21 0 7 0; #X connect 25 0 7 0; #X connect 32 0 7 0; #X connect 33 0 32 0; #X connect 36 0 22 0; pd-creb-0.10.0/doc/inv-help.pd000066400000000000000000000007121434364737600157410ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #N canvas 331 92 494 307 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION inverse; #X text 12 65 INLET_0 float; #X text 12 85 OUTLET_0 float; #X text 12 5 KEYWORDS control abstraction needs_work (example patch) ; #X text 12 105 AUTHOR Tom Schouten ; #X text 12 25 LICENSE GPL v2; #X restore 391 275 pd META; #X obj 139 143 inv; pd-creb-0.10.0/doc/junction~-help.pd000066400000000000000000000044001434364737600171720ustar00rootroot00000000000000#N canvas 0 26 390 300 10; #X obj 181 138 junction~ 4; #X obj 253 167 delwrite~ del1 1000; #X obj 123 51 vd~ del1; #X obj 183 51 vd~ del2; #X obj 244 51 vd~ del3; #X obj 304 51 vd~ del4; #X obj 123 30 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 183 30 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 245 31 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 305 31 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 63 262 dac~; #X obj 13 121 ead~; #X obj 30 97 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 90 97 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 4 97 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1 ; #X obj 229 189 delwrite~ del2 1000; #X obj 205 210 delwrite~ del3 1000; #X obj 181 232 delwrite~ del4 1000; #X msg 313 111 random \$1; #X obj 314 85 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X text 61 5 junction~: a circular lossless signal junction; #X obj 58 238 vols~; #X obj 105 221 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #N canvas 379 250 494 421 META 0; #X text 12 245 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION a circular lossless signal junction; #X text 12 65 INLET_0 signal random; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 145 OUTLET_0 signal; #X text 12 165 OUTLET_1 signal; #X text 12 185 OUTLET_2 signal; #X text 12 205 OUTLET_3 signal; #X text 12 5 KEYWORDS signal; #X text 12 25 LICENSE GPL v2; #X text 12 225 AUTHOR Tom Schouten ; #X restore 341 280 pd META; #X connect 0 0 17 0; #X connect 0 0 21 0; #X connect 0 1 16 0; #X connect 0 1 21 1; #X connect 0 2 15 0; #X connect 0 3 1 0; #X connect 2 0 0 0; #X connect 3 0 0 1; #X connect 4 0 0 2; #X connect 5 0 0 3; #X connect 6 0 2 0; #X connect 7 0 3 0; #X connect 8 0 4 0; #X connect 9 0 5 0; #X connect 11 0 0 0; #X connect 12 0 11 1; #X connect 13 0 11 2; #X connect 14 0 11 0; #X connect 18 0 0 0; #X connect 19 0 18 0; #X connect 21 0 10 0; #X connect 21 1 10 1; #X connect 22 0 21 2; pd-creb-0.10.0/doc/lattice3-help.pd000066400000000000000000000010671434364737600166610ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #X text 22 4 expand harmonic lattice vector in the (2 \, 3/2 \, 5/4) basis; #N canvas 331 92 494 345 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 OUTLET_0 signal; #X text 12 65 INLET_0 signal; #X text 12 45 DESCRIPTION expand a 3D harmonic lattice vector; #X text 12 5 KEYWORDS control abstraction needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 391 275 pd META; #X obj 74 93 lattice3; pd-creb-0.10.0/doc/lattice~-help.pd000066400000000000000000000043241434364737600167730ustar00rootroot00000000000000#N canvas 0 26 433 557 10; #X obj 57 -77 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 12500 1; #X msg 57 223 rc 0 \$1; #X obj 88 -78 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 6432 1; #X obj 119 -77 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 3732 1; #X obj 149 -77 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 4332 1; #X obj 179 -77 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 21232 1; #X obj 210 -78 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 24900 1; #X obj 241 -78 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 18232 1; #X obj 271 -77 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 16932 1; #X msg 86 199 rc 1 \$1; #X msg 118 224 rc 2 \$1; #X msg 147 200 rc 3 \$1; #X msg 179 223 rc 4 \$1; #X msg 208 199 rc 5 \$1; #X msg 240 224 rc 6 \$1; #X msg 269 200 rc 7 \$1; #X floatatom 154 -125 5 -1 1 0 - - -; #X obj 64 302 lattice~ 8; #X obj 6 254 noise~; #X obj 63 363 vol~; #X obj 63 397 dac~; #X floatatom 85 333 5 0 0 0 - - -; #X text 159 298 lattice~ a lattice filter; #X text 139 333 [rc ] sets reflection coefficient; #X text 159 311 creation argument sets order; #X obj 27 330 dist~ 1; #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 25 LICENSE; #X text 12 45 DESCRIPTION a lattic filter; #X text 12 5 KEYWORDS signal filter; #X text 12 65 INLET_0 signal rc; #X text 12 85 OUTLET_0 signal; #X text 12 105 AUTHOR Tom Schouten ; #X restore 383 409 pd META; #X connect 0 0 1 0; #X connect 1 0 17 0; #X connect 2 0 9 0; #X connect 3 0 10 0; #X connect 4 0 11 0; #X connect 5 0 12 0; #X connect 6 0 13 0; #X connect 7 0 14 0; #X connect 8 0 15 0; #X connect 9 0 17 0; #X connect 10 0 17 0; #X connect 11 0 17 0; #X connect 12 0 17 0; #X connect 13 0 17 0; #X connect 14 0 17 0; #X connect 15 0 17 0; #X connect 16 0 0 0; #X connect 16 0 2 0; #X connect 16 0 3 0; #X connect 16 0 4 0; #X connect 16 0 5 0; #X connect 16 0 6 0; #X connect 16 0 7 0; #X connect 16 0 8 0; #X connect 17 0 25 0; #X connect 18 0 17 0; #X connect 19 0 20 1; #X connect 19 0 20 0; #X connect 21 0 19 1; #X connect 25 0 19 0; pd-creb-0.10.0/doc/lpifft~-help.pd000066400000000000000000000013251434364737600166300ustar00rootroot00000000000000#N canvas 0 26 463 346 10; #X text 18 7 ifft with rectangular lowpass for anti-aliased dynwav ; #X text 9 18 creation arg = fft size \, right inlet = dynwav cutoff freq; #N canvas 331 92 494 386 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 125 OUTLET_0 signal; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 145 OUTLET_1 signal; #X text 12 105 INLET_2 float; #X text 12 45 DESCRIPTION ifft + lowpass (for anti-aliased dynwav) ; #X text 12 25 LICENSE GPL v2; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 5 KEYWORDS signal abstraction needs_work (example); #X restore 412 324 pd META; #X obj 57 112 lpifft~; pd-creb-0.10.0/doc/nfft~-help.pd000066400000000000000000000010521434364737600162760ustar00rootroot00000000000000#N canvas 344 306 450 300 12; #X obj 108 112 creb/nfft~; #N canvas 379 254 494 344 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_0 signal; #X text 12 105 INLET_1 signal; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS signal needs_work needs_work (example); #X text 12 5 NAME nfft~; #X text 12 65 DESCRIPTION mayer fft; #X restore 391 274 pd META; pd-creb-0.10.0/doc/nifft~-help.pd000066400000000000000000000010641434364737600164520ustar00rootroot00000000000000#N canvas 344 306 450 300 12; #X obj 108 112 creb/nifft~; #N canvas 379 254 494 344 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 85 INLET_0 signal; #X text 12 105 INLET_1 signal; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 165 AUTHOR Tom Schouten ; #X text 12 45 LICENSE GPL v2; #X text 12 25 KEYWORDS signal needs_work needs_work (example); #X text 12 5 NAME nifft~; #X text 12 65 DESCRIPTION mayer inverse fft; #X restore 391 274 pd META; pd-creb-0.10.0/doc/output~.pd000066400000000000000000000041341434364737600157570ustar00rootroot00000000000000#N canvas 572 427 434 408 10; #X obj 13 106 hsl 42 23 0.01 1 1 0 \$0-v \$0-v volume 7 13 1 9 -245500 -13381 -1 0 0; #X obj 57 106 tgl 18 0 THIS_IS_HERE_TO_GET_RID_OF_THE_OUTLET \$0-dsp-toggle dsp 2 9 1 9 -262144 -195568 -33289 0 1; #N canvas 1019 468 429 371 dsp 0; #X obj 36 30 inlet; #X obj 117 227 select 0 1; #X msg 150 252 6; #X obj 117 86 route dsp; #X obj 117 59 receive pd; #X msg 36 228 dsp \$1; #X obj 36 253 send pd; #X msg 231 279 set \$1; #X msg 117 279 color \$1 20 12; #X obj 231 310 send \$0-dsp-toggle; #X msg 117 251 0; #X obj 251 129 loadbang; #X obj 231 99 sig~ 1; #X obj 231 191 snapshot~; #X obj 251 158 delay 100; #X obj 117 138 change -1; #X obj 2 2 cnv 15 425 20 empty empty empty 3 12 0 14 -204280 -1 0; #X text 6 3 Retrieve and set DSP state; #X connect 0 0 5 0; #X connect 0 0 15 0; #X connect 1 0 10 0; #X connect 1 1 2 0; #X connect 2 0 8 0; #X connect 3 0 15 0; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 7 0 9 0; #X connect 8 0 9 0; #X connect 10 0 8 0; #X connect 11 0 14 0; #X connect 12 0 13 0; #X connect 13 0 1 0; #X connect 13 0 7 0; #X connect 14 0 13 0; #X connect 15 0 7 0; #X connect 15 0 1 0; #X restore 82 148 pd dsp logic; #X obj 188 31 inlet~; #X obj 74 268 line~; #X obj 174 328 *~; #X obj 194 358 dac~; #X text 200 51 audio in; #X obj 250 31 inlet~; #X obj 236 327 *~; #X obj 188 102 hip~ 3; #X obj 250 102 hip~ 3; #X obj 10 283 send pd; #X msg 10 262 dsp 1; #X obj 74 247 pack 0 50; #X text 141 246 <-- make a ramp to avoid clicks or zipper noise; #X msg 74 212 0; #X obj 74 189 moses 0.011; #X text 294 103 filter out DC; #X obj 4 3 cnv 15 425 20 empty empty empty 3 12 0 14 -204280 -1 0; #X text 10 3 dac~ and DSP switch abstraction; #X text 14 376 Created by Katja Vetter after an idea by Claude Heiland-Allen ; #X connect 0 0 13 0; #X connect 0 0 17 0; #X connect 1 0 2 0; #X connect 3 0 10 0; #X connect 4 0 9 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 8 0 11 0; #X connect 9 0 6 1; #X connect 10 0 5 1; #X connect 11 0 9 1; #X connect 13 0 12 0; #X connect 14 0 4 0; #X connect 16 0 14 0; #X connect 17 0 16 0; #X connect 17 1 14 0; #X coords 0 0 1 1 65 39 1 10 90; pd-creb-0.10.0/doc/pdynwav~-help.pd000066400000000000000000000007441434364737600170400ustar00rootroot00000000000000#N canvas 0 26 194 151 10; #X obj 35 15 pdynwav~; #N canvas 80 80 494 326 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 125 AUTHOR Tom Shouten; #X text 12 105 OUTLET_0 signal; #X text 12 65 INLET_0 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 85 INLET_1 float; #X text 12 45 DESCRIPTION phasor~ + dynwav~; #X text 12 25 LICENSE GPL v2; #X restore 143 129 pd META; pd-creb-0.10.0/doc/permut~-help.pd000066400000000000000000000017151434364737600166630ustar00rootroot00000000000000#N canvas 0 26 443 234 10; #X text 29 10 permut~ performs a random permutation on a signal block ; #X text 30 27 mainly intended for shuffling spectral data (dynwav) ; #X obj 73 127 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 96 126 random; #X text 154 124 bang or random create a new random permutation; #X obj 30 91 osc~; #X obj 30 166 permut~; #X obj 29 210 dac~; #X floatatom 30 61 5 0 0 0 - - -; #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal random; #X text 12 45 DESCRIPTION perform a random permutation on a signal block; #X text 12 85 OUTLET_0 signal; #X text 12 65 INLET_0 signal bang random; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 385 210 pd META; #X connect 2 0 6 0; #X connect 3 0 6 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 6 0 7 1; #X connect 8 0 5 0; pd-creb-0.10.0/doc/qmult~-help.pd000066400000000000000000000043771434364737600165200ustar00rootroot00000000000000#N canvas 0 26 658 342 10; #X obj 111 145 qnorm~; #X obj 38 71 osc~ 30; #X obj 101 71 osc~ 40; #X obj 163 70 osc~ 50; #X obj 229 71 osc~ 60; #X obj 143 319 dac~; #X obj 123 244 vol~; #X obj 163 244 vol~; #X floatatom 230 230 5 0 0 0 - - -; #X floatatom 58 36 5 0 0 0 - - -; #X floatatom 107 36 5 0 0 0 - - -; #X floatatom 159 36 5 0 0 0 - - -; #X floatatom 208 36 5 0 0 0 - - -; #X obj 167 282 hip~ 10; #X obj 103 281 hip~ 10; #X text 402 190 qmult multiplies 2 quaternion signals; #X floatatom 347 35 5 0 0 0 - - -; #X floatatom 396 35 5 0 0 0 - - -; #X floatatom 448 35 5 0 0 0 - - -; #X floatatom 497 35 5 0 0 0 - - -; #X obj 327 70 osc~ 70; #X obj 390 70 osc~ 80; #X obj 452 69 osc~ 90; #X obj 518 70 osc~ 100; #X obj 410 136 qnorm~; #X obj 106 195 qmult~ 0 0 0 0 0; #X text 410 208 "quaternion ring modulation"; #X text 403 245 the inlets are in 1 x real 3 x imag form; #N canvas 375 135 494 397 META 0; #X text 12 325 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION multiply 2 quarternion signals; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 145 INLET_4 signal; #X text 12 165 INLET_5 signal; #X text 12 185 INLET_6 signal; #X text 12 205 INLET_7 signal; #X text 12 225 OUTLET_0 signal; #X text 12 245 OUTLET_1 signal; #X text 12 265 OUTLET_2 signal; #X text 12 285 OUTLET_3 signal; #X text 12 25 LICENSE GPL v2; #X text 12 305 AUTHOR Tom Schouten ; #X restore 598 319 pd META; #X connect 0 0 25 0; #X connect 0 1 25 1; #X connect 0 2 25 2; #X connect 0 3 25 3; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 0 2; #X connect 4 0 0 3; #X connect 6 0 14 0; #X connect 7 0 13 0; #X connect 8 0 7 1; #X connect 8 0 6 1; #X connect 9 0 1 0; #X connect 10 0 2 0; #X connect 11 0 3 0; #X connect 12 0 4 0; #X connect 13 0 5 1; #X connect 14 0 5 0; #X connect 16 0 20 0; #X connect 17 0 21 0; #X connect 18 0 22 0; #X connect 19 0 23 0; #X connect 20 0 24 0; #X connect 21 0 24 1; #X connect 22 0 24 2; #X connect 23 0 24 3; #X connect 24 0 25 4; #X connect 24 1 25 5; #X connect 24 2 25 6; #X connect 24 3 25 7; #X connect 25 0 6 0; #X connect 25 1 6 0; #X connect 25 2 7 0; #X connect 25 3 7 0; pd-creb-0.10.0/doc/qnorm~-help.pd000066400000000000000000000026611434364737600165040ustar00rootroot00000000000000#N canvas 0 26 352 287 10; #X obj 119 137 qnorm~; #X obj 96 68 osc~ 30; #X obj 159 68 osc~ 40; #X obj 221 67 osc~ 50; #X obj 287 68 osc~ 60; #X obj 131 265 dac~; #X obj 111 190 vol~; #X obj 151 190 vol~; #X floatatom 185 154 5 0 0 0 - - -; #X floatatom 116 33 5 0 0 0 - - -; #X floatatom 165 33 5 0 0 0 - - -; #X floatatom 217 33 5 0 0 0 - - -; #X floatatom 266 33 5 0 0 0 - - -; #X obj 155 228 hip~ 10; #X obj 91 227 hip~ 10; #X text 45 -2 qnorm normalizes a quaternion signal to unit norm; #N canvas 350 117 494 537 META 0; #X text 12 245 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION normalize a quaternion signal to unit norm ; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 145 OUTLET_0 signal; #X text 12 165 OUTLET_1 signal; #X text 12 185 OUTLET_2 signal; #X text 12 205 OUTLET_3 signal; #X text 12 25 LICENSE GPL v2; #X text 12 225 AUTHOR Tom Schouten ; #X restore 301 265 pd META; #X connect 0 0 6 0; #X connect 0 1 6 0; #X connect 0 2 7 0; #X connect 0 3 7 0; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 0 2; #X connect 4 0 0 3; #X connect 6 0 14 0; #X connect 7 0 13 0; #X connect 8 0 7 1; #X connect 8 0 6 1; #X connect 9 0 1 0; #X connect 10 0 2 0; #X connect 11 0 3 0; #X connect 12 0 4 0; #X connect 13 0 5 1; #X connect 14 0 5 0; pd-creb-0.10.0/doc/ramp~-help.pd000066400000000000000000000011211434364737600162750ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #X obj 29 19 ramp~; #X obj 153 21 blockramp~; #N canvas 107 51 494 364 META 0; #X text 12 5 ALIAS blockramp~; #X text 12 95 INLET_0 bang; #X text 12 75 DESCRIPTION retriggerable counter for dsp signals; #X text 12 135 LIBRARY external creb; #X text 12 115 OUTLET_0 signal; #X text 12 175 HELP_PATCH_AUTHORS Jonathan Wilkes for PDDP.; #X text 12 25 KEYWORDS signal conversion ramp block_oriented needs_work (example patch); #X text 12 55 LICENSE GPL v2; #X text 12 155 AUTHOR Tom Schouten ; #X restore 395 276 pd META; #X text 95 121 needs an example; pd-creb-0.10.0/doc/ratio-help.pd000066400000000000000000000015461434364737600162710ustar00rootroot00000000000000#N canvas 0 26 414 244 10; #X obj 75 99 ratio; #X obj 103 192 osc~; #X floatatom 131 122 5 0 0 0 - - -; #X obj 103 150 *; #X obj 103 223 dac~; #X floatatom 75 51 5 0 0 0 - - -; #X floatatom 35 135 5 0 0 0 - - -; #X text 189 32 ratio is an octave shifter.; #X text 188 46 output is between 1 and 2; #X text 189 62 it computes 2^(log2(x)-int(log2(x))); #N canvas 379 254 494 344 META 0; #X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS control; #X text 12 45 DESCRIPTION octave shifter; #X text 12 65 INLET_0 float; #X text 12 85 OUTLET_0 float; #X text 12 25 LICENSE GPL v2; #X text 12 105 AUTHOR Tom Schouten ; #X restore 364 223 pd META; #X connect 0 0 3 0; #X connect 0 0 6 0; #X connect 1 0 4 0; #X connect 1 0 4 1; #X connect 2 0 3 1; #X connect 3 0 1 0; #X connect 5 0 0 0; pd-creb-0.10.0/doc/reference.txt000066400000000000000000000055541434364737600164020ustar00rootroot00000000000000abstractions 64k a beat shuffler using raw 64k/break sample banks bdft,bdfts set decay time (ms/sec) and osc frequency (for bdiag~) bhip~ butterworth high pass filter blop~ butterworth low pass filter bpm convert bpm to metro time and phasor freq cadd~ complex add ccmap~ conformal self map of the unit disk cconj~ complex conjugate cep~/icep~ complex cepstrum and inverse cinv~ complex inverse cmul~ complex multiplication count modulo counter cosc~ complex oscillator csub~ complex subtraction dsfosc~ (finite) discrete summation formula oscillator eadh~ exponential attack decay (with hold == duration) eadsrh~ exponential attack decay sustain release (..) expmap~ exponential map fblock block relative frequency conversion fmod floating point modulo fmop~ fm operator frequor~ like phasor, but for block spectra idsfosc~ infinite discrete summation formula inv inverse lattice3 expand a 3D harmonic lattice vector lpfft~ ifft + lowpass (for anti-aliased dynwav) pdynwav~ phasor~ + dynwav~ scale7 arbitrary 7 tone scale ti_hihat hihat gop object ti_snare snare drum gop object tblock block relative time conversion ucnorm~ normalize a complex signal to unit norm ucmod~ unit circle modulator vols~ volume for a stereo signal vol~ volume for a mono signal externs ffpoly finite field polynomial fwarp tangent warp frequency ratio multiply by 2^k so result is 1<=r<2 (transposer) tilde externs bdiag~ block diagonal state space system (spectral processor) bfft~ reordered fft bitsplit~ convert signal to binary vector bwin~ several windowing functions and spectral envelopes biquadseries~ biquad second order sections (i.e. butterworth) bitsplit~ convert a signal to binary representation blocknorm~ normalize a (set of) dsp block(s) (i.e. for spectral processing) blosc~ several bandlimited oscillators cheby~ chebyshev polynomial waveshaper clog~ complex log diag~ diagonal state space system (spectral processor) dist~ several distortions & waveshaping functions dwt~ discrete wavelet transform idwt~ inverse dynwav~ dynamic wavetable: use a signal block as wavetable ead~ exp. attack decay eadsr~ exp. attack decay sustain release ear~ exp. attack release filterortho~ several biquad filters, orthogonal implementation fdn~ a feedback delay network junction~ a circulant lossless signal junction lattice~ lattice filter matrix~ multiply a signal block with an arbitrary matrix permut~ random permute a signal block qmult~ multiply 2 quaternion signals qnorm~ normalize a quaternion signal (or any 4 channel sig) ramp~ generates an integer ramp resofilt~ a reso filter (4pole, 3pole) sbosc~ smallband oscillator (i.e. for formant synthesis) statwav~ a tabread4~ clone with 8 point interpolation scrollgrid1D~ a stabilized scroll grid chaotic oscillator tabreadmix~ a tabread~ clone with overlap add (for smooth time stretch) xfm~ coupled frequency modulation pd-creb-0.10.0/doc/resofilt~-help.pd000066400000000000000000000053401434364737600171740ustar00rootroot00000000000000#N canvas 0 26 638 489 10; #X floatatom 50 203 5 0 0 0 - - -; #X obj 118 433 vol~; #X floatatom 157 409 5 0 0 0 - - -; #X obj 110 468 dac~; #X floatatom 291 252 5 0 0 0 - - -; #X floatatom 290 301 5 0 0 0 - - -; #X obj 119 341 vol~; #X floatatom 142 318 5 0 0 0 - - -; #X obj 295 232 hsl 128 15 20 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 7900 1; #X obj 294 282 hsl 128 15 0 1 0 1 empty empty empty -2 -6 0 8 -262144 -1 -1 5600 1; #X obj 242 225 ead~; #X obj 243 268 *~; #X obj 235 203 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X floatatom 259 203 5 0 0 0 - - -; #X floatatom 305 202 5 0 0 0 - - -; #X obj 19 170 ead~; #X obj 20 273 *~; #X obj 19 102 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X floatatom 35 147 5 0 0 0 - - -; #X floatatom 76 147 5 0 0 0 - - -; #X obj 86 71 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 87 44 metro 125; #X obj 88 20 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X floatatom 147 16 5 0 0 0 - - -; #X msg 34 126 10; #X msg 76 126 400; #X msg 268 180 20; #X obj 36 225 blosc~ saw; #X obj 37 248 -~; #X msg 141 297 70; #X text 281 96 all inputs are signal inlets. frequency and reso are interpolated from their average (rms) value.; #X msg 305 181 500; #X text 279 28 resofilt~: high-quality implementations of the moog 4-pole and tb303 3-pole reso ladder filter. state-limited which means it distorts on high reso input \, and can go into self oscillation when reso > 1; #X msg 53 182 70; #X obj 119 377 resofilt~ 4; #X text 222 378 creation argument 4 = 4pole \, 3 = 3pole; #N canvas 379 254 494 344 META 0; #X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal filter; #X text 12 45 DESCRIPTION high-quality implementations of the moog 4-pole and tb303 3-pole res ladder filter; #X text 12 75 INLET_0 signal; #X text 12 95 INLET_1 signal; #X text 12 115 INLET_2 signal; #X text 12 135 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 155 AUTHOR Tom Schouten ; #X restore 588 468 pd META; #X connect 0 0 27 0; #X connect 1 0 3 0; #X connect 1 0 3 1; #X connect 2 0 1 1; #X connect 4 0 11 1; #X connect 6 0 34 0; #X connect 7 0 6 1; #X connect 8 0 4 0; #X connect 9 0 5 0; #X connect 10 0 11 0; #X connect 12 0 10 0; #X connect 13 0 10 1; #X connect 14 0 10 2; #X connect 15 0 16 0; #X connect 16 0 6 0; #X connect 17 0 15 0; #X connect 18 0 15 1; #X connect 19 0 15 2; #X connect 20 0 12 0; #X connect 20 0 17 0; #X connect 21 0 20 0; #X connect 22 0 21 0; #X connect 23 0 21 1; #X connect 24 0 18 0; #X connect 25 0 19 0; #X connect 26 0 13 0; #X connect 27 0 28 0; #X connect 28 0 16 1; #X connect 29 0 7 0; #X connect 31 0 14 0; #X connect 33 0 0 0; #X connect 34 0 1 0; pd-creb-0.10.0/doc/sbosc~-help.pd000066400000000000000000000027351434364737600164630ustar00rootroot00000000000000#N canvas 0 26 349 360 10; #X obj 70 158 sbosc~; #X floatatom 101 285 5 0 0 0 - - -; #X obj 70 308 vol~; #X obj 58 340 dac~; #X floatatom 70 68 5 0 0 0 - - -; #X floatatom 136 106 5 0 0 0 - - -; #X msg 129 139 0; #X text 171 139 phase; #X text 56 44 pitch; #X text 119 84 center freq; #X text 38 14 sbosc~: smallband periodic complex oscillator.; #X obj 134 53 hsl 128 15 20 20000 1 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X obj 213 91 hsl 128 15 20 20000 1 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X obj 85 228 idsfosc~; #X obj 70 256 *~; #X floatatom 136 206 5 0 0 0 - - -; #X obj 194 191 hsl 128 15 -0.99 0.99 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X text 136 188 bw; #N canvas 379 254 494 366 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION smallband periodic complex oscillator; #X text 12 5 KEYWORDS signal oscillator; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 float; #X text 12 125 OUTLET_0 signal; #X text 12 145 OUTLET_1 signal; #X text 12 25 LICENSE GPL v2; #X text 12 165 AUTHOR Tom Schouten ; #X restore 299 340 pd META; #X connect 0 0 14 0; #X connect 1 0 2 1; #X connect 2 0 3 0; #X connect 2 0 3 1; #X connect 4 0 0 0; #X connect 4 0 13 0; #X connect 5 0 0 1; #X connect 6 0 0 2; #X connect 11 0 4 0; #X connect 12 0 5 0; #X connect 13 0 14 1; #X connect 14 0 2 0; #X connect 15 0 13 1; #X connect 16 0 15 0; pd-creb-0.10.0/doc/scale7-help.pd000066400000000000000000000007711434364737600163300ustar00rootroot00000000000000#N canvas 0 26 450 373 10; #N canvas 331 92 494 323 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 list; #X text 12 105 OUTLET_0 float; #X text 12 5 KEYWORDS control abstraction needs_work (example patch) ; #X text 12 45 DESCRIPTION arbitrary 7 tone scale; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 398 347 pd META; #X obj 151 152 scale7; pd-creb-0.10.0/doc/scrollgrid1D~-help.pd000066400000000000000000000100031434364737600176660ustar00rootroot00000000000000#N canvas 0 26 659 650 10; #X obj 116 111 scrollgrid1D~; #X msg 36 87 reset; #X floatatom 111 82 5 0 0 0 - - -; #X floatatom 187 82 5 0 0 0 - - -; #X floatatom 237 81 5 0 0 0 - - -; #X floatatom 290 80 5 0 0 0 - - -; #X obj 401 190 tabwrite~ t; #X obj 401 142 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 504 196 table t 10000; #X obj 123 217 vol~; #X floatatom 146 191 5 0 0 0 - - -; #X text 103 42 frequency; #X text 197 40 T1; #X text 249 40 T2; #X text 301 41 N; #X msg 111 61 350; #X msg 235 61 1; #X msg 291 60 3; #X msg 188 60 12; #X obj 379 212 tabwrite~ t; #X obj 379 142 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 353 233 tabwrite~ t; #X obj 353 143 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 253 255 parameters:; #X text 286 322 N = number of scrolls or unstable rotation centers in attractor; #X text 253 357 outputs:; #X text 250 407 some remarks; #X text 286 375 the first output is alongside the scoll centers \, the other two are orthogonal to this line.; #X text 368 125 X Y Z; #X obj 178 217 vol~; #X floatatom 201 191 5 0 0 0 - - -; #X obj 64 218 vol~; #X floatatom 87 192 5 0 0 0 - - -; #X obj 63 277 hip~ 10; #X floatatom 133 281 5 0 0 0 - - -; #X obj 63 300 blop~ 4; #X msg 132 258 500; #X msg 163 258 5000; #X text 285 288 T1 = unstable time constant in ms ("attack" time); #X text 285 305 T2 = stable time constant in ms ("release" time); #X text 285 572 the entire circuit is clipped \, which means that for some parameter values that would normally cause a blowup \, its behaviour is limited to that of an oscillator.; #X obj 4 278 hip~ 10; #X obj 4 301 blop~ 4; #X floatatom 180 165 5 0 0 0 - - -; #X obj 4 397 tabwrite~ t; #X obj 21 375 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 142 61 5000; #X text 284 272 freq = spiral frequency in Hz; #X text 45 11 stabilized scroll grid chaotic oscillator with scroll centers located on a line.; #X msg 204 257 17000; #X text 285 427 this chaotic system is a switched unstable linear system. it consists of N scrolls (outward spirals). when the amplitude of the spiral has reached a certain threshold \, it is switched to be attracted by a neighbouring scroll. the freq parameter determines the frequency of the outward spiralling motion on a scroll. T1 is the outward spiralling time constant. T1 large means slow buildup or mild chaotic motion \, T1 small means fast buildup or turbulent chaotic motion. T2 is the time constant with which a trajectory is attracted to the plane of a scroll. T2 small means fast attraction \, T2 large means slow attraction. ; #X obj 94 373 dac~ 4; #N canvas 375 235 494 405 META 0; #X text 12 235 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION stabilized scroll grid chaotic oscillator with scroll centers located on a line; #X text 12 75 INLET_0 signal reset; #X text 12 95 INLET_1 signal; #X text 12 115 INLET_2 signal; #X text 12 135 INLET_3 signal; #X text 12 155 OUTLET_0 signal; #X text 12 175 OUTLET_1 signal; #X text 12 195 OUTLET_2 signal; #X text 12 5 KEYWORDS signal; #X text 12 25 LICENSE GPL v2; #X text 12 215 AUTHOR Tom Schouten ; #X restore 589 623 pd META; #X connect 0 0 21 0; #X connect 0 0 31 0; #X connect 0 1 9 0; #X connect 0 1 19 0; #X connect 0 2 6 0; #X connect 0 2 29 0; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 1; #X connect 4 0 0 2; #X connect 5 0 0 3; #X connect 7 0 6 0; #X connect 9 0 41 0; #X connect 10 0 9 1; #X connect 15 0 2 0; #X connect 16 0 4 0; #X connect 17 0 5 0; #X connect 18 0 3 0; #X connect 20 0 19 0; #X connect 22 0 21 0; #X connect 29 0 33 0; #X connect 30 0 29 1; #X connect 31 0 33 0; #X connect 31 0 41 0; #X connect 32 0 31 1; #X connect 33 0 35 0; #X connect 34 0 35 1; #X connect 34 0 42 1; #X connect 35 0 44 0; #X connect 35 0 51 0; #X connect 36 0 34 0; #X connect 37 0 34 0; #X connect 41 0 42 0; #X connect 42 0 44 0; #X connect 42 0 51 0; #X connect 43 0 10 0; #X connect 43 0 30 0; #X connect 45 0 44 0; #X connect 46 0 2 0; #X connect 49 0 34 0; pd-creb-0.10.0/doc/statwav~-help.pd000066400000000000000000000011171434364737600170340ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X obj 52 29 statwav~; #X text 124 29 static wavetable oscillator; #N canvas 127 170 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 LIBRARY external creb; #X text 12 85 OUTLET_0 signal; #X text 12 45 DESCRIPTION static wavetable oscillator; #X text 12 65 INLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS signal array needs_work (example patch); #X text 12 125 AUTHOR Tom Schouten ; #X restore 398 276 pd META; #X text 135 120 needs an example; pd-creb-0.10.0/doc/tabreadmix~-help.pd000066400000000000000000000034401434364737600174640ustar00rootroot00000000000000#N canvas 0 26 513 405 10; #X floatatom 199 254 5 0 0 0 - - -; #X obj 48 315 dac~; #X floatatom 38 40 5 0 0 0 - - -; #X text 135 7 tabreadmix~ an overlap add tabread clone; #X obj 288 362 soundfiler; #X text 203 236 right inlet: window hop size; #X text 249 247 (window size = 2x hop size); #X obj 38 77 phasor~; #X obj 38 124 *~; #X text 136 40 usage analogous to tabread~; #X text 136 58 only sample adressing is modulo length; #X obj 288 311 openpanel; #X obj 288 291 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 171 97 bang; #X text 219 97 reset windowing; #X msg 171 150 pitch \$1; #X floatatom 171 132 5 0 0 0 - - -; #X text 245 151 set window hop size corresponding to pitch; #X floatatom 172 178 5 0 0 0 - - -; #X msg 172 196 chunks \$1; #X text 246 196 set hop size to 1/xth of length; #X obj 374 304 table sample123; #X msg 288 338 read -resize \$1 sample123; #X obj 288 386 s length; #X obj 54 100 r length; #X obj 57 275 tabreadmix~ sample123; #X text 136 24 simple (sample rate synchronous) playback; #N canvas 379 254 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal array; #X text 12 65 INLET_0 bang signal pitch chunks; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 signal; #X text 12 45 DESCRIPTION an overlap add tabread~ clone; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 464 386 pd META; #X connect 0 0 25 1; #X connect 2 0 7 0; #X connect 4 0 23 0; #X connect 7 0 8 0; #X connect 8 0 25 0; #X connect 11 0 22 0; #X connect 12 0 11 0; #X connect 13 0 25 0; #X connect 15 0 25 0; #X connect 16 0 15 0; #X connect 18 0 19 0; #X connect 19 0 25 0; #X connect 22 0 4 0; #X connect 24 0 8 1; #X connect 25 0 1 0; #X connect 25 0 1 1; pd-creb-0.10.0/doc/tblock-help.pd000066400000000000000000000014351434364737600164260ustar00rootroot00000000000000#N canvas 0 26 467 246 10; #X text 95 58 right inlet is also "active"; #X text 95 113 for spectral domain processing; #X text 95 14 tblock: compute block relative time delays; #X text 96 28 out = left + right * (blocksize / sys_samplerate); #X text 96 98 main usage is to compute block synchronous time delays ; #X obj 22 20 tblock; #N canvas 200 78 494 325 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 float; #X text 12 105 OUTLET_0 float; #X text 12 45 DESCRIPTION block relative time conversion; #X text 12 5 KEYWORDS control abstraction needs_work (example patch) ; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 416 225 pd META; pd-creb-0.10.0/doc/ti_hihat-help.pd000066400000000000000000000013001434364737600167300ustar00rootroot00000000000000#N canvas 0 26 333 350 10; #N canvas 200 78 494 529 META 0; #X text 12 245 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION hihat gop object; #X text 12 5 KEYWORDS signal abstraction GUI needs_work (example patch) ; #X text 12 65 INLET_0 float; #X text 12 85 INLET_1 float; #X text 12 105 INLET_2 float; #X text 12 125 INLET_3 float; #X text 12 145 INLET_4 float; #X text 12 165 INLET_5 float; #X text 12 185 INLET_6 float; #X text 12 205 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 225 AUTHOR Tom Schouten ; #X restore 278 327 pd META; #X obj 9 52 ti_hihat ----; #X coords 0 0 0.00245098 0.00260417 200 50 0; pd-creb-0.10.0/doc/ti_snare-help.pd000066400000000000000000000013311434364737600167470ustar00rootroot00000000000000#N canvas 1 26 449 391 10; #N canvas 200 78 494 332 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal abstraction GUI needs_work (example patch) ; #X text 12 105 OUTLET_0 signal; #X text 12 45 DESCRIPTION snare drum gop object; #X text 12 65 INLET_0 bang; #X text 12 85 INLET_1 float; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 395 359 pd META; #X obj 77 59 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 77 92 ti_snare; #X obj 76 159 output~; #X text 132 16 snare drum gop object; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 0 3 1; #X coords 0 0 1 1 270 50 0; pd-creb-0.10.0/doc/ucmod~-help.pd000066400000000000000000000011621434364737600164520ustar00rootroot00000000000000#N canvas 0 0 404 300 10; #X text 84 18 unit circle modulator. (1+r conj(z)/(1+rz); #N canvas 331 92 494 366 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 145 OUTLET_1 signal; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 45 DESCRIPTION unit circle modulator; #X text 12 105 INLET_2 signal; #X text 12 125 OUTLET_0 signal; #X text 12 25 LICENSE GPL v2; #X text 12 165 AUTHOR Tom Schouten ; #X restore 352 275 pd META; #X obj 95 121 ucmod~; pd-creb-0.10.0/doc/ucnorm~-help.pd000066400000000000000000000011531434364737600166460ustar00rootroot00000000000000#N canvas 0 0 450 300 10; #X text 59 21 normalize complex number to unit magnitude; #N canvas 200 78 494 353 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 45 DESCRIPTION normalize complex number to unit magnitude ; #X text 12 5 KEYWORDS signal abstraction needs_work (example patch) ; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 signal; #X text 12 105 OUTLET_0 signal; #X text 12 125 OUTLET_1 signal; #X text 12 25 LICENSE GPL v2; #X text 12 145 AUTHOR Tom Schouten ; #X restore 398 277 pd META; #X obj 183 126 ucnorm~; pd-creb-0.10.0/doc/vols~-help.pd000066400000000000000000000014241434364737600163270ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #N canvas 248 148 494 372 META 0; #X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 125 OUTLET_0 signal; #X text 12 65 INLET_0 signal; #X text 12 165 AUTHOR Tom Shouten; #X text 12 45 DESCRIPTION volume for a stereo signal; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 float; #X text 12 145 OUTLET_1 signal; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS signal filter abstraction; #X restore 393 274 pd META; #X obj 152 129 vols~; #X obj 137 36 osc~ 440; #X floatatom 176 95 5 0 100 0 - - -; #X obj 153 165 dac~; #X obj 156 66 osc~ 440.1; #X text 210 126 volume for a stereo signal; #X connect 1 0 4 0; #X connect 1 1 4 1; #X connect 2 0 1 0; #X connect 3 0 1 2; #X connect 5 0 1 1; pd-creb-0.10.0/doc/vol~-help.pd000066400000000000000000000011761434364737600161500ustar00rootroot00000000000000#N canvas 0 26 450 300 10; #N canvas 379 254 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 105 OUTLET_0 signal; #X text 12 45 DESCRIPTION volume for a mono signal; #X text 12 5 KEYWORDS signal filter; #X text 12 65 INLET_0 signal; #X text 12 85 INLET_1 float; #X text 12 25 LICENSE GPL v2; #X text 12 125 AUTHOR Tom Schouten ; #X restore 392 273 pd META; #X obj 172 144 vol~; #X obj 171 83 osc~ 880; #X floatatom 193 118 5 0 100 0 - - -; #X obj 172 212 dac~; #X connect 1 0 4 0; #X connect 1 0 4 1; #X connect 2 0 1 0; #X connect 3 0 1 1; pd-creb-0.10.0/doc/xfm~-help.pd000066400000000000000000000067101434364737600161410ustar00rootroot00000000000000#N canvas 0 26 604 604 10; #X text 298 24 xfm~ cross frequency modulation; #X msg 180 308 reset; #X floatatom 231 255 5 0 0 0 - - -; #X floatatom 282 255 5 0 0 0 - - -; #X floatatom 332 255 5 0 0 0 - - -; #X floatatom 382 255 5 0 0 0 - - -; #X obj 287 514 dac~; #X obj 231 282 lop~ 1; #X obj 282 282 lop~ 1; #X obj 332 282 lop~ 1; #X obj 382 282 lop~ 1; #X floatatom 444 268 5 0 0 0 - - -; #X text 228 232 freq1; #X text 279 232 freq2; #X text 337 233 fb1; #X text 381 234 fb2; #X text 297 43 freq_osc1 = freq1 + wave_out2*fb1; #X text 297 58 freq_osc2 = freq2 + wave_out1*fb2; #X obj 275 99 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 15200 1; #X obj 275 121 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 14400 1; #X obj 276 146 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 18938 1; #X obj 276 171 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 21000 1; #X floatatom 487 377 5 0 0 0 - - -; #X floatatom 534 375 5 0 0 0 - - -; #X obj 462 348 metro; #X floatatom 534 335 5 0 0 0 - - -; #X obj 463 324 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 534 306 500; #X msg 565 305 125; #X msg 444 241 0.1; #X msg 495 306 1000; #X msg 150 223 type 0; #X msg 151 263 type 1; #X text 42 213 square phasor; #X text 45 158 algo type; #X text 37 257 circular phasor; #X text 7 371 remark: all frequencies are warped; #X text 8 388 (f_real = arctan(2pi*f_in)/2pi); #X obj 288 485 vols~; #X floatatom 352 453 5 0 0 0 - - -; #X text 7 416 for frequencies under 1000Hz; #X text 8 430 this effect is minimal; #X text 9 465 use the fwarp to convert from; #X text 9 478 real to warped; #X text 9 505 the square phasor type is warped too; #X text 9 520 but not in such a nice way as the; #X text 9 534 circular phasor; #X text 36 229 (chaotic 4DOF); #X text 5 272 (quasiperiodic 2DOF); #X obj 462 411 ead~ 0 0; #X obj 442 517 dac~; #X obj 435 451 *~; #X obj 472 451 *~; #X obj 443 488 vols~; #X floatatom 507 456 5 0 0 0 - - -; #X text 2 173 (can be set by creation argument); #N canvas 515 145 494 383 META 0; #X text 12 205 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; #X text 12 5 KEYWORDS signal; #X text 12 45 DESCRIPTION cross frequency modulation; #X text 12 85 INLET_1 signal; #X text 12 105 INLET_2 signal; #X text 12 125 INLET_3 signal; #X text 12 145 OUTLET_0 signal; #X text 12 165 OUTLET_1 signal; #X text 12 65 INLET_0 signal type reset; #X text 12 25 LICENSE GPL v2; #X text 12 185 AUTHOR Tom Schouten ; #X restore 552 582 pd META; #X obj 277 325 xfm~; #X connect 1 0 57 0; #X connect 2 0 7 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 10 0; #X connect 7 0 57 0; #X connect 8 0 57 1; #X connect 9 0 57 2; #X connect 10 0 57 3; #X connect 11 0 10 1; #X connect 11 0 9 1; #X connect 11 0 7 1; #X connect 11 0 8 1; #X connect 18 0 2 0; #X connect 19 0 3 0; #X connect 20 0 4 0; #X connect 21 0 5 0; #X connect 22 0 49 1; #X connect 23 0 49 2; #X connect 24 0 49 0; #X connect 25 0 24 1; #X connect 25 0 23 0; #X connect 26 0 24 0; #X connect 27 0 25 0; #X connect 28 0 25 0; #X connect 29 0 11 0; #X connect 30 0 25 0; #X connect 31 0 57 0; #X connect 32 0 57 0; #X connect 38 0 6 0; #X connect 38 1 6 1; #X connect 39 0 38 2; #X connect 49 0 51 1; #X connect 49 0 52 1; #X connect 51 0 53 0; #X connect 52 0 53 1; #X connect 53 0 50 0; #X connect 53 1 50 1; #X connect 54 0 53 2; #X connect 57 0 51 0; #X connect 57 0 38 0; #X connect 57 1 52 0; #X connect 57 1 38 1; pd-creb-0.10.0/modules++/000077500000000000000000000000001434364737600147235ustar00rootroot00000000000000pd-creb-0.10.0/modules++/DSPI.h000066400000000000000000000026711434364737600156410ustar00rootroot00000000000000 #include "m_pd.h" #ifndef DSPI_h #define DSPI_h #define DSPImin(x,y) (((x)<(y)) ? (x) : (y)) #define DSPImax(x,y) (((x)>(y)) ? (x) : (y)) #define DSPIclip(min, x, max) (DSPImin(DSPImax((min), (x)), max)) // test if floating point number is denormal #if defined(__i386__) || defined(__x86_64__) // Type punning code: #ifndef PD_FLOAT_PRECISION #define PD_FLOAT_PRECISION 32 #endif #if PD_FLOAT_PRECISION == 32 typedef union { unsigned int i; t_float f; } t_dspiflint; static inline int DSPI_IS_DENORMAL(t_float f) { t_dspiflint pun; pun.f = f; return ((pun.i & 0x7f800000) == 0); } // test if almost denormal, choose whichever is fastest static inline int DSPI_IS_ALMOST_DENORMAL(t_float f) { t_dspiflint pun; pun.f = f; return ((pun.i & 0x7f800000) < 0x08000000); } #elif PD_FLOAT_PRECISION == 64 typedef union { unsigned int i[2]; t_float f; } t_dspiflint; static inline int DSPI_IS_DENORMAL(t_float f) { t_dspiflint pun; pun.f = f; return ((pun.i[1] & 0x7ff00000) == 0); } static inline int DSPI_IS_ALMOST_DENORMAL(t_float f) { t_dspiflint pun; pun.f = f; return ((pun.i[1] & 0x7ff00000) < 0x10000000); } #endif // endif PD_FLOAT_PRECISION #else // if not defined(__i386__) || defined(__x86_64__) #define DSPI_IS_DENORMAL(f) 0 #endif // end if defined(__i386__) || defined(__x86_64__) //#define DSPI_IS_ALMOST_DENORMAL(f) (fabs(f) < 3.e-34) #endif // end ifndef DSPI_h pd-creb-0.10.0/modules++/DSPIcomplex.h000066400000000000000000000130711434364737600172250ustar00rootroot00000000000000/* * DSPIcomplex.h - Quick and dirty inline class for complex numbers * (mainly to compute filter poles/zeros, not to be used inside loops) * Copyright (c) 2000 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef DSPIcomplex_h #define DSPIcomplex_h #include #include class DSPIcomplex { public: inline DSPIcomplex() {_r = _i = 0;} inline DSPIcomplex(const t_float &a, const t_float &b) {setCart(a, b);} inline DSPIcomplex(const t_float &phasor) {setAngle(phasor);} inline void setAngle(const t_float &angle) {_r = cos(angle); _i = sin(angle);} inline void setPolar(const t_float &phasor, const t_float &norm) {_r = norm * cos(phasor); _i = norm * sin(phasor);} inline void setCart(const t_float &a, const t_float &b) {_r = a; _i = b;} inline const t_float& r() const {return _r;} inline const t_float& i() const {return _i;} inline t_float norm2() const {return _r*_r+_i*_i;} inline t_float norm() const {return sqrt(norm2());} inline void normalize() {t_float n = 1.0f / norm(); _r *= n; _i *= n;} inline DSPIcomplex conj() const {return DSPIcomplex(_r, -_i);} inline t_float angle() const {return atan2(_i, _r);} inline DSPIcomplex operator+ (const DSPIcomplex &a) const { return DSPIcomplex(_r + a.r(), _i + a.i()); } inline DSPIcomplex operator+ (t_float f) const { return DSPIcomplex(_r + f, _i); } inline DSPIcomplex operator- (const DSPIcomplex &a) const { return DSPIcomplex(_r - a.r(), _i - a.i()); } inline DSPIcomplex operator- (t_float f) const { return DSPIcomplex(_r - f, _i); } inline DSPIcomplex operator* (const DSPIcomplex &a) const { return DSPIcomplex(_r * a.r() - _i * a.i(), _i * a.r() + _r * a.i()); } inline DSPIcomplex operator* (t_float f) const { return DSPIcomplex(_r * f, _i * f); } inline DSPIcomplex operator/ (const DSPIcomplex &a) const { t_float n_t = 1.0f / a.norm2(); return DSPIcomplex(n_t * (_r * a.r() + _i * a.i()), n_t * (_i * a.r() - _r * a.i())); } inline DSPIcomplex operator/ (t_float f) const { t_float n_t = 1.0f / f; return DSPIcomplex(n_t * _r, n_t * _i); } inline friend std::ostream& operator<< (std::ostream& o, DSPIcomplex& a) { return o << "(" << a.r() << "," << a.i() << ")"; } inline friend DSPIcomplex operator+ (t_float f, DSPIcomplex& a) { return(DSPIcomplex(a.r() + f, a.i())); } inline friend DSPIcomplex operator- (t_float f, DSPIcomplex& a) { return(DSPIcomplex(f - a.r(), - a.i())); } inline friend DSPIcomplex operator/ (t_float f, DSPIcomplex& a) { return(DSPIcomplex(f,0) / a); } // ???? inline friend DSPIcomplex operator* (t_float f, DSPIcomplex& a) { return(DSPIcomplex(f*a.r(), f*a.i())); } inline DSPIcomplex& operator *= (t_float f) { _r *= f; _i *= f; return *this; } inline DSPIcomplex& operator /= (t_float f) { _r /= f; _i /= f; return *this; } inline DSPIcomplex& operator *= (DSPIcomplex& a) { t_float r_t = _r * a.r() - _i * a.i(); _i = _r * a.i() + _i * a.r(); _r = r_t; return *this; } inline DSPIcomplex& operator /= (DSPIcomplex& a) { t_float n_t = a.norm2(); t_float r_t = n_t * (_r * a.r() + _i * a.i()); _i = n_t * (_i * a.r() - _r * a.i()); _r = r_t; return *this; } t_float _r; t_float _i; }; // COMPLEX LOG inline DSPIcomplex dspilog(DSPIcomplex a) /* complex log */ { t_float r_t = log(a.norm()); t_float i_t = a.angle(); return DSPIcomplex(r_t, i_t); } // COMPLEX EXP inline DSPIcomplex dspiexp(DSPIcomplex a) /* complex exp */ { return (DSPIcomplex(a.i()) * exp(a.r())); } // BILINEAR TRANSFORM analog -> digital inline DSPIcomplex bilin_stoz(DSPIcomplex a) { DSPIcomplex a2 = a * 0.5; return((1.0 + a2)/(1.0 - a2)); } // BILINEAR TRANSFORM digital -> analog inline DSPIcomplex bilin_ztos(DSPIcomplex a) { return ((a - 1.0) / (a + 1.0))*2.0; } // not really a complex function but a nice complement to the bilinear routines inline t_float bilin_prewarp(t_float freq) { return 2.0 * tan(M_PI * freq); } #endif //DSPIcomplex_h pd-creb-0.10.0/modules++/DSPIfilters.h000066400000000000000000000363241434364737600172340ustar00rootroot00000000000000/* * DSPIfilters.h - Inline classes for biquad filters * Copyright (c) 2000 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef DSPIfilters_h #define DSPIfilters_h #include "DSPIcomplex.h" #include "DSPI.h" //#include /* orthogonal biquad */ class DSPIfilterOrtho { public: inline DSPIfilterOrtho(){resetState();resetCoef();resetSCoef();} inline ~DSPIfilterOrtho(){} inline void resetState(){d1A = d1B = d2A = d2B = 0.0;} inline void resetCoef(){ai = ar = c0 = c1 = c2 = 0.0;} inline void resetSCoef(){s_ai = s_ar = s_c0 = s_c1 = s_c2 = 0.0;} /* * Biquad filters remarks * * Q is defined with reference to the analog prototype: * poles/zeros = w0 * (1/Q +- sqrt(1 - 1/Q^2)) * * the num/den polynomial then has the form: * 1 + 2s/Qw0 + (s/w0)^2 * * if Q < 1 => real valued poles/zeros * if Q > 1 => complex values poles/zeros * if Q = inf => imaginary poles/zeros * if Q = sqrt(2) => 'maximally flat' poles/zeros * * the analog prototypes are converted to the digital domain * using the bilinear transform. hence the prewarping. */ // make sure freq and Q are positive and within bounds inline void checkBounds(t_float &freq, t_float &Q) { freq = fabs(freq); Q = fabs(Q); t_float epsilon = .0001; // stability guard t_float fmin = 0.0 + epsilon; t_float fmax = 0.5 - epsilon; t_float Qmin = 1.1; if (freq < fmin) freq = fmin; if (freq > fmax) freq = fmax; if (Q < Qmin) Q = Qmin; } inline void setAP(t_float freq, t_float Q) // allpass { // prototype: H(s) = (1 - 2s/Qw0 + (s/w0)^2) / (1 + 2s/Qw0 + (s/w0)^2) // s_p = - s_z (analog: symmetric wrt. im axis) // z_p = 1/z_z (digiatl: summ wrt. unit circle) checkBounds(freq, Q); // prewarp for bilin transfo freq = bilin_prewarp(freq); t_float zeta = 1.0/Q; DSPIcomplex p = bilin_stoz(DSPIcomplex(-zeta, (1.0-zeta*zeta))*freq); DSPIcomplex z = 1.0 / p; setPoleZeroNormalized(p, z, DSPIcomplex(1,0)); } inline void setLP(t_float freq, t_float Q) // low pass { // prototype: H(s) = 1 / (1 + 2s/Qw0 + (s/w0)^2) // the bilinear transform has 2 zeros at NY checkBounds(freq, Q); freq = bilin_prewarp(freq); t_float zeta = 1/Q; DSPIcomplex p = bilin_stoz(DSPIcomplex(-zeta, (1.0-zeta*zeta))*freq); setPoleZeroNormalized(p, DSPIcomplex(-1, 0), DSPIcomplex(1, 0)); } inline void setHP(t_float freq, t_float Q) // hi pass { // prototype: H(s) = (s/w0)^2 / (1 + 2s/Qw0 + (s/w0)^2) // the bilinear transform has 2 zeros at DC checkBounds(freq, Q); freq = bilin_prewarp(freq); t_float zeta = 1/Q; DSPIcomplex p = bilin_stoz(DSPIcomplex(-zeta, (1.0-zeta*zeta))*freq); setPoleZeroNormalized(p, DSPIcomplex(1, 0), DSPIcomplex(-1, 0)); } inline void setBP(t_float freq, t_float Q) // band pass (1-allpass) { // prototype: 1/2 * (1 - H_allpass(z)) setAP(freq, Q); t_float h = -0.5; c0 *= h; c1 *= h; c2 *= h; c0 -= h; } inline void setBR(t_float freq, t_float Q) // band reject { // prototype: H(s) = (1 - (s/w0)^2) / (1 + 2s/Qw0 + (s/w0)^2) checkBounds(freq, Q); // pole phasor DSPIcomplex z = DSPIcomplex(2.0 * M_PI * freq); // prewarp for bilin transfo freq = bilin_prewarp(freq); t_float zeta = 1/Q; DSPIcomplex p = bilin_stoz(DSPIcomplex(-zeta, (1.0-zeta*zeta))*freq); setPoleZeroNormalized(p, z, DSPIcomplex(1,0)); } inline void setHS(t_float freq, t_float gain) // low shelf { // hi shelf = LP - g(LP-1) t_float Q = M_SQRT2; setLP(freq, Q); c0 -= gain * (c0 - 1.0); c1 -= gain * (c1); c2 -= gain * (c2); } inline void setLS(t_float freq, t_float gain) // low shelf { // hi shelf = HP - g(HP-1) t_float Q = M_SQRT2; setHP(freq, Q); c0 -= gain * (c0 - 1.0); c1 -= gain * (c1); c2 -= gain * (c2); } inline void setEQ(t_float freq, t_float Q, t_float gain)// param EQ { // EQ = (1+A)/2 + (1-A)/2 AP t_float a0 = 0.5 * (1.0 + gain); t_float a1 = 0.5 * (1.0 - gain); setAP(freq, Q); c0 *= a1; c1 *= a1; c2 *= a1; c0 += a0; } inline void setPoleZero ( const DSPIcomplex& a, // pole const DSPIcomplex& b // zero ) { ar = a.r(); ai = a.i(); c0 = 1.0; c1 = 2.0 * (a.r() - b.r()); c2 = (a.norm2() - b.norm2() - c1 * a.r()) / a.i(); } inline void setPoleZeroNormalized ( const DSPIcomplex& a, // pole const DSPIcomplex& b, // zero const DSPIcomplex& c // gain = 1 at this freq ) { setPoleZero(a, b); DSPIcomplex invComplexGain = ((c-a)*(c-a.conj()))/((c-b)*(c-b.conj())); t_float invGain = invComplexGain.norm(); c0 *= invGain; c1 *= invGain; c2 *= invGain; } // one channel bang inline void Bang ( t_float &input, t_float &output ) { t_float d1t = ar * d1A + ai * d2A + input; t_float d2t = ar * d2A - ai * d1A; output = c0 * input + c1 * d1A + c2 * d2A; d1A = d1t; d2A = d2t; } // one channel bang smooth // a default s could be s = (1 - (.1)^(1/n)) inline void BangSmooth ( t_float &input, // input ref t_float &output, // output ref t_float s // smooth pole ) { t_float d1t = s_ar * d1A + s_ai * d2A + input; t_float d2t = s_ar * d2A - s_ai * d1A; s_ar += s * (ar - s_ar); s_ai += s * (ai - s_ai); output = s_c0 * input + s_c1 * d1A + s_c2 * d2A; d1A = d1t; d2A = d2t; s_c0 += s * (c0 - s_c0); s_c1 += s * (c1 - s_c1); s_c2 += s * (c2 - s_c2); } // two channel bang inline void Bang2 ( t_float &input1, t_float &input2, t_float &output1, t_float &output2 ) { t_float d1tA = ar * d1A + ai * d2A + input1; t_float d1tB = ar * d1B + ai * d2B + input2; t_float d2tA = ar * d2A - ai * d1A; t_float d2tB = ar * d2B - ai * d1B; output1 = c0 * input1 + d1A * c1 + d2A * c2; output2 = c0 * input2 + d1B * c1 + d2B * c2; d1A = d1tA; d2A = d2tA; d1B = d1tB; d2B = d2tB; } // two channel bang smooth inline void Bang2Smooth ( t_float &input1, t_float &input2, t_float &output1, t_float &output2, t_float s ) { t_float d1tA = s_ar * d1A + s_ai * d2A + input1; t_float d1tB = s_ar * d1B + s_ai * d2B + input2; t_float d2tA = s_ar * d2A - s_ai * d1A; t_float d2tB = s_ar * d2B - s_ai * d1B; s_ar += s * (ar - s_ar); s_ai += s * (ai - s_ai); output1 = s_c0 * input1 + d1A * s_c1 + d2A * s_c2; output2 = s_c0 * input2 + d1B * s_c1 + d2B * s_c2; d1A = d1tA; d2A = d2tA; d1B = d1tB; d2B = d2tB; s_c0 += s * (c0 - s_c0); s_c1 += s * (c1 - s_c1); s_c2 += s * (c2 - s_c2); } inline void killDenormals() { // state data t_float zero = 0.0; d1A = DSPI_IS_DENORMAL(d1A) ? zero : d1A; d2A = DSPI_IS_DENORMAL(d2A) ? zero : d2A; d1B = DSPI_IS_DENORMAL(d1B) ? zero : d1B; d2B = DSPI_IS_DENORMAL(d2B) ? zero : d2B; /* test on athlon showed nuking smooth data does not * present a noticable difference in performance however * nuking state data is really necessary // smooth data t_float dai = ai - s_ai; t_float dar = ar - s_ar; t_float dc0 = c0 - s_c0; t_float dc1 = c1 - s_c1; t_float dc2 = c2 - s_c2; s_ai = DSPI_IS_DENORMAL(dai) ? ai : s_ai; s_ar = DSPI_IS_DENORMAL(dar) ? ar : s_ar; s_c0 = DSPI_IS_DENORMAL(dc0) ? c0 : s_c0; s_c1 = DSPI_IS_DENORMAL(dc0) ? c1 : s_c1; s_c2 = DSPI_IS_DENORMAL(dc0) ? c2 : s_c2; */ } private: // state data t_float d1A; t_float d2A; t_float d1B; t_float d2B; // pole data t_float ai; t_float s_ai; t_float ar; t_float s_ar; // zero data t_float c0; t_float s_c0; t_float c1; t_float s_c1; t_float c2; t_float s_c2; }; class DSPIfilterSeries{ public: inline DSPIfilterSeries() {DSPIfilterSeries(1);} inline ~DSPIfilterSeries() {delete [] biquad;}; inline DSPIfilterSeries(int numberOfSections) { // create a set of biquads sections = numberOfSections; biquad = new DSPIfilterOrtho[numberOfSections]; } inline void setButterHP(t_float freq) { /* This member function computes the poles for a highpass butterworth filter. * The filter is transformed to the digital domain using a bilinear transform. * Every biquad section is normalized at NY. */ t_float epsilon = .0001; // stability guard t_float min = 0.0 + epsilon; t_float max = 0.5 - epsilon; if (freq < min) freq = min; if (freq > max) freq = max; // prewarp cutoff frequency t_float omega = bilin_prewarp(freq); DSPIcomplex NY(-1,0); //normalize at NY DSPIcomplex DC(1,0); //all zeros will be at DC DSPIcomplex pole( (2*sections + 1) * M_PI / (4*sections)); // first pole of lowpass filter with omega == 1 DSPIcomplex pole_inc(M_PI / (2*sections)); // phasor to get to next pole, see Porat p. 331 for (int i=0; i HP -> digital transfo DC, // all zeros at DC NY); // normalized (gain == 1) at NY pole *= pole_inc; // compe next (lowpass) pole } } inline void setButterLP(t_float freq) { /* This member function computes the poles for a lowpass butterworth filter. * The filter is transformed to the digital domain using a bilinear transform. * Every biquad section is normalized at DC. * Doing it this way, only the pole locations need to be transformed. * The constant gain factor can be computed by setting the DC gain of every section to 1. * An analog butterworth is all-pole, meaning the bilinear transform has all zeros at -1 */ t_float epsilon = .0001; // stability guard t_float min = 0.0 + epsilon; t_float max = 0.5 - epsilon; if (freq < min) freq = min; if (freq > max) freq = max; // prewarp cutoff frequency t_float omega = bilin_prewarp(freq); DSPIcomplex DC(1,0); //normalize at DC DSPIcomplex NY(-1,0); //all zeros will be at NY DSPIcomplex pole( (2*sections + 1) * M_PI / (4*sections)); pole *= omega; // first pole, see Porat p. 331 DSPIcomplex pole_inc(M_PI / (2*sections)); // phasor to get to next pole, see Porat p. 331 for (int i=0; i #include "DSPIcomplex.h" #include "DSPIfilters.h" typedef struct biquadseries_struct { t_object x_obj; t_float x_f; DSPIfilterSeries* biquadseries; } t_biquadseries; void biquadseries_bang(t_biquadseries *x) { } void biquadseries_butterLP(t_biquadseries *x, t_floatarg f) { x->biquadseries->setButterLP(f / sys_getsr()); } void biquadseries_butterHP(t_biquadseries *x, t_floatarg f) { x->biquadseries->setButterHP(f / sys_getsr()); } static t_int *biquadseries_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); DSPIfilterSeries* biquadseries = (DSPIfilterSeries *)(w[1]); t_int n = (t_int)(w[2]); t_int i; t_float x; // dit kan beter t_float smooth = .01; //1.0f - pow(.9f,1.0f/(float)(n)); for (i = 0; i < n; i++) { x = *in++; biquadseries->BangSmooth(x, x, smooth); *out++ = x; } return (w+5); } static void biquadseries_dsp(t_biquadseries *x, t_signal **sp) { dsp_add(biquadseries_perform, 4, x->biquadseries, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } void biquadseries_free(void) { } t_class *biquadseries_class; void *biquadseries_new(t_floatarg fsections) { t_biquadseries *x = (t_biquadseries *)pd_new(biquadseries_class); int sections = (int)fsections; if (sections < 1) sections = 1; // post("biquadseries~: %d sections", sections); x->biquadseries = new DSPIfilterSeries(sections); // inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("freq")); outlet_new(&x->x_obj, gensym("signal")); biquadseries_butterLP(x, 10000); return (void *)x; } extern "C" { void biquadseries_tilde_setup(void) { //post("biquadseries~ v0.1"); biquadseries_class = class_new(gensym("biquadseries~"), (t_newmethod)biquadseries_new, (t_method)biquadseries_free, sizeof(t_biquadseries), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(biquadseries_class, t_biquadseries, x_f); class_addmethod(biquadseries_class, (t_method)biquadseries_bang, gensym("bang"), (t_atomtype)0); class_addmethod(biquadseries_class, (t_method)biquadseries_dsp, gensym("dsp"), (t_atomtype)0); class_addmethod(biquadseries_class, (t_method)biquadseries_butterLP, gensym("butterLP"), A_FLOAT, A_NULL); class_addmethod(biquadseries_class, (t_method)biquadseries_butterHP, gensym("butterHP"), A_FLOAT, A_NULL); } } pd-creb-0.10.0/modules++/blosc~.cc000066400000000000000000000462651434364737600165470ustar00rootroot00000000000000/* * blosc.c - bandlimited oscillators * using minimum phase impulse, step & ramp * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #include "../modules/extlib_util.h" #include "DSPIcomplex.h" #include "DSPIfilters.h" #define LPHASOR (8*sizeof(u32)) // the phasor logsize #define VOICES 8 // the number of waveform voices #define LLENGTH 6 // the loglength of a fractional delayed basic waveform #define LOVERSAMPLE 6 // the log of the oversampling factor (nb of fract delayed waveforms) #define LPAD 1 // the log of the time padding factor (to reduce time aliasing) #define LTABLE (LLENGTH+LOVERSAMPLE) #define N (1< 1 = rect) #define CUTOFF 0.8 // fraction of nyquist for impulse cutoff #define NBPERIODS ((t_float)(L) * CUTOFF / 2.0) /* sample buffers */ static t_float bli[N]; // band limited impulse static t_float bls[N]; // band limited step static t_float blr[N]; // band limited ramp typedef struct bloscctl { t_int c_index[VOICES]; // array of indices in sample table t_float c_frac[VOICES]; // array of fractional indices t_float c_vscale[VOICES]; // array of scale factors t_int c_next_voice; // next voice to steal (round robin) u32 c_phase; // phase of main oscillator u32 c_phase2; // phase of secondairy oscillator t_float c_state; // state of the square wave t_float c_prev_amp; // previous input of comparator t_float c_phase_inc_scale; t_float c_scale; t_float c_scale_update; DSPIfilterSeries* c_butter; // the series filter t_symbol *c_waveform; } t_bloscctl; typedef struct blosc { t_object x_obj; t_float x_f; t_bloscctl x_ctl; } t_blosc; /* phase converters */ static inline t_float _phase_to_float(u32 p){return ((t_float)p) * (1.0 / 4294967296.0);} static inline u32 _float_to_phase(t_float f){return ((u32)(f * 4294967296.0)) & ~(S-1);} /* flat table: better for linear interpolation */ static inline t_float _play_voice_lint(t_float *table, t_int *index, t_float frac, t_float scale) { int i = *index; /* perform linear interpolation */ t_float f = (((1.0 - frac) * table[i]) + (table[i+1] * frac)) * scale; /* increment phase index if next 2 elements will still be inside table if not there's no increment and the voice will keep playing the same sample */ i += (((i+S+1) >> LTABLE) ^ 1) << LOVERSAMPLE; *index = i; return f; } /* get one sample from the bandlimited discontinuity wavetable playback syth */ static inline t_float _get_bandlimited_discontinuity(t_bloscctl *ctl, t_float *table) { t_float sum = 0.0; int i; /* sum all voices */ for (i=0; ic_index+i, ctl->c_frac[i], ctl->c_vscale[i]); } return sum; } /* update waveplayers on zero cross */ static void _bang_comparator(t_bloscctl *ctl, t_float prev, t_float curr) { /* check for sign change */ if ((prev * curr) < 0.0){ int voice; /* determine the location of the discontinuity (in oversampled coordiates using linear interpolation */ t_float f = (t_float)S * curr / (curr - prev); /* get the offset in the oversample table */ u32 table_index = (u32)f; /* determine the fractional part (in oversampled coordinates) for linear interpolation */ t_float table_frac_index = f - (t_float)table_index; /* set state (+ or -) */ ctl->c_state = (curr > 0.0) ? 0.5 : -0.5; /* steal the oldest voice */ voice = ctl->c_next_voice++; ctl->c_next_voice &= VOICES-1; /* initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; ctl->c_frac[voice] = table_frac_index; ctl->c_vscale[voice] = -ctl->c_scale * 2.0 * ctl->c_state; } } /* advance phasor and update waveplayers on phase wrap */ static void _bang_phasor(t_bloscctl *ctl, t_float freq) { u32 phase = ctl->c_phase; u32 phase_inc; u32 oldphase; int voice; t_float scale = ctl->c_scale; /* get increment */ t_float inc = freq * ctl->c_phase_inc_scale; /* calculate new phase the increment (and the phase) should be a multiple of S */ if (inc < 0.0) inc = -inc; phase_inc = ((u32)inc) & ~(S-1); oldphase = phase; phase += phase_inc; /* check for phase wrap */ if (phase < oldphase){ u32 phase_inc_decimated = phase_inc >> LOVERSAMPLE; u32 table_index; u32 table_phase; /* steal the oldest voice if we have a phase wrap */ voice = ctl->c_next_voice++; ctl->c_next_voice &= VOICES-1; /* determine the location of the discontinuity (in oversampled coordinates) which is S * (new phase) / (increment) */ table_index = phase / phase_inc_decimated; /* determine the fractional part (in oversampled coordinates) for linear interpolation */ table_phase = phase - (table_index * phase_inc_decimated); /* use it to initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; ctl->c_frac[voice] = (t_float)table_phase / (t_float)phase_inc_decimated; ctl->c_vscale[voice] = scale; scale = scale * ctl->c_scale_update; } /* save state */ ctl->c_phase = phase; ctl->c_scale = scale; } /* the 2 oscillator version: the second osc can reset the first osc's phase (hence it determines the pitch) the first osc determines the waveform */ static void _bang_hardsync_phasor(t_bloscctl *ctl, t_float freq, t_float freq2) { u32 phase = ctl->c_phase; u32 phase2 = ctl->c_phase2; u32 phase_inc; u32 phase_inc2; u32 oldphase; u32 oldphase2; int voice; t_float scale = ctl->c_scale; /* get increment */ t_float inc = freq * ctl->c_phase_inc_scale; t_float inc2 = freq2 * ctl->c_phase_inc_scale; /* calculate new phases the increment (and the phase) should be a multiple of S */ /* save previous phases */ oldphase = phase; oldphase2 = phase2; /* update second osc */ if (inc2 < 0.0) inc2 = -inc2; phase_inc2 = ((u32)inc2) & ~(S-1); phase2 += phase_inc2; /* update first osc (freq should be >= freq of sync osc */ if (inc < 0.0) inc = -inc; phase_inc = ((u32)inc) & ~(S-1); if (phase_inc < phase_inc2) phase_inc = phase_inc2; phase += phase_inc; /* check for sync discontinuity (osc 2) */ if (phase2 < oldphase2) { /* adjust phase depending on the location of the discontinuity in phase2: phase/phase_inc == phase2/phase_inc2 */ u64 pi = phase_inc >> LOVERSAMPLE; u64 pi2 = phase_inc2 >> LOVERSAMPLE; u64 lphase = ((u64)phase2 * pi) / pi2; phase = lphase & ~(S-1); } /* check for phase discontinuity (osc 1) */ if (phase < oldphase){ u32 phase_inc_decimated = phase_inc >> LOVERSAMPLE; u32 table_index; u32 table_phase; t_float stepsize; /* steal the oldest voice if we have a phase wrap */ voice = ctl->c_next_voice++; ctl->c_next_voice &= VOICES-1; /* determine the location of the discontinuity (in oversampled coordinates) which is S * (new phase) / (increment) */ table_index = phase / phase_inc_decimated; /* determine the fractional part (in oversampled coordinates) for linear interpolation */ table_phase = phase - (table_index * phase_inc_decimated); /* determine the step size as opposed to saw/impulse waveforms, the step is not always equal to one. it is: oldphase - phase + phase_inc but for the unit step this will overflow to zero, so we reduce the bit depth to prevent overflow */ stepsize = _phase_to_float(((oldphase-phase) >> LOVERSAMPLE) + phase_inc_decimated) * (t_float)S; /* use it to initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; ctl->c_frac[voice] = (t_float)table_phase / (t_float)phase_inc_decimated; ctl->c_vscale[voice] = scale * stepsize; scale = scale * ctl->c_scale_update; } /* save state */ ctl->c_phase = phase; ctl->c_phase2 = phase2; ctl->c_scale = scale; } static t_int *blosc_perform_hardsync_saw(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *freq2 = (t_float *)(w[4]); t_float *out = (t_float *)(w[5]); t_bloscctl *ctl = (t_bloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; /* set postfilter cutoff */ ctl->c_butter->setButterHP(0.85 * (*freq / sys_getsr())); while (n--) { t_float frequency = *freq++; t_float frequency2 = *freq2++; /* get the bandlimited discontinuity */ t_float sample = _get_bandlimited_discontinuity(ctl, bls); /* add aliased sawtooth wave */ sample += _phase_to_float(ctl->c_phase) - 0.5; /* highpass filter output to remove DC offset and low frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05); /* send to output */ *out++ = sample; /* advance phasor */ _bang_hardsync_phasor(ctl, frequency2, frequency); } return (w+6); } static t_int *blosc_perform_saw(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_bloscctl *ctl = (t_bloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; while (n--) { t_float frequency = *freq++; /* get the bandlimited discontinuity */ t_float sample = _get_bandlimited_discontinuity(ctl, bls); /* add aliased sawtooth wave */ sample += _phase_to_float(ctl->c_phase) - 0.5; /* send to output */ *out++ = sample; /* advance phasor */ _bang_phasor(ctl, frequency); } return (w+5); } static t_int *blosc_perform_pulse(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_bloscctl *ctl = (t_bloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; /* set postfilter cutoff */ ctl->c_butter->setButterHP(0.85 * (*freq / sys_getsr())); while (n--) { t_float frequency = *freq++; /* get the bandlimited discontinuity */ t_float sample = _get_bandlimited_discontinuity(ctl, bli); /* highpass filter output to remove DC offset and low frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05); /* send to output */ *out++ = sample; /* advance phasor */ _bang_phasor(ctl, frequency); } return (w+5); } static t_int *blosc_perform_comparator(t_int *w) { t_float *amp = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_bloscctl *ctl = (t_bloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; t_float prev_amp = ctl->c_prev_amp; while (n--) { t_float curr_amp = *amp++; /* exact zero won't work for zero detection (sic) */ if (curr_amp == 0.0) curr_amp = 0.0000001; /* get the bandlimited discontinuity */ t_float sample = _get_bandlimited_discontinuity(ctl, bls); /* add the block wave state */ sample += ctl->c_state; /* send to output */ *out++ = sample; /* advance phasor */ _bang_comparator(ctl, prev_amp, curr_amp); prev_amp = curr_amp; } ctl->c_prev_amp = prev_amp; return (w+5); } static void blosc_phase(t_blosc *x, t_float f) { x->x_ctl.c_phase = _float_to_phase(f); x->x_ctl.c_phase2 = _float_to_phase(f); } static void blosc_phase1(t_blosc *x, t_float f) { x->x_ctl.c_phase = _float_to_phase(f); } static void blosc_phase2(t_blosc *x, t_float f) { x->x_ctl.c_phase2 = _float_to_phase(f); } static void blosc_dsp(t_blosc *x, t_signal **sp) { int n = sp[0]->s_n; /* set sampling rate scaling for phasors */ x->x_ctl.c_phase_inc_scale = 4.0 * ((t_float)(1<<(LPHASOR-2))) / sys_getsr(); /* setup & register the correct process routine depending on the waveform */ /* 2 osc */ if (x->x_ctl.c_waveform == gensym("syncsaw")){ x->x_ctl.c_scale = 1.0; x->x_ctl.c_scale_update = 1.0; dsp_add(blosc_perform_hardsync_saw, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec); } /* 1 osc */ else if (x->x_ctl.c_waveform == gensym("pulse")){ x->x_ctl.c_scale = 1.0; x->x_ctl.c_scale_update = 1.0; dsp_add(blosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("pulse2")){ x->x_ctl.c_phase_inc_scale *= 2; x->x_ctl.c_scale = 1.0; x->x_ctl.c_scale_update = -1.0; dsp_add(blosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("comparator")){ x->x_ctl.c_scale = 1.0; x->x_ctl.c_scale_update = 1.0; dsp_add(blosc_perform_comparator, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else{ x->x_ctl.c_scale = 1.0; x->x_ctl.c_scale_update = 1.0; dsp_add(blosc_perform_saw, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } } static void blosc_free(t_blosc *x) { delete x->x_ctl.c_butter; } t_class *blosc_class; static void *blosc_new(t_symbol *s) { t_blosc *x = (t_blosc *)pd_new(blosc_class); int i; /* out 1 */ outlet_new(&x->x_obj, gensym("signal")); /* optional signal inlets */ if (s == gensym("syncsaw")){ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); } /* optional phase inlet */ if (s != gensym("comparator")){ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("phase")); } /* create the postfilter */ x->x_ctl.c_butter = new DSPIfilterSeries(3); /* init oscillators */ for (i=0; ix_ctl.c_index[i] = N-2; x->x_ctl.c_frac[i] = 0.0; } /* init rest of state data */ blosc_phase(x, 0); blosc_phase2(x, 0); x->x_ctl.c_state = 0.0; x->x_ctl.c_prev_amp = 0.0; x->x_ctl.c_next_voice = 0; x->x_ctl.c_scale = 1.0; x->x_ctl.c_scale_update = 1.0; x->x_ctl.c_waveform = s; return (void *)x; } /* CLASS DATA INIT (tables) */ /* some vector ops */ /* clear a buffer */ static inline void _clear(t_float *array, int size) { memset(array, 0, sizeof(t_float)*size); } /* compute complex log */ static inline void _clog(t_float *real, t_float *imag, int size) { int k; for (k=0; k pi, -pi -> 0] */ static inline t_float _i2theta(int i, int size){ t_float p = 2.0 * M_PI * (t_float)i / (t_float)size; if (p >= M_PI) p -= 2.0 * M_PI; return p; } /* print matlab array */ static void _printm(t_float *array, char *name, int size) { int i; fprintf(stderr, "%s = [", name); for (i=0; i=N (time padding to reduce time aliasing) */ /* we work in the complex domain to eliminate the need to avoid negative spectral components */ t_float real[M]; t_float imag[M]; t_float sum,scale; int i,j; /* create windowed sinc */ _clear(imag, M); real[0] = 1.0; for (i=1; iM-1] and work with the first N samples */ /* normalize impulse (integral = 1) */ sum = 0.0; for (i=0; i0 */ sum = 0.0; for (i=0; i #include "DSPIcomplex.h" #include "DSPIfilters.h" typedef struct filterortho_struct { t_object x_obj; t_float x_f; DSPIfilterOrtho *filterortho; } t_filterortho; void filterortho_bang(t_filterortho *x) { } static t_int *filterortho_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); DSPIfilterOrtho* filterortho = (DSPIfilterOrtho *)(w[1]); t_int n = (t_int)(w[2]); t_int i; t_float x; // dit kan beter t_float smooth = 1.0 - pow(.05,1.0/(t_float)(n)); for (i = 0; i < n; i++) { x = *in++; filterortho->BangSmooth(x, x, smooth); *out++ = x; } filterortho->killDenormals(); return (w+5); } static void filterortho_dsp(t_filterortho *x, t_signal **sp) { dsp_add(filterortho_perform, 4, x->filterortho, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } void filterortho_free(t_filterortho *x) { delete x->filterortho; } t_class *filterortho_class; void setLP(t_filterortho *x, t_floatarg f, t_floatarg Q) {x->filterortho->setLP(f / sys_getsr(), Q);} void setHP(t_filterortho *x, t_floatarg f, t_floatarg Q) {x->filterortho->setHP(f / sys_getsr(), Q);} void setBP(t_filterortho *x, t_floatarg f, t_floatarg Q) {x->filterortho->setBP(f / sys_getsr(), Q);} void setBR(t_filterortho *x, t_floatarg f, t_floatarg Q) {x->filterortho->setBR(f / sys_getsr(), Q);} void setAP(t_filterortho *x, t_floatarg f, t_floatarg Q) {x->filterortho->setAP(f / sys_getsr(), Q);} void setLS(t_filterortho *x, t_floatarg f, t_floatarg A) {x->filterortho->setLS(f / sys_getsr(), A);} void setHS(t_filterortho *x, t_floatarg f, t_floatarg A) {x->filterortho->setHS(f / sys_getsr(), A);} void setEQ(t_filterortho *x, t_floatarg f, t_floatarg Q, t_floatarg A) {x->filterortho->setEQ(f / sys_getsr(), Q, A);} void *filterortho_new() { t_filterortho *x = (t_filterortho *)pd_new(filterortho_class); x->filterortho = new DSPIfilterOrtho(); outlet_new(&x->x_obj, gensym("signal")); setLP(x, 10000, 2); return (void *)x; } extern "C" { void filterortho_tilde_setup(void) { //post("filterortho~ v0.1"); filterortho_class = class_new(gensym("filterortho~"), (t_newmethod)filterortho_new, (t_method)filterortho_free, sizeof(t_filterortho), 0, A_NULL); CLASS_MAINSIGNALIN(filterortho_class, t_filterortho, x_f); class_addmethod(filterortho_class, (t_method)filterortho_bang, gensym("bang"), A_NULL); class_addmethod(filterortho_class, (t_method)filterortho_dsp, gensym("dsp"), A_NULL); class_addmethod(filterortho_class, (t_method)setLP, gensym("setLP"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setHP, gensym("setHP"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setBP, gensym("setBP"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setBR, gensym("setBR"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setAP, gensym("setAP"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setLS, gensym("setLS"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setHS, gensym("setHS"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(filterortho_class, (t_method)setEQ, gensym("setEQ"), A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); } } pd-creb-0.10.0/modules++/filters.h000066400000000000000000000110101434364737600165350ustar00rootroot00000000000000/* this file contains a 37th attempt to write a general purpose iir filter toolset */ /* defined as inline functions with call by reference to enable compiler ref/deref optim */ /* the typedef */ #ifndef T #define T t_float #endif /* the prototype for a word */ #define P static inline void #define PP static void /* the 'reference' arguments */ #define A *a #define B *b #define C *c #define D *d #define X *x #define Y *y #define S *s /* the opcodes */ /* add */ P cadd (T X, T Y, T A, T B, T C, T D) { X = A + C; Y = B + D;} P cadd2 (T A, T B, T C, T D) { A += C; B += D;} P vcadd (T X, T A, T C) { cadd(x,x+1,a,a+1,c,c+1); } P vcadd2 (T A, T C) { cadd2(a,a+1,c,c+1); } /* mul */ P cmul_r (T X, T A, T B, T C, T D) { X = A * C - B * D;} P cmul_i (T Y, T A, T B, T C, T D) { Y = A * D + B * C;} P cmul (T X, T Y, T A, T B, T C, T D) { cmul_r (x, a, b, c, d); cmul_i (y, a, b, c, d); } P cmul2 (T A, T B, T C, T D) { T x = A; T y = B; cmul (&x, &y, a, b, c, d); A = x; B = y; } P vcmul (T X, T A, T C) { cmul(x,x+1,a,a+1,c,c+1); } P vcmul2 (T A, T C) { cmul2(a,a+1,c,c+1); } /* norm */ static inline t_float vcnorm(T X) { return hypot(x[0], x[1]); } /* swap */ P vcswap(T Y, T X) { t_float t[2] = {x[0], x[1]}; x[0] = y[0]; x[1] = y[1]; y[0] = t[0]; y[1] = t[1]; } /* inverse */ P vcinv(T Y, T X) { t_float scale = 1.0 / vcnorm(x); y[0] = scale * x[0]; y[1] = scale * x[1]; } P vcinv1(T X) { t_float scale = 1.0 / vcnorm(x); x[0] *= scale; x[1] *= scale; } /* exp */ /* X = exp(Y) */ P vcexp2 (T Y, T X) { T r = exp(x[0]); y[0] = cos (x[1]); y[1] = sin (x[1]); y[0] *= r; y[1] *= r; } P vcexp1 (T X) { T y[2]; vcexp2(y,x); x[0] = y[0]; x[1] = y[1]; } /* FILTERS the transfer function is defined in terms of the "engineering" bilateral z-transform of the discrete impulse response h[n]. H(z) = Sum{n = -inf -> inf} h[n] z^(-n) a unit delay operating on a singnal S(z) is therefore represented as z^(-1) S(z) */ /* biquads */ /* biquad, orthogonal (poles & zeros), real in, out, state, pole, output */ P biq_orth_r (T X, T Y, T S, T A, T C) { Y = X + c[0] * s[0] - c[1] * s[1]; /* mind sign of c[1] */ vcmul2(s, a); S += X; } /* biquad, orthogonal, complex one-pole, with scaling */ /* complex one pole: (output = s[0] + is[1]): C / (1-A z^(-1)) */ P one_pole_complex (T X, T Y, T S, T A, T C) { vcmul(y, s, a); vcadd2(y, x); s[0] = y[0]; s[1] = y[1]; vcmul(y, s, c); } /* complex conj two pole: (output = s[0] : (Re(C) - Re(C*Conj(A))) / (1 - A z^(-1)) (1 - Conj(A) z^(-1)) */ P two_pole_complex_conj (T X, T Y, T S, T A, T C) { vcmul2(s, a); s[0] += x[0]; y[0] = s[0] * c[0] - s[1] * c[1]; } /* support functions for IIR filter design */ /* evaluate pole and allzero TF in z^-1 given the complex zeros/poles: p(z) (or p(z)^-1) = \product (1-z_i z^-1) */ PP eval_zero_poly(t_float *val, t_float *arg, t_float *zeros, int nb_zeros) { int i; t_float a[2] = {arg[0], arg[1]}; vcinv1(a); val[0] = 1.0; val[1] = 0.0; a[0] *= -1; a[1] *= -1; for (i=0; i /* ------------------------- abs~ -------------------------- */ static t_class *abs_class; typedef struct _abs { t_object x_obj; } t_abs; static t_int *abs_perform(t_int *w) { t_abs *x = (t_abs *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { t_sample f = *in++; if (f < 0) f = -f; *out++ = f; } return (w+5); } static void abs_dsp(t_abs *x, t_signal **sp) { dsp_add(abs_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void *abs_new(void) { t_abs *x = (t_abs *)pd_new(abs_class); outlet_new(&x->x_obj, &s_signal); return (x); } void abs_tilde_setup(void) { abs_class = class_new(gensym("abs~"), (t_newmethod)abs_new, 0, sizeof(t_abs), 0, A_NULL); class_addmethod(abs_class, (t_method)nullfn, &s_signal, A_NULL); class_addmethod(abs_class, (t_method)abs_dsp, gensym("dsp"), A_NULL); } #endif pd-creb-0.10.0/modules/bdiag~.c000066400000000000000000000135521434364737600162130ustar00rootroot00000000000000/* * bdiag.c - block diagonal state space system * treats input dsp block as n parallel signals * * s1 = (a * s1) + (b * s2) + u1; * s2 = (a * s2) - (b * s1) + u2; * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" #include #include #define MAXORDER 64 typedef struct bdiagctl { t_float *c_state; t_float *c_eigen; t_int c_order; } t_bdiagctl; typedef struct bdiag { t_object x_obj; t_float x_f; t_bdiagctl x_ctl; } t_bdiag; static t_float randfloat(void){ t_float r = rand (); r /= (RAND_MAX/2); r -= 1; return r; } static void bdiag_random(t_bdiag *x) { int i; for (i=0; ix_ctl.c_order; i++) { x->x_ctl.c_state[i] = randfloat(); } } static void bdiag_reset(t_bdiag *x) { int i; for (i=0; ix_ctl.c_order; i++) { x->x_ctl.c_state[i] = 0; } } static void bdiag_eigen(t_bdiag *x, t_floatarg index, t_floatarg aval, t_floatarg bval) { int i = (int)index; if (i<0) return; if (i>=x->x_ctl.c_order/2) return; x->x_ctl.c_eigen[2*i+0] = aval; x->x_ctl.c_eigen[2*i+1] = bval; } /* set decay time and frequency of pole at index */ static void bdiag_timefreq(t_bdiag *x, t_floatarg index, t_floatarg time, t_floatarg freq) { t_float r,a,b,n; t_float sr = sys_getsr() / (t_float)x->x_ctl.c_order; /* time in ms */ time *= 0.001; if (time < 0.0) time = 0.0; r = pow(0.001, 1.0 / (time * sr)); if (r < 0.0) r = 0.0; if (r > 1.0) r = 1.0; a = cos(2*M_PI*freq/sr); b = sin(2*M_PI*freq/sr); /* normalize to be sure */ n = 1.0 / sqrt(a*a + b*b); a *= n; b *= n; bdiag_eigen(x, index, r*a, r*b); } static void bdiag_preset(t_bdiag *x, t_floatarg preset) { int p = preset; int i; t_float a, b, w, r; switch(p){ case 0: post("preset 0"); for (i=0; ix_ctl.c_order/2; i++){ w = randfloat() * .001; r = 1. - (((t_float)i + 1.)/1000.); a = cos(w) * r; b = sin(w) * r; post("%f %f %f %f", w, r, a, b); bdiag_eigen(x,i,a,b); } break; case 1: default: break; } } static t_int *bdiag_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_bdiagctl *ctl = (t_bdiagctl *)(w[1]); t_float *eigen = ctl->c_eigen; t_float *state = ctl->c_state; t_int n = (t_int)(w[2]); t_float u1,u2,a,b,s1,s2,s1new,s2new; int i; for (i=0; is_n; int i; if (n == 1) { post("bdiag: doesnt work with blocksize == 1"); dsp_add_copy(sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } else { if (x->x_ctl.c_order != n) { if (x->x_ctl.c_state) free(x->x_ctl.c_state); if (x->x_ctl.c_eigen) free(x->x_ctl.c_eigen); x->x_ctl.c_state = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_eigen = (t_float *)malloc(n*sizeof(t_float)); for(i=0;ix_ctl.c_state[i] = 0; x->x_ctl.c_eigen[i] = 0; } x->x_ctl.c_order = n; } dsp_add(bdiag_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } } static void bdiag_free(t_bdiag *x) { if (x->x_ctl.c_state) free(x->x_ctl.c_state); if (x->x_ctl.c_eigen) free(x->x_ctl.c_eigen); } t_class *bdiag_class; static void *bdiag_new(t_floatarg permute) { t_bdiag *x = (t_bdiag *)pd_new(bdiag_class); int i, n=64; outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_state = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_eigen = (t_float *)malloc(n*sizeof(t_float)); for(i=0;ix_ctl.c_state[i] = 0; x->x_ctl.c_eigen[i] = 0; } x->x_ctl.c_order = n; return (void *)x; } void bdiag_tilde_setup(void) { //post("bdiag~ v0.1"); bdiag_class = class_new(gensym("bdiag~"), (t_newmethod)bdiag_new, (t_method)bdiag_free, sizeof(t_bdiag), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(bdiag_class, t_bdiag, x_f); class_addmethod(bdiag_class, (t_method)bdiag_random, gensym("random"), 0); class_addmethod(bdiag_class, (t_method)bdiag_random, gensym("bang"), 0); class_addmethod(bdiag_class, (t_method)bdiag_reset, gensym("reset"), 0); class_addmethod(bdiag_class, (t_method)bdiag_dsp, gensym("dsp"), 0); class_addmethod(bdiag_class, (t_method)bdiag_eigen, gensym("eigen"), A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(bdiag_class, (t_method)bdiag_timefreq, gensym("timefreq"), A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(bdiag_class, (t_method)bdiag_preset, gensym("preset"), A_DEFFLOAT, 0); } pd-creb-0.10.0/modules/bfft~.c000066400000000000000000000073121434364737600160630ustar00rootroot00000000000000/* * bfft.c - Code for some fourrier transform variants and utility * functions. Data organization is in (real, imag) pairs the first 2 * components are (DC, NY) * * Copyright (c) 2000-2003 by Tom Schouten * * Restructured code to separate objects and library blob mode * Fred Jan Kraan, 2020-01-12 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #define MAXORDER 64 typedef struct bfftctl { t_int c_levels; char c_name[16]; t_int *c_clutter; t_int *c_unclutter; t_int c_kill_DC; t_int c_kill_NY; } t_bfftctl; typedef struct bfft { t_object x_obj; t_float x_f; t_bfftctl x_ctl; } t_bfft; t_class *bfft_class, *ibfft_class, *fht_class; static inline void bfft_perform_permutation(t_float *S, int n, t_int *f) { t_int k,l; t_float swap; for(k=0; kx_ctl; int i; if (ctl->c_clutter) free(ctl->c_clutter); if (ctl->c_unclutter) free(ctl->c_unclutter); ctl->c_clutter = (t_int *)malloc(n*sizeof(t_int)); ctl->c_unclutter = (t_int *)malloc(n*sizeof(t_int)); ctl->c_unclutter[0] = 0; ctl->c_unclutter[1] = n/2; for (i=1; ic_unclutter[2*i] = i; ctl->c_unclutter[2*i+1] = n-i; } for(i=0; ic_clutter[ctl->c_unclutter[i]] = i; return; /* debug */ /* for(k=0; kc_clutter[k]); ** for(k=0; kc_unclutter[k]); ** ** exit(1); */ } static t_int *bfft_perform(t_int *w) { // t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_bfftctl *ctl = (t_bfftctl *)(w[1]); t_int n = (t_int)(w[2]); t_float scale = sqrt(1.0f / (t_float)(n)); mayer_fht(out, n); bfft_perform_permutation(out, n, ctl->c_unclutter); while (n--) *out++ *= scale; return (w+5); } static void bfft_dsp(t_bfft *x, t_signal **sp) { int n = sp[0]->s_n; t_float *in = sp[0]->s_vec; t_float *out = sp[1]->s_vec; bfft_permutation(x, n); if (in != out) { dsp_add_copy(in, out, n); in = out; } dsp_add(bfft_perform, 4, &x->x_ctl, n, in, out); } static void bfft_free(t_bfft *x) { if (x->x_ctl.c_clutter) free(x->x_ctl.c_clutter); if (x->x_ctl.c_unclutter) free(x->x_ctl.c_unclutter); } static void *bfft_new(void) { t_bfft *x = (t_bfft *)pd_new(bfft_class); outlet_new(&x->x_obj, gensym("signal")); sprintf(x->x_ctl.c_name,"bfft"); x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; return (void *)x; } void bfft_tilde_setup(void) { //post("bfft~ v0.1"); bfft_class = class_new(gensym("bfft~"), (t_newmethod)bfft_new, (t_method)bfft_free, sizeof(t_bfft), 0, 0); CLASS_MAINSIGNALIN(bfft_class, t_bfft, x_f); class_addmethod(bfft_class, (t_method)bfft_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/bitsplit~.c000066400000000000000000000052301434364737600167710ustar00rootroot00000000000000/* * bitsplit.c - Convert a signal to a binary vector. * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #define MAXCHANNELS 24 typedef struct bitsplitctl { t_int c_outputs; t_float *c_input; t_float **c_output; } t_bitsplitctl; typedef struct bitsplit { t_object x_obj; t_float x_f; t_bitsplitctl x_ctl; } t_bitsplit; static t_int *bitsplit_perform(t_int *word) { t_bitsplitctl *ctl = (t_bitsplitctl *)(word[1]); t_int n = (t_int)(word[2]); t_float *in = ctl->c_input; t_int outputs = ctl->c_outputs; t_float **out = ctl->c_output; t_int i,j; for (i=0;i> 31) & 1); word <<= 1; } } return (word+3); } static void bitsplit_dsp(t_bitsplit *x, t_signal **sp) { int i; x->x_ctl.c_input = sp[0]->s_vec; for (i=0;ix_ctl.c_outputs;i++){ x->x_ctl.c_output[i] = sp[i+1]->s_vec; } dsp_add(bitsplit_perform, 2, &x->x_ctl, sp[0]->s_n); } static void bitsplit_free(t_bitsplit *x) { free (x->x_ctl.c_output); } t_class *bitsplit_class; static void *bitsplit_new(t_floatarg channels) { int i = (int)channels; t_bitsplit *x = (t_bitsplit *)pd_new(bitsplit_class); if (i<1) i = 1; if (i>MAXCHANNELS) i = MAXCHANNELS; x->x_ctl.c_outputs = i; x->x_ctl.c_output = malloc(sizeof(t_float)*i); while (i--) outlet_new(&x->x_obj, gensym("signal")); return (void *)x; } void bitsplit_tilde_setup(void) { bitsplit_class = class_new(gensym("bitsplit~"), (t_newmethod)bitsplit_new, (t_method)bitsplit_free, sizeof(t_bitsplit), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(bitsplit_class, t_bitsplit, x_f); class_addmethod(bitsplit_class, (t_method)bitsplit_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/blocknorm~.c000066400000000000000000000062241434364737600171310ustar00rootroot00000000000000/* * blocknorm.c - Normalize an array of dsp blocks. (spectral * processing primitive) * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #define MAXCHANNELS 32 typedef struct blocknormctl { t_int c_channels; t_float **c_input; t_float **c_output; } t_blocknormctl; typedef struct blocknorm { t_object x_obj; t_float x_f; t_blocknormctl x_ctl; } t_blocknorm; static t_int *blocknorm_perform(t_int *word) { t_blocknormctl *ctl = (t_blocknormctl *)(word[1]); t_int n = (t_int)(word[2]); t_float **in = ctl->c_input; t_float **out = ctl->c_output; t_int c = ctl->c_channels; t_int i,j; t_float p = 0.0f; t_float x, s; /* get power */ for (j=0;jx_ctl.c_channels; for (i=0;ix_ctl.c_input[i] = sp[i]->s_vec; x->x_ctl.c_output[i] = sp[c+i]->s_vec; } dsp_add(blocknorm_perform, 2, &x->x_ctl, sp[0]->s_n); } static void blocknorm_free(t_blocknorm *x) { free (x->x_ctl.c_output); free (x->x_ctl.c_input); } t_class *blocknorm_class; static void *blocknorm_new(t_floatarg channels) { int i = (int)channels; int j; t_blocknorm *x = (t_blocknorm *)pd_new(blocknorm_class); if (i<1) i = 1; if (i>MAXCHANNELS) i = MAXCHANNELS; x->x_ctl.c_channels = i; x->x_ctl.c_input = malloc(sizeof(t_float)*i); x->x_ctl.c_output = malloc(sizeof(t_float)*i); j = i; while (--j) inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); while (i--) outlet_new(&x->x_obj, gensym("signal")); return (void *)x; } void blocknorm_tilde_setup(void) { blocknorm_class = class_new(gensym("blocknorm~"), (t_newmethod)blocknorm_new, (t_method)blocknorm_free, sizeof(t_blocknorm), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(blocknorm_class, t_blocknorm, x_f); class_addmethod(blocknorm_class, (t_method)blocknorm_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/blockramp~.c000066400000000000000000000032151434364737600171120ustar00rootroot00000000000000/* * blockramp.c - retriggerable counter for dsp signals * Copyright (c) 2000-2003 by Tom Schouten * * Restructuring for independent objects and library blob mode by * Fred Jan Kraan 2020-01-12 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include "ramp-common.h" t_class *blockramp_class; void *blockramp_new(void) { t_ramp *x = (t_ramp *)pd_new(blockramp_class); outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_blockscale = 0; ramp_bang(x); x->x_ctl.c_blockscale = 1; return (void *)x; } void blockramp_tilde_setup(void) { //post("blockramp~ v0.1"); blockramp_class = class_new(gensym("blockramp~"), (t_newmethod)blockramp_new, (t_method)ramp_free, sizeof(t_ramp), 0, 0); class_addmethod(blockramp_class, (t_method)ramp_bang, gensym("bang"), 0); class_addmethod(blockramp_class, (t_method)ramp_dsp, gensym("dsp"), 0); class_addfloat(blockramp_class, (t_method)ramp_offset); } pd-creb-0.10.0/modules/bmatrix~.c000066400000000000000000000073241434364737600166130ustar00rootroot00000000000000/* * matrix.c - applies a matrix transform to a signal block * intended for spectral processing, dynwav * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include /* support older Pd versions without sys_open(), sys_fopen(), sys_fclose() */ #if PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 44 #define sys_open open #define sys_fopen fopen #define sys_fclose fclose #endif #define MAXORDER 1024 typedef struct matrixctl { t_float *c_A; /* matrix */ t_float *c_x; /* vector */ t_int c_order; } t_matrixctl; typedef struct matrix { t_object x_obj; t_float x_f; t_matrixctl x_ctl; } t_matrix; static void matrix_load(t_matrix *x, t_symbol *s) { FILE *matrix; if(s && s->s_name) { post("matrix: loading %s",s->s_name); if(matrix = sys_fopen(s->s_name, "r")) { int n = x->x_ctl.c_order; fread(x->x_ctl.c_A, sizeof(t_float), n*n, matrix); } else post("matrix: error, cant open file."); } } static t_int *matrix_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_matrixctl *ctl = (t_matrixctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i,j; t_float *A = ctl->c_A; t_float *x = ctl->c_x; if (in == out) /* store input if ness. */ { memcpy(x, in, sizeof(t_float)*n); in = x; } bzero(out, sizeof(t_float)*n); /* init output */ for (j=0; js_n; int k,i; if (x->x_ctl.c_order != n) { if (x->x_ctl.c_A) free (x->x_ctl.c_A); x->x_ctl.c_A = (t_float *)calloc(n*n,sizeof(t_float)); x->x_ctl.c_x = (t_float *)calloc(n,sizeof(t_float)); x->x_ctl.c_order = n; } for (i=0;ix_ctl.c_A[i] = 1; dsp_add(matrix_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void matrix_free(t_matrix *x) { if (x->x_ctl.c_A) free (x->x_ctl.c_A); if (x->x_ctl.c_x) free (x->x_ctl.c_x); } t_class *matrix_class; static void *matrix_new(t_floatarg order) { t_matrix *x = (t_matrix *)pd_new(matrix_class); int iorder = (int)order; int i, n=64, k; /* out 1 */ outlet_new(&x->x_obj, gensym("signal")); /* init data */ x->x_ctl.c_A = (t_float *)calloc(n*n,sizeof(t_float)); x->x_ctl.c_x = (t_float *)calloc(n,sizeof(t_float)); for (i=0;ix_ctl.c_A[i] = 1; x->x_ctl.c_order = n; return (void *)x; } void bmatrix_tilde_setup(void) { //post("matrix~ v0.1"); matrix_class = class_new(gensym("bmatrix~"), (t_newmethod)matrix_new, (t_method)matrix_free, sizeof(t_matrix), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(matrix_class, t_matrix, x_f); class_addmethod(matrix_class, (t_method)matrix_dsp, gensym("dsp"), 0); class_addmethod(matrix_class, (t_method)matrix_load, gensym("load"), A_SYMBOL,0); } pd-creb-0.10.0/modules/bwin~.c000066400000000000000000000103311434364737600160740ustar00rootroot00000000000000/* * window.c - window generation abstraction * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include static t_class *window_class; typedef struct _window { t_object x_obj; t_float x_f; t_float *x_window; t_int x_size; t_symbol *x_type; t_float x_typearg; } t_window; static t_int *window_perform(t_int *w) { t_window *x = (t_window *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); t_float *window = x->x_window; int n = (int)(w[4]); while (n--) { *out++ = (*in++) * (*window++); } return (w+5); } static void window_size(t_window *x, t_int n) { if (x->x_size != n){ if (x->x_window) free(x->x_window); x->x_window = malloc(sizeof(t_float)*n); x->x_size = n; } } static void window_type(t_window *x, t_symbol *s, t_float f) { int i; t_float a = 0; t_float a_inc = 2 * M_PI / (t_float)(x->x_size); if (!s) s = gensym("hamming"); if (s == gensym("hamming")){ for (i=0; ix_size; i++){ t_float c = cos(a); x->x_window[i] = (0.54 - 0.46 * c); a += a_inc; } } else if (s == gensym("hann")){ for (i=0; ix_size; i++){ t_float c = cos(a); x->x_window[i] = (0.5 - 0.5 * c); a += a_inc; } } else if (s == gensym("hann/hamming")){ for (i=0; ix_size; i++) { t_float c = cos(a); x->x_window[i] = (0.5 - 0.5 * c) / (0.54 - 0.46 * c); a += a_inc; } } else if (s == gensym("bfft_pink")){ x->x_window[0] = 1.0f; //DC x->x_window[1] = 1.0f / sqrt((double)(x->x_size>>1)); //NY for (i=2; ix_size; i+=2) { double freq = (double)(i>>1); t_float amp = sqrt(1.0 / freq); x->x_window[i] = amp; x->x_window[i+1] = amp; } } else if (s == gensym("bfft_blue")){ x->x_window[0] = 1.0f; //DC x->x_window[1] = sqrt((double)(x->x_size>>1)); //NY for (i=2; ix_size; i+=2) { double freq = (double)(i>>1); t_float amp = sqrt(freq); x->x_window[i] = amp; x->x_window[i+1] = amp; } } else if (s == gensym("bfft_db/octave")){ t_float power = f/6.0; x->x_window[0] = 1.0f; //DC x->x_window[1] = pow((double)(x->x_size>>1), power); //NY for (i=2; ix_size; i+=2) { double freq = (double)(i>>1); t_float amp = pow(freq, power); x->x_window[i] = amp; x->x_window[i+1] = amp; } } /* default is no window */ else{ post("bwin~: unknown window type, using rectangular"); for (i=0; ix_size; i++) x->x_window[i] = 1.0f; } x->x_type = s; x->x_typearg = f; } static void window_dsp(t_window *x, t_signal **sp) { int n = sp[0]->s_n; if (x->x_size != n){ window_size(x, n); window_type(x, x->x_type, x->x_typearg); } dsp_add(window_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, n); } static void window_free(t_window *x) { free(x->x_window); } static void *window_new(t_symbol *s) { t_window *x = (t_window *)pd_new(window_class); outlet_new(&x->x_obj, &s_signal); x->x_window = 0; window_size(x, 64); window_type(x, s, 0); return (x); } void bwin_tilde_setup(void) { window_class = class_new(gensym("bwin~"), (t_newmethod)window_new, (t_method)window_free, sizeof(t_window), 0, A_DEFSYMBOL, A_NULL); CLASS_MAINSIGNALIN(window_class, t_window, x_f); class_addmethod(window_class, (t_method)window_dsp, gensym("dsp"), A_NULL); class_addmethod(window_class, (t_method)window_type, gensym("type"), A_SYMBOL, A_DEFFLOAT, A_NULL); } pd-creb-0.10.0/modules/cexp~.c000066400000000000000000000042221434364737600160760ustar00rootroot00000000000000/* * cexp.c - some complex math dsp objects * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #define MINNORM 0.0000000001 t_class *cexp_class; typedef struct cexp { t_object x_obj; t_float x_f; } t_cexp; void cexp_free(void) { } static t_int *cexp_perform(t_int *w) { t_float *inx = (t_float *)(w[2]); t_float *iny = (t_float *)(w[3]); t_float *outx = (t_float *)(w[5]); // clockwize addressing t_float *outy = (t_float *)(w[4]); t_int n = (t_int)(w[1]); while (n--){ t_float x = *inx++; t_float y = *iny++; t_float norm = exp(x); *outx++ = norm * cos(y); *outy++ = norm * sin(y); } return (w+6); } static void cexp_dsp(t_cexp *x, t_signal **sp) { dsp_add(cexp_perform, 5, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec); } t_cexp *cexp_new(void) { t_cexp *x = (t_cexp *)pd_new(cexp_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); return x; } void cexp_tilde_setup(void) { cexp_class = class_new(gensym("cexp~"), (t_newmethod)cexp_new, (t_method)cexp_free, sizeof(t_cexp), 0, 0); CLASS_MAINSIGNALIN(cexp_class, t_cexp, x_f); class_addmethod(cexp_class, (t_method)cexp_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/cheby~.c000066400000000000000000000063611434364737600162370ustar00rootroot00000000000000/* * cheby.c - chebyshev polynomial evaluation * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #define MAX_ORDER 1024 #define DEFAULT_ORDER 4 typedef struct chebyctl { t_float c_gain[MAX_ORDER]; t_int c_order; } t_chebyctl; typedef struct cheby { t_object x_obj; t_float x_f; t_chebyctl x_ctl; } t_cheby; static void cheby_bang(t_cheby *x) { } static void cheby_coef(t_cheby *x, t_floatarg coef, t_floatarg f) { int i = (int)coef; if ((i > 0) && (i < x->x_ctl.c_order + 1)){ x->x_ctl.c_gain[i-1] = f; /* post("cheby: harmonic %d set to %f", i, f); */ } } static t_int *cheby_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_chebyctl *ctl = (t_chebyctl *)(w[1]); t_float *gain = ctl->c_gain; t_int i; t_int n = (t_int)(w[2]), k; t_float x,y,t1,t2,t,acc; for (i = 0; i < n; i++) { x = *in++; gain = ctl->c_gain; t2 = 1; /* T_0 */ t1 = x; /* T_1 */ acc = *gain++ * x; /* a_1 T_1 */ for (k=2; k<=ctl->c_order; k++){ t = 2*x*t1 - t2; /* T_k = 2 x T_{k-1} - T_{k-2} */ acc += *gain++ * t; /* a_k T_k */ t2 = t1; t1 = t; } *out++ = acc; } return (w+5); } static void cheby_dsp(t_cheby *x, t_signal **sp) { dsp_add(cheby_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void cheby_free(void) { } t_class *cheby_class; static void *cheby_new(t_floatarg order_f) { int i; int order = (int)order_f; t_cheby *x = (t_cheby *)pd_new(cheby_class); outlet_new(&x->x_obj, gensym("signal")); if (order < 1) order = DEFAULT_ORDER; /* default */ if (order > MAX_ORDER) order = MAX_ORDER; /* maximum */ //post("cheby: order = %d", order); x->x_ctl.c_order = order; cheby_coef(x, 1, 1); for (i=2; i #define MINNORM 0.0000000001 t_class *clog_class; typedef struct clog { t_object x_obj; t_float x_f; } t_clog; void clog_free(void) { } static t_int *clog_perform(t_int *w) { t_float *inx = (t_float *)(w[2]); t_float *iny = (t_float *)(w[3]); t_float *outx = (t_float *)(w[5]); // clockwize addressing t_float *outy = (t_float *)(w[4]); t_int n = (t_int)(w[1]); while (n--) { t_float x = *inx++; t_float y = *iny++; t_float norm = sqrt(x*x + y*y); t_float arg = atan2(y, x); if (norm < MINNORM) { norm = MINNORM; } *outx++ = log(norm); *outy++ = arg; } return (w+6); } static void clog_dsp(t_clog *x, t_signal **sp) { dsp_add(clog_perform, 5, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec); } t_clog *clog_new(void) { t_clog *x = (t_clog *)pd_new(clog_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); return x; } void clog_tilde_setup(void) { clog_class = class_new(gensym("clog~"), (t_newmethod)clog_new, (t_method)clog_free, sizeof(t_clog), 0, 0); CLASS_MAINSIGNALIN(clog_class, t_clog, x_f); class_addmethod(clog_class, (t_method)clog_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/diag~.c000066400000000000000000000107411434364737600160460ustar00rootroot00000000000000/* * diag.c - diagonal state space system. * treats input dsp block as n parallel signals * * s1 = (a * s1) + (b * s2) + u1; * s2 = (a * s2) - (b * s1) + u2; * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" #include #include #define MAXORDER 64 typedef struct diagctl { t_float *c_state; t_float *c_eigen; t_int c_order; } t_diagctl; typedef struct diag { t_object x_obj; t_float x_f; t_diagctl x_ctl; } t_diag; static t_float randfloat(void){ t_float r = rand (); r /= (RAND_MAX/2); r -= 1; return r; } static void diag_eigen(t_diag *x, t_floatarg index, t_floatarg val) { int i = (int)index; if (i<0) return; if (i>=x->x_ctl.c_order) return; x->x_ctl.c_eigen[i] = val; } /* set decay time of pole at index */ static void diag_time(t_diag *x, t_floatarg index, t_floatarg time) { t_float r; /* time in ms */ time *= 0.001; if (time < 0.0) time = 0.0; r = pow(0.001, (t_float)x->x_ctl.c_order / (time * sys_getsr())); if (r < 0.0) r = 0.0; if (r > 1.0) r = 1.0; diag_eigen(x, index, r); } static void diag_reset(t_diag *x) { int i; for (i=0; ix_ctl.c_order; i++) { x->x_ctl.c_state[i] = 0; } } static void diag_random(t_diag *x) { int i; for (i=0; ix_ctl.c_order; i++) { x->x_ctl.c_state[i] = randfloat(); } } static t_int *diag_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_diagctl *ctl = (t_diagctl *)(w[1]); t_float *eigen = ctl->c_eigen; t_float *state = ctl->c_state; t_int n = (t_int)(w[2]); t_float newstate; int i; for (i=0; is_n; int i; if (x->x_ctl.c_order != n) { if (x->x_ctl.c_state) free(x->x_ctl.c_state); if (x->x_ctl.c_eigen) free(x->x_ctl.c_eigen); x->x_ctl.c_state = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_eigen = (t_float *)malloc(n*sizeof(t_float)); for(i=0;ix_ctl.c_state[i] = 0; x->x_ctl.c_eigen[i] = 0; } x->x_ctl.c_order = n; } dsp_add(diag_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void diag_free(t_diag *x) { if (x->x_ctl.c_state) free(x->x_ctl.c_state); if (x->x_ctl.c_eigen) free(x->x_ctl.c_eigen); } t_class *diag_class; static void *diag_new(t_floatarg permute) { t_diag *x = (t_diag *)pd_new(diag_class); int i, n=64; outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_state = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_eigen = (t_float *)malloc(n*sizeof(t_float)); for(i=0;ix_ctl.c_state[i] = 0; x->x_ctl.c_eigen[i] = 0; } x->x_ctl.c_order = n; return (void *)x; } void diag_tilde_setup(void) { //post("diag~ v0.1"); diag_class = class_new(gensym("diag~"), (t_newmethod)diag_new, (t_method)diag_free, sizeof(t_diag), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(diag_class, t_diag, x_f); class_addmethod(diag_class, (t_method)diag_dsp, gensym("dsp"), 0); class_addmethod(diag_class, (t_method)diag_reset, gensym("reset"), 0); class_addmethod(diag_class, (t_method)diag_random, gensym("random"), 0); class_addmethod(diag_class, (t_method)diag_random, gensym("bang"), 0); class_addmethod(diag_class, (t_method)diag_eigen, gensym("eigen"), A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(diag_class, (t_method)diag_time, gensym("time"), A_DEFFLOAT, A_DEFFLOAT, 0); } pd-creb-0.10.0/modules/dist~.c000066400000000000000000000116751434364737600161140ustar00rootroot00000000000000/* * dist.c - wave shaping extern * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" #define CLIP 0 #define INVERSE 1 #define INVERSESQ 2 #define INVERSECUB 3 #define RAT1 4 #define RAT2 5 #define FULLRECT 6 #define HALFRECT 7 #define PULSE 8 #define NEWTON1 9 #define UPPERCLIP 10 #define COMPARATOR 11 typedef struct distctl { t_float c_gain; t_float c_delay; char c_type; } t_distctl; typedef struct dist { t_object x_obj; t_float x_f; t_distctl x_ctl; } t_dist; void dist_bang(t_dist *x) { } void dist_gain(t_dist *x, t_floatarg f) { x->x_ctl.c_gain = f; } static t_int *dist_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_distctl *ctl = (t_distctl *)(w[1]); t_float gain = ctl->c_gain; t_int i; t_int n = (t_int)(w[2]); t_float x,y,v; t_float z = ctl->c_delay; switch(ctl->c_type){ case CLIP: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x > 1) ? ( 1.) : x; x = (x < -1) ? (-1.) : x; *out++ = 0.9999 * x; } break; case INVERSE: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x > 1) ? (2. - 1/x) : x; x = (x < -1) ? (-2. - 1/x) : x; *out++ = x/2.0001; } break; case INVERSESQ: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x > 1) ? (2. - 1/x) : x; x = (x < -1) ? (-2. - 1/x) : x; x /= 2; *out++ = 1.999*x*x-1; } break; case INVERSECUB: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x > 1) ? (2. - 1/x) : x; x = (x < -1) ? (-2. - 1/x) : x; x /= 2; *out++ = .9999 * x*x*x; } break; case RAT1: /*(2*d./((1+(d).^2)))*/ for (i = 0; i < n; i++) { x = *in++ * gain; y = (1. + x*x); x = 1.9999*x/y; *out++ = x; } break; case RAT2: /*(2*d./((1+(d).^16)))*/ for (i = 0; i < n; i++) { x = *in++ * gain; y = x*x; y *= y; y *= y; y *= y; y = (1. + y); x = 1.2*x/y; *out++ = x; } break; case FULLRECT: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x>0) ? x : -x; x = (x>1) ? 1 : x; *out++ = 1.9999*(x-.5); } break; case HALFRECT: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x>0) ? x : 0; x = (x>1) ? 1 : x; *out++ = 1.9999*(x-.5); } break; case PULSE: for (i = 0; i < n; i++) { x = *in++ * gain; y = (x>0) ? (1):(-1); x = (z*y > 0) ? (0) : (y); *out++ = .9999 * x; z = x; } ctl->c_delay = z; break; case NEWTON1: for (i = 0; i < n; i++) { x = *in++ * gain; y = 1./(1.+x*x); z = .5; z = .5*(y/z + z); z = .5*(y/z + z); z = .5*(y/z + z); /* z = .5*(y/z + z); * z = .5*(y/z + z); * z = .5*(y/z + z); */ *out++ = x * z; } ctl->c_delay = z; break; case UPPERCLIP: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x < 0.0f) ? 0.0f : x; x = (x > 0.9999f) ? 0.9999f : x; *out++ = x; } break; case COMPARATOR: for (i = 0; i < n; i++) { x = *in++ * gain; x = (x > 0.0f) ? 1.0f : -1.0f; *out++ = x; } break; default: for (i = 0; i < n; i++) *out++ = *in++; break; } return (w+5); } static void dist_dsp(t_dist *x, t_signal **sp) { dsp_add(dist_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } void dist_free(void) { } t_class *dist_class; void *dist_new(t_floatarg type) { t_dist *x = (t_dist *)pd_new(dist_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("gain")); outlet_new(&x->x_obj, gensym("signal")); dist_gain(x, 1); x->x_ctl.c_type = (char)type; x->x_ctl.c_delay = 0; return (void *)x; } void dist_tilde_setup(void) { //post("dist~ v0.1"); dist_class = class_new(gensym("dist~"), (t_newmethod)dist_new, (t_method)dist_free, sizeof(t_dist), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(dist_class, t_dist, x_f); class_addmethod(dist_class, (t_method)dist_bang, gensym("bang"), 0); class_addmethod(dist_class, (t_method)dist_dsp, gensym("dsp"), 0); class_addmethod(dist_class, (t_method)dist_gain, gensym("gain"), A_FLOAT, 0); } pd-creb-0.10.0/modules/dt_ms.c000066400000000000000000000042121434364737600160460ustar00rootroot00000000000000/* * dt_ms.c - compute time it takes to propagate a message * Copyright (c) by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "m_pd.h" #include #include typedef struct dt_ms_struct { t_object x_obj; t_float x_f; t_outlet *x_outlet_dt; t_outlet *x_outlet_bang; } t_dt_ms; static void dt_ms_bang(t_dt_ms *x) { struct timeval tv_1; gettimeofday(&tv_1, NULL); /* Measure time it takes to execute this subtree. */ outlet_bang(x->x_outlet_bang); struct timeval tv_2; gettimeofday(&tv_2, NULL); suseconds_t us = tv_2.tv_usec - tv_1.tv_usec; time_t s = tv_2.tv_sec - tv_1.tv_sec; if (us < 0) { us += 1000000; s--; } t_float f_us = us; t_float f_s = s; f_s *= 10000000.0; f_us += f_s; t_float f_ms = f_us / 1000.0f; outlet_float(x->x_outlet_dt, f_ms); } static void dt_ms_free(t_dt_ms *x __attribute__((__unused__))) { } t_class *dt_ms_class; static void *dt_ms_new(void ) { t_dt_ms *x = (t_dt_ms *)pd_new(dt_ms_class); x->x_outlet_dt = outlet_new(&x->x_obj, &s_float); x->x_outlet_bang = outlet_new(&x->x_obj, &s_float); return (void *)x; } #ifdef __cplusplus extern "C" { #endif void dt_ms_setup(void) { dt_ms_class = class_new(gensym("dt_ms"), (t_newmethod)dt_ms_new, (t_method)dt_ms_free, sizeof(t_dt_ms), 0, A_NULL); class_addbang(dt_ms_class, (t_method)dt_ms_bang); } #ifdef __cplusplus } #endif pd-creb-0.10.0/modules/dwt-common.h000066400000000000000000000230211434364737600170300ustar00rootroot00000000000000/* * dwt-common.c - code for discrete wavelet transform * (symmetric interpolating biorthogonal wavelets using the lifting transform) * Copyright (c) 2000-2003 by Tom Schouten * This is the code common to dwt~, idwt~, dwt16~ and idwt16~. This code * restructuring (mainly reorganizing methods) is performed by Fred Jan Kraan, * 2020-01-11 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef DWTCOMMON #include "m_pd.h" #include #include #include #include #define MAXORDER 64 typedef enum{DWT,IDWT,DWT16,IDWT16} t_dwttype; typedef struct dwtctl { t_float c_update[MAXORDER]; t_float c_predict[MAXORDER]; t_int c_nupdate; t_int c_npredict; t_int c_levels; t_int c_fakein; t_float c_fakeval; t_int c_mask; char c_name[16]; t_int *c_clutter; t_int *c_unclutter; t_int c_permute; t_dwttype c_type; } t_dwtctl; typedef struct dwt { t_object x_obj; t_float x_f; t_dwtctl x_ctl; } t_dwt; static void dwt_even(t_dwt *x, t_floatarg f) { int k = (int)f; int i, j; t_float *p = x->x_ctl.c_predict; t_float *u = x->x_ctl.c_update; t_float l, xi, xj; if ((k>0) && (kx_ctl.c_npredict = 2*k; x->x_ctl.c_nupdate = 2*k; } } static void dwt_wavelet(t_dwt *x, t_floatarg f) { int k = (int)f; t_float *p = x->x_ctl.c_predict; t_float *u = x->x_ctl.c_update; t_int *np = &x->x_ctl.c_npredict; t_int *nu = &x->x_ctl.c_nupdate; switch(k) { default: case 1: /* haar */ *np = *nu = 2; /* actual order is one */ p[0] = 1; p[1] = 0; u[0] = 0; u[1] = .5; break; case 2: /* hat */ case 3: *np = *nu = 2; p[0] = .5; p[1] = .5; u[0] = .25; u[1] = .25; break; case 4: /* N = 4, N~ = 4 */ case 5: *np = *nu = 4; p[0] = -0.0625; p[1] = 0.5625; p[2] = 0.5625; p[3] = -0.0625; u[0] = -0.03125; u[1] = 0.28125; u[2] = 0.28125; u[3] = -0.03125; break; case 6: case 7: *np = *nu = 6; p[0] = 0.01171875000000; p[1] = -0.09765625000000; p[2] = 0.58593750000000; p[3] = 0.58593750000000; p[4] = -0.09765625000000; p[5] = 0.01171875000000; u[0] = 0.00585937500000; u[1] = -0.04882812500000; u[2] = 0.29296875000000; u[3] = 0.29296875000000; u[4] = -0.04882812500000; u[5] = 0.00585937500000; break; } } static inline void dwt_perform_permutation(t_float *S, int n, t_int *f) { t_int k,l; t_float swap; for(k=0; kx_ctl; t_int k, L=0, l, start, power; t_int nsave = n; while(nsave>>=1) L++; if (ctl->c_clutter) free(ctl->c_clutter); if (ctl->c_unclutter) free(ctl->c_unclutter); ctl->c_clutter = (t_int *)malloc(n*sizeof(t_int)); ctl->c_unclutter = (t_int *)malloc(n*sizeof(t_int)); for(l = L, start = n/2, power=1; l>0; l--, start /=2, power *=2) { for(k=0; kc_unclutter[start+k] = (1 + 2*k) * power; } } ctl->c_unclutter[0] = 0; for(k=0; kc_clutter[ctl->c_unclutter[k]] = k; return; /* debug */ for(k=0; kc_clutter[k]); for(k=0; kc_unclutter[k]); exit(1); } static void idwt_coef(t_dwt *x, t_floatarg index, t_floatarg value) { x->x_ctl.c_fakein = (int)index; x->x_ctl.c_fakeval = value; } static void dwt_print(t_dwt *x) { int i; printf("%s: predict: [ ", x->x_ctl.c_name); for (i=0; ix_ctl.c_npredict; i++) printf("%f ", x->x_ctl.c_predict[i]); printf("], "); printf("update: [ "); for (i=0; ix_ctl.c_nupdate; i++) printf("%f ", x->x_ctl.c_update[i]); printf("]\n"); } static void dwt_filter(t_dwt *x, t_symbol *s, int argc, t_atom *argv) { int invalid_argument = 0; int i; char *name = x->x_ctl.c_name; t_float *pfilter = x->x_ctl.c_predict; t_float *ufilter = x->x_ctl.c_update; t_float *mask = NULL; t_int *length = NULL; t_float sum = 0; if (s == gensym("predict")) { mask = pfilter; length = &(x->x_ctl.c_npredict); } else if (s == gensym("update")) { mask = ufilter; length = &(x->x_ctl.c_nupdate); } else if (s == gensym("mask")) { mask = NULL; } else { return; } if (argc >= MAXORDER) post("%s: error, maximum order exceeded.",name); else if ((x->x_ctl.c_type == DWT16 || x->x_ctl.c_type == IDWT16 ) && (argc != 16)) post("%s: error, need to have 16 coefficients.",name); else if (argc == 0) post("%s: no arguments given.",name); else if (argc & 1) post("%s: error, only an even number of coefficients is allowed.", name); else { for (i=0; ix_ctl.c_npredict = argc; x->x_ctl.c_nupdate = argc; } } } } static inline void dwtloop(t_float *vector, int source, int dest, int increment, int backup, int numcoef, int mask, t_float *filter, int filtlength, t_float sign) { int k, m; t_float acc; for (k = 0; k < numcoef; k++) { acc = 0; for (m = 0; m < filtlength; m++) { acc += filter[m] * vector[source]; source += increment; source &= mask; } vector[dest] += sign * acc; dest += increment; source -= backup; source &= mask; } } static inline void dwtloop16(t_float *vector, int source, int dest, int increment, int backup, int numcoef, int mask, t_float *filter, int filtlength, /* ignored, set to 16 */ t_float sign) { int k; t_float acc; for (k = 0; k < numcoef; k++) { acc = 0; acc += filter[0] * vector[source]; source += increment; source &= mask; acc += filter[1] * vector[source]; source += increment; source &= mask; acc += filter[2] * vector[source]; source += increment; source &= mask; acc += filter[3] * vector[source]; source += increment; source &= mask; acc += filter[4] * vector[source]; source += increment; source &= mask; acc += filter[5] * vector[source]; source += increment; source &= mask; acc += filter[6] * vector[source]; source += increment; source &= mask; acc += filter[7] * vector[source]; source += increment; source &= mask; acc += filter[8] * vector[source]; source += increment; source &= mask; acc += filter[9] * vector[source]; source += increment; source &= mask; acc += filter[10] * vector[source]; source += increment; source &= mask; acc += filter[11] * vector[source]; source += increment; source &= mask; acc += filter[12] * vector[source]; source += increment; source &= mask; acc += filter[13] * vector[source]; source += increment; source &= mask; acc += filter[14] * vector[source]; source += increment; source &= mask; acc += filter[15] * vector[source]; source += increment; source &= mask; vector[dest] += sign * acc; dest += increment; source -= backup; source &= mask; } } void dwt_free(t_dwt *x) { if (x->x_ctl.c_clutter) free(x->x_ctl.c_clutter); if (x->x_ctl.c_unclutter) free(x->x_ctl.c_unclutter); } static void dwt_reset(t_dwt *x) { bzero(x->x_ctl.c_update, 16*sizeof(t_float)); bzero(x->x_ctl.c_predict, 16*sizeof(t_float)); x->x_ctl.c_update[7] = .25; x->x_ctl.c_update[8] = .25; x->x_ctl.c_nupdate = 16; x->x_ctl.c_predict[7] = .5; x->x_ctl.c_predict[8] = .5; x->x_ctl.c_npredict = 16; x->x_ctl.c_fakein = -1; x->x_ctl.c_fakeval = 0; } #define DWTCOMMON #endif pd-creb-0.10.0/modules/dwt16~.c000066400000000000000000000072771434364737600161210ustar00rootroot00000000000000/* * dwt16.c - code for discrete wavelet transform * (symmetric interpolating biorthogonal wavelets using the lifting transform) * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #include "dwt-common.h" #define MAXORDER 64 t_class *dwt16_class; static t_int *dwt16_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); t_int n = (t_int)(w[2]); int i; int numcoef = n/2; /* int source_u = ((1 - ctl->c_nupdate)/2 - 1); * int source_p = ((1 - ctl->c_npredict)/2); */ int source_u = ((2 - ctl->c_nupdate) - 1); int source_p = ((2 - ctl->c_npredict)); int increment = 2; int dest = 1; int backup_u = (ctl->c_nupdate-1)*2; int backup_p = (ctl->c_npredict-1)*2; /* copy input to output */ if (in != out) for (i=0; ic_levels; i++){ /* foreward predict */ dwtloop16(out, (source_p & (n-1)), dest, increment, backup_p, numcoef, n-1, ctl->c_predict, 16, -1); /* foreward update */ dwtloop16(out, (source_u & (n-1)), 0, increment, backup_u, numcoef, n-1, ctl->c_update, 16, +1); /* update control parameters */ numcoef /= 2; source_p *= 2; source_u *= 2; backup_p *= 2; backup_u *= 2; increment *= 2; dest *= 2; } if (ctl->c_permute) dwt_perform_permutation(out, n, ctl->c_unclutter); return (w+5); } static void dwt16_dsp(t_dwt *x, t_signal **sp) { int n = sp[0]->s_n; int ln = 0; dwt_permutation(x, n); x->x_ctl.c_mask = n-1; while (n >>= 1) ln++; x->x_ctl.c_levels = ln; dsp_add(dwt16_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void *dwt16_new(t_floatarg permute) { t_dwt *x = (t_dwt *)pd_new(dwt16_class); outlet_new(&x->x_obj, gensym("signal")); /* init data */ dwt_reset(x); x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; x->x_ctl.c_permute = (t_int) permute; sprintf(x->x_ctl.c_name,"dwt16"); return (void *)x; } void dwt16_tilde_setup(void) { //post("dwt16~ v0.1"); dwt16_class = class_new(gensym("dwt16~"), (t_newmethod)dwt16_new, (t_method)dwt_free, sizeof(t_dwt), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(dwt16_class, t_dwt, x_f); class_addmethod(dwt16_class, (t_method)dwt_print, gensym("print"), 0); class_addmethod(dwt16_class, (t_method)dwt_reset, gensym("reset"), 0); class_addmethod(dwt16_class, (t_method)dwt16_dsp, gensym("dsp"), 0); class_addmethod(dwt16_class, (t_method)dwt_filter, gensym("predict"), A_GIMME, 0); class_addmethod(dwt16_class, (t_method)dwt_filter, gensym("update"), A_GIMME, 0); class_addmethod(dwt16_class, (t_method)dwt_filter, gensym("mask"), A_GIMME, 0); } pd-creb-0.10.0/modules/dwt~.c000066400000000000000000000075751434364737600157530ustar00rootroot00000000000000/* * dwt.c - code for discrete wavelet transform * (symmetric interpolating biorthogonal wavelets using the lifting transform) * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #include "dwt-common.h" #define MAXORDER 64 t_class *dwt_class; static t_int *dwt_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); t_int n = (t_int)(w[2]); int i; int numcoef = n/2; /* int source_u = ((1 - ctl->c_nupdate)/2 - 1); * int source_p = ((1 - ctl->c_npredict)/2); */ int source_u = ((2 - ctl->c_nupdate) - 1); int source_p = ((2 - ctl->c_npredict)); int increment = 2; int dest = 1; int backup_u = (ctl->c_nupdate-1)*2; int backup_p = (ctl->c_npredict-1)*2; /* copy input to output */ if (in != out) for (i=0; ic_levels; i++){ /* foreward predict */ dwtloop(out, (source_p & (n-1)), dest, increment, backup_p, numcoef, n-1, ctl->c_predict, ctl->c_npredict, -1); /* foreward update */ dwtloop(out, (source_u & (n-1)), 0, increment, backup_u, numcoef, n-1, ctl->c_update, ctl->c_nupdate, +1); /* update control parameters */ numcoef /= 2; source_p *= 2; source_u *= 2; backup_p *= 2; backup_u *= 2; increment *= 2; dest *= 2; } if (ctl->c_permute) dwt_perform_permutation(out, n, ctl->c_unclutter); return (w+5); } static void dwt_dsp(t_dwt *x, t_signal **sp) { int n = sp[0]->s_n; int ln = 0; dwt_permutation(x, n); x->x_ctl.c_mask = n-1; while (n >>= 1) ln++; x->x_ctl.c_levels = ln; dsp_add(dwt_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void *dwt_new(t_floatarg permute) { t_dwt *x = (t_dwt *)pd_new(dwt_class); outlet_new(&x->x_obj, gensym("signal")); /* init data */ dwt_reset(x); x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; x->x_ctl.c_permute = (t_int) permute; sprintf(x->x_ctl.c_name,"dwt"); x->x_ctl.c_type = DWT; return (void *)x; } void dwt_tilde_setup(void) { //post("dwt~ v0.1"); dwt_class = class_new(gensym("dwt~"), (t_newmethod)dwt_new, (t_method)dwt_free, sizeof(t_dwt), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(dwt_class, t_dwt, x_f); class_addmethod(dwt_class, (t_method)dwt_print, gensym("print"), 0); class_addmethod(dwt_class, (t_method)dwt_reset, gensym("reset"), 0); class_addmethod(dwt_class, (t_method)dwt_dsp, gensym("dsp"), 0); class_addmethod(dwt_class, (t_method)dwt_filter, gensym("predict"), A_GIMME, 0); class_addmethod(dwt_class, (t_method)dwt_filter, gensym("update"), A_GIMME, 0); class_addmethod(dwt_class, (t_method)dwt_filter, gensym("mask"), A_GIMME, 0); class_addmethod(dwt_class, (t_method)dwt_even, gensym("even"), A_DEFFLOAT, 0); /*class_addmethod(dwt_class, (t_method)dwt_wavelet, gensym("wavelet"), A_DEFFLOAT, 0); */ } pd-creb-0.10.0/modules/dynwav~.c000066400000000000000000000160341434364737600164530ustar00rootroot00000000000000/* * dynwav~.c - dynamic wavetable oscillators * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #define MAXORDER 1024 typedef struct dynwavctl { t_float *c_buf1; /* current */ t_float *c_buf2; /* old */ t_int c_order; } t_dynwavctl; typedef struct dynwav { t_object x_obj; t_float x_f; t_dynwavctl x_ctl; } t_dynwav; #if 0 static t_int *dynwav_perform(t_int *w) { t_float *wave = (t_float *)(w[3]); t_float *freq = (t_float *)(w[4]); t_float *out = (t_float *)(w[5]); t_dynwavctl *ctl = (t_dynwavctl *)(w[1]); t_int n = (t_int)(w[2]); t_float *buf, *dbuf, *swap; int i; int mask = n-1; /* swap buffer pointers */ swap = ctl->c_buf1; /* this is the last one stored */ buf = ctl->c_buf1 = ctl->c_buf2; /* put oldest in newest to overwrite */ dbuf = ctl->c_buf2 = swap; /* put last one in oldest */ if (buf && dbuf) { /* store input wavetable in buffer */ memcpy(buf, wave, n*sizeof(t_float)); for (i = 0; i < n; i++) { t_float findex = *freq++ * (t_float)n; int index = findex; t_float frac, a, b, c, d, cminusb, q, r; int ia, ib, ic, id; frac = findex - index; ia = (index-1) & mask; ib = (index ) & mask; ic = (index+1) & mask; id = (index+2) & mask; q = i+1; q /= n; r = n-1-i; r /= n; /* get 4 points, wrap index */ a = q * buf[ia] + r * dbuf[ia]; b = q * buf[ib] + r * dbuf[ib]; c = q * buf[ic] + r * dbuf[ic]; d = q * buf[id] + r * dbuf[id]; cminusb = c-b; *out++ = b + frac * (cminusb - 0.5f * (frac-1.) * ((a - d + 3.0f * cminusb) * frac + (b - a - cminusb))); } } return (w+6); } #endif static t_int *dynwav_perform_8point(t_int *w) /* FIXME: i thought this was broken. */ { t_float *wave = (t_float *)(w[3]); t_float *freq = (t_float *)(w[4]); t_float *out = (t_float *)(w[5]); t_dynwavctl *ctl = (t_dynwavctl *)(w[1]); t_int n = (t_int)(w[2]); t_float *buf, *dbuf, *swap; int i; int mask = n-1; /* swap buffer pointers */ swap = ctl->c_buf1; /* this is the last one stored */ buf = ctl->c_buf1 = ctl->c_buf2; /* put oldest in newest to overwrite */ dbuf = ctl->c_buf2 = swap; /* put last one in oldest */ if (buf && dbuf) { /* const t_float N1 = 1 / ( 2 * (1-(1/9)) * (1-(1/25)) * (1-(1/49)) ); ** const t_float N2 = 1 / ( (1-(9)) * 2 * (1-(9/25)) * (1-(9/49)) ); ** const t_float N3 = 1 / ( (1-(25)) * (1-(25/9)) * 2 * (1-(25/49)) ); ** const t_float N4 = 1 / ( (1-(49)) * (1-(49/9)) * (1-(49/25)) * 2 ); */ const t_float N1 = 0.59814453125; const t_float N2 = -0.11962890625; const t_float N3 = 0.02392578125; const t_float N4 = -0.00244140625; /* store input wavetable in buffer */ memcpy(buf, wave, n*sizeof(t_float)); for (i = 0; i < n; i++) { t_float findex = *freq++ * (t_float)n; int index = findex; t_float frac, q, r, fm, fp, fe, fo; t_float x1, x2, x3, x4; t_float g1, g2, g3, g4; t_float gg, g2g3g4, g1g3g4, g1g2g4, g1g2g3; t_float acc; int im, ip; frac = 2 *(findex - index) - 1; x1 = frac; x2 = frac/3; x3 = frac/5; x4 = frac/7; g1 = 1 - x1*x1; g2 = 1 - x2*x2; g3 = 1 - x3*x3; g4 = 1 - x4*x4; gg = g3 * g4; g2g3g4 = g2 * gg; /* 1 */ g1g3g4 = g1 * gg; /* 2 */ gg = g1 * g2; g1g2g4 = g4 * gg; /* 3 */ g1g2g3 = g3 * gg; /* 4 */ /* triangle interpolation between current and past wavetable*/ q = i+1; q /= n; r = n-1-i; r /= n; /* 1, -1*/ im = (index ) & mask; ip = (index+1) & mask; fm = q * buf[im] + r * dbuf[im]; fp = q * buf[ip] + r * dbuf[ip]; fe = fp + fm; fo = fp - fm; acc = N1 * g2g3g4 * (fe + x1*fo); /* 2, -2 */ im = (index-1) & mask; ip = (index+2) & mask; fm = q * buf[im] + r * dbuf[im]; fp = q * buf[ip] + r * dbuf[ip]; fe = fp + fm; fo = fp - fm; acc += N2 * g1g3g4 * (fe + x2*fo); /* 3, -3 */ im = (index-2) & mask; ip = (index+3) & mask; fm = q * buf[im] + r * dbuf[im]; fp = q * buf[ip] + r * dbuf[ip]; fe = fp + fm; fo = fp - fm; acc += N3 * g1g2g4 * (fe + x3*fo); /* 4, -4 */ im = (index-3) & mask; ip = (index+4) & mask; fm = q * buf[im] + r * dbuf[im]; fp = q * buf[ip] + r * dbuf[ip]; fe = fp + fm; fo = fp - fm; acc += N4 * g1g2g3 * (fe + x4*fo); *out++ = acc; } } return (w+6); } static void dynwav_dsp(t_dynwav *x, t_signal **sp) { int n = sp[0]->s_n; int k; if (x->x_ctl.c_order != n) { if (x->x_ctl.c_buf1) free (x->x_ctl.c_buf1); if (x->x_ctl.c_buf2) free (x->x_ctl.c_buf2); x->x_ctl.c_buf1 = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_buf2 = (t_float *)malloc(n*sizeof(t_float)); for(k=0; kx_ctl.c_buf1[k] = 0; x->x_ctl.c_buf2[k] = 0; } x->x_ctl.c_order = n; } dsp_add(dynwav_perform_8point, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec); } static void dynwav_free(t_dynwav *x) { if (x->x_ctl.c_buf1) free (x->x_ctl.c_buf1); if (x->x_ctl.c_buf2) free (x->x_ctl.c_buf2); } t_class *dynwav_class; static void *dynwav_new(t_floatarg order) { t_dynwav *x = (t_dynwav *)pd_new(dynwav_class); int iorder = (int)order; int i, n=64, k; /* in 2 */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); /* out 1 */ outlet_new(&x->x_obj, gensym("signal")); /* init data */ x->x_ctl.c_buf1 = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_buf2 = (t_float *)malloc(n*sizeof(t_float)); for(k=0; kx_ctl.c_buf1[k] = 0; x->x_ctl.c_buf2[k] = 0; } x->x_ctl.c_order = n; return (void *)x; } void dynwav_tilde_setup(void) { //post("dynwav~ v0.1"); dynwav_class = class_new(gensym("dynwav~"), (t_newmethod)dynwav_new, (t_method)dynwav_free, sizeof(t_dynwav), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(dynwav_class, t_dynwav, x_f); class_addmethod(dynwav_class, (t_method)dynwav_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/eadsr~.c000066400000000000000000000111511434364737600162340ustar00rootroot00000000000000/* * eadsr.c - exponential attack decay sustain release envelope * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" typedef struct eadsrctl { t_float c_attack; t_float c_decay; t_float c_sustain; t_float c_release; t_float c_state; t_float c_target; } t_eadsrctl; typedef struct eadsr { t_object x_obj; t_float x_sr; t_eadsrctl x_ctl; } t_eadsr; void eadsr_attack(t_eadsr *x, t_floatarg f) { x->x_ctl.c_attack = milliseconds_2_one_minus_realpole(f); } void eadsr_decay(t_eadsr *x, t_floatarg f) { x->x_ctl.c_decay = milliseconds_2_one_minus_realpole(f); } void eadsr_sustain(t_eadsr *x, t_floatarg f) { if (f>ENVELOPE_MAX) f = ENVELOPE_MAX; if (fx_ctl.c_sustain = f; } void eadsr_release(t_eadsr *x, t_floatarg f) { x->x_ctl.c_release = milliseconds_2_one_minus_realpole(f); } void eadsr_start(t_eadsr *x) { x->x_ctl.c_target = 1; x->x_ctl.c_state = 0.0f; } void eadsr_stop(t_eadsr *x) { x->x_ctl.c_target = 0; } void eadsr_float(t_eadsr *x, t_floatarg f) { if (f == 0.0f) eadsr_stop(x); else eadsr_start(x); } static t_int *eadsr_perform(t_int *w) { t_float *out = (t_float *)(w[3]); t_eadsrctl *ctl = (t_eadsrctl *)(w[1]); t_float attack = ctl->c_attack; t_float decay = ctl->c_decay; t_float sustain = ctl->c_sustain; t_float release = ctl->c_release; t_float state = ctl->c_state; t_float target = ctl->c_target; t_int n = (t_int)(w[2]); t_int i; for (i = 0; i < n; i++){ if (target == 1.0f){ /* attack */ *out++ = state; state += attack*(1 - state); target = (state > ENVELOPE_MAX) ? sustain : 1.0f; } else if (target == 0.0f){ /* release */ *out++ = state; state -= release*state; } else{ /* decay */ *out++ = state; state -= decay*(state-sustain); } } /* save state */ ctl->c_state = IS_DENORMAL(state) ? 0 : state; ctl->c_target = target; return (w+4); } static void eadsr_dsp(t_eadsr *x, t_signal **sp) { x->x_sr = sp[0]->s_sr; dsp_add(eadsr_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec); } void eadsr_free(void) { } t_class *eadsr_class; void *eadsr_new(t_floatarg attack, t_floatarg decay, t_floatarg sustain, t_floatarg release) { t_eadsr *x = (t_eadsr *)pd_new(eadsr_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("attack")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("decay")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("sustain")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("release")); outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_state = 0; x->x_ctl.c_target = 0; eadsr_attack(x, attack); eadsr_decay(x, decay); eadsr_sustain(x, sustain); eadsr_release(x, release); return (void *)x; } void eadsr_tilde_setup(void) { //post("eadsr~ v0.1"); eadsr_class = class_new(gensym("eadsr~"), (t_newmethod)eadsr_new, (t_method)eadsr_free, sizeof(t_eadsr), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(eadsr_class, (t_method)eadsr_float, gensym("float"), A_FLOAT, 0); class_addmethod(eadsr_class, (t_method)eadsr_start, gensym("start"), 0); class_addmethod(eadsr_class, (t_method)eadsr_start, gensym("bang"), 0); class_addmethod(eadsr_class, (t_method)eadsr_stop, gensym("stop"), 0); class_addmethod(eadsr_class, (t_method)eadsr_dsp, gensym("dsp"), 0); class_addmethod(eadsr_class, (t_method)eadsr_attack, gensym("attack"), A_FLOAT, 0); class_addmethod(eadsr_class, (t_method)eadsr_decay, gensym("decay"), A_FLOAT, 0); class_addmethod(eadsr_class, (t_method)eadsr_sustain, gensym("sustain"), A_FLOAT, 0); class_addmethod(eadsr_class, (t_method)eadsr_release, gensym("release"), A_FLOAT, 0); } pd-creb-0.10.0/modules/ead~.c000066400000000000000000000073751434364737600157040ustar00rootroot00000000000000/* * ead.c - exponential attack decay envelope * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" /* pointer to */ t_class *ead_class; /* state data fpr attack/decay dsp plugin */ typedef struct eadctl { t_float c_attack; t_float c_decay; t_float c_state; t_int c_target; } t_eadctl; /* object data structure */ typedef struct ead { t_object x_obj; t_eadctl x_ctl; } t_ead; static void ead_attack(t_ead *x, t_floatarg f) { x->x_ctl.c_attack = milliseconds_2_one_minus_realpole(f); } static void ead_decay(t_ead *x, t_floatarg f) { x->x_ctl.c_decay = milliseconds_2_one_minus_realpole(f); } static void ead_start(t_ead *x) { /* reset state if necessary to prevent skipping */ // always reset, seems to be safest //if (x->x_ctl.c_target == 1) x->x_ctl.c_state = 0.0f; x->x_ctl.c_target = 1; } /* dsp callback function, not a method */ static t_int *ead_perform(t_int *w) { /* interprete arguments */ t_float *out = (t_float *)(w[3]); t_eadctl *ctl = (t_eadctl *)(w[1]); t_float attack = ctl->c_attack; t_float decay = ctl->c_decay; t_float state = ctl->c_state; t_int n = (t_int)(w[2]); t_int i; /* A/D code */ for (i = 0; i < n; i++){ switch(ctl->c_target){ case 1: /* attack phase */ *out++ = state; state += attack*(1 - state); ctl->c_target = (state <= ENVELOPE_MAX); break; default: /* decay phase */ *out++ = state; state -= decay*state; break; } } /* save state */ ctl->c_state = IS_DENORMAL(state) ? 0 : state; return (w+4); } static void ead_dsp(t_ead *x, t_signal **sp) { dsp_add(ead_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec); } /* destructor */ static void ead_free(void) { } /* constructor */ static void *ead_new(t_floatarg attack, t_floatarg decay, t_floatarg sustain, t_floatarg release) { /* create instance */ t_ead *x = (t_ead *)pd_new(ead_class); /* create new inlets, convert incoming message float to attack/decay */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("attack")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("decay")); /* create a dsp outlet */ outlet_new(&x->x_obj, gensym("signal")); /* initialize */ x->x_ctl.c_state = 0; x->x_ctl.c_target = 0; ead_attack(x, attack); ead_decay(x, decay); /* return instance */ return (void *)x; } void ead_tilde_setup(void) { //post("ead~ v0.1"); ead_class = class_new(gensym("ead~"), (t_newmethod)ead_new, (t_method)ead_free, sizeof(t_ead), 0, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(ead_class, (t_method)ead_start, gensym("start"), 0); class_addmethod(ead_class, (t_method)ead_start, gensym("bang"), 0); class_addmethod(ead_class, (t_method)ead_dsp, gensym("dsp"), 0); class_addmethod(ead_class, (t_method)ead_attack, gensym("attack"), A_FLOAT, 0); class_addmethod(ead_class, (t_method)ead_decay, gensym("decay"), A_FLOAT, 0); } pd-creb-0.10.0/modules/ear~.c000066400000000000000000000067451434364737600157220ustar00rootroot00000000000000/* * ear.c - exponential attack release envelope * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" typedef struct earctl { t_float c_attack; t_float c_release; t_float c_state; t_float c_target; } t_earctl; typedef struct ear { t_object x_obj; t_float x_sr; t_earctl x_ctl; } t_ear; void ear_attack(t_ear *x, t_floatarg f) { x->x_ctl.c_attack = milliseconds_2_one_minus_realpole(f); } void ear_release(t_ear *x, t_floatarg f) { x->x_ctl.c_release = milliseconds_2_one_minus_realpole(f); } void ear_start(t_ear *x) { x->x_ctl.c_target = 1; x->x_ctl.c_state = 0.0f; } void ear_stop(t_ear *x) { x->x_ctl.c_target = 0; } void ear_float(t_ear *x, t_floatarg f) { if (f == 0.0f) ear_stop(x); else ear_start(x); } static t_int *ear_perform(t_int *w) { t_float *out = (t_float *)(w[3]); t_earctl *ctl = (t_earctl *)(w[1]); t_float attack = ctl->c_attack; t_float release = ctl->c_release; t_float state = ctl->c_state; t_float target = ctl->c_target; t_int n = (t_int)(w[2]); t_int i; if (target) /* attack phase */ for (i = 0; i < n; i++) { *out++ = state; state += attack*(1 - state); } else /* release phase */ for (i = 0; i < n; i++) { *out++ = state; state -= release*state; } ctl->c_state = IS_DENORMAL(state) ? 0 : state; return (w+4); } static void ear_dsp(t_ear *x, t_signal **sp) { x->x_sr = sp[0]->s_sr; dsp_add(ear_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec); } void ear_free(void) { } t_class *ear_class; /* attack - release */ void *ear_new(t_floatarg attack, t_floatarg release) { t_ear *x = (t_ear *)pd_new(ear_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("attack")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("release")); outlet_new(&x->x_obj, gensym("signal")); ear_attack(x,attack); ear_release(x,release); x->x_ctl.c_state = 0; x->x_ctl.c_target = 0; return (void *)x; } void ear_tilde_setup(void) { //post("ear~ v0.1"); ear_class = class_new(gensym("ear~"), (t_newmethod)ear_new, (t_method)ear_free, sizeof(t_ear), 0, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(ear_class, (t_method)ear_float, gensym("float"), A_FLOAT, 0); class_addmethod(ear_class, (t_method)ear_start, gensym("start"), 0); class_addmethod(ear_class, (t_method)ear_start, gensym("bang"), 0); class_addmethod(ear_class, (t_method)ear_stop, gensym("stop"), 0); class_addmethod(ear_class, (t_method)ear_dsp, gensym("dsp"), 0); class_addmethod(ear_class, (t_method)ear_attack, gensym("attack"), A_FLOAT, 0); class_addmethod(ear_class, (t_method)ear_release, gensym("release"), A_FLOAT, 0); } pd-creb-0.10.0/modules/eblosc~.c000066400000000000000000000353271434364737600164200ustar00rootroot00000000000000/* * eblosc.c - bandlimited oscillators with infinite support discontinuities * using minimum phase impulse, step & ramp * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #include "filters.h" typedef unsigned long long u64; typedef unsigned long u32; #define LPHASOR (8*sizeof(u32)) // the phasor logsize #define VOICES 8 // the number of oscillators #define CUTOFF 0.8f // fraction of nyquist for impulse cutoff typedef struct ebloscctl { t_float c_pole[VOICES*2]; // complex poles t_float c_gain[VOICES*2]; // complex gains (waveform specific constants) t_float c_state[VOICES*2]; // complex state u32 c_phase; // phase of main oscillator u32 c_phase2; // phase of secondairy oscillator t_float c_prev_amp; // previous input of comparator t_float c_phase_inc_scale; t_float c_scale; t_float c_scale_update; t_symbol *c_waveform; } t_ebloscctl; typedef struct eblosc { t_object x_obj; t_float x_f; t_ebloscctl x_ctl; } t_eblosc; /* phase converters */ static inline float _phase_to_float(u32 p){ return ((t_float)p) * (1.0f / 4294967296.0f); } static inline u32 _float_to_phase(t_float f){ return (u32)(f * 4294967296.0f); } /* get one sample from the oscillator bank and perform time tick */ static inline t_float _osc_tick(t_ebloscctl *ctl) { float sum = 0.0f; int i; /* sum all voices */ for (i=0; ic_state+i, ctl->c_pole+i); /* get real part and add to output */ sum += ctl->c_state[0]; } return sum; } /* add shifted impulse */ static inline void _add_impulse(t_ebloscctl *ctl, t_float t0) { int i; for (i=0; ic_state[0] += real; ctl->c_state[1] += imag; } } /* add step */ static inline void _add_step(t_ebloscctl *ctl) { int i; for (i=0; ic_state[0] += real; ctl->c_state[1] += imag; } } /* add shifted step */ static inline void _add_shifted_step(t_ebloscctl *ctl, t_float t0) { int i; for (i=0; ic_state[0] += real; ctl->c_state[1] += imag; } } #if 0 /* update waveplayers on zero cross */ static void _bang_comparator(t_ebloscctl *ctl, float prev, float curr) { /* check for sign change */ if ((prev * curr) < 0.0f){ int voice; /* determine the location of the discontinuity (in oversampled coordiates using linear interpolation */ float f = (t_float)S * curr / (curr - prev); /* get the offset in the oversample table */ u32 table_index = (u32)f; /* determine the fractional part (in oversampled coordinates) for linear interpolation */ float table_frac_index = f - (t_float)table_index; /* set state (+ or -) */ ctl->c_state = (curr > 0.0f) ? 0.5f : -0.5f; /* steal the oldest voice */ voice = ctl->c_next_voice++; ctl->c_next_voice &= VOICES-1; /* initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; ctl->c_frac[voice] = table_frac_index; ctl->c_vscale[voice] = -ctl->c_scale * 2.0f * ctl->c_state; } } /* advance phasor and update waveplayers on phase wrap */ static void _bang_phasor(t_ebloscctl *ctl, float freq) { u32 phase = ctl->c_phase; u32 phase_inc; u32 oldphase; int voice; float scale = ctl->c_scale; /* get increment */ float inc = freq * ctl->c_phase_inc_scale; /* calculate new phase the increment (and the phase) should be a multiple of S */ if (inc < 0.0f) inc = -inc; phase_inc = ((u32)inc) & ~(S-1); oldphase = phase; phase += phase_inc; /* check for phase wrap */ if (phase < oldphase){ u32 phase_inc_decimated = phase_inc >> LOVERSAMPLE; u32 table_index; u32 table_phase; /* steal the oldest voice if we have a phase wrap */ voice = ctl->c_next_voice++; ctl->c_next_voice &= VOICES-1; /* determine the location of the discontinuity (in oversampled coordinates) which is S * (new phase) / (increment) */ table_index = phase / phase_inc_decimated; /* determine the fractional part (in oversampled coordinates) for linear interpolation */ table_phase = phase - (table_index * phase_inc_decimated); /* use it to initialize the new voice index and interpolation * fraction */ ctl->c_index[voice] = table_index; ctl->c_frac[voice] = (t_float)table_phase / (t_float)phase_inc_decimated; ctl->c_vscale[voice] = scale; scale = scale * ctl->c_scale_update; } /* save state */ ctl->c_phase = phase; ctl->c_scale = scale; } /* the 2 oscillator version: the second osc can reset the first osc's phase (hence it determines the pitch) the first osc determines the waveform */ static void _bang_hardsync_phasor(t_ebloscctl *ctl, float freq, float freq2) { u32 phase = ctl->c_phase; u32 phase2 = ctl->c_phase2; u32 phase_inc; u32 phase_inc2; u32 oldphase; u32 oldphase2; int voice; float scale = ctl->c_scale; /* get increment */ float inc = freq * ctl->c_phase_inc_scale; float inc2 = freq2 * ctl->c_phase_inc_scale; /* calculate new phases the increment (and the phase) should be a multiple of S */ /* save previous phases */ oldphase = phase; oldphase2 = phase2; /* update second osc */ if (inc2 < 0.0f) inc2 = -inc2; phase_inc2 = ((u32)inc2) & ~(S-1); phase2 += phase_inc2; /* update first osc (freq should be >= freq of sync osc */ if (inc < 0.0f) inc = -inc; phase_inc = ((u32)inc) & ~(S-1); if (phase_inc < phase_inc2) phase_inc = phase_inc2; phase += phase_inc; /* check for sync discontinuity (osc 2) */ if (phase2 < oldphase2) { /* adjust phase depending on the location of the discontinuity in phase2: phase/phase_inc == phase2/phase_inc2 */ u64 pi = phase_inc >> LOVERSAMPLE; u64 pi2 = phase_inc2 >> LOVERSAMPLE; u64 lphase = ((u64)phase2 * pi) / pi2; phase = lphase & ~(S-1); } /* check for phase discontinuity (osc 1) */ if (phase < oldphase){ u32 phase_inc_decimated = phase_inc >> LOVERSAMPLE; u32 table_index; u32 table_phase; float stepsize; /* steal the oldest voice if we have a phase wrap */ voice = ctl->c_next_voice++; ctl->c_next_voice &= VOICES-1; /* determine the location of the discontinuity (in oversampled coordinates) which is S * (new phase) / (increment) */ table_index = phase / phase_inc_decimated; /* determine the fractional part (in oversampled coordinates) for linear interpolation */ table_phase = phase - (table_index * phase_inc_decimated); /* determine the step size. as opposed to saw/impulse waveforms, the step is not always equal to one. it is: oldphase - phase + phase_inc but for the unit step this will overflow to zero, so we reduce the bit depth to prevent overflow */ stepsize = _phase_to_float(((oldphase-phase) >> LOVERSAMPLE) + phase_inc_decimated) * (t_float)S; /* use it to initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; ctl->c_frac[voice] = (t_float)table_phase / (t_float)phase_inc_decimated; ctl->c_vscale[voice] = scale * stepsize; scale = scale * ctl->c_scale_update; } /* save state */ ctl->c_phase = phase; ctl->c_phase2 = phase2; ctl->c_scale = scale; } static t_int *eblosc_perform_hardsync_saw(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *freq2 = (t_float *)(w[4]); t_float *out = (t_float *)(w[5]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; /* set postfilter cutoff */ ctl->c_butter->setButterHP(0.85f * (*freq / sys_getsr())); while (n--) { float frequency = *freq++; float frequency2 = *freq2++; /* get the bandlimited discontinuity */ float sample = _get_bandlimited_discontinuity(ctl, bls); /* add aliased sawtooth wave */ sample += _phase_to_float(ctl->c_phase) - 0.5f; /* highpass filter output to remove DC offset and low * frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05f); /* send to output */ *out++ = sample; /* advance phasor */ _bang_hardsync_phasor(ctl, frequency2, frequency); } return (w+6); } static t_int *eblosc_perform_saw(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; while (n--) { float frequency = *freq++; /* get the bandlimited discontinuity */ float sample = _get_bandlimited_discontinuity(ctl, bls); /* add aliased sawtooth wave */ sample += _phase_to_float(ctl->c_phase) - 0.5f; /* send to output */ *out++ = sample; /* advance phasor */ _bang_phasor(ctl, frequency); } return (w+5); } static t_int *eblosc_perform_pulse(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; /* set postfilter cutoff */ ctl->c_butter->setButterHP(0.85f * (*freq / sys_getsr())); while (n--) { float frequency = *freq++; /* get the bandlimited discontinuity */ float sample = _get_bandlimited_discontinuity(ctl, bli); /* highpass filter output to remove DC offset and low * frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05f); /* send to output */ *out++ = sample; /* advance phasor */ _bang_phasor(ctl, frequency); } return (w+5); } static t_int *eblosc_perform_comparator(t_int *w) { t_float *amp = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; t_float prev_amp = ctl->c_prev_amp; while (n--) { float curr_amp = *amp++; /* exact zero won't work for zero detection (sic) */ if (curr_amp == 0.0f) curr_amp = 0.0000001f; /* get the bandlimited discontinuity */ float sample = _get_bandlimited_discontinuity(ctl, bls); /* add the block wave state */ sample += ctl->c_state; /* send to output */ *out++ = sample; /* advance phasor */ _bang_comparator(ctl, prev_amp, curr_amp); prev_amp = curr_amp; } ctl->c_prev_amp = prev_amp; return (w+5); } static void eblosc_phase(t_eblosc *x, t_float f) { x->x_ctl.c_phase = _float_to_phase(f); x->x_ctl.c_phase2 = _float_to_phase(f); } static void eblosc_phase1(t_eblosc *x, t_float f) { x->x_ctl.c_phase = _float_to_phase(f); } static void eblosc_phase2(t_eblosc *x, t_float f) { x->x_ctl.c_phase2 = _float_to_phase(f); } static void eblosc_dsp(t_eblosc *x, t_signal **sp) { int n = sp[0]->s_n; /* set sampling rate scaling for phasors */ x->x_ctl.c_phase_inc_scale = 4.0f * (t_float)(1<<(LPHASOR-2)) / sys_getsr(); /* setup & register the correct process routine depending on the waveform */ /* 2 osc */ if (x->x_ctl.c_waveform == gensym("syncsaw")){ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; dsp_add(eblosc_perform_hardsync_saw, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec); } /* 1 osc */ else if (x->x_ctl.c_waveform == gensym("pulse")){ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("pulse2")){ x->x_ctl.c_phase_inc_scale *= 2; x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = -1.0f; dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("comparator")){ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; dsp_add(eblosc_perform_comparator, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else{ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; dsp_add(eblosc_perform_saw, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } } static void eblosc_free(t_eblosc *x) { delete x->x_ctl.c_butter; } t_class *eblosc_class; static void *eblosc_new(t_symbol *s) { t_eblosc *x = (t_eblosc *)pd_new(eblosc_class); int i; /* out 1 */ outlet_new(&x->x_obj, gensym("signal")); /* optional signal inlets */ if (s == gensym("syncsaw")){ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); } /* optional phase inlet */ if (s != gensym("comparator")){ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("phase")); } /* create the postfilter */ x->x_ctl.c_butter = new DSPIfilterSeries(3); /* init oscillators */ for (i=0; ix_ctl.c_index[i] = N-2; x->x_ctl.c_frac[i] = 0.0f; } /* init rest of state data */ eblosc_phase(x, 0); eblosc_phase2(x, 0); x->x_ctl.c_state = 0.0; x->x_ctl.c_prev_amp = 0.0; x->x_ctl.c_next_voice = 0; x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; x->x_ctl.c_waveform = s; return (void *)x; } extern "C" { void eblosc_tilde_setup(void) { //post("eblosc~ v0.1"); build_tables(); eblosc_class = class_new(gensym("eblosc~"), (t_newmethod)eblosc_new, (t_method)eblosc_free, sizeof(t_eblosc), 0, A_DEFSYMBOL, A_NULL); CLASS_MAINSIGNALIN(eblosc_class, t_eblosc, x_f); class_addmethod(eblosc_class, (t_method)eblosc_dsp, gensym("dsp"), A_NULL); class_addmethod(eblosc_class, (t_method)eblosc_phase, gensym("phase"), A_FLOAT, A_NULL); class_addmethod(eblosc_class, (t_method)eblosc_phase2, gensym("phase2"), A_FLOAT, A_NULL); } } #endif pd-creb-0.10.0/modules/extlib_util.h000066400000000000000000000057351434364737600173040ustar00rootroot00000000000000/* * Prototypes for utility functions used in pd externals * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef CREB_EXTLIB_UTIL_H #define CREB_EXTLIB_UTIL_H #include #include "m_pd.h" // __COUNTER__ is a CPP extension enabled in gcc >= 4.3 #if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 3 #define HAVE_COUNTER #endif #if defined __GNUC__ && __GNUC__ >= 5 #define HAVE_COUNTER #endif #ifdef __clang__ // Should we check version here? #define HAVE_COUNTER #endif #ifndef HAVE_COUNTER #warning CT_ASSERT() disabled #define CT_ASSERT(...) #else #define CT_NAMED_ASSERT(name,x) \ typedef int _GENSYM(name ## _ctassert_)[-((x)==0)] #define CT_ASSERT(x) CT_NAMED_ASSERT(,x) #define _GENSYM(x) _CONCAT(x,__COUNTER__) #define _CONCAT1(x,y) x##y #define _CONCAT(x,y) _CONCAT1(x,y) #endif /* Only defined in pd-extended. */ #ifndef PD_FLOAT_PRECISION #define PD_FLOAT_PRECISION 32 #endif /* http://www.unix.org/version2/whatsnew/lp64_wp.html */ typedef unsigned long long u64; typedef unsigned int u32; CT_ASSERT(sizeof(u32)==4); CT_ASSERT(sizeof(u64)==8); /* envelope stuff */ /* exponential range for envelopes is 60dB */ #define ENVELOPE_RANGE 0.001 #define ENVELOPE_MAX (1.0 - ENVELOPE_RANGE) #define ENVELOPE_MIN ENVELOPE_RANGE /* convert milliseconds to 1-p, with p a real pole */ static inline t_float milliseconds_2_one_minus_realpole(t_float time) { t_float r; if (time < 0.0) time = 0.0; r = -expm1(1000.0 * log(ENVELOPE_RANGE) / (sys_getsr() * time)); if (!(r < 1.0)) r = 1.0; //post("%f",r); return r; } #if defined(__i386__) || defined(__x86_64__) // type punning code: #if PD_FLOAT_PRECISION == 32 typedef union { unsigned int i; t_float f; } t_flint; /* check if floating point number is denormal */ //#define IS_DENORMAL(f) (((*(unsigned int *)&(f))&0x7f800000) == 0) #define IS_DENORMAL(f) (((((t_flint)(f)).i) & 0x7f800000) == 0) #elif PD_FLOAT_PRECISION == 64 typedef union { unsigned int i[2]; t_float f; } t_flint; #define IS_DENORMAL(f) (((((t_flint)(f)).i[1]) & 0x7ff00000) == 0) #endif // endif PD_FLOAT_PRECISION #else // if not defined(__i386__) || defined(__x86_64__) #define IS_DENORMAL(f) 0 #endif // end if defined(__i386__) || defined(__x86_64__) #endif /* CREB_EXTLIB_UTIL_H */ pd-creb-0.10.0/modules/fdn~.c000066400000000000000000000274001434364737600157110ustar00rootroot00000000000000/* * fdn.c - a feedback delay network (reverb tail) * using a housholder reflection feedback matrix (In - 2/n 11T) * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* TODO: CLEAN UP THIS MESS add delay time generation code add prime calculation routine (for prime delay line lengths) add more diffuse feedback matrix (hadamard) check filtering code */ #include "extlib_util.h" #include #include #include #define FDN_MIN_DECAY_TIME .01 /* #define NBPRIMES int prime[NBPRIMES]; static int isprime(int n) { int i=1; int d,m,p; while(1){ p = prime[i++]; m = n % p; if (m == 0) return 0; // it is a prime d = n / p; if (d < p) return 1; // it is not a prime } } static int initprimes(void) { int i, curprime; prime[0] = 1; prime[1] = 2; curprime = 3; for(i=2; i x->x_ctl.c_maxorder) { post("fdn: this should not happen (panic!) order %d " "is larger than maxorder %d:", order, x->x_ctl.c_maxorder ); exit(1); } x->x_ctl.c_order = order; x->x_ctl.c_leak = -2./ order; x->x_ctl.c_input = 1./ sqrt(order); //???????????????? } static void fdn_print(t_fdn *x) { int i; fprintf(stderr, "fdn: delay coefficients (ms)\n"); for (i=0;ix_ctl.c_order;i++) { fprintf(stderr, "%f ", x->x_ctl.c_length[i]); } fprintf(stderr, "\n"); } static void fdn_reset(t_fdn *x) { int i; if (x->x_ctl.c_buf) memset(x->x_ctl.c_buf, 0, x->x_ctl.c_bufsize * sizeof(t_float)); if (x->x_ctl.c_vectorbuffer) memset(x->x_ctl.c_vectorbuffer, 0, x->x_ctl.c_maxorder * 2 * sizeof(t_float)); } static t_int *fdn_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *outr = (t_float *)(w[4]); t_float *outl = (t_float *)(w[5]); t_fdnctl *ctl = (t_fdnctl *)(w[1]); t_int n = (t_int)(w[2]); t_float input = ctl->c_input; t_float output = ctl->c_output; t_float *gain_in = ctl->c_gain_in; t_float *gain_state = ctl->c_gain_state; t_int order = ctl->c_order; t_int *tap = ctl->c_tap; t_float *buf = ctl->c_buf; t_int mask = ctl->c_bufsize - 1; t_int i,j; t_float x,y,v,left,right,z; t_float filt_in, filt_last; t_float *cvec, *lvec; t_float save; for(i=0;ic_vector[ctl->c_curvector]; lvec = ctl->c_vector[ctl->c_curvector ^ 1]; ctl->c_curvector ^= 1; /* read input vector + get sum and left/right output*/ for(j=0;jc_leak; /* perform feedback */ /* todo: decouple feedback & permutation */ save = cvec[0]; for (j=0; jx_ctl.c_fsample = sp[0]->s_sr; dsp_add(fdn_perform, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec); } static void fdn_free(t_fdn *x) { if ( x->x_ctl.c_tap) free( x->x_ctl.c_tap); if ( x->x_ctl.c_length) free( x->x_ctl.c_length); if ( x->x_ctl.c_gain_in) free( x->x_ctl.c_gain_in); if ( x->x_ctl.c_gain_state) free( x->x_ctl.c_gain_state); if ( x->x_ctl.c_buf) free ( x->x_ctl.c_buf); if ( x->x_ctl.c_vectorbuffer) free ( x->x_ctl.c_vectorbuffer ); } /* each delay line is filtered with a first order iir filter: (gl: dc gain, gh: ny gain) H(z) = 2 gl gh / (gl + gh - z^-1 (gl - gh)) this results in the difference equation yk = (2 gl gh ) / (gl + gh) x + (gl - gh) / (gl + gh) yk-1 */ static void fdn_time(t_fdn *x, t_float timelow, t_float timehigh){ t_float elow, ehigh; t_int i; t_float gainlow, gainhigh, gainscale; if (timelow < FDN_MIN_DECAY_TIME) timelow = FDN_MIN_DECAY_TIME; if (timehigh < FDN_MIN_DECAY_TIME) timehigh = FDN_MIN_DECAY_TIME; elow = -.003 / (timelow); ehigh = -.003 / (timehigh); /* setup gains */ for(i=0;ix_ctl.c_order;i++){ gainlow = pow(10, elow * (x->x_ctl.c_length[i])); gainhigh = pow(10, ehigh * (x->x_ctl.c_length[i])); gainscale = 1.0f / (gainlow + gainhigh); x->x_ctl.c_gain_in[i] = 2.0f * gainlow * gainhigh * gainscale; x->x_ctl.c_gain_state[i] = (gainlow - gainhigh) * gainscale; } x->x_ctl.c_timehigh = timehigh; x->x_ctl.c_timelow = timelow; } static void fdn_updatedamping(t_fdn *x) { fdn_time(x, x->x_ctl.c_timelow, x->x_ctl.c_timehigh); } static void fdn_timelow(t_fdn *x, t_float f){ x->x_ctl.c_timelow = fabs(f); fdn_updatedamping(x); } static void fdn_timehigh(t_fdn *x, t_float f){ x->x_ctl.c_timehigh = fabs(f); fdn_updatedamping(x); } static void fdn_setupdelayline(t_fdn *x){ int sum, t, n; int mask = x->x_ctl.c_bufsize - 1; int start = x->x_ctl.c_tap[0]; t_int *tap = x->x_ctl.c_tap; t_float *length = x->x_ctl.c_length; t_float scale = sys_getsr() * .001f; sum = 0; tap[0] = (start & mask); for (t=1; t<= x->x_ctl.c_order; t++){ sum += (int)(length[t-1] * scale); tap[t]=(start+sum)&mask; } if (sum > mask){ post("fdn: warning: not enough delay memory, behaviour " "is undefined (this could lead to instability...)"); } } static void fdn_list (t_fdn *x, t_symbol *s, int argc, t_atom *argv){ int i; t_float l; int sum=0; int order = argc & 0xfffffffc; if (order < 4) return; if (order > x->x_ctl.c_maxorder) return; fdn_order(x, order); for(i=0; ix_ctl.c_length[i] = argv[i].a_w.w_float; fdn_setupdelayline(x); fdn_updatedamping(x); } static void fdn_linear(t_fdn *x, t_float forder, t_float min, t_float max) { t_int order = ((int)forder) & 0xfffffffc; t_float length, inc; t_int i; if (order < 4) return; if (order > x->x_ctl.c_maxorder) return; if (min <= 0) return; if (max <= 0) return; inc = (max - min) / (t_float)(order - 1); length = min; for (i=0; ix_ctl.c_length[i] = length; length += inc; } fdn_order(x, order); fdn_setupdelayline(x); fdn_updatedamping(x); } static void fdn_exponential(t_fdn *x, t_float forder, t_float min, t_float max) { t_int order = ((int)forder) & 0xfffffffc; t_float length, inc; t_int i; if (order < 4) return; if (order > x->x_ctl.c_maxorder) return; if (min <= 0) return; if (max <= 0) return; inc = pow (max / min, 1.0f / ((t_float)(order - 1))); length = min; for (i=0; ix_ctl.c_length[i] = length; length *= inc; } fdn_order(x, order); fdn_setupdelayline(x); fdn_updatedamping(x); } t_class *fdn_class; static void *fdn_new(t_floatarg maxiorder, t_floatarg maxibufsize) { t_int order = maxiorder; t_int bufround; t_fdn *x = (t_fdn *)pd_new(fdn_class); t_float scale = sys_getsr() * .001f; t_int bufsize = (t_int)(scale * maxibufsize); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("timelow")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("timehigh")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); /* init data */ if (order < 4) order = 8; if (bufsize < 64) bufsize = 65536; bufround = 1; while (bufround < bufsize) bufround *= 2; bufsize = bufround; post("fdn: maximum nb of delay lines %d, total buffer " "size %d samples (%f seconds)", order, bufsize, ((t_float)bufsize) / sys_getsr()); x->x_ctl.c_maxorder = order; x->x_ctl.c_buf = (t_float *)malloc(sizeof(t_float) * bufsize); x->x_ctl.c_bufsize = bufsize; x->x_ctl.c_fsample = sys_getsr(); x->x_ctl.c_tap = (t_int *)malloc((order + 1) * sizeof(t_int)); x->x_ctl.c_length = (t_float *)malloc(order * sizeof(t_int)); x->x_ctl.c_gain_in = (t_float *)malloc(order * sizeof(t_float)); x->x_ctl.c_gain_state = (t_float *)malloc(order * sizeof(t_float)); x->x_ctl.c_vectorbuffer = (t_float *)malloc(order * 2 * sizeof(t_float)); memset(x->x_ctl.c_vectorbuffer, 0, order * 2 * sizeof(t_float)); x->x_ctl.c_curvector = 0; x->x_ctl.c_vector[0] = &x->x_ctl.c_vectorbuffer[0]; x->x_ctl.c_vector[1] = &x->x_ctl.c_vectorbuffer[order]; /* preset */ fdn_order(x,8); x->x_ctl.c_length[0]= 29.0f; x->x_ctl.c_length[1]= 31.0f; x->x_ctl.c_length[2]= 37.0f; x->x_ctl.c_length[3]= 67.0f; x->x_ctl.c_length[4]= 82.0f; x->x_ctl.c_length[5]= 110.0f; x->x_ctl.c_length[6]= 172.0f; x->x_ctl.c_length[7]= 211.0f; fdn_setupdelayline(x); fdn_time(x, 4, 1); /* reset delay memory to zero */ fdn_reset(x); return (void *)x; } void fdn_tilde_setup(void) { //post("fdn~ v0.1"); fdn_class = class_new(gensym("fdn~"), (t_newmethod)fdn_new, (t_method)fdn_free, sizeof(t_fdn), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(fdn_class, t_fdn, x_f); class_addmethod(fdn_class, (t_method)fdn_print, gensym("print"), 0); class_addmethod(fdn_class, (t_method)fdn_reset, gensym("reset"), 0); class_addmethod(fdn_class, (t_method)fdn_timehigh, gensym("timehigh"), A_DEFFLOAT, 0); class_addmethod(fdn_class, (t_method)fdn_timelow, gensym("timelow"), A_DEFFLOAT, 0); class_addmethod(fdn_class, (t_method)fdn_list, gensym("lines"), A_GIMME, 0); class_addmethod(fdn_class, (t_method)fdn_dsp, gensym("dsp"), 0); class_addmethod(fdn_class, (t_method)fdn_linear, gensym("linear"), A_FLOAT, A_FLOAT, A_FLOAT, 0); class_addmethod(fdn_class, (t_method)fdn_exponential, gensym("exponential"), A_FLOAT, A_FLOAT, A_FLOAT, 0); } pd-creb-0.10.0/modules/ffpoly.c000066400000000000000000000071721434364737600162470ustar00rootroot00000000000000/* * ffpoly.c - compute a finite field polynomial * Copyright (c) by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "m_pd.h" #include typedef struct ffpoly_struct { t_object x_obj; t_float x_f; t_outlet *x_outlet; t_int *x_coef; t_int x_poly_order; t_int x_field_order; t_int x_lastpackedcoef; } t_ffpoly; static void ffpoly_compute(t_ffpoly *x, t_floatarg fcoef) { int in = (int)fcoef; int fo = x->x_field_order; int po = x->x_poly_order; t_int* c = x->x_coef; int i, out; in %= fo; if (in < 0) in += fo; out = c[po]; for (i=po-1; i>=0; i--){ out *= in; out += c[i]; out %= fo; } outlet_float(x->x_outlet, (t_float)out); } /* this sets all coefficients given one float */ static void ffpoly_coefficients(t_ffpoly *x, t_floatarg fcoef) { int coef = (int)fcoef; int i; if (coef < 0) coef = -coef; x->x_lastpackedcoef = coef; for (i=0; ix_poly_order + 1; i++){ x->x_coef[i] = coef % x->x_field_order; coef = coef / x->x_field_order; } } /* this sets one coefficient */ static void ffpoly_coef(t_ffpoly *x, t_floatarg index, t_floatarg val) { int i = (int)index; int v = (int)val; if (i<0) return; if (i>x->x_poly_order) return; v %= x->x_field_order; if (v<0) v += x->x_field_order; x->x_coef[i] = v; } static void ffpoly_fieldorder(t_ffpoly *x, t_floatarg ffieldorder) { int i; int order = (int)ffieldorder; if (order < 2) order = 2; x->x_field_order = order; for (i=0; ix_poly_order+1; i++) x->x_coef[i] %= x->x_field_order; //ffpoly_coefficients(x, x->x_lastpackedcoef); } static void ffpoly_free(t_ffpoly *x) { free (x->x_coef); } t_class *ffpoly_class; static void *ffpoly_new(t_floatarg fpolyorder, t_floatarg ffieldorder) { t_int polyorder = (int)fpolyorder; t_int fieldorder = (int)ffieldorder; t_ffpoly *x = (t_ffpoly *)pd_new(ffpoly_class); if (polyorder < 1) polyorder = 1; if (fieldorder < 2) fieldorder = 2; x->x_poly_order = polyorder; x->x_field_order = fieldorder; x->x_coef = (t_int *)malloc((x->x_poly_order + 1) * sizeof(int)); /* set poly to f(x) = x */ ffpoly_coefficients(x, x->x_field_order); x->x_outlet = outlet_new(&x->x_obj, &s_float); return (void *)x; } #ifdef __cplusplus extern "C" { #endif void ffpoly_setup(void) { ffpoly_class = class_new(gensym("ffpoly"), (t_newmethod)ffpoly_new, (t_method)ffpoly_free, sizeof(t_ffpoly), 0, A_DEFFLOAT, A_DEFFLOAT, A_NULL); class_addmethod(ffpoly_class, (t_method)ffpoly_coefficients, gensym("coefficients"), A_FLOAT, A_NULL); class_addmethod(ffpoly_class, (t_method)ffpoly_coef, gensym("coef"), A_FLOAT, A_FLOAT, A_NULL); class_addmethod(ffpoly_class, (t_method)ffpoly_fieldorder, gensym("order"), A_FLOAT, A_NULL); class_addfloat(ffpoly_class, (t_method)ffpoly_compute); } #ifdef __cplusplus } #endif pd-creb-0.10.0/modules/fht~.c000066400000000000000000000050271434364737600157240ustar00rootroot00000000000000/* * fht.c - Code for some fourrier transform variants and utility * functions. Data organization is in (real, imag) pairs the first 2 * components are (DC, NY) * * Copyright (c) 2000-2003 by Tom Schouten * * Restructured code to separate objects and library blob mode * Fred Jan Kraan, 2020-01-12 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #define MAXORDER 64 typedef struct fhtctl { t_int c_levels; char c_name[16]; t_int *c_clutter; t_int *c_unclutter; t_int c_kill_DC; t_int c_kill_NY; } t_fhtctl; typedef struct fht { t_object x_obj; t_float x_f; t_fhtctl x_ctl; } t_fht; t_class *fht_class; static t_int *fht_perform(t_int *w) { // t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); // t_fhtctl *ctl = (t_fhtctl *)(w[1]); t_int n = (t_int)(w[2]); mayer_fht(out, n); return (w+5); } static void fht_dsp(t_fht *x, t_signal **sp) { int n = sp[0]->s_n; t_float *in = sp[0]->s_vec; t_float *out = sp[1]->s_vec; if (in != out) { dsp_add_copy(in, out, n); in = out; } dsp_add(fht_perform, 4, &x->x_ctl, n, in, out); } static void fht_free(t_fht *x) { if (x->x_ctl.c_clutter) free(x->x_ctl.c_clutter); if (x->x_ctl.c_unclutter) free(x->x_ctl.c_unclutter); } static void *fht_new(void) { t_fht *x = (t_fht *)pd_new(fht_class); outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; sprintf(x->x_ctl.c_name,"fht"); return (void *)x; } void fht_tilde_setup(void) { //post("fht~ v0.1"); fht_class = class_new(gensym("fht~"), (t_newmethod)fht_new, (t_method)fht_free, sizeof(t_fht), 0, 0); CLASS_MAINSIGNALIN(fht_class, t_fht, x_f); class_addmethod(fht_class, (t_method)fht_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/filters.h000066400000000000000000000111451434364737600164200ustar00rootroot00000000000000/* this file contains a 37th attempt to write a general purpose iir filter toolset */ /* defined as inline functions with call by reference to enable compiler ref/deref optim */ /* the typedef */ #ifndef T #define T t_float #endif /* the prototype for a word */ #define P static inline void #define PP static void /* the 'reference' arguments */ #define A *a #define B *b #define C *c #define D *d #define X *x #define Y *y #define S *s /* the opcodes */ /* add */ P cadd (T X, T Y, T A, T B, T C, T D) { X = A + C; Y = B + D;} P cadd2 (T A, T B, T C, T D) { A += C; B += D;} P vcadd (T X, T A, T C) { cadd(x,x+1,a,a+1,c,c+1); } P vcadd2 (T A, T C) { cadd2(a,a+1,c,c+1); } /* mul */ P cmul_r (T X, T A, T B, T C, T D) { X = A * C - B * D;} P cmul_i (T Y, T A, T B, T C, T D) { Y = A * D + B * C;} P cmul (T X, T Y, T A, T B, T C, T D) { cmul_r (x, a, b, c, d); cmul_i (y, a, b, c, d); } P cmul2 (T A, T B, T C, T D) { T x = A; T y = B; cmul (&x, &y, a, b, c, d); A = x; B = y; } P vcmul (T X, T A, T C) { cmul(x,x+1,a,a+1,c,c+1); } P vcmul2 (T A, T C) { cmul2(a,a+1,c,c+1); } /* norm */ static inline t_float vcnorm(T X) { return hypot(x[0], x[1]); } /* swap */ P vcswap(T Y, T X) { t_float t[2] = {x[0], x[1]}; x[0] = y[0]; x[1] = y[1]; y[0] = t[0]; y[1] = t[1]; } /* inverse */ P vcinv(T Y, T X) { t_float scale = 1.0 / vcnorm(x); y[0] = scale * x[0]; y[1] = scale * x[1]; } P vcinv1(T X) { t_float scale = 1.0 / vcnorm(x); x[0] *= scale; x[1] *= scale; } /* exp */ /* X = exp(Y) */ P vcexp2 (T Y, T X) { T r = exp(x[0]); y[0] = cos (x[1]); y[1] = sin (x[1]); y[0] *= r; y[1] *= r; } P vcexp1 (T X) { T y[2]; vcexp2(y,x); x[0] = y[0]; x[1] = y[1]; } /* FILTERS the transfer function is defined in terms of the "engineering" bilateral z-transform of the discrete impulse response h[n]. H(z) = Sum{n = -inf -> inf} h[n] z^(-n) a unit delay operating on a singnal S(z) is therefore represented as z^(-1) S(z) */ /* biquads */ /* biquad, orthogonal (poles & zeros), real in, out, state, pole, output */ P biq_orth_r (T X, T Y, T S, T A, T C) { Y = X + c[0] * s[0] - c[1] * s[1]; /* mind sign of c[1] */ vcmul2(s, a); S += X; } /* biquad, orthogonal, complex one-pole, with scaling */ /* complex one pole: (output = s[0] + is[1]): C / (1-A z^(-1)) */ P one_pole_complex (T X, T Y, T S, T A, T C) { vcmul(y, s, a); vcadd2(y, x); s[0] = y[0]; s[1] = y[1]; vcmul(y, s, c); } /* complex conj two pole: (output = s[0] : (Re(C) - Re(C*Conj(A))) / (1 - A z^(-1)) (1 - Conj(A) z^(-1)) */ P two_pole_complex_conj (T X, T Y, T S, T A, T C) { vcmul2(s, a); s[0] += x[0]; y[0] = s[0] * c[0] - s[1] * c[1]; } /* support functions for IIR filter design */ /* evaluate pole and allzero TF in z^-1 given the complex zeros/poles: p(z) (or p(z)^-1) = \product (1-z_i z^-1) */ #if 0 PP eval_zero_poly(t_float *val, t_float *arg, t_float *zeros, int nb_zeros) { int i; t_float a[2] = {arg[0], arg[1]}; vcinv1(a); val[0] = 1.0; val[1] = 0.0; a[0] *= -1; a[1] *= -1; for (i=0; i #define SEQL 16 typedef struct fwarp { t_object t_ob; t_outlet *x_out; } t_fwarp; static void fwarp_float(t_fwarp *x, t_floatarg f) { t_float twopi = 2.0f * M_PI; t_float sr = sys_getsr(); f /= sr; f = tan(twopi * f) / twopi; outlet_float(x->x_out, f * sr); } static void fwarp_free(void) { } t_class *fwarp_class; static void *fwarp_new(void) { t_fwarp *x = (t_fwarp *)pd_new(fwarp_class); x->x_out = outlet_new(&x->t_ob, gensym("float")); return (void *)x; } void fwarp_setup(void) { fwarp_class = class_new(gensym("fwarp"), (t_newmethod)fwarp_new, (t_method)fwarp_free, sizeof(t_fwarp), 0, 0); class_addfloat(fwarp_class, fwarp_float); } pd-creb-0.10.0/modules/ibfft~.c000066400000000000000000000102741434364737600162350ustar00rootroot00000000000000/* * bifft.c - Code for some fourrier transform variants and utility * functions. Data organization is in (real, imag) pairs the first 2 * components are (DC, NY) * * Copyright (c) 2000-2003 by Tom Schouten * * Restructured code to separate objects and library blob mode * Fred Jan Kraan, 2020-01-12 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #define MAXORDER 64 typedef struct ibfftctl { t_int c_levels; char c_name[16]; t_int *c_clutter; t_int *c_unclutter; t_int c_kill_DC; t_int c_kill_NY; } t_ibfftctl; typedef struct ibfft { t_object x_obj; t_float x_f; t_ibfftctl x_ctl; } t_ibfft; t_class *ibfft_class; static inline void ibfft_perform_permutation(t_float *S, int n, t_int *f) { t_int k,l; t_float swap; for(k=0; kx_ctl; int i; if (ctl->c_clutter) free(ctl->c_clutter); if (ctl->c_unclutter) free(ctl->c_unclutter); ctl->c_clutter = (t_int *)malloc(n*sizeof(t_int)); ctl->c_unclutter = (t_int *)malloc(n*sizeof(t_int)); ctl->c_unclutter[0] = 0; ctl->c_unclutter[1] = n/2; for (i=1; ic_unclutter[2*i] = i; ctl->c_unclutter[2*i+1] = n-i; } for(i=0; ic_clutter[ctl->c_unclutter[i]] = i; return; /* debug */ /* for(k=0; kc_clutter[k]); ** for(k=0; kc_unclutter[k]); ** ** exit(1); */ } static t_int *ibfft_perform(t_int *w) { // t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_ibfftctl *ctl = (t_ibfftctl *)(w[1]); t_int n = (t_int)(w[2]); t_float scale = sqrt(1.0f / (t_float)(n)); if (ctl->c_kill_DC) {out[0] = 0.0f;} if (ctl->c_kill_NY) {out[1] = 0.0f;} ibfft_perform_permutation(out, n, ctl->c_clutter); mayer_fht(out, n); while (n--) *out++ *= scale; return (w+5); } static void ibfft_dsp(t_ibfft *x, t_signal **sp) { int n = sp[0]->s_n; t_float *in = sp[0]->s_vec; t_float *out = sp[1]->s_vec; ibfft_permutation(x, n); if (in != out) { dsp_add_copy(in, out, n); in = out; } dsp_add(ibfft_perform, 4, &x->x_ctl, n, in, out); } static void ibfft_free(t_ibfft *x) { if (x->x_ctl.c_clutter) free(x->x_ctl.c_clutter); if (x->x_ctl.c_unclutter) free(x->x_ctl.c_unclutter); } static void *ibfft_new(t_symbol *s) { t_ibfft *x = (t_ibfft *)pd_new(ibfft_class); outlet_new(&x->x_obj, gensym("signal")); if (s == gensym("killDCNY")){ x->x_ctl.c_kill_DC = 1; x->x_ctl.c_kill_NY = 1; post("ibfft: removing DC and NY components."); } else{ x->x_ctl.c_kill_DC = 0; x->x_ctl.c_kill_NY = 0; } x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; sprintf(x->x_ctl.c_name,"ibfft"); return (void *)x; } void ibfft_tilde_setup(void) { //post("ibfft~ v0.1"); ibfft_class = class_new(gensym("ibfft~"), (t_newmethod)ibfft_new, (t_method)ibfft_free, sizeof(t_ibfft), 0, A_DEFSYMBOL, A_NULL); /* add the more logical bifft~ alias */ // class_addcreator((t_newmethod)ibfft_new, // gensym("bifft~"), 0, A_DEFSYMBOL, A_NULL); CLASS_MAINSIGNALIN(ibfft_class, t_ibfft, x_f); class_addmethod(ibfft_class, (t_method)ibfft_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/idwt16~.c000066400000000000000000000074711434364737600162660ustar00rootroot00000000000000/* * idwt.c - code for discrete wavelet transform * (symmetric interpolating biorthogonal wavelets using the lifting transform) * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #include "dwt-common.h" #define MAXORDER 64 t_class *idwt16_class; static t_int *idwt16_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); t_int n = (t_int)(w[2]); int i; int numcoef = 1; int source_u = ((2 - ctl->c_nupdate) - 1) * (n/2); int source_p = ((2 - ctl->c_npredict)) * (n/2); int increment = n; int dest = n/2; int backup_u = (ctl->c_nupdate-1)*n; int backup_p = (ctl->c_npredict-1)*n; int fake_in = ctl->c_fakein; t_float fake_val = ctl->c_fakeval; /* copy input to output */ if (in != out) for (i=0; i= 0) && (fake_inc_permute) dwt_perform_permutation(out, n, ctl->c_clutter); /* backward transform */ /* iterate over all levels */ for (i=0; i < ctl->c_levels; i++){ /* backward update */ dwtloop16(out, (source_u & (n-1)), 0, increment, backup_u, numcoef, n-1, ctl->c_update, 16, -1); /* backward predict */ dwtloop16(out, (source_p & (n-1)), dest, increment, backup_p, numcoef, n-1, ctl->c_predict, 16, +1); /* update control parameters */ numcoef *= 2; source_p /= 2; source_u /= 2; backup_p /= 2; backup_u /= 2; increment /= 2; dest /= 2; } return (w+5); } static void idwt16_dsp(t_dwt *x, t_signal **sp) { int n = sp[0]->s_n; int ln = 0; dwt_permutation(x, n); x->x_ctl.c_mask = n-1; while (n >>= 1) ln++; x->x_ctl.c_levels = ln; dsp_add(idwt16_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void *idwt16_new(t_floatarg permute) { t_dwt *x = (t_dwt *)pd_new(idwt16_class); int i; outlet_new(&x->x_obj, gensym("signal")); /* init data */ dwt_reset(x); x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; x->x_ctl.c_permute = (t_int) permute; sprintf(x->x_ctl.c_name,"idwt16"); x->x_ctl.c_type = IDWT16; return (void *)x; } void idwt16_tilde_setup(void) { //post("idwt16~ v0.1"); idwt16_class = class_new(gensym("idwt16~"), (t_newmethod)idwt16_new, (t_method)dwt_free, sizeof(t_dwt), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(idwt16_class, t_dwt, x_f); class_addmethod(idwt16_class, (t_method)dwt_print, gensym("print"), 0); class_addmethod(idwt16_class, (t_method)idwt16_dsp, gensym("dsp"), 0); class_addmethod(idwt16_class, (t_method)dwt_filter, gensym("predict"), A_GIMME, 0); class_addmethod(idwt16_class, (t_method)dwt_filter, gensym("update"), A_GIMME, 0); class_addmethod(idwt16_class, (t_method)dwt_filter, gensym("mask"), A_GIMME, 0); class_addmethod(idwt16_class, (t_method)idwt_coef, gensym("coef"), A_DEFFLOAT, A_DEFFLOAT, 0); } pd-creb-0.10.0/modules/idwt~.c000066400000000000000000000075561434364737600161230ustar00rootroot00000000000000/* * idwt.c - code for discrete wavelet transform * (symmetric interpolating biorthogonal wavelets using the lifting transform) * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #include "dwt-common.h" #define MAXORDER 64 t_class *idwt_class; static t_int *idwt_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); t_int n = (t_int)(w[2]); int i; int numcoef = 1; int source_u = ((2 - ctl->c_nupdate) - 1) * (n/2); int source_p = ((2 - ctl->c_npredict)) * (n/2); int increment = n; int dest = n/2; int backup_u = (ctl->c_nupdate-1)*n; int backup_p = (ctl->c_npredict-1)*n; int fake_in = ctl->c_fakein; t_float fake_val = ctl->c_fakeval; /* copy input to output */ if (in != out) for (i=0; i= 0) && (fake_inc_permute) dwt_perform_permutation(out, n, ctl->c_clutter); /* backward transform */ /* iterate over all levels */ for (i=0; i < ctl->c_levels; i++){ /* backward update */ dwtloop(out, (source_u & (n-1)), 0, increment, backup_u, numcoef, n-1, ctl->c_update, ctl->c_nupdate, -1); /* backward predict */ dwtloop(out, (source_p & (n-1)), dest, increment, backup_p, numcoef, n-1, ctl->c_predict, ctl->c_npredict, +1); /* update control parameters */ numcoef *= 2; source_p /= 2; source_u /= 2; backup_p /= 2; backup_u /= 2; increment /= 2; dest /= 2; } return (w+5); } static void idwt_dsp(t_dwt *x, t_signal **sp) { int n = sp[0]->s_n; int ln = 0; dwt_permutation(x, n); x->x_ctl.c_mask = n-1; while (n >>= 1) ln++; x->x_ctl.c_levels = ln; dsp_add(idwt_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void *idwt_new(t_floatarg permute) { t_dwt *x = (t_dwt *)pd_new(idwt_class); outlet_new(&x->x_obj, gensym("signal")); /* init data */ dwt_reset(x); x->x_ctl.c_clutter = NULL; x->x_ctl.c_unclutter = NULL; x->x_ctl.c_permute = (t_int) permute; sprintf(x->x_ctl.c_name,"idwt"); x->x_ctl.c_type = IDWT; return (void *)x; } void idwt_tilde_setup(void) { //post("idwt~ v0.1"); idwt_class = class_new(gensym("idwt~"), (t_newmethod)idwt_new, (t_method)dwt_free, sizeof(t_dwt), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(idwt_class, t_dwt, x_f); class_addmethod(idwt_class, (t_method)dwt_print, gensym("print"), 0); class_addmethod(idwt_class, (t_method)idwt_dsp, gensym("dsp"), 0); class_addmethod(idwt_class, (t_method)dwt_filter, gensym("predict"), A_GIMME, 0); class_addmethod(idwt_class, (t_method)dwt_filter, gensym("update"), A_GIMME, 0); class_addmethod(idwt_class, (t_method)dwt_filter, gensym("mask"), A_GIMME, 0); class_addmethod(idwt_class, (t_method)idwt_coef, gensym("coef"), A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(idwt_class, (t_method)dwt_even, gensym("even"), A_DEFFLOAT, 0); } pd-creb-0.10.0/modules/junction~.c000066400000000000000000000106671434364737600170020ustar00rootroot00000000000000/* * junction.c - computes a lossless circulant junction * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include typedef struct junctionctl { t_int c_channels; t_float **c_in; t_float **c_out; t_float *c_buffer; t_float *c_coef; t_float c_norm; } t_junctionctl; typedef struct junction { t_object x_obj; t_float x_f; t_junctionctl x_ctl; } t_junction; void junction_bang(t_junction *x) { int i, n = x->x_ctl.c_channels; t_float *coef = x->x_ctl.c_coef; t_float r; for (i=1; ic_channels; t_float **in = ctl->c_in; t_float **out = ctl->c_out; t_float *buf = ctl->c_buffer; t_float *coef = ctl->c_coef; t_float norm = ctl->c_norm; for (i=0;ix_ctl.c_channels; t_float norm; for (i=0;ix_ctl.c_in[i] = sp[i]->s_vec; x->x_ctl.c_out[i] = sp[i+c]->s_vec; } norm = c; norm = 1. / (norm); x->x_ctl.c_norm = norm; dsp_add(junction_perform, 2, &x->x_ctl, sp[0]->s_n); /* dsp_add(junction_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);*/ } void junction_free(t_junction *x) { if (x->x_ctl.c_in) free (x->x_ctl.c_in); if (x->x_ctl.c_out) free (x->x_ctl.c_out); if (x->x_ctl.c_buffer) free (x->x_ctl.c_buffer); if (x->x_ctl.c_coef) free (x->x_ctl.c_coef); } t_class *junction_class; void *junction_new(t_floatarg channels) { int l = ilog2(channels); int i,n; t_junction *x = (t_junction *)pd_new(junction_class); if (l<2) l = 2; if (l>4) l = 4; n=1; while (l--) n *= 2; for (i=1;ix_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); for (i=0;ix_obj, gensym("signal")); x->x_ctl.c_in = (t_float **)malloc(n*sizeof(t_float *)); x->x_ctl.c_out = (t_float **)malloc(n*sizeof(t_float *)); x->x_ctl.c_buffer = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_coef = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_channels = n; junction_bang(x); return (void *)x; } void junction_tilde_setup(void) { //post("junction~ v0.1"); junction_class = class_new(gensym("junction~"), (t_newmethod)junction_new, (t_method)junction_free, sizeof(t_junction), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(junction_class, t_junction, x_f); class_addmethod(junction_class, (t_method)junction_bang, gensym("bang"), 0); class_addmethod(junction_class, (t_method)junction_random, gensym("random"), A_FLOAT, 0); class_addmethod(junction_class, (t_method)junction_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/lattice~.c000066400000000000000000000067101434364737600165700ustar00rootroot00000000000000/* * lattice.c - a lattice filter for pd * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #define MAXORDER 1024 #define MAXREFCO 0.9999 typedef struct latticesegment { t_float delay; // delay element t_float rc; // reflection coefficient } t_latticesegment; typedef struct latticectl { t_latticesegment c_segment[MAXORDER]; // array of lattice segment data t_int c_segments; } t_latticectl; typedef struct lattice { t_object x_obj; t_float x_f; t_latticectl x_ctl; } t_lattice; static t_int *lattice_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_latticectl *ctl = (t_latticectl *)(w[1]); t_int i,j; t_int n = (t_int)(w[2]); t_float x,rc,d; t_latticesegment* seg = ctl->c_segment; t_int segments = ctl->c_segments; for (i=0; ix_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void lattice_free(void) { } t_class *lattice_class; static void lattice_rc(t_lattice *x, t_float segment, t_float refco) { t_int seg = (t_float)segment; if ((seg >= 0) && (seg < x->x_ctl.c_segments)){ if (refco >= MAXREFCO) refco = MAXREFCO; if (refco <= -MAXREFCO) refco = -MAXREFCO; x->x_ctl.c_segment[seg].rc = refco; } } static void lattice_reset(t_lattice *x) { t_float* buf = (t_float *)x->x_ctl.c_segment; t_int n = x->x_ctl.c_segments; t_int i; for (i=0; ix_obj, gensym("signal")); if (seg < 1) seg = 1; if (seg > MAXORDER) seg = MAXORDER; x->x_ctl.c_segments = seg; lattice_reset(x); return (void *)x; } void lattice_tilde_setup(void) { //post("lattice~ v0.1"); lattice_class = class_new(gensym("lattice~"), (t_newmethod)lattice_new, (t_method)lattice_free, sizeof(t_lattice), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(lattice_class, t_lattice, x_f); class_addmethod(lattice_class, (t_method)lattice_dsp, gensym("dsp"), 0); class_addmethod(lattice_class, (t_method)lattice_reset, gensym("reset"), 0); class_addmethod(lattice_class, (t_method)lattice_rc, gensym("rc"), A_FLOAT, A_FLOAT, 0); } pd-creb-0.10.0/modules/nfft~.c000066400000000000000000000042541434364737600161010ustar00rootroot00000000000000/* * nfft.c - some complex math dsp objects * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #define MINNORM 0.0000000001 t_class *nfft_class; typedef struct nfft { t_object x_obj; t_float x_f; } t_nfft; void nfft_free(void) { } static t_int *nfft_perform(t_int *w) { t_float *inx = (t_float *)(w[2]); t_float *iny = (t_float *)(w[3]); t_float *outx = (t_float *)(w[5]); // clockwize addressing t_float *outy = (t_float *)(w[4]); t_int i; t_int n = (t_int)(w[1]); t_float x; t_float scale = 1.0 / (sqrt((t_float)n)); mayer_fft(n, inx, outx); while (n--){ t_float x = *inx++; t_float y = *iny++; *outx++ = scale * x; *outy++ = scale * y; } return (w+6); } static void nfft_dsp(t_nfft *x, t_signal **sp) { dsp_add(nfft_perform, 5, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec); } t_nfft *nfft_new(void) { t_nfft *x = (t_nfft *)pd_new(nfft_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); return x; } void nfft_tilde_setup(void) { nfft_class = class_new(gensym("nfft~"), (t_newmethod)nfft_new, (t_method)nfft_free, sizeof(t_nfft), 0, 0); CLASS_MAINSIGNALIN(nfft_class, t_nfft, x_f); class_addmethod(nfft_class, (t_method)nfft_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/nifft~.c000066400000000000000000000043041434364737600162460ustar00rootroot00000000000000/* * nifft.c - some complex math dsp objects * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #define MINNORM 0.0000000001 t_class *nifft_class; typedef struct nifft { t_object x_obj; t_float x_f; } t_nifft; void nifft_free(void) { } static t_int *nifft_perform(t_int *w) { t_float *inx = (t_float *)(w[2]); t_float *iny = (t_float *)(w[3]); t_float *outx = (t_float *)(w[5]); // clockwize addressing t_float *outy = (t_float *)(w[4]); t_int i; t_int n = (t_int)(w[1]); t_float x; t_float scale = 1.0 / (sqrt((t_float)n)); mayer_fft(n, inx, outx); while (n--){ t_float x = *inx++; t_float y = *iny++; *outx++ = scale * x; *outy++ = scale * y; } return (w+6); } static void nifft_dsp(t_nifft *x, t_signal **sp) { dsp_add(nifft_perform, 5, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec); } t_nifft *nifft_new(void) { t_nifft *x = (t_nifft *)pd_new(nifft_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); return x; } void nifft_tilde_setup(void) { nifft_class = class_new(gensym("nifft~"), (t_newmethod)nifft_new, (t_method)nifft_free, sizeof(t_nifft), 0, 0); CLASS_MAINSIGNALIN(nifft_class, t_nifft, x_f); class_addmethod(nifft_class, (t_method)nifft_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/permut~.c000066400000000000000000000077141434364737600164640ustar00rootroot00000000000000/* * permut.c - applies a (random) permutation on a signal block * intended for spectral processing, dynwav * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include //#include "m_pd.h" #include "extlib_util.h" typedef union { float f; unsigned int i; }t_permutflint; typedef struct permutctl { char c_type; t_int *c_permutationtable; int c_blocksize; } t_permutctl; typedef struct permut { t_object x_obj; t_float x_f; t_permutctl x_ctl; } t_permut; static inline void permut_perform_permutation(t_float *S, int n, t_int *f) { t_int k,l; t_float swap; for(k=0; kx_ctl.c_blocksize; int mask = N-1; t_int *p = x->x_ctl.c_permutationtable; int r, last = 0; t_permutflint flintseed; flintseed.f = (float)seed; srand(flintseed.i); if(p) { p[0] = rand() & mask; for (i=1;ix_ctl.c_blocksize != size) { if (x->x_ctl.c_permutationtable) free(x->x_ctl.c_permutationtable); x->x_ctl.c_permutationtable = (t_int *)malloc(sizeof(int)*size); x->x_ctl.c_blocksize = size; /* make sure it's initialized */ permut_bang(x); } } static t_int *permut_perform(t_int *w) { t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); t_permutctl *ctl = (t_permutctl *)(w[1]); t_int i; t_int n = (t_int)(w[2]); t_float x,y; t_int *p = ctl->c_permutationtable; if (in != out) for (i=0; is_n); dsp_add(permut_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } static void permut_free(t_permut *x) { if (x->x_ctl.c_permutationtable) free(x->x_ctl.c_permutationtable); } t_class *permut_class; static void *permut_new(void) { t_permut *x = (t_permut *)pd_new(permut_class); outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_permutationtable = 0; x->x_ctl.c_blocksize = 0; permut_resize_table(x, 64); permut_random(x, 0); return (void *)x; } void permut_tilde_setup(void) { //post("permut~ v0.1"); permut_class = class_new(gensym("permut~"), (t_newmethod)permut_new, (t_method)permut_free, sizeof(t_permut), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(permut_class, t_permut, x_f); class_addmethod(permut_class, (t_method)permut_random, gensym("random"), A_FLOAT, 0); class_addmethod(permut_class, (t_method)permut_bang, gensym("bang"), 0); class_addmethod(permut_class, (t_method)permut_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/qmult~.c000066400000000000000000000066161434364737600163120ustar00rootroot00000000000000/* * qmult.c - quaternion multiplication dsp object * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include typedef struct qmultctl { t_float *c_inputleft[4]; t_float *c_inputright[4]; t_float *c_output[4]; } t_qmultctl; typedef struct qmult { t_object x_obj; t_float x_f; t_qmultctl x_ctl; } t_qmult; static t_int *qmult_perform(t_int *word) { t_qmultctl *ctl = (t_qmultctl *)(word[1]); t_int n = (t_int)(word[2]); t_int i; t_float *in0l = ctl->c_inputleft[0]; t_float *in1l = ctl->c_inputleft[1]; t_float *in2l = ctl->c_inputleft[2]; t_float *in3l = ctl->c_inputleft[3]; t_float *in0r = ctl->c_inputright[0]; t_float *in1r = ctl->c_inputright[1]; t_float *in2r = ctl->c_inputright[2]; t_float *in3r = ctl->c_inputright[3]; t_float *out0 = ctl->c_output[0]; t_float *out1 = ctl->c_output[1]; t_float *out2 = ctl->c_output[2]; t_float *out3 = ctl->c_output[3]; t_float wl, xl, yl, zl; t_float wr, xr, yr, zr; t_float w, x, y, z; for (i=0;ix_ctl.c_inputleft[i] = sp[i]->s_vec; x->x_ctl.c_inputright[i] = sp[i+4]->s_vec; x->x_ctl.c_output[i] = sp[i+8]->s_vec; } dsp_add(qmult_perform, 2, &x->x_ctl, sp[0]->s_n); } static void qmult_free(t_qmult *x) { } t_class *qmult_class; static void *qmult_new(t_floatarg channels) { int i; t_qmult *x = (t_qmult *)pd_new(qmult_class); for (i=1;i<8;i++) inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); for (i=0;i<4;i++) outlet_new(&x->x_obj, gensym("signal")); return (void *)x; } void qmult_tilde_setup(void) { //post("qmult~ v0.1"); qmult_class = class_new(gensym("qmult~"), (t_newmethod)qmult_new, (t_method)qmult_free, sizeof(t_qmult), 0, 0); CLASS_MAINSIGNALIN(qmult_class, t_qmult, x_f); class_addmethod(qmult_class, (t_method)qmult_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/qnorm~.c000066400000000000000000000056241434364737600163020ustar00rootroot00000000000000/* * qnorm.c - quaternion normalization dsp object * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include typedef struct qnormctl { t_float *c_input[4]; t_float *c_output[4]; } t_qnormctl; typedef struct qnorm { t_object x_obj; t_float x_f; t_qnormctl x_ctl; } t_qnorm; static t_int *qnorm_perform(t_int *word) { t_qnormctl *ctl = (t_qnormctl *)(word[1]); t_int n = (t_int)(word[2]); t_int i; t_float *in0 = ctl->c_input[0]; t_float *in1 = ctl->c_input[1]; t_float *in2 = ctl->c_input[2]; t_float *in3 = ctl->c_input[3]; t_float *out0 = ctl->c_output[0]; t_float *out1 = ctl->c_output[1]; t_float *out2 = ctl->c_output[2]; t_float *out3 = ctl->c_output[3]; t_float w, x, y, z; t_float norm; t_float inorm; for (i=0;ix_ctl.c_input[i] = sp[i]->s_vec; x->x_ctl.c_output[i] = sp[i+4]->s_vec; } dsp_add(qnorm_perform, 2, &x->x_ctl, sp[0]->s_n); } static void qnorm_free(t_qnorm *x) { } t_class *qnorm_class; static void *qnorm_new(t_floatarg channels) { int i; t_qnorm *x = (t_qnorm *)pd_new(qnorm_class); for (i=1;i<4;i++) inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); for (i=0;i<4;i++) outlet_new(&x->x_obj, gensym("signal")); return (void *)x; } void qnorm_tilde_setup(void) { //post("qnorm~ v0.1"); qnorm_class = class_new(gensym("qnorm~"), (t_newmethod)qnorm_new, (t_method)qnorm_free, sizeof(t_qnorm), 0, 0); CLASS_MAINSIGNALIN(qnorm_class, t_qnorm, x_f); class_addmethod(qnorm_class, (t_method)qnorm_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/ramp-common.h000066400000000000000000000036001434364737600171720ustar00rootroot00000000000000/* * ramp-common.h - retriggerable counter for dsp signals * Copyright (c) 2000-2003 by Tom Schouten * * Restructuring for independent objects and library blob mode by * Fred Jan Kraan 2020-01-12 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #ifndef RAMPCOMMON typedef struct rampctl { t_float c_offset; t_int c_blockscale; } t_rampctl; typedef struct ramp { t_object x_obj; t_float x_f; t_rampctl x_ctl; } t_ramp; void ramp_offset(t_ramp *x, t_floatarg f) { x->x_ctl.c_offset = f; } void ramp_bang(t_ramp *x) { ramp_offset(x, 0); } static t_int *ramp_perform(t_int *w) { t_float *out = (t_float *)(w[3]); t_rampctl *ctl = (t_rampctl *)(w[1]); t_int i; t_int n = (t_int)(w[2]); t_float x; t_float scale = ctl->c_blockscale ? 1.0 / (t_float)n : 1.0; x = ctl->c_offset; for (i = 0; i < n; i++) { *out++ = ((t_float)x++) * scale; } ctl->c_offset = x; /* save state */ return (w+4); } static void ramp_dsp(t_ramp *x, t_signal **sp) { dsp_add(ramp_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec); } void ramp_free(void) { } #define RAMPCOMMON #endif pd-creb-0.10.0/modules/ramp~.c000066400000000000000000000030541434364737600161000ustar00rootroot00000000000000/* * ramp.c - retriggerable counter for dsp signals * Copyright (c) 2000-2003 by Tom Schouten * * Restructuring for independent objects and library blob mode by * Fred Jan Kraan 2020-01-12 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include "ramp-common.h" t_class *ramp_class; void *ramp_new(void) { t_ramp *x = (t_ramp *)pd_new(ramp_class); outlet_new(&x->x_obj, gensym("signal")); x->x_ctl.c_blockscale = 0; ramp_bang(x); return (void *)x; } void ramp_tilde_setup(void) { //post("ramp~ v0.1"); ramp_class = class_new(gensym("ramp~"), (t_newmethod)ramp_new, (t_method)ramp_free, sizeof(t_ramp), 0, 0); class_addmethod(ramp_class, (t_method)ramp_bang, gensym("bang"), 0); class_addmethod(ramp_class, (t_method)ramp_dsp, gensym("dsp"), 0); class_addfloat(ramp_class, (t_method)ramp_offset); } pd-creb-0.10.0/modules/ratio.c000066400000000000000000000031131434364737600160550ustar00rootroot00000000000000/* * ratio.c - multiplies by 2^k such that output is between 1 and 2 * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #define SEQL 16 typedef struct{ } t_ratio_data; typedef struct ratio { t_object t_ob; t_outlet *x_out; t_ratio_data x_c; } t_ratio; static void ratio_float(t_ratio *x, t_floatarg f) { f = (f<0)?(-f):(f); if (f) { while (f < 1.0) f *= 2.0; while (f >= 2.0) f *= 0.5; } outlet_float(x->x_out, f); } static void ratio_free(void) { } t_class *ratio_class; static void *ratio_new(void) { t_ratio *x = (t_ratio *)pd_new(ratio_class); x->x_out = outlet_new(&x->t_ob, gensym("float")); return (void *)x; } void ratio_setup(void) { ratio_class = class_new(gensym("ratio"), (t_newmethod)ratio_new, (t_method)ratio_free, sizeof(t_ratio), 0, 0); class_addfloat(ratio_class, ratio_float); } pd-creb-0.10.0/modules/resofilt~.c000066400000000000000000000250351434364737600167730ustar00rootroot00000000000000/* * resofilt.c - some high quality time variant filters * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* some (expensive) time variant iir filters, i.e. moog 4-pole transfer function using the impulse invariant transform with self osc and signal freq and reso inputs */ #include "m_pd.h" #include #include #include #include #include "filters.h" typedef struct resofiltctl { t_float c_state[4]; /* filter state */ t_float c_f_prev; t_float c_r_prev; } t_resofiltctl; typedef struct resofilt { t_object x_obj; t_float x_f; t_resofiltctl x_ctl; t_perfroutine x_dsp; } t_resofilt; static inline void _sat_state(t_float *x) { const t_float norm_squared_max = 1.0; t_float norm_squared = x[0] * x[0] + x[1] * x[1]; if (norm_squared > norm_squared_max){ t_float scale = 1.0 / sqrt(norm_squared); x[0] *= scale; x[1] *= scale; } } /* the moog vcf discretized with an impulse invariant transform */ static t_int *resofilt_perform_fourpole(t_int *w) { t_resofiltctl *ctl = (t_resofiltctl *)(w[1]); t_int n = (t_int)(w[2]); t_float *in = (t_float *)(w[3]); t_float *freq = (t_float *)(w[4]); t_float *reso = (t_float *)(w[5]); t_float *out = (t_float *)(w[6]); int i; t_float inv_n = 1.0 / ((t_float)n); t_float inv_sr = 1.0 / sys_getsr(); t_float phasor[2], phasor_rot[2]; t_float radior[2], radior_rot[2]; t_float scalor, scalor_inc; t_float f,r,freq_rms,reso_rms; t_float f_prev = ctl->c_f_prev; t_float r_prev = ctl->c_r_prev; /* use rms of input to drive freq and reso. this is such that connecting a dsp signal to the inlets has a reasonable result, even if the inputs are oscillatory. the rms values will be interpolated linearly (that is, linearly in the "analog" domain, so exponentially in the z-domain) */ reso_rms = freq_rms = 0.0; for (i=0; i1), >1 == self osc */ t_float _reso = *reso++; freq_rms += _freq * _freq; reso_rms += _reso * _reso; } freq_rms = sqrt(freq_rms * inv_n) * inv_sr; reso_rms = sqrt(reso_rms * inv_n); f = (freq_rms > 0.5) ? 0.5 : freq_rms; r = sqrt(sqrt(reso_rms)); /* calculate the new pole locations. we use an impulse invariant transform: the moog vcf poles are located at s_p = (-1 +- r \sqrt{+- j}, with r = (k/4)^(1/4) \in [0,1] the poles are always complex, so we can use an orthogonal implementation both conj pole pairs have the same angle, so we can use one phasor and 2 radii */ /* compute phasor, radius and update eqs since these are at k-rate, the expense is justifyable */ phasor[0] = cos(2.0 * M_PI * r_prev * f_prev); phasor[1] = sin(2.0 * M_PI * r_prev * f_prev); phasor_rot[0] = cos(2.0 * M_PI * (r*f - r_prev*f_prev) * inv_n); phasor_rot[1] = sin(2.0 * M_PI * (r*f - r_prev*f_prev) * inv_n); radior[0] = exp(f_prev * (-1.0 + r_prev)); /* dominant radius */ radior[1] = exp(f_prev * (-1.0 - r_prev)); radior_rot[0] = exp((f*(-1.0f + r) - f_prev * (-1.0 + r_prev)) * inv_n); radior_rot[1] = exp((f*(-1.0f - r) - f_prev * (-1.0 - r_prev)) * inv_n); /* moog like scaling */ if (1){ t_float r2 = r_prev * r_prev; t_float r4 = r2 * r2; scalor = 1.0f + (1.0 + 4.0 * r4); r2 = r * r; r4 = r2 * r2; scalor_inc = ((1.0 + (1.0 + 4.0 * r4)) - scalor) * inv_n; } /* no scaling */ else{ scalor = 1.0; scalor_inc = 0.0; } ctl->c_f_prev = f; ctl->c_r_prev = r; /* perform filtering */ for (i=0; ic_state; t_float *stateB = ctl->c_state+2; t_float x; /* compute poles */ poleA[0] = radior[0] * phasor[0]; poleA[1] = radior[0] * phasor[1]; poleB[0] = radior[1] * phasor[0]; poleB[1] = radior[1] * phasor[1]; /* perform filtering: use 2 DC normalized complex one-poles: y[k] = x[k] + a(y[k-1] - x[k]) or y(z) = (1-a)/(1-az^{-1}) x(z) */ x = *in++ * scalor; /* nondominant pole first */ stateB[0] -= x; vcmul2(stateB, poleB); x = stateB[0] += x; /* dominant pole second */ stateA[0] -= x; vcmul2(stateA, poleA); x = stateA[0] += x; *out++ = x; /* saturate (normalize if pow > 1) state to prevent explosion * and to allow self-osc */ _sat_state(stateA); _sat_state(stateB); /* interpolate filter coefficients */ vcmul2(phasor, phasor_rot); radior[0] *= radior_rot[0]; radior[1] *= radior_rot[1]; scalor += scalor_inc; } return (w+7); } /* 303-style modified moog vcf (3-pole) */ static t_int *resofilt_perform_threepole(t_int *w) { t_resofiltctl *ctl = (t_resofiltctl *)(w[1]); t_int n = (t_int)(w[2]); t_float *in = (t_float *)(w[3]); t_float *freq = (t_float *)(w[4]); t_float *reso = (t_float *)(w[5]); t_float *out = (t_float *)(w[6]); int i; t_float inv_n = 1.0f / ((t_float)n); t_float inv_sr = 1.0f / sys_getsr(); t_float phasor[2], phasor_rot[2]; t_float radior[2], radior_rot[2]; t_float scalor, scalor_inc; t_float f,r,freq_rms,reso_rms; t_float f_prev = ctl->c_f_prev; t_float r_prev = ctl->c_r_prev; t_float sqrt5 = sqrt(5.0); /* use rms of input to drive freq and reso */ reso_rms = freq_rms = 0.0; for (i=0; i1), >1 == self osc */ t_float _reso = *reso++; freq_rms += _freq * _freq; reso_rms += _reso * _reso; } freq_rms = sqrt(freq_rms * inv_n) * inv_sr; reso_rms = sqrt(reso_rms * inv_n); f = (freq_rms > 0.5) ? 0.25 : freq_rms * 0.5; r = cbrt(reso_rms); /* calculate the new pole locations. we use an impulse invariant transform: the 303 vcf poles are located at s_p = omega(-1 + r sqrt(5) e^{pi/3(1+2p)}) real pole: omega * (-1 -r) complex pole: real = omega (-1 + r) imag = omega (+- 2 r) this is a strange beast. legend goes it was "invented" by taking the moog vcf and moving one cap up, such that the not-so controllable 3-pole that emerged would avoid the moog patent.. so, the sound is not so much the locations of the poles, but how the filter reacts to time varying controls. i.e. the pole movement with constant reso, used in the tb-303. */ /* compute phasor, radius and update eqs */ phasor[0] = cos(2.0 * M_PI * r_prev * f_prev * 2.0); phasor[1] = sin(2.0 * M_PI * r_prev * f_prev * 2.0); phasor_rot[0] = cos(2.0 * M_PI * (r*f - r_prev*f_prev) * 2.0 * inv_n); phasor_rot[1] = sin(2.0 * M_PI * (r*f - r_prev*f_prev) * 2.0 * inv_n); radior[0] = exp(f_prev * (-1.0 + r_prev)); /* dominant radius */ radior[1] = exp(f_prev * (-1.0 - sqrt5 * r_prev)); radior_rot[0] = exp((f*(-1.0 + r) - f_prev * (-1.0 + r_prev)) * inv_n); radior_rot[1] = exp((f*(-1.0 - r) - f_prev * (-1.0 - sqrt5 * r_prev)) * inv_n); /* 303 like scaling */ if (1){ t_float r3 = r_prev * r_prev * r_prev; scalor = 1.0 + (1.0 + 3.0 * r_prev); r3 = r * r * r; scalor_inc = ((1.0f + (1.0f + 3.0 * r3)) - scalor) * inv_n; } /* no scaling */ else{ scalor = 1.0; scalor_inc = 0.0; } ctl->c_f_prev = f; ctl->c_r_prev = r; ctl->c_state[3] = 0.0; /* perform filtering */ for (i=0; ic_state; t_float *stateB = ctl->c_state+2; t_float x; /* compute poles */ poleA[0] = radior[0] * phasor[0]; poleA[1] = radior[0] * phasor[1]; poleB[0] = radior[1]; /* perform filtering: use (real part of) 2 DC normalized complex one-poles: y[k] = x[k] + a(y[k-1] - x[k]) or y(z) = (1-a)/(1-az^{-1}) x(z) */ x = *in++ * scalor; /* nondominant pole first */ stateB[0] -= x; stateB[0] *= poleB[0]; x = stateB[0] += x; /* dominant pole second */ stateA[0] -= x; vcmul2(stateA, poleA); x = stateA[0] += x; *out++ = x; /* saturate (normalize if pow > 1) state to prevent explosion * and to allow self-osc */ _sat_state(stateA); _sat_state(stateB); /* interpolate filter coefficients */ vcmul2(phasor, phasor_rot); radior[0] *= radior_rot[0]; radior[1] *= radior_rot[1]; scalor += scalor_inc; } return (w+7); } static void resofilt_dsp(t_resofilt *x, t_signal **sp) { int n = sp[0]->s_n; dsp_add(x->x_dsp, 6, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec); } static void resofilt_free(t_resofilt *x) { } t_class *resofilt_class; static void *resofilt_new(t_floatarg algotype) { t_resofilt *x = (t_resofilt *)pd_new(resofilt_class); /* in */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); /* out */ outlet_new(&x->x_obj, gensym("signal")); /* set algo type */ if (algotype == 3.0){ post("resofilt~: 3-pole lowpass ladder vcf"); x->x_dsp = resofilt_perform_threepole; } else { post("resofilt~: 4-pole lowpass ladder vcf"); x->x_dsp = resofilt_perform_fourpole; } return (void *)x; } void resofilt_tilde_setup(void) { resofilt_class = class_new(gensym("resofilt~"), (t_newmethod)resofilt_new, (t_method)resofilt_free, sizeof(t_resofilt), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(resofilt_class, t_resofilt, x_f); class_addmethod(resofilt_class, (t_method)resofilt_dsp, gensym("dsp"), 0); } pd-creb-0.10.0/modules/sawtooth~.c000066400000000000000000000064011434364737600170100ustar00rootroot00000000000000/* * sawtooth.c - differentiated piecewize polynomial sawtooth generator * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include typedef struct sawtoothctl { t_float c_phase, c_increment, c_delay_1, c_delay_2; } t_sawtoothctl; typedef struct sawtooth { t_object x_obj; t_float x_f; t_sawtoothctl x_ctl; } t_sawtooth; void sawtooth_phase(t_sawtooth *x, t_floatarg f) { x->x_ctl.c_phase = f; } void sawtooth_freq(t_sawtooth *x, t_floatarg f) { x->x_ctl.c_increment = f / sys_getsr(); post ("increment %f", x->x_ctl.c_increment); } void sawtooth_bang(t_sawtooth *x) { sawtooth_phase(x, 0); } static t_int *sawtooth_perform(t_int *w) { t_float *out = (float *)(w[3]); t_sawtoothctl *ctl = (t_sawtoothctl *)(w[1]); int i; int n = (int)(w[2]); t_float phase, x, _x; t_float x1 = ctl->c_delay_1; t_float x2 = ctl->c_delay_2; phase = ctl->c_phase; for (i = 0; i < n; i++) { phase += ctl->c_increment; /* Limit range to [0,1[ */ x = phase - ((t_float)((int)phase)); /* Bring range to [-1,1[ */ x = 2 * x - 1; /* Cubic. */ x = (x-1) * x * (x + 1); /* Differentiate twice, (backward diff) */ _x = x; x -= x1; x1 = _x; _x = x; x -= x2; x2 = _x; *out++ = x; //post("%f", x); } /* Oscillator and filter state. */ ctl->c_phase = phase; ctl->c_delay_1 = x1; ctl->c_delay_2 = x2; return (w+4); } static void sawtooth_dsp(t_sawtooth *x, t_signal **sp) { dsp_add(sawtooth_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec); } void sawtooth_free(void) { } t_class *sawtooth_class; void *sawtooth_new(void) { t_sawtooth *x = (t_sawtooth *)pd_new(sawtooth_class); outlet_new(&x->x_obj, gensym("signal")); sawtooth_bang(x); sawtooth_freq(x, 0); return (void *)x; } void sawtooth_tilde_setup(void) { // post("sawtooth~ v0.1"); sawtooth_class = class_new(gensym("sawtooth~"), (t_newmethod)sawtooth_new, (t_method)sawtooth_free, sizeof(t_sawtooth), 0, 0); class_addmethod(sawtooth_class, (t_method)sawtooth_bang, gensym("bang"), 0); class_addmethod(sawtooth_class, (t_method)sawtooth_dsp, gensym("dsp"), 0); class_addmethod(sawtooth_class, (t_method)sawtooth_phase, gensym("phase"), A_FLOAT, A_NULL); class_addmethod(sawtooth_class, (t_method)sawtooth_freq, gensym("freq"), A_FLOAT, A_NULL); class_addfloat(sawtooth_class, (t_method)sawtooth_phase); } pd-creb-0.10.0/modules/sbosc~.c000066400000000000000000000114271434364737600162550ustar00rootroot00000000000000/* * sbosc.c - smallband oscillator. periodic, linear interpolated * frequency center. * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include #define LOGTABSIZE 10 #define TABSIZE (1<> SHIFTTABSIZE; t_float f2 = (t & MASKFRACTABSIZE) * INVFRACTABSIZE; unsigned int i2 = (i1+1) & MASKTABSIZE; unsigned int i3 = (i1 - (TABSIZE>>2)) & MASKTABSIZE; unsigned int i4 = (i2 + 1 - (TABSIZE>>2)) & MASKTABSIZE; t_float f1 = 1.0 - f2; t_float a1 = f1 * costable[i1]; t_float a2 = f2 * costable[i2]; t_float b1 = f1 * costable[i3]; t_float b2 = f2 * costable[i4]; *real = a1 + a2; *imag = b1 + b2; } static t_class *sbosc_tilde_class; typedef struct _sbosc_tilde { t_object x_obj; t_float x_f; /* state vars */ unsigned int x_phase; // phase of main pitch osc unsigned int x_phase_inc; // frequency of main pitch osc unsigned int x_harmonic; // first harmonic t_float x_frac; // fraction of first harmonic } t_sbosc_tilde; static void *sbosc_tilde_new(void) { t_sbosc_tilde *x = (t_sbosc_tilde *)pd_new(sbosc_tilde_class); x->x_phase = 0; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("phase")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } static t_int *sbosc_tilde_perform(t_int *w) { t_sbosc_tilde *x = (t_sbosc_tilde *)(w[1]); t_float *pitch = (t_float *)(w[2]); t_float *center= (t_float *)(w[3]); t_float *out_real = (t_float *)(w[4]); t_float *out_imag = (t_float *)(w[5]); int n = (int)(w[6]); int i; t_float pitch_to_phase = 4294967295.0 / sys_getsr(); for (i = 0; i < n; i++) { t_float p = *pitch++; t_float c = *center++; t_float r1,r2,i1,i2; /* compute harmonic mixture */ unsigned int h1 = x->x_phase * x->x_harmonic; unsigned int h2 = h1 + x->x_phase; _exp_j2pi(h1, &r1, &i1); _exp_j2pi(h2, &r2, &i2); r1 *= x->x_frac; i1 *= x->x_frac; r2 *= 1.0 - x->x_frac; i2 *= 1.0 - x->x_frac; *out_real++ = r1 + r2; *out_imag++ = i1 + i2; x->x_phase += x->x_phase_inc; /* check for phase wrap & update osc */ if ((x->x_phase <= x->x_phase_inc)) { t_float p_plus = (p < 0.0) ? -p : p; t_float p_limit = (p_plus < PITCHLIMIT) ? PITCHLIMIT : p_plus; t_float c_plus = (c < 0.0) ? -c : c; t_float harmonic = c_plus/p_limit; x->x_phase_inc = pitch_to_phase * p_limit; x->x_harmonic = harmonic; x->x_frac = 1.0 - (harmonic - x->x_harmonic); } } return (w+7); } static void sbosc_tilde_dsp(t_sbosc_tilde *x, t_signal **sp) { dsp_add(sbosc_tilde_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); } static void sbosc_tilde_free(t_sbosc_tilde *x) { } static void sbosc_tilde_phase(t_sbosc_tilde *x, t_floatarg f) { x->x_phase = f * (1.0 / 4294967295.0); } void sbosc_tilde_setup(void) { int i; // init tables for (i=0; i #include #include #include #include "filters.h" typedef struct scrollgrid1Dctl { t_float c_x, c_y, c_z; /* state */ } t_scrollgrid1Dctl; typedef struct scrollgrid1D { t_object x_obj; t_float x_f; t_scrollgrid1Dctl x_ctl; } t_scrollgrid1D; static inline t_float _fixedpoint(t_float x, int n) { int ix = (x + 0.5); if (ix < 0) ix = 0; else if (ix >= n) ix = n-1; return (t_float)ix; } static inline t_float _sat(t_float x, t_float upper) { t_float lower = -1.0; if (x < lower) x = lower; else if (x > upper) x = upper; return x; } static t_int *scrollgrid1D_perform(t_int *w) { t_float *freq = (t_float *)(w[3]); t_float *t1 = (t_float *)(w[4]); t_float *t2 = (t_float *)(w[5]); t_float *order = (t_float *)(w[6]); t_float *outx = (t_float *)(w[7]); t_float *outy = (t_float *)(w[8]); t_float *outz = (t_float *)(w[9]); t_scrollgrid1Dctl *ctl = (t_scrollgrid1Dctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; t_float inv_sr = 1.0 /sys_getsr(); t_float state[3] = {ctl->c_x, ctl->c_y, ctl->c_z}; t_float c,f; t_float pole[2], r1, r2; t_int o; t_float x,y,z; for (i=0; ic_x = state[0]; ctl->c_y = state[1]; ctl->c_z = state[2]; return (w+10); } static void scrollgrid1D_dsp(t_scrollgrid1D *x, t_signal **sp) { int n = sp[0]->s_n; int k; dsp_add(scrollgrid1D_perform, 9, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[5]->s_vec, sp[6]->s_vec); } static void scrollgrid1D_free(t_scrollgrid1D *x) { } static void scrollgrid1D_reset(t_scrollgrid1D *x) { x->x_ctl.c_x = 1; x->x_ctl.c_y = 1; x->x_ctl.c_z = 1; } t_class *scrollgrid1D_class; static void *scrollgrid1D_new(t_floatarg algotype) { t_scrollgrid1D *x = (t_scrollgrid1D *)pd_new(scrollgrid1D_class); /* ins */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); /* outs */ outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); /* init data */ scrollgrid1D_reset(x); return (void *)x; } void scrollgrid1D_tilde_setup(void) { //post("scrollgrid1D~ v0.1"); scrollgrid1D_class = class_new(gensym("scrollgrid1D~"), (t_newmethod)scrollgrid1D_new, (t_method)scrollgrid1D_free, sizeof(t_scrollgrid1D), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(scrollgrid1D_class, t_scrollgrid1D, x_f); class_addmethod(scrollgrid1D_class, (t_method)scrollgrid1D_dsp, gensym("dsp"), 0); class_addmethod(scrollgrid1D_class, (t_method)scrollgrid1D_reset, gensym("reset"), 0); } pd-creb-0.10.0/modules/setup.c000066400000000000000000000043411434364737600161030ustar00rootroot00000000000000#include "m_pd.h" void ead_tilde_setup(void); void ear_tilde_setup(void); void eadsr_tilde_setup(void); void dist_tilde_setup(void); void tabreadmix_tilde_setup(void); void xfm_tilde_setup(void); void biquadseries_tilde_setup(void); void filterortho_tilde_setup(void); void qmult_tilde_setup(void); void qnorm_tilde_setup(void); void cheby_tilde_setup(void); void abs_tilde_setup(void); void ramp_tilde_setup(void); void dwt_tilde_setup(void); void bfft_tilde_setup(void); void dynwav_tilde_setup(void); void statwav_tilde_setup(void); void bdiag_tilde_setup(void); void diag_tilde_setup(void); void bmatrix_tilde_setup(void); void permut_tilde_setup(void); void lattice_tilde_setup(void); void ratio_setup(void); void ffpoly_setup(void); void dt_ms_setup(void); void fwarp_setup(void); void junction_tilde_setup(void); void fdn_tilde_setup(void); void bwin_tilde_setup(void); void blosc_tilde_setup(void); void cmath_tilde_setup(void); void bitsplit_tilde_setup(void); void sbosc_tilde_setup(void); void blocknorm_tilde_setup(void); void resofilt_tilde_setup(void); void scrollgrid1D_tilde_setup(void); void sawtooth_tilde_setup(void); #ifndef CREB_VERSION #define CREB_VERSION "externals cvs" #endif void creb_setup(void) { post("CREB: version " CREB_VERSION); /* setup tilde objects */ ead_tilde_setup(); ear_tilde_setup(); eadsr_tilde_setup(); dist_tilde_setup(); tabreadmix_tilde_setup(); xfm_tilde_setup(); qmult_tilde_setup(); qnorm_tilde_setup(); cheby_tilde_setup(); ramp_tilde_setup(); dwt_tilde_setup(); bfft_tilde_setup(); dynwav_tilde_setup(); statwav_tilde_setup(); bdiag_tilde_setup(); diag_tilde_setup(); bmatrix_tilde_setup(); permut_tilde_setup(); lattice_tilde_setup(); junction_tilde_setup(); fdn_tilde_setup(); bwin_tilde_setup(); blosc_tilde_setup(); cmath_tilde_setup(); bitsplit_tilde_setup(); sbosc_tilde_setup(); blocknorm_tilde_setup(); resofilt_tilde_setup(); scrollgrid1D_tilde_setup(); sawtooth_tilde_setup(); /* setup other objects */ ratio_setup(); ffpoly_setup(); dt_ms_setup(); fwarp_setup(); /* setup c++ modules */ biquadseries_tilde_setup(); filterortho_tilde_setup(); /* optional modules */ #ifdef HAVE_ABS_TILDE abs_tilde_setup(); #endif } pd-creb-0.10.0/modules/statwav~.c000066400000000000000000000077661434364737600166500ustar00rootroot00000000000000/* * statwav.c - static wavetable oscillator (scale + tabread) * * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "m_pd.h" #include #include #include #include static t_class *statwav_tilde_class; typedef struct _statwav_tilde { t_object x_obj; int x_npoints; t_float *x_vec; t_symbol *x_arrayname; t_float x_f; } t_statwav_tilde; static void *statwav_tilde_new(t_symbol *s) { t_statwav_tilde *x = (t_statwav_tilde *)pd_new(statwav_tilde_class); x->x_arrayname = s; x->x_vec = 0; outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } static t_int *statwav_tilde_perform(t_int *w) { t_statwav_tilde *x = (t_statwav_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); t_float maxindex; int imaxindex; t_float *buf = x->x_vec, *fp; int i; maxindex = x->x_npoints; imaxindex = x->x_npoints; if (!buf) goto zero; for (i = 0; i < n; i++) { t_float phase = *in++; t_float modphase = phase - (int)phase; t_float findex; int index; int ia, ib, ic, id; t_float frac, a, b, c, d, cminusb; static int count; if (modphase < 0.0) modphase += 1.0; findex = modphase * maxindex; index = findex; frac = findex - index; ia = (imaxindex+index-1) % imaxindex; ib = index; ic = (index+1) % imaxindex; id = (index+2) % imaxindex; a = buf[ia]; b = buf[ib]; c = buf[ic]; d = buf[id]; /* if (!i && !(count++ & 1023)) post("fp = %lx, shit = %lx, b = %f", fp, buf->b_shit, b); */ cminusb = c-b; *out++ = b + frac * ( cminusb - 0.5 * (frac-1.) * ( (a - d + 3.0 * cminusb) * frac + (b - a - cminusb) ) ); } return (w+5); zero: while (n--) *out++ = 0; return (w+5); } static void statwav_tilde_set(t_statwav_tilde *x, t_symbol *s) { t_garray *a; x->x_arrayname = s; if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { if (*s->s_name) error("statwav~: %s: no such array", x->x_arrayname->s_name); x->x_vec = 0; } else if (!garray_getfloatarray(a, &x->x_npoints, &x->x_vec)) { error("%s: bad template for statwav~", x->x_arrayname->s_name); x->x_vec = 0; } else garray_usedindsp(a); } static void statwav_tilde_dsp(t_statwav_tilde *x, t_signal **sp) { statwav_tilde_set(x, x->x_arrayname); dsp_add(statwav_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void statwav_tilde_free(t_statwav_tilde *x) { } void statwav_tilde_setup(void) { //post("statwav~ v0.1"); statwav_tilde_class = class_new(gensym("statwav~"), (t_newmethod)statwav_tilde_new, (t_method)statwav_tilde_free, sizeof(t_statwav_tilde), 0, A_DEFSYM, 0); CLASS_MAINSIGNALIN(statwav_tilde_class, t_statwav_tilde, x_f); class_addmethod(statwav_tilde_class, (t_method)statwav_tilde_dsp, gensym("dsp"), 0); class_addmethod(statwav_tilde_class, (t_method)statwav_tilde_set, gensym("set"), A_SYMBOL, 0); } pd-creb-0.10.0/modules/tabreadmix~.c000066400000000000000000000213641434364737600172650ustar00rootroot00000000000000/* * tabreadmix.c - an overlap add tabread~ clone * * Copyright (c) 2000-2003 by Tom Schouten * Additional code (audiorate, wrap messages) copyright (c) 2008 by * Damian Stewart, damian [at] frey [dot] co [dot] nz * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "extlib_util.h" /******************** tabreadmix~ ***********************/ static t_class *tabreadmix_tilde_class; typedef struct _tabreadmix_tilde { t_object x_obj; int x_npoints; t_float *x_vec; t_symbol *x_arrayname; t_float x_f; /* file position vars */ t_float x_currpos; t_float x_prevpos; t_float x_posinc; /* cross fader state vars */ int x_xfade_size; int x_xfade_phase; t_float x_xfade_cos; t_float x_xfade_sin; t_float x_xfade_state_c; t_float x_xfade_state_s; /* wrap start and end */ int x_wrap_start; int x_wrap_end; int x_wrap_length; } t_tabreadmix_tilde; inline void tabreadmix_tilde_wrapindices(t_tabreadmix_tilde *x) { /* modulo */ while ( x->x_currpos > x->x_wrap_end ) x->x_currpos -= x->x_wrap_length; while ( x->x_prevpos > x->x_wrap_end ) x->x_prevpos -= x->x_wrap_length; /* make sure 0<=..x_npoints */ //if (x->x_currpos < 0) x->x_currpos += x->x_npoints; //if (x->x_prevpos < 0) x->x_prevpos += x->x_npoints; x->x_currpos += (x->x_currpos < 0) * x->x_npoints; x->x_prevpos += (x->x_prevpos < 0) * x->x_npoints; } #define min(x,y) ((x)<(y)?(x):(y)) static t_int *tabreadmix_tilde_perform(t_int *w) { t_tabreadmix_tilde *x = (t_tabreadmix_tilde *)(w[1]); t_float *pos = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); int maxxindex; t_float *buf = x->x_vec; int i; t_float currgain, prevgain; t_float c,s; int chunk; int leftover; int newpos = (int)*pos; // maxxindex = x->x_npoints; maxxindex = x->x_wrap_end; if (!buf) goto zero; if (maxxindex <= 0) goto zero; while (n){ /* process as much data as possible */ leftover = x->x_xfade_size - x->x_xfade_phase; chunk = min(n, leftover); for (i = 0; i < chunk; i++){ /* compute crossfade gains from oscillator state */ currgain = 0.5 - x->x_xfade_state_c; prevgain = 0.5 + x->x_xfade_state_c; /* check indices & wrap */ tabreadmix_tilde_wrapindices(x); /* mix and write */ newpos = (int)(*pos++); *out++ = currgain * buf[(int)x->x_currpos] + prevgain * buf[(int)x->x_prevpos]; x->x_currpos += x->x_posinc; x->x_prevpos += x->x_posinc; /* advance oscillator */ c = x->x_xfade_state_c * x->x_xfade_cos - x->x_xfade_state_s * x->x_xfade_sin; s = x->x_xfade_state_c * x->x_xfade_sin + x->x_xfade_state_s * x->x_xfade_cos; x->x_xfade_state_c = c; x->x_xfade_state_s = s; } /* update indices */ x->x_xfade_phase += chunk; n -= chunk; //pos += chunk; /* check if prev chunk is finished */ if (x->x_xfade_size == x->x_xfade_phase){ x->x_prevpos = x->x_currpos; x->x_currpos = newpos; x->x_xfade_state_c = 0.5; x->x_xfade_state_s = 0.0; x->x_xfade_phase = 0; } } /* return if we ran out of data */ return (w+5); zero: while (n--) *out++ = 0; return (w+5); } static void tabreadmix_tilde_blocksize(t_tabreadmix_tilde *x, t_float size) { double prev_phase; int max; t_float fmax = (t_float)x->x_wrap_length * 0.5; if (size < 1.0) size = 1.0; // post( "got input size %f\n", size ); prev_phase = (double)x->x_xfade_phase; prev_phase *= size; prev_phase /= (double)x->x_xfade_size; /* preserve the crossfader state */ x->x_xfade_phase = (int)prev_phase; x->x_xfade_size = (int)size; x->x_xfade_cos = cos(M_PI / (t_float)x->x_xfade_size); x->x_xfade_sin = sin(M_PI / (t_float)x->x_xfade_size); /* make sure indices are inside array */ if (x->x_npoints == 0){ x->x_currpos = 0; x->x_prevpos = 0; } //else tabreadmix_tilde_wrapindices(x); } void tabreadmix_tilde_wrap(t_tabreadmix_tilde *x, t_float start, t_float end ) { if ( start > end ) error( "tabreadmix~: wrap: start %i must be lower than end %i", (int)start, (int)end ); else if ( 0 > start || start > x->x_npoints ) error( "tabreadmix~: wrap: start %i must be between 0 and bufsize (%d)", (int)start, (int)x->x_npoints ); else if ( 0 > end || end > x->x_npoints ) error( "tabreadmix~: wrap: end %i must be between 0 and bufsize (%d)", (int)end, (int)x->x_npoints ); else { x->x_wrap_start = start; x->x_wrap_end = end; x->x_wrap_length = end - start; } } void tabreadmix_tilde_pitch(t_tabreadmix_tilde *x, t_float f) { if (f < 1) f = 1; tabreadmix_tilde_blocksize(x, sys_getsr() / f); } void tabreadmix_tilde_audiorate(t_tabreadmix_tilde *x, t_float f) { if ( f<0.001 ) f = 0.001; x->x_posinc = f; } void tabreadmix_tilde_chunks(t_tabreadmix_tilde *x, t_float f) { if (f < 1.0) f = 1.0; tabreadmix_tilde_blocksize(x, (t_float)x->x_npoints / f); } void tabreadmix_tilde_bang(t_tabreadmix_tilde *x, t_float f) { //trigger a chunk reset on next dsp call x->x_xfade_phase = x->x_xfade_size; } void tabreadmix_tilde_set(t_tabreadmix_tilde *x, t_symbol *s) { t_garray *a; int old_npoints = x->x_npoints; x->x_arrayname = s; if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { if (*s->s_name) error("tabreadmix~: %s: no such array", x->x_arrayname->s_name); x->x_vec = 0; } else if (!garray_getfloatarray(a, &x->x_npoints, &x->x_vec)) { error("%s: bad template for tabreadmix~", x->x_arrayname->s_name); x->x_vec = 0; } else garray_usedindsp(a); // reset wrappage if ( old_npoints != x->x_npoints ) { x->x_wrap_start = 0; x->x_wrap_end = x->x_npoints; x->x_wrap_length = x->x_npoints; } /* make sure indices are inside array */ if (x->x_npoints == 0){ x->x_currpos = 0; x->x_prevpos = 0; } //else tabreadmix_tilde_wrapindices(x); } static void tabreadmix_tilde_dsp(t_tabreadmix_tilde *x, t_signal **sp) { tabreadmix_tilde_set(x, x->x_arrayname); dsp_add(tabreadmix_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void tabreadmix_tilde_free(t_tabreadmix_tilde *x) { } static void *tabreadmix_tilde_new(t_symbol *s) { t_tabreadmix_tilde *x = (t_tabreadmix_tilde *)pd_new(tabreadmix_tilde_class); x->x_arrayname = s; x->x_vec = 0; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("blocksize")); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; x->x_xfade_phase = 0; x->x_xfade_size = 1024; x->x_currpos = 0; x->x_prevpos = 0; x->x_posinc = 1.0; x->x_xfade_state_c = 0.5; x->x_xfade_state_s = 0.0; tabreadmix_tilde_blocksize(x, 1024); return (x); } void tabreadmix_tilde_setup(void) { tabreadmix_tilde_class = class_new(gensym("tabreadmix~"), (t_newmethod)tabreadmix_tilde_new, (t_method)tabreadmix_tilde_free, sizeof(t_tabreadmix_tilde), 0, A_DEFSYM, 0); CLASS_MAINSIGNALIN(tabreadmix_tilde_class, t_tabreadmix_tilde, x_f); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_dsp, gensym("dsp"), 0); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_set, gensym("set"), A_SYMBOL, 0); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_blocksize, gensym("blocksize"), A_FLOAT, 0); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_pitch, gensym("pitch"), A_FLOAT, 0); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_chunks, gensym("chunks"), A_FLOAT, 0); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_audiorate, gensym("audiorate"), A_FLOAT, 0 ); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_wrap, gensym("wrap"), A_FLOAT, A_FLOAT, 0 ); class_addmethod(tabreadmix_tilde_class, (t_method)tabreadmix_tilde_bang, gensym("bang"), 0); } pd-creb-0.10.0/modules/xfm~.c000066400000000000000000000126151434364737600157360ustar00rootroot00000000000000/* * xfm.c - cross frequency modulation object * Copyright (c) 2000-2003 by Tom Schouten * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* coupled fm. osc state equations: phasor for system i = [ 1 -phi ] (1+phi^2)^(1/2) * [ phi 1 ] with phi = 2*pi*(freq_base + freq_mod * out_other) / sr ideal phasor would be [ cos(phi) - sin(phi) ] [ sin(phi) cos(phi) ] this means frequencies are warped: 2*pi*f_real = atan(2*pi*f) some (possible) enhancements: + add an integrator to get phase modulation + undo the frequency warping */ #include "m_pd.h" #include #include #include #include #define SINSAMPLES 512 #define MYPI 3.141592653589793 #define DISTORTED 0 #define NORMALIZED 1 typedef struct xfmctl { //t_float c_sintab[SINSAMPLES + 1]; t_float c_x1, c_y1; /* state osc 1 */ t_float c_x2, c_y2; /* state osc 2 */ t_int c_type; /* type of algo */ } t_xfmctl; typedef struct xfm { t_object x_obj; t_float x_f; t_xfmctl x_ctl; } t_xfm; void xfm_type(t_xfm *x, t_float f) { int t = (int)f; if (t == DISTORTED) x->x_ctl.c_type = t; if (t == NORMALIZED) x->x_ctl.c_type = t; } static inline t_float xfm_sat(t_float x) { const t_float max = 1; const t_float min = -1; x = (x > max) ? (max) : (x); x = (x < min) ? (min) : (x); return(x); } static t_int *xfm_perform(t_int *w) { t_float *inA = (t_float *)(w[3]); t_float *inB = (t_float *)(w[4]); t_float *fbA = (t_float *)(w[5]); t_float *fbB = (t_float *)(w[6]); t_float *outA = (t_float *)(w[7]); t_float *outB = (t_float *)(w[8]); t_xfmctl *ctl = (t_xfmctl *)(w[1]); t_int n = (t_int)(w[2]); //t_float *tab = ctl->c_sintab; t_float x1 = ctl->c_x1, y1 = ctl->c_y1, z1, dx1, dy1, inv_norm1; t_float x2 = ctl->c_x2, y2 = ctl->c_y2, z2, dx2, dy2, inv_norm2; t_float scale = 2 * M_PI / sys_getsr(); t_int i; switch(ctl->c_type){ default: case DISTORTED: /* this is a 4 degree of freedom hyperchaotic system */ /* two coupled saturated unstable oscillators */ for (i=0; ic_x1 = x1; ctl->c_y1 = y1; ctl->c_x2 = x2; ctl->c_y2 = y2; return (w+9); } static void xfm_dsp(t_xfm *x, t_signal **sp) { int n = sp[0]->s_n; int k; dsp_add(xfm_perform, 8, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[5]->s_vec); } static void xfm_free(t_xfm *x) { } static void xfm_reset(t_xfm *x) { x->x_ctl.c_x1 = 1; x->x_ctl.c_y1 = 0; x->x_ctl.c_x2 = 1; x->x_ctl.c_y2 = 0; } t_class *xfm_class; static void *xfm_new(t_floatarg algotype) { t_xfm *x = (t_xfm *)pd_new(xfm_class); /* ins */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); /* outs */ outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); /* init data */ xfm_reset(x); xfm_type(x, algotype); return (void *)x; } void xfm_tilde_setup(void) { //post("xfm~ v0.1"); xfm_class = class_new(gensym("xfm~"), (t_newmethod)xfm_new, (t_method)xfm_free, sizeof(t_xfm), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(xfm_class, t_xfm, x_f); class_addmethod(xfm_class, (t_method)xfm_type, gensym("type"), A_FLOAT, 0); class_addmethod(xfm_class, (t_method)xfm_dsp, gensym("dsp"), 0); class_addmethod(xfm_class, (t_method)xfm_reset, gensym("reset"), 0); } pd-creb-0.10.0/objects.txt000066400000000000000000000055271434364737600153300ustar00rootroot0000000000000064k a beat shuffler using raw 64k/break sample banks bdft,bdfts set decay time (ms/sec) and osc frequency (for bdiag~) bhip~ butterworth high pass filter blop~ butterworth low pass filter bpm convert bpm to metro time and phasor freq cadd~ complex add ccmap~ conformal self map of the unit disk cconj~ complex conjugate cep~/icep~ complex cepstrum and inverse cinv~ complex inverse cmul~ complex multiplication count modulo counter cosc~ complex oscillator csub~ complex subtraction dsfosc~ (finite) discrete summation formula oscillator eadh~ exponential attack decay (with hold == duration) eadsrh~ exponential attack decay sustain release (..) expmap~ exponential map fblock block relative frequency conversion fmod floating point modulo fmop~ fm operator frequor~ like phasor, but for block spectra idsfosc~ infinite discrete summation formula inv inverse lattice3 expand a 3D harmonic lattice vector lpfft~ ifft + lowpass (for anti-aliased dynwav) pdynwav~ phasor~ + dynwav~ scale7 arbitrary 7 tone scale ti_hihat hihat gop object ti_snare snare drum gop object tblock block relative time conversion ucnorm~ normalize a complex signal to unit norm ucmod~ unit circle modulator vols~ volume for a stereo signal vol~ volume for a mono signal ffpoly finite field polynomial fwarp tangent warp frequency ratio multiply by 2^k so result is 1<=r<2 (transposer) abs~ absolute value bdiag~ block diagonal state space system (spectral processor) bfft~ reordered fft bitsplit~ convert signal to binary vector bwin~ several windowing functions and spectral envelopes biquadseries~ biquad second order sections (i.e. butterworth) bitsplit~ convert a signal to binary representation blocknorm~ normalize a (set of) dsp block(s) (i.e. for spectral processing) blosc~ several bandlimited oscillators cheby~ chebyshev polynomial waveshaper clog~ complex log diag~ diagonal state space system (spectral processor) dist~ several distortions & waveshaping functions dwt~ discrete wavelet transform idwt~ inverse dynwav~ dynamic wavetable: use a signal block as wavetable ead~ exp. attack decay eadsr~ exp. attack decay sustain release ear~ exp. attack release filterortho~ several biquad filters, orthogonal implementation fdn~ a feedback delay network junction~ a circulant lossless signal junction lattice~ lattice filter matrix~ multiply a signal block with an arbitrary matrix permut~ random permute a signal block qmult~ multiply 2 quaternion signals qnorm~ normalize a quaternion signal (or any 4 channel sig) ramp~ generates an integer ramp resofilt~ a reso filter (4pole, 3pole) sbosc~ smallband oscillator (i.e. for formant synthesis) statwav~ a tabread4~ clone with 8 point interpolation scrollgrid1D~ a stabilized scroll grid chaotic oscillator tabreadmix~ a tabread~ clone with overlap add (for smooth time stretch) xfm~ coupled frequency modulation pd-creb-0.10.0/pd-lib-builder/000077500000000000000000000000001434364737600157205ustar00rootroot00000000000000pd-creb-0.10.0/pd-lib-builder/Makefile.pdlibbuilder000066400000000000000000001266041434364737600220310ustar00rootroot00000000000000# Makefile.pdlibbuilder dated 2019-12-21 version = 0.6.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 # # 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. # # 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 ################################################################################ ### 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 ########################################################### ################################################################################ #=== 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 .o, $(basename $(classes.sources))) common.objects := $(addsuffix .o, $(basename $(common.sources))) shared.objects := $(addsuffix .o, $(basename $(shared.sources))) lib.setup.objects := $(addsuffix .o, $(basename $(lib.setup.sources))) all.objects = $(classes.objects) $(common.objects) $(shared.objects) \ $(lib.setup.objects) #=== executables =============================================================== # use recursive variables here because executable extension is not yet known # construct class executable names from class names classes.executables = $(addsuffix .$(extension), $(classes)) # construct shared lib executable name if shared sources are defined ifdef shared.sources shared.lib = lib$(lib.name).$(shared.extension) else shared.lib = endif ################################################################################ ### 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 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), 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.dll" c.ldlibs := cxx.flags := -fcheck-new cxx.ldflags := -static-libgcc -static-libstdc++ -shared \ -Wl,--enable-auto-import "$(PDBINDIR)/pd.dll" cxx.ldlibs := shared.extension = dll shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd.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)" $(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 := $(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: 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.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 .o, $(basename $($2.class.sources))) \ $(addsuffix .o, $(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 lib$(lib.name).$(shared.extension) $(shared.objects) \ $($1.ldlibs) $(shared.ldlibs) endef # rule for linking objects in shared executable # build recipe is in macro 'link-shared' lib$(lib.name).$(shared.extension): $(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. %.o:: %.c $(call make-object-file,c) %.o:: %.cc $(call make-object-file,cxx) %.o:: %.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 .o, $(basename $($v.class.sources))) \ $(addsuffix .o, $(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)$(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: pd-creb-0.10.0/unittests/000077500000000000000000000000001434364737600151675ustar00rootroot00000000000000pd-creb-0.10.0/unittests/bdiag~-unittest.pd000066400000000000000000000026401434364737600206370ustar00rootroot00000000000000#N canvas 0 22 856 657 10; #X obj 119 374 testtools/unit-test-frame~; #X msg 440 144 timefreq 1 23 10 \, timefreq 2 15 0 \, timefreq 3 1 5 \, timefreq 5 1 8 \, timefreq 7 13 4 \, timefreq 11 11 12 \, timefreq 17 2 32 \, timefreq 30 6 2; #X msg 119 347 bdiag~ 0; #X obj 440 111 loadbang; #X obj 440 321 creb/bdiag~; #X text 43 175 the [eig ] message sets the eigenvalue for the corresponding block. there are n/2 blocks \, with n the dsp blocksize.; #X text 44 230 you can use [timefreq <60dB time> ] for a more appropriate initialization of the eigenvalues using decay time in milliseconds and oscillation frequency in Hz.; #X text 41 25 bdiag~: parallel block diagonal state space model (parallel 2d rotations) see bdiag.c for more info. the state equations for one block are:; #X text 85 77 state1 = real * state1 - imag * state2 + input1; #X text 85 92 state2 = real * state2 + imag * state1 + input2; #X text 43 128 this module is intended to "filter" spectral data produced by bfft or other short time spectral transforms like dwt.; #X text 41 286 [bang] or [random] set the state vector to a random value. [reset] sets it to 0; #X msg 466 272 0.2; #X text 438 45 For this object \, the test result is different between the first bang and later bangs.; #X connect 0 2 12 0; #X connect 1 0 4 0; #X connect 2 0 0 0; #X connect 3 0 1 0; #X connect 3 0 2 0; #X connect 4 0 0 1; #X connect 12 0 4 0; pd-creb-0.10.0/unittests/bdiag~.wav000066400000000000000000000040541434364737600171550ustar00rootroot00000000000000RIFF$WAVEfmt D dataL>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>EQ>`> > >L>:L>L>L>L>IL>L>L>>/t>L>L>L>L>L>L>QҊ>ϓ>L>L>L>L>L>L>L>L>L>L>M>RN>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>r>t>L>L>L>L>>B>6ʵ>6ʵ>L>:L>L>L>L>IL>L>L>s?>>L>L>L>L>L>L>a>\>L>L>L>L>L>L>L>L>L>L>>M>N>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>y>{>L>L>L>L>>t4?Y>Y>L>:L>L>L>L>IL>L>L>5>>L>L>L>L>L>L>{>.>L>L>L>L>L>L>L>L>L>L>>M>N>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>X|>L>L>L>L>1> ?ȥ>ȥ>L>:L>L>L>L>IL>L>L>"*>b>L>L>L>L>L>L>TҜ>@>L>L>L>L>L>L>L>L>L>L>>M>N>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>{>;}>L>L>L>L>~>?L>:L>L>L>L>IL>L>L>>>L>L>L>L>L>L>-.>`>L>L>L>L>L>L>L>L>L>L>>M>N>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>({>H}>L>L>L>L>>ѩ? > >L>:L>L>L>L>IL>L>L>>>L>L>L>L>L>L>GB>~>L>L>L>L>L>L>L>L>L>L>>M>N>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>!*{>K}>L>L>L>L>>K ?H>H>L>:L>L>L>L>IL>L>L>>>L>L>L>L>L>L>C>\>L>L>L>L>L>L>L>L>L>L>>M>N>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>L>*{> L}>L>L>pd-creb-0.10.0/unittests/bfft~-unittest.pd000066400000000000000000000007351434364737600205150ustar00rootroot00000000000000#N canvas 130 36 773 544 10; #X obj 57 269 testtools/unit-test-frame~; #X obj 57 194 loadbang; #X obj 378 236 /~ 1; #X obj 399 210 sqrt; #X obj 399 160 loadbang; #X msg 57 231 bfft~ 100; #X obj 378 132 creb/bfft~; #X obj 378 99 phasor~ 440; #X msg 441 71 0; #X msg 399 185 64; #X connect 0 2 8 0; #X connect 1 0 5 0; #X connect 2 0 0 1; #X connect 3 0 2 1; #X connect 4 0 9 0; #X connect 5 0 0 0; #X connect 6 0 2 0; #X connect 7 0 6 0; #X connect 8 0 7 1; #X connect 9 0 3 0; pd-creb-0.10.0/unittests/bfft~.wav000066400000000000000000000040541434364737600170300ustar00rootroot00000000000000RIFF$WAVEfmt D data?P(?@D.x"/ڽ$="c';=x/D.<:v>,RAz8<{=O*0ߩ[s=".2Ҽ_'2.=t>;vrvD.<%c >|=ДD.<='>̴>?;|=Ĉ&; )=뼪¼H鬐*;p ;[<҆Nf>8>&>10>T:>yD>N>>X>>b>"m>qPw>/>؅>> >6&>@>\>hw>>뮮>ʳ>>b>><>X>|>OA>>~>f™>>(L>ah>Z==lyժ h>g>:#>->8>9B>^L> V>@`>Bj>u>s5>>Vˉ>>j>>o3>N>i>>j>s>ټ>>9>.>>d>> U>>H>I>>[= =m꽺 ێH6k8k’\=ՏVPGԠPG)ˠ2M; dwi\OeB +6ȕ).F--ڽýtC쀽VVYP+в2GTL >g>̄!>+>z5>v?> J>3T>\^>ևh>r>|>z> >d>4Ւ>>8 >M%>@>W\>3x>;>f>>>e>Z>.>>+>Zo>-}>G>>=n="bIM(P#JJ.no듾+fA0 y*q* ʺp>!SʬjEUvGdY7WyY9l#_!R >>_2>-Q)> r3> => G>EQ>f \>h5f>/bp>z>C`>x>,>>IƖ>>>{>!3>N>k>0>u>̿>0>%>>V>>$F>rz>/E>p >i=m!>>&>1>B;>gE>ێO>Y>c>n>/>x>7>O>h>Ȃ>>̷>ҟ>F> >%>A>]>Az>>>s>Û>s->h٪>>x>>B> >ĥ=p}y r˽þX}yº,p~Ȟ$r =}0pcVIP"=0d%$L J<ѽ2M᤽Lێ3rp-G,1众L%;|M<Ƙp>>T$>6.>28>HC>meW>pd-creb-0.10.0/unittests/biquadseries~10.wav000066400000000000000000000040541434364737600207300ustar00rootroot00000000000000RIFF$WAVEfmt D data=A=f>f>8>&>10>T:>yD>N>>X>>b>"m>qPw>/>؅>> >6&>@>\>hw>>뮮>ʳ>>b>><>X>|>OA>>~>f™>>(L>ah>Z==lyժ h>g>:#>->8>9B>^L> V>@`>Bj>u>s5>>Vˉ>>j>>o3>N>i>>j>s>ټ>>9>.>>d>> U>>H>I>>[= =m꽺 ێH6k8k’\=ՏVPGԠPG)ˠ2M; dwi\OeB +6ȕ).F--ڽýtC쀽VVYP+в2GTL >g>̄!>+>z5>v?> J>3T>\^>ևh>r>|>z> >d>4Ւ>>8 >M%>@>W\>3x>;>f>>>e>Z>.>>+>Zo>-}>G>>=n="bIM(P#JJ.no듾+fA0 y*q* ʺp>!SʬjEUvGdY7WyY9l#_!R >>_2>-Q)> r3> => G>EQ>f \>h5f>/bp>z>C`>x>,>>IƖ>>>{>!3>N>k>0>u>̿>0>%>>V>>$F>rz>/E>p >i=m!>>&>1>B;>gE>ێO>Y>c>n>/>x>7>O>h>Ȃ>>̷>ҟ>F> >%>A>]>Az>>>s>Û>s->h٪>>x>>B> >ĥ=p}y r˽þX}yº,p~Ȟ$r =}0pcVIP"=0d%$L J<ѽ2M᤽Lێ3rp-G,1众L%;|M<Ƙp>>T$>6.>28>HC>meW>pd-creb-0.10.0/unittests/bitsplit~-unittest.pd000066400000000000000000000004741434364737600214260ustar00rootroot00000000000000#N canvas 0 22 769 474 10; #X obj 306 162 creb/bitsplit~ 4; #X obj 306 117 osc~ 440; #X obj 78 203 testtools/unit-test-frame~; #X msg 351 82 0; #X obj 78 131 loadbang; #X msg 78 162 bitsplit~ 10; #X connect 0 3 2 1; #X connect 1 0 0 0; #X connect 2 2 3 0; #X connect 3 0 1 1; #X connect 4 0 5 0; #X connect 5 0 2 0; pd-creb-0.10.0/unittests/bitsplit~.wav000066400000000000000000000040541434364737600177410ustar00rootroot00000000000000RIFF$WAVEfmt D data??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????pd-creb-0.10.0/unittests/blocknorm~-unittest.pd000066400000000000000000000005471434364737600215630ustar00rootroot00000000000000#N canvas 0 22 746 470 10; #X obj 378 128 creb/blocknorm~; #X obj 57 174 testtools/unit-test-frame~; #X obj 378 69 phasor~ 440; #X obj 378 97 -~ 0.5; #X msg 441 39 0; #X obj 57 100 loadbang; #X msg 57 134 blocknorm~ 0; #X connect 0 0 1 1; #X connect 1 2 4 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 4 0 2 1; #X connect 5 0 6 0; #X connect 6 0 1 0; pd-creb-0.10.0/unittests/blocknorm~.wav000066400000000000000000000040541434364737600200750ustar00rootroot00000000000000RIFF$WAVEfmt D data:-꿧!Ί2ܿQ׿oҿͿȿÿt龿i&D[cՁOȾAݗ68)WF~8(u,ekaWNXD:0'L 'ؾtžh⊾$nG )-8q =P=Gi=>>>9e>r>>~>>>9>M>1>G>P>P>7? ?q?5?V?&?}-?A.5?v\zUTN G2?n}851)s{s|"pcMWJ;x> 2X%8t d"AϾ[IztfW%,0Rr=tʤ=>Ѹ5>bg>+>[>/>>>OW??0,?)?6?kB?N?j@[?تg?Kt???u?P?ߒ??I?3?l???T?P???(?3^?j???3?Nh?K'?XO?cw?p?}ǽ?????g?οɿ޶ſҎf>Ƭ{vnNb&UI֓=0#^6~u{m+e\T;LgCM;5K3*"Z  j5ڔᾪоvTFsc{fZ&94Kʪ+PQ%je= =9=G]>#>m(B>LX`>7~>\>t>>룻>>>>>؍? ?˥?1?!?I)?0?a8???yG?O?V?^?e?5m?zt?uM|???x?>??ʔ??V????n?4????廿YݓͬA{쵝)c׊L woq:տMοXaǿt@'¤֝閿j#nvhpZYLB ?'11X#~ߥZ׾+5Є)=Rƽ@0E5h>&%>Z׫>>;>> P ?%)??)?Y6?nD?R?f`??n?|??? Ғ??'??>?p?X]?I?p6?"???}?P? ?m?¾??k]?,??jˠ??j?i9??س?h?v?Ônź&oWŸq飿Jr{ܐs >nt?{tblBd%]UDMIF>G 7m/'J0 MT -Lվuƾ8Rt V\78SŽ : >k/<=[=>u">C>c>0>Ȃ>Ԣ>&>x>>>n>O`?J ?H?F?D#?>-+?y>)>R>|>U>ξ>> >1J>gs>>> >C>yA>j>>>U>>8>a>1>i>>> 0>EY>}>>>!>Y'>P>y>>5>k>>G>q>G>}>>>#?>Yh>>ɺ>>5 >m6>_>ۈ>>I>>->9>fC)ވ;ſQ޾ ::߾zz޾Y n߾=َ澁mSF޾".|ܾObgK޾+d.پᾋMپھ۾!+վfھԾiվԾоӾξϾ,KξM˾̾_ɾʾ0Ǿƾ[ƾľ!ľNͿ$cjtO\2 sൾ<d;`)鮾򿭾mMD񧾨Ȧq:vM#^џ'~U,Kژݰo^85 ⑾\%g=늾I‰oFm6ʂȡx~FL|yjwTus p]nD lָihfgebo`^B[wYf%WTR.PM@K6IdFD?B?=>H;8b6P41/Y-<+δ(`b&$!k:s^!|* 8 2\;$H-lエ>ؙ PݽDؽhԽaϽʽƽrμ@)d߮:ЕL<`]n(wpJne[HmR#I? 6hF-#@i1ؼQż]qʠ7"GwB Rb,DWŻvºL:xG;-;<{;^d!<^F<^kF=O=X=xb=8ek=t=}=,= F==ď=4=|ٚ=\~=4#= Ȩ=l===|[=\=<=J==̓=8==\=<'==p===_=2>>'>~y> >V >p>6>>h>~> >Z_>Ʊ>6!>V#>%>~'>M*>^,>.>6E1>3>5><8>:>^<>3?>:A>C>+F>}H>J>^"M>tO>>Q>T>lV>X>[>bc]>ε_>>b>Zd>f>h>Qk>fm>o>>Ir>t>v>@y>{>f}>>!E>Wn>>>>3>k<>e>َ>>G> >3>\>#>[>ؓ>>*>7T>m}>>Ϛ>>I">K>t>>%ǡ>[>>B>l>7>o>>>:>Kc>>>ް>'>_1>Z>˃>>;ַ>q>(>Q>{>M>;>>>)I>_r>>>>;>s@>i>>>O>>7>`>+>c>>>/>?X>u>>>>Q&>O>x>>->c>>F> p>?>w>>>>>Sg>>>>/ >g5>^>Ӈ> >C>y>,>v>X\dh1)R3o޾;D߾lpd-creb-0.10.0/unittests/blosc~440.wav000066400000000000000000000040541434364737600174410ustar00rootroot00000000000000RIFF$WAVEfmt D dataA׷>y>)>R>|>U>ξ>> >1J>gs>>> >C>yA>j>>>U>>8>a>1>i>>> 0>EY>}>>>!>Y'>P>y>>5>k>>G>q>G>}>>>#?>Yh>>ɺ>>5 >m6>_>ۈ>>I>>->7>fC)ވ;ſQ޾ ::߾zz޾Y n߾<َ澁mSF޾".|ܾObgK޾+d.پᾋMپھ۾!+վfھԾiվԾоӾξϾ,KξM˾̾_ɾʾ0Ǿƾ[ƾľ!ľNͿ$cjtO\2 sൾ<d;`)鮾򿭾mMD񧾨Ȧq:vM#^џ'~U,Kژݰo^85 ⑾\%g=늾I‰oFm6ʂȡx~FL|yjwTus p]nD lָihfgebo`^B[wYf%WTR.PM@K6IdFD?B?=>H;8b6P41/Y-<+δ(`b&$!k:s^!|* 8 2\;$H-lエ>ؙ PݽDؽhԽaϽʽƽrμ@)d߮:ЕL<`]n(wpJne[HmR#I? 6hF-#@i1ؼQż]qʠ7"GwB Rb,DWŻvºL:xG;-;<{;^d!<^F<^kF=O=X=xb=8ek=t=}=,= F==ď=4=|ٚ=\~=4#= Ȩ=l===|[=\=<=J==̓=8==\=<'==p===_=2>>'>~y> >V >p>6>>h>~> >Z_>Ʊ>6!>V#>%>~'>M*>^,>.>6E1>3>5><8>:>^<>3?>:A>C>+F>}H>J>^"M>tO>>Q>T>lV>X>[>bc]>ε_>>b>Zd>f>h>Qk>fm>o>>Ir>t>v>@y>{>f}>>!E>Wn>>>>3>k<>e>َ>>G> >3>\>#>[>ؓ>>*>7T>m}>>Ϛ>>I">K>t>>%ǡ>[>>B>l>7>o>>>:>Kc>>>ް>'>_1>Z>˃>>;ַ>q>(>Q>{>M>;>>>)I>_r>>>>;>s@>i>>>O>>7>`>+>c>>>/>?X>u>>>>Q&>O>x>>->c>>F> p>?>w>>>>>Sg>>>>/ >g5>^>Ӈ> >C>y>,>v>P\dh1)R3o޾;D߾lpd-creb-0.10.0/unittests/bwin~-unittest.pd000066400000000000000000000003701434364737600205260ustar00rootroot00000000000000#N canvas 0 22 744 443 10; #X obj 373 90 creb/bwin~ hann; #X obj 52 137 testtools/unit-test-frame~; #X obj 373 49 sig~ 1; #X obj 52 58 loadbang; #X msg 52 100 bwin~ 0; #X connect 0 0 1 1; #X connect 2 0 0 0; #X connect 3 0 4 0; #X connect 4 0 1 0; pd-creb-0.10.0/unittests/bwin~.wav000066400000000000000000000040541434364737600170460ustar00rootroot00000000000000RIFF$WAVEfmt D data; h0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`0;>Jc>R>v>诵>>[>?Ջ ??(%?0?V>>>R>zc>0;>J>Tp==q==@`#>#>}*>FQ6>vA>lL>!1W>3a>l>[5v> >R>>)>N>>>)>>٦>z>>N>>G>y><>ٿ>JR>>>z>>E>C">/>v>(>\;>+>N>>;>x>2>5> N>wJ>+>>ɠ>&4>y>>a>h>`>_>>>>QQ>>>+I>T>R>!>.,>F>vٿ>j!>`>?>\ȸ>>>c0>G>[>Mj>v>}>F>>*>> >>>e>l>Q>\>>>>7>?>ଇ>'>̓>>W>-|>kx>t>p> Rm> i>f>R~b>^>Io[>W>T>Q>]M>]J> G>KC>@>Q=>j$:>6>3>]0>`->*>'>O$>!> >h3>Db>>>2>l> >h >>>`>ͳ=3=='=>=:=L{=="=5==s==:=R(=η==V9==ʦ=5='=f=V=N=N=\V=}e={=2}=zu=m=2f=^= W=O=23H=@=t9=$2=*=Z#=Sk=>==6=<<<~< <<տ<< <<qks#**$2u9@[3HJO;W^3fm3{u2}|eVNNVf`m\ʦY9cη(Ľtɽ9ͽҽs"׽۽{ཇ:彯꽟󽮴Q`L dljb3 P!$J'M*-0X3R7$:R=@C>GP^JԶMQTWo[Y^~bfiRmp&tlx3.|<まF΃t*܎bڅ6dՈoʆ7~CvjX[4H0񶾋ȸh`!ٿdG,þ7ľRƾeǾ8Iɾʾ̾OQ;ξϾоIѾDҾFӾaԾվGվ3־־־+׾'J׾M׾5׾׾ ־$;־վԾ +Ծ:Ӿ'ҾоϾ!ξ̾ʾȾ ƾľ`Q¾ؿ;x7߀MbyئHl(/얾ᚒ8(ބ -2vla-WiLesAM6*}{< 9LǽA_{yeI7eɼIG6J<5">8>|*>EQ6>vA>lL> 1W>2a>l>[5v> >R>>)>N>>>)>>٦>z>>N>>N>y><>ٿ>JR>>>y>>E>B">.>u>(>\;>+>K>>;>|>2>5> N>wJ>+>>ɠ>)4>x>>a>f>`>`>>pd-creb-0.10.0/unittests/cheby~-unittest.pd000066400000000000000000000007041434364737600206620ustar00rootroot00000000000000#N canvas 107 296 738 457 10; #X obj 371 138 creb/cheby~ 4; #X obj 50 179 testtools/unit-test-frame~; #X obj 371 48 osc~ 440; #X msg 416 22 0; #X msg 390 103 coef 1 0.5 \, coef 2 0.25 \, coef 3 0.125 \, coef 4 0.0625; #X msg 50 143 cheby~ 200; #X obj 50 113 loadbang; #X obj 391 77 loadbang; #X connect 0 0 1 1; #X connect 1 2 3 0; #X connect 2 0 0 0; #X connect 3 0 2 1; #X connect 4 0 0 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 4 0; pd-creb-0.10.0/unittests/cheby~.wav000066400000000000000000000040541434364737600172010ustar00rootroot00000000000000RIFF$WAVEfmt D dataNVL%MwZ_Kj㧾, } 4`?Xdx #M~b qdZ\PG?{^7P.i#t__ٽ/?H=$W=L.>8:v>$>z>>?!?R4?nE?;T?_?%h?,n?o?-n?h?_?T?oE?#4?!??<>>u>cBv>vT.> e=hH=8:/vٽ;h#pO.]7?,G[PZ } ,㧾1`cw&DL|NeWYk׹>h%ǭvUTlē̯* teg p\wRdI^AE9y0a& $9.SH3=t=>ae>殘>u>>f ?r?2l0?lA?P?i]?g?8@m?to?n?GQj?Db?M W?H?8?=&?T?p>>>@>%>*>>=MV{=ܱ"<F -ͽ! '؏ ,j5=ENNWcbCn9{|L ";N@uz;R^nl֣ *ĄЦ(K歾y뭾ܬפAĢNQJEw>\j^pT K=3C $;2(No tǪT>؏>m>^N>??.=,?>?M?Z?-e?%l?o?aro?%k?ed?vY?gL?Iwɳ>^>fRN>ϱ >껗=Ҷ<"ʼkڀF . J)i3;CLLU_uk2x悾[0=՝6;䪾A&ڭլ z1R[蠾qgà GɢتԢ%í3c@| ࣾjS⑾劾ڃz#m`aVvMs EW<~4t+bh"|ȽnH}iΎD>|>=I>>"?m?X'?n!:?]J?-X? c?j?"o?o?l?Vf?4\?O?7I@?.?C?B?P>>B(>^>>p==us`Ç;v齸 <^#'W1:B3WJfRS6Hj- K"(Խ0Ù! c;K\=$=4> }>n9>՟>> ?Y#?`%6?8F?LHU?r`?Fhi?zn?o?@m?uh?\_?R?D?62?V ?h- ?Q>5>D ><~o>I(>-=`5=#j+>szI޽3|z$1/!8eE@dkH1Q|[ fGrƍiᠾNM0G_e!묧T2~do[m!: d੾㫾Ypd-creb-0.10.0/unittests/clog~-unittest.pd000066400000000000000000000010341434364737600205110ustar00rootroot00000000000000#N canvas 0 22 752 559 10; #X obj 322 201 creb/clog~; #X obj 1 261 testtools/unit-test-frame~; #X obj 379 126 -~ 0.25; #X msg 385 59 0; #X obj 322 174 cos~; #X obj 379 150 wrap~; #X obj 379 174 cos~; #X obj 322 88 phasor~ 100; #X obj 322 227 /~ 3.14159; #X msg 1 232 clog~ 0; #X obj 1 200 loadbang; #X connect 0 0 8 0; #X connect 1 2 3 0; #X connect 2 0 5 0; #X connect 3 0 7 1; #X connect 4 0 0 0; #X connect 5 0 6 0; #X connect 6 0 0 1; #X connect 7 0 4 0; #X connect 7 0 2 0; #X connect 8 0 1 1; #X connect 9 0 1 0; #X connect 10 0 9 0; pd-creb-0.10.0/unittests/clog~.wav000066400000000000000000000040541434364737600170330ustar00rootroot00000000000000RIFF$WAVEfmt D data76;<(^<_>R >h>@>A>>ӊ">/'>+>dy0>@5>9>g>> C>G>}VL>ZP>0U> EZ>^>c>3h>rl>M}q>)"v>z>k>Y>Z>2>> R>w>>PI>>)>@>>o>7>H>ܤ>"/>>ӫ>j&>x>C˲>>p>¹>>fg>չ>B >^>>>U>e>>BM>>>D>>f>;>C>> 3>>>k*>|>H>!>%t>>>qk>?(?_1?Z?̓??=?u?( ?Q ?{ ?R ????0I?fr??? ?D?|@?i??"?Y??7 ?`!?7"?m#?$?&?/'?JX(?)?*?+?',?]&.?O/?x0?1?:2?r3?5?F6?p7?N8?9?:?=?ag>???Ϲ@?A?= C?s5D?^E?F?G?PH?J?,K?UL?+M?aN?O?P?$R?=MS?tvT?U?V?W?QY?DZ?m[?\?/]?e^?`?;a? eb?Bc?yd?e? g?3h?W\i?j?Įk?l?2n?k*o?Sp?|q?r?Hs?t?!v?Jw?%tx?]y?z?{?}?:B~?qk?qk;B~}{z]y%txJw!vtGsr|qSpi*o0nl®kjS\i3h getd=ceb;a`^^&]\m[DZGYWVUivT0MS#RPORNMUL,KsJ >=<:h9/8o7F65R321x0qO/;&.,+*])$X(.'&|$E# "`!7 f/iQ@q;rI[% z Q }( G׬hZ21k9s\!{|*゙12Ut;޾ܾ+Dھ׾OվLӾnоξU̾&ʾǾJ^ž þif!¹oEʲdx%ӫ.@ܤщa7䝾@햾=H]񣍾Q9Zjz v$|qBlf2hc^CZU PAULcG Cf>95x0;+[.'"?2Q Ry2{1޽RսT̽ ýmw-㝽;yP zq^+SLȿ9C,'Z޼񼹼畔^ 76;<(^<_>R >i>@>A>>ڊ">/'>+>dy0>@5>9>g>> C>G>VL>ZP>2U> EZ>^>Ŏc>3h>rl>N}q>)"v>z>k>Y>Z>3>> R>y>>RI>>)>@>>o>7>I>pd-creb-0.10.0/unittests/dist~-unittest.pd000066400000000000000000000006131434364737600205320ustar00rootroot00000000000000#N canvas 128 152 747 511 10; #X obj 57 234 testtools/unit-test-frame~; #X obj 378 110 osc~ 440; #X msg 423 83 0; #X msg 447 161 5; #X obj 447 138 loadbang; #X obj 57 177 loadbang; #X msg 57 206 dist~ 100; #X obj 378 186 creb/dist~ 3; #X connect 0 2 2 0; #X connect 1 0 7 0; #X connect 2 0 1 1; #X connect 3 0 7 1; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 6 0 0 0; #X connect 7 0 0 1; pd-creb-0.10.0/unittests/dist~.wav000066400000000000000000000040541434364737600170520ustar00rootroot00000000000000RIFF$WAVEfmt D dataE2:d4&67۷89*: :E:s::Mg9x|8-I75L31/+U($ͫ fAQþh SiŽx弉HSo=5Ȉ;d = = _>Bh>*Q>]w>>j ?p??1?$?Y(?`,?~m/?@2?e+4?5?o7?n8?x}9?:?{:?:?{:?:?|}9?s8?o7?5?s+4?Q2?m/?`,?{(?ʋ$?c?V?? ?j>tx>R>i>F_>R=3=t;>5-Sy弋ŽSfPþD@㾳~ |$U(`+/1635I7o|8Fg9:s:E::*:987&6Md43E2/,8)%' SXl: A龂5˾GkKhsɻퟷ6;ѿ<ȯ=-G>dH>9>X>JZ>p?0??H?{#?''?+?+.?%u1?33?5?T!7?]8?O9?^9?k:?0:?6:?'8:?9?:8?67?^T6?4?2?` 0?-?H)?[%? ?~?qF?B& ?S?>}>l >)w>~>`9=j"<V8͸Vap:_Nܾ=PY "pj'7+tq.,1^y3d56<8899fb:::5D:5987964n2Z0hy-*& X!& բϵҾV+}eB\: <=->>ᴶ>c%>>n?i?v??`"?>&?*?m.?*0?;3?15?6?8?9?9?HX:?>:?t:?O:?a9?m 9?8?6?5?b 3?80?-?}*?B&?@!?~p??!??U>S>d/>+A><#>{v=X<\:Z빫Opc % GLվ} .Mi!v&mh*-0246799M:::cZ:9#9"8N6;5hH3!0,.* '|"yeyپkȻf0 *vT9S#{>>> >L? ?t??/:!?H%?)?g-?xK0?W2?4?ox6? 7?Q8?]9?A:?:?:?=d:?b9?<9?C8?7?n5?3?J;1?ׂ.?$L+?'? #????t?->H>߻>T>=>咟=ǤeP>o>8>/? ?@?h3? ?$?S")?,?/?72?X4?k6?.7?88?ю9?(:?π:?j:?cu:?:?k9?8?+Q7?5? 3?1?+/?(,?l(? $?0 ?Z??: ?1>e>!>l>-V>X*=U<>c;To!M.ؽM]hƾ :a@xJkp$c(PM,\/14I5h7h8y9:y:Ԛ: }::pd-creb-0.10.0/unittests/dwt~-unittest.pd000066400000000000000000000004651434364737600203720ustar00rootroot00000000000000#N canvas 0 22 787 536 10; #X obj 394 189 creb/dwt~; #X obj 394 142 phasor~ 440; #X msg 457 105 0; #X obj 73 243 testtools/unit-test-frame~; #X obj 73 165 loadbang; #X msg 73 204 dwt~ 100; #X connect 0 0 3 1; #X connect 1 0 0 0; #X connect 2 0 1 1; #X connect 3 2 2 0; #X connect 4 0 5 0; #X connect 5 0 3 0; pd-creb-0.10.0/unittests/dwt~.wav000066400000000000000000000040541434364737600167050ustar00rootroot00000000000000RIFF$WAVEfmt D data?P(?0<(20= >x-=33|f>3;3>`33k>>*?(2$9Z>w#淽2Q_2F&3333u=33j>33k>>>w>6> < 2P=3XA=U?3?3?>Y=<22㕝2()3>(2P"9 &?w#淽R_3F&333u=333j>33k>>>w>_>>=W2t:233K33( v(2P(9 ? < 2P=3XA=Zs=33z&>3?>׾=<2C(+2>)2P#9?w#淽P_3F&333u=333j>33k>>>w>/> <|3+?>=42|=2L#3k[3("3>&2P(9pd-creb-0.10.0/unittests/dynwav~-unittest.pd000066400000000000000000000006731434364737600211050ustar00rootroot00000000000000#N canvas 149 186 729 497 10; #X obj 369 171 creb/dynwav~; #X obj 414 43 bang~; #X msg 414 70 0.25; #X msg 501 118 0; #X obj 48 224 testtools/unit-test-frame~; #X obj 48 150 loadbang; #X obj 438 145 phasor~ 220; #X obj 369 102 osc~ 120; #X msg 48 185 dynwav~ 20; #X connect 0 0 4 1; #X connect 1 0 2 0; #X connect 2 0 7 1; #X connect 3 0 6 1; #X connect 4 2 3 0; #X connect 5 0 8 0; #X connect 6 0 0 1; #X connect 7 0 0 0; #X connect 8 0 4 0; pd-creb-0.10.0/unittests/dynwav~.wav000066400000000000000000000040541434364737600174170ustar00rootroot00000000000000RIFF$WAVEfmt D datat't-2v8=qCHChN;SXY/^Adi#o&tyipi·/^0ߏ:旾:㟾/ԧxY7e/Mɼaľ/"Ǿ@ɾD̾+ξbѾSӾx־پLj۾޾ʑ㾊徒 qV ,5PO G( x5 (` 7&JlƎWW N'Ax[s* L!<"#C$.%&* (r)$*j/+8,@-? @AZBF}CzcDGE*Fs GGHIJ~^K6L MMöNMOGZP)QQlRVSTTUU~VgW(XXģY._Z:[U\\i\CYZB_pWw i?U@GAAk+BCCMDEFG|fHDI JJK/L$MVN)O}OP˙QfR0SSTULVWWSXNY, ZZ[\!]ZaYe\\3ivdqH4;; ==;=e+3 { 1D3Nre{?evZ~˽2׽j+ G`sfG: Yngu"q(-v38t>CZmIN~`TY"M_dK2j/owu"}zS[ ɾn̒y$Ϛx Ǣ^mWHWؖ4зk@:5¾ľ^Ǿɾy̾ϾcѾ)Ծ־<پ۾H޾7/N㾯徐M辒nE-5<mlmi:k "% P C{ g@d_p5% A[uO| !X"#$&i'#(0)<*G+P,X-_. d/g0j1pd-creb-0.10.0/unittests/eadsr~-unittest.pd000066400000000000000000000010151434364737600206620ustar00rootroot00000000000000#N canvas 0 22 792 504 10; #X obj 65 212 testtools/unit-test-frame~; #X msg 386 60 start; #X obj 65 151 loadbang; #X msg 407 98 17; #X msg 439 95 8; #X msg 503 95 20; #X msg 471 95 10; #X msg 65 179 eadsr~ 0; #X obj 450 57 loadbang; #X obj 386 141 creb/eadsr~ 0 0; #X connect 0 2 1 0; #X connect 1 0 9 0; #X connect 2 0 7 0; #X connect 3 0 9 1; #X connect 4 0 9 2; #X connect 5 0 9 4; #X connect 6 0 9 3; #X connect 7 0 0 0; #X connect 8 0 3 0; #X connect 8 0 4 0; #X connect 8 0 6 0; #X connect 8 0 5 0; #X connect 9 0 0 1; pd-creb-0.10.0/unittests/eadsr~.wav000066400000000000000000000040541434364737600172050ustar00rootroot00000000000000RIFF$WAVEfmt D dataD<\ >ow>&>t$>0V,>%4>/;>WC>~'K>ͮR>o$Z>a>Qh>p>lMw>m~>>-=>$>">>>f?>n>՝>B>2M>}>y>ǭ>>>>>e>>->>c>P>a>/>>>p>9$>~>zx><>ӳ>LH>>!_>>,^>>E>>>v>p??:?x_??Y?R??q ? ?N ?r( ?6?CA?I?FP?)T?U?T?Q?L?GD?0:?-?B?v?y?O????Q| ?\!?:"?#?#?@$?k%?s&?E'?4(?(?%)?{*?D+? ,?,?-?~U.?>/?;/?z0?I1?2?2?Zo3?#4?>4?5?46?6?7?78?08?/9?,:?:? s;??"??0??R@?@?{A?B?B?0C?ݾC?WLD?D?hcE?E?auF?|F?ZG?H?iH? I?I?} J?'J? K?K?8L?M{L?CL?lM?M?XN?N?@O?O?$P?ݔP?3Q?rQ?Q?LR?nR?!S?S?|S?ZT?cT?&U?U?6U?QV?سV?W?tW?W?f2X?ۏX?tX?4HY?Y?/Y?oVZ?ݮZ?{[?L][?Q[?\?\\?\?]?U]?]?]?G^?Ֆ^?G^?3_?_?T_?`?b`?`?`??a?a?>a?!b?]\b?b?b?:+c?nc?c?tc?M6d?wd?1d??d?7e?ve?e?e?/f?jlf?wf?f?g?VYg?7g?g?ch?=h?yuh?h?h?i?Oi?фi?i?i?!j?Uj?j?Zj?Lj?k?Nk?hk?k?=k?l?S=l?kl?l??l?al?!m?hMm?Oym?Ϥm?m?m?$n?Nn?cxn?n?Tn?n?o?pBo?io?o?Go?o?ep?(p?Np?rp?|p?p?p?q?8&q?Iq?kq?ލq?ɯq?dq?q?r?`4r?Tr?tr?r?+r?cr?Rr?s?V/s?mMs?=ks?Ljs? s? s?s?As?wt?j4t?Pt?kt?t?t?_t?t?t? u?$u?6>u?xWu?~pu?Ju?ۡu?3u?Ru?8u?v?\v?0v?Gv?w^v?uv?|v?v?v?yv?v?wv? w?"w?|7w?Lw?`w?tw?؈w?w?jw?w?Cw?kw?fw?5x?"x?O5x?Gx?Yx?kx?|}x?x?x?x?x? x?x?x?y?|y?&y?6y?Fy?Vy?(fy?uy?y?:y?Ny?>y? y?y?=y?y?y? z? z?$z?2z?J@z?Mz?*[z?jhz?uz?z?qz?7z?ߨz?iz?z?%z?Wz?mz?fz?Cz? {?{?5!{?,{?7{?3C{?SN{?XY{?Dd{?o{?y{?n{?{?b{?{?{?{?&{?{?{?{?q{? {?{?|?O|?|?!|?*|?3|?<|?E|?QN|?V|?_|?h|?p|?x|?-|?b|?|?|?|?x|?N|?|?|?d|?|?n|?|?1|?y|?|?|?}? }?}?}?}?]%}?,}?2}?I9}??}?CF}?L}?S}?HY}?_}?e}?k}?q}?w}?}}?}?}?L}?}?}?T}?}?m}?}?pd-creb-0.10.0/unittests/ead~-unittest.pd000066400000000000000000000006251434364737600203230ustar00rootroot00000000000000#N canvas 0 22 792 504 10; #X obj 65 212 testtools/unit-test-frame~; #X msg 386 60 start; #X obj 65 151 loadbang; #X msg 423 98 17; #X msg 461 98 8; #X obj 450 57 loadbang; #X obj 386 141 creb/ead~ 0 0; #X msg 65 179 ead~ 0; #X connect 0 2 1 0; #X connect 1 0 6 0; #X connect 2 0 7 0; #X connect 3 0 6 1; #X connect 4 0 6 2; #X connect 5 0 3 0; #X connect 5 0 4 0; #X connect 6 0 0 1; #X connect 7 0 0 0; pd-creb-0.10.0/unittests/ead~.wav000066400000000000000000000040541434364737600166400ustar00rootroot00000000000000RIFF$WAVEfmt D dataD<\ >ow>&>t$>0V,>%4>/;>WC>~'K>ͮR>o$Z>a>Qh>p>lMw>m~>>-=>$>">>>f?>n>՝>B>2M>}>y>ǭ>>>>>e>>->>c>P>a>/>>>p>9$>~>zx><>ӳ>LH>>!_>>,^>>E>>>v>p??:?x_??Y?R??q ? ?N ?r( ?6?CA?I?FP?)T?U?T?Q?L?GD?0:?-?B?v?y?O????Q| ?\!?:"?#?#?@$?k%?s&?E'?4(?(?%)?{*?D+? ,?,?-?~U.?>/?;/?z0?I1?2?2?Zo3?#4?>4?5?46?6?7?78?08?/9?,:?:? s;??"??0??R@?@?{A?B?B?0C?ݾC?WLD?D?hcE?E?auF?|F?ZG?H?iH? I?I?} J?'J? K?K?8L?M{L?CL?lM?M?XN?N?@O?O?$P?ݔP?3Q?rQ?Q?LR?nR?!S?S?|S?ZT?cT?&U?U?6U?QV?سV?W?tW?W?f2X?ۏX?tX?4HY?Y?/Y?oVZ?ݮZ?{[?L][?Q[?\?\\?\?]?U]?]?]?G^?Ֆ^?G^?3_?_?T_?`?b`?`?`??a?a?>a?!b?]\b?b?b?:+c?nc?c?tc?M6d?wd?1d??d?7e?ve?e?e?/f?jlf?wf?f?g?VYg?7g?g?ch?=h?yuh?h?h?i?Oi?фi?i?i?!j?Uj?j?Zj?Lj?k?Nk?hk?k?=k?l?S=l?kl?l??l?al?!m?hMm?Oym?Ϥm?m?m?$n?Nn?cxn?n?Tn?n?o?pBo?io?o?Go?o?ep?(p?Np?rp?|p?p?p?q?8&q?Iq?kq?ލq?ɯq?dq?q?r?`4r?Tr?tr?r?+r?cr?Rr?s?V/s?mMs?=ks?Ljs? s? s?s?As?wt?j4t?Pt?kt?t?t?_t?t?t? u?$u?6>u?xWu?~pu?Ju?ۡu?3u?Ru?8u?v?\v?0v?Gv?w^v?uv?|v?v?v?yv?v?wv? w?"w?|7w?Lw?`w?tw?؈w?w?jw?w?Cw?kw?fw?5x?"x?O5x?Gx?Yx?kx?|}x?x?x?x?x? x?x?x?y?|y?&y?6y?Fy?Vy?(fy?uy?y?:y?Ny?>y? y?y?=y?y?y? z? z?$z?2z?J@z?Mz?*[z?jhz?uz?z?qz?7z?ߨz?iz?z?%z?Wz?mz?fz?Cz? {?{?5!{?,{?7{?3C{?SN{?XY{?Dd{?o{?y{?n{?{?b{?{?{?{?&{?{?{?{?q{? {?{?|?O|?|?!|?*|?3|?<|?E|?QN|?V|?_|?h|?p|?x|?-|?b|?|?|?|?x|?N|?|?|?d|?|?n|?|?1|?y|?|?|?}? }?}?}?}?]%}?,}?2}?I9}??}?CF}?L}?S}?HY}?_}?e}?k}?q}?w}?}}?}?}?L}?}?}?T}?}?m}?}?pd-creb-0.10.0/unittests/ead~subnormal-unittest.pd000066400000000000000000000122131434364737600222420ustar00rootroot00000000000000#N canvas 444 35 680 522 10; #X obj 55 118 bang~; #X obj 40 150 snapshot~; #X obj 40 24 bng 50 1000 50 0 empty empty empty 17 7 0 10 -262144 -260097 -1; #X obj 40 177 change; #X obj 40 232 sel 0; #X obj 40 258 f; #X floatatom 62 303 17 0 0 0 - - -; #X msg 134 27 \; pd dsp 1; #X msg 204 27 \; pd dsp 1; #X obj 134 -2 loadbang; #X obj 114 354 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 47 354 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 40 330 moses 1e-46; #N canvas 181 252 394 427 single 0; #X obj 27 20 inlet; #X msg 114 147 NORMAL \$1; #X msg 25 293 UNIT-TEST-DONE; #X obj 26 390 print unit-test; #X obj 54 364 stdout; #X obj 134 390 outlet; #X obj 25 247 t b a; #X obj 53 328 list trim; #X obj 25 215 pack s f s; #X obj 81 187 r \$0-classname; #X msg 26 147 SUBNORMAL \$1; #X obj 26 113 moses; #X msg 76 47 2; #X floatatom 76 115 15 0 0 0 - - -; #X obj 75 19 loadbang; #X obj 76 77 pow -126; #X text 176 116 smallest normal value for float; #X msg 135 356 set \$1 \$2 \$3; #X connect 0 0 11 0; #X connect 1 0 8 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 6 0 2 0; #X connect 6 1 17 0; #X connect 6 1 7 0; #X connect 7 0 3 0; #X connect 7 0 4 0; #X connect 8 0 6 0; #X connect 9 0 8 2; #X connect 10 0 8 0; #X connect 11 0 10 0; #X connect 11 1 1 0; #X connect 12 0 15 0; #X connect 14 0 12 0; #X connect 15 0 13 0; #X connect 15 0 11 1; #X connect 17 0 5 0; #X restore 104 378 pd single; #N canvas 101 191 396 411 double 0; #X obj 26 13 inlet; #X msg 24 279 UNIT-TEST-DONE; #X obj 25 366 print unit-test; #X obj 52 339 stdout; #X obj 131 366 outlet; #X obj 25 241 t b a; #X msg 180 150 NORMAL \$1; #X obj 53 308 list trim; #X obj 25 217 pack s f s; #X obj 82 187 r \$0-classname; #X msg 26 149 SUBNORMAL \$1; #X obj 26 116 moses; #X msg 73 43 2; #X obj 72 15 loadbang; #X obj 73 76 pow -1022; #X floatatom 72 117 15 0 0 0 - - -; #X text 175 116 smallest bnormal value for double; #X msg 131 331 set \$1 \$2 \$3; #X connect 0 0 11 0; #X connect 1 0 3 0; #X connect 1 0 2 0; #X connect 5 0 1 0; #X connect 5 1 17 0; #X connect 5 1 7 0; #X connect 6 0 8 0; #X connect 7 0 2 0; #X connect 7 0 3 0; #X connect 8 0 5 0; #X connect 9 0 8 2; #X connect 10 0 8 0; #X connect 11 0 10 0; #X connect 11 1 6 0; #X connect 12 0 14 0; #X connect 13 0 12 0; #X connect 14 0 11 1; #X connect 14 0 15 0; #X connect 17 0 4 0; #X restore 40 378 pd double; #X msg 40 413 SUBNORMAL 2.2114198411132e-308; #X text 134 92 exponential decay; #X text 302 6 [creb/ead~] checks for subnormals once per signal block. Therefore \, subnormals do happen when the curve approaches zero \, but only for a short period of time (depending on blocksize).; #X obj 40 92 creb/ead~ 0 15; #X text 64 281 smallest non-zero number seen by [snapshot~]; #X text 301 74 In this patch we test if the subnormals-flush routine works as expected. Open [pd more] to see how small subnormals can go for a given precision.; #X msg 345 358 ead~; #X obj 345 411 s \$0-classname; #X obj 345 383 symbol; #X obj 346 333 loadbang; #X obj 457 211 s \$0-smallnumbers; #X msg 456 179 arrayviewlistnew; #X obj 455 250 table \$0-smallnumbers 10000; #N canvas 626 222 402 246 write 0; #X obj 27 38 inlet; #X obj 25 198 tabwrite \$0-smallnumbers; #X obj 26 91 t f b; #X obj 54 132 f; #X obj 85 132 + 1; #X obj 132 35 inlet; #X msg 132 89 const 0; #X msg 70 94 0; #X obj 133 133 s \$0-smallnumbers; #X msg 188 89 arrayviewclose; #X connect 0 0 2 0; #X connect 2 0 1 0; #X connect 2 1 3 0; #X connect 3 0 4 0; #X connect 3 0 1 1; #X connect 4 0 3 1; #X connect 5 0 6 0; #X connect 5 0 7 0; #X connect 5 0 9 0; #X connect 6 0 8 0; #X connect 7 0 3 1; #X connect 9 0 8 0; #X restore 82 258 pd write; #X obj 40 203 abs; #N canvas 683 194 435 442 more 0; #X msg 39 359 2; #X floatatom 39 413 15 0 0 0 - - -; #X obj 39 330 t b f; #X msg 38 46 2; #X floatatom 55 99 15 0 0 0 - - -; #X obj 38 385 pow; #X obj 37 18 loadbang; #X floatatom 38 306 5 0 0 0 - - -; #X floatatom 40 155 15 0 0 0 - - -; #X text 36 254 check how small a non-zero value can be represented ; #X text 37 184 Some CPU architectures support denormal numbers by default. Repeated calculation of subnormal numbers can happen in recursive filters \, feedback delay lines \, reverb simulators etc. This slows down calculation considerably.; #X obj 54 71 pow -126; #X obj 39 126 pow -1022; #X text 143 154 smallest bnormal value for double; #X msg 39 277 -127; #X msg 82 276 -1023; #X text 156 98 smallest normal value for float; #X connect 0 0 5 0; #X connect 2 0 0 0; #X connect 2 1 5 1; #X connect 3 0 11 0; #X connect 3 0 12 0; #X connect 5 0 1 0; #X connect 6 0 3 0; #X connect 7 0 2 0; #X connect 11 0 4 0; #X connect 12 0 8 0; #X connect 14 0 7 0; #X connect 15 0 7 0; #X restore 307 142 pd more; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 2 0 18 0; #X connect 2 0 28 1; #X connect 3 0 29 0; #X connect 4 0 5 0; #X connect 4 1 5 1; #X connect 4 1 28 0; #X connect 5 0 6 0; #X connect 5 0 12 0; #X connect 9 0 7 0; #X connect 9 0 2 0; #X connect 12 0 11 0; #X connect 12 0 14 0; #X connect 12 1 10 0; #X connect 12 1 13 0; #X connect 13 0 15 0; #X connect 14 0 15 0; #X connect 18 0 1 0; #X connect 21 0 23 0; #X connect 23 0 22 0; #X connect 24 0 21 0; #X connect 26 0 25 0; #X connect 29 0 4 0; pd-creb-0.10.0/unittests/ear~-unittest.pd000066400000000000000000000006251434364737600203410ustar00rootroot00000000000000#N canvas 0 22 792 504 10; #X obj 65 212 testtools/unit-test-frame~; #X msg 386 60 start; #X obj 65 151 loadbang; #X obj 450 57 loadbang; #X obj 386 141 creb/ear~ 0 0; #X msg 65 179 ear~ 0; #X msg 461 96 1; #X msg 423 96 16; #X connect 0 2 1 0; #X connect 1 0 4 0; #X connect 2 0 5 0; #X connect 3 0 7 0; #X connect 3 0 6 0; #X connect 4 0 0 1; #X connect 5 0 0 0; #X connect 6 0 4 2; #X connect 7 0 4 1; pd-creb-0.10.0/unittests/ear~.wav000066400000000000000000000040541434364737600166560ustar00rootroot00000000000000RIFF$WAVEfmt D data|b >ow>>Mq%>->6>J>>iF>tN>kV>N^>Nf>u>j}>M>x>$>Y>>j>>>m>~>S>~E>A>>0>n>դ>Ҽ>>>G->;>B>~B>:> +>h>m>B>>q>O7>>>"_> >V>J>5>mq>@>_??}?~??Q'?Y??? ? ?e) ?KJ ?ah??7????M?p???V?7??}????? ?)!?_"?K#?j$?ZO%?1&?'?M'?(?m)?{*?Q+?G$,?k,?-?.?\/?%0?0?,1?vu2?63?Z3?4?o5?)6?6?>7?L8?8?9?`:? ;?;?c?>?Ğ??T?@?T@?{A?B?B?JC?aC?OxD? E?̟E?c1F?F?SPG?G?iH?TH?}I?J?-J?|K?K?9L?L?M?ϘM?N?N?BO?SO?4P?xP?pP?dQ? Q?'LR?"R?/S?ǞS?v T?{T?T?SU?U?&V?GV?V?\W?RW?&X?X?zX?MY?qY?Z?lZ?\Z?)'[?[?[?+8\?h\?\?HA]?]?]?B^?ܖ^?/^?<_?i_?S_?s/`?~`?^`?-a?:ha?a?b?Jb?b?[b?'c?nc?3c?c?Bd?̇d?Nd?%e?SSe?ڕe?e?f?Yf?f?f?g?Ug?Ag?+g?} h?9Hh?`h?h?h?e1i?Fji?i?ai?j?OHj?y~j?j?9j?k?Qk?yk?k?k?4l?Nl?l?l?l?em??m?cnm?m?m?m?$n?xQn?}n?F}? M}?S}?oZ}? a}?g}? n}?tt}?z}?}?O}?y}?}?}?}?}?g}?7}?}?}?P}?}?p}?}?X}?}? }?O}?}?}?}?}?~?~? ~?~?}~?D~?~?#~?S(~?,~?x1~?5~?p:~?>~?;C~?G~?pd-creb-0.10.0/unittests/fdn~-unittest.pd000066400000000000000000000005701434364737600203400ustar00rootroot00000000000000#N canvas 98 70 727 466 10; #X obj 39 177 testtools/unit-test-frame~; #X obj 360 86 phasor~ 1; #X msg 411 57 0; #X obj 39 106 loadbang; #X msg 376 111 reset; #X obj 360 134 creb/fdn~ 64 200; #X msg 39 141 fdn~ 1100; #X connect 0 2 2 0; #X connect 1 0 5 0; #X connect 2 0 1 1; #X connect 2 0 4 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 5 0 0 1; #X connect 6 0 0 0; pd-creb-0.10.0/unittests/fdn~.wav000066400000000000000000000040541434364737600166560ustar00rootroot00000000000000RIFF$WAVEfmt D dataS>S>gT>>T>FQT>-\T>bT>fT>hT>iT>jT>kT>lT>xmT>;nT>oT>oT>'>??q??!?{?g??ϛ????z????}?ͮ??Y???{?̏?O?k??ɔ?+??ĝ??????F?\?ʛ??x?7>ٔ>>Rd>>>ۻ>>>vD>p>V߸>˸>>K>\>>X>/>E>n>֣>ɛ>_>rs>F> >1>N>X>E>>}>0>Lœ>Ĝ>IŜ>Ŝ>Ŝ>Ŝ>3Ɯ>Ɯ>Ɯ>ǜ>pǜ>ǜ>Ȝ>nu>+:>xH>j>BZ=/=2=*==s =&=;=H=P=MU=@X=RZ=\====@^===>$(>+>:q,>P*>&> $>d">u!> >< > > >Hz >Hv >nt >s >s >.t >t > >&!>M >6O=B~=(="=8=Q===&=;= ====O=J=N=====>{>߁!>!>!>V!>Y">,">>">QG">R">`">m">x">">">">[">">F">O">8">|">%e">"=(>z,>p.>.>/>2>4>L5> 5>+6>H6>S6>X6>Z6>\6>\6>75>&v4>z2>>1>-.>\W>w>@>T>>s`>a0>%>>0>>>G>M>P>Q>R>S>$T>T>T>>U>5>,>>k>k>1>?` ?n??J?a?e?e?ge? e?e?e?=e?ae?e?e??b?"?$?b&?J'?&'?>(?(?(?(?X(?)?5 )? )?q)?)?)?J)?E2)?R)?w)?Ϝ)?@)?)?ht+?,?-?.?<.?q.?.?.?k.?.?b.?f.?I.?=.?k.?.?.?o.?|.?F-?-?U+?*?'?Q%?$?D$?] $?#?#?#?#?#?#?#?#?#?#?#?#?8!+?_0?Ԗ3? 5?&?Q ??Ϧ????S?????՚?\?????!?8?H?[?O??ĩ?????? ???M????J?O???]????=3 ? ? ?2 ?c ? ? ? ? ?O ? ?u ?S ?ټ ?, ?c ? ? ????/C???-.??|?q?i?,g?f?g?g?)h?h?h?i?Hi??s;?B?l]?3m?U-u?L?@?w?97?BG?Ɏ??!?^-?2?5?'6?6?6?7?77?P7?h7?8=?I?Y?i?v??#?P?Ԛ??f??,???P?Ȫ?,???p??;???H?Ҍ?Ћ?捌?z?Ԍ?V??z?? ? ?% ?v ? ? ? ?q?U?Ҏ??ؐ? ?3> q>K>>r>e>d>d>pd-creb-0.10.0/unittests/ffpoly-unittest.pd000066400000000000000000000006501434364737600206710ustar00rootroot00000000000000#N canvas 0 22 714 567 10; #X obj 352 157 creb/ffpoly 3 5; #X obj 352 97 loadbang; #X obj 31 260 testtools/unit-test-frame; #X obj 352 187 - 2; #X msg 352 123 coefficients 83092; #X msg 31 230 ffpoly; #X obj 31 198 loadbang; #X text 352 53 ffpoly - compute a finite field polynomial; #X connect 0 0 3 0; #X connect 1 0 4 0; #X connect 2 2 0 0; #X connect 3 0 2 1; #X connect 4 0 0 0; #X connect 5 0 2 0; #X connect 6 0 5 0; pd-creb-0.10.0/unittests/ffpoly.wav000066400000000000000000000040541434364737600172100ustar00rootroot00000000000000RIFF$WAVEfmt D data??????????????????????????????????????????????????????????????????????????????????????????????????????pd-creb-0.10.0/unittests/filterortho~-unittest.pd000066400000000000000000000007631434364737600221360ustar00rootroot00000000000000#N canvas 0 22 743 565 10; #X obj 376 215 creb/filterortho~; #X msg 394 181 setBP 220 1; #X obj 376 71 phasor~ 440; #X obj 55 270 testtools/unit-test-frame~; #X msg 439 40 0; #X obj 394 152 loadbang; #X msg 55 241 filterortho~ 200; #X obj 55 202 loadbang; #X obj 376 97 -~ 0.5; #X obj 376 122 *~ 2; #X connect 0 0 3 1; #X connect 1 0 0 0; #X connect 2 0 8 0; #X connect 3 2 4 0; #X connect 4 0 2 1; #X connect 5 0 1 0; #X connect 6 0 3 0; #X connect 7 0 6 0; #X connect 8 0 9 0; #X connect 9 0 0 0; pd-creb-0.10.0/unittests/filterortho~.wav000066400000000000000000000040541434364737600204500ustar00rootroot00000000000000RIFF$WAVEfmt D data0kw_eSZ@Dr-O]V<t`\΁7t;tx#> 7>J>^>8kq>K>Lϋ>?>›>>>.>2>>>N>^L>>@>Γ>?? ????p?,?E"?{&?d*?c?I?`>>x>:U>bu><=n<3.TU yČh\?@Ǿ`tϾD־۾| b8(羶辐I`z;\tᾂ޾%ھվOоaO˾už4ǓLKΚ)KȴqJ_M ;T(N^ݽfFbN? <&>:>N>`a>t>xڃ>T>[>>!N>v>N>>Zh>3>>M>b>f>9Y?q?5}?{ ?;k?M?"???N#?F&?L?/=?'_>&>ְ>I>p%>h=k#2#>f7>J>^^>q>j>>P]>>>Z/>BI>K>6>o >%>c>C>V>(>^??{ ????}y?w5?"?ك&???>&i>>TH>4>=uv|#>$7>eJ>B ^>nq>\M>Ћ>HA>Z>[>>0>3>>B>>M>>"B>>?&?0 ??:??,q?`-?"?0|&?p?s?ގ>r[>>:H>>߇=0 vx#> 7>J>^>9kq>K>Nϋ>?>ś>>>.>2>>>P>`L>>@>Г>?? ????p?,?H"?{&???>Z>>@9H>>N݇= <47h:@9`0z>ɠӭo9þ̾]ԾھR^S*꾺.쾂쾺뾆lO3XmᾀݾXپPԾ ξ%Ⱦ?¾`ỾAմLvʥ'؝j4Dkw_e^SD[@r- Pڥbpd-creb-0.10.0/unittests/filterortho~subnormal-unittest .pd000066400000000000000000000135361434364737600241230ustar00rootroot00000000000000#N canvas 427 28 691 516 10; #X obj 69 197 bang~; #X obj 39 222 snapshot~; #X obj 38 46 bng 50 1000 50 0 empty empty empty 17 7 0 10 -262144 -260097 -1; #X obj 39 249 change; #X obj 39 296 sel 0; #X obj 39 322 f; #X floatatom 55 365 17 0 0 0 - - -; #X msg 141 59 \; pd dsp 1; #X msg 205 59 \; pd dsp 1; #X obj 116 3 loadbang; #X obj 113 418 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 46 418 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 39 394 moses 1e-46; #N canvas 582 172 303 432 single 0; #X obj 27 20 inlet; #X msg 115 163 NORMAL \$1; #X msg 25 293 UNIT-TEST-DONE; #X obj 26 390 print unit-test; #X obj 54 364 stdout; #X obj 134 390 outlet; #X obj 25 247 t b a; #X obj 53 328 list trim; #X obj 25 215 pack s f s; #X obj 81 187 r \$0-classname; #X msg 26 163 SUBNORMAL \$1; #X msg 80 45 2; #X floatatom 80 102 15 0 0 0 - - -; #X obj 79 17 loadbang; #X obj 80 73 pow -126; #X obj 27 124 moses; #X text 91 122 smallest normal value for float; #X msg 135 356 set \$1 \$2 \$3; #X connect 0 0 15 0; #X connect 1 0 8 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 6 0 2 0; #X connect 6 1 17 0; #X connect 6 1 7 0; #X connect 7 0 3 0; #X connect 7 0 4 0; #X connect 8 0 6 0; #X connect 9 0 8 2; #X connect 10 0 8 0; #X connect 11 0 14 0; #X connect 13 0 11 0; #X connect 14 0 12 0; #X connect 14 0 15 1; #X connect 15 0 10 0; #X connect 15 1 1 0; #X connect 17 0 5 0; #X restore 103 442 pd single; #N canvas 187 45 257 407 double 0; #X obj 27 20 inlet; #X msg 24 279 UNIT-TEST-DONE; #X obj 25 366 print unit-test; #X obj 52 339 stdout; #X obj 131 366 outlet; #X obj 25 241 t b a; #X msg 115 143 NORMAL \$1; #X obj 53 308 list trim; #X obj 25 217 pack s f s; #X obj 82 187 r \$0-classname; #X msg 26 143 SUBNORMAL \$1; #X msg 72 48 2; #X obj 71 20 loadbang; #X obj 72 76 pow -1022; #X floatatom 73 111 20 0 0 0 - - -; #X obj 27 108 moses; #X msg 132 331 set \$1 \$2 \$3; #X connect 0 0 15 0; #X connect 1 0 3 0; #X connect 1 0 2 0; #X connect 5 0 1 0; #X connect 5 1 16 0; #X connect 5 1 7 0; #X connect 6 0 8 0; #X connect 7 0 2 0; #X connect 7 0 3 0; #X connect 8 0 5 0; #X connect 9 0 8 2; #X connect 10 0 8 0; #X connect 11 0 13 0; #X connect 12 0 11 0; #X connect 13 0 14 0; #X connect 13 0 15 1; #X connect 15 0 10 0; #X connect 15 1 6 0; #X connect 16 0 4 0; #X restore 39 442 pd double; #X msg 39 477 SUBNORMAL 1.0581381223108e-310 filterortho~; #N canvas 683 194 435 442 more 0; #X msg 39 359 2; #X floatatom 39 413 15 0 0 0 - - -; #X obj 39 330 t b f; #X msg 38 46 2; #X floatatom 55 99 15 0 0 0 - - -; #X obj 38 385 pow; #X obj 37 18 loadbang; #X floatatom 38 306 5 0 0 0 - - -; #X floatatom 40 155 15 0 0 0 - - -; #X text 36 254 check how small a non-zero value can be represented ; #X text 37 184 Some CPU architectures support denormal numbers by default. Repeated calculation of subnormal numbers can happen in recursive filters \, feedback delay lines \, reverb simulators etc. This slows down calculation considerably.; #X obj 54 71 pow -126; #X obj 39 126 pow -1022; #X text 143 154 smallest bnormal value for double; #X msg 39 277 -127; #X msg 82 276 -1023; #X text 156 98 smallest normal value for float; #X connect 0 0 5 0; #X connect 2 0 0 0; #X connect 2 1 5 1; #X connect 3 0 11 0; #X connect 3 0 12 0; #X connect 5 0 1 0; #X connect 6 0 3 0; #X connect 7 0 2 0; #X connect 11 0 4 0; #X connect 12 0 8 0; #X connect 14 0 7 0; #X connect 15 0 7 0; #X restore 307 142 pd more; #X text 57 343 smallest non-zero number seen by [snapshot~]; #X text 301 74 In this patch we test if the subnormals-flush routine works as expected. Open [pd more] to see how small subnormals can go for a given precision.; #X obj 336 476 s \$0-classname; #X obj 336 448 symbol; #X obj 337 398 loadbang; #X obj 39 166 creb/filterortho~; #X msg 336 423 filterortho~; #X text 303 6 [creb/filterortho~] checks for subnormals once per signal block. Therefore \, subnormals do happen when the curve approaches zero \, but only for a short period of time (depending on blocksize). ; #X obj 115 29 t b b; #N canvas 550 199 205 218 click~ 0; #X obj 35 25 inlet; #X obj 37 127 sig~; #X msg 36 90 50; #X msg 74 88 0; #X obj 74 59 delay 2; #X obj 37 169 outlet~; #X connect 0 0 2 0; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 4 0 3 0; #X restore 39 111 pd click~; #X obj 39 272 abs; #N canvas 626 222 402 246 write 0; #X obj 27 38 inlet; #X obj 25 198 tabwrite \$0-smallnumbers; #X obj 26 91 t f b; #X obj 54 132 f; #X obj 85 132 + 1; #X obj 132 35 inlet; #X msg 132 89 const 0; #X msg 70 94 0; #X obj 133 133 s \$0-smallnumbers; #X msg 188 89 arrayviewclose; #X connect 0 0 2 0; #X connect 2 0 1 0; #X connect 2 1 3 0; #X connect 3 0 4 0; #X connect 3 0 1 1; #X connect 4 0 3 1; #X connect 5 0 6 0; #X connect 5 0 7 0; #X connect 5 0 9 0; #X connect 6 0 8 0; #X connect 7 0 3 1; #X connect 9 0 8 0; #X restore 79 323 pd write; #X obj 457 211 s \$0-smallnumbers; #X msg 456 179 arrayviewlistnew; #X obj 455 250 table \$0-smallnumbers 10000; #X obj 169 198 snapshot~; #X obj 169 225 change; #X obj 169 172 metro 100; #X obj 168 143 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X floatatom 179 253 20 0 0 0 - - -; #X obj 168 277 print; #X msg 53 137 setBP 100 2; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 2 0 26 0; #X connect 2 0 28 1; #X connect 3 0 27 0; #X connect 4 0 5 0; #X connect 4 1 5 1; #X connect 4 1 28 0; #X connect 5 0 6 0; #X connect 5 0 12 0; #X connect 9 0 25 0; #X connect 12 0 11 0; #X connect 12 0 14 0; #X connect 12 1 10 0; #X connect 12 1 13 0; #X connect 13 0 15 0; #X connect 14 0 15 0; #X connect 20 0 19 0; #X connect 21 0 23 0; #X connect 22 0 1 0; #X connect 22 0 32 0; #X connect 23 0 20 0; #X connect 25 0 2 0; #X connect 25 1 7 0; #X connect 25 1 38 0; #X connect 26 0 22 0; #X connect 27 0 4 0; #X connect 30 0 29 0; #X connect 32 0 33 0; #X connect 33 0 36 0; #X connect 33 0 37 0; #X connect 34 0 32 0; #X connect 35 0 34 0; #X connect 38 0 22 0; pd-creb-0.10.0/unittests/fwarp-unittest.pd000066400000000000000000000004121434364737600205050ustar00rootroot00000000000000#N canvas 10 120 697 488 10; #X obj 346 152 creb/fwarp; #X obj 25 203 testtools/unit-test-frame; #X obj 346 119 / 512; #X msg 25 165 fwarp 0; #X obj 25 133 loadbang; #X connect 0 0 1 1; #X connect 1 2 2 0; #X connect 2 0 0 0; #X connect 3 0 1 0; #X connect 4 0 3 0; pd-creb-0.10.0/unittests/fwarp.wav000066400000000000000000000040541434364737600170300ustar00rootroot00000000000000RIFF$WAVEfmt D data:;;;<@<_<<<<<<<<<<====(=0=7=@=H=P=X=_=h=p=x==================================>>>> > >>>>>>>>>>>">$>&>(>*>,>.>0>2>3>6>7>:><>>>@>B>D>F>H>I>L>N>P>R>T>V>X>Z>\>^>_>a>d>f>h>j>l>n>p>q>t>v>x>z>|>~>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>????????????????? ? ? ? ? ? ? ? ? ? ?????????????????????????????????????? ?!?!?"?"?#?#?$?$?%?%?&?&?'?'?(?(?)?)?*?*?+?+?,?,?-?-?.?.?/?/?0?0?1?1?2?2?3?3?3?4?5?5?6?6?7?7?7?8?9?9?:?:?;?;??>?????@?@?@?A?B?B?C?C?D?D?E?E?F?F?G?G?H?H?I?I?I?J?K?K?L?L?M?M?N?N?O?O?P?P?Q?Q?R?R?R?S?T?T?U?U?V?V?V?W?X?X?Y?Y?Z?Z?[?[?\?\?\?]?^?^?_?_?_?`?a?a?a?b?c?c?d?d?e?e?f?f?g?g?h?h?h?i?j?j?k?k?l?l?m?m?n?n?o?o?p?p?q?q?q?r?s?s?t?t?u?u?v?v?w?w?x?x?y?y?z?z?z?{?|?|?}?}?~?~?~??pd-creb-0.10.0/unittests/junction.wav000066400000000000000000000040541434364737600175420ustar00rootroot00000000000000RIFF$WAVEfmt D data@$x1n=ש=0B'>P=f 6U=IsᕽD8>fe>ш`I>U0Mwj,p=7q>=i;dX=P/<>Jq(H==|hսv=1<46vѾ:0I(N=C5tMJʾa@.=`=Љ؛ A'>*>!]Ivt=/Hh=2>dc>X5>V>> 9<iB>\X>>>M~>>D>;h=\ť>,>T>P=o=tx>&<>FL> 0F= C>><3_V<oG>=_88%~6|>DJ͓j.˾PmpyJ=TLܧO=B>`W+=St1> `>K0J>OTt(&=v>=<2 TB=H>8;py]N=:3E>pc<0WU^߇>l(>=`Hr>n>|'> >Gn<C%>>Xs?>(DI> >>^<?-#?>PN>2N>->~"?]q?'>>=>> ?no>G>_=>p> >$~AIPm=Xj=0RH}/f|ot8'ؾoAl_~Y8QvZվ=|ZU_a$09;ɾHy3vԾKZ|>>=>>b -?.?L2>>i>;?k?T?}@? >0#?Z~g?n~?}P?N6?>`-?d?a?? ?P>Xʸ>i ?6?NO?V+>P=>Tp> e>5a>ƽR2Zp_=T΃=2< ¾KNC$;>hGG>_fG@wPϾ@B\*M]{(Ǿ WB5t,jϾ ,ľ𧽘6=P=*N}@qYv>/>2j>?^<\k>>?>>n3>H>z#??p>+>X>S?ݍ'?p?t>>=:>x? ?ͯ>(=nE>2># >S˽Y;>>K>(I~ِn=BmI>)<8B{Y䪾 = =ѽPݽV=ѓ=3R ،CA>A=VR@c*&t=K><9[]D1H>+Z>dDGW H=z>7>\|x=q>1=13N=L5>y|ڽp=ط="[k™71)=<,NӾؓἨ;=o/tǾ8@Hv==`1 NP D4>4>Ƥ,|jO>&=X>P>#(\(>2r>4>t>>xUj>ూ<8>=>F>h'>+>Z0= >Me>ʧ>pg=iP=W>RY>1> Lm=d>d:~>^jGpd-creb-0.10.0/unittests/junction~-unittest.pd000066400000000000000000000015171434364737600214240ustar00rootroot00000000000000#N canvas 0 22 692 541 10; #X obj 21 262 testtools/unit-test-frame~; #X msg 21 226 junction 12; #X obj 342 103 osc~ 440; #X obj 373 125 osc~ 550; #X obj 404 147 osc~ 660; #X obj 435 170 osc~ 7700; #X msg 486 60 0; #X obj 342 226 *~ 0.25; #X obj 21 192 loadbang; #X obj 342 196 creb/junction~ 4; #X text 24 45 For the reproducable test \, circular junction is not applied; #X msg 264 167 random 3; #X obj 264 134 loadbang; #X text 23 20 junction~: a circular lossless signal junction; #X connect 0 2 6 0; #X connect 1 0 0 0; #X connect 2 0 9 0; #X connect 3 0 9 1; #X connect 4 0 9 2; #X connect 5 0 9 3; #X connect 6 0 2 1; #X connect 6 0 3 1; #X connect 6 0 4 1; #X connect 6 0 5 1; #X connect 7 0 0 1; #X connect 8 0 1 0; #X connect 9 0 7 0; #X connect 9 1 7 0; #X connect 9 2 7 0; #X connect 9 3 7 0; #X connect 11 0 9 0; #X connect 12 0 11 0; pd-creb-0.10.0/unittests/lattice~-unittest.pd000066400000000000000000000024131434364737600212140ustar00rootroot00000000000000#N canvas 0 22 681 692 10; #X obj 339 -75 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 14250 1; #X obj 370 -76 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 15950 1; #X obj 401 -75 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 17350 1; #X obj 431 -75 vsl 15 250 -1 1 0 1 empty empty empty 20 8 0 8 -262144 -1 -1 18350 1; #X msg 370 201 rc 1 \$1; #X msg 401 226 rc 2 \$1; #X msg 431 202 rc 3 \$1; #X floatatom 431 -106 5 -1 1 0 - - -; #X text 434 278 lattice~ a lattice filter; #X text 434 291 creation argument sets order; #X obj 18 315 testtools/unit-test-frame~; #X obj 232 163 phasor~ 440; #X msg 295 137 0; #X obj 232 194 -~ 0.5; #X obj 18 250 loadbang; #X msg 18 280 lattice~ 200; #X obj 339 261 creb/lattice~ 4; #X obj 339 285 *~ 0.5; #X msg 339 225 rc 0 \$1; #X floatatom 439 184 5 0 0 0 - - -; #X connect 0 0 18 0; #X connect 1 0 4 0; #X connect 2 0 5 0; #X connect 3 0 6 0; #X connect 3 0 19 0; #X connect 4 0 16 0; #X connect 5 0 16 0; #X connect 6 0 16 0; #X connect 7 0 0 0; #X connect 7 0 1 0; #X connect 7 0 2 0; #X connect 7 0 3 0; #X connect 10 0 12 0; #X connect 11 0 13 0; #X connect 12 0 11 1; #X connect 13 0 16 0; #X connect 14 0 15 0; #X connect 15 0 10 0; #X connect 16 0 17 0; #X connect 17 0 10 1; #X connect 18 0 16 0; pd-creb-0.10.0/unittests/lattice~.wav000066400000000000000000000040541434364737600175340ustar00rootroot00000000000000RIFF$WAVEfmt D data Dv'jR:*" \,\G# ȴ>9> R>l>:΂>N>i>L=>u>I>{>IJ>>>۴?+?*?>?,? "?L(?`/?~5?H;?wB?9H?qO?U?Bn\?b?ki?Go?jv?|?N? ?E>>t>=<߅/`HڭP[ǾݾB m#&7j{z_X,&R. M 5D8뾴Zؾyξ)ľI㮾ܘo4XmV>j&t$]6 ئz;h<W=l=Z=w2>{>p3>d:M>f>>݌>>tx>L>$>>>>8>xG??2 ?թ?!?ؚ ?'?-? 4?:?A?~G?M?yT?Z?ua?g?sn?t?r{?$?Hr? >Ѿ>u7n>\J=IJ<تA~f ͰOʾzGj, )LJQ V!v'!*s Da=z' ԾNs8 .PR۾oѾǾ畼ر~릾YқԐA*VCs[jD@,kJȽ4M/ּ->|OG>`>`Dz>>.>>+W>U/>* >\>>±>{>A? ?/?.? ?Й%?<,?P2? 9?9??F?)L?R?|Y?2_?yf?l?8xs?y?;??d>Yܻ>Lh>wt= m<3# ilvWóD;㾾w V,_p! p""2"! @!|> 9 .}Ev޾dԾiʾ^δ੾ǞLD.yaUJ.2Z3ԽaʣjeB@B<'==J=D=0>'>dA>Z>pYt>>>>a>9>>>+>I>>?5= ?^?r,?`?$?*?1?B7?| >?:D?mK?Q?X?v^?,d?0~k?|q?}x?~?|?">>ab>=T+(}oNO]0<=Wt=t=g=@>">y;>T>nn>*>>Ȑ>>:l>dD>9 >j>>>>SL?z?9??*?X"?)?ؙ/?6?j>v\>ȸ=;s,d/>xaFv/Ӿs龮` \3"T "Df$e%%%^$ #" P/ # .Nuk0a侄OھXϾNvž˯;q m+Vn>:&f|F v7a2pd-creb-0.10.0/unittests/permute~.wav000066400000000000000000000040541434364737600175700ustar00rootroot00000000000000RIFF$WAVEfmt D dataw<?/\>w>dk>w#3>>>o@>q?1>>&>Q_?m>/\?U=>o@?=(>hV>w#=q>$>UL=3u=kB>w#>*:>h>m->C?O?1 ?7>o@>UL>,˲>=w=fj>{ ?3=?$?=>>q>U>`>f>3u>3>O>Ж?dk> ?(?h>r?3u?Rc?&?e?!+?jnh? Ӟ= =\+>Oz?9>=? B=tr>??d=HY?m-?( C=Fm?M=0?,2?S?UL?a<#k=N?>}>{5>qQ?&p?w#?hV?|? Y5?7?7^??>kB?yJ>wr^>t:?dk?̡;JD?,.=([?=`?=>:T> >È>7>k]??ӫ??w>X ?2>'?9?0d>Tt?>MK?t ?PR7?>?-ON?? Le?2>/9?K0`?>p4?l&>N>/?4?uj>5>>>*?62?n>n3I?+b? P?.>?ߍ> >rU ?>>?jS?,>U?[?sٻ>R"?2q%?qH>-?,B>np> )>l? B3>ir?>z>ab=G>.=wr>y=>{>>6>>?̡|<;>9? ,>It?=A>Q>)-w?y?%{=,.= >\>*=V>6?>( = \>gj?#=>H|?~?>>j=t>>S;>?ґ>f9=~%>d >˿> >y>8>4>:>Q ?w?I> ]?_?M?m?qHP?W?n?)b?1?0dU?/4?K=PR?,B~?Yyuj'?X P;>U)?L{?C?7?v?W??2?Sg>?6?|q?l&y?K9?M=&>Fg=s;?Z? ?2@?NEg??N"?ҞH?D=5,?BE=>$?.i?al?/? t?F?zW<,K?=x0=@=VY=';>Y>5 H???d>O>>d>f?}?3><>O>)6?}>!?c)?8?\/?ճO?ĕ>G$?J?>:,?>z?>tx>U>>Ck>?Z?>83?%M?D;?¢>>^E>A>< ?q>H>->=?E>`@?V|E?>K ??>?>&?>I>+?x.?vB?X 1?AR?SY?G>>,.>hS=t]W?f¹=3y\?%{W>e$>Бx?a={? B>c1=d>N>]>*.>W>QZn?> >1p?PH>.'=_?!v>_=a?"d?<}?a>,>m:K&>;>y>S2<.>T?̡<8>f?>i?x=I>vs?>>qk?( C>CM>v?#k> P=>j= Ӟ>>> >Es>>o=uG?yJ?["8?ê>;:?B>VY?YL? ????}?>=?h?Sp?Ӧ?8O?=??7k??=`?f?-??Va?YB? ??(?~%!?[?6c?]#?z?=, <=A&?D?>\+?Q?( ? ?3?QR<?H<F=_D?:T?V?{?wr^?x0?m?{5?tr?Tou? =4w?=pd-creb-0.10.0/unittests/permut~-unittest.pd000066400000000000000000000007041434364737600211040ustar00rootroot00000000000000#N canvas 0 22 705 451 10; #X obj 342 105 creb/permut~; #X obj 21 164 testtools/unit-test-frame~; #X msg 21 125 permute~ 0; #X obj 21 95 loadbang; #X obj 342 76 phasor~ 440; #X msg 405 45 0; #X text 29 10 permut~ performs a random permutation on a signal block ; #X text 30 27 mainly intended for shuffling spectral data (dynwav) ; #X connect 0 0 1 1; #X connect 1 2 5 0; #X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 4 0 0 0; #X connect 5 0 4 1; pd-creb-0.10.0/unittests/qmult~-unittest.pd000066400000000000000000000024131434364737600207310ustar00rootroot00000000000000#N canvas 25 75 735 544 10; #X obj 72 106 osc~ 30; #X obj 153 107 osc~ 40; #X obj 232 106 osc~ 50; #X obj 313 108 osc~ 60; #X text 477 207 qmult multiplies 2 quaternion signals; #X obj 400 106 osc~ 70; #X obj 481 106 osc~ 80; #X obj 560 105 osc~ 90; #X obj 641 104 osc~ 100; #X text 485 225 "quaternion ring modulation"; #X obj 47 264 testtools/unit-test-frame~; #X msg 402 51 0; #X msg 47 235 qmult~ 100; #X obj 47 208 loadbang; #X obj 327 211 creb/qmult~ 0 0 0 0 0; #X obj 72 135 *~ 0.707107; #X obj 153 134 *~ 0.707107; #X obj 232 134 *~ 0.707107; #X obj 313 133 *~ 0.707107; #X obj 400 134 *~ 0.707107; #X obj 481 133 *~ 0.707107; #X obj 560 133 *~ 0.707107; #X obj 641 132 *~ 0.707107; #X connect 0 0 15 0; #X connect 1 0 16 0; #X connect 2 0 17 0; #X connect 3 0 18 0; #X connect 5 0 19 0; #X connect 6 0 20 0; #X connect 7 0 21 0; #X connect 8 0 22 0; #X connect 10 1 11 0; #X connect 11 0 0 1; #X connect 11 0 1 1; #X connect 11 0 2 1; #X connect 11 0 3 1; #X connect 11 0 5 1; #X connect 11 0 6 1; #X connect 11 0 7 1; #X connect 11 0 8 1; #X connect 12 0 10 0; #X connect 13 0 12 0; #X connect 14 1 10 1; #X connect 15 0 14 0; #X connect 16 0 14 1; #X connect 17 0 14 2; #X connect 18 0 14 3; #X connect 19 0 14 4; #X connect 20 0 14 5; #X connect 21 0 14 6; #X connect 22 0 14 7; pd-creb-0.10.0/unittests/qmult~.wav000066400000000000000000000040541434364737600172510ustar00rootroot00000000000000RIFF$WAVEfmt D dataC?&E? G?I?0zK?NM?6O?jP?8R?`ZT?u V?GW?UY?Z?$\?\^?_?a a?~b?|c?Le?Hf?gg? Bi?Jj?xk?l?/n?1o?Gp?Uq?AXr? Ts?(Et?#.u?" v?v?w?ux?1y?y?z?){?{?J|?|?E}?}?@~?u~?~??P??@???2??*???0?i?P?x?~?u~?~?}?E}?N|?lJ|?Ծ{?({?z?y?0y?6ux?Tw?v? v?-u?Dt?Ss?Wr?Tq?2Gp?:1o?n?2l?k?ɂj?Ai?g?f?_Le?c? ~b? a?u_?^?\?Z?NUY?W? V?YT?R?P?O?_MM?zyK?ٝI?VG?lE?C?!A???=?m;?^9?7?5?-3?_1?%4/?X-?*?(?R&? $?!?#u?n!??mn?^?,?=C?C? h ? ???ވ?H ?5 >>>>Z>U>>_>6> >n>>kq>8>Q>eí>H>fH> >Ș>j>H>b>.ȃ>}>r>h>]>*S>H>^M>>93>)>b(>> >=>==w5=^===!e===== FNV`a^fm2Ru|4CɌB< \3ӠNLD沾궵_x+ϽXdf¾^až4Ǿ3"ʾzk̾0ξоBҾԾ־dؾhھܾXG޾߾Aᾲ"㾑rpw:2RTde!XT: |N*s2F:-&}xf-JLYXI,*v)TH󾸬:Q~𾀿ヨ98pg辎oLPT~w߾ݾqܾھfCپ׾վ4ԾqҾߥоzξ̾:˾h"ɾ,Ǿ/ž2+þr 񼾝Ѻ7x| I:Я5Cܠ:J졾_)V,镾 xZt %xJ&KzwJuFp&Ek Cf*Aa@\CWDRJM-TH_C p>94z/* &=!&u͵PPMC scFݽ?XԽ˽p&ýﶺ]>r>v>/>>x)>>n>.>>>>>6>~X>B>@>Z>s_>!>>.>MT>l>w>v>jj>S>4>q >8ܘ>h>j>)>V>>n~>v>+m>zd>yp\>!S>8iK>B>:>#2>W)>*x!>9> >>V>=S=F==c=D/=_&=F=&o=*R=`5==~"4Q2Txٚt"Ee+TV4ySrqĭ<sYu  Ց  ͬ 9 pd-creb-0.10.0/unittests/qnorm~-unittest.pd000066400000000000000000000010661434364737600207260ustar00rootroot00000000000000#N canvas 0 22 733 553 10; #X obj 347 169 osc~ 30; #X obj 410 169 osc~ 40; #X obj 472 168 osc~ 50; #X obj 527 168 osc~ 60; #X obj 370 238 creb/qnorm~; #X msg 386 114 0; #X obj 70 282 testtools/unit-test-frame~; #X text 324 64 qnorm normalizes a quaternion signal to unit norm; #X msg 70 248 qnorm 100; #X obj 70 221 loadbang; #X connect 0 0 4 0; #X connect 1 0 4 1; #X connect 2 0 4 2; #X connect 3 0 4 3; #X connect 4 1 6 1; #X connect 5 0 0 1; #X connect 5 0 1 1; #X connect 5 0 2 1; #X connect 5 0 3 1; #X connect 6 0 5 0; #X connect 8 0 6 0; #X connect 9 0 8 0; pd-creb-0.10.0/unittests/ramp~-unittest.pd000066400000000000000000000013101434364737600205210ustar00rootroot00000000000000#N canvas 39 54 741 577 10; #X obj 39 248 testtools/unit-test-frame~; #X obj 30 67 cnv 15 150 150 empty empty empty 20 12 0 14 -233017 -66577 0; #X text 38 106 1 - reference name; #X text 38 125 2 - test delay in ms; #X text 37 86 test arguments (list):; #X obj 39 154 loadbang; #X obj 323 67 cnv 15 150 150 empty empty empty 20 12 0 14 -233017 -66577 0; #X msg 360 142 0; #X text 337 85 system under test; #X text 322 29 Use a bang from one of [testtools/unit-test-frame~] outlets to reset phase at test start.; #X obj 360 169 creb/ramp~; #X msg 39 183 ramp~ 0; #X obj 360 223 /~ 512; #X connect 0 2 7 0; #X connect 5 0 11 0; #X connect 7 0 10 0; #X connect 10 0 12 0; #X connect 11 0 0 0; #X connect 12 0 0 1; pd-creb-0.10.0/unittests/ramp~.wav000066400000000000000000000040541434364737600170460ustar00rootroot00000000000000RIFF$WAVEfmt D data;;;< <@<`<<<<<<<<<==== =(=0=8=@=H=P=X=`=h=p=x=================================>>>>> > >>>>>>>>>> >">$>&>(>*>,>.>0>2>4>6>8>:><>>>@>B>D>F>H>J>L>N>P>R>T>V>X>Z>\>^>`>b>d>f>h>j>l>n>p>r>t>v>x>z>|>~>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>?????????????????? ? ? ? ? ? ? ? ? ? ????????????????????????????????????? ? ?!?!?"?"?#?#?$?$?%?%?&?&?'?'?(?(?)?)?*?*?+?+?,?,?-?-?.?.?/?/?0?0?1?1?2?2?3?3?4?4?5?5?6?6?7?7?8?8?9?9?:?:?;?;??>?????@?@?A?A?B?B?C?C?D?D?E?E?F?F?G?G?H?H?I?I?J?J?K?K?L?L?M?M?N?N?O?O?P?P?Q?Q?R?R?S?S?T?T?U?U?V?V?W?W?X?X?Y?Y?Z?Z?[?[?\?\?]?]?^?^?_?_?`?`?a?a?b?b?c?c?d?d?e?e?f?f?g?g?h?h?i?i?j?j?k?k?l?l?m?m?n?n?o?o?p?p?q?q?r?r?s?s?t?t?u?u?v?v?w?w?x?x?y?y?z?z?{?{?|?|?}?}?~?~???pd-creb-0.10.0/unittests/ratio-unittest.pd000066400000000000000000000006661434364737600205170ustar00rootroot00000000000000#N canvas 0 22 746 542 10; #X obj 352 71 creb/ratio; #X obj 31 139 testtools/unit-test-frame; #X msg 31 112 ratio 0; #X obj 31 87 loadbang; #X text 104 41 ratio is an octave shifter.; #X text 103 55 output is between 1 and 2; #X text 104 71 it computes 2^(log2(x)-int(log2(x))); #X obj 351 44 + 1; #X obj 352 100 - 1; #X connect 0 0 8 0; #X connect 1 2 7 0; #X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 7 0 0 0; #X connect 8 0 1 1; pd-creb-0.10.0/unittests/ratio.wav000066400000000000000000000040541434364737600170270ustar00rootroot00000000000000RIFF$WAVEfmt D data?>?@?>>>? ?@?`?=>@>>>>>?? ?0?@?P?`?p?===> >@>`>>>>>>>>>???? ?(?0?8?@?H?P?X?`?h?p?x?<=@=====>> >0>@>P>`>p>>>>>>>>>>>>>>>>>??? ????? ?$?(?,?0?4?8?>>> >(>0>8>@>H>P>X>`>h>p>x>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>????? ? ?????????? ?"?$?&?(?*?,?.?0?2?4?6?8?:??@?B?D?F?H?J?L?N?P?R?T?V?X?Z?\?^?`?b?d?f?h?j?l?n?p?r?t?v?x?z?|?~?;<@<<<<<== =0=@=P=`=p=================>>> >>>>> >$>(>,>0>4>8><>@>D>H>L>P>T>X>\>`>d>h>l>p>t>x>|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>????????? ? ? ? ? ??????????????????? ?!?"?#?$?%?&?'?(?)?*?+?,?-?.?/?0?1?2?3?4?5?6?7?8?9?:?;????@?A?B?C?D?E?F?G?H?I?J?K?L?M?N?O?P?Q?R?S?T?U?V?W?X?Y?Z?[?\?]?^?_?`?a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s?t?u?v?w?x?y?z?{?|?}?~??pd-creb-0.10.0/unittests/resofilt~-unittest.pd000066400000000000000000000013141434364737600214150ustar00rootroot00000000000000#N canvas 83 173 720 497 10; #X obj 55 226 testtools/unit-test-frame~; #X obj 376 35 phasor~ 440; #X obj 422 115 sig~ 1000; #X obj 469 145 sig~ 0.999; #X obj 376 62 -~ 0.5; #X obj 376 88 *~ 2; #X msg 439 12 0; #X obj 55 156 loadbang; #X text 12 30 resofilt~: high-quality implementations of the moog 4-pole and tb303 3-pole reso ladder filter. state-limited which means it distorts on high reso input \, and can go into self oscillation when reso > 1; #X obj 376 177 creb/resofilt~ 4; #X msg 55 189 resofilt~ 100; #X connect 0 2 6 0; #X connect 1 0 4 0; #X connect 2 0 9 1; #X connect 3 0 9 2; #X connect 4 0 5 0; #X connect 5 0 9 0; #X connect 6 0 1 1; #X connect 7 0 10 0; #X connect 9 0 0 1; #X connect 10 0 0 0; pd-creb-0.10.0/unittests/resofilt~.wav000066400000000000000000000040541434364737600177360ustar00rootroot00000000000000RIFF$WAVEfmt D data(ۅ.kS?]+ ~|Cy xsfk@`rQiq>L&y 0̾(l@w^=>h> ??O/-?2:?#E?mcN?i>V?\?Ȳb?֤g?k?o?lr?сu?w?y?{?}?eI~?M??g??;ހ?#??(?,?(?? ??S݀???z?o?2X?(F4?t?Hs> (>m@˾{8*$3H@J T[Vbgl2p1,tPw[yb{8>}~K4 ݀&,#+퀿{ԀOX{iO#ܫ\~̤{w,okeCGX{Fx 0fxXo^IG='F>|>I>??X(?`6?B?K?OT?[?a?Ff?,j?Dn?q?|t?8w?Uy?"{?ª|?}??+?P?@?Ѐ???&?,?*?!?^???ʀ??{?"o?yX?4? h?>)>i70LXT˾t $f3(2@2JS%[Gb!g1lȱpH"t w_}yȈ{9}ʛ~gK܀|%"U|逿 πW Mp^Go Z=~|!wmEqmg[2.J4c*Vס,<(>X>cA>$^?M?%?U3???I?nR?oY?_?=e?i?m?5:q?a.t?v?x?~z?\|?+}?h~??>?F?bƀ?>??t#?,?+?$????Ѐ?Ŷ?-{?Lo?(X?r4?~?D> )>/| H˾-gP$3(@JS[=bDglKpt-wxy{7}ߙ~ж(K럀݀$!mN倿mɀ&6ydOR<N~vX|ixUPrOied]nM9HҨE:Ҍ >ȉ>$>{Z>?h"?*1?=?\G?8P? HX?^?&3d?Zh?m?fp?s?9v?*{x?iz?m |?p}? ~?D?,?|?h?H?d ?q ?*?|,?2&?S???Հ??E{?jp?طX?<4?L?:>*><)=˾H[$3@JS[t4blglptZvsy{&4}̗~J֟݀t$0ဿÀacoXCE{0ئ~|x%s^jr_KQPO<$q\ž]M@=x>>>ξ ? ?QZ.?c-;?|E?O?*V?u]?<#c?h?@5*>" 3˾"Oē$ry3@JSL[*bbg:lp tMvny|{0}~sJ݀n#'݀g란dL7#0~| Bypd-creb-0.10.0/unittests/sbosc~-unittest.pd000066400000000000000000000005211434364737600206760ustar00rootroot00000000000000#N canvas 83 84 706 444 10; #X obj 32 160 testtools/unit-test-frame~; #X obj 353 120 creb/sbosc~; #X obj 353 37 sig~ 440; #X obj 384 63 sig~ 550; #X obj 32 58 loadbang; #X msg 32 126 sbosc~ 0; #X obj 32 96 delay 100; #X connect 1 0 0 1; #X connect 2 0 1 0; #X connect 3 0 1 1; #X connect 4 0 6 0; #X connect 5 0 0 0; #X connect 6 0 5 0; pd-creb-0.10.0/unittests/sbosc~.wav000066400000000000000000000040541434364737600172200ustar00rootroot00000000000000RIFF$WAVEfmt D data 2_*p1\':+ }[gbB"vQfDKݾҡξBս᪾S̕fB}JPϞ==%&>.}k>Ņ>_V>;>n>l?vQ ?p/?=?ZJ?IV?Na?yj?r?#x?w}|????}|?#x?r?yj?GNa?V?J?5=?Fq/?Q ?kl?(>>W>>~k>&>=m=LMJYA}˕h᪾Խ{ξJݾfvBbh^ ?+'\0p&Z-yt Fo-nTྫྷ&Ҿ`ƚ Vg!ѽz1H< =(>.[>Ț>p>>@,>ҷ ??n,?`:?PG?T?[_?h?p?Xv?{?~??by?=}?Gy?s?GYl?/c?i;Y?ߗM?P@?2?#???>9>Kr>C{>-6>p=?=.C4V>e(rdF{˾|%ھ.-64 /DE06(h.WVLT9 Wz}PUs^<* ({k Chվ>žAóФ>j.HbJ-hzi};=J>~L>>8>;>{>? .?>(?AO7?wD?hoQ?(\?}f? n?u?[z?#~?*??}??Tz?}u?[$n?]e?m[?YP? C?6?vL'?M?{?Df>>p]>A>E>p>8O{=_)22f{BǾ-־3g`ホS we=|nE;yƁqtddPWNO DABhCz@O]Y,P_f;xBؾIɾ? Hg;Ym:H'W=˩=j<>ɀ>o>T_>J>e8??8%?4?A?N?H9Z?:bd?Bm?R5t?0y?}?7??x~?zJ{?fv?o?+g?^?5 S?F?;9?B*?V?: ?>->G> q>ZzU>>=^J<;H۽e&Y[8軜$hþΆӾᾱmW\*[&kZhǡ9fFQL.!<4!,#] N BڠMMZe ܾ1;2 Ɠx2%Fżm4=!=,>q>Ű>;~>>n?%?*!?0?Y>?6K?W?3b?;k?r?Κx?|?E? ?~?X*|?w? |q?Si?Mf`?wU?=I?zdG>.>[>72e>hh >ع=LD<\ {dO_р̗r5 оM޾%bB*ct_A=-jMT!pd-creb-0.10.0/unittests/scrollgrid1D~-unittest.pd000066400000000000000000000015751434364737600221300ustar00rootroot00000000000000#N canvas 194 118 757 495 10; #X text 390 62 frequency; #X text 484 60 T1; #X text 534 60 T2; #X text 586 61 N; #X msg 398 81 350; #X msg 520 81 1; #X msg 576 80 3; #X msg 475 80 12; #X text 55 21 stabilized scroll grid chaotic oscillator with scroll centers located on a line.; #X obj 77 220 testtools/unit-test-frame~; #X obj 398 159 -~ 1; #X obj 398 26 loadbang; #X obj 77 152 loadbang; #X obj 398 131 creb/scrollgrid1D~; #X obj 398 189 *~ 0.5; #X obj 205 65 creb/scrollgrid1D~; #X obj 206 90 creb/scrollgrid1D~; #X obj 207 118 creb/scrollgrid1D~; #X obj 207 144 creb/scrollgrid1D~; #X msg 77 183 scrollgrid1D~ 0; #X connect 4 0 13 0; #X connect 5 0 13 2; #X connect 6 0 13 3; #X connect 7 0 13 1; #X connect 10 0 14 0; #X connect 11 0 4 0; #X connect 11 0 7 0; #X connect 11 0 5 0; #X connect 11 0 6 0; #X connect 12 0 19 0; #X connect 13 0 10 0; #X connect 14 0 9 1; #X connect 19 0 9 0; pd-creb-0.10.0/unittests/scrollgrid1D~.wav000066400000000000000000000040541434364737600204400ustar00rootroot00000000000000RIFF$WAVEfmt D dataҩ ( $L rO(#~& 8*[-1K558>$>Ȑ!>(>.>\3>$8>;>>>?>I@>$@>0>><>:>Z6>1>^,>&&>$>]>0>>Y=*=X==`Q=P~=^M==@<<ͻH8Sɽ#꽶+5.%%4D+Щ,ȽHۥɃDKʆY]< <`*=a==ȴ===@f=`=>H>>>$%>*>/>3>\7>9>P;>0<>==><>;>č9>6>S3> />\/*>\$>>>D>ܥ>g>H!=M=`=j= x=`=y= H=p:=<5<7 }7S/0gs{ɽt̅*h7EpQDE^Uju啀ӲLϐ蘾ḾoȾо4׾޾%4nyD  9-q(_F K "%#Y$b$@%%%%о% u%%e$f#r"!j ~ Y!;7P ( e>~^~输 u ܾ־о`ʾ?#ľrE'{Ȳ1"g^;;iˎbs3@L}p"YdXK)B B[e>>S>G>?9?@?%?y.?4?|7?8?w)??/>l>>\8>%=p;p !i⟾'žy۾Qvr O_ L (R+BjimMʾNoɽh:z=4:=z>>4">F!>)>>~ >U=NJ=%ji23*sme:;+{ ) 3 > # @L#Pkj>7{>>?(?8d9?!I?{P?X?ca?g?aj?=j?gEf?Q]?cP?U8??>>cF>K9>>]<IJ;c~[=H;=A>eU>>ݻ>>H?6?dK?E#?-?P3?(7?z9?.?y?>SF>>zI> =V<1x]Xƞ ׾ )Y ܦaqؾxN=9=- >I>1R!>Jt">$>z>X>c>=ǽ; XHy^l㎾۪Hƾcä _ / F [IоR#`8>>M>?ܩ%?U5?0F?;@O?U?_?f?9j?k?g?_?AT?m??*_??J>$b>3>.>3=S!*=d= > F>S`>q>6>~>:( ?qD?}!?*?e2?6?9?2?1?N>>F>AY>ޤ >>=*(WHHj4ƶpҾ,eObF N^ k2K4զC۞$!v(=aW=>>yT >o">>W>+>u >O=X>a?~G"?b1?B?M?S?]?`e?Ji?Z5k?_h?a?BW?)E?&? ?gO>E>#/>Y<>=O< M==S7>F|>쨨>m>>$ ???3(?1?5?-9?5?O"?m?ʱ>c>i>)a >=跼b_ֽ 7z;uV $ Q ^cƨe<f 5=9̀<2=<=9x>o>">U >O>>G>`,=M5=-*lyU@AJmY־Ly= ~ u } ~ ٍso3=>*>?Ɵ?-?>?S?L?QR?T[?c?h?k?i?Fc?Y?J?P1.?Z?/ >q>2>=?>n=bH3i˜ek>0>>N>???x&?/? 5?H8?8?'? ?[I>ڣ>kz>1>d=NA%-?'pCCǾݾ , Nyþ^P`- <#==O>Lk>T">f!>>[>>Us={=gXDϽ0sо@꾬fO,N J"  _ J˩#p|>@>n?LJ?C*?;?$J?P?wY?pb?ph?j?j?e?d^\?7O?5?L?Ro>f>P>>C<>Y_ >V<rk<n=6=>[>G͔>|~>l$>?pd-creb-0.10.0/unittests/statwav~unittest.pd000066400000000000000000000021471434364737600212070ustar00rootroot00000000000000#N canvas 169 49 764 603 10; #X obj 63 320 testtools/unit-test-frame~; #X obj 384 222 phasor~ 440; #X msg 447 191 0; #X obj 63 243 loadbang; #X obj 95 40 hsl 250 170 0 127 0 0 empty empty empty -2 -8 0 10 -228856 -228856 -1 0 1; #N canvas 0 22 450 300 (subpatch) 0; #X array \$0-statwavtest 64 float 3; #A 0 0 0 0.0714278 0.142856 0.242855 0.371425 0.485709 0.571423 0.628565 0.685707 0.714278 0.714278 0.585708 0.38571 0.25714 0.142856 0 -0.12857 -0.242855 -0.371425 -0.442852 -0.51428 -0.542851 -0.557137 -0.585708 -0.614279 -0.614279 -0.542851 -0.414281 -0.171427 0 0.0857134 0.142856 0.157141 0.157141 0.142856 0.142856 0.0714278 -0.0571423 -0.171427 -0.271426 -0.357139 -0.442852 -0.51428 -0.542851 -0.542851 -0.542851 -0.485709 -0.342854 0.171427 0.414281 0.585708 0.685707 0.785706 0.828563 0.885705 0.914276 0.914276 0.871419 0.785706 0.599994 0.428567 0.185712 0.17857; #X coords 0 1 64 -1 200 140 1; #X restore 117 62 graph; #X obj 384 274 creb/statwav~ \$0-statwavtest; #X msg 63 278 statwav~ 0; #X connect 0 2 2 0; #X connect 1 0 6 0; #X connect 2 0 1 1; #X connect 3 0 7 0; #X connect 6 0 0 1; #X connect 7 0 0 0; pd-creb-0.10.0/unittests/tabreadmix~.wav000066400000000000000000000040541434364737600202270ustar00rootroot00000000000000RIFF$WAVEfmt D dataH=Bn11(މI対>Ҿ}C.t᾿վ++n=}dS>>v>я\>/> =d=-Ӽ|Џ>.>Q ?$?C=? L?@^?H(h? i?Q_?j[H?G?>G>BxO> l==߮:>c>h>??"%??k?e>{ >`q>6( >>H>lA>V_>>> ?g?>*?/?f?2@>ۧ>>$i;9콷X 뿾筷J@\ľ¾O:=Pl+>aQ–_JɾY^T[ž+87W=>>/>H>}>ʄ=嗍[>I׮ɾRھվ|Lƾ7UY.T>fN>T> $>*=M< E!#P`YqE>3>m?+?R5G?;S?b?(i?xf?pW? %>??Y>l> t>><>’>Y >T>2?0???>T¼>Pa>Մ>>m'>i>>A.>+?W+?R)?a3?6??>>H>vp< ʽG9ag:醾hb"eaӄ򆾞5oTr:V-s~Lƾ۾AU <*[SѾ3j=H>A>>#>=z~<,ս)Zu0yZiH–OC̽|=-> *=ȝ>?~/?-bH?6P?Z?u[?T?A?Y(? ?>> >Ux> >[>D>?h[%?;*??X>>`>Ǵ>ʪ=U=U%>Pr>>`>H?K ?~/?6?5??>{|>H>X>u=F֦=N*i=o^fBz|鴂ǜh{Eb*f˚([<-Xͥ*CGnNؾ{f0>>~y?/-?~B?dG?M?%J???*?8 ?>&>4>Lf>nK>l>e> ?$?z8?@?_:?J9?N~>>nu>H(J=< =H>XKv>>ڮ>IM?k ?,?1?<,?qN ?8>V,v>%>=b =0 <9<"=== ī\UN z.DPkQľcd0H Ӿ/T==B==$@%=pwM>m?&!?|0?+/?+A.?Q%?)?>[>>p>ܓ>>=>a>T? (? ^>K>1N< r;+3=H>Vz> >n> ??Q$?TJ'??>>ah>1>_>==ާ>p4>pa>bN>n>> =pʑ;7ТS$*r-񲾬pؾ? /0 ̾E, =i= =:,0&a6k@h㌽|K:<==pAr|ܾpd-creb-0.10.0/unittests/tabreadmix~unittest.pd000066400000000000000000000024561434364737600216410ustar00rootroot00000000000000#N canvas 0 22 764 603 10; #X obj 63 320 testtools/unit-test-frame~; #X obj 384 222 phasor~ 440; #X msg 447 191 0; #X obj 585 219 loadbang; #X obj 63 243 loadbang; #X obj 384 274 creb/tabreadmix~ \$0-tabreadmixtest; #X obj 384 249 *~ 64; #X msg 428 249 bang; #X msg 585 245 32; #X msg 63 277 tabreadmix~ 100; #X obj 95 40 hsl 250 170 0 127 0 0 empty empty empty -2 -8 0 10 -228856 -228856 -1 0 1; #N canvas 0 22 450 300 (subpatch) 0; #X array \$0-tabreadmixtest 64 float 3; #A 0 0 0 0.0714278 0.142856 0.242855 0.371425 0.485709 0.571423 0.628565 0.685707 0.714278 0.714278 0.585708 0.38571 0.25714 0.142856 0 -0.12857 -0.242855 -0.371425 -0.442852 -0.51428 -0.542851 -0.557137 -0.585708 -0.614279 -0.614279 -0.542851 -0.414281 -0.171427 0 0.0857134 0.142856 0.157141 0.157141 0.142856 0.142856 0.0714278 -0.0571423 -0.171427 -0.271426 -0.357139 -0.442852 -0.51428 -0.542851 -0.542851 -0.542851 -0.485709 -0.342854 0.171427 0.414281 0.585708 0.685707 0.785706 0.828563 0.885705 0.914276 0.914276 0.871419 0.785706 0.599994 0.428567 0.185712 0.17857; #X coords 0 1 64 -1 200 140 1; #X restore 120 60 graph; #X connect 0 2 2 0; #X connect 1 0 6 0; #X connect 2 0 1 1; #X connect 2 0 7 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 0 1; #X connect 6 0 5 0; #X connect 7 0 5 0; #X connect 8 0 5 1; #X connect 9 0 0 0; pd-creb-0.10.0/unittests/xfm~-unittest.pd000066400000000000000000000022141434364737600203600ustar00rootroot00000000000000#N canvas 0 22 749 571 10; #X obj 369 228 creb/xfm~ 1; #X obj 48 281 testtools/unit-test-frame~; #X floatatom 369 196 5 0 0 0 - - -; #X floatatom 406 196 5 0 0 0 - - -; #X floatatom 456 196 5 0 0 0 - - -; #X floatatom 506 196 5 0 0 0 - - -; #X text 366 173 freq1; #X text 403 173 freq2; #X text 461 174 fb1; #X text 505 175 fb2; #X obj 397 40 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 15000 1; #X obj 397 62 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 12900 1; #X obj 398 87 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 18138 1; #X obj 398 112 hsl 300 15 1 20000 1 1 empty empty empty -2 -6 0 8 -262144 -1 -1 19400 1; #X msg 321 197 reset; #X obj 48 220 loadbang; #X text 52 43 xfm~ cross frequency modulation; #X text 51 62 freq_osc1 = freq1 + wave_out2*fb1; #X text 51 77 freq_osc2 = freq2 + wave_out1*fb2; #X msg 48 247 xfm~ 0; #X connect 0 0 1 1; #X connect 1 0 14 0; #X connect 2 0 0 0; #X connect 3 0 0 1; #X connect 4 0 0 2; #X connect 5 0 0 3; #X connect 10 0 2 0; #X connect 11 0 3 0; #X connect 12 0 4 0; #X connect 13 0 5 0; #X connect 14 0 0 0; #X connect 15 0 19 0; #X connect 19 0 1 0; pd-creb-0.10.0/unittests/xfm~.wav000066400000000000000000000040541434364737600167010ustar00rootroot00000000000000RIFF$WAVEfmt D dataz7?|?y?s?>pm? e?]?NT?\K?A?*8?.?=%?B?? ?O?lZ>ѧ>,> >>>(u>>>[> >>>Aֱ>>n2>\>}>Q>Ȋ>h> >q>>q>1N?j ?&?S??-$?v+?\2?9?y??E?$K?*Q?VOV?;[?o9_?b?.f?h?*k?Nl?Dn?4%o?o?o?Vo?#n?/l?j?g?9d?_?Z?.*T?HL?D?4:?/?"?B??6>g>d>G>>>P=S=(SEP5+Ҿҍ nK>*7DH?O*Yae,i-SohRt@x8{Y}~~p~h~8~~(~8~ g~ ~<[k~}5|szxNwvsrpXmi+fnb!^Z=dWSPMrjKCIG@F!rEL"EgTEH F+DGI>as0Y!|nྜྷ0k!ndӑPC w=q>R><2>>$>>v7 ?qK?,?p:?gG?S?;^?Ig?n?$t?~y?|?~??1?A?~?Љ|?z?'y?ʕw?Q?v?]8u?It?Gt?7et?kt?u?v?x?||y?Zz?2U|?}?~?nm??4?? '?@~?}?*{?Qz?ox?,ww?:v?:u?t?+t?%3t?t?mu?v?x?y?^{?}?x~????k~?|?Ux?@s?xl?d?[?#P?C?b6?'?U}?d?s~>c>ݻ>>V>I>>s=o 6tU~מּ5;&B#M1(>cJ/U@_h~Ppxv {)<~Ei~{wrQvlߧe?^6fVlAN_E=N5k'-4%#V"!C⾹5ؾϾ3wƾb>X#3h횾Y)ɌFw%bm8؂͂٣煾-k­F8,3d*b+`sþʾzҾ ھZI"[o T>p!')-39>@FEK]]Q6V[}`Idh2l7oZr;tvx%z${{ۘ|}H}Nb}U}}i|W|"?{ zoxWvsSp3l.6gUCaGZE3RHk>3^&L 2 ҾP"44NMU\(<= ,>? w>>$>D>??j?G+?:6?6A??fJ?kR?RY?,_? d? h?>k?m?o?p?q?r? r?Dq?p?_o?m?qhk?h?e?a?]?*Y?T?~N?H?׫B?f ?}?0??>{,>>-N>2>u>=I>չ>k>b>>&>c>??6 ??`?c ?'?/?8?