From 256119f46dce880391bd994b82be81d003056f7d Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Tue, 19 Nov 2002 11:47:34 +0000 Subject: added svn path=/trunk/externals/rhythm_estimator/; revision=218 --- AUTHORS | 2 + COPYING | 340 ++++++++ ChangeLog | 0 INSTALL | 182 ++++ Makefile | 413 +++++++++ Makefile.am | 73 ++ Makefile.in | 413 +++++++++ NEWS | 5 + README | 91 ++ TODO | 20 + aclocal.m4 | 546 ++++++++++++ bang-eater.pd | 34 + config.guess | 973 +++++++++++++++++++++ config.sub | 956 +++++++++++++++++++++ configure | 1900 ++++++++++++++++++++++++++++++++++++++++++ configure.in | 48 ++ drumboy~.pd | 37 + drunk-metro.pd | 70 ++ install-sh | 251 ++++++ libtoolkludge | 11 + missing | 190 +++++ mkinstalldirs | 40 + pd_rhythm_estimator.c | 49 ++ pd_rhythm_estimator.h | 48 ++ pd_rhythm_ioi_histogram.c | 351 ++++++++ pd_rhythm_ioi_histogram.h | 86 ++ pd_rhythm_quantum.c | 291 +++++++ pd_rhythm_quantum.h | 80 ++ pd_rhythm_slave_metro.c | 258 ++++++ pd_rhythm_slave_metro.h | 75 ++ ping~.pd | 19 + rhythm_estimator.h | 47 ++ rhythm_estimator.pd | 43 + rhythm_estimator_example.pd | 131 +++ rhythm_estimator_example2.pd | 19 + rhythm_ioi_histogram.c | 428 ++++++++++ rhythm_ioi_histogram.h | 108 +++ rhythm_quantum.c | 269 ++++++ rhythm_quantum.h | 76 ++ rhythm_slave_metro.c | 287 +++++++ rhythm_slave_metro.h | 79 ++ version.h | 28 + version.h.in | 28 + 43 files changed, 9395 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100644 bang-eater.pd create mode 100755 config.guess create mode 100644 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100644 drumboy~.pd create mode 100644 drunk-metro.pd create mode 100755 install-sh create mode 100755 libtoolkludge create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 pd_rhythm_estimator.c create mode 100644 pd_rhythm_estimator.h create mode 100644 pd_rhythm_ioi_histogram.c create mode 100644 pd_rhythm_ioi_histogram.h create mode 100644 pd_rhythm_quantum.c create mode 100644 pd_rhythm_quantum.h create mode 100644 pd_rhythm_slave_metro.c create mode 100644 pd_rhythm_slave_metro.h create mode 100644 ping~.pd create mode 100644 rhythm_estimator.h create mode 100644 rhythm_estimator.pd create mode 100644 rhythm_estimator_example.pd create mode 100644 rhythm_estimator_example2.pd create mode 100644 rhythm_ioi_histogram.c create mode 100644 rhythm_ioi_histogram.h create mode 100644 rhythm_quantum.c create mode 100644 rhythm_quantum.h create mode 100644 rhythm_slave_metro.c create mode 100644 rhythm_slave_metro.h create mode 100644 version.h create mode 100644 version.h.in diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..80166ae --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Jarno Seppänen +Piotr Majdak diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..b42a17a --- /dev/null +++ b/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..949c7c5 --- /dev/null +++ b/Makefile @@ -0,0 +1,413 @@ +# Generated automatically from Makefile.in by configure. +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = . +prefix = /usr +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/rhythm_estimator +pkglibdir = $(libdir)/rhythm_estimator +pkgincludedir = $(includedir)/rhythm_estimator + +top_builddir = . + +ACLOCAL = aclocal +AUTOCONF = autoconf +AUTOMAKE = automake +AUTOHEADER = autoheader + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} +transform = s,x,x, + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +AS = @AS@ +CC = gcc +DLLTOOL = @DLLTOOL@ +LD = /usr/bin/ld +LIBTOOL = $(SHELL) $(top_builddir)/libtoolkludge +LN_S = @LN_S@ +MAINT = # +MAKEINFO = makeinfo +NM = @NM@ +OBJDUMP = @OBJDUMP@ +PACKAGE = rhythm_estimator +PDDIR = /usr/lib/pd +RANLIB = @RANLIB@ +VERSION = 0.1 + +SUFFIXES = .pd_linux + +pddir = /usr/lib/pd + +pdinstalldir = $(pddir)/extra/rhythm_estimator + +# Automake won't accept something ending in ".pd_linux" as a library +pdinstall_PROGRAMS = rhythm_ioi_histogram.pd_linux rhythm_quantum.pd_linux rhythm_slave_metro.pd_linux + + +rhythm_ioi_histogram_pd_linux_SOURCES = pd_rhythm_estimator.c pd_rhythm_estimator.h pd_rhythm_ioi_histogram.c pd_rhythm_ioi_histogram.h rhythm_estimator.h rhythm_ioi_histogram.c rhythm_ioi_histogram.h + + +rhythm_quantum_pd_linux_SOURCES = pd_rhythm_estimator.c pd_rhythm_estimator.h pd_rhythm_quantum.c pd_rhythm_quantum.h rhythm_estimator.h rhythm_quantum.c rhythm_quantum.h + + +rhythm_slave_metro_pd_linux_SOURCES = pd_rhythm_estimator.c pd_rhythm_estimator.h pd_rhythm_slave_metro.c pd_rhythm_slave_metro.h rhythm_estimator.h rhythm_slave_metro.c rhythm_slave_metro.h + + +pdincludedir = $(pddir)/src +INCLUDES = -I$(top_srcdir) -I$(pdincludedir) +CFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch + +LDFLAGS = -export_dynamic -shared + +pdinstall_DATA = AUTHORS COPYING NEWS README TODO bang-eater.pd cama99.ps click1.wav click2.wav drumboy~.pd drunk-metro.pd ping~.pd rhythm_estimator.pd rhythm_estimator_example.pd rhythm_estimator_example2.pd + + +noinst_SCRIPTS = libtoolkludge + +EXTRA_DIST = $(pdinstall_DATA) $(noinst_SCRIPTS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = version.h +PROGRAMS = $(pdinstall_PROGRAMS) + + +DEFS = -DPACKAGE=\"rhythm_estimator\" -DVERSION=\"0.1\" -DHAVE_LIBC=1 -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -I. -I$(srcdir) +CPPFLAGS = +LIBS = -lm -lc +rhythm_ioi_histogram_pd_linux_OBJECTS = pd_rhythm_estimator.o \ +pd_rhythm_ioi_histogram.o rhythm_ioi_histogram.o +rhythm_ioi_histogram_pd_linux_LDADD = $(LDADD) +rhythm_ioi_histogram_pd_linux_DEPENDENCIES = +rhythm_ioi_histogram_pd_linux_LDFLAGS = +rhythm_quantum_pd_linux_OBJECTS = pd_rhythm_estimator.o \ +pd_rhythm_quantum.o rhythm_quantum.o +rhythm_quantum_pd_linux_LDADD = $(LDADD) +rhythm_quantum_pd_linux_DEPENDENCIES = +rhythm_quantum_pd_linux_LDFLAGS = +rhythm_slave_metro_pd_linux_OBJECTS = pd_rhythm_estimator.o \ +pd_rhythm_slave_metro.o rhythm_slave_metro.o +rhythm_slave_metro_pd_linux_LDADD = $(LDADD) +rhythm_slave_metro_pd_linux_DEPENDENCIES = +rhythm_slave_metro_pd_linux_LDFLAGS = +SCRIPTS = $(noinst_SCRIPTS) + +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(pdinstall_DATA) + +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +Makefile.in NEWS TODO aclocal.m4 config.guess config.sub configure \ +configure.in install-sh missing mkinstalldirs version.h.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(rhythm_ioi_histogram_pd_linux_SOURCES) $(rhythm_quantum_pd_linux_SOURCES) $(rhythm_slave_metro_pd_linux_SOURCES) +OBJECTS = $(rhythm_ioi_histogram_pd_linux_OBJECTS) $(rhythm_quantum_pd_linux_OBJECTS) $(rhythm_slave_metro_pd_linux_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .pd_linux .s +$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): # configure.in + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: #$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) +version.h: $(top_builddir)/config.status version.h.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +mostlyclean-pdinstallPROGRAMS: + +clean-pdinstallPROGRAMS: + -test -z "$(pdinstall_PROGRAMS)" || rm -f $(pdinstall_PROGRAMS) + +distclean-pdinstallPROGRAMS: + +maintainer-clean-pdinstallPROGRAMS: + +install-pdinstallPROGRAMS: $(pdinstall_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pdinstalldir) + @list='$(pdinstall_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pdinstalldir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pdinstalldir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-pdinstallPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(pdinstall_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pdinstalldir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +rhythm_ioi_histogram.pd_linux: $(rhythm_ioi_histogram_pd_linux_OBJECTS) $(rhythm_ioi_histogram_pd_linux_DEPENDENCIES) + @rm -f rhythm_ioi_histogram.pd_linux + $(LINK) $(rhythm_ioi_histogram_pd_linux_LDFLAGS) $(rhythm_ioi_histogram_pd_linux_OBJECTS) $(rhythm_ioi_histogram_pd_linux_LDADD) $(LIBS) + +rhythm_quantum.pd_linux: $(rhythm_quantum_pd_linux_OBJECTS) $(rhythm_quantum_pd_linux_DEPENDENCIES) + @rm -f rhythm_quantum.pd_linux + $(LINK) $(rhythm_quantum_pd_linux_LDFLAGS) $(rhythm_quantum_pd_linux_OBJECTS) $(rhythm_quantum_pd_linux_LDADD) $(LIBS) + +rhythm_slave_metro.pd_linux: $(rhythm_slave_metro_pd_linux_OBJECTS) $(rhythm_slave_metro_pd_linux_DEPENDENCIES) + @rm -f rhythm_slave_metro.pd_linux + $(LINK) $(rhythm_slave_metro_pd_linux_LDFLAGS) $(rhythm_slave_metro_pd_linux_OBJECTS) $(rhythm_slave_metro_pd_linux_LDADD) $(LIBS) + +install-pdinstallDATA: $(pdinstall_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pdinstalldir) + @list='$(pdinstall_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pdinstalldir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pdinstalldir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pdinstalldir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(pdinstalldir)/$$p; \ + fi; fi; \ + done + +uninstall-pdinstallDATA: + @$(NORMAL_UNINSTALL) + list='$(pdinstall_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pdinstalldir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +pd_rhythm_estimator.o: pd_rhythm_estimator.c +pd_rhythm_ioi_histogram.o: pd_rhythm_ioi_histogram.c \ + pd_rhythm_estimator.h pd_rhythm_ioi_histogram.h \ + rhythm_ioi_histogram.h rhythm_estimator.h +pd_rhythm_quantum.o: pd_rhythm_quantum.c pd_rhythm_estimator.h \ + pd_rhythm_quantum.h rhythm_quantum.h rhythm_estimator.h +pd_rhythm_slave_metro.o: pd_rhythm_slave_metro.c pd_rhythm_estimator.h \ + rhythm_estimator.h pd_rhythm_slave_metro.h rhythm_slave_metro.h +rhythm_ioi_histogram.o: rhythm_ioi_histogram.c rhythm_ioi_histogram.h \ + rhythm_estimator.h +rhythm_quantum.o: rhythm_quantum.c rhythm_quantum.h rhythm_estimator.h +rhythm_slave_metro.o: rhythm_slave_metro.c rhythm_estimator.h \ + rhythm_slave_metro.h + +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-pdinstallPROGRAMS install-pdinstallDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-pdinstallPROGRAMS uninstall-pdinstallDATA +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(pdinstalldir) $(DESTDIR)$(pdinstalldir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-pdinstallPROGRAMS mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-pdinstallPROGRAMS clean-compile clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-pdinstallPROGRAMS distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-pdinstallPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-pdinstallPROGRAMS distclean-pdinstallPROGRAMS \ +clean-pdinstallPROGRAMS maintainer-clean-pdinstallPROGRAMS \ +uninstall-pdinstallPROGRAMS install-pdinstallPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile uninstall-pdinstallDATA install-pdinstallDATA \ +tags mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..3f5a064 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,73 @@ +## Process this file with automake to produce Makefile.in. -*-Makefile-*- + +SUFFIXES = .pd_linux + +pddir = @PDDIR@ + +## Make and install the shared libraries. + +pdinstalldir = $(pddir)/extra/rhythm_estimator + +# Automake won't accept something ending in ".pd_linux" as a library +pdinstall_PROGRAMS = \ + rhythm_ioi_histogram.pd_linux \ + rhythm_quantum.pd_linux \ + rhythm_slave_metro.pd_linux + +rhythm_ioi_histogram_pd_linux_SOURCES = \ + pd_rhythm_estimator.c \ + pd_rhythm_estimator.h \ + pd_rhythm_ioi_histogram.c \ + pd_rhythm_ioi_histogram.h \ + rhythm_estimator.h \ + rhythm_ioi_histogram.c \ + rhythm_ioi_histogram.h + +rhythm_quantum_pd_linux_SOURCES = \ + pd_rhythm_estimator.c \ + pd_rhythm_estimator.h \ + pd_rhythm_quantum.c \ + pd_rhythm_quantum.h \ + rhythm_estimator.h \ + rhythm_quantum.c \ + rhythm_quantum.h + +rhythm_slave_metro_pd_linux_SOURCES = \ + pd_rhythm_estimator.c \ + pd_rhythm_estimator.h \ + pd_rhythm_slave_metro.c \ + pd_rhythm_slave_metro.h \ + rhythm_estimator.h \ + rhythm_slave_metro.c \ + rhythm_slave_metro.h + +pdincludedir = $(pddir)/src +INCLUDES = -I$(top_srcdir) -I$(pdincludedir) +CFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \ + -Wall -W -Wshadow -Wstrict-prototypes -Werror \ + -Wno-unused -Wno-parentheses -Wno-switch +LDFLAGS = -export_dynamic -shared + +## Install the documentation. + +pdinstall_DATA = \ + AUTHORS \ + COPYING \ + NEWS \ + README \ + TODO \ + bang-eater.pd \ + cama99.ps \ + click1.wav \ + click2.wav \ + drumboy~.pd \ + drunk-metro.pd \ + ping~.pd \ + rhythm_estimator.pd \ + rhythm_estimator_example.pd \ + rhythm_estimator_example2.pd + +## My kludge +noinst_SCRIPTS = libtoolkludge + +EXTRA_DIST = $(pdinstall_DATA) $(noinst_SCRIPTS) diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..f9c79c4 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,413 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NM = @NM@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +PDDIR = @PDDIR@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ + +SUFFIXES = .pd_linux + +pddir = @PDDIR@ + +pdinstalldir = $(pddir)/extra/rhythm_estimator + +# Automake won't accept something ending in ".pd_linux" as a library +pdinstall_PROGRAMS = rhythm_ioi_histogram.pd_linux rhythm_quantum.pd_linux rhythm_slave_metro.pd_linux + + +rhythm_ioi_histogram_pd_linux_SOURCES = pd_rhythm_estimator.c pd_rhythm_estimator.h pd_rhythm_ioi_histogram.c pd_rhythm_ioi_histogram.h rhythm_estimator.h rhythm_ioi_histogram.c rhythm_ioi_histogram.h + + +rhythm_quantum_pd_linux_SOURCES = pd_rhythm_estimator.c pd_rhythm_estimator.h pd_rhythm_quantum.c pd_rhythm_quantum.h rhythm_estimator.h rhythm_quantum.c rhythm_quantum.h + + +rhythm_slave_metro_pd_linux_SOURCES = pd_rhythm_estimator.c pd_rhythm_estimator.h pd_rhythm_slave_metro.c pd_rhythm_slave_metro.h rhythm_estimator.h rhythm_slave_metro.c rhythm_slave_metro.h + + +pdincludedir = $(pddir)/src +INCLUDES = -I$(top_srcdir) -I$(pdincludedir) +CFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch + +LDFLAGS = -export_dynamic -shared + +pdinstall_DATA = AUTHORS COPYING NEWS README TODO bang-eater.pd cama99.ps click1.wav click2.wav drumboy~.pd drunk-metro.pd ping~.pd rhythm_estimator.pd rhythm_estimator_example.pd rhythm_estimator_example2.pd + + +noinst_SCRIPTS = libtoolkludge + +EXTRA_DIST = $(pdinstall_DATA) $(noinst_SCRIPTS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = version.h +PROGRAMS = $(pdinstall_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LIBS = @LIBS@ +rhythm_ioi_histogram_pd_linux_OBJECTS = pd_rhythm_estimator.o \ +pd_rhythm_ioi_histogram.o rhythm_ioi_histogram.o +rhythm_ioi_histogram_pd_linux_LDADD = $(LDADD) +rhythm_ioi_histogram_pd_linux_DEPENDENCIES = +rhythm_ioi_histogram_pd_linux_LDFLAGS = +rhythm_quantum_pd_linux_OBJECTS = pd_rhythm_estimator.o \ +pd_rhythm_quantum.o rhythm_quantum.o +rhythm_quantum_pd_linux_LDADD = $(LDADD) +rhythm_quantum_pd_linux_DEPENDENCIES = +rhythm_quantum_pd_linux_LDFLAGS = +rhythm_slave_metro_pd_linux_OBJECTS = pd_rhythm_estimator.o \ +pd_rhythm_slave_metro.o rhythm_slave_metro.o +rhythm_slave_metro_pd_linux_LDADD = $(LDADD) +rhythm_slave_metro_pd_linux_DEPENDENCIES = +rhythm_slave_metro_pd_linux_LDFLAGS = +SCRIPTS = $(noinst_SCRIPTS) + +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(pdinstall_DATA) + +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +Makefile.in NEWS TODO aclocal.m4 config.guess config.sub configure \ +configure.in install-sh missing mkinstalldirs version.h.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(rhythm_ioi_histogram_pd_linux_SOURCES) $(rhythm_quantum_pd_linux_SOURCES) $(rhythm_slave_metro_pd_linux_SOURCES) +OBJECTS = $(rhythm_ioi_histogram_pd_linux_OBJECTS) $(rhythm_quantum_pd_linux_OBJECTS) $(rhythm_slave_metro_pd_linux_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .pd_linux .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) +version.h: $(top_builddir)/config.status version.h.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +mostlyclean-pdinstallPROGRAMS: + +clean-pdinstallPROGRAMS: + -test -z "$(pdinstall_PROGRAMS)" || rm -f $(pdinstall_PROGRAMS) + +distclean-pdinstallPROGRAMS: + +maintainer-clean-pdinstallPROGRAMS: + +install-pdinstallPROGRAMS: $(pdinstall_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pdinstalldir) + @list='$(pdinstall_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pdinstalldir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pdinstalldir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-pdinstallPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(pdinstall_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pdinstalldir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +rhythm_ioi_histogram.pd_linux: $(rhythm_ioi_histogram_pd_linux_OBJECTS) $(rhythm_ioi_histogram_pd_linux_DEPENDENCIES) + @rm -f rhythm_ioi_histogram.pd_linux + $(LINK) $(rhythm_ioi_histogram_pd_linux_LDFLAGS) $(rhythm_ioi_histogram_pd_linux_OBJECTS) $(rhythm_ioi_histogram_pd_linux_LDADD) $(LIBS) + +rhythm_quantum.pd_linux: $(rhythm_quantum_pd_linux_OBJECTS) $(rhythm_quantum_pd_linux_DEPENDENCIES) + @rm -f rhythm_quantum.pd_linux + $(LINK) $(rhythm_quantum_pd_linux_LDFLAGS) $(rhythm_quantum_pd_linux_OBJECTS) $(rhythm_quantum_pd_linux_LDADD) $(LIBS) + +rhythm_slave_metro.pd_linux: $(rhythm_slave_metro_pd_linux_OBJECTS) $(rhythm_slave_metro_pd_linux_DEPENDENCIES) + @rm -f rhythm_slave_metro.pd_linux + $(LINK) $(rhythm_slave_metro_pd_linux_LDFLAGS) $(rhythm_slave_metro_pd_linux_OBJECTS) $(rhythm_slave_metro_pd_linux_LDADD) $(LIBS) + +install-pdinstallDATA: $(pdinstall_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pdinstalldir) + @list='$(pdinstall_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pdinstalldir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pdinstalldir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pdinstalldir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(pdinstalldir)/$$p; \ + fi; fi; \ + done + +uninstall-pdinstallDATA: + @$(NORMAL_UNINSTALL) + list='$(pdinstall_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pdinstalldir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +pd_rhythm_estimator.o: pd_rhythm_estimator.c +pd_rhythm_ioi_histogram.o: pd_rhythm_ioi_histogram.c \ + pd_rhythm_estimator.h pd_rhythm_ioi_histogram.h \ + rhythm_ioi_histogram.h rhythm_estimator.h +pd_rhythm_quantum.o: pd_rhythm_quantum.c pd_rhythm_estimator.h \ + pd_rhythm_quantum.h rhythm_quantum.h rhythm_estimator.h +pd_rhythm_slave_metro.o: pd_rhythm_slave_metro.c pd_rhythm_estimator.h \ + rhythm_estimator.h pd_rhythm_slave_metro.h rhythm_slave_metro.h +rhythm_ioi_histogram.o: rhythm_ioi_histogram.c rhythm_ioi_histogram.h \ + rhythm_estimator.h +rhythm_quantum.o: rhythm_quantum.c rhythm_quantum.h rhythm_estimator.h +rhythm_slave_metro.o: rhythm_slave_metro.c rhythm_estimator.h \ + rhythm_slave_metro.h + +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-pdinstallPROGRAMS install-pdinstallDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-pdinstallPROGRAMS uninstall-pdinstallDATA +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(pdinstalldir) $(DESTDIR)$(pdinstalldir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-pdinstallPROGRAMS mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-pdinstallPROGRAMS clean-compile clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-pdinstallPROGRAMS distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-pdinstallPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-pdinstallPROGRAMS distclean-pdinstallPROGRAMS \ +clean-pdinstallPROGRAMS maintainer-clean-pdinstallPROGRAMS \ +uninstall-pdinstallPROGRAMS install-pdinstallPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile uninstall-pdinstallDATA install-pdinstallDATA \ +tags mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..b75e3c0 --- /dev/null +++ b/NEWS @@ -0,0 +1,5 @@ +Rhythm estimator NEWS --- history of changes. + +Overview of changes in version 0.1, released June 22 2000 +========================================================= +* Initial release diff --git a/README b/README new file mode 100644 index 0000000..4fc7438 --- /dev/null +++ b/README @@ -0,0 +1,91 @@ +Rhythm estimator for Pd +======================= + +This is a collection of Pd objects for doing rhythm (quantum) +estimation. + +This text corresponds to release 0.1 of rhythm_estimator as of 22 +June, 2000. This release of rhythm_estimator has been tested with Pd +0.30. + +Rhythm_estimator is distributed under the GNU General Public License. + +Contents +-------- + +The package consists of the following Pd objects: +* "rhythm_estimator.pd" - Pd patch implementing the algorithm +* "rhythm_estimator_example.pd" - an example usage of rhythm_estimator +* "rhythm_ioi_histogram.pd_linux", "rhythm_quantum.pd_linux" and + "rhythm_slave_metro.pd_linux" - Pd externs implementing parts of the + algorithm +* "bang-eater.pd", "drumboy~.pd", "drunk-metro.pd" and "ping~.pd" + - subpatches used in the rhythm_estimator_example patch + +Installation +------------ + +The pd libraries and the rhythm_estimator subpatches are all installed +in the extras/rhythm_estimator subdirectory in the Pd directory tree. +The installation is carried out with the "configure", "make" and "make +install" commands as usual. If "configure" doesn't find the Pd +installed on your system, you can select it by hand by giving +"configure" the option "--with-pddir=YOUR_PD_DIRECTORY", for example +"--with-pddir=/home/pd/pd-0.30". See INSTALL for more precise usage +information. + +Operation +--------- + +The rhythm_estimator patch accepts bangs, which represent sound onset +events, and produces a metrical grid, a "metronome" of the shortest +time pulse present in the onset stream. The onsets are taken in the +first inlet and the metrical grid is sent in the first outlet. + +Rhythm_estimator consists of 3 subobjects, which are implemented in +C. The subobjects are rhythm_ioi_histogram, rhythm_quantum and +rhythm_slave_metro. + +The rhythm_ioi_histogram object generates a histogram from the +inter-onset intervals (IOI's) of the incoming onset stream. The +histogram is saved in a Pd array, represented with the "table" +object. Rhythm_ioi_histogram sends a bang on every onset, which +causes the histogram content to change. + +The rhythm_quantum object accepts the histogram generated by +rhythm_ioi_histogram and attempts to find the most prominent quantum +(quantization step) period from the IOI's. Rhythm_quantum accepts +also bangs from rhythm_ioi_histogram, which tell when to recompute the +quantum. + +The last object in rhythm_estimator, the rhythm_slave_metro, accepts +the original onset stream and the estimated quantum duration from +rhythm_quantum. It produces a stream of bangs with an average period +specified by the quantum duration, but which is synchronized to the +incoming onsets. + +The algorithm operation is discussed in more detail in the supplied +"cama99.ps" technical paper. The paper can also be downloaded from +the algorithm home page, with the link as given below. + +Parameters +---------- + +There are numerous parameters for the algorithm, all of which can be +changed with the "set" message to the second inlet of +"rhythm_estimator". The second inlet accepts also a "print" message, +which then prints all parameter values. See the +"rhythm_estimator_example" patch and the source code for parameter +details. + +The second outlet of "rhythm_estimator" sends out the quantum duration +in milliseconds during the estimation process. + +Links +----- + +For more information about the rhythm estimator algorithm, see +http://www.cs.tut.fi/sgn/arg/music/jams/. For more information about +Pd, see http://iem.mhsg.ac.at/pd/. + +Jarno Seppänen and Piotr Majdak diff --git a/TODO b/TODO new file mode 100644 index 0000000..1a4f699 --- /dev/null +++ b/TODO @@ -0,0 +1,20 @@ +TODO for rhythm_estimator 0.2: + +* compute histogram array (table) size in rhythm_ioi_histogram based + on the parameters ioi_resolution etc. instead of having it hardcoded + in rhythm_estimator.pd + +* have rhythm_slave_metro accept messages "start", "stop" and "auto" + in order to turn the metronome output on/off. The "auto" mode would + turn off automatically after no input in eg. 10 seconds of time; the + time could be chosen in the "auto" message itself + +* debug rhythm_slave_metro and optimize its (default) parameter + values; the debugging would be done with writing incoming onset + times and outgoing bang times into two files and then looking at the + sequences in MATLAB + +* link all objects in one "rhythm_estimator.pd_linux" library instead + of three + +* make more examples diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..4b4bc4d --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,546 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + + +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) + +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +dnl + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], +[libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[libtool_flags="$libtool_flags --enable-win32-dll"]) +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$host" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_RESTORE]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +]) +esac +]) + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN(AC_PROG_LD, +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(ac_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$ac_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_SUBST(LD) +AC_PROG_LD_GNU +]) + +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi]) +]) + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi]) +NM="$ac_cv_path_NM" +AC_MSG_RESULT([$NM]) +AC_SUBST(NM) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN(AC_CHECK_LIBM, +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case "$host" in +*-*-beos* | *-*-cygwin*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl + diff --git a/bang-eater.pd b/bang-eater.pd new file mode 100644 index 0000000..7ba788c --- /dev/null +++ b/bang-eater.pd @@ -0,0 +1,34 @@ +#N canvas 382 213 483 334 10; +#X obj 46 18 inlet; +#X obj 193 313 outlet; +#X obj 121 153 int; +#X obj 163 152 + 1; +#X obj 121 83 loadbang; +#X obj 158 16 inlet; +#X obj 176 196 mod 4; +#X obj 318 16 inlet; +#X text 87 19 bang; +#X obj 211 234 >= 2; +#X obj 195 266 select 1; +#X text 198 17 N bangs to eat...; +#X text 356 18 ...in every M bangs; +#X floatatom 88 274; +#X msg 129 113 999; +#X obj 207 100 int; +#X obj 276 100 int; +#X obj 288 315 outlet; +#X connect 0 0 2 0; +#X connect 2 0 3 0; +#X connect 3 0 6 0; +#X connect 4 0 14 0; +#X connect 5 0 15 0; +#X connect 6 0 2 1; +#X connect 6 0 9 0; +#X connect 6 0 13 0; +#X connect 7 0 16 0; +#X connect 9 0 10 0; +#X connect 10 0 1 0; +#X connect 10 1 17 0; +#X connect 14 0 2 1; +#X connect 15 0 9 1; +#X connect 16 0 6 1; diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..4e5345f --- /dev/null +++ b/config.guess @@ -0,0 +1,973 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + ${CC-cc} $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c + int main (argc, argv) int argc; char **argv; { + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + ${CC-cc} $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + sed 's/^ //' << EOF >$dummy.c + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*T3E:*:*:*) + echo t3e-cray-unicosmk${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. + ld_help_string=`ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <$dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + ${CC-cc} $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +main(argc, argv) + int argc; + char *argv[]; +{ +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:UnixWare:*:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + fi + echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/config.sub b/config.sub new file mode 100644 index 0000000..da8b7ae --- /dev/null +++ b/config.sub @@ -0,0 +1,956 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | v850) + basic_machine=$basic_machine-unknown + ;; + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + np1) + basic_machine=np1-gould + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | k6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \ + | -openstep*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -xenix) + os=-xenix + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -hpux*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os diff --git a/configure b/configure new file mode 100755 index 0000000..b696e25 --- /dev/null +++ b/configure @@ -0,0 +1,1900 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" +ac_help="$ac_help + --with-pddir=... enter absolute path to Pd (PDPREFIX/lib/pd by default)" +ac_help="$ac_help + --with-gnu-ld assume the C compiler uses GNU ld [default=no]" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=rhythm_quantum.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:563: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:616: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:673: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=rhythm_estimator + +VERSION=0.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:719: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:732: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:745: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:758: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:771: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:791: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:812: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# I don't use libtool. This is only a hack because automake wants +# libtool, and only for installation... Works for automake 1.4, BTW. +LIBTOOL="\$(SHELL) \$(top_builddir)/libtoolkludge" + + +if test "x$prefix" = xNONE; then +echo $ac_n "checking for prefix by $ac_c" 1>&6 +# Extract the first word of "pd", so it can be a program name with args. +set dummy pd; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:845: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PD" in + /*) + ac_cv_path_PD="$PD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PD="$PD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +PD="$ac_cv_path_PD" +if test -n "$PD"; then + echo "$ac_t""$PD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -n "$ac_cv_path_PD"; then + prefix=`echo $ac_cv_path_PD|sed 's%/[^/][^/]*//*[^/][^/]*$%%'` + fi +fi + +PDDIR=$prefix/lib/pd +# Check whether --with-pddir or --without-pddir was given. +if test "${with_pddir+set}" = set; then + withval="$with_pddir" + if expr x"$withval" : "x/" >/dev/null; then + PDDIR=$withval + echo "$ac_t""Installing Pd files in $PDDIR." 1>&6 + else + { echo "configure: error: Illegal value given to --with-pddir. Give an absolute path." 1>&2; exit 1; } + fi + +fi + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:901: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:931: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:982: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1014: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1025 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1056: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1061: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1089: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1121: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 +echo "configure:1150: checking for ld used by GCC" >&5 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 +echo "configure:1174: checking for GNU ld" >&5 +else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 +echo "configure:1177: checking for non-GNU ld" >&5 +fi +if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$ac_cv_path_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } + +echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 +echo "configure:1213: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1240: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking for printf in -lc""... $ac_c" 1>&6 +echo "configure:1294: checking for printf in -lc" >&5 +ac_lib_var=`echo c'_'printf | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo c | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 +echo "configure:1341: checking for sin in -lm" >&5 +ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1389: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1469: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +for ac_hdr in string.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1576: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile version.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@LIBTOOL@%$LIBTOOL%g +s%@PD@%$PD%g +s%@PDDIR@%$PDDIR%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@LD@%$LD%g +s%@CPP@%$CPP%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..67af2c7 --- /dev/null +++ b/configure.in @@ -0,0 +1,48 @@ +dnl Process this file with autoconf to produce a configure script. + +dnl Initialize autoconf and automake. Version number here! +AC_INIT(rhythm_quantum.c) +AM_INIT_AUTOMAKE(rhythm_estimator, 0.1) +AC_CANONICAL_HOST +AM_MAINTAINER_MODE + +# I don't use libtool. This is only a hack because automake wants +# libtool, and only for installation... Works for automake 1.4, BTW. +LIBTOOL="\$(SHELL) \$(top_builddir)/libtoolkludge" +AC_SUBST(LIBTOOL) + +dnl Look for Pd. +AC_PREFIX_PROGRAM(pd) +PDDIR=$prefix/lib/pd +AC_ARG_WITH(pddir, +[ --with-pddir=... enter absolute path to Pd (PDPREFIX/lib/pd by default)], + [if expr x"$withval" : "x/" >/dev/null; then + PDDIR=$withval + AC_MSG_RESULT(Installing Pd files in $PDDIR.) + else + AC_MSG_ERROR(Illegal value given to --with-pddir. Give an absolute path.) + fi] +) +AC_SUBST(PDDIR) + +dnl FIXME check that $PDDIR/src/m_pd.h exists! + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_LD +AC_PROG_INSTALL + +dnl Checks for libraries. +AC_CHECK_LIB(c, printf) +AC_CHECK_LIB(m, sin) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(string.h) + +dnl Checks for typedefs, structures, and compiler characteristics. + +dnl Checks for library functions. + +dnl Output the makefile and version information file. +AC_OUTPUT(Makefile version.h) diff --git a/drumboy~.pd b/drumboy~.pd new file mode 100644 index 0000000..f0d4a4b --- /dev/null +++ b/drumboy~.pd @@ -0,0 +1,37 @@ +#N canvas 123 163 576 465 10; +#X obj 319 172 soundfiler; +#X floatatom 317 204; +#X graph graph1 0 -1 2549 1 356 466 556 326; +#X array drumarray 2549 float; +#X array drumarray2 3280 float; +#X pop; +#X obj 245 10 loadbang; +#X obj 123 405 hip~ 5; +#X msg 56 73 bang; +#X obj 38 320 tabplay~ drumarray; +#X obj 177 319 tabplay~ drumarray2; +#X obj 126 370 +~; +#X obj 107 174 bang-eater; +#X msg 138 77 1; +#X msg 182 76 4; +#X obj 127 450 outlet~; +#X obj 57 15 inlet; +#X msg 264 85 read -resize click1.wav drumarray; +#X msg 304 108 read -resize click2.wav drumarray2; +#X connect 0 0 1 0; +#X connect 3 0 14 0; +#X connect 3 0 15 0; +#X connect 3 0 10 0; +#X connect 3 0 11 0; +#X connect 4 0 12 0; +#X connect 5 0 9 0; +#X connect 6 0 8 0; +#X connect 7 0 8 1; +#X connect 8 0 4 0; +#X connect 9 0 6 0; +#X connect 9 1 7 0; +#X connect 10 0 9 1; +#X connect 11 0 9 2; +#X connect 13 0 5 0; +#X connect 14 0 0 0; +#X connect 15 0 0 0; diff --git a/drunk-metro.pd b/drunk-metro.pd new file mode 100644 index 0000000..4211d48 --- /dev/null +++ b/drunk-metro.pd @@ -0,0 +1,70 @@ +#N canvas 121 130 394 592 10; +#X obj 91 291 metro 500; +#X floatatom 178 113; +#X obj 109 86 noise~; +#X obj 230 90 loadbang; +#X obj 93 176 snapshot~; +#X obj 140 255 +; +#X obj 31 314 timer; +#X floatatom 32 340; +#X floatatom 172 292; +#X obj 136 218 *; +#X obj 125 575 outlet; +#X obj 31 57 inlet; +#X obj 178 61 inlet; +#X floatatom 31 103; +#X obj 190 203 *; +#X floatatom 231 138; +#X text 152 35 interval [ms]; +#X text 6 36 start/stop (1/0); +#X text 22 8 MAKE SURE YOU HAVE AUDIO PROCESSING TURNED ON!; +#X obj 210 177 / 100; +#X text 261 140 drunk amount [%]; +#X msg 231 117 5; +#X obj 64 135 metro; +#X obj 117 527 bang-eater; +#X obj 146 326 noise~; +#X obj 131 359 snapshot~; +#X msg 242 345 4; +#X obj 256 303 loadbang; +#X obj 150 467 *; +#X obj 133 381 + 1; +#X obj 133 403 / 2; +#X floatatom 232 393; +#X floatatom 242 516; +#X obj 186 424 - 1; +#X connect 0 0 6 1; +#X connect 0 0 6 0; +#X connect 0 0 25 0; +#X connect 0 0 23 0; +#X connect 1 0 5 1; +#X connect 1 0 14 0; +#X connect 1 0 22 1; +#X connect 2 0 4 0; +#X connect 3 0 21 0; +#X connect 4 0 9 0; +#X connect 5 0 0 1; +#X connect 6 0 7 0; +#X connect 9 0 5 0; +#X connect 9 0 8 0; +#X connect 11 0 13 0; +#X connect 12 0 1 0; +#X connect 13 0 0 0; +#X connect 13 0 22 0; +#X connect 14 0 9 1; +#X connect 15 0 19 0; +#X connect 19 0 14 1; +#X connect 21 0 15 0; +#X connect 22 0 4 0; +#X connect 23 0 10 0; +#X connect 24 0 25 0; +#X connect 25 0 29 0; +#X connect 26 0 31 0; +#X connect 27 0 26 0; +#X connect 28 0 23 1; +#X connect 28 0 32 0; +#X connect 29 0 30 0; +#X connect 30 0 28 0; +#X connect 31 0 23 2; +#X connect 31 0 33 0; +#X connect 33 0 28 1; diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/libtoolkludge b/libtoolkludge new file mode 100755 index 0000000..bf62a81 --- /dev/null +++ b/libtoolkludge @@ -0,0 +1,11 @@ +#! /bin/sh + +if test \( $# -gt 1 \) -a \( $1 = "--mode=install" \); then + shift; + echo " libtoolkludge running \"$*\"" + $* + exit 0 +else + echo "Libtoolkludge is a kludge for libtool --mode=install only. Die!" >&2 + exit 1 +fi diff --git a/missing b/missing new file mode 100755 index 0000000..7789652 --- /dev/null +++ b/missing @@ -0,0 +1,190 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Franc,ois Pinard , 1996. + +# 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, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..3a9b109 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2002-11-19 11:42:03 ggeiger Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/pd_rhythm_estimator.c b/pd_rhythm_estimator.c new file mode 100644 index 0000000..409f5eb --- /dev/null +++ b/pd_rhythm_estimator.c @@ -0,0 +1,49 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_estimator.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + + +#ifndef MAXPDSTRING /* how primitive */ +#include "m_pd.h" +#endif /* MAXPDSTRING */ + + +float ParameterCheck (char* name, float value, float min, float max ) +{ + + if (value > max) + { + printf("Parameter: %s out of range [%.1f...%.1f]. Value limited.\n", name, + min, max ); + return(max); + } + + if(value < min) + { + printf("Parameter: %s out of range [%.1f...%.1f]. Value limited.\n", name, + min, max ); + return(min); + } + return(value); +} diff --git a/pd_rhythm_estimator.h b/pd_rhythm_estimator.h new file mode 100644 index 0000000..4d89be4 --- /dev/null +++ b/pd_rhythm_estimator.h @@ -0,0 +1,48 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_estimator.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __PD_RHYTHM_ESTIMATOR_H__ +#define __PD_RHYTHM_ESTIMATOR_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* compilation "flags" for debugging */ +#define RHYTHM_ESTIMATOR_DEBUG_PROFILE 0 +#define RHYTHM_ESTIMATOR_DEBUG_TEXT 0 +#define RHYTHM_ESTIMATOR_DEBUG_QUANTUM 0 +#define RHYTHM_ESTIMATOR_DEBUG_TEXT_SP 0 + + +/* Parameter strings for setting using set-method */ +#define RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR "ioi_resolution" +#define RHYTHM_ESTIMATOR_MIN_QUANTUM_STR "min_quantum" +#define RHYTHM_ESTIMATOR_MAX_QUANTUM_STR "max_quantum" + +/* Checks/limits parameter for bounds and prints warnings */ +float ParameterCheck (char* name, float value, float min, float max ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __PD_RHYTHM_ESTIMATOR_H__ */ +/* EOF */ diff --git a/pd_rhythm_ioi_histogram.c b/pd_rhythm_ioi_histogram.c new file mode 100644 index 0000000..15dadf7 --- /dev/null +++ b/pd_rhythm_ioi_histogram.c @@ -0,0 +1,351 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_ioi_histogram.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#include "m_pd.h" + +#include "pd_rhythm_estimator.h" +#include "pd_rhythm_ioi_histogram.h" +#include "rhythm_ioi_histogram.h" + + +static t_class* pd_rhythm_ioi_histogram_class = NULL; + +/* We need a reference systime value */ +static double pd_rhythm_ioi_histogram_setup_systime = 0; + +void +rhythm_ioi_histogram_setup (void) +{ + pd_rhythm_ioi_histogram_class = class_new (gensym ("rhythm_ioi_histogram"), + (t_newmethod)pd_rhythm_ioi_histogram_new, + (t_method)pd_rhythm_ioi_histogram_free, + sizeof (pd_t_rhythm_ioi_histogram), + 0, + A_DEFSYM, 0); + assert (pd_rhythm_ioi_histogram_class != NULL); + + /* Initialize setup time variable */ + pd_rhythm_ioi_histogram_setup_systime = clock_getsystime (); + + /* Set the callback for bang messages */ + class_addbang (pd_rhythm_ioi_histogram_class, pd_rhythm_ioi_histogram_bang); + /* Set the callback for float messages */ + class_addfloat (pd_rhythm_ioi_histogram_class, + pd_rhythm_ioi_histogram_float); + /* SET-Message */ + class_addmethod (pd_rhythm_ioi_histogram_class, + (t_method)pd_rhythm_ioi_histogram_set, + gensym("set"), + A_SYMBOL, A_FLOAT, 0); + /* PRINT-Message */ + class_addmethod (pd_rhythm_ioi_histogram_class, + (t_method)pd_rhythm_ioi_histogram_print, + gensym("print"), + 0); +} + +static void* +pd_rhythm_ioi_histogram_new (t_symbol* s) +{ + pd_t_rhythm_ioi_histogram* x = NULL; + + /* Allocate object struct */ + x = (pd_t_rhythm_ioi_histogram*)pd_new (pd_rhythm_ioi_histogram_class); + assert (x != NULL); + + /* Construct rhythm_ioi_histogram */ + x->rhythm_ioi_histogram = rhythm_ioi_histogram_new (); + assert (x->rhythm_ioi_histogram != NULL); + rhythm_ioi_histogram_initialize (x->rhythm_ioi_histogram); + + /* Initialize debug array */ + pd_rhythm_ioi_histogram_array_initialize (x, s); + + /* Inlet(s) already created? */ + + /* Create outlet(s) */ + + /* Bang message outlet */ + outlet_new (&x->x_obj, gensym ("bang")); + + return x; +} + +static void +pd_rhythm_ioi_histogram_free (pd_t_rhythm_ioi_histogram* x) +{ + /* precondition(s) */ + assert (x != NULL); + + pd_rhythm_ioi_histogram_array_finish (x); + + /* Destruct rhythm_ioi_histogram */ + rhythm_ioi_histogram_finish (x->rhythm_ioi_histogram); + rhythm_ioi_histogram_delete (x->rhythm_ioi_histogram); + x->rhythm_ioi_histogram = NULL; +} + +static void +pd_rhythm_ioi_histogram_bang (pd_t_rhythm_ioi_histogram* x) +{ + /* precondition(s) */ + assert (x != NULL); + + /* a "bang" message is equal to a float "0" message */ + pd_rhythm_ioi_histogram_float (x, 0); +} + +static void +pd_rhythm_ioi_histogram_float (pd_t_rhythm_ioi_histogram* x, t_floatarg f) +{ +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + double time; /* for debugging */ +#endif + + /* precondition(s) */ + assert (x != NULL); + + /* Invoke rhythm_ioi_histogram onset event */ +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + time = sys_getrealtime (); +#endif + if (rhythm_ioi_histogram_onset_event (x->rhythm_ioi_histogram, + pd_rhythm_ioi_histogram_get_time ()) + != 0) + { + /* Update our histogram array */ +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + printf("ioi_histo: B'4 write time: %f\n", (sys_getrealtime()- time)*1000.); +#endif + pd_rhythm_ioi_histogram_array_write (x, + x->rhythm_ioi_histogram->main_ioi_histogram, + x->rhythm_ioi_histogram->hist_length); + /* Send a "bang" message to the output */ +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + printf("ioi_histo: after write time: %f\n", (sys_getrealtime()- time)*1000.); +#endif + outlet_bang (x->x_obj.ob_outlet); + } +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + printf("ioi_histo: Used time: %f\n", (sys_getrealtime()- time)*1000.); +#endif +} + +static void +pd_rhythm_ioi_histogram_set (pd_t_rhythm_ioi_histogram* x, + t_symbol* s, + t_float value) +{ + + /* Format: 'parameter value' */ + + if(strlen(s->s_name)) + { + /* Check for IOI_RESOLUTION */ + if (!strncmp( s->s_name, RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR + , strlen(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR))) + { + x->rhythm_ioi_histogram->ioi_resolution = + ParameterCheck(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR, + value, + RHYTHM_ESTIMATOR_IOI_RESOLUTION_MIN, + RHYTHM_ESTIMATOR_IOI_RESOLUTION_MAX); + return; + } + else /* Check for MIN_QUANTUM */ + if (!strncmp(s->s_name, RHYTHM_ESTIMATOR_MIN_QUANTUM_STR + , strlen(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR))) + { + x->rhythm_ioi_histogram->min_quantum = + ParameterCheck(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR, + value, + RHYTHM_ESTIMATOR_MIN_QUANTUM_MIN, + RHYTHM_ESTIMATOR_MIN_QUANTUM_MAX); + return; + } + else /* Check for MAX_QUANTUM */ + if (!strncmp(s->s_name, RHYTHM_ESTIMATOR_MAX_QUANTUM_STR + , strlen(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR))) + { + x->rhythm_ioi_histogram->max_quantum = + ParameterCheck(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR, + value, + RHYTHM_ESTIMATOR_MAX_QUANTUM_MIN, + RHYTHM_ESTIMATOR_MAX_QUANTUM_MAX); + return; + } + else /* Check for HIST_HALF_LIFE */ + if (!strncmp(s->s_name,RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_STR + , strlen(RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_STR))) + { + x->rhythm_ioi_histogram->hist_half_life = + ParameterCheck(RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_STR, + value, + RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_MIN, + RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_MAX); + return; + } + else /* Check for _HIST_CYCLES */ + if (!strncmp(s->s_name, RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_STR + , strlen(RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_STR))) + { + x->rhythm_ioi_histogram->hist_cycles = + ParameterCheck(RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_STR, + value, + RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_MIN, + RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_MAX); + return; + } + } + printf("Error, use format like: 'parameter value'\n"); + printf("Valid 'parameter' for rhythm_ioi_resolution:\n "); + printf(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR); + printf("\n "); + printf(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR); + printf("\n "); + printf(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR); + printf("\n "); + printf(RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_STR); + printf("\n "); + printf(RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_STR); + printf("\n\n"); +} + +static void +pd_rhythm_ioi_histogram_print (pd_t_rhythm_ioi_histogram* x) +{ + + printf("HISTOGRAM:\n %s: %0.1f", + RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR, x->rhythm_ioi_histogram->ioi_resolution); + printf("\n "); + printf("%s: %0.1f",RHYTHM_ESTIMATOR_MIN_QUANTUM_STR, x->rhythm_ioi_histogram->min_quantum); + printf("\n "); + printf("%s: %0.1f",RHYTHM_ESTIMATOR_MAX_QUANTUM_STR, x->rhythm_ioi_histogram->max_quantum); + printf("\n "); + printf("%s: %0.1f",RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_STR, + x->rhythm_ioi_histogram->hist_half_life); + printf("\n "); + printf("%s: %0.1f",RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_STR, + x->rhythm_ioi_histogram->hist_cycles); + printf("\n\n"); +} + +static double +pd_rhythm_ioi_histogram_get_time (void) +{ + return clock_gettimesince (pd_rhythm_ioi_histogram_setup_systime); +} + +static void +pd_rhythm_ioi_histogram_array_initialize (pd_t_rhythm_ioi_histogram* x, + t_symbol* s) +{ + t_garray *a; + x->array_symbol = s; + + /* Find the array by name */ + + a = (t_garray*)pd_findbyclass (x->array_symbol, garray_class); + if (a == 0) + { + if (s->s_name != NULL) + { + pd_error(x, "rhythm_ioi_histogram: %s: no such array", + x->array_symbol->s_name); + } + x->array_vec = 0; + } + + /* Initialize array buffer length and pointer */ + + else if (!garray_getfloatarray (a, &x->array_nsampsintab, &x->array_vec)) + { + error("rhythm_ioi_histogram: %s: bad array", x->array_symbol->s_name); + x->array_vec = 0; + } + else garray_usedindsp (a); + + if (x->array_vec == NULL) + { + printf ("rhythm_ioi_histogram: array %s not given\n", x->array_symbol->s_name); + } +} + +void +pd_rhythm_ioi_histogram_array_write (pd_t_rhythm_ioi_histogram* x, float* vector, + unsigned length) +{ + t_garray *a; + + /* Find the array by name and test if we still have an array */ + + a = (t_garray*)pd_findbyclass (x->array_symbol, garray_class); + if (a == 0) + { + if (x->array_symbol->s_name != NULL) + { + pd_error(x, "rhythm_ioi_histogram: %s: no such array", + x->array_symbol->s_name); + } + x->array_vec = 0; + } + + /* Initialize array buffer length and pointer */ + + else if (!garray_getfloatarray (a, &x->array_nsampsintab, &x->array_vec)) + { + error("rhythm_ioi_histogram: %s: bad array", x->array_symbol->s_name); + x->array_vec = 0; + } + else + { + unsigned i = 0; + + garray_usedindsp (a); + + /* Copy histogram content to array */ + + if (length > x->array_nsampsintab) + { + printf ("warning: array (%d) is shorter than histogram (%d)\n", + x->array_nsampsintab, length); + length = x->array_nsampsintab; + } + for (i = 0; i < length; i++) + { + x->array_vec[i] = vector[i]; + } + + /* Redraw array on screen, if needed -- FIXME don't */ + /*garray_redraw (a);*/ + } +} + +static void +pd_rhythm_ioi_histogram_array_finish (pd_t_rhythm_ioi_histogram* x) +{ +} + +/* EOF */ diff --git a/pd_rhythm_ioi_histogram.h b/pd_rhythm_ioi_histogram.h new file mode 100644 index 0000000..4c9bc14 --- /dev/null +++ b/pd_rhythm_ioi_histogram.h @@ -0,0 +1,86 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_ioi_histogram.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __PD_RHYTHM_IOI_HISTOGRAM_H__ +#define __PD_RHYTHM_IOI_HISTOGRAM_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef MAXPDSTRING /* how primitive */ +#include "m_pd.h" +#endif /* MAXPDSTRING */ + +#include "rhythm_ioi_histogram.h" + + /* Parameter strings for setting using set-method */ +#define RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_STR "half_life" +#define RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_STR "cycles" + +typedef struct +{ + t_object x_obj; + + Rhythm_Ioi_Histogram* rhythm_ioi_histogram; + + /* Array-related variables */ + t_symbol* array_symbol; + unsigned array_nsampsintab; + float* array_vec; + +} pd_t_rhythm_ioi_histogram; + +/* Object construction and destruction */ +void rhythm_ioi_histogram_setup (void); +static void* pd_rhythm_ioi_histogram_new (t_symbol* s); +static void pd_rhythm_ioi_histogram_free (pd_t_rhythm_ioi_histogram* x); + +/* "Bang" inlet message callback */ +static void pd_rhythm_ioi_histogram_bang (pd_t_rhythm_ioi_histogram* x); +/* Float inlet message callback */ +static void pd_rhythm_ioi_histogram_float (pd_t_rhythm_ioi_histogram* x, t_floatarg f); +/* Set-Message interpreter */ +static void pd_rhythm_ioi_histogram_set (pd_t_rhythm_ioi_histogram* x, + t_symbol* s, + t_float value); + /* print method */ +static void pd_rhythm_ioi_histogram_print (pd_t_rhythm_ioi_histogram* x); + + /* helper functions */ + /* access to time */ +static double pd_rhythm_ioi_histogram_get_time (void); + + /* access to an array for displaying the histogram */ +static void pd_rhythm_ioi_histogram_array_initialize (pd_t_rhythm_ioi_histogram* x, + t_symbol* s); +static void pd_rhythm_ioi_histogram_array_write (pd_t_rhythm_ioi_histogram* x, + float* vector, + unsigned length); +static void pd_rhythm_ioi_histogram_array_finish (pd_t_rhythm_ioi_histogram* x); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __PD_RHYTHM_IOI_HISTOGRAM_H__ */ +/* EOF */ + diff --git a/pd_rhythm_quantum.c b/pd_rhythm_quantum.c new file mode 100644 index 0000000..28cdfe3 --- /dev/null +++ b/pd_rhythm_quantum.c @@ -0,0 +1,291 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_quantum.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#include "m_pd.h" + +#include "pd_rhythm_estimator.h" +#include "pd_rhythm_quantum.h" +#include "rhythm_quantum.h" + +static t_class* pd_rhythm_quantum_class = NULL; + +void +rhythm_quantum_setup (void) +{ + pd_rhythm_quantum_class = class_new (gensym ("rhythm_quantum"), + (t_newmethod)pd_rhythm_quantum_new, + (t_method)pd_rhythm_quantum_free, + sizeof (pd_t_rhythm_quantum), + 0, + A_DEFSYM, 0); + assert (pd_rhythm_quantum_class != NULL); + + /* Set the callback for bang messages */ + class_addbang (pd_rhythm_quantum_class, pd_rhythm_quantum_bang); + + /* SET-Message */ + class_addmethod(pd_rhythm_quantum_class, + (t_method)pd_rhythm_quantum_set, + gensym("set"), + A_SYMBOL, A_FLOAT, 0); + /* PRINT-Message */ + class_addmethod(pd_rhythm_quantum_class, + (t_method)pd_rhythm_quantum_print, + gensym("print"), + 0); +} + +static void* +pd_rhythm_quantum_new (t_symbol* s) +{ + pd_t_rhythm_quantum* x = NULL; + + /* Allocate object struct */ + x = (pd_t_rhythm_quantum*)pd_new (pd_rhythm_quantum_class); + assert (x != NULL); + + /* Construct rhythm_quantum */ + x->rhythm_quantum = rhythm_quantum_new (); + assert (x->rhythm_quantum != NULL); + rhythm_quantum_initialize (x->rhythm_quantum); + + /* Initialize debug array */ + pd_rhythm_quantum_array_initialize (x, s); + + /* Create outlet(s) */ + + /* Bang message outlet */ + outlet_new (&x->x_obj, gensym ("float")); + + return x; +} + +static void +pd_rhythm_quantum_free (pd_t_rhythm_quantum* x) +{ + /* precondition(s) */ + assert (x != NULL); + + pd_rhythm_quantum_array_finish (x); + + /* Destruct rhythm_quantum */ + rhythm_quantum_finish (x->rhythm_quantum); + rhythm_quantum_delete (x->rhythm_quantum); + x->rhythm_quantum = NULL; +} + +static void +pd_rhythm_quantum_bang (pd_t_rhythm_quantum* x) +{ + float *vector; + unsigned len; + unsigned i; +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + double time; +#endif + + /* precondition(s) */ + assert (x != NULL); + + /* Invoke rhythm_quantum onset event */ + + pd_rhythm_quantum_array_read(x, &vector, &len); +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + time = sys_getrealtime(); +#endif + outlet_float(x->x_obj.ob_outlet, + rhythm_quantum_compute_quantum (x->rhythm_quantum, vector, len)); + +#if RHYTHM_ESTIMATOR_DEBUG_PROFILE + printf("quantum: Used time: %f\n", (sys_getrealtime()- time)*1000.); +#endif + + /* FIXME - Only for debugging: copy error function to histogram array */ +#if RHYTHM_ESTIMATOR_DEBUG_QUANTUM + for(i=0; irhythm_quantum->gcd_re_length; i++) + vector[i]=x->rhythm_quantum->gcd_remainder_error[i]; + garray_redraw ((t_garray*)pd_findbyclass (x->array_symbol, garray_class)); +#endif +} + +static void +pd_rhythm_quantum_set (pd_t_rhythm_quantum* x, + t_symbol* s, + t_float value) +{ + + /* Format: s value */ + + if(strlen(s->s_name)) + { + /* Check for IOI_RESOLUTION */ + if (!strncmp( s->s_name, RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR + , strlen(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR))) + { + /* rhythm_ioi_quantum_set_ioi_resolution(x, value);*/ + x->rhythm_quantum->ioi_resolution = + ParameterCheck(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR, + value, + RHYTHM_ESTIMATOR_IOI_RESOLUTION_MIN, + RHYTHM_ESTIMATOR_IOI_RESOLUTION_MAX); + return; + } + else /* Check for MIN_QUANTUM */ + if (!strncmp(s->s_name, RHYTHM_ESTIMATOR_MIN_QUANTUM_STR + , strlen(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR))) + { + x->rhythm_quantum->min_quantum = + ParameterCheck(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR, + value, + RHYTHM_ESTIMATOR_MIN_QUANTUM_MIN, + RHYTHM_ESTIMATOR_MIN_QUANTUM_MAX); + return; + } + else /* Check for MAX_QUANTUM */ + if (!strncmp(s->s_name, RHYTHM_ESTIMATOR_MAX_QUANTUM_STR + , strlen(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR))) + { + x->rhythm_quantum->max_quantum = + ParameterCheck(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR, + value, + RHYTHM_ESTIMATOR_MAX_QUANTUM_MIN, + RHYTHM_ESTIMATOR_MAX_QUANTUM_MAX); + return; + } + else /* Check for GCD_PERC */ + if (!strncmp(s->s_name,RHYTHM_QUANTUM_GCD_PERC_STR + , strlen(RHYTHM_QUANTUM_GCD_PERC_STR))) + { + x->rhythm_quantum->gcd_perc = + ParameterCheck(RHYTHM_QUANTUM_GCD_PERC_STR, + value, + RHYTHM_QUANTUM_GCD_PERC_MIN, + RHYTHM_QUANTUM_GCD_PERC_MAX); + return; + } + } + printf("Error, use format like: 'parameter value'\n"); + printf("Valid 'parameter' for rhythm_quantum:\n "); + printf(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR); + printf("\n "); + printf(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR); + printf("\n "); + printf(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR); + printf("\n "); + printf(RHYTHM_QUANTUM_GCD_PERC_STR); + printf("\n\n"); +} + +static void +pd_rhythm_quantum_print (pd_t_rhythm_quantum* x) +{ + + printf("QUANTUM-Paramater:\n %s: %0.1f", + RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR, x->rhythm_quantum->ioi_resolution); + printf("\n "); + printf("%s: %0.1f",RHYTHM_ESTIMATOR_MIN_QUANTUM_STR, x->rhythm_quantum->min_quantum); + printf("\n "); + printf("%s: %0.1f",RHYTHM_ESTIMATOR_MAX_QUANTUM_STR, x->rhythm_quantum->max_quantum); + printf("\n "); + printf("%s: %0.1f",RHYTHM_QUANTUM_GCD_PERC_STR, + x->rhythm_quantum->gcd_perc); + printf("\n\n"); +} + +static void +pd_rhythm_quantum_array_initialize (pd_t_rhythm_quantum* x, + t_symbol* s) +{ + t_garray *a; + x->array_symbol = s; + + /* Find the array by name */ + + a = (t_garray*)pd_findbyclass (x->array_symbol, garray_class); + if (a == 0) + { + if (s->s_name != NULL) + { + pd_error(x, "rhythm_quantum: %s: no such array", + x->array_symbol->s_name); + } + x->array_vec = 0; + } + + /* Get array buffer length and pointer */ + + else if (!garray_getfloatarray (a, &x->array_nsampsintab, &x->array_vec)) + { + error("rhythm_quantum: %s: bad array", x->array_symbol->s_name); + x->array_vec = 0; + } + else garray_usedindsp (a); + + if (x->array_vec == NULL) + { + printf ("rhythm_quantum: array %s not given\n", x->array_symbol->s_name); + } +} + +static void +pd_rhythm_quantum_array_read (pd_t_rhythm_quantum* x, float** vector, + unsigned* length) +{ + t_garray *a; + + /* Find the array by name and test if we still have an array */ + + a = (t_garray*)pd_findbyclass (x->array_symbol, garray_class); + if (a == 0) + { + if (x->array_symbol->s_name != NULL) + { + pd_error(x, "rhythm_quantum: %s: no such array", + x->array_symbol->s_name); + } + x->array_vec = 0; + } + + /* Initialize array buffer length and pointer */ + + else if (!garray_getfloatarray (a, &x->array_nsampsintab, &x->array_vec)) + { + error("rhythm_quantum: %s: bad array", x->array_symbol->s_name); + x->array_vec = 0; + } + else + { + garray_usedindsp (a); + *vector = x->array_vec; + *length = x->array_nsampsintab; + } +} + +static void +pd_rhythm_quantum_array_finish (pd_t_rhythm_quantum* x) +{ +} + +/* EOF */ diff --git a/pd_rhythm_quantum.h b/pd_rhythm_quantum.h new file mode 100644 index 0000000..fa573c0 --- /dev/null +++ b/pd_rhythm_quantum.h @@ -0,0 +1,80 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_quantum.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __PD_RHYTHM_QUANTUM_H__ +#define __PD_RHYTHM_QUANTUM_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef MAXPDSTRING /* how primitive */ +#include "m_pd.h" +#endif /* MAXPDSTRING */ + +#include "rhythm_quantum.h" + + /* Parameter string for setting using set-method */ +#define RHYTHM_QUANTUM_GCD_PERC_STR "gcd_perc" + + +typedef struct +{ + t_object x_obj; + + Rhythm_Quantum* rhythm_quantum; + + /* Array-related variables */ + t_symbol* array_symbol; + int array_nsampsintab; + float* array_vec; + +} pd_t_rhythm_quantum; + +/* Object construction and destruction */ +void rhythm_quantum_setup (void); +static void* pd_rhythm_quantum_new (t_symbol* s); +static void pd_rhythm_quantum_free (pd_t_rhythm_quantum* x); + +/* "Bang" inlet message callback */ +static void pd_rhythm_quantum_bang (pd_t_rhythm_quantum* x); +static void pd_rhythm_quantum_set (pd_t_rhythm_quantum* x, + t_symbol* s, + t_float value); +static void pd_rhythm_quantum_print (pd_t_rhythm_quantum* x); + + /* helper functions */ + /* access to an array for reading the histogram */ +static void pd_rhythm_quantum_array_initialize (pd_t_rhythm_quantum* x, + t_symbol* s); +static void pd_rhythm_quantum_array_read (pd_t_rhythm_quantum* x, + float** vector, + unsigned* length); +static void pd_rhythm_quantum_array_finish (pd_t_rhythm_quantum* x); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __PD_RHYTHM_QUANTUM_H__ */ +/* EOF */ + diff --git a/pd_rhythm_slave_metro.c b/pd_rhythm_slave_metro.c new file mode 100644 index 0000000..1abb2ca --- /dev/null +++ b/pd_rhythm_slave_metro.c @@ -0,0 +1,258 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_slave_metro.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#ifndef MAXPDSTRING /* how primitive */ +#include "m_pd.h" +#endif /* MAXPDSTRING */ + +#include "pd_rhythm_estimator.h" +#include "rhythm_estimator.h" +#include "pd_rhythm_slave_metro.h" +#include "rhythm_slave_metro.h" + +static t_class* pd_rhythm_slave_metro_class = NULL; + +/* We need a reference systime value */ +static double pd_rhythm_slave_metro_setup_systime = 0; + + +void +rhythm_slave_metro_setup (void) +{ + pd_rhythm_slave_metro_class = class_new (gensym ("rhythm_slave_metro"), + (t_newmethod)pd_rhythm_slave_metro_new, + (t_method)pd_rhythm_slave_metro_free, + sizeof (pd_t_rhythm_slave_metro), + 0, + 0); + assert (pd_rhythm_slave_metro_class != NULL); + + /* Initialize setup time variable */ + pd_rhythm_slave_metro_setup_systime = clock_getsystime (); + + /* Set the callback for bang messages in the first inlet */ + class_addbang (pd_rhythm_slave_metro_class, pd_rhythm_slave_metro_bang); + /* Set the callback for float messages in the first inlet */ + class_addfloat (pd_rhythm_slave_metro_class, pd_rhythm_slave_metro_float); + /* Set the callback for float messages in the second inlet */ + class_addmethod (pd_rhythm_slave_metro_class, + (t_method)pd_rhythm_slave_metro_ft1, + gensym ("ft1"), + A_FLOAT, 0); + /* SET-Message */ + class_addmethod (pd_rhythm_slave_metro_class, + (t_method)pd_rhythm_slave_metro_set, + gensym("set"), + A_SYMBOL, A_FLOAT, 0); + /* PRINT-Message */ + class_addmethod (pd_rhythm_slave_metro_class, + (t_method)pd_rhythm_slave_metro_print, + gensym("print"), + 0); +} + +static void* +pd_rhythm_slave_metro_new (t_symbol* s) +{ + pd_t_rhythm_slave_metro* x = NULL; + + /* Allocate object struct */ + x = (pd_t_rhythm_slave_metro*)pd_new (pd_rhythm_slave_metro_class); + assert (x != NULL); + + /* Construct clock */ + x->x_clock = clock_new (x, (t_method)pd_rhythm_slave_metro_tick); + assert (x->x_clock != NULL); + + /* Construct rhythm_slave_metro */ + x->rhythm_slave_metro = rhythm_slave_metro_new (); + assert (x->rhythm_slave_metro != NULL); + rhythm_slave_metro_initialize (x->rhythm_slave_metro); + + /* Create in- and outlet(s) */ + + /* Second inlet for period time */ + inlet_new (&x->x_obj, &x->x_obj.ob_pd, gensym ("float"), gensym ("ft1")); + /* Bang message outlet */ + outlet_new (&x->x_obj, gensym ("bang")); + + /* Start the periodic timer clock */ + pd_rhythm_slave_metro_ft1 (x, 500); /* initialize clock period */ + pd_rhythm_slave_metro_tick (x); /* schedule first clock tick */ + + return x; +} + +static void +pd_rhythm_slave_metro_free (pd_t_rhythm_slave_metro* x) +{ + /* precondition(s) */ + assert (x != NULL); + + /* Stop the periodic timer clock */ + clock_unset (x->x_clock); + + /* Destruct rhythm_slave_metro */ + rhythm_slave_metro_finish (x->rhythm_slave_metro); + rhythm_slave_metro_delete (x->rhythm_slave_metro); + x->rhythm_slave_metro = NULL; + + /* Destruct clock */ + clock_free (x->x_clock); + x->x_clock = NULL; +} + +static void +pd_rhythm_slave_metro_bang (pd_t_rhythm_slave_metro* x) +{ + /* precondition(s) */ + assert (x != NULL); + + /* a "bang" message is equal to a float "0" message */ + pd_rhythm_slave_metro_float (x, 0); +} + +static void +pd_rhythm_slave_metro_float (pd_t_rhythm_slave_metro* x, t_floatarg f) +{ + double new_delay; + + /* precondition(s) */ + assert (x != NULL); + + /* Invoke rhythm_slave_metro onset event */ + new_delay = rhythm_slave_metro_onset_event (x->rhythm_slave_metro, + pd_rhythm_slave_metro_get_time ()); + if (new_delay) + { + /* Reschedule, i.e. cancel the old and schedule a new tick */ + clock_delay (x->x_clock, new_delay); + } +} + +static void +pd_rhythm_slave_metro_ft1 (pd_t_rhythm_slave_metro* x, t_floatarg f) +{ + /* precondition(s) */ + assert (x != NULL); + + /* update clock period */ + rhythm_slave_metro_set_period (x->rhythm_slave_metro, f); +} + +static void +pd_rhythm_slave_metro_tick (pd_t_rhythm_slave_metro* x) +{ + double new_delay; + + /* precondition(s) */ + assert (x != NULL); + + /* Invoke rhythm_slave_metro periodic event */ + new_delay = rhythm_slave_metro_periodic_event (x->rhythm_slave_metro, + pd_rhythm_slave_metro_get_time ()); + if (new_delay) + { + /* Schedule a new tick */ + clock_delay (x->x_clock, new_delay); + } + + /* Send a "bang" message to the output */ + outlet_bang (x->x_obj.ob_outlet); +} + +static void +pd_rhythm_slave_metro_set (pd_t_rhythm_slave_metro* x, + t_symbol* s, + t_float value) +{ + + /* Format: s value */ + + if(strlen(s->s_name)) + { + /* Check for IOI_RESOLUTION */ + if (!strncmp( s->s_name, RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR + , strlen(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR))) + { + /* rhythm_ioi_quantum_set_ioi_resolution(x, value);*/ + x->rhythm_slave_metro->ioi_resolution = + ParameterCheck(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR, + value, + RHYTHM_ESTIMATOR_IOI_RESOLUTION_MIN, + RHYTHM_ESTIMATOR_IOI_RESOLUTION_MAX); + return; + } + else /* Check for MIN_QUANTUM */ + if (!strncmp(s->s_name, RHYTHM_ESTIMATOR_MIN_QUANTUM_STR + , strlen(RHYTHM_ESTIMATOR_MIN_QUANTUM_STR))) + { + return; + } + else /* Check for MAX_QUANTUM */ + if (!strncmp(s->s_name, RHYTHM_ESTIMATOR_MAX_QUANTUM_STR + , strlen(RHYTHM_ESTIMATOR_MAX_QUANTUM_STR))) + { + return; + } + else /* Check for PHASE_ADAP_SPEED */ + if (!strncmp(s->s_name,RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_STR + , strlen(RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_STR))) + { + x->rhythm_slave_metro->phase_adap_speed = + ParameterCheck(RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_STR, + value, + RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_MIN, + RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_MAX); + return; + } + } + printf("Error, use format like: 'parameter value'\n"); + printf("Valid 'parameter' for slave_metro:\n "); + printf(RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR); + printf("\n "); + printf(RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_STR); + printf("\n\n"); +} + +static void +pd_rhythm_slave_metro_print (pd_t_rhythm_slave_metro* x) +{ + + printf("SLAVE_METRO-Paramater:\n %s: %0.1f", + RHYTHM_ESTIMATOR_IOI_RESOLUTION_STR, x->rhythm_slave_metro->ioi_resolution); + printf("\n "); + printf("%s: %0.1f", RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_STR, + x->rhythm_slave_metro->phase_adap_speed); + printf("\n\n"); +} + +static double +pd_rhythm_slave_metro_get_time (void) +{ + return clock_gettimesince (pd_rhythm_slave_metro_setup_systime); +} + +/* EOF */ diff --git a/pd_rhythm_slave_metro.h b/pd_rhythm_slave_metro.h new file mode 100644 index 0000000..e2045fe --- /dev/null +++ b/pd_rhythm_slave_metro.h @@ -0,0 +1,75 @@ +/* Rhythm estimation in real time -- PD wrapper + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: pd_rhythm_slave_metro.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __PD_RHYTHM_SLAVE_METRO_H__ +#define __PD_RHYTHM_SLAVE_METRO_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef MAXPDSTRING /* how primitive */ +#include "m_pd.h" +#endif /* MAXPDSTRING */ + +#include "rhythm_slave_metro.h" + +#define RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_STR "adapt_speed" + + +typedef struct +{ + t_object x_obj; + t_clock* x_clock; + + Rhythm_Slave_Metro* rhythm_slave_metro; + +} pd_t_rhythm_slave_metro; + +/* Object construction and destruction */ +void rhythm_slave_metro_setup (void); +static void* pd_rhythm_slave_metro_new (t_symbol* s); +static void pd_rhythm_slave_metro_free (pd_t_rhythm_slave_metro* x); + +/* First inlet message callback for "bang" messages */ +static void pd_rhythm_slave_metro_bang (pd_t_rhythm_slave_metro* x); +/* First inlet message callback for float messages */ +static void pd_rhythm_slave_metro_float (pd_t_rhythm_slave_metro* x, t_floatarg f); +/* Second inlet message callback for float messages */ +static void pd_rhythm_slave_metro_ft1 (pd_t_rhythm_slave_metro* x, t_floatarg f); +/* Periodic clock tick callback */ +static void pd_rhythm_slave_metro_tick (pd_t_rhythm_slave_metro* x); +static void pd_rhythm_slave_metro_set (pd_t_rhythm_slave_metro* x, + t_symbol* s, + t_float value); +static void pd_rhythm_slave_metro_print (pd_t_rhythm_slave_metro* x); + +/* Helper function for time */ +static double pd_rhythm_slave_metro_get_time (void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __PD_RHYTHM_SLAVE_METRO_H__ */ +/* EOF */ + diff --git a/ping~.pd b/ping~.pd new file mode 100644 index 0000000..98b1588 --- /dev/null +++ b/ping~.pd @@ -0,0 +1,19 @@ +#N canvas 200 222 450 292 10; +#X obj 115 43 inlet; +#X obj 152 257 outlet~; +#X obj 159 195 *~; +#X obj 208 161 line~; +#X obj 215 104 delay 10; +#X msg 218 131 0 30; +#X obj 96 146 osc~ 500; +#X obj 201 44 inlet; +#X msg 161 123 0.7 2; +#X connect 0 0 4 0; +#X connect 0 0 8 0; +#X connect 2 0 1 0; +#X connect 3 0 2 1; +#X connect 4 0 5 0; +#X connect 5 0 3 0; +#X connect 6 0 2 0; +#X connect 7 0 6 0; +#X connect 8 0 3 0; diff --git a/rhythm_estimator.h b/rhythm_estimator.h new file mode 100644 index 0000000..f25b789 --- /dev/null +++ b/rhythm_estimator.h @@ -0,0 +1,47 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_estimator.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __RHYTHM_ESTIMATOR_H__ +#define __RHYTHM_ESTIMATOR_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Parameter default values */ +#define RHYTHM_ESTIMATOR_DEFAULT_IOI_RESOLUTION 5 /* ms */ +#define RHYTHM_ESTIMATOR_DEFAULT_MIN_QUANTUM 80 /* ms */ +#define RHYTHM_ESTIMATOR_DEFAULT_MAX_QUANTUM 400 /* ms */ + +#define RHYTHM_ESTIMATOR_IOI_RESOLUTION_MIN 1 +#define RHYTHM_ESTIMATOR_MIN_QUANTUM_MIN 10 +#define RHYTHM_ESTIMATOR_MAX_QUANTUM_MIN 100 + +#define RHYTHM_ESTIMATOR_IOI_RESOLUTION_MAX 40 +#define RHYTHM_ESTIMATOR_MIN_QUANTUM_MAX 99 +#define RHYTHM_ESTIMATOR_MAX_QUANTUM_MAX 1000 + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __RHYTHM_ESTIMATOR_H__ */ +/* EOF */ diff --git a/rhythm_estimator.pd b/rhythm_estimator.pd new file mode 100644 index 0000000..f928cd1 --- /dev/null +++ b/rhythm_estimator.pd @@ -0,0 +1,43 @@ +#N canvas 249 170 627 423 10; +#X obj 414 255 loadbang; +#X floatatom 145 250; +#X obj 36 34 inlet; +#X obj 43 394 outlet; +#X obj 201 395 outlet; +#X obj 44 287 rhythm_slave_metro; +#X obj 453 300 metro 500; +#X msg 456 279 1; +#X obj 256 30 inlet; +#X obj 256 56 route histogram quantum slave_metro; +#X text 27 13 Onset bangs; +#X text 225 12 Inlet for setting parameters; +#X obj 436 367 table \$1-histogram; +#X msg 438 332 resize 320; +#X obj 72 105 rhythm_ioi_histogram \$1-histogram; +#X obj 77 181 rhythm_quantum \$1-histogram; +#X text 363 228 Initialize and refresh IOI histogram array; +#X text 254 182 Compute quantum duration from IOI histogram; +#X text 286 105 Calculate IOI histogram from incoming onset times; +#X text 161 288 Send bangs in sync with incoming onsets; +#X text 91 394 "click"; +#X text 175 252 Current quantum duration [ms]; +#X text 246 394 quantum duration; +#X connect 0 0 13 0; +#X connect 0 0 7 0; +#X connect 1 0 4 0; +#X connect 1 0 5 1; +#X connect 2 0 5 0; +#X connect 2 0 14 0; +#X connect 5 0 3 0; +#X connect 6 0 13 0; +#X connect 7 0 6 0; +#X connect 8 0 9 0; +#X connect 9 0 14 0; +#X connect 9 1 15 0; +#X connect 9 2 5 0; +#X connect 9 3 5 0; +#X connect 9 3 14 0; +#X connect 9 3 15 0; +#X connect 13 0 12 0; +#X connect 14 0 15 0; +#X connect 15 0 1 0; diff --git a/rhythm_estimator_example.pd b/rhythm_estimator_example.pd new file mode 100644 index 0000000..52de3d6 --- /dev/null +++ b/rhythm_estimator_example.pd @@ -0,0 +1,131 @@ +#N canvas 78 62 834 600 10; +#X msg 180 213 bang; +#X obj 21 103 drunk-metro; +#X msg 18 59 1; +#X msg 28 77 0; +#X floatatom 85 81; +#X obj 230 41 loadbang; +#X obj 473 40 notein; +#X obj 473 66 stripnote; +#X floatatom 473 90; +#X obj 176 116 drunk-metro; +#X msg 173 63 1; +#X msg 188 83 0; +#X floatatom 231 79; +#X obj 84 373 ping~; +#X msg 106 354 500; +#X obj 51 443 dac~; +#X msg 24 354 200; +#X obj 42 375 ping~; +#X obj 15 332 loadbang; +#X obj 78 123 delay 20; +#X msg 230 62 333; +#X floatatom 118 100; +#X msg 117 81 10; +#X obj 307 116 metro; +#X msg 301 65 1; +#X msg 310 85 0; +#X floatatom 234 374; +#X msg 84 62 301; +#X msg 422 235 set ioi_resolution \$1; +#X floatatom 421 217; +#X msg 282 258 print; +#X msg 422 273 set min_quantum \$1; +#X msg 423 311 set max_quantum \$1; +#X msg 424 372 histogram set half_life \$1; +#X msg 424 408 histogram set cycles \$1; +#X msg 425 476 quantum set gcd_perc \$1; +#X msg 427 544 slave_metro set adapt_speed \$1; +#X floatatom 423 354; +#X floatatom 423 292; +#X floatatom 352 82; +#X msg 353 64 333; +#X obj 353 43 loadbang; +#X obj 84 40 loadbang; +#X text 328 65 GO!; +#X text 195 64 GO!; +#X text 46 61 GO!; +#X text 242 242 Print all parameters; +#X floatatom 422 253; +#X floatatom 424 390; +#X floatatom 425 458; +#X floatatom 427 526; +#X text 425 199 GLOBAL Parameters; +#X text 423 340 Parameters only for histogram; +#X text 425 441 Parameter for quantum estimation; +#X text 426 509 Parameter for metronom; +#X text 455 6 Get Midi notes; +#X text 303 9 Simulation of simple; +#X text 336 19 metronom; +#X text 180 2 Simulation of; +#X text 179 13 "human"-player; +#X text 175 25 with kind of swing; +#X text 14 2 2 "Human"-players; +#X text 455 17 for estimation; +#X text 19 474 Play a "ping" for every bang; +#X text 8 24 deviation with each other; +#X text 21 13 having constant; +#X text 20 517 The rhythm_estimator object is used for estimating the underlying "quantum" pulse from an incoming stream of "onset" events.; +#X text 561 236 IOI discretization resolution; +#X text 548 275 Minimum allowable quantum duration; +#X text 548 312 Maximum allowable quantum duration; +#X text 598 373 Half life of histogram content; +#X text 577 409 Histogram length multiplier; +#X text 576 475 Quantum estimation threshold; +#X text 617 544 Slave metro phase adaptation speed; +#X obj 142 371 drumboy~; +#X text 198 394 Current quantum [ms]; +#X obj 183 303 rhythm_estimator re1; +#X connect 0 0 17 0; +#X connect 0 0 76 0; +#X connect 1 0 0 0; +#X connect 1 0 19 0; +#X connect 2 0 1 0; +#X connect 3 0 1 0; +#X connect 4 0 1 1; +#X connect 5 0 20 0; +#X connect 6 0 7 0; +#X connect 6 1 7 1; +#X connect 7 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 0 0; +#X connect 10 0 9 0; +#X connect 11 0 9 0; +#X connect 12 0 9 1; +#X connect 13 0 15 1; +#X connect 14 0 13 1; +#X connect 16 0 17 1; +#X connect 17 0 15 0; +#X connect 18 0 16 0; +#X connect 18 0 14 0; +#X connect 19 0 0 0; +#X connect 20 0 12 0; +#X connect 21 0 19 1; +#X connect 22 0 21 0; +#X connect 23 0 0 0; +#X connect 24 0 23 0; +#X connect 25 0 23 0; +#X connect 27 0 4 0; +#X connect 28 0 76 1; +#X connect 29 0 28 0; +#X connect 30 0 76 1; +#X connect 31 0 76 1; +#X connect 32 0 76 1; +#X connect 33 0 76 1; +#X connect 34 0 76 1; +#X connect 35 0 76 1; +#X connect 36 0 76 1; +#X connect 37 0 33 0; +#X connect 38 0 32 0; +#X connect 39 0 23 1; +#X connect 40 0 39 0; +#X connect 41 0 40 0; +#X connect 42 0 27 0; +#X connect 42 0 22 0; +#X connect 47 0 31 0; +#X connect 48 0 34 0; +#X connect 49 0 35 0; +#X connect 50 0 36 0; +#X connect 74 0 15 1; +#X connect 76 0 74 0; +#X connect 76 1 26 0; diff --git a/rhythm_estimator_example2.pd b/rhythm_estimator_example2.pd new file mode 100644 index 0000000..bfccc51 --- /dev/null +++ b/rhythm_estimator_example2.pd @@ -0,0 +1,19 @@ +#N canvas 333 301 450 292 10; +#X obj 134 192 pipe; +#X obj 202 164 bang-eater 1 2; +#X obj 195 70 loadbang; +#X obj 76 120 cos; +#X obj 125 151 +; +#X obj 66 57 line; +#X text 39 18 LFO; +#X obj 101 95 osc~; +#X obj 198 113 rhythm_estimator re1; +#X obj 202 202 rhythm_estimator re2; +#X connect 0 0 8 0; +#X connect 1 0 9 0; +#X connect 2 0 8 0; +#X connect 3 0 4 0; +#X connect 4 0 0 1; +#X connect 8 0 1 0; +#X connect 8 1 4 1; +#X connect 9 0 0 0; diff --git a/rhythm_ioi_histogram.c b/rhythm_ioi_histogram.c new file mode 100644 index 0000000..8d9dc76 --- /dev/null +++ b/rhythm_ioi_histogram.c @@ -0,0 +1,428 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_ioi_histogram.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#include "rhythm_ioi_histogram.h" + + +Rhythm_Ioi_Histogram* +rhythm_ioi_histogram_new (void) +{ + Rhythm_Ioi_Histogram* ge = NULL; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_ioi_histogram_new\n", stderr); +#endif + + /* Allocate memory for our data structure */ + ge = calloc (1, sizeof (Rhythm_Ioi_Histogram)); + if (ge == NULL) + { + printf ("Not enough memory."); + assert (0); + } + + /* Initialize data members */ + ge->ioi_resolution = RHYTHM_ESTIMATOR_DEFAULT_IOI_RESOLUTION; + ge->min_quantum = RHYTHM_ESTIMATOR_DEFAULT_MIN_QUANTUM; + ge->max_quantum = RHYTHM_ESTIMATOR_DEFAULT_MAX_QUANTUM; + ge->hist_cycles = RHYTHM_IOI_HISTOGRAM_DEFAULT_HIST_CYCLES; + ge->hist_half_life = RHYTHM_IOI_HISTOGRAM_DEFAULT_HIST_HALF_LIFE; + + /* Initialize onset FIFO */ + ge->fifo_length = RHYTHM_IOI_HISTOGRAM_IOI_FIFO_LENGTH; + ge->fifo_buffer = calloc (ge->fifo_length, sizeof (float)); + if (ge->fifo_buffer == NULL) + { + printf("Not enough memory."); + assert (0); + } + + /* Compute internal "helper" variables */ + assert (ge->ioi_resolution != 0); + ge->hist_length = (unsigned)(ge->hist_cycles * ge->max_quantum + / ge->ioi_resolution); + + /* Initialize filling IOI histogram */ + ge->fill_ioi_histogram = calloc (ge->hist_length, sizeof (float)); + if (ge->fill_ioi_histogram == NULL) + { + printf("Not enough memory."); + assert (0); + } + + /* Initialize main IOI histogram */ + ge->main_ioi_histogram = calloc (ge->hist_length, sizeof (float)); + if (ge->main_ioi_histogram == NULL) + { + printf("Not enough memory."); + assert (0); + } + + return ge; +} + +void +rhythm_ioi_histogram_delete (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_ioi_histogram_delete\n", stderr); +#endif + + if (rhythm_ioi_histogram->main_ioi_histogram != NULL) + { + free (rhythm_ioi_histogram->main_ioi_histogram); + rhythm_ioi_histogram->main_ioi_histogram = NULL; + } + + if (rhythm_ioi_histogram->fill_ioi_histogram != NULL) + { + free (rhythm_ioi_histogram->fill_ioi_histogram); + rhythm_ioi_histogram->fill_ioi_histogram = NULL; + } + + if (rhythm_ioi_histogram->fifo_buffer != NULL) + { + free (rhythm_ioi_histogram->fifo_buffer); + rhythm_ioi_histogram->fifo_buffer = NULL; + } + rhythm_ioi_histogram->fifo_length = 0; + rhythm_ioi_histogram->fifo_num_onsets = 0; + + if (rhythm_ioi_histogram != NULL) + { + free (rhythm_ioi_histogram); + rhythm_ioi_histogram = NULL; + } +} + +void +rhythm_ioi_histogram_initialize (Rhythm_Ioi_Histogram* ge) +{ + unsigned i = 0; + + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_ioi_histogram_initialize\n", stderr); +#endif + + /* Clear FIFO */ + ge->fifo_num_onsets = 0; + ge->fifo_current_index = 0; + + /* Clear IOI histograms */ + for (i = 0; i < ge->hist_length; i++) + { + ge->fill_ioi_histogram[i] = 0.0; + ge->main_ioi_histogram[i] = 0.0; + } + + /* Initialize histogram update time variable */ + ge->main_histogram_update_time = 0; +} + +void +rhythm_ioi_histogram_finish (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_ioi_histogram_finish\n", stderr); +#endif +} + +int +rhythm_ioi_histogram_onset_event (Rhythm_Ioi_Histogram* ge, double time) +{ + unsigned i = 0; + + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fprintf (stderr, "rhythm_ioi_histogram_onset_event: time %f ms\n", time); +#endif + + /* Compute inter-onset interval (IOI) histogram fill function */ + for (i = 0; i < ge->fifo_num_onsets; i++) + { + double ioi; + unsigned ioi_index; + + /* First, compute the exact IOI */ + + /* (a) When the FIFO is not full, the onset values are + positioned in FIFO begin from 0 to num_onsets - 1 + (b) When the FIFO is full, it doesn't matter in + which order the onsets are inspected, therefore + we loop from 0 to num_onsets - 1 (end of FIFO) */ + ioi = time - ge->fifo_buffer[i]; + + /* Then, the exact "continuous" IOI is discretized (quantized) */ + ioi_index = (unsigned)rint (ioi / ge->ioi_resolution); + + /* Next, increment the proper "fill" histogram bin by one */ + if (ioi_index < ge->hist_length) + { + ge->fill_ioi_histogram[ioi_index]++; + /* Set a flag for the periodic_event function */ + ge->fill_histogram_changed = 1; + } + } + + /* Shift onset FIFO and store new onset */ + ge->fifo_buffer[ge->fifo_current_index] = time; + ge->fifo_current_index = (ge->fifo_current_index + 1) % ge->fifo_length; + if (ge->fifo_num_onsets < ge->fifo_length) + { + ge->fifo_num_onsets++; + } + if(ge->fill_histogram_changed) + { + rhythm_ioi_histogram_periodic_event(ge, time); + ge->fill_histogram_changed = 0; + /* Update PD-array */ + return 1; + } + else + { + return 0; + } +} + +void +rhythm_ioi_histogram_periodic_event (Rhythm_Ioi_Histogram* ge, double time) +{ + unsigned i = 0; + double time_passed = 0.0; + + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fprintf (stderr, "rhythm_ioi_histogram_periodic_event: time %f ms\n", time); +#endif + + /* Get the amount of time since last histogram update */ + if (ge->main_histogram_update_time == 0) + { + /* Have the new IOI's get through to the histogram */ + time_passed = 1.0e10; + } + else + { + /* Compute time since last update */ + time_passed = time - ge->main_histogram_update_time; + } + + /* Save time for next event */ + ge->main_histogram_update_time = time; + + /* Accumulate the main IOI histogram */ + rhythm_ioi_histogram_update_ioi_histogram (ge, time_passed); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + /* Dump main IOI histogram for debugging */ + printf ("HIST: "); + for (i = 0; i < ge->hist_length; i++) + { + printf ("%f ", (double)(ge->main_ioi_histogram[i])); + } + printf ("\n.\n"); +#endif + + /* Clear fill IOI histogram */ + for (i = 0; i < ge->hist_length; i++) + { + ge->fill_ioi_histogram[i] = 0; + } +} + +static void +rhythm_ioi_histogram_update_ioi_histogram (Rhythm_Ioi_Histogram* ge, double time_passed) +{ + unsigned i = 0; + double coeff_old = 0.0; + double coeff_new = 0.0; + + /* Compute the coefficients needed for update */ + coeff_old = pow (0.5, time_passed / ge->hist_half_life); + /*coeff_new = (1 - coeff_old) / coeff_old;*/ + coeff_new = 1 - coeff_old; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + printf ("time_passed=%.2f, coeff_old=%.2f, coeff_new=%.2f\n", + time_passed, coeff_old, coeff_new); +#endif + + /* Update main_ioi_histogram now */ + for (i = 0; i < ge->hist_length; i++) + { + ge->main_ioi_histogram[i] = + coeff_old * ge->main_ioi_histogram[i] + + coeff_new * ge->fill_ioi_histogram[i]; + } +} + + +float +rhythm_ioi_histogram_get_ioi_resolution (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* get the parameter */ + return rhythm_ioi_histogram->ioi_resolution; +} + +float +rhythm_ioi_histogram_get_min_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* get the parameter */ + return rhythm_ioi_histogram->min_quantum; +} + +float +rhythm_ioi_histogram_get_max_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* get the parameter */ + return rhythm_ioi_histogram->max_quantum; +} + +float +rhythm_ioi_histogram_get_hist_cycles (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* get the parameter */ + return rhythm_ioi_histogram->hist_cycles; +} + +float +rhythm_ioi_histogram_get_hist_half_life (Rhythm_Ioi_Histogram* rhythm_ioi_histogram) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* get the parameter */ + return rhythm_ioi_histogram->hist_half_life; +} + +void +rhythm_ioi_histogram_set_ioi_resolution (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* sanity check(s) */ + if (v < 1) + { + fprintf (stderr, "ERROR rhythm_ioi_histogram: ioi_resolution must not be less than 1 ms\n"); + v = 1; + } + + /* set the parameter */ + rhythm_ioi_histogram->ioi_resolution = v; +} + +void +rhythm_ioi_histogram_set_min_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* sanity check(s) */ + if (v < 1) + { + fprintf (stderr, "ERROR rhythm_ioi_histogram: min_quantum must not be less than 1 ms\n"); + v = 1; + } + + /* set the parameter */ + rhythm_ioi_histogram->min_quantum = v; +} + +void +rhythm_ioi_histogram_set_max_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* sanity check(s) */ + if (v < 1) + { + fprintf (stderr, "ERROR rhythm_ioi_histogram: max_quantum must not be less than 1 ms\n"); + v = 1; + } + + /* set the parameter */ + rhythm_ioi_histogram->max_quantum = v; +} + +void +rhythm_ioi_histogram_set_hist_cycles (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* sanity check(s) */ + if (v <= 0) + { + fprintf (stderr, "ERROR rhythm_ioi_histogram: hist_cycles must be positive\n"); + v = 1; + } + + /* set the parameter */ + rhythm_ioi_histogram->hist_cycles = v; +} + +void +rhythm_ioi_histogram_set_hist_half_life (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v) +{ + /* precondition(s) */ + assert (rhythm_ioi_histogram != NULL); + + /* sanity check(s) */ + if (v <= 0) + { + fprintf (stderr, "ERROR rhythm_ioi_histogram: hist_half_life must be positive\n"); + v = 1; + } + + /* set the parameter */ + rhythm_ioi_histogram->hist_half_life = v; +} + + +/* EOF */ diff --git a/rhythm_ioi_histogram.h b/rhythm_ioi_histogram.h new file mode 100644 index 0000000..a6d1c98 --- /dev/null +++ b/rhythm_ioi_histogram.h @@ -0,0 +1,108 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_ioi_histogram.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __RHYTHM_IOI_HISTOGRAM_H__ +#define __RHYTHM_IOI_HISTOGRAM_H__ + +/* Global header for Rhythm Estimator */ +#include "rhythm_estimator.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Local Parameter default values */ +#define RHYTHM_IOI_HISTOGRAM_DEFAULT_HIST_HALF_LIFE 1300 /* ms */ +#define RHYTHM_IOI_HISTOGRAM_DEFAULT_HIST_CYCLES 4 + +#define RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_MIN 10 /*ms*/ +#define RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_MIN 1 + +#define RHYTHM_IOI_HISTOGRAM_HIST_HALF_LIFE_MAX 10000 /* ms*/ +#define RHYTHM_IOI_HISTOGRAM_HIST_CYCLES_MAX 16 + + + + +#define RHYTHM_IOI_HISTOGRAM_IOI_FIFO_LENGTH 500 /* onsets */ + +typedef struct +{ + /* User-changeable parameters: */ + float ioi_resolution; /* ms */ + float min_quantum; /* ms */ + float max_quantum; /* ms */ + float hist_cycles; + float hist_half_life; /* ms */ + + + /* --- Private data --- */ + + /* Internal "helper" variables */ + unsigned hist_length; + float hist_new_coef; /* Coefficient for histogram update */ + + /* Onsets are stored in the following FIFO */ + float* fifo_buffer; /* FIFO address */ + unsigned fifo_num_onsets; /* number of onsets contained in FIFO */ + unsigned fifo_length; /* FIFO length, i.e. maximum num_onsets */ + unsigned fifo_current_index; /* Ringbuffer read/write index; + points to the oldest value */ + + /* IOI histograms are stored in the following buffers */ + float* fill_ioi_histogram; /* Buffer length is given with hist_length */ + float* main_ioi_histogram; /* Buffer length is given with hist_length */ + int fill_histogram_changed; + double main_histogram_update_time; + +} Rhythm_Ioi_Histogram; + + +Rhythm_Ioi_Histogram* rhythm_ioi_histogram_new (void); +void rhythm_ioi_histogram_delete (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); + +void rhythm_ioi_histogram_initialize (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +void rhythm_ioi_histogram_finish (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); + +int rhythm_ioi_histogram_onset_event (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, double time); +void rhythm_ioi_histogram_periodic_event (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, double time); + +float rhythm_ioi_histogram_get_ioi_resolution (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +float rhythm_ioi_histogram_get_min_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +float rhythm_ioi_histogram_get_max_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +float rhythm_ioi_histogram_get_hist_cycles (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +float rhythm_ioi_histogram_get_hist_half_life (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +float rhythm_ioi_histogram_get_phase_adap_speed (Rhythm_Ioi_Histogram* rhythm_ioi_histogram); +void rhythm_ioi_histogram_set_ioi_resolution (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v); +void rhythm_ioi_histogram_set_min_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v); +void rhythm_ioi_histogram_set_max_quantum (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v); +void rhythm_ioi_histogram_set_hist_cycles (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v); +void rhythm_ioi_histogram_set_hist_half_life (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v); +void rhythm_ioi_histogram_set_phase_adap_speed (Rhythm_Ioi_Histogram* rhythm_ioi_histogram, float v); + + /* Subroutines */ +static void rhythm_ioi_histogram_update_ioi_histogram (Rhythm_Ioi_Histogram* ge, double time_passed); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __RHYTHM_IOI_HISTOGRAM_H__ */ +/* EOF */ diff --git a/rhythm_quantum.c b/rhythm_quantum.c new file mode 100644 index 0000000..d5ecd33 --- /dev/null +++ b/rhythm_quantum.c @@ -0,0 +1,269 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_quantum.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#include "rhythm_quantum.h" + + +Rhythm_Quantum* +rhythm_quantum_new (void) +{ + Rhythm_Quantum* ge = NULL; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_quantum_new\n", stderr); +#endif + + /* Allocate memory for our data structure */ + ge = calloc (1, sizeof (Rhythm_Quantum)); + if (ge == NULL) + { + printf ("Not enough memory."); + assert (0); + } + + /* Initialize data members */ + ge->gcd_perc = RHYTHM_QUANTUM_DEFAULT_GCD_PERC; + ge->max_quantum = RHYTHM_ESTIMATOR_DEFAULT_MAX_QUANTUM; + ge->min_quantum = RHYTHM_ESTIMATOR_DEFAULT_MIN_QUANTUM; + ge->ioi_resolution = RHYTHM_ESTIMATOR_DEFAULT_IOI_RESOLUTION; + + /* Compute internal "helper" variables */ + assert (ge->ioi_resolution != 0); + + /* Initialize GCD error fn */ + ge->gcd_re_length = (unsigned)ceil (ge->max_quantum / ge->ioi_resolution); +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + printf ("GCD-RE length: %d\n", (int)(ge->gcd_re_length)); +#endif + ge->gcd_remainder_error = calloc (ge->gcd_re_length, sizeof (float)); + if (ge->gcd_remainder_error == NULL) + { + printf("Not enough memory."); + assert (0); + } + + return ge; +} + +void +rhythm_quantum_delete (Rhythm_Quantum* rhythm_quantum) +{ +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_quantum_delete\n", stderr); +#endif + + if (rhythm_quantum->gcd_remainder_error != NULL) + { + free (rhythm_quantum->gcd_remainder_error); + rhythm_quantum->gcd_remainder_error = NULL; + } + + if (rhythm_quantum != NULL) + { + free (rhythm_quantum); + rhythm_quantum = NULL; + } +} + +void +rhythm_quantum_initialize (Rhythm_Quantum* ge) +{ + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_quantum_initialize\n", stderr); +#endif +} + +void +rhythm_quantum_finish (Rhythm_Quantum* rhythm_quantum) +{ + /* precondition(s) */ + assert (rhythm_quantum != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_quantum_finish\n", stderr); +#endif +} + + +float rhythm_quantum_compute_quantum(Rhythm_Quantum* ge, float *vector, unsigned len) +{ + rhythm_quantum_compute_gcd_re (ge, vector, len); + return rhythm_quantum_determine_quantum (ge); +} + +static float +rhythm_quantum_determine_quantum (Rhythm_Quantum* ge) +{ + unsigned i; + float median=0; + float min=0; + float threshold; + unsigned first_index; + unsigned min_index; + + first_index = (unsigned)rint (ge->min_quantum/ge->ioi_resolution); + /* Compute minimum value of error function (within min_quantum and */ + /* max_quantum ) */ + min = 1.0e10; + for(i = first_index; i < ge->gcd_re_length; i++) + { + if (ge->gcd_remainder_error[i] < min) + { + min = ge->gcd_remainder_error[i]; + } + } + + /* Compute median value of error function */ + if(ge->gcd_re_length-first_index == 0) + assert (0); + median = compute_median (&ge->gcd_remainder_error[first_index], + ge->gcd_re_length-first_index); +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + printf ("DEBUG min=%f, median=%f\n", (double)min, (double)median); +#endif + + /* Compute error function threshold */ + threshold = ge->gcd_perc * min + (1-ge->gcd_perc) * median; + /* Find first sample under threshold, begining from the end of the error-function */ + i = ge->gcd_re_length-1; + while (ge->gcd_remainder_error[i--] >= threshold) + ; + /* i: pointer to the first sample under the threshold */ + i++; + min = threshold; + /* Now let's find minimum of error-function within the area under threshold */ + min_index = 0; + while (ge->gcd_remainder_error[i] <= threshold) + { + if(ge->gcd_remainder_error[i] < min) + { + min = ge->gcd_remainder_error[i]; + min_index = i; + } + if (i <= first_index) + break; + i--; + } + if (i < first_index || min_index == 0) + { + printf ("warning: quantum not found\n"); + return 0; + } + + return (float)(min_index) * ge->ioi_resolution; +} + + +static void +rhythm_quantum_compute_gcd_re (Rhythm_Quantum* ge, float *histogram, unsigned hist_len) +{ + unsigned j = 0; + unsigned k = 0; + double denominator; + + denominator = 0.0; + for (k = 0; k < hist_len; k++) + { + denominator += histogram[k]; + } + + if (denominator < 1.0e-4) + { + printf ("warning: histogram mass went small\n"); + denominator = 1.0e-4; + } + + /* Quantum cannot be zero <=> 0th remainder error tap isn't used */ + assert (ge->gcd_re_length > 0); + ge->gcd_remainder_error[0] = 0; + for (j = 1; j < ge->gcd_re_length; j++) + { + double q; + double nominator; + + q = j * ge->ioi_resolution; + nominator = 0.0; + for (k = 0; k < hist_len; k++) + { + double mr; /* modified residual */ + double term; + mr = fmod (k * ge->ioi_resolution / q + 0.5, 1) - 0.5; + + mr = (fmod (k * ge->ioi_resolution + q / 2, q) - q / 2) / q; + + + term = histogram[k] * mr * mr; /* mr^2 */ + nominator += term; + } + + /* Denominator shouldn't theoretically be zero... */ + ge->gcd_remainder_error[j] = (float)(nominator / denominator); + } +} + +/* Find median with Torben's method: see + * http://www.eso.org/~ndevilla/median/ + * FIXME this is actually the very slowest method presented on the page... + */ +static float +compute_median (float* vector, unsigned length) +{ + unsigned i, less, greater, equal; + float min, max, guess, maxltguess, mingtguess; + + min = max = vector[0] ; + for (i=1 ; imax) max=vector[i]; + } + + while (1) { + guess = (min+max)/2; + less = 0; greater = 0; equal = 0; + maxltguess = min ; + mingtguess = max ; + for (i=0; imaxltguess) maxltguess = vector[i] ; + } else if (vector[i]>guess) { + greater++; + if (vector[i]greater) max = maxltguess ; + else min = mingtguess; + } + if (less >= (length+1)/2) return maxltguess; + else if (less+equal >= (length+1)/2) return guess; + else return mingtguess; +} + + +/* EOF */ diff --git a/rhythm_quantum.h b/rhythm_quantum.h new file mode 100644 index 0000000..4c8bc80 --- /dev/null +++ b/rhythm_quantum.h @@ -0,0 +1,76 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_quantum.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __RHYTHM_QUANTUM_H__ +#define __RHYTHM_QUANTUM_H__ + +#include "rhythm_estimator.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Parameter default values */ +#define RHYTHM_QUANTUM_DEFAULT_GCD_PERC 0.4 /* internal */ +#define RHYTHM_QUANTUM_GCD_PERC_MIN 0 +#define RHYTHM_QUANTUM_GCD_PERC_MAX 1 + +typedef struct +{ + /* --- Public data --- */ + + /* User-changeable parameters: */ + + /* --- Private data --- */ + + /* Internal parameters: */ + float gcd_perc; + float max_quantum; + float min_quantum; + float ioi_resolution; + + /* Internal "helper" variables */ + float* gcd_remainder_error; /* Length is below */ + unsigned gcd_re_length; /* ceil(max_quantum/ioi_resolution) */ + +} Rhythm_Quantum; + + +Rhythm_Quantum* rhythm_quantum_new (void); +void rhythm_quantum_delete (Rhythm_Quantum* rhythm_quantum); + +void rhythm_quantum_initialize (Rhythm_Quantum* rhythm_quantum); +void rhythm_quantum_finish (Rhythm_Quantum* rhythm_quantum); + + +float rhythm_quantum_compute_quantum (Rhythm_Quantum* rhythm_quantum, float *vector, unsigned len); + + /* Subroutines */ +static float rhythm_quantum_determine_quantum (Rhythm_Quantum* ge); +static void rhythm_quantum_compute_gcd_re (Rhythm_Quantum* ge, float *histogram, unsigned hist_len); + +static float compute_median (float* vector, unsigned length); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __RHYTHM_QUANTUM_H__ */ +/* EOF */ diff --git a/rhythm_slave_metro.c b/rhythm_slave_metro.c new file mode 100644 index 0000000..4d508f2 --- /dev/null +++ b/rhythm_slave_metro.c @@ -0,0 +1,287 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_slave_metro.c,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#include "rhythm_estimator.h" +#include "rhythm_slave_metro.h" + + +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#endif + +Rhythm_Slave_Metro* +rhythm_slave_metro_new (void) +{ + Rhythm_Slave_Metro* ge = NULL; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_slave_metro_new\n", stderr); +#endif + + /* Allocate memory for our data structure */ + ge = calloc (1, sizeof (Rhythm_Slave_Metro)); + if (ge == NULL) + { + printf ("Not enough memory."); + assert (0); + } + + /* Initialize data members */ + ge->phase_adap_speed = RHYTHM_SLAVE_METRO_DEFAULT_PHASE_ADAP_SPEED; + ge->ioi_resolution = RHYTHM_ESTIMATOR_DEFAULT_IOI_RESOLUTION; + + return ge; +} + +void +rhythm_slave_metro_delete (Rhythm_Slave_Metro* rhythm_slave_metro) +{ +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_slave_metro_delete\n", stderr); +#endif + + if (rhythm_slave_metro != NULL) + { + free (rhythm_slave_metro); + rhythm_slave_metro = NULL; + } +} + +void +rhythm_slave_metro_initialize (Rhythm_Slave_Metro* ge) +{ + unsigned i = 0; + + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_slave_metro_initialize\n", stderr); +#endif + + /* Initialize */ + ge->last_bang_time = 0; + ge->period = 500; + ge->dev_mean_sum_re = 0; + ge->dev_mean_sum_im = 0; + ge->dev_mean_count = 0; + ge->dev_syst = 0; + ge->dev_syst_limit = (double)ge->ioi_resolution / 2; +} + +void +rhythm_slave_metro_finish (Rhythm_Slave_Metro* rhythm_slave_metro) +{ + /* precondition(s) */ + assert (rhythm_slave_metro != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fputs ("rhythm_slave_metro_finish\n", stderr); +#endif +} + +void +rhythm_slave_metro_set_period (Rhythm_Slave_Metro* ge, + double new_period) +{ + /* precondition(s) */ + assert (ge != NULL); + + if (new_period < 1) + { + new_period = 1; + } + + if (new_period != ge->period) + { + /* systematic deviation isn't true anymore */ + ge->dev_syst = 0; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT_SP + printf ("DEBUG: dev_syst cleared\n"); +#endif + } + + ge->period = new_period; +} + +double +rhythm_slave_metro_get_period (Rhythm_Slave_Metro* ge) +{ + /* precondition(s) */ + assert (ge != NULL); + + return ge->period; +} + +double +rhythm_slave_metro_onset_event (Rhythm_Slave_Metro* ge, double time) +{ + double dev; + double dev_arg; + + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fprintf (stderr, "rhythm_slave_metro_onset_event: time %f ms\n", time); +#endif + + dev = time - ge->last_bang_time; + + /* Circular mean: accumulate exp (j * dev * 2 * pi / period) */ + dev_arg = 2 * M_PI * dev / (ge->period + ge->dev_syst); + ge->dev_mean_sum_re += cos (dev_arg); + ge->dev_mean_sum_im += sin (dev_arg); + ge->dev_mean_count++; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT_SP + printf ("onset: dev=%+04.2f ms\n", dev); +#endif + + return 0; +} + +double +rhythm_slave_metro_periodic_event (Rhythm_Slave_Metro* ge, double time) +{ + double new_delay = 0; + double dev_mean = 0; + double dev_rand = 0; + double beta = 0; + double dev_mean_goodness = 0; + + /* precondition(s) */ + assert (ge != NULL); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT + fprintf (stderr, "rhythm_slave_metro_periodic_event: time %f ms\n", time); +#endif + + if (ge->dev_mean_count) + { + double dev_mean_re = 0; + double dev_mean_im = 0; +#if 0 + double elapsed_since_bang = 0; +#endif + + /* compute circular mean of deviations */ + dev_mean_re = ge->dev_mean_sum_re / ge->dev_mean_count; + dev_mean_im = ge->dev_mean_sum_im / ge->dev_mean_count; + /* angle */ + dev_mean = (atan2 (dev_mean_im, dev_mean_re) + * (ge->period + ge->dev_syst) / (2 * M_PI)); + /* magnitude */ + dev_mean_goodness = sqrt (dev_mean_re * dev_mean_re + + dev_mean_im * dev_mean_im); + + /* mean wrapped implicitly with atan2() */ +#if 0 + elapsed_since_bang = time - ge->last_bang_time; + if (dev_mean > elapsed_since_bang / 2) + { + dev_mean -= elapsed_since_bang; + } +#endif + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT_SP + printf (" dev=%+04.2f ms (%.0f; %2.0f%%)", + dev_mean, ge->dev_mean_count, 100 * dev_mean_goodness); +#endif + + /* start accumulating a fresh new mean of deviations */ + ge->dev_mean_sum_re = 0; + ge->dev_mean_sum_im = 0; + ge->dev_mean_count = 0; + } + else + { + dev_mean = 0; + dev_mean_goodness = 0; + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT_SP + printf (" dev=%+04.2f ms (%.0f)", + (double)0, (double)0); +#endif + } + + /* systematic deviation adaptation speed coefficient */ + /*beta = (double)ge->phase_adap_speed * (double)ge->phase_adap_speed;*/ + beta = 0.3 * (double)ge->phase_adap_speed * dev_mean_goodness; + + /* compute systematic and random deviations */ + ge->dev_syst = (beta * MAX (-ge->dev_syst_limit, + MIN (ge->dev_syst_limit, dev_mean)) + + (1 - beta) * ge->dev_syst); + dev_rand = dev_mean - ge->dev_syst; + + /* compute delay until next bang, i.e. new (temporary) period */ + new_delay = (ge->period + + ge->dev_syst + + dev_mean_goodness * ge->phase_adap_speed * dev_rand); + +#if RHYTHM_ESTIMATOR_DEBUG_TEXT_SP + printf (", rdev=%+04.2f ms, sdev=%+04.2f ms, delta=%+04.1f ms, quant=%+04.1f ms\n", + dev_rand, ge->dev_syst, ge->dev_syst + dev_rand * ge->phase_adap_speed, new_delay); +#endif + + /* store this bang time */ + ge->last_bang_time = time; + + return new_delay; +} + +float +rhythm_slave_metro_get_phase_adap_speed (Rhythm_Slave_Metro* rhythm_slave_metro) +{ + /* precondition(s) */ + assert (rhythm_slave_metro != NULL); + + /* get the parameter */ + return rhythm_slave_metro->phase_adap_speed; +} + +void +rhythm_slave_metro_set_phase_adap_speed (Rhythm_Slave_Metro* rhythm_slave_metro, float v) +{ + /* precondition(s) */ + assert (rhythm_slave_metro != NULL); + + /* sanity check(s) */ + if (v <= 0) + { + fprintf (stderr, "ERROR rhythm_slave_metro: phase_adap_speed must be positive\n"); + v = 1; + } + + /* set the parameter */ + rhythm_slave_metro->phase_adap_speed = v; +} + +/* EOF */ diff --git a/rhythm_slave_metro.h b/rhythm_slave_metro.h new file mode 100644 index 0000000..78cfaf4 --- /dev/null +++ b/rhythm_slave_metro.h @@ -0,0 +1,79 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: rhythm_slave_metro.h,v 1.1 2002-11-19 11:39:55 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __RHYTHM_SLAVE_METRO_H__ +#define __RHYTHM_SLAVE_METRO_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Parameter default values */ +#define RHYTHM_SLAVE_METRO_DEFAULT_PHASE_ADAP_SPEED 0.1 +#define RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_MIN 0 +#define RHYTHM_SLAVE_METRO_PHASE_ADAP_SPEED_MAX 1 + +typedef struct +{ + /* --- Public data --- */ + + /* User-changeable parameters: */ + float phase_adap_speed; + float ioi_resolution; + + /* --- Private data --- */ + + double last_bang_time; /* [ms] */ + + double period; /* quantum [ms] */ + + double dev_mean_sum_re; /* circular mean - real part [ms] */ + double dev_mean_sum_im; /* circular mean - imaginary part [ms] */ + double dev_mean_count; + double dev_syst; /* systematic deviation (lpf) */ + double dev_syst_limit; /* syst. deviation limit */ + +} Rhythm_Slave_Metro; + + +Rhythm_Slave_Metro* rhythm_slave_metro_new (void); +void rhythm_slave_metro_delete (Rhythm_Slave_Metro* rhythm_slave_metro); + +void rhythm_slave_metro_initialize (Rhythm_Slave_Metro* rhythm_slave_metro); +void rhythm_slave_metro_finish (Rhythm_Slave_Metro* rhythm_slave_metro); + +void rhythm_slave_metro_set_period (Rhythm_Slave_Metro* rhythm_slave_metro, + double period); +double rhythm_slave_metro_get_period (Rhythm_Slave_Metro* rhythm_slave_metro); + +double rhythm_slave_metro_onset_event (Rhythm_Slave_Metro* rhythm_slave_metro, + double time); +double rhythm_slave_metro_periodic_event (Rhythm_Slave_Metro* rhythm_slave_metro, + double time); + +float rhythm_slave_metro_get_phase_adap_speed (Rhythm_Slave_Metro* rhythm_slave_metro); +void rhythm_slave_metro_set_phase_adap_speed (Rhythm_Slave_Metro* rhythm_slave_metro, float v); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __RHYTHM_SLAVE_METRO_H__ */ +/* EOF */ diff --git a/version.h b/version.h new file mode 100644 index 0000000..3abee5a --- /dev/null +++ b/version.h @@ -0,0 +1,28 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: version.h,v 1.1 2002-11-19 11:38:58 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __RHYTHM_ESTIMATOR_VERSION_H__ +#define __RHYTHM_ESTIMATOR_VERSION_H__ + +#ifndef RHYTHM_ESTIMATOR_VERSION +#define RHYTHM_ESTIMATOR_VERSION "0.1" +#endif + +#endif /* __RHYTHM_ESTIMATOR_VERSION_H__ */ diff --git a/version.h.in b/version.h.in new file mode 100644 index 0000000..88389e3 --- /dev/null +++ b/version.h.in @@ -0,0 +1,28 @@ +/* Rhythm estimation in real time + Copyright (C) 2000 Jarno Seppänen and Piotr Majdak + $Id: version.h.in,v 1.1 2002-11-19 11:42:03 ggeiger Exp $ + + This file is part of rhythm_estimator. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __RHYTHM_ESTIMATOR_VERSION_H__ +#define __RHYTHM_ESTIMATOR_VERSION_H__ + +#ifndef RHYTHM_ESTIMATOR_VERSION +#define RHYTHM_ESTIMATOR_VERSION "@VERSION@" +#endif + +#endif /* __RHYTHM_ESTIMATOR_VERSION_H__ */ -- cgit v1.2.1